Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
v0.9.9.5
Browse files Browse the repository at this point in the history
- Support for chainloading unsigned .EFI files (eg Clover, rEFInd) from Grub2 with Secure Boot enabled.
- Improved Grub2 script for ISO & IMG Mapper.
- Add Restore_AIOBOOT_Drive.exe to AIO_MAP partition, you can restore partitions from Windows without having to boot into Grub2.
- Add shimia32 (bootia32.efi) and MokManager IA32 (mmia32.efi) obtained from Fedora. Tested on VMware Workstation.
- New a1ive Grub2.
- Fixed bugs.
  • Loading branch information
nguyentumine committed Aug 19, 2020
1 parent 0c1a1de commit efa5046
Show file tree
Hide file tree
Showing 201 changed files with 933 additions and 939 deletions.
Binary file modified AIO/Files/PartIMG_ROOT.img
Binary file not shown.
Binary file modified AIO/Tools/AIOCreator_x64.exe
Binary file not shown.
1 change: 0 additions & 1 deletion AIO/grub/background.cfg

This file was deleted.

37 changes: 19 additions & 18 deletions AIO/grub/functions.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# GRUB is free software: you can redistribute it and/or modify
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
Expand Down Expand Up @@ -565,9 +566,9 @@ function PartitionImageMapper {
loopback filefs "$file"
probe -f -s _filefs filefs
loopback -d filefs
if [ "$_filefs" == "iso9660" ]; then
if [ "$_filefs" == "iso9660" ] -o [ "$_filefs" == "udf" ]; then
set _fstype=0xA8
elif [ "$_filefs" == "fat" ] -o [ "$_filefs" == "udf" ]; then
elif [ "$_filefs" == "fat" ]; then
set _fstype=0x0C
elif [ "$_filefs" == "ntfs" ] -o [ "$_filefs" == "exfat" ]; then
set _fstype=0x07
Expand All @@ -584,12 +585,6 @@ function PartitionImageMapper {
return 1
fi
echo "${donemsg}"

if [ "$_filefs" == "iso9660" ] -o [ "$_filefs" == "udf" ]; then
set vdtype="CD"
else
set vdtype="HD"
fi
unset _filefs

for partpartimg in 1 2 3 4; do
Expand Down Expand Up @@ -617,21 +612,26 @@ function PartitionImageMapper {
fi
echo "${donemsg}"

blocklist --disk --set=fileblocklist "${file}"
blocklist --disk --set=imgblocklist "/AIO/Files/PartIMG_ROOT.img"
parttool hd${disknum},${scheme}${partnum} type=0x00
if [ -n "$efi" ]; then
set currentdev="hd${disknum},${scheme}${partnum}"

map -x vd0
if map (hd${disknum},${scheme}${partfile}) vd0; then
if map (hd${disknum})${fileblocklist} vd0; then
set root=vd0
parttool ${currentdev} type=0x00
if [ -e /boot/loader.efi ]; then
if [ -e /efi/boot/grub${_SPEC_UEFI_ARCH}.efi ]; then
chainloader -b /efi/boot/grub${_SPEC_UEFI_ARCH}.efi
return 0
elif [ -e /boot/loader.efi ]; then
chainloader -b /boot/loader.efi
return 0
fi
else
parttool ${currentdev} type=0x00
set root=hd${disknum},${scheme}${partfile}
if [ -e /boot/grub/grub.cfg ]; then
if [ -e /efi/boot/grub${_SPEC_UEFI_ARCH}.efi ]; then
chainloader -b /efi/boot/grub${_SPEC_UEFI_ARCH}.efi
return 0
elif [ -e /boot/grub/grub.cfg ]; then
configfile /boot/grub/grub.cfg
elif [ -e /efi/boot/grub.cfg ]; then
configfile /efi/boot/grub.cfg
Expand All @@ -646,9 +646,10 @@ function PartitionImageMapper {
fi
fi
else
regexp -s _path '\(.*\)(.*)' "$file"
set opt="root ${g4droot};/AIO/mapper.g4b ${disknum} ${g4dpartnum} ${3} ${_path}"
linux ${g4d_path}/grub.exe --config-file=${opt}
loopback imgloop (hd${disknum})${imgblocklist}
set opt="map (hd${disknum})${imgblocklist} (fd1) || map --mem (hd${disknum})${imgblocklist} (fd1);map --hook;root (fd1);/AIO/MAP ${disknum} ${3} ${fileblocklist}"
linux16 (imgloop)/AIO/grub.exe --config-file=${opt}
boot
fi
return 0
}
Expand Down
Binary file modified AIO/grub/g2ldr
Binary file not shown.
76 changes: 46 additions & 30 deletions AIO/grub/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,52 @@ if [ -s $prefix/grubenv ]; then
fi
fi

if [ "${grub_platform}" == "efi" ]; then
set efi=1
export efi
if [ "${grub_cpu}" == "x86_64" ]; then
set _SPEC_UEFI_ARCH="x64"
set _SPEC_UEFI_ARCH_2="64"
set _SPEC_UEFI_ARCH_3="64"
else
set _SPEC_UEFI_ARCH="ia32"
set _SPEC_UEFI_ARCH_2="86"
set _SPEC_UEFI_ARCH_3="32"
fi
export _SPEC_UEFI_ARCH
export _SPEC_UEFI_ARCH_2
export _SPEC_UEFI_ARCH_3

if [ -z "$grub_secureboot" ]; then
set rootsaved=${root}
search -s -f -q /efi/microsoft/boot/bootmgfw.efi
search -s -f -q /efi/boot/boot${_SPEC_UEFI_ARCH}.efi
getenv -t uint8 SecureBoot grub_secureboot
if [ "${grub_secureboot}" = "1" ]; then
export grub_secureboot="Enabled"
sbpolicy -i
fucksb -i
fucksb --off
fi
if [ "${grub_secureboot}" = "0" ]; then
export grub_secureboot="Disabled";
fi
set root=${rootsaved}
fi
elif [ "${grub_platform}" == "pc" ]; then
set modules="linux linux16 afs bfs chain ext2 f2fs hfs hfsplus iso9660 jfs linux16 part_acorn part_apple part_bsd part_dfly part_dvh part_plan part_sun part_sunpc udf ufs1 ufs1_be ufs2 xfs zfs sfs progress search regexp"
for module in ${modules}; do
insmod ${module}
done
unset modules
set pc=1
set memdisk="(${root})/AIO/Tools/memdisk"
set g4d_path="(${root})/AIO/Tools/grub4dos"
export pc
export memdisk
export g4d_path
fi

if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
Expand Down Expand Up @@ -60,36 +106,6 @@ function load_video {
fi
}

if [ "${grub_platform}" == "efi" ]; then
set efi=1
export efi
if [ "${grub_cpu}" == "x86_64" ]; then
set _SPEC_UEFI_ARCH="x64"
set _SPEC_UEFI_ARCH_2="64"
set _SPEC_UEFI_ARCH_3="64"
else
set _SPEC_UEFI_ARCH="ia32"
set _SPEC_UEFI_ARCH_2="86"
set _SPEC_UEFI_ARCH_3="32"
fi
export _SPEC_UEFI_ARCH
export _SPEC_UEFI_ARCH_2
export _SPEC_UEFI_ARCH_3
elif [ "${grub_platform}" == "pc" ]; then
set modules="afs bfs chain ext2 f2fs hfs hfsplus iso9660 jfs part_acorn part_apple part_bsd part_dfly part_dvh part_plan part_sun part_sunpc udf ufs1 ufs1_be ufs2 xfs zfs sfs";
for module in ${modules};
do
insmod ${module};
done;
unset modules
set pc=1
set memdisk="(${root})/AIO/Tools/memdisk"
set g4d_path="(${root})/AIO/Tools/grub4dos"
export pc
export memdisk
export g4d_path
fi

if [ -z "$bgloaded" ]; then
if [ -z "${font}" ]; then
if [ -e ${prefix}/fonts/fonts.cfg ]; then source ${prefix}/fonts/fonts.cfg; else font=unicode-small; fi
Expand Down
Binary file modified AIO/grub/grub2win
Binary file not shown.
Binary file modified AIO/grub/i386-efi/ahci.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/cbmemc.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/cmdline_cat_test.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/conv.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/cryptodisk.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/div_test.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/dp.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/ehci.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/functional_test.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/gdb.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/geli.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/gpt.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/ini.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/ldm.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/legacy_password_test.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/linux16.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/luks.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/luks2.mod
Binary file not shown.
Binary file modified AIO/grub/i386-efi/memrw.mod
Binary file not shown.
Loading

0 comments on commit efa5046

Please sign in to comment.