Skip to content

Instantly share code, notes, and snippets.

@CRTified
Created November 2, 2017 21:00
Show Gist options
  • Save CRTified/eeaf1a8677b059d3e523954da9d5c88b to your computer and use it in GitHub Desktop.
Save CRTified/eeaf1a8677b059d3e523954da9d5c88b to your computer and use it in GitHub Desktop.
iPXE netboot
#!/bin/sh
BOOTUUID=`blkid -o value $(df /boot | grep "$MOUNTPOINT\$"| cut -f1 -d" ") | head -n 2 | tail -n1`;
ROOTUUID=`blkid -o value $(df / | grep "$MOUNTPOINT\$"| cut -f1 -d" ") | head -n 2 | tail -n1`;
PREFIX=""
if [ "$BOOTUUID" = "$ROOTUUID" ]; then
PREFIX="/boot"
fi;
mkdir -p /boot/ipxe/;
cp -R /usr/share/ipxe-netboot/* /boot/ipxe/;
cat <<EOF
menuentry "Arch Linux iPXE x86_64" --class arch {
search --no-floppy --fs-uuid --set $BOOTUUID
linux16 ${PREFIX}/ipxe/ipxe.lkrn
initrd ${PREFIX}/ipxe/ipxe.pxe
}
1. Install ipxe-netboot from AUR
2. Put script at /etc/grub/
3. Make script executable
4. Rebuild grub config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment