how to boot up a system with a pure kernel.

发表于:2007-06-08来源:作者:点击数: 标签:
1 build root files system 1.1 mke2fs - m0 - i2000/dev/ram0 /* make ext2 file system on ram disk */ 1.2 mount /dev/ram0 foo /* mount the ramdisk */ 1.3 cd foo mkdir {bin, dev, etc, proc, sbin, lib,lib/tsl} /* make the directory under root

1 build root files system

            1.1 mke2fs m 0 i 2000 /dev/ram0                                      /* make ext2 file system on ram disk */

            1.2 mount /dev/ram0 foo                                                           /* mount the ramdisk */

            1.3 cd foo & mkdir {bin, dev, etc, proc, sbin, lib,lib/tsl}            /* make the directory under root file system */

            1.4 cp –dpR the file needed, such as ls, dmesg and so on

            1.5 ldd /bin/ls                                                                            /* check the lib used by command.*/

            1.6 cp –dpR the lib needed.

            1.7 chroot foo & run the command to check if the command can work

            1.8 umount foo

            1.9 dd if=/dev/ram0 bs=1k | gzip -9 >ramfs.gz

 

2 use grub to boot up

            2.1 cp the kernel image and ramfs.gz to the usb flash disk with grub installed

            2.2 add new entry in grub configuration file, like:

                        title mini linux

                        root (hd0,0)

                        kenerl /boot/vmlnuz……..   root=/dev/ram0 rw ramdisk_size=65536 init=/bin/bash devfs=nomount

                        initrd /ramfs.gz

 

such system is just a running kernel,  without hard disk driver and.network driver and so on.

           

           

原文转自:http://www.ltesting.net