-
Notifications
You must be signed in to change notification settings - Fork 1
/
grub.cfg
63 lines (50 loc) · 1.52 KB
/
grub.cfg
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
# MIT license (c) 2024 https://github.com/slowpeek
# Homepage: https://github.com/slowpeek/ubuntu-remaster-bbb
# About: Isoboot grub config for ubuntu images
insmod regexp
set any=y
for iso in /boot/iso/*buntu*.iso; do
if [ ! -e "$iso" ]; then
echo ---
echo '/boot/iso does not contain any ubuntu-like iso images'
echo 'Press Esc to continue'
sleep -i 10
set any=n
break
fi
regexp --set 1:iso_name '/([^/]+)$' "$iso"
menuentry "$iso_name" "$iso" {
if [ -e (loop) ]; then loopback -d loop; fi
loopback loop "$2"
set casper='(loop)/casper'
if [ ! -e "$casper" ]; then
echo 'Not a casper-based iso'
echo 'Press Esc to continue'
sleep -i 10
else
set extra='file=/cdrom/preseed/ubuntu.seed fsck.mode=skip'
if [ -e "$casper"/minimal.standard.live.squashfs ]; then
set extra="$extra layerfs-path=minimal.standard.live.squashfs"
fi
for kernel in "$casper"/hwe-vmlinuz "$casper"/vmlinuz*; do
if [ -e "$kernel" ]; then break; fi
done
for initrd in "$casper"/hwe-initrd "$casper"/initrd*; do
if [ -e "$initrd" ]; then break; fi
done
linux "$kernel" boot=casper iso-scan/filename="$2" $extra
initrd "$initrd"
fi
}
done
if [ "$any" = y ]; then
menuentry --- {
true
}
fi
menuentry Reboot {
reboot
}
menuentry Shutdown {
halt
}