Created
November 2, 2017 21:00
-
-
Save CRTified/eeaf1a8677b059d3e523954da9d5c88b to your computer and use it in GitHub Desktop.
iPXE netboot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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