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