From efd1f97aac28cac211c594a7dc7de020d7b21a02 Mon Sep 17 00:00:00 2001
From: Andreas Loibl <andreas@andreas-loibl.de>
Date: Mon, 27 Feb 2012 11:12:29 +0100
Subject: hide the non-HFS EFI-partitions from the Mac OS Bootloader

---
 config/binary_local-hooks/mkefipart-fat                            | 3 +++
 config/chroot_local-includes/lib/live/config/900-enable-persistent | 1 +
 isohybrid-acritox                                                  | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/config/binary_local-hooks/mkefipart-fat b/config/binary_local-hooks/mkefipart-fat
index 90dd64c..3062d9a 100755
--- a/config/binary_local-hooks/mkefipart-fat
+++ b/config/binary_local-hooks/mkefipart-fat
@@ -33,4 +33,7 @@ do
 	mcopy -i "$img" $file "::efi/boot/$(basename "$file")"
 done
 
+# hide the FAT-EFI-partition from the Mac Bootloader by f***ing up the "EFI" directory entry
+sed -i -e '0,/EFI        /s/EFI        /EFI     \x0\x0\x0/' "$img"
+
 exit 0
diff --git a/config/chroot_local-includes/lib/live/config/900-enable-persistent b/config/chroot_local-includes/lib/live/config/900-enable-persistent
index 0d424e2..a26a3c2 100644
--- a/config/chroot_local-includes/lib/live/config/900-enable-persistent
+++ b/config/chroot_local-includes/lib/live/config/900-enable-persistent
@@ -22,6 +22,7 @@ Terminal=false
 TerminalOptions=
 Type=Application
 EOF
+		chmod +x /home/${LIVE_USERNAME}/Desktop/enable_persistent.desktop
 		;;
 	esac
 	;;
diff --git a/isohybrid-acritox b/isohybrid-acritox
index 60ee8eb..4e5b773 100755
--- a/isohybrid-acritox
+++ b/isohybrid-acritox
@@ -240,6 +240,8 @@ do
 				$bytes -= read(FILE, $name, $namelen);
 				$filename = unpack("Z*", $name);
 				print("file: $filename\n");
+				# hide the second ISOFS-EFI-partition from the Mac Bootloader by f***ing up the "EFI" directory entry
+				write_val(-$namelen, pack("Z*", ".PC")) if($filename eq "EFI");
 
 				$bytes -= read(FILE, $sua_head, 4);
 				($sig, $len, $version) = unpack("a[2]CC", $sua_head);
-- 
cgit v1.0