diff options
Diffstat (limited to 'src/grub-efi.sh')
-rwxr-xr-x | src/grub-efi.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/grub-efi.sh b/src/grub-efi.sh new file mode 100755 index 0000000..e2d50f6 --- /dev/null +++ b/src/grub-efi.sh | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/bin/sh | ||
2 | . samizdat-paths.sh | ||
3 | |||
4 | grub_config() | ||
5 | { | ||
6 | cat <<EOF | ||
7 | insmod echo | ||
8 | echo GRUB | ||
9 | insmod part_acorn | ||
10 | insmod part_amiga | ||
11 | insmod part_apple | ||
12 | insmod part_bsd | ||
13 | insmod part_dvh | ||
14 | insmod part_gpt | ||
15 | insmod part_msdos | ||
16 | insmod part_plan | ||
17 | insmod part_sun | ||
18 | insmod part_sunpc | ||
19 | |||
20 | insmod linux | ||
21 | insmod iso9660 | ||
22 | |||
23 | echo Loading vmlinuz... | ||
24 | linux /linux/vmlinuz boot=samizdat components quiet splash | ||
25 | echo Loading initrd.img... | ||
26 | initrd /linux/initrd.img | ||
27 | echo Booting. | ||
28 | echo | ||
29 | boot | ||
30 | |||
31 | EOF | ||
32 | } | ||
33 | |||
34 | real_destdir=$samizdat_grub_efi_dir | ||
35 | destdir=$real_destdir.tmp | ||
36 | |||
37 | set -e | ||
38 | rm -r "${destdir}" 2>/dev/null || true | ||
39 | mkdir -p "${destdir}"/grub/i386-pc/ | ||
40 | cp -r /usr/lib/grub/i386-pc/* "${destdir}"/grub/i386-pc/ | ||
41 | rm "${destdir}"/grub/i386-pc/*.img || true | ||
42 | |||
43 | grub_config > "${destdir}"/load_cfg | ||
44 | set -x | ||
45 | grub-mkimage -O i386-pc -d /usr/lib/grub/i386-pc/ -o "${destdir}"/core.img -c "${destdir}"/load_cfg --prefix=/grub iso9660 biosdisk | ||
46 | cat /usr/lib/grub/i386-pc/cdboot.img "${destdir}"/core.img > "${destdir}"/grub/i386-pc/eltorito.img | ||
47 | cat /usr/lib/grub/i386-pc/boot.img "${destdir}"/core.img > "${destdir}"/embedded.img | ||
48 | |||
49 | rm -r "$real_destdir" 2>/dev/null || true | ||
50 | mv -T "$destdir" "$real_destdir" | ||