ppc: YabootInstaller doesn't handle USB drive installation so well

Bug #956481 reported by Tormod Volden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
yaboot-installer (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Just the "Installation Complete" dialog was left hanging, otherwise things looks fine. Apport made me file this bug. Installation of yaboot failed, because I am installing to an external USB drive which does not have any AppleBootstrap partition. I will boot yaboot from openfirmware anyway.

I did not attach the debug log because I was warned that it contains my password. Is that true? I could not find it in syslog or installer/debug.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: ubiquity 2.9.28
ProcVersionSignature: Ubuntu 3.2.0-18.28-powerpc 3.2.9
Uname: Linux 3.2.0-18-powerpc ppc
ApportVersion: 1.94-0ubuntu1
Architecture: powerpc
Date: Thu Mar 15 22:44:14 2012
InstallCmdLine: ro ramdisk_size=1048576 boot=casper rootdelay=10 live-media-path=Users/Tormod/casper file=/cdrom/Users/tormod/casper/preseed/lubuntu.seed break=mount ignore_uuid
ProcEnviron:
 TERM=unknown
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tormod Volden (tormodvolden) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : Traceback

Exception during installation:
Mar 15 21:29:33 ubuntu plugininstall.py: Traceback (most recent call last):
Mar 15 21:29:33 ubuntu plugininstall.py: File "/usr/share/ubiquity/plugininstall.py", line 1719, in <module>
Mar 15 21:29:33 ubuntu plugininstall.py: install.run()
Mar 15 21:29:33 ubuntu plugininstall.py: File "/usr/share/ubiquity/plugininstall.py", line 55, in wrapper
Mar 15 21:29:33 ubuntu plugininstall.py: func(self)
Mar 15 21:29:33 ubuntu plugininstall.py: File "/usr/share/ubiquity/plugininstall.py", line 204, in run
Mar 15 21:29:33 ubuntu plugininstall.py: self.configure_bootloader()
Mar 15 21:29:33 ubuntu plugininstall.py: File "/usr/share/ubiquity/plugininstall.py", line 1023, in configure_bootloader
Mar 15 21:29:33 ubuntu plugininstall.py: "YabootInstaller failed with code %d" % ret)
Mar 15 21:29:33 ubuntu plugininstall.py: InstallStepError: YabootInstaller failed with code 1
Mar 15 21:29:33 ubuntu plugininstall.py:

tags: added: installer-crash
summary: - installation crashed when it finished
+ ppc: yaboot doesn't handle USB drive installation so well
summary: - ppc: yaboot doesn't handle USB drive installation so well
+ ppc: YabootInstaller doesn't handle USB drive installation so well
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Actually, I would say the ubiquity bug is that it raises InstallStepError and triggers apport, instead of telling the user politely and informatively that it was not able to install the boot loader, and move on.

Revision history for this message
Colin Watson (cjwatson) wrote :

It certainly shouldn't move on; a failed boot loader installation is a hard failure IMO. A fix in yaboot-installer would be sufficient here, I think.

no longer affects: ubiquity (Ubuntu)
Changed in yaboot-installer (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Colin Watson (cjwatson) wrote :

... by which I mean that yaboot-installer itself could handle this error and present some kind of UI if it thinks that's appropriate, rather than ubiquity trying to decide how fatal an error in a boot loader installer script is.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

I don't know if this belongs in ubiquity or yaboot-installer but it would be nice to have an option where to install the boot loader or not install it at all (like "Continue without bootloader installation" in debian-installer) so that ubiquity can finish properly. Now I ended up with casper etc on the installed system. Of course, I should probably use debian-installer instead, but I really like ubiquity :)

Revision history for this message
ojordan (ojordan12345) wrote :

As I understand it, installation on USB fails because ofpath can't handle USB.

I've never installed a proper system to USB, but I've been playing with live USB persistence. When you run ybin/mkofboot it complains that ofpath doesn't support USB. You have to pass an ofboot option to them, specifying say usb0/@1:2 .

If my memory is correct yabootconfig doesn't have an ofboot option. It may generate a yaboot.conf file before it fails so it maybe possible to just run the mkofboot command with the ofboot option to copy the files to the bootloader.

My instructions for live USB persistence are on the PowerPC FAQ https://wiki.ubuntu.com/PowerPCFAQ#How_do_I_boot_from_a_USB_drive.3F .

Revision history for this message
ojordan (ojordan12345) wrote :

Also, another thing to consider is if installation to USB worked correctly, then nvram would be updated to boot the USB drive by default. Is this what people would want since I would think most USB instalations would be temporary or for testing/trying out purposes? It would be good if the installer gave the user an option to update nvram or not.

In my persistence instructions I pass

--ofboot "&device;:2" --nonvram

This allows the device to be connected to any usb port and doesn't update nvram. That is assuming the installation is on partition 2.

Revision history for this message
ojordan (ojordan12345) wrote :

Correction: that is assuming yaboot is on partition 2.

Revision history for this message
ojordan (ojordan12345) wrote :

Just had a quick look at the code and yabootinstaller doesn't use yabootconfig so that is good. I think it would be possible to write a patch so that when ofpath returns nothing we use &device; and the correct partition and set nonvram. Thoughts? I may have a go at coming up with something. Ages since I've done any coding!

In post#1 you wrote "because I am installing to an external USB drive which does not have any AppleBootstrap partition". How were you intending booting if you didn't set up a boot partition? What were you going to call from openfirmware?

Revision history for this message
ojordan (ojordan12345) wrote :

I haven't tested this yet, but I think something like this would work:

Expand the current if statement

if [ "$ARCH" = powerpc/powermac_newworld ]; then
    writeyabootconf <<EOF
magicboot=/usr/lib/yaboot/ofboot
EOF
fi

to this......

if [ "$ARCH" = powerpc/powermac_newworld ]; then
    writeyabootconf <<EOF
magicboot=/usr/lib/yaboot/ofboot
EOF

    # Check if ofpath can find the bootstrap partition. If it can't then don't set nvram and
    # set a generic value for ofboot
    if ! [ $(map_of_path "$boot") ]; then
        # we should be able to at least find the bootstrap partition number
        ofbootpartnr="`printf %s "$boot" | sed 's/[^0-9]*\([0-9]\)/\1/'`"

        writeyabootconf <<EOF
# ofpath failed to find the openfirmware path of the boostrap partition.
# To enable automatic booting, remove the nonvram line and change the ofboot value to
# the openfirmware path of the bootstrap partition. For example: ofboot=usb0/@1:2
nonvram
ofboot=&device;:$ofbootpartnr
EOF
    fi
fi

Sorry, haven't looked into doing fancy patches yet! I am very very rusty at writing any sort of code so please check it makes sense!

Revision history for this message
ojordan (ojordan12345) wrote :

This probably can be simplified further. Instead of finding ofbootpartnr, just use

ofboot=&device;:&partition;

Revision history for this message
Tormod Volden (tormodvolden) wrote :

ojordan, thanks for investigating this!

> Also, another thing to consider is if installation to USB worked correctly, then nvram would be updated to boot the USB drive
> by default. Is this what people would want since I would think most USB instalations would be temporary or for testing/trying
> out purposes? It would be good if the installer gave the user an option to update nvram or not.

Agree. If installing to a USB drive it should not change NVRAM (or the internal HD for that matter). Ideally it should just make the USB drive bootable so that it can be chosen with the Alt key when powering up.

> In post#1 you wrote "because I am installing to an external USB drive which does not have any AppleBootstrap partition". How
> were you intending booting if you didn't set up a boot partition? What were you going to call from openfirmware?

My USB drive is a firewire combo drive. Obviously I would prefer to use firewire plugged straight into the PowerBook. However there is a firmware/software bug so that the firewire firmware gets totally messed up by current Linux setups (https://bugzilla.kernel.org/show_bug.cgi?id=42914), I have to disable /lib/udev/scsi_id and even then there is something run by e.g. ubiquity (partman?) that makes it unusable. So I have resorted to USB, but this Powerbook has only USB 1.x so I am using a PCMCIA card with USB 2.0. Of course, openfirmware cannot see my USB drive through this PCMCIA card, so either I have to do a replugging dance when booting, or simply copy yaboot+kernel+initrd to somewhere where openfirmware can see it (and make sure my initrd has the needed yenta-socket module for the PCMCIA card). I just use a folder on the internal all-MacOSX-hfs+ drive for this, and just type "boot hd:\myfolder\yaboot" in openfirmware. Surely not your grandma's setup, and I hope to have the kernel/udev/firmware issues sorted out one day so I can simply boot the firmware drive, at which point I will probably make an AppleBootstrap partition to have the convenient Alt key magic work.

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/956481

tags: added: iso-testing
Revision history for this message
ojordan (ojordan12345) wrote :

The attached patch applied to /usr/lib/ubiquity/yaboot-installer/yaboot-installer on a live ISO allowed me install the bootloader to a USB partition successfully.

I'm not 100% sure I'm using the function map_of_path correctly in the patch. Other instances of that function seem more complicated.

yaboot-installer may fail in other ways so I think ubiquity still needs a way to deal with this cleanly.

tags: added: patch
Revision history for this message
ojordan (ojordan12345) wrote :

This https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1043066 is another example of how yaboot-installer can fail.

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for your patch in bug 1043066. I've made some minor syntactic improvements and applied it. That bug remains open for better failure handling in ubiquity.

Colin Watson (cjwatson)
Changed in yaboot-installer (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package yaboot-installer - 1.1.22ubuntu2

---------------
yaboot-installer (1.1.22ubuntu2) quantal; urgency=low

  * Check for Open Firmware path of MacOS (X) devices before adding them to
    yaboot.conf, and avoid updating NVRAM if no Open Firmware path can be
    found for the bootstrap partition (thanks, o jordan; LP: #956481).
 -- Colin Watson <email address hidden> Mon, 24 Sep 2012 00:54:05 +0100

Changed in yaboot-installer (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.