-
-
Save Gamer-Guy12/7734ffde77f582aef124a0610221e3a5 to your computer and use it in GitHub Desktop.
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/bash | |
| rm -f disk.img | |
| dd if=/dev/zero of=disk.img bs=1M count=256 | |
| parted disk.img mklabel gpt | |
| parted disk.img mkpart ESP fat32 1MiB 255MiB | |
| parted disk.img set 1 esp on | |
| LOOPBACK=$(losetup -o $((2048 * 512)) --sizelimit $((254 * 1024 * 1024)) -f disk.img --show) | |
| mkfs.vfat -F 16 -n "EFI System" $LOOPBACK | |
| mkdir img | |
| mount $LOOPBACK img | |
| grub-install \ | |
| --target=x86_64-efi \ | |
| --efi-directory=img \ | |
| --boot-directory=img/boot \ | |
| --removable \ | |
| --no-nvram | |
| cp boot/ img/ -r | |
| umount img | |
| rm -r img | |
| losetup -d $LOOPBACK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment