[Netkit.users] Creating a custom root_fs
Adrian Sanchez
adrian_sas a hotmail.com
Mar 9 Ott 2007 18:34:27 CEST
Hi,
There is a man page, you can access by doing:
man netkit-filesystem
and here is a transcript documentation that Massimo gave to me (Thank you
Massimo):
--------------------- cut here --------------------------------
So, I start below with some basic instructions to build a Netkit filesystem,
commencing from the very beginning:
- Create an empty file of the desired size, which will serve as storage for
the filesystem. Preferably, use a sparse file to save disk space (this is
achieved by "seek"ing to a given location instead of actually writing
"count" many blocks - each block takes "bs" bytes). FILESYSTEM_SIZE is
expressed in MB.
dd if=/dev/zero of=netkit-fs bs=1M count=0 seek=FILESYSTEM_SIZE
- Setup a loopback device associated to netkit-fs.
losetup -f #(tells you the loopback device that will be used; take note of
it)
losetup -f netkit-fs
- Create a partition inside the image. In the following command, replace
CYL_COUNT with FILESYSTEM_SIZE*1048576/32256.
echo ",,L,*" | sfdisk -q -H 1 -S 63 -C CYL_COUNT name_of_the_loopback_device
losetup -d name_of_the_loopback_device
- Create the filesystem inside the partition.
losetup -f #(take note of the loopback device)
losetup -o 512 name_of_the_loopback_device netkit-fs
mkfs.ext2 name_of_the_loopback_device
losetup -d name_of_the_loopback_device
- Install a base system.
mount -o loop,offset=512 netkit-fs some_mount_point
debootstrap sid some_mount_point http://ftp.debian.org/debian/ #(use a
nearby mirror site)
umount some_mount_point
- Install missing packages
vstart pc1 -M 512 -m netkit-fs --append=root=98:1 -W
(inside the virtual machine) configure /etc/resolv.conf and
/etc/apt/sources.list
(inside the virtual machine) apt-get update
(inside the virtual machine) apt-get install pkg ....
(inside the virtual machine) halt
- Perform adaptations
Basically, this step consists of copying some files from an existing Netkit
filesystem to the newly created one. You can copy files directly to
netkit-fs after having mounted it as described in the "Install a base
system" step. The files to be copied include (I'm using bash wildcards):
/etc/init.d/netkit-phase?
/etc/rc2.d/S??netkit-phase?
/etc/rc6.d/S??netkit-phase?
/etc/rc0.d/S??netkit-phase?
/etc/inittab
Also, runlevel services must be tuned in order to disable needless stuff at
boot time. This step depends on the packages that have been installed.
--------------------- cut here --------------------------------
Best Regards,
Adrian Sanchez
>From: "ZioPRoTo (Saverio Proto)" <zioproto at gmail.com>
>Reply-To: Users of the Netkit Network Emulation System
><netkit.users at list.dia.uniroma3.it>
>To: netkit.users at list.dia.uniroma3.it
>Subject: [Netkit.users] Creating a custom root_fs
>Hello,
>
>I'm using successfully Netkit since a few months.
>
>I also ha successfully recompiled my own kernel and had it working on
>Netkit.
>
>Now, I'd like to create a custom root_fs based on gentoo linux.
>
>I tried already but I can't get my Netkit machine to boot, the xterm
>disappears immediately.
>
>Is there any official documentation to create your own root_fs ?
>
>thanks
>
>Saverio Proto
>_______________________________________________
>Netkit.users mailing list
>Netkit.users at list.dia.uniroma3.it
>http://list.dia.uniroma3.it/mailman/listinfo/netkit.users
_________________________________________________________________
Windows Live Spaces en Prodigy/MSN: Tu espacio en la red
http://spaces.live.com
Maggiori informazioni sulla lista
Netkit.users