about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Aldridge <aldridge.mac@gmail.com>2015-10-14 23:44:08 -0500
committerMichael Aldridge <aldridge.mac@gmail.com>2015-11-05 03:54:19 -0600
commitd6a20ce1c80e4f2c3c9ee476e7598e9c2141e3c2 (patch)
tree80c3c446cf9f13b218201489a549102d0770ae02
parentd0f0910b6738b175d2ecc6fdbf6515927cd9d81e (diff)
downloadhrmpf-d6a20ce1c80e4f2c3c9ee476e7598e9c2141e3c2.tar.gz
hrmpf-d6a20ce1c80e4f2c3c9ee476e7598e9c2141e3c2.tar.xz
hrmpf-d6a20ce1c80e4f2c3c9ee476e7598e9c2141e3c2.zip
Add support for proper 32 bit grub
-rw-r--r--mklive.sh.in39
1 files changed, 27 insertions, 12 deletions
diff --git a/mklive.sh.in b/mklive.sh.in
index 913a0c3..797df5b 100644
--- a/mklive.sh.in
+++ b/mklive.sh.in
@@ -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