Mike Chirico (mchirico@users.sourceforge.net) or (mchirico@comcast.net)
Copyright (c) 2005 (GNU Free Documentation License)
Last Updated: Sun Nov 13 09:07:31 EST 2005

The latest version of this document can be found at:
http://souptonuts.sourceforge.net/cdrom.htm

Create a Custom Live Linux CD - Leveraging BusyBox and OpenSSH

These steps will show you how to create a functioning Linux system, with the latest 2.6 kernel compiled from source, and how to integrate the BusyBox utilities including the installation of DHCP. Plus, how to compile in the OpenSSH package. The system will have full ssh capabilities. The techniques for compiling and installing software can be universally applied to your own packages. So, once you understand the process, you are free to recreate your own system -- there is a lot of free space.

On system boot-up a filesystem will be created and the contents from the CD will be uncompressed and completely loaded into RAM -- the CD could be removed at this point for boot-up on a second computer. You can take over any PC assuming you have configured the kernel with the appropriate drivers and the PC can boot from a CD.


QUICK INSTALL: Confirmation that Everything Works - Before Rolling You Own


Quick step 1:

Download "cdrom_linux_boot_proj1.iso" and burn this iso on your cdrom. Next, reboot the system. This is a check to see if the current kernel has been compiled with the necessary network, video, and keyboard (USB included) drivers. If critical drivers are not recognized they can be added into the kernel.

Quick step 2:

Download the complete project environment "proj1.tar.gz." This includes everything used to build and customize "cdrom_linux_boot_proj1.iso", including the BusyBox source, libraries, and ssh. The directory "_install" contains the necessary libraries for ssh, init and tcpdump. The 2.6.11 kernel ".config" can be found in the documents directory. The staging area contains a copy of the kernel bzImage, along with the isolinux boot loader. The "proj1.tar.gz" file is about 13M, since it includes everything you need, except the kernel source, which can be downloaded from the following link:

http://www.kernel.org/pub/linux/kernel/v2.6/

Step 8 covers the configuration and installation of the latest kernel. At this stage, download the project environment "proj1.tar.gz" from the following link:

http://prdownloads.sourceforge.net/souptonuts/proj1.tar.gz

You must "tar -xzf" this file as root to get all the necessary character and block devices. Standard user accounts cannot create all the necessary block and character devices that will be needed. Try "tar -xzf" under an account without root privileges to see the differences in the files created under "_install/dev".

If you're curious about the difference between character devices and block devices, you may want to reference the Linux Journal article

http://www.linuxjournal.com/article/2890

In summary, only block devices can mount filesystems. But character devices, such as a tape drive can contain data found on a block device.

Checking the download:

a. Check the md5sum to make sure you got the full copy, then, "tar -xzf" the package.

              $ md5sum proj1.tar.gz

b. Now as root, so that you will get all "dev/" devices, execute the following command.

              [Must be done as root]

$ su -

# cd <to project directory>

# tar -xzf proj1.tar.gz

If you did the above as root, then you should have the following:

                [root@third-fl-71 _install]# ls -l dev

total 8

crw-------    1 root     root       5,   1 Feb 25 20:41 console

lrwxrwxrwx    1 root     root           11 Mar  6 09:22 core -> /proc/kcore

brw-rw-rw-    1 root     floppy     2,   0 Feb 20 17:37 fd0

brw-rw----    1 root     disk       3,   0 Mar  5 04:32 hda

brw-rw----    1 root     disk       3,   1 Mar  5 20:37 hda1

brw-rw----    1 root     disk       3,   2 Mar  5 20:38 hda2

brw-rw----    1 root     disk       3,   3 Mar  5 21:02 hda3

brw-rw----    1 root     disk       3,   4 Mar  5 21:02 hda4

drwxr-xr-x    2 root     root         4096 Mar  5 21:13 mapper

crw-rw-rw-    1 root     root       1,   3 Feb 20 17:37 null

crw-rw-rw-    1 root     tty        5,   2 Feb 26 12:54 ptmx

drwxr-xr-x    2 root     root         4096 Mar  4 05:33 pts

brw-------    1 root     disk       1,   0 Feb 20 17:37 ram0

brw-rw-rw-    1 root     disk       1,   1 Feb 20 17:37 ram1

brw-rw-rw-    1 root     disk       1,   2 Feb 20 17:37 ram2

brw-rw-rw-    1 root     disk       1,   3 Feb 20 17:37 ram3

crw-rw-rw-    1 root     root       1,   8 Feb 26 03:23 random

brw-rw----    1 root     disk       8,   0 Mar  5 04:32 sda

brw-rw----    1 root     disk       8,   1 Mar  5 04:32 sda1

brw-rw----    1 root     disk       8,   2 Mar  5 04:32 sda2

brw-rw----    1 root     disk       8,   3 Mar  5 21:02 sda3

brw-rw----    1 root     disk       8,   4 Mar  5 21:02 sda4

lrwxrwxrwx    1 root     root           15 Mar  6 09:22 stderr -> /proc/self/fd/2

lrwxrwxrwx    1 root     root           15 Mar  6 09:22 stdin -> /proc/self/fd/0

lrwxrwxrwx    1 root     root           15 Mar  6 09:22 stdout -> /proc/self/fd/1

crw-rw-rw-    1 root     root       5,   0 Feb 21 18:32 tty

crw-rw-rw-    1 root     root       4,   0 Feb 20 17:37 tty0

crw-rw-rw-    1 root     root       4,   1 Feb 20 22:38 tty1

crw-rw-rw-    1 root     root       4,   2 Feb 26 08:24 tty2

crw-rw-rw-    1 root     root       4,   3 Feb 26 08:24 tty3

crw-rw-rw-    1 root     root       4,   4 Feb 26 08:24 tty4

crw-rw-rw-    1 root     root       4,   5 Feb 26 08:24 tty5

crw-------    1 root     root       4,   6 Mar  1 19:34 tty6

crw-rw----    1 root     root       4,   7 Mar  1 14:33 tty7

crw-rw----    1 root     root       4,   8 Mar  1 14:33 tty8

crw-rw----    1 root     tty        4,   9 Mar  1 14:33 tty9

cr--r--r--    1 root     root       1,   9 Feb 26 03:23 urandom

crw-------    1 vcsa     tty        7,   0 Mar  1 14:33 vcs

crw-rw-rw-    1 root     root       1,   5 Feb 26 03:23 zero


文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!