Add support for proper 32 bit grub

This commit is contained in:
Michael Aldridge 2015-10-14 23:44:08 -05:00
parent d0f0910b67
commit d6a20ce1c8
1 changed files with 27 additions and 12 deletions

View File

@ -28,7 +28,7 @@
#-
trap "error_out $LINENO $?" INT TERM 0
readonly REQUIRED_PKGS="base-files libgcc dash coreutils sed tar gawk syslinux grub-x86_64-efi squashfs-tools xorriso"
readonly REQUIRED_PKGS="base-files libgcc dash coreutils sed tar gawk syslinux grub-i386-efi grub-x86_64-efi squashfs-tools xorriso"
readonly INITRAMFS_PKGS="binutils xz device-mapper"
readonly PROGNAME=$(basename $0)
@ -208,18 +208,33 @@ generate_grub_efi_boot() {
mount -o rw,flush -t vfat "${LOOP_DEVICE}" "${GRUB_EFI_TMPDIR}" >/dev/null 2>&1
cp -a $IMAGEDIR/boot $VOIDHOSTDIR
xbps-uchroot $VOIDHOSTDIR grub-mkstandalone -- \
--directory="/usr/lib/grub/x86_64-efi" \
--format="x86_64-efi" \
--compression="xz" --output="/tmp/bootx64.efi" \
"boot/grub/grub.cfg"
if [ $? -ne 0 ]; then
umount "$GRUB_EFI_TMPDIR"
losetup --detach "${LOOP_DEVICE}"
die "Failed to generate EFI loader"
if [ $BASE_ARCH = "i686" ]; then
xbps-uchroot $VOIDHOSTDIR grub-mkstandalone -- \
--directory="/usr/lib/grub/i386-efi" \
--format="i386-efi" \
--compression="xz" --output="/tmp/bootia32.efi" \
"boot/grub/grub.cfg"
if [ $? -ne 0 ]; then
umount "$GRUB_EFI_TMPDIR"
losetup --detach "${LOOP_DEVICE}"
die "Failed to generate EFI loader"
fi
mkdir -p ${GRUB_EFI_TMPDIR}/EFI/BOOT
cp -f $VOIDHOSTDIR/tmp/bootia32.efi ${GRUB_EFI_TMPDIR}/EFI/BOOT/BOOTIA32.EFI
else
xbps-uchroot $VOIDHOSTDIR grub-mkstandalone -- \
--directory="/usr/lib/grub/x86_64-efi" \
--format="x86_64-efi" \
--compression="xz" --output="/tmp/bootx64.efi" \
"boot/grub/grub.cfg"
if [ $? -ne 0 ]; then
umount "$GRUB_EFI_TMPDIR"
losetup --detach "${LOOP_DEVICE}"
die "Failed to generate EFI loader"
fi
mkdir -p ${GRUB_EFI_TMPDIR}/EFI/BOOT
cp -f $VOIDHOSTDIR/tmp/bootx64.efi ${GRUB_EFI_TMPDIR}/EFI/BOOT/BOOTX64.EFI
fi
mkdir -p ${GRUB_EFI_TMPDIR}/EFI/BOOT
cp -f $VOIDHOSTDIR/tmp/bootx64.efi ${GRUB_EFI_TMPDIR}/EFI/BOOT/BOOTX64.EFI
umount "$GRUB_EFI_TMPDIR"
losetup --detach "${LOOP_DEVICE}"
rm -rf $GRUB_EFI_TMPDIR