|
- 完成 lfs
- 打包
- 找个 livecd
自己作了一个,你可以用这个:
http://imghch.com/doc/files/bootcd_initramfs/bootcd.iso
- 写个安装 script
这个是我用的: (livecd 中 /root/install)- #echo -e "0 200\n201 500" | sfdisk /dev/hda
- mkswap /dev/hda1 &&
- swapon /dev/hda1 &&
- mkfs -t ext3 /dev/hda2 &&
- mount /dev/hda2 /mnt/lfs &&
- cd /mnt/lfs &&
- tar jxpf /root/lfs-6.1+.bz2 &&
- cp /dev/hd* /mnt/lfs/dev/ -R &&
- cd / &&
- chroot /mnt/lfs \
- bash -c "echo -e 'root (hd0,1)\nsetup (hd0)\nquit' | /usr/sbin/grub" &&
- umount /mnt/lfs &&
- echo "install finished"
复制代码
- 当然,你也可以写个更复杂的(大家都是高手,我就不解释了)...
- ##########
- #Be care to use this install script
- #You need perform partitioning action before run this script
- #Following is an example for partitioning:
- #echo -e "0 200\n201 500" | sfdisk /dev/hda
- #And please read this simple script first, you should know what you are
- #doing
- #This script might not what you want
- ##########
- echo "Please input disk interface (sd for SCSI; hd for IDE):"
- read DISK &&
- echo IP address: &&
- read IP &&
- echo GATEWAY: &&
- read GATEWAY &&
- echo PREFIX: &&
- read PREFIX &&
- echo BROADCAST: &&
- read BROADCAST &&
- mkswap /dev/$DISK'a1'
- swapon /dev/$DISK'a1' &&
- mkfs -t ext3 /dev/$DISK'a2' &&
- mount /dev/$DISK'a2' /mnt/lfs &&
- cd /mnt/lfs &&
- tar jxpf /root/lfs-6.1+.bz2 &&
- echo ONBOOT=yes > /mnt/lfs/etc/sysconfig/network-devices/ifconfig.eth0/ipv4 &&
- echo SERVICE=ipv4-static >> /mnt/lfs/etc/sysconfig/network-devices/ifconfig.eth0/ipv4 &&
- echo IP=$IP >> /mnt/lfs/etc/sysconfig/network-devices/ifconfig.eth0/ipv4 &&
- echo GATEWAY=$GATEWAY >> /mnt/lfs/etc/sysconfig/network-devices/ifconfig.eth0/ipv4 &&
- echo PREFIX=$PREFIX >> /mnt/lfs/etc/sysconfig/network-devices/ifconfig.eth0/ipv4 &&
- echo BROADCAST=$BROADCAST >> /mnt/lfs/etc/sysconfig/network-devices/ifconfig.eth0/ipv4 &&
- cp /root/fstab_$DISK /mnt/lfs/etc/fstab &&
- cp /root/menu.lst_$DISK /mnt/lfs/boot/grub/menu.lst &&
- cp /dev/$DISK* /mnt/lfs/dev/ -R &&
- cd / &&
- chroot /mnt/lfs \
- bash -c "echo -e 'root (hd0,1)\nsetup (hd0)\nquit' | /usr/sbin/grub" &&
- umount /mnt/lfs &&
- echo &&
- echo &&
- echo "Install finished. Reboot now and happy your LFS!"
复制代码
- 把 script 和 lfs 包放到 livecd 上
- Enjoy your distribution!
|
|