2024-09-11 23:40:51 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "Generating pxelinux for your configs"
|
|
|
|
rm pxeconfigs/*
|
2024-10-15 10:44:09 -04:00
|
|
|
#rm /var/lib/tftpboot/pxelinux/pxelinux.cfg/01*
|
2024-09-11 23:40:51 -04:00
|
|
|
|
|
|
|
function gen_file_config {
|
|
|
|
role=$1
|
|
|
|
mac=$(echo $2 | sed 's/\:/\-/g')
|
|
|
|
arp_type="01"
|
|
|
|
image=$3
|
|
|
|
disk_type=$4
|
|
|
|
|
|
|
|
echo "#$2
|
|
|
|
|
|
|
|
timeout 1200
|
2024-10-15 10:44:09 -04:00
|
|
|
ui menu.c32
|
2024-09-11 23:40:51 -04:00
|
|
|
menu title Infidel's PXE boot Manager
|
|
|
|
# Background image *must* be the same resolution as the resolution here.
|
2024-10-15 10:44:09 -04:00
|
|
|
#MENU RESOLUTION 640 480
|
|
|
|
#MENU BACKGROUND bg.png
|
2024-09-11 23:40:51 -04:00
|
|
|
|
|
|
|
# White on a black/transparent background.
|
|
|
|
MENU COLOR screen * #ffffffff #00000000 std
|
|
|
|
|
|
|
|
# Blue borders on a black/transparent background.
|
|
|
|
# Borders have padding, so that background matters.
|
|
|
|
MENU COLOR border * #ff0000ff #00000000 std
|
|
|
|
|
|
|
|
# Title bar is cyan on a black/transparent background.
|
|
|
|
MENU COLOR title * #ff00ffff #00000000 std
|
|
|
|
|
|
|
|
# Selection bar is white on a magenta/opaque background.
|
|
|
|
MENU COLOR sel * #ffffffff #ffff00ff none
|
|
|
|
|
|
|
|
# Unselected menu items are white on black/transparent.
|
|
|
|
MENU COLOR unsel * #ffffffff #00000000 std
|
|
|
|
# menu resolution 604 455
|
|
|
|
# menu background bg.png
|
|
|
|
# default $role
|
|
|
|
default localboot
|
|
|
|
prompt 0
|
|
|
|
|
|
|
|
label $role
|
|
|
|
menu label Ignite Openshift: $role < $2 >
|
2024-10-15 10:44:09 -04:00
|
|
|
|
|
|
|
KERNEL boot/rhcos-live-kernel-x86_64
|
|
|
|
APPEND initrd=boot/rhcos-live-initramfs.x86_64.img coreos.live.rootfs_url=http://192.169.22.1:8080/boot/rhcos/rhcos-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/$disk_type coreos.inst.ignition_url=http://192.169.22.1:8080/boot/auth/$role.ign
|
2024-09-11 23:40:51 -04:00
|
|
|
|
|
|
|
label localboot
|
|
|
|
menu label Boot from Local Drive
|
|
|
|
localboot 0
|
|
|
|
menu end
|
|
|
|
" > pxeconfigs/$arp_type'-'$mac
|
|
|
|
}
|
|
|
|
|
|
|
|
while IFS="," read -r role mac image disk_type
|
|
|
|
do
|
|
|
|
echo $role ' ---> ' $mac ' Finished '
|
|
|
|
gen_file_config $role $mac $image $disk_type
|
|
|
|
done < <( cat mac-lists.csv )
|
|
|
|
|
2024-10-15 10:44:09 -04:00
|
|
|
#cp -R pxeconfigs/* /var/lib/tftpboot/pxelinux/pxelinux.cfg/
|
2024-09-11 23:40:51 -04:00
|
|
|
|
|
|
|
|