[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New discussion: ppc64 installer -- ext2 /boot partition to keep yaboot happy.



On 10/10/2017 12:33 PM, Frank Scheiner wrote:
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.

Great.


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
```

That looks reasonable to me.

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].

Not sure. Those might be hints for the menu system.

We can ask in #debian-boot or on the debian-boot mailing list.


[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?
The package manager for udebs is called "anna" (Anna is Not Nearly Apt)
and its README might help you [1].

Adrian

[1] https://anonscm.debian.org/cgit/d-i/anna.git/tree/README

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Reply to: