|
set -- $(cat /proc/cmdline)
for x in "$@"; do
case "$x" in
myip=*)
export myip="${x#myip=}"
;;
pxeroot=*)
export pxeroot"${x#pxeroot=}"
;;
esac
done
#mount
for i in $(ls /mnt); do
mount /mnt/$i
done
if [ !-n $bootmulu ]; then
mulu=$( find /mnt/ -name pxeboot -type d)
else
mulu=$( find /mnt/ -name $pxeroot -type d)
fi
sudo /bin/cat << EOF > /etc/dnsmasq.conf
#Don't function as a DNS server:
port=0
#Log lots of extra information about DHCP transactions.
log-dhcp
enable-tftp
tftp-root=$mulu
#Disable re-use of the DHCP servername and filename fields as extra
#option space. That's to avoid confusing some old or broken DHCP clients.
dhcp-no-override
pxe-prompt="Press F8 for NBP (Net Boot Program) menu.Default ipxe.", 10
#0
#pxe-service=X86PC, "kkpxe for Legacy BIOS", undionly.kkpxe
#pxe-service=X86PC, "kpxe for Legacy BIOS", undionly.kpxe
#pxe-service=X86PC, "pxe for Legacy BIOS", undionly.pxe
#2
#pxe-service=IA64_EFI, "Boot IA64_EFI", uefi/ipxe64.efi
#6
#pxe-service=IA32_EFI, "Boot IA32_EFI", uefi/ipxe32.efi
#7
#pxe-service=X86-64_EFI, "Boot X86-64_EFI", uefi/ipxe64.efi
#8
#pxe-service=Xscale_EFI, "Boot BC_EFI", uefi/ipxe64.efi
#9
#pxe-service=BC_EFI, "Boot BC_EFI", uefi/ipxe64.efi
EOF
#test
cd $mulu
for biosfilea in $(find *bios* -type f ); do
echo pxe-service=X86PC, "${biosfilea%.*}", ${biosfilea%.0} >> /etc/dnsmasq.conf
done
for biosfileb in $(find *.0 -type f ); do
echo pxe-service=X86PC, "${biosfileb%.*}", ${biosfileb%.0} >> /etc/dnsmasq.conf
done
for efi64a in $(find *64* -type f ); do
echo pxe-service=BC_EFI, "$efi64a", $efi64a >> /etc/dnsmasq.conf
done
for efi64b in $(find *64* -type f ); do
echo pxe-service=X86-64_EFI, "$efi64b", $efi64b >> /etc/dnsmasq.conf
done
for efi64c in $(find *64* -type f ); do
echo pxe-service=IA64_EFI, "$efi64c", $efi64c >> /etc/dnsmasq.conf
done
for efi32 in $(find *32* -type f ); do
echo pxe-service=IA32_EFI, "$efi32", $efi32 >> /etc/dnsmasq.conf
done
sleep 8
ip=$(/sbin/ifconfig |grep -v 127 | grep 'inet ' | sed 's/^.*inet addr://g' | sed 's/ *Bcast.*$//g')
echo "dhcp-range=$ip,proxy" >> /etc/dnsmasq.conf
echo tftp:$mulu
echo $ip
sleep 2
/usr/local/sbin/dnsmasq -9 &
/usr/local/httpd/sbin/httpd -p 80 -h $mulu &
filetool.sh -b
cd /tce/optional
我改成这样了,暂时用pxelinux能启 |
|