Hi Frank!

On 10/19/2017 11:03 AM, Frank Scheiner wrote:
I'd like to provide an update on d-i/grub-installer for NewWorld Power Macs:

Great \o/.

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. :-)

No worries. It's always up to the individual contributors when they want to work
on something, there is no pressure. We're all here for the fun :-).

## What works ##

(snip)

Great. Sounds like you really made some progress here :-).

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

Ok, thanks for researching this.

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

How does yaboot-installer do it?

## 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:

I can just upload updated versions of the packages to the Debian Ports FTP 
servers
for testing and before committing any changes to git.

```
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.schei...@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
```

Looks good to me.

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?

My suggestion would be that you send me the necessary patches for all packages 
that
need to be patched. I'll then build and upload patched versions of those 
packages,
then rebuild updated installation images.

We can then test your changes and if everything works, I'll commit your patches.

Adrian

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

Reply via email to