*FreeBsd PXELINUX
เอกสารฉบับนี้เป็นการ install โดยใช้ sysinstall ซึ่งถูกแทนที่ด้วย bsdinstall ใน freebsd version 9
# install syslinux
1 2 3 4 5 |
yum install xinetd tftpd-server syslinux dhcp vsftdp -y cd /usr/shared/syslinux cp pxelinux.0 menu.c32 memdisk mboot.c32 chain.c32 /tftpboot |
FreeBsd 8.x use sysinstall for install freebsd.
@ NFS
++ PXEBOOT
use iso boot only from bsd
# Edit /etc/ dhcp.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
default-lease-time 600; max-lease-time 86300; option subnet-mask 255.255.255.0; option domain-name-servers 8.8.8.8,4.2.2.2; server-name LinuxDeployServer; filename "/pxelinux.0"; subnet 192.168.1.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option routers 192.168.1.254; next-server 192.168.1.115; range 192.168.1.150 192.168.1.250; option root-path "192.168.1.115:/tftpboot/pxeboot.d/freebsd/8.4/amd64"; } |
# Edit /etc/xinetd.d/tftp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot per_source = 11 cps = 100 2 flags = IPv4 } |
% service xinetd start
สร้าง menu mulit link pxelinux
# Edit /tftpboot/pxelinux.cfg/default
1 2 3 4 5 6 7 8 9 10 11 |
default vesamenu.c32 prompt 0 MENU TITLE PXE MENU LABEL Freebsd MENU MENU LABEL ^Freebsd Linux Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/freebsd.menu |
# Edit /tftpboot/pxelinux.cfg/freebsd.menu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
MENU TITLE Ubuntu Menu LABEL Main Menu MENU LABEL ^Return to Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/default MENU separator label Freebsd 9 menu label Freebsd 9 kernel vesamenu.c32 append pxelinux.cfg/graphics.conf pxelinux.cfg/freebsd9.menu label Freebsd 8 menu label Freebsd 8 kernel vesamenu.c32 append pxelinux.cfg/graphics.conf pxelinux.cfg/freebsd8.menu |
# Edit /tftpboot/pxelinux.cfg/freebsd8.menu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
MENU TITLE Freebsd 8 Menu LABEL Main Menu MENU LABEL ^PXE Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/graphics.conf pxelinux.cfg/freebsd.menu MENU separator label Freebsd 8.4 amd64 menu label Freebsd 8.4 amd64 PXE pxeboot.d/freebsd/8.4/amd64/boot/pxeboot TEXT HELP Install FreeBSD 8.4 for amd64 (64 bits) with normal filesytems ENDTEXT |
Download : http://ftp.freebsd.org/%2Fpub/FreeBSD/releases/amd64/ISO-IMAGES/8.4/FreeBSD-8.4-RELEASE-amd64-bootonly.iso
extract ที่ path:
1 2 3 |
/tftpboot/pxeboot.d/freebsd/8.4/amd64 |
ที่ระบุไว้ที่ dhcp.conf option root-path
1 2 3 4 |
mount -o loop freebsdxx.iso /mnt cp -Rav /mnt/* /tftpboot/pxeboot.d/freebsd/8.4/amd64 |
ในส่วน freebsd8.menu ทีระบุ
1 2 3 |
PXE pxeboot.d/freebsd/8.4/amd64/boot/pxeboot |
โดยเครื่อง guest จะโหลดจาก tftp protocol โดย ระบุไปที่ ไฟล์ pxeboot ที่ได้มาจาก iso
แก้ไข /tftpboot/image/freebsd/8.4/amd64/boot/loader.conf
1 2 3 4 5 6 7 |
mfsroot_load="YES" mfsroot_type="mfs_root" mfsroot_name="/boot/mfsroot" autoboot_delay=0 vfs.root.mountfrom="ufs:/dev/md0" |
แก้ไข /tftpboot/image/freebsd/8.4/amd64/boot/loader.rc
1 2 3 4 5 |
include /boot/loader.4th start check-password |
++ automate
แก้บน Freebsd
# Edit mfsroot.gz ทีอยู่ใน path /tftpboot/pxeboot.d/freebsd/8.4/amd64/boot
1 2 3 4 5 |
gunzip mfsroot.gz mdconfig -f mfsroot -u 0 mount /dev/md0 /mnt |
%cp install.cfg /mnt
1 2 3 4 5 |
umount /mnt mdconfig -d -u 0 gzip mfsroot |
# install.cfg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
debug=YES nonInteractive=YES noWarn=YES tryDHCP=YES hostname=saza domainname=vpls.local nfs=192.168.1.115:/tftpboot/image/freebsd/8.4/amd64 #netDev=em0 tryDHCP=YES mediaSetNFS distSetMinimum disk=ad10 partition=all bootManager=standard diskPartitionEditor #diskPartitionWrite ad10s1-1=ufs 12582912 / ad10s1-2=swap 4096000 none ad10s1-3=ufs 4194304 /var 1 ad10s1-4=ufs 2097152 /tmp 1 ad10s1-5=ufs 0 /usr 1 diskLabelEditor installCommit #command="/dist/inst_post" #system shutdown |
จากนั้น copy mfsroot.gz /tftpboot/pxeboot.d/freebsd/8.4/amd64/boot
config
nfs=192.168.1.115:/tftpboot/image/freebsd/8.4/amd64 ส่วนนี้จะเก็บ ไฟล์ iso freebsd FreeBSD-8.4-RELEASE-amd64-disc1.iso
Ref. ตัวอย่าง install.cfg
Ref. http://tonkersten.com/2011/06/96-freebsd-pxe-boot-part-2/
Ref. http://www.tnpi.net/computing/freebsd/pxe-netboot.shtml
Ref. http://blog.hostileadmin.com/2012/05/08/using-sysinstall-for-automated-freebsd-8-x-installs/
@ WITHOUT NFS
++ use iso boot only raw image
default not auto config url for path to install , Can modify mfsroot.gz ( ufs file system) config file install.cfg
1 2 3 4 5 6 |
label Freebsd 8.4 AMD64 ISO menu label Freebsd 8.4 AMD64 ISO linux memdisk APPEND initrd=image/freebsd/8.4/amd64/freebsd-8.4-amd64-bootonly.iso iso raw |
โดยระบุ APPEND initrd=image/freebsd/8.4/amd64/freebsd-8.4-amd64-bootonly.iso
path นี้ใช้ tftp protocol ในการโหลด ดังนั้น path ที่จะทำการ download ไว้
1 2 3 |
/tftpboot/image/freebsd/8.4/amd64/freebsd-8.4-amd64-bootonly.iso iso |
+ + mfsbsd image or iso
1 2 3 4 5 6 |
label Frebbsd 8.4 mfsbsd menu label Freebsd 8.4 mfsbsd kernel memdisk append initrd=pxeboot.d/freebsd/8.4/mfsbsd-8.4-RELEASE-amd64.img raw |
root: mfsroot
Execute
1 2 3 |
sysinstall |