Bering
Home
About
Developing
   Section 1
   Section 2
   Section 3
   Section 4
   Section 5
   Section 6
   Section 7

Search Web Pages




7. How-to build a Debian/slink filesystem?

First create a 150M file using the dd command:

dd if=/dev/zero of=root_fs_slink count=1 seek=150 bs=1M

Then format it as an ext2 filesystem:

mke2fs -Fq root_fs_slink

Now mount it as a loop device (that must be done by root)

mount -o loop root_fs_slink /mnt

Download the base2_1.tgz file which contains the Debian/slink base filesystem and unpack it in /mnt:

cd /mnt
tar xzvf /whatever_directory/base2_1.tgz
Important

You must be root to unpack base2_1.tgz, otherwise /dev entries won't be created.

OK. Now we need to make some tuning to make that a nice Debian/slink bootable UML filesystem:

Create the etc/fstab file with the following content:

/dev/ubd/0        /       ext2    defaults        1       1
proc            /proc   proc    defaults        0       0

Create the etc/mtab file with the following content:

/dev/ubd/0        /       ext2    rw              0       0
proc            /proc   proc    rw              0       0
/tmpfs          /tmp    tmpfs   rw,size=64M     0       0

Edit the etc/inittab and replace:

1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

with:

c1:2345:respawn:/sbin/getty 38400 ttys/1
c2:2345:respawn:/sbin/getty 38400 ttys/2
c3:2345:respawn:/sbin/getty 38400 ttys/3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

This will open 3 virtual UML consoles when booting up your Debian/slink virtual machine.

Edit the etc/securitty file and add the following entries:

console
ttys/1
ttys/2
ttys/3
Important

Do not forget to do that otherwise you won't be able to login !

Create the etc/hostname file:

echo "uml_slink" > etc/hostname

Remove some symlinks in etc/rcX.d scripts:

In rcS.d:

rm -f S05keymaps.sh S50hwclock.sh

In rc0.d and rc6.d:

rm K89pcmcia S25hwclock.sh

In rc1.d:

rm K89pcmcia

In rc2,3,4 & 5.d:

rm S11pcmcia

In etc/syslog.conf, the following four lines must be commented out:

daemon.*;mail.*;\
        news.crit;news.err;news.notice;\
        *.=debug;*.=info;\
        *.=notice;*.=warn       |/dev/xconsole

In etc/init.d/bootmisc.sh, the following two lines must be commented out:

chmod 666 /dev/tty[p-za-e][0-9a-f]
chown root:tty /dev/tty[p-za--e][0-9a-f]

Finally remove the following file:

rm sbin/unconfigured.sh

Umount /mnt and boot your uml machine:

./linuxuml ubd0=root_fs_slink

The linux log should show up in a console, and a couple of xterm should pop-up at the end. Login as root. You will then be directed to the last part of the Debian/slink installation process. Just send carriage returns to answer the questions until you are asked to define a password for root. Do so. Then define a new user if you wish and answer yes to setup the Shadow password facility. The system will then reboot. Make sure you can login and halt.

Tip

As Jeff Dike mentioned it to me, you do not need to be root to build the initial filesystem. You can create the root_fs file on your non-root hosts account, boot UML with that file as ubd1, the source data (base2_1.tgz) as ubd2, and, inside UML, mkfs it, mount it and populate it.


  • Created on 2004-03-26 13:10:28 by mhnoyes
  • Updated on 2004-05-02 12:21:19 by mhnoyes

 Printable Version


Hosted on Get LEAF Linux Embedded Appliance Framework at SourceForge.net. Fast, secure and Free Open Source software downloads, and powered by phpWebSite.