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

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



Hi all,

I'd like to provide an update on d-i/grub-installer for NewWorld Power Macs:

Sadly I didn't find the time to follow this until yesterday morning and today in the morning, but I am now closer to a solution, I believe. :-)

## What works ##

* Installing `hfsutils` now works automatically (from `debian/postinst`)

* Formatting with HFS (only if needed, which will conserve any prior installation of yaboot) and mounting of the NewWorld boot partition in-target (incl. fstab entry) also works

* The OF boot script (template from [1], installed on the NewWorld boot partition as `[...]/BootX`) that is missing in the `grub-ieee1275` deb package is now created and installed automatically. The OF path to the NewWorld boot partition is determined by `ofpath` (which seems to yield a correct OF path for the used NewWorld boot partition on my Power Macintosh G5 (11,2) instead of `ofpathname` (used by `grub-install`) and instead of a manually compiled `grub-ofpathname` (from [2]) which both yield non-working OF paths)

[1]: http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/boot/powerpc/grub.chrp.in?id=446794de8da4329ea532cbee4ca877bcafd0e534

[2]: http://git.savannah.gnu.org/cgit/grub.git/tree/util/ieee1275/grub-ofpathname.c?id=446794de8da4329ea532cbee4ca877bcafd0e534

## What doesn't yet work or isn't yet implemented ##

* Selecting/Confirming the NewWorld boot partition for GRUB installation. I use adapted code from the d-i/yaboot-installer to achieve this, but am struggling with the needed debconf templates (see below). I also observe that the NewWorld boot partition can only be guessed but not determined by d-i/partman-newworld. This is also visible when performing a yaboot installation, as the NewWorld boot partition has to be always confirmed by the user, although it is the only partition in a fresh install that has the bootable flag set and it should have been already detected and stored in "partman-newworld/boot_partitions" (see [3]). I used the installer ISO from [4] but dated 2017-10-10, so d-i/partman-newworld was included. It currently works to just use the partition that is guessed by the d-i/yaboot-installer derived code, but I'd feel safer if users would have to confirm that choice before continuing, because the selected partition might get formatted.

[3]: https://anonscm.debian.org/cgit/d-i/yaboot-installer.git/tree/debian/postinst?id=94cd300c98904d8c308d996239719df4b0c59d6f#n97

[4]: https://cdimage.debian.org/cdimage/ports/debian-9.0-ppc64-NETINST-1.iso

* Modifying the NVRAM to automatically boot GRUB. But this can be done easily from OF itself, e.g. with `boot hd:2,BootX` with my modifications.

## Problems ##

I wasn't successful in installing my modifed grub-installer udeb with `anna-install`, but I discovered that `udpkg` can be used to also "install" or better "unpack" udebs, i.e. with:

```
udpkg --unpack <UDEB_FILE>
```

But as I later found out, this does not offer more functionality over just updating the scripts `grub-installer` and `debian/postinst` manually. I copy them to a web server and download them from the installer environment. But this way (`udpkg --unpack [...]`), the debconf templates in `/var/lib/cdebconf` are not updated with the new templates from my modified udeb and hence cannot be found from code inside `grub-installer` or `debian/postinst` - assuming they search the files there.

So, assuming that additional templates with unique names won't hurt other existing code, I suggest the following patch to d-i/grub-installer:

```
diff --git a/debian/changelog b/debian/changelog
index d0a4bb3..c4dfbdd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+grub-installer (1.146) UNRELEASED; urgency=medium
+
+  [ Frank Scheiner ]
+  * include new debconf templates to prepare grub-installer for support of
+    NewWorld Power Macintosh systems
+
+ -- Frank Scheiner <frank.scheiner@web.de>  Thu, 19 Oct 2017 08:40:00 +0200
+
 grub-installer (1.145) unstable; urgency=medium

   [ Updated translations ]
diff --git a/debian/grub-installer.templates b/debian/grub-installer.templates
index e294afb..1d8e51a 100644
--- a/debian/grub-installer.templates
+++ b/debian/grub-installer.templates
@@ -1,3 +1,39 @@
+Template: grub-installer/part_newworld
+Type: text
+# :sl4:
+ _Description: Looking for NewWorld boot partitions
+
+Template: grub-installer/nopart_newworld
+Type: error
+# :sl4:
+_Description: No NewWorld boot partition found
+ No hard disks were found which have a "NewWorld boot partition".
+ You must create a 10-Megabyte partition of type "NewWorld boot partition".
+
+Template: grub-installer/bootdev_newworld
+Type: select
+Choices: ${DEVICES}
+Default: invaliddevice
+# :sl4:
+_Description: Device for boot loader installation:
+ GRUB needs to be installed on a "NewWorld boot partition" in order for
+ your system to be bootable. Please choose the destination partition
+ from among these partitions that have the bootable flag set.
+ .
+ Warning: this will erase all data on the selected partition!
+
+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/with_other_os
 Type: boolean
 Default: true
```

With a rebuilt grub-installer.udeb providing the necessary debconf templates and installed during the Debian installation and its `grub-installer` and `debian/postinst` scripts patched after udeb installation I hope to get the described problems solved. Then we can try to include the remaining code changes.

@Adrian:
What do you think?

Cheers,
Frank


Reply to: