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

利用BusyBox定制Linux Live CD

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

Now run make

       
  $ make   

A few files need to change. This assumes your current directory is "_install/openssh-3.9p1"

  $ mv ../../_install/usr/bin/install  ../../_install/usr/bin/installBB
  $ cp /usr/bin/install ../../_install/usr/bin/.

When this is done, "cd" so that your current directory is "_install".

  $ cd ..

Now, "chroot".

   $ chroot . /bin/sh -i
   BusyBox v1.00 (2005.02.21-00:50+0000) Built-in shell (ash)
   Enter 'help' for a list of built-in commands.
      
   $ cd openssh-3.9p1/
   $ make install
 

If all goes well, exit out of chroot.

   $ exit
   $ mv usr/bin/installBB usr/bin/install
   mv: overwrite `usr/bin/install'? y
   $ rm -rf openssh-3.9p1*

At this point ssh should be installed with the correct references to "etc", and all other files.


STEP 8: Compiling the Linux Kernel

You do not need to download the full kernel on each revision. Note, with the "linux-2.6.11.tar.gz" there is also a patch "patch-2.6.11.bz2". The patch get's applied to the "linux-2.6.10" kernel, assuming you had already downloaded it.

Assuming you have no linux kernel's downloaded.

  $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.tar.gz
  $ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.11.tar.gz.sign

Next, grab the correct key and verify the signature.

  $ gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E
  $ gpg --verify linux-2.6.11.tar.gz.sign linux-2.6.11.tar.gz

At this point, you know the source code is valid. Unroll the "tar.gz".

  $ tar -xzf linux-2.6.11.tar.gz

[********** Special Note - What if you had the 2.6.10 kernel source? ***************]

If this is the case, all you need to install is the patch "patch-2.6.11.bz2". This is the preferred method, as it keeps you ".config" settings.

  $ wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.11.bz2
  $ wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.11.bz2.sign
  $ gpg --verify patch-2.6.11.bz2.sign patch-2.6.11.bz2

  $ cd linux-2.6.10   <-- note this is my existing source
  $ bzip2 -dc ../patch-2.6.11.bz2 | patch -p1
  $ cd ..

[********************* End Special Note ********************************************]

You may want to copy by kernel ".config", or take a look at it if downloading the ""cdrom_linux_boot_proj1.iso"" found all the drivers on your computer.

  $ wget 
  $ make xconfig   -- This will allow you to graphically look at all 
                      the options.

  $ make bzImage   -- Only do this
  $ cp arch/i386/boot/bzImage ${PROJDIR}/proj1/staging_iso_image/boot/isolinux/linux26

That is it for create the compress kernel image. It may be necessary to add in additional drivers. What driver modules are used by your current system? Check "/etc/modprobe.conf"

  $ cat "/etc/modprobe.conf"
  ...
  alias eth0 tg3
  ...

Notice above that "eth0", the network interface card on my current system is loading this module. If I look for "tg3" in all the kernel "Makefile's", I can see that "CONFIG_TIGON3" should compiled into the kernel.

  $ find . -iname 'Makefile' -exec grep -H 'tg3' {} \;
  ./drivers/net/Makefile:obj-$(CONFIG_TIGON3) += tg3.o

Check your device drives and set them to yes in the ".config" file. As you can see, the ".config" used for proj1 has this option set to yes so when the kernel boot it will automatically find the needed network drivers. These steps should be performed for any NICs, or USB devices needed at boot time.

  $ cat .config |grep 'CONFIG_TIGON3'
  CONFIG_TIGON3=y

Also, if you want to NFS mount devices, you may want to include the NFS in the kernel

  CONFIG_NFS_FS=y
  CONFIG_NFS_V3=y
  CONFIG_NFS_V4=y
  (see cdrom_linux_boot_unionfs.iso)
For the complete kernel config for NFS see the following link:

http://prdownloads.sourceforge.net/souptonuts/cdrom_linux_boot_unionfs.iso


UNIONFS (Optional Step)

Unionfs is a utility for merging several directories into a single unified view. For example, if you had directory "/Fruits" and "/Vegetables" then you can combine the contents of those two directories into a third, which will be "/mnt/healthy". For more usage examples, see the following article:

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

Unionfs will work on the 2.6.9+ kernels. The software can be downloaded from the following site:

   ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs

Once downloaded, take a look at the Makefile. Below I have edited it to fit my environment, since my 2.6.11 kernel source is currently under "/home/chirico/kernel/BUILD/linux-2.6.11". So this is what my Unionfs Makefile looks like. All I did was change the variable LINUXSRC as shown below:

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



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

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