about summary refs log tree commit diff
path: root/mklive.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'mklive.sh.in')
-rw-r--r--mklive.sh.in43
1 files changed, 29 insertions, 14 deletions
diff --git a/mklive.sh.in b/mklive.sh.in
index 58784c6..9e6a9c3 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)
 
@@ -215,18 +215,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
@@ -272,8 +287,6 @@ generate_iso_image() {
         -output "$CURDIR/$OUTPUT_FILE" "$IMAGEDIR" || die "Failed to generate ISO image"
 }
 
-BOOT_FILES=
-XBPS_REPOSITORY="--repository=http://repo.voidlinux.eu/current --repository=http://muslrepo.voidlinux.eu/current"
 #
 # main()
 #
@@ -299,6 +312,8 @@ while getopts "a:b:B:r:c:C:T:Kk:l:i:s:S:o:p:h" opt; do
 done
 shift $((OPTIND - 1))
 
+XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=http://repo.voidlinux.eu/current --repository=http://muslrepo.voidlinux.eu/current"
+
 ARCH=$(uname -m)
 
 # Set defaults