-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathfix_bootconfig.aarch64
executable file
·102 lines (96 loc) · 3.03 KB
/
fix_bootconfig.aarch64
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#! /bin/bash
# Custom menu to ensure that we boot correctly
# from local disk on UEFI
# https://github.com/openSUSE/agama/issues/1609
# KIWI config
dst="$1"
if [ ! -d "$dst" ] ; then
echo "fix_bootconfig.aarch64: image dir \"$dst\" not found"
exit 1
fi
# KIWI config which should normally be inherited
# from a parent process in our case xorriso
# but that's not the case.
test -f $dst/.profile && . $dst/.profile
#
# Create grub.cfg
#
cat >$dst/boot/grub2/grub.cfg <<XXX
# kiwi generated one time grub2 config file
set btrfs_relative_path="y"
export btrfs_relative_path
search --file --set=root /boot/0x11cebed2
set default=0
if [ -n "\$extra_cmdline" ]; then
submenu "Bootable snapshot \$snapshot_num" {
menuentry "If OK, run snapper rollback and reboot." { true; }
}
fi
if [ -n "\${iso_path}" ]; then
isoboot="iso-scan/filename=\${iso_path}"
fi
set timeout=10
set timeout_style=menu
if [ "\${grub_platform}" = "efi" ]; then
echo "Please press 't' to show the boot menu on this console"
fi
set gfxmode=auto
set font=(\$root)/boot/aarch64/loader/grub2/fonts/unicode.pf2
set ascii_font=grub2/themes/openSUSE/ascii.pf2
set sans_bold_14_font=grub2/themes/openSUSE/DejaVuSans-Bold14.pf2
set sans_10_font=grub2/themes/openSUSE/DejaVuSans10.pf2
set sans_12_font=grub2/themes/openSUSE/DejaVuSans12.pf2
if [ -f \${font} ];then
loadfont \${font}
fi
if [ -f (\$root)/boot/\${ascii_font} ];then
loadfont (\$root)/boot/\${ascii_font}
fi
if [ -f (\$root)/boot/\${sans_bold_14_font} ];then
loadfont (\$root)/boot/\${sans_bold_14_font}
fi
if [ -f (\$root)/boot/\${sans_10_font} ];then
loadfont (\$root)/boot/\${sans_10_font}
fi
if [ -f (\$root)/boot/\${sans_12_font} ];then
loadfont (\$root)/boot/\${sans_12_font}
fi
if [ -f (\$root)/boot/grub2/themes/openSUSE/theme.txt ];then
set theme=(\$root)/boot/grub2/themes/openSUSE/theme.txt
fi
terminal_input console
terminal_output gfxterm
menuentry "$kiwi_iname" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot}
echo Loading initrd...
initrd (\$root)/boot/aarch64/loader/initrd
}
menuentry "Failsafe -- $kiwi_iname" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} ide=nodma apm=off noresume edd=off nomodeset 3
echo Loading initrd...
initrd (\$root)/boot/aarch64/loader/initrd
}
menuentry "Mediacheck" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/aarch64/loader/linux mediacheck=1 plymouth.enable=0 \${isoboot}
echo Loading initrd...
initrd (\$root)/boot/aarch64/loader/initrd
}
menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os {
exit
}
if [ -f "/.snapshots/grub-snapshot.cfg" ]; then
source "/.snapshots/grub-snapshot.cfg"
fi
if [ "\${grub_platform}" = "efi" ]; then
hiddenentry "Text mode" --hotkey "t" {
set textmode=true
terminal_output console
}
fi
XXX