|
3#
楼主 |
发表于 2019-8-16 03:18:35
|
只看该作者
本帖最后由 hkkitlee 于 2019-8-16 03:24 编辑
.bTCpxe.sh
/bin/su tc -c '/usr/bin/tce-load -wi dnsmasq';
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=/var/lib/tftpboot
#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.", 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
pxe-service=X86PC, "Test for Legacy BIOS", test.bios
#2
pxe-service=IA64_EFI, "Boot IA64_EFI", uefi/ipxe64.efi
pxe-service=IA64_EFI, "Test IA64_EFI", uefi/test64.efi
#6
pxe-service=IA32_EFI, "Boot IA32_EFI", uefi/ipxe32.efi
pxe-service=IA32_EFI, "Test IA32_EFI", uefi/test32.efi
#7
pxe-service=X86-64_EFI, "Boot X86-64_EFI", uefi/ipxe64.efi
pxe-service=X86-64_EFI, "Test X86-64_EFI", uefi/test64.efi
#8
pxe-service=Xscale_EFI, "Boot BC_EFI", uefi/ipxe64.efi
pxe-service=Xscale_EFI, "Test BC_EFI", uefi/test64.efi
#9
pxe-service=BC_EFI, "Boot BC_EFI", uefi/ipxe64.efi
pxe-service=BC_EFI, "Test BC_EFI", uefi/test64.efi
EOF
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
sudo /bin/mkdir -p /var/lib/tftpboot/uefi
/usr/local/sbin/dnsmasq -9 &
sudo /usr/bin/wget https://hkkitlee.ddns.net:9000/undionly.pxe -O /var/lib/tftpboot/undionly.pxe ;
sudo /usr/bin/wget https://hkkitlee.ddns.net:9000/undionly.kpxe -O /var/lib/tftpboot/undionly.kpxe ;
sudo /usr/bin/wget https://hkkitlee.ddns.net:9000/undionly.kkpxe -O /var/lib/tftpboot/undionly.kkpxe ;
sudo /usr/bin/wget https://hkkitlee.ddns.net:9000/ipxe32.efi -O /var/lib/tftpboot/uefi/ipxe32.efi ;
sudo /usr/bin/wget https://hkkitlee.ddns.net:9000/ipxe64.efi -O /var/lib/tftpboot/uefi/ipxe64.efi ; |
|