Ubuntu 9.10 Live CD pxe 網路開機設定

Ubuntu 9.10 Live CD pxe 網路開機設定

// reference: PXEInstallServer
https://help.ubuntu.com/community/PXEInstallServer
https://wiki.ubuntu.com/LiveCDNetboot

// install software

apt-get install inetutils-inetd
apt-get install tftpd-hpa
apt-get install dhcp3-server
apt-get install nfs-kernel-server


// Configure tftpd-hpa

alex@Karmic:/# vim /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"
alex@Karmic:/# /etc/init.d/tftpd-hpa restart


// Configure dhcpd

default-lease-time 259260;
max-lease-time 720000;

subnet 172.23.84.0 netmask 255.255.254.0 {
range 172.23.84.101 172.23.84.127;
option routers 172.23.84.254;
option subnet-mask 255.255.254.0;
option domain-name-servers 172.23.5.1, 168.95.1.1;
filename "pxelinux.0";
next-server 172.23.84.88;
}

alex@Karmic:/# /etc/init.d/dhcp3-server restart


// Configure nfs

alex@Karmic:/# vim /etc/exports
/home/livecd 172.23.80.0/20(async,no_root_squash,no_subtree_check,ro)

alex@Karmic:/# /etc/init.d/nfs-kernel-server reload


// Get file

Step1: 先抓 ubuntu desktop CD-ISO:

Step2: 取出光碟內 casper/*,將 filesystem.* 放到 nfs export 出來的目錄 /home/livecd/desktop/casper,
initrd.gz (initrd.lz) 與 vmlinuz 放到 /var/lib/tftpboot/desktop/
Step3: 把 ftp://archive.ubuntu.com/ubuntu/dists/karmic/main/installer-i386/current/images/netboot/
裡所有的檔案下載到TFTP server的根目錄 /var/lib/tftpboot/。

// Add boot menu

alex@Karmic:/var/lib/tftpboot# vim ubuntu-installer/i386/boot-screens/text.cfg
// ------------------------
default desktop
LABEL desktop
menu label Ubuntu 9.10 ^Desktop Live
menu default
kernel desktop/vmlinuz
append initrd=desktop/initrd.lz boot=casper netboot=nfs nfsroot=172.23.83.22:/home/livecd/desktop locale=zh_TW --
LABEL custom
menu label Ubuntu 9.10 Desktop ^Custom
kernel custom/vmlinuz
append initrd=custom/initrd.gz boot=casper netboot=nfs nfsroot=172.23.83.22:/home/livecd/custom locale=zh_TW --
LABEL netbook
menu label Ubuntu 9.10 ^Netbook Remix
kernel netbook/vmlinuz
append initrd=netbook/initrd.lz boot=casper netboot=nfs nfsroot=172.23.83.22:/home/livecd/netbook locale=zh_TW --
// ------------------------
alex@Karmic:/var/lib/tftpboot#

alex@Karmic:/var/lib/tftpboot$ cat pxelinux.cfg/default
include ubuntu-installer/i386/boot-screens/menu.cfg
default ubuntu-installer/i386/boot-screens/vesamenu.c32
prompt 0
timeout 100
alex@Karmic:/var/lib/tftpboot#


// 另外用 remastersys還可製作自已的 Live CD
http://www.geekconnection.org/remastersys/ubuntu.html
http://www.dedoimedo.com/computers/remastersys.html

No comments: