blob: 9fe9eeefef55c716bc325ce45c8ed477ab9acdd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/bash -e
# create GPT table with EFI System Partition
rm -f test-disk
dd if=/dev/null of=test-disk bs=1M seek=64 count=1
parted --script test-disk "mklabel gpt" "mkpart ESP fat32 1M 64M" "set 1 boot on" "print"
# create FAT32 file system
LOOP=$(losetup --show -f -P test-disk)
mkfs.vfat -F32 $LOOP
mkdir -p mnt
mount $LOOP mnt
# install gummiboot
mkdir -p mnt/EFI/BOOT
cp gummibootx64.efi mnt/EFI/BOOT/BOOTX64.EFI
[ -e /boot/shellx64.efi ] && cp /boot/shellx64.efi mnt/
# install entries
mkdir -p mnt/loader/entries
echo -e "timeout 3\n" > mnt/loader/loader.conf
echo -e "title Test\nefi /test\n" > mnt/loader/entries/test.conf
echo -e "title Test2\nefi /test2\n" > mnt/loader/entries/test2.conf
echo -e "title Test3\nefi /test3\n" > mnt/loader/entries/test3.conf
echo -e "title Test4\nefi /test4\n" > mnt/loader/entries/test4.conf
echo -e "title Test5\nefi /test5\n" > mnt/loader/entries/test5.conf
sync
umount mnt
rmdir mnt
losetup -d $LOOP
|