Merge pull request #47 from the-maldridge/grub32
Add support for proper 32 bit grub
This commit is contained in:
commit
97ce376755
39
mklive.sh.in
39
mklive.sh.in
|
@ -28,7 +28,7 @@
|
||||||
#-
|
#-
|
||||||
trap "error_out $LINENO $?" INT TERM 0
|
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 INITRAMFS_PKGS="binutils xz device-mapper"
|
||||||
readonly PROGNAME=$(basename $0)
|
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
|
mount -o rw,flush -t vfat "${LOOP_DEVICE}" "${GRUB_EFI_TMPDIR}" >/dev/null 2>&1
|
||||||
|
|
||||||
cp -a $IMAGEDIR/boot $VOIDHOSTDIR
|
cp -a $IMAGEDIR/boot $VOIDHOSTDIR
|
||||||
xbps-uchroot $VOIDHOSTDIR grub-mkstandalone -- \
|
if [ $BASE_ARCH = "i686" ]; then
|
||||||
--directory="/usr/lib/grub/x86_64-efi" \
|
xbps-uchroot $VOIDHOSTDIR grub-mkstandalone -- \
|
||||||
--format="x86_64-efi" \
|
--directory="/usr/lib/grub/i386-efi" \
|
||||||
--compression="xz" --output="/tmp/bootx64.efi" \
|
--format="i386-efi" \
|
||||||
"boot/grub/grub.cfg"
|
--compression="xz" --output="/tmp/bootia32.efi" \
|
||||||
if [ $? -ne 0 ]; then
|
"boot/grub/grub.cfg"
|
||||||
umount "$GRUB_EFI_TMPDIR"
|
if [ $? -ne 0 ]; then
|
||||||
losetup --detach "${LOOP_DEVICE}"
|
umount "$GRUB_EFI_TMPDIR"
|
||||||
die "Failed to generate EFI loader"
|
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
|
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"
|
umount "$GRUB_EFI_TMPDIR"
|
||||||
losetup --detach "${LOOP_DEVICE}"
|
losetup --detach "${LOOP_DEVICE}"
|
||||||
rm -rf $GRUB_EFI_TMPDIR
|
rm -rf $GRUB_EFI_TMPDIR
|
||||||
|
|
Loading…
Reference in New Issue