This repository was archived by the owner on Dec 20, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathadd-uefi-support
executable file
·50 lines (42 loc) · 1.7 KB
/
add-uefi-support
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -e
. data/extra.sh
mkdir -p efi/boot
if [ ! -f efi/boot/grub.efi ]; then
UUID=`grub-probe -d $DEVICE -t fs_uuid`
GRML_ISO=
for i in grml-plus/grml*.iso; do GRML_ISO=`basename $i`; done
echo "search.fs_uuid $UUID root" >../load.cfg
echo "loopback grml (\$root)/grml-plus/$GRML_ISO" >>../load.cfg
echo "set prefix=(grml)/boot/grub" >>../load.cfg
echo "insmod normal" >>../load.cfg
echo 'set EFI=1' >>../load.cfg
echo 'export EFI' >>../load.cfg
echo 'set prefix=($root)/grml-plus/grub' >>../load.cfg
grub-mkimage -c ../load.cfg -d /usr/lib/grub/x86_64-efi -O x86_64-efi \
--output=efi/boot/grub.efi --prefix=/ \
fat iso9660 part_msdos loopback test all_video search_fs_uuid
fi
if [ ! -f efi/boot/bootx64.efi ]; then
wget -P .. -nc 'http://github.com/schierlm/grml-plus-uefi-tools/releases/download/v0.1/protector.efi'
cp ../protector.efi efi/boot/bootx64.efi
fi
if [ ! -f efi/boot/efi-shell.efi ]; then
wget -P .. -nc 'http://sourceforge.net/p/edk2/code/15566/tree/branches/UDK2014/EdkShellBinPkg/FullShell/X64/Shell_Full.efi?format=raw'
cp '../Shell_Full.efi?format=raw' efi/boot/efi-shell.efi
fi
if [ ! -f efi/boot/uefi-shell.efi ]; then
wget -P .. -nc 'http://sourceforge.net/p/edk2/code/15566/tree/branches/UDK2014/ShellBinPkg/UefiShell/X64/Shell.efi?format=raw'
cp '../Shell.efi?format=raw' efi/boot/uefi-shell.efi
fi
if [ ! -f efi/boot/memtest.efi ]; then
wget -P .. -nc \
http://www.memtest86.com/downloads/memtest86-iso.zip
mkdir -p ../efimemtest/mnt
unzip ../memtest86-iso.zip -d ../efimemtest
mount ../efimemtest/Memtest86-*.iso ../efimemtest/mnt -o ro,loop
cp ../efimemtest/mnt/efi/boot/bootx64.efi efi/boot/memtest.efi
umount ../efimemtest/mnt
rm -r ../efimemtest
fi
extra_cleanup