Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->Linux安全 ->正文

利用BusyBox定制Linux Live CD

来源:Linux时代 作者:Mike Chirico  时间:2007-04-22 点击: [收藏] [投稿]

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


STEP 4: Device Entries

The "dev" directory needs to be populated with device entries. They can either be copied from the current system or created with the "mknod -m " command. The following will have to be done as root.

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:基于FreeBSD5.4全能服务器安装v1.01   下一篇:使用 Perl 自动化 UNIX 系统管理

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号