手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网站运营>建站经验>列表

利用BusyBox定制Linux Live CD

来源:互联网 作者:west263.com 时间:2008-04-16
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

If you repeat the steps above using a standard account, a lot of the files will be missing.

c. Take a look at the file "proj1/createiso". This will create a filesystem on a loop back device with the mount point "./cdrom". Copy the contents of "_install", which has already been compiled with the necessary busybox code. Once it is copied, umount "./cdrom" so that it can be compressed. This will then get copied to the staging area where "mkisofs" will create a bootable CD image. The boot loader isolinux, along with the needed config files can be found in "proj1/staging_iso_image/boot/isolinux/"

There is a bash script "createiso" that performs the above tasks.

               $ cd proj1

$ su

# ./createiso

Take a look at "createiso". This bash script creates a virtual filesystem. For details on creating a virtual filesystem reference the following article on Freshmeat [ http://freshmeat.net/articles/view/1387/ ]

COMPREHENSIVE TUTORIAL: Building Everything from Downloaded Source

You may want to keep the results of the quick install steps above in a separate directory to compare against the completion of each step below.

STEP 1: Download BusyBox

Download BusyBox (http://www.busybox.net/downloads/). These examples were created with http://www.busybox.net/downloads/busybox-1.00.tar.gz.

  $ wget http://www.busybox.net/downloads/busybox-1.00.tar.gz

$ wget http://www.busybox.net/downloads/busybox-1.00.tar.gz.sign

$ md5sum busybox-1.00.tar.gz

fa62459e098fc00b22772aaf2e75bc98  busybox-1.00.tar.gz

Next expand the files:

  $ tar -xzf busybox-1.00.tar.gz

Note if you want to verify Erik's key:

  $ wget http://codepoet.org/andersen/erik/gpg.asc

$ gpg --import gpg.asc

$ gpg --verify busybox-1.00.tar.gz.sign

Now look inside busybox-1.00.tar.gz.sign for the md5sum. Note, he has done it differently than it's done with the 2.6 kernel (reference step 9).


STEP 2: Configuring BusyBox

You may want to download my config for BusyBox and rename it to ".config". I have the needed features turned on.

My config download can be found here: http://prdownloads.sourceforge.net/souptonuts/chiricobusybox.config

  $ cd busybox-1.00

[Note you may need to select another mirror]

$ wget http://osdn.dl.sourceforge.net/sourceforge/souptonuts/chiricobusybox.config

$ cp chiricobusybox.config .config

You should take a look at the options that I have set by running "make menuconfig" or take a look at "chiricobusybox.config" directly.

  $ make menuconfig

In particular, "Support version 2.6.x Linux kernels" is checked. Under "Login/Password Management Utilities" everything is checked EXCEPT "Use internal password and group functions". Note, at this stage you do NOT want to select this option because "/etc/passwd", "/etc/shadow" and "/etc/shadow-", will be copied to the "_install/etc" directory, and used instead.

Also, "lsmod", "modprobe", "rmmod" are checked. Although not essential for the initial build, this system you are building will support networking. You may eventually want to scp in modules and load them, once you get the system running, of course. There is plenty of space for these modules.

After taking a look at ".config", run "make" and "make install", which by default will install everything under "_install".

  $ make

$ make install

During the final stages of "make install" the following message will be displayed.

  --------------------------------------------------

You will probably need to make your busybox binary

setuid root to ensure all configured applets will

work properly.

--------------------------------------------------

The next command must be executed after each "make install" to setuid root on the BusyBox binary.

  $ chmod 4755 ./_install/bin/busybox


STEP 3: Needed Directories

Several directories need to be created under "_install". Take a look at the current contents.

  $ cd _install

$ ls

bin  linuxrc  sbin  usr

Next create "dev" for "device entries", which will be populated later, "etc", "lib", "proc", "tmp", "var" and "sys" with the following commands.

  $ mkdir -p dev sys etc/init.d lib proc tmp var/lib/misc var/lock var/log var/run var/tmp

$ chmod 1777 tmp

$ chmod 1777 var/tmp


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