blob: e2d50f6c3c9d43fda629fb3dc493f80be10c646d (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/sh
. samizdat-paths.sh
grub_config()
{
cat <<EOF
insmod echo
echo GRUB
insmod part_acorn
insmod part_amiga
insmod part_apple
insmod part_bsd
insmod part_dvh
insmod part_gpt
insmod part_msdos
insmod part_plan
insmod part_sun
insmod part_sunpc
insmod linux
insmod iso9660
echo Loading vmlinuz...
linux /linux/vmlinuz boot=samizdat components quiet splash
echo Loading initrd.img...
initrd /linux/initrd.img
echo Booting.
echo
boot
EOF
}
real_destdir=$samizdat_grub_efi_dir
destdir=$real_destdir.tmp
set -e
rm -r "${destdir}" 2>/dev/null || true
mkdir -p "${destdir}"/grub/i386-pc/
cp -r /usr/lib/grub/i386-pc/* "${destdir}"/grub/i386-pc/
rm "${destdir}"/grub/i386-pc/*.img || true
grub_config > "${destdir}"/load_cfg
set -x
grub-mkimage -O i386-pc -d /usr/lib/grub/i386-pc/ -o "${destdir}"/core.img -c "${destdir}"/load_cfg --prefix=/grub iso9660 biosdisk
cat /usr/lib/grub/i386-pc/cdboot.img "${destdir}"/core.img > "${destdir}"/grub/i386-pc/eltorito.img
cat /usr/lib/grub/i386-pc/boot.img "${destdir}"/core.img > "${destdir}"/embedded.img
rm -r "$real_destdir" 2>/dev/null || true
mv -T "$destdir" "$real_destdir"
|