summary refs log tree commit diff
path: root/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2019-05-18 17:49:05 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2019-05-18 18:35:37 +0200
commit1d86b05618a063378d7ffc89a9b4c33dd65a760c (patch)
tree1507fc79ed5a3966d0a9488da703985017664499 /gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch
parent08eafef8650922681bad10d9f5a3f92ff91616b6 (diff)
downloadguix-1d86b05618a063378d7ffc89a9b4c33dd65a760c.tar.gz
vm: Create installation media with MBR and HFS only, no GPT.
* gnu/build/vm.scm (make-iso9660-image): Accept XORRISO,
GRUB-MKRESCUE-ENVIRONMENT.
* gnu/system/vm.scm (iso9660-image): Pass XORRISO; accept
GRUB-MKRESCUE-ENVIRONMENT.
(system-disk-image): Pass GRUB-MKRESCUE-ENVIRONMENT.
* gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch: New file.
* gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/cdrom.scm (xorriso)[source]: Add patches.
[arguments]<#:phases>[install-frontends]:
Add phase.
Diffstat (limited to 'gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch')
-rw-r--r--gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch b/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch
new file mode 100644
index 0000000000..a43889d2c6
--- /dev/null
+++ b/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch
@@ -0,0 +1,47 @@
+https://dev.lovelyhq.com/libburnia/libisoburn/commit/1eb51f44dadb8b6c5f87533ca357186cdc1ac625
+diff --git a/frontend/grub-mkrescue-sed.sh b/frontend/grub-mkrescue-sed.sh
+index b3948c99..dcd9d696 100755
+--- a/frontend/grub-mkrescue-sed.sh
++++ b/frontend/grub-mkrescue-sed.sh
+@@ -120,6 +120,7 @@ fi
+ # "yes" overwrites the MBR partition table area in the EFI boot image by zeros.
+ # Some EFI implementations get stuck when seeing in the EFI partition a
+ # partition table entry which begins at LBA 0.
++# "extra" not only zeros the partition table but also the MBR signature.
+ efi_zero_inner_pt=no
+ if test -n "$MKRESCUE_SED_IN_EFI_NO_PT"
+ then
+@@ -192,24 +193,31 @@ then
+   find "$dir"
+ fi
+ 
+-if test "$efi_zero_inner_pt" = yes
++if test "$efi_zero_inner_pt" = yes -o "$efi_zero_inner_pt" = extra
+ then
+   did_dd=0
+   if test -e "$dir"/efi.img
+   then
++    # Look for 0x55 0xAA in bytes 510 and 511
+     magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \
+             od -c | head -1 | awk '{print $2 " " $3}')
+     if test "$magic" = "U 252"
+     then
++      echo "Performing actions for MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2
+       dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img
+       did_dd=1
++      if test "$efi_zero_inner_pt" = extra
++      then
++        dd if=/dev/zero bs=1 seek=510 count=2 conv=notrunc of="$dir"/efi.img
++      fi
++      echo >&2
+     fi
+   fi
+   if test "$did_dd" = 0
+   then
+     echo >&2
+     echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2
+-    echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=yes" >&2
++    echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2
+     echo >&2
+   fi
+ fi