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

製作 ubuntu 開機隨身碟,並更改預設語言為 zh_TW

1. 用 ubuntu 9.10 Live 開機製作 USB boot 隨身碟
參考 http://www.pendrivelinux.com/create-a-ubuntu-9-10-live-usb-from-cd/

2. 更改預設語言
sudo -i
安裝 gfxboot
apt-get install gfxboot
apt-get install gfxboot-theme-ubuntu

cd /usr/share/gfxboot-theme-ubuntu/

# 編輯 Makefile
# 將 "DEFAULT_LANG =" 改成 "DEFAULT_LANG = zh_TW"

make

cp /usr/share/gfxboot-theme-ubuntu/boot/message bootlogo

# 將 bootlogo 複製到隨身碟 /syslinux 目錄下
# 如要用其他的檔名
# 也可以編輯 syslinux.cfg
# 改這一行 "gfxboot bootlogo" 即可 (要用短檔名)
# 順便把時間調少一點 "timeout 80" // 看起來單位是 1/10 秒

參考資料
http://0rz.tw/ayyKb