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
|
insmod part_gpt
insmod fat
insmod chain
#insmod part_msdos
#insmod ext2
echo
echo "Scanning, first pass..."
#list_env
#echo "eins: '${1}' oder '$1'"
#set
#sleep 10
#for efi in (*,gpt*)/efi/*/grub.cfg (*,gpt*)/efi/*/*/grub.cfg (*,gpt*)/grub.cfg (*,gpt*)/*/grub.cfg (*,gpt*)/efi/grub/grubx64.efi (*,gpt*)/efi/boot/bootx64.efi (*,gpt*)/efi/*/*/bootmgfw.efi (*,gpt*)/efi/*/*.efi ; do
for efi in (*,gpt*)/efi/grub/grubx64.efi (*,gpt*)/efi/boot/bootx64.efi (*,gpt*)/efi/*/*/bootmgfw.efi (*,gpt*)/efi/*/*.efi \
(*,msdos*)/efi/grub/grubx64.efi (*,msdos*)/efi/boot/bootx64.efi (*,msdos*)/efi/*/*/bootmgfw.efi (*,msdos*)/efi/*/*.efi; do
regexp --set=1:efi_device '^\((.*)\)/' "${efi}"
done
echo "Scanning, second pass..."
for efi in (*,gpt*)/efi/grub/grubx64.efi (*,gpt*)/efi/boot/bootx64.efi (*,gpt*)/efi/*/*/bootmgfw.efi (*,gpt*)/efi/*/*.efi \
(*,msdos*)/efi/grub/grubx64.efi (*,msdos*)/efi/boot/bootx64.efi (*,msdos*)/efi/*/*/bootmgfw.efi (*,msdos*)/efi/*/*.efi; do
if [ -e "${efi}" ]; then
#regexp --set=1:efi_device '^\((.*)\)/' "${efi}"
regexp --set=1:root '^(\(.*\))/' "${efi}"
regexp --set=1:efi_path '^\(.*\)(/.*)$' "${efi}"
echo " >> Found operating system! <<"
echo " Path: '${efi}' on '${root}'"
echo " Fallback '${efi_path}'"
#echo " Booting in 5s..."
#sleep --interruptible --verbose 5
chainloader "${efi}"
boot
echo " That failed..."
fi
done
echo "No EFI known OS found. Reboot."
sleep --interruptible --verbose 15
reboot
|