Re: New discussion: ppc64 installer -- ext2 /boot partition to keep yaboot happy.
On 10/09/2017 05:44 PM, John Paul Adrian Glaubitz wrote:
[...]
Good news: With partman-prep enabled on ppc64 and after adding the hack 
to wipe
and find the PREP partition on powerpc and ppc64 in grub-installer [1], the
installation of GRUB on ppc64 works now out of the box on my POWER7 
system \o/.
Good to hear! :-)
One can simply install GRUB on these systems now by choosing "Back" in the
yaboot-installer menu and then choosing to install GRUB.
Now we only need to get it working on NewWorld Macs :).
Yeah, that seems to be a hard nut to crack. But I believe I'm making 
some progress - in understanding at least :-D.
Regarding hfsutils:
Here's a patch for grub-installer (package source) that should hopefully 
install hfsutils from the `debian/postinst` script (adapted from 
yaboot-installer) for the newworld_powermac subarchitecture(s) only:
```
diff --git a/debian/grub-installer.templates 
b/debian/grub-installer.templates
index e294afb..7ed4b21 100644
--- a/debian/grub-installer.templates
+++ b/debian/grub-installer.templates
@@ -131,6 +131,18 @@ Template: grub-installer/password-crypted
 Type: password
 Description: for internal use; can be preseeded
+Template: grub-installer/apt-install-hfsutils
+Type: text
+# :sl2:
+_Description: Installing hfsutils
+
+Template: grub-installer/apt-install-hfsutils-failed
+Type: error
+# :sl2:
+_Description: hfsutils installation failed
+ The hfsutils package failed to install into /target/. Without it the 
NewWorld
+ boot partition cannot be formatted.
+
 Template: grub-installer/apt-install-failed
 Type: error
 # :sl2:
diff --git a/debian/postinst b/debian/postinst
index 4b12027..d301ecd 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -31,6 +31,28 @@ mountvirtfs () {
 	fi
 }
+
+ARCH="$(archdetect)"
+
+if [ "$ARCH" = */powermac_newworld ]; then
+	db_progress INFO grub-installer/apt-install-hfsutils
+
+	if ! apt-install hfsutils; then
+	    info "Calling 'apt-install hfsutils' failed"
+	    # Hm, unable to install hfsutils into /target/, what should we do?
+	    db_input critical grub-installer/apt-install-hfsutils-failed || [ 
$? -eq 30 ]
+	    if ! db_go; then
+		db_progress STOP
+		exit 10 # back up to menu
+	    fi
+	    db_get grub-installer/apt-install-hfsutils-failed
+	    if [ "$RET" != true ]; then
+		db_progress STOP
+		exit 1
+	    fi
+	fi
+fi
+
 # If we're installing grub-efi, it wants /sys mounted in the
 # target. Maybe /proc too?
 mountvirtfs proc /target/proc
```
What is the meaning of those "# :sl<NUMBER>:" comments, if at all? I 
didn't find any clue in the debconf specification [1] and manpages [2].
[1]: https://www.debian.org/doc/packaging-manuals/debconf_specification.html
[2]: https://manpages.debian.org/stretch/debconf-doc/index.html
Last, how can I test this? Is there a way to inject "my" version of 
grub-installer.udeb into a Debian installation without recreating the ISO?
Cheers,
Frank
Reply to: