lantianyu520 发表于 2011-12-21 08:41

LiveCD是这么产生的(转)

<div id="post_message_1744786" style="overflow-x: hidden;"><font size="6"><font color="Magenta">属于原创作品,如果转载,请注明出处和作者(springwind@bhu.edu.cn)</font></font><br>
<br>
<font size="4"><font color="Blue"><br>
内核配置文件和busybox的配置文件,以及squashfs的补丁在附件中<br>
LFS部分是参考LFS-6.3rc1来进行的,需要特别修改的地方已经标明在下面<br>
全程制作过程见附件livecd.sh.gz<br>
</font></font><br>
<br>
<font size="5"><font color="Magenta">glibc-2.5</font></font><br>
<font color="Red"><font size="5">安装locale部分,使用自定义方式,只安装下面我需要的locale</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">mkdir -pv /usr/lib/locale
localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f UTF-8 en_US.UTF-8
localedef -i zh_CN -f GB2312 zh_CN
localedef -i zh_CN -f GBK zh_CN.GBK
localedef -i zh_CN -f GB18030 zh_CN.GB18030
localedef -i zh_CN -f UTF-8 zh_CN.UTF-8</div>
</div><font color="Red"><font size="5">按照晨想版主的建议,使用PRC</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">cp -v --remove-destination /usr/share/zoneinfo/PRC /etc/localtime</div>
</div><br>
<font size="5"><font color="Magenta">第八章</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">mv -v /etc/udev/rules.d/{75-cd-aliases-generator.rules,../}
mv -v /etc/udev/rules.d/{75-persistent-net-generator.rules,../}
rm -v /etc/udev/rules.d/70-persistent-cd.rules

cat &gt;/etc/udev/rules.d/81-cdrom.rules &lt;&lt;"EOF"
# /etc/udev/rules.d/81-cdrom.rules: Set CD-ROM permissions.

ACTION=="add", SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", PROGRAM="getcdrom %k", SYMLINK+="cdrom%c", GROUP="cdrom"
EOF
cat &gt;/lib/udev/getcdrom &lt;&lt;"EOF"
#!/bin/sh
i=0
while [ -e /dev/cdrom${i} ]
do
   [ X$(realpath /dev/cdrom${i}) == X/dev/$1 ] &amp;&amp; break
   let i=i+1
done
echo $i
exit 0
EOF
chmod 755 /lib/udev/getcdrom</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4"><br>
1、75-cd-aliases-generator.rules<br>
75-persistent-net-generator.rules<br>
的作用是创建一些静态的规则(写文件),在livecd上没有意义,在liveUSB上,会引起问题(因为每台机器的网卡的MAC都不同,直接导致的后果
是每在一台新的机器上运行后,网卡的编号是递增的,比如在A机上启动后,网卡的名字是eth0,可是,到另外一台机器上启动后,网卡是
eth1,....,另外,CDROM的名字也有这样的情况发生)<br>
2、修改81-cdrom.rules,作用是在/dev目录下创建cdrom?这样的符号连接,链接到实际的光驱上面,第一个光驱是cdrom0,第二
个是cdrom1,依次类推(/lib/udev/getcdrom是一个shell脚本,目的就是获取某个光驱的编号,返回值从0开始)<br>
</font></font><br>
<br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
# Begin /etc/sysconfig/clock

UTC=0

# End /etc/sysconfig/clock
EOF</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4"><br>
设置UTC=0,就是使用本地时间,否则看起来别扭,总是差8个小时<br>
</font></font><br>
<br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">echo "HOSTNAME=livecd" &gt; /etc/sysconfig/network
cd /etc/sysconfig/network-devices
mkdir -v ifconfig.eth0
cat &gt; ifconfig.eth0/ipv4 &lt;&lt; "EOF"
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.1.1
GATEWAY=192.168.1.2
PREFIX=24
BROADCAST=192.168.1.255
EOF

cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
# Begin /etc/resolv.conf

#domain &lt;Your Domain Name&gt;
nameserver 202.96.64.68
nameserver 202.96.69.38

# End /etc/resolv.conf
EOF

cat &gt; /etc/fstab &lt;&lt; "EOF"
# Begin /etc/fstab

# file systemmount-pointtype   options         dumpfsck
#                                                      order

#/dev/&lt;xxx&gt;   /            &lt;fff&gt;defaults      1   1
#/dev/&lt;yyy&gt;   swap         swap   pri=1         0   0
proc         /proc      proc   defaults      0   0
sysfs          /sys         sysfsdefaults      0   0
devpts         /dev/pts   devpts gid=4,mode=6200   0
shm            /dev/shm   tmpfsdefaults      0   0
# End /etc/fstab
EOF</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4"><br>
1、设置机器名字为livecd<br>
2、使用静态IP<br>
3、DNS服务器是我使用的,这个需要按照实际情况改动<br>
4、因为是用于liveCD或者liveUSB,因此,在/etc/fstab中是没有/和swap的,因此不需要写<br>
</font></font><br>
<br>
<font size="5"><font color="Magenta">内核编译部分</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">wget http://nchc.dl.sourceforge.net/sourceforge/squashfs/squashfs3.2-r2.tar.gz
tar xf squashfs3.2-r2.tar.gz
cd linux-2.6.22.1
patch -Np1 -i ../squashfs3.2-r2/kernel-patches/linux-2.6.20/squashfs3.2-patch
cd /sources/squashfs3.2-r2/squashfs-tools
make
cd /sources/linux-2.6.22.1
patch -Np1 -i ../linux-2.6.22.1-squashfs.patch
make
make modules_install
cp -v arch/i386/boot/bzImage /boot/vmlinuz-2.6.22.1
cp -v System.map /boot/System.map-2.6.22.1
cp -v .config /boot/config-2.6.22.1


cd /sources/aufs
make KDIR=/lib/modules/2.6.22.1/build/ -f local.mk
install -m 500 -p mount.aufs umount.aufs auplink aulchown /sbin
echo FLUSH=ALL &gt; /etc/default/auplink
mkdir /lib/modules/2.6.22.1/kernel/fs/aufs
cp aufs.ko /lib/modules/2.6.22.1/kernel/fs/aufs/
depmod -a 2.6.22.1

echo 6.3-rc1 &gt; /etc/lfs-release

#mkinitrd
cd /sources
tar xf busybox-1.5.1.tar.bz2
cd busybox-1.5.1
make defconfig
make

mkdir /initrd
cd /initrd
mkdir bin dev etc lib mnt/{,cdrom,root,roroot,rwroot} proc root sbin sys tmp
chmod 1777 tmp
cp /sbin/{modinfo,udevd,udevtrigger,depmod,modprobe,udevcontrol,udevsettle} sbin/
cp -a /sources/busybox-1.5.1/_install/{bin,sbin} .
cp -a /etc/udev etc/
cp -a /lib/udev lib/
cp -a /lib/{ld-linux.so.2,libc.so.6,libvolume_id.so.0,libvolum_id.so.0.78.0} lib/
mkdir -p lib/modules/2.6.22.1/kernel/{drivers,fs}
cp -a /lib/modules/2.6.22.1/kernel/drivers/{ata,block,cdrom,hid,ide,input,pcmia,scsi,usb} lib/modules/2.6.22.1/kernel/drivers/
cp -a /lib/modules/2.6.22.1/kernel/fs lib/modules/2.6.22.1/kernel/
cat &gt;init &lt;&lt;"EOF"
#!/bin/sh
PATH=/bin:/sbin

mount -t proc proc /proc
mount -t sysfs sysfs /sys

ro=-r
INIT=/sbin/init
ROOTDELAY=
DEBUG=
NOAUFS=

for i in $(cat /proc/cmdline)
do
case "$i" in
    rootdelay=*)
    ROOTDELAY=${i#rootdelay=}
    ;;
esac
done

/sbin/depmod -a

echo &gt; /proc/sys/kernel/hotplug
cp -a /lib/udev/devices/* /dev
/sbin/udevd --daemon
/sbin/udevtrigger
/sbin/udevsettle

if [ X$ROOTDELAY != X ]
then
echo "wait $ROOTDELAY seconds ......"
sleep $ROOTDELAY
fi

for i in $(cat /proc/cmdline)
do
case "$i" in
    root=*)
      ROOT=${i#root=}
      case "$ROOT" in
      UUID=*)
          ROOT=${ROOT#UUID=}
          ROOT=$(realpath /dev/disk/by-uuid/$ROOT)
          ;;
      /dev/*)
          ROOT=$ROOT
          ;;
      *)
          ROOT=
      esac
      ;;
    init=*)
      INIT=${i#init=}
      ;;
    ro)
      ro=-r
      ;;
    rw)
      ro=
      ;;
    debug)
      DEBUG=1
      ;;
    noaufs)
      NOAUFS=1
      ;;
esac
done

if [ X$DEBUG != X ]
then
echo "enter debug mode..."
PS1='\[\033$ ' /bin/sh -i
else
PS1='\$ '
[ -d /mnt/cdrom ] || mkdir /mnt/cdrom
[ -d /mnt/root ] || mkdir /mnt/root
[ -d /mnt/roroot ] || mkdir /mnt/roroot
[ -d /mnt/rwroot ] || mkdir /mnt/rwroot
if [ X$ROOT == X ]
then
    echo "mount cdrom ......"
    modprobe iso9660
    for i in 1 2 4 8
    do
      for CDROM in /dev/cdrom*
      do
      mount -nt iso9660 -o ro $CDROM /mnt/cdrom
      mountpoint -q /mnt/cdrom &amp;&amp; break
      [ -f /mnt/cdrom/root.sqfs ] &amp;&amp; break
      umount /mnt/cdrom
      done
      [ -f /mnt/cdrom/root.sqfs ] &amp;&amp; break
      sleep $i
    done
else
    echo "mount rootdev(${ROOT}) ......"
    FSTYPE=$(/lib/udev/vol_id -t "${ROOT}" 2&gt; /dev/null)
    if [ X$FSTYPE != X ]
    then   
      modprobe nls_iso8859-1
      modprobe nls_cp437
      modprobe $FSTYPE
      for i in 1 2 4 8
      do
      mount -nt $FSTYPE -o ro $ROOT /mnt/cdrom
      mountpoint -q /mnt/cdrom &amp;&amp; break
      sleep $i
      done
    fi
fi
mountpoint -q /mnt/cdrom || (echo "no rootdev";/bin/sh -i)

if [ X$AUFS == X ]
then
    echo "mount roroot ......"
    mount -o remount,rw /mnt/cdrom
    modprobe loop
    modprobe squashfs
    for i in 1 2 4 8
    do
      mount -nt squashfs -o loop,ro /mnt/cdrom/root.sqfs /mnt/roroot
      mountpoint -q /mnt/roroot &amp;&amp; break
      sleep $i
    done
    mountpoint -q /mnt/roroot || (echo "no roroot";/bin/sh -i)

    mount -nt tmpfs -o mode=755 tmpfs /mnt/rwroot
    mountpoint -q /mnt/rwroot || (echo "no tmpfs";/bin/sh -i)

    echo "mount realroot ......"
    modprobe aufs
    for i in 1 2 4 8
    do
      mount -nt aufs -o br:/mnt/rwroot=rw:/mnt/roroot=ro aufsroot /mnt/root
      mountpoint -q /mnt/root &amp;&amp; break
      sleep $i
    done
    mountpoint -q /mnt/root || (echo "no root";/bin/sh -i)
    mkdir /mnt/root/mnt/.rootdev
    mount --bind /mnt/cdrom /mnt/root/mnt/.rootdev
    touch /mnt/root/fastboot
    touch /mnt/root/.livecd
else
    mount -n -o move /mnt/cdrom /mnt/root
fi

#start up hook
[ -f /mnt/cdrom/onboot.sh ] &amp;&amp; sh /mnt/cdrom/onboot.sh

killall udevd
umount /proc
umount /sys
fi

exec switch_root /mnt/root $INIT "$@"
EOF</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4"><br>
1、因为CD和USB的空间有限,因此需要对root文件系统进行压缩,我使用的是squashfs来进行压缩,因为squashfs是只读的,可是实际
运行中需要对/文件系统进行写操作,因此使用aufs来挂载/文件系统,将所有的写操作在内存中进行(squashfs和aufs的获取可能通过官方网站
的提示进行,我的aufs是通过cvs获取的)<br>
2、initrd使用initramfs,这种initrd比较简单,而且可控性很强,因为启动后,这个initrd就被释放,因此,使用busybox
来提供大部分工具,省得复制一些运行库,目的是尽可能减少initrd的空间,不过,因为把一部分内核模块复制到initrd中了,initrd的容量已
经比较大了,有20M左右,因此,这部分的减小没有太大意义,不过,如果只是编译内核,使得内核只支持IDE的cdrom的话,和部分USB的光驱,以及
部分SATA的光驱的话,内核模块的容量还是比较小的。<br>
3、在复制内核模块的fs部分,实际上只需要复制部分用得着的,比如livecd只需要isofs,aufs,squashfs,liveUSB只需要aufs,squashfs和USB分区的分区类型的相应模块<br>
4、initrd中使用的是udev,只是为了方便,如果有能力的话,可以自己去创建设备节点(那样做有一些麻烦,因为还需要手动去加载相应的内核模块,工作量确实不少),就可以不用udev了<br>
</font></font><br>
<br>
<font size="5"><font color="Magenta">额外工具</font></font><br>
<font color="Red"><font size="4">其中一部分是参考BLFS的开发版的手册,其它的都可以从internet上获取</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">tar xf zhcon-0.2.5.tar.gz
cd zhcon-0.2.5
zcat ../zhcon-0.2.5-to-0.2.6.diff.gz | patch -Np1
./configure --prefix=/usr --sysconfdir=/etc
make &amp;&amp; make install</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4">因为暂时不想安装X,因此,在控制台下面对中文的支持是必要的</font></font><br>
<br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">tar xf openssl-0.9.8d.tar.gz
cd openssl-0.9.8d
patch -Np1 -i ../openssl-0.9.8d-fix_manpages-1.patch
make MANDIR=/usr/share/man
make MANDIR=/usr/share/man install
cp -v -r certs /etc/ssl &amp;&amp;
install -v -d -m755 /usr/share/doc/openssl-0.9.8d &amp;&amp;
cp -v -r doc/{HOWTO,README,*.{txt,html,gif}} \
    /usr/share/doc/openssl-0.9.8d
cd /sources/blfs/ &amp;&amp; rm -rf openssl-0.9.8d


tar xf wget-1.10.2.tar.gz
cd wget-1.10.2
./configure --prefix=/usr --sysconfdir=/etc &amp;&amp; make &amp;&amp; make install
cd /sources/blfs/ &amp;&amp; rm -rf wget-1.10.2

tar xf pcre-7.2.tar.bz2
cd pcre-7.2
./configure --prefix=/usr \
            --docdir=/usr/share/doc/pcre-7.2 \
            --enable-utf8 &amp;&amp;
make &amp;&amp;
make install
mv -v /usr/lib/libpcre.so.* /lib/ &amp;&amp;
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
cd /sources/blfs/ &amp;&amp; rm -rf pcre-7.2


cat &gt; /usr/bin/which &lt;&lt; "EOF"
#!/bin/bash
type -pa "$@" | head -n 1 ; exit ${PIPESTATUS}
EOF
chmod -v 755 /usr/bin/which
chown -v root:root /usr/bin/which

tar xf pkg-config-0.22.tar.gz
cd pkg-config-0.22
./configure --prefix=/usr &amp;&amp; make &amp;&amp; make install
cd /sources/blfs/ &amp;&amp; rm -rf pkg-config-0.22

tar xf cpio-2.9.tar.bz2
cd cpio-2.9
./configure CPIO_MT_PROG=mt \
            --prefix=/usr \
            --bindir=/bin \
            --libexecdir=/tmp \
            --with-rmt=/usr/sbin/rmt &amp;&amp;
make &amp;&amp; make install
cd /sources/blfs/ &amp;&amp; rm -rf cpio-2.9

tar xf pciutils-2.2.3.tar.bz2
cd pciutils-2.2.3
sed -i 's/null ;/null 2&gt;\&amp;1 ;/' update-pciids.sh &amp;&amp;
make PREFIX=/usr &amp;&amp;
make PREFIX=/usr install &amp;&amp;
install -v -m 755 -d /usr/include/pci &amp;&amp;
install -v -m 644 lib/libpci.a /usr/lib &amp;&amp;
install -v -m 644 lib/*.h /usr/include/pci
update-pciids
cd /sources/blfs/ &amp;&amp; rm -rf pciutils-2.2.3

tar xf gc6.8.tar.gz
cd gc6.8
sed -i "s|\$(datadir)/@PACKAGE@|&amp;-6.8|" doc/Makefile.in &amp;&amp;
./configure --prefix=/usr \
    --datadir=/usr/share/doc --enable-cplusplus &amp;&amp;
make &amp;&amp; make install &amp;&amp;
install -v -m644 doc/gc.man /usr/share/man/man3/gc_malloc.3 &amp;&amp;
ln -v -s gc_malloc.3 /usr/share/man/man3/gc.3 &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf gc6.8

tar xf w3m-0.5.2.tar.gz
cd w3m-0.5.2
./configure --prefix=/usr \
            --libexecdir=/usr/lib \
            --sysconfdir=/etc &amp;&amp;
make &amp;&amp; make install &amp;&amp;
install -v -m644 -D doc/keymap.default /etc/w3m/keymap &amp;&amp;
install -v -m644    doc/menu.default /etc/w3m/menu &amp;&amp;
install -v -m755 -d /usr/share/doc/w3m-0.5.2 &amp;&amp;
install -v -m644    doc/{HISTORY,READ*,keymap.*,menu.*,*.html} \
                  /usr/share/doc/w3m-0.5.2
cd /sources/blfs/ &amp;&amp; rm -rf w3m-0.5.2


tar xf screen-4.0.3.tar.gz
cd screen-4.0.3
./configure --prefix=/usr --with-socket-dir=/var/run/screen \
    --with-sys-screenrc=/etc/screenrc &amp;&amp;
sed -i -e "s%/usr/local/etc/screenrc%/etc/screenrc%" {etc,doc}/* &amp;&amp;
make &amp;&amp; make install &amp;&amp;
install -m 644 etc/etcscreenrc /etc/screenrc
cd /sources/blfs/ &amp;&amp; rm -rf screen-4.0.3


tar xf openssh-4.6p1.tar.gz
cd openssh-4.6p1
install -v -m700 -d /var/lib/sshd &amp;&amp;
chown -v root:sys /var/lib/sshd &amp;&amp;
groupadd -g 50 sshd &amp;&amp;
useradd -c 'sshd PrivSep' -d /var/lib/sshd -g sshd \
    -s /bin/false -u 50 sshd
sed -i "s:-lcrypto:/usr/lib/libcrypto.a -ldl:g" configure
sed -i "s/lkrb5 -ldes/lkrb5/" configure &amp;&amp;
./configure --prefix=/usr --sysconfdir=/etc/ssh \
    --libexecdir=/usr/lib/openssh --with-md5-passwords \
    --with-privsep-path=/var/lib/sshd &amp;&amp;
make &amp;&amp; make install &amp;&amp;
install -v -m755 -d /usr/share/doc/openssh-4.6p1 &amp;&amp;
install -v -m644 INSTALL LICENCE OVERVIEW README* WARNING.RNG \
    /usr/share/doc/openssh-4.6p1
cd /sources/blfs/ &amp;&amp; rm -rf openssh-4.6p1


tar xf dhcp-3.0.5.tar.gz
cd dhcp-3.0.5
patch -Np1 -i ../dhcp-3.0.5-client_dns-1.patch
patch -Np1 -i ../dhcp-3.0.5-iproute2-1.patch
./configure &amp;&amp;
make &amp;&amp;
make LIBDIR=/usr/lib INCDIR=/usr/include install
cat &gt; /etc/dhclient.conf &lt;&lt; "EOF"
# dhclient.conf

interface "eth0"{
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
      domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
}
# end dhclient.conf
EOF
cd /sources/blfs/ &amp;&amp; rm -rf dhcp-3.0.5
cat &gt; /etc/sysconfig/network-devices/dhclient.example &lt;&lt; "EOF"
ONBOOT="yes"
SERVICE="dhclient"
DHCP_START="-q &lt;add additional start parameters here&gt;"
DHCP_STOP="-q -r &lt;add additional stop parameters here&gt;"

# Set PRINTIP="yes" to have the script print
# the DHCP assigned IP address
PRINTIP="no"

# Set PRINTALL="yes" to print the DHCP assigned values for
# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
PRINTALL="no"
EOF

tar xf ppp-2.4.4.tar.gz &amp;&amp;
cd ppp-2.4.4 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
make install-etcppp &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf ppp-2.4.4


tar xf rp-pppoe-3.8.tar.gz &amp;&amp;
cd rp-pppoe-3.8 &amp;&amp;
patch -Np1 -i ../rp-pppoe-3.8-iproute2-1.patch &amp;&amp;
sed -i s%/usr/bin/logger%/bin/logger% scripts/pppoe-{connect,setup,stop}.in &amp;&amp;
cd src &amp;&amp;
./configure &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cat &gt; /etc/sysconfig/network-devices/pppoe-example &lt;&lt; "EOF"
ONBOOT="yes"
SERVICE="pppoe"
EOF
cd /sources/blfs/ &amp;&amp; rm -rf rp-pppoe-3.8
cd blfs-bootscripts-20070726 &amp;&amp;
make install-service-pppoe &amp;&amp;
cd /sources/blfs

tar xf libpcap-0.9.6.tar.gz &amp;&amp;
cd libpcap-0.9.6 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
install -v -m755 -d /usr/share/doc/libpcap-0.9.6 &amp;&amp;
install -v -m644 doc/* /usr/share/doc/libpcap-0.9.6 &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf libpcap-0.9.6


tar xf wireless_tools.28.tar.gz &amp;&amp;
cd wireless_tools.28 &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf wireless_tools.28


tar xf glib-2.12.12.tar.bz2 &amp;&amp;
cd glib-2.12.12 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cat &gt; /etc/profile.d/glib2-locale.sh &lt;&lt; "EOF"
# Use the current locale charset for filenames
# in applications using GLib
export G_FILENAME_ENCODING=@locale
EOF
cd /sources/blfs/ &amp;&amp; rm -rf glib-2.12.12


tar xf wireshark-0.99.6.tar.bz2 &amp;&amp;
cd wireshark-0.99.6 &amp;&amp;
./configure --prefix=/usr \
            --sysconfdir=/etc \
            --enable-threads \
            --disable-wireshark &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
install -v -m755 -d /usr/share/doc/wireshark-0.99.6 &amp;&amp;
install -v -m644    FAQ README{,.linux} doc/README.* doc/*.{pod,txt} \
                  /usr/share/doc/wireshark-0.99.6 &amp;&amp;
pushd /usr/share/doc/wireshark-0.99.6 &amp;&amp;
for FILENAME in ../../wireshark/*.html; do \
    ln -s -v $FILENAME .
done &amp;&amp;
popd &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf wireshark-0.99.6

tar xf nmap-4.20.tar.bz2 &amp;&amp;
cd nmap-4.20 &amp;&amp;
./configure --prefix=/usr --without-nmapfe &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf nmap-4.20


tar xf traceroute-1.4a12.tar.gz &amp;&amp;
cd traceroute-1.4a12 &amp;&amp;
sed -i -e 's/-o bin/-o root/' Makefile.in &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
make install-man &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf traceroute-1.4a12

tar xf whois_4.7.21.tar.gz &amp;&amp;
cd whois-4.7.21 &amp;&amp;
make &amp;&amp;
make prefix=/usr install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf whois-4.7.21

tar xf bind-9.4.1-P1.tar.gz &amp;&amp;
cd bind-9.4.1-P1 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make -C lib/dns &amp;&amp;
make -C lib/isc &amp;&amp;
make -C lib/bind9 &amp;&amp;
make -C lib/isccfg &amp;&amp;
make -C lib/lwres &amp;&amp;
make -C bin/dig &amp;&amp;
make -C bin/dig install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf bind-9.4.1-P1

tar xf lftp-3.5.12.tar.bz2 &amp;&amp;
cd lftp-3.5.12 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf lftp-3.5.12

groupadd -g 46 proftpd &amp;&amp;
useradd -c proftpd -d /srv/ftp -g proftpd \
      -s /usr/bin/proftpdshell -u 46 proftpd &amp;&amp;
install -v -d -m775 -o proftpd -g proftpd /srv/ftp &amp;&amp;
ln -v -s /bin/false /usr/bin/proftpdshell &amp;&amp;
echo /usr/bin/proftpdshell &gt;&gt; /etc/shells &amp;&amp;
tar xf proftpd-1.3.0.tar.bz2 &amp;&amp;
cd proftpd-1.3.0 &amp;&amp;
./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var/run &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cat &gt; /etc/proftpd.conf &lt;&lt; "EOF"
# This is a basic ProFTPD configuration file
# It establishes a single server and a single anonymous login.

ServerName                      "ProFTPD Default Installation"
ServerType                      standalone
DefaultServer                   on

# Port 21 is the standard FTP port.
Port                            21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.If you need to allow more than 30 concurrent connections
# at once, simply increase this value.Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances                  30

# Set the user and group that the server normally runs at.
User                            proftpd
Group                           proftpd

# Normally, files should be overwritable.
&lt;Directory /*&gt;
AllowOverwrite                on
&lt;/Directory&gt;

# A basic anonymous configuration, no upload directories.
&lt;Anonymous ~proftpd&gt;
User                        proftpd
Group                         proftpd
# Clients should be able to login with "anonymous" as well as "proftpd"
UserAlias                     anonymous proftpd

# Limit the maximum number of anonymous logins
MaxClients                  10

# 'welcome.msg' should be displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin                  welcome.msg
DisplayFirstChdir             .message

# Limit WRITE everywhere in the anonymous chroot
&lt;Limit WRITE&gt;
    DenyAll
&lt;/Limit&gt;
&lt;/Anonymous&gt;
EOF
cd /sources/blfs/ &amp;&amp; rm -rf proftpd-1.3.0
cd /sources/blfs/blfs-bootscripts-20070726
make install-proftpd
cd /sources/blfs

tar xf gpm-1.20.1.tar.bz2 &amp;&amp;
cd gpm-1.20.1 &amp;&amp;
patch -Np1 -i ../gpm-1.20.1-segfault-1.patch &amp;&amp;
patch -Np1 -i ../gpm-1.20.1-silent-1.patch &amp;&amp;
./configure --prefix=/usr --sysconfdir=/etc &amp;&amp;
LDFLAGS="-lm" make &amp;&amp;
make install &amp;&amp;
cp -v conf/gpm-root.conf /etc &amp;&amp;
ldconfig &amp;&amp;
cat &gt; /etc/sysconfig/mouse &lt;&lt; "EOF"
# Begin /etc/sysconfig/mouse

MDEVICE="/dev/input/mouse0"
PROTOCOL="imps2"
GPMOPTS=""

# End /etc/sysconfig/mouse
EOF
cd /sources/blfs/ &amp;&amp; rm -rf gpm-1.20.1
cd /sources/blfs/blfs-bootscripts-20070726
make install-gpm
cd /sources/blfs

tar xf slang-2.1.1.tar.bz2 &amp;&amp;
cd slang-2.1.1 &amp;&amp;
./configure --prefix=/usr --sysconfdir=/etc &amp;&amp;
make &amp;&amp;
make install_doc_dir=/usr/share/doc/slang-2.1.1 install-all &amp;&amp;
chmod -v 755 /usr/lib/libslang.so.2.1.1 \
             /usr/lib/slang/v2/modules/*.so &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf slang-2.1.1

tar xf mc-4.6.1.tar.gz &amp;&amp;
cd mc-4.6.1 &amp;&amp;
patch -Np1 -i ../mc-4.6.1-bash32-1.patch &amp;&amp;
patch -Np1 -i ../mc-4.6.1-debian_fixes-1.patch &amp;&amp;
CPPFLAGS="-DUTF8" ./configure --prefix=/usr \
            --enable-charset &amp;&amp;
make &amp;&amp;
convert-mans ISO-8859-1 UTF-8 lib/mc.hint{,.es,.it,.nl} &amp;&amp;
convert-mans ISO-8859-2 UTF-8 lib/mc.hint{.cs,.hu,.pl} &amp;&amp;
convert-mans ISO-8859-5 UTF-8 lib/mc.hint.sr &amp;&amp;
convert-mans KOI8-R UTF-8 lib/mc.hint.ru &amp;&amp;
convert-mans KOI8-U UTF-8 lib/mc.hint.uk &amp;&amp;
convert-mans BIG5 UTF-8 lib/mc.hint.zh &amp;&amp;
convert-mans ISO-8859-1 UTF-8 doc/{es,it}/mc.hlp.* &amp;&amp;
convert-mans ISO-8859-2 UTF-8 doc/{hu,pl}/mc.hlp.* &amp;&amp;
convert-mans ISO-8859-5 UTF-8 doc/sr/mc.hlp.sr &amp;&amp;
convert-mans KOI8-R UTF-8 doc/ru/mc.hlp.ru &amp;&amp;
make install &amp;&amp;
chmod 1755 /usr/lib/mc/cons.saver &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf mc-4.6.1

#comiple p7zip need nasm
#wget "http://downloads.sourceforge.net/nasm/nasm-0.99.01.tar.bz2?modtime=1180529807&amp;big_mirror=0"
tar xf nasm-0.99.01.tar.bz2 &amp;&amp;
cd nasm-0.99.01 &amp;&amp;
./configure &amp;&amp; make &amp;&amp;
cp nasm /usr/local/bin/ &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf nasm-0.99.01

tar xf p7zip_4.51_src_all.tar.bz2 &amp;&amp;
cd p7zip_4.51 &amp;&amp;
cp makefile.linux_x86_asm_gcc_4.X makefile.machine &amp;&amp;
make clean &amp;&amp;
make all3 &amp;&amp;
sed -i "s@DEST_HOME=/usr/local@DEST_HOME=/usr@" install.sh &amp;&amp;
./install.sh &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf p7zip_4.51

tar xf fuse-2.7.0.tar.gz &amp;&amp;
cd fuse-2.7.0 &amp;&amp;
./configure --disable-kernel-module --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf fuse-2.7.0

tar xf sshfs-fuse-1.8.tar.gz &amp;&amp;
cd sshfs-fuse-1.8 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf sshfs-fuse-1.8

tar xf curl-7.16.3.tar.bz2 &amp;&amp;
cd curl-7.16.3 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
find docs -name "Makefile*" -o -name "*.1" -o -name "*.3" | xargs rm &amp;&amp;
install -v -d -m755 /usr/share/doc/curl-7.16.3 &amp;&amp;
cp -v -R docs/* /usr/share/doc/curl-7.16.3 &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf curl-7.16.3

#wget "http://downloads.sourceforge.net/curlftpfs/curlftpfs-0.9.1.tar.gz?modtime=1175788159&amp;big_mirror=0"
tar xf curlftpfs-0.9.1.tar.gz &amp;&amp;
cd curlftpfs-0.9.1 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf curlftpfs-0.9.1

tar xf ntfs-3g-1.710.tgz &amp;&amp;
cd ntfs-3g-1.710 &amp;&amp;
./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install &amp;&amp;
cd /sources/blfs/ &amp;&amp; rm -rf ntfs-3g-1.710</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4"><br>
我只是安装一些我觉得有用的工具,具体应该安装哪些,视各人喜好而定<br>
1、wget,lftp可以用来下载文件和访问ftp服务器<br>
2、w3m可以浏览网页<br>
3、screen是一个可爱的工具<br>
4、openssh,proftpd分别提供ssh服务和ftp服务<br>
5、dhcp可以动态获取IP,在很多场合下是必要的<br>
6、rp-pppoe可以提供ADSL拨号功能<br>
7、wireless-tool可以提供对无线网卡的控制(内核中已经把大部分无线网卡的驱动编译成模块了)<br>
8、nmap,wireshark是网络工具<br>
9、sshfs,curlftpfs,ntfs-3g是一些可爱的工具,sshfs可以通过ssh将远程主机上的文件系统挂载到本地;curlftpfs可以将远程FTP上的目录挂载到本地;ntfs-3g可以提供对ntfs的读写操作<br>
10、cpio,p7zip是压缩解压工具,p7zip可以支持大部分的压缩格式<br>
11、gpm支持控制台下面使用鼠标(启动后,我发现在/dev/input下面有鼠标的设备节点,分别是mouse0,mouse1....,所以就在配置文件中使用了/dev/input/mouse0作为鼠标的设备节点了)<br>
12、mc是一个大部分人都说好的工具<br>
<br>
<font color="Blue"><font size="6">期待您的参与,给提供一些好的工具,以便添加到livecd中</font></font><br>
<br>
</font></font><br>
<br>
<font size="5"><font color="Magenta">修正启动脚本中的一点问题</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">ln -sf /proc/mounts /etc/mtab

cat &gt; /etc/rc.d/init.d/mountfs &lt;&lt;"EOF"
#!/bin/sh
########################################################################
# Begin $rc_base/init.d/mountfs
#
# Description : File System Mount Script
#
# Authors   : Gerard Beekmans - gerard@linuxfromscratch.org
#
# Version   : 00.00
#
# Notes       :
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
      start)
                boot_mesg "Remounting root file system in read-write mode..."
                [ -f /.livecd ] || mount -n -o remount,rw / &gt;/dev/null 2&gt;&amp;1
                evaluate_retval

                # Remove fsck-related file system watermarks.
                rm -f /fastboot /forcefsck /.livecd

                # This will mount all filesystems that do not have _netdev in
                # their option list._netdev denotes a network filesystem.
                boot_mesg "Mounting remaining file systems..."
                mount -an -O no_netdev &gt;/dev/null 2&gt;&amp;1
                evaluate_retval
                ;;

      stop)
                boot_mesg "Unmounting all other currently mounted file systems..."
                umount -a -d -r &gt;/dev/null 2&gt;&amp;1
                evaluate_retval
                ;;

      *)
                echo "Usage: ${0} {start|stop}"
                exit 1
                ;;
esac

# End $rc_base/init.d/mountfs
EOF</div>
</div><font size="5"><font color="Magenta">解释:</font></font><br>
<font color="Red"><font size="4"><br>
因为livecd使用的方式有些特别,因此,在mountfs中运行的一些脚本可能出现错误(不影响实际的使用)<br>
在livecd的initrd中已经挂载了/文件系统,并且是可写的,因此,在mountfs中就不需要重新以rw方式挂载/了<br>
</font></font><br>
<br>
<font size="5"><font color="Magenta">设置一些必要的配置文件(来自BLFS手册)</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">cat &gt; /etc/profile &lt;&lt; "EOF"
# Begin /etc/profile
# Written for Beyond Linux From Scratch
# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
# modifications by Dagmar d'Surreal &lt;rivyqntzne@pbzpnfg.arg&gt;

# System wide environment variables and startup programs.

# System wide aliases and functions should go in /etc/bashrc.Personal
# environment variables and startup programs should go into
# ~/.bash_profile.Personal aliases and functions should go into
# ~/.bashrc.

# Functions to help us manage paths.Second argument is the name of the
# path variable to be modified (default: PATH)
pathremove () {
      local IFS=':'
      local NEWPATH
      local DIR
      local PATHVARIABLE=${2:-PATH}
      for DIR in ${!PATHVARIABLE} ; do
                if [ "$DIR" != "$1" ] ; then
                  NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
                fi
      done
      export $PATHVARIABLE="$NEWPATH"
}

pathprepend () {
      pathremove $1 $2
      local PATHVARIABLE=${2:-PATH}
      export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
}

pathappend () {
      pathremove $1 $2
      local PATHVARIABLE=${2:-PATH}
      export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
}


# Set the initial path
export PATH=/bin:/usr/bin

if [ $EUID -eq 0 ] ; then
      pathappend /sbin:/usr/sbin
      unset HISTFILE
fi

# Setup some environment variables.
export HISTSIZE=1000
export HISTIGNORE="&amp;:g:exit"

# Setup a red prompt for root and a green one for users.
NORMAL="\[\e"
RED="\[\e"
GREEN="\[\e"
if [[ $EUID == 0 ]] ; then
PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
else
PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi

for script in /etc/profile.d/*.sh ; do
      if [ -r $script ] ; then
                . $script
      fi
done

# Now to clean up
unset pathremove pathprepend pathappend

# End /etc/profile
EOF
install --directory --mode=0755 --owner=root --group=root /etc/profile.d
cat &gt; /etc/profile.d/dircolors.sh &lt;&lt; "EOF"
# Setup for /bin/ls to support color, the alias is in /etc/bashrc.
if [ -f "/etc/dircolors" ] ; then
      eval $(dircolors -b /etc/dircolors)

      if [ -f "$HOME/.dircolors" ] ; then
                eval $(dircolors -b $HOME/.dircolors)
      fi
fi
alias ls='ls --color=auto'
EOF
cat &gt; /etc/profile.d/readline.sh &lt;&lt; "EOF"
# Setup the INPUTRC environment variable.
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
      INPUTRC=/etc/inputrc
fi
export INPUTRC
EOF
cat &gt; /etc/profile.d/umask.sh &lt;&lt; "EOF"
# By default we want the umask to get set.
if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
umask 002
else
umask 022
fi
EOF
cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
# Set up i18n variables
export LANG=zh_CN.UTF-8
EOF
cat &gt; /etc/bashrc &lt;&lt; "EOF"
# Begin /etc/bashrc
# Written for Beyond Linux From Scratch
# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
# updated by Bruce Dubbs &lt;bdubbs@linuxfromscratch.org&gt;

# System wide aliases and functions.

# System wide environment variables and startup programs should go into
# /etc/profile.Personal environment variables and startup programs
# should go into ~/.bash_profile.Personal aliases and functions should
# go into ~/.bashrc

# Provides a colored /bin/ls command.Used in conjunction with code in
# /etc/profile.

alias ls='ls --color=auto'

# Provides prompt for non-login shells, specifically shells started
# in the X environment. [Review the LFS archive thread titled
# PS1 Environment Variable for a great case study behind this script
# addendum.]

NORMAL="\[\e"
RED="\[\e"
GREEN="\[\e"
if [[ $EUID == 0 ]] ; then
PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
else
PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi

# End /etc/bashrc
EOF
cat &gt; ~/.bash_profile &lt;&lt; "EOF"
# Begin ~/.bash_profile
# Written for Beyond Linux From Scratch
# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
# updated by Bruce Dubbs &lt;bdubbs@linuxfromscratch.org&gt;

# Personal environment variables and startup programs.

# Personal aliases and functions should go in ~/.bashrc.System wide
# environment variables and startup programs are in /etc/profile.
# System wide aliases and functions are in /etc/bashrc.

append () {
# First remove the directory
local IFS=':'
local NEWPATH
for DIR in $PATH; do
   if [ "$DIR" != "$1" ]; then
       NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
   fi
done

# Then append the directory
export PATH=$NEWPATH:$1
}

if [ -f "$HOME/.bashrc" ] ; then
source $HOME/.bashrc
fi

if [ -d "$HOME/bin" ] ; then
append $HOME/bin
fi

unset append

# End ~/.bash_profile
EOF
cat &gt; ~/.bashrc &lt;&lt; "EOF"
# Begin ~/.bashrc
# Written for Beyond Linux From Scratch
# by James Robertson &lt;jameswrobertson@earthlink.net&gt;

# Personal aliases and functions.

# Personal environment variables and startup programs should go in
# ~/.bash_profile.System wide environment variables and startup
# programs are in /etc/profile.System wide aliases and functions are
# in /etc/bashrc.

if [ -f "/etc/bashrc" ] ; then
source /etc/bashrc
fi

# End ~/.bashrc
EOF

dircolors -p &gt; /etc/dircolors

cat &gt; /etc/shells &lt;&lt; "EOF"
# Begin /etc/shells

/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/proftpdshell

# End /etc/shells
EOF</div>
</div><font size="5"><font color="Magenta">创建initrd和ISO</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">cd /initrd
find . | cpio -o -H newc | gzip -9 &gt; /boot/initrd.img-2.6.22.1

umount $LFS/{proc,sys,dev/shm,dev/pts,dev} <font color="red">#在宿主系统中执行</font>

/sources/squashfs3.2-r2/squashfs-tools/mksquashfs bin boot dev etc home lib media mnt opt proc root sbin srv sys tmp usr var /sources/root.sqfs</div>
</div><font size="5"><font color="Magenta">下面代码需要在宿主系统中操作</font></font><br>
<div style="margin:20px; margin-top:5px; margin-left:0px">
        <div class="smallfont" style="margin-bottom:2px">代码:</div>
        <div dir="ltr" style="text-align:left;">cd $LFS
mkdir -p isolinux/boot/grub
cp ${LFS}/boot/{initrd.img-2.6.22.1,vmlinuz-2.6.22.1} isolinux/boot/
cp ${LFS}/usr/lib/grub/i386-pc/{stage2_eltorito,stage1,stage2} isolinux/boot/grub/
cp ${LFS}/sources/root.sqfs isolinux/
cat &gt; isolinux/boot/grub/menu.lst &lt;&lt;"EOF"
default 0
timeout 5

title lfs(kernel 2.6.22.1)
kernel /boot/vmlinuz-2.6.22.1 vga=788
initrd /boot/initrd.img-2.6.22.1
EOF
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o lfs.iso isolinux</div>
</div><font size="5"><font color="Magenta">至此,liveCD已经完成,$LFS目录下的lfs.iso就是最终的光盘映象文件,可以用虚拟机挂载上,看看效果了</font></font><br>
<br>
<br>
<font color="Blue"><font size="6">因为写得仓促,如有错误之处,敬请指正</font></font></div>

cliffordl 发表于 2013-01-05 13:36

回复 1# lantianyu520


    路过
页: [1]
查看完整版本: LiveCD是这么产生的(转)