#1407 Issue closed: Master: SLES11 SP4 on Power: unable to boot generated iso image, yaboot missing on iso image

Labels: bug, fixed / solved / done

abbbi opened issue at 2017-07-13 09:41:

hi there,

as our internal Power8 System has now some spare LPAR i can use, so i have the chance
to do some testing with REAR on Power.

Im using the latest head git checkout.
Installed is a SLES11 SP4 for Power.

REAR creates the ISO Image using mkisofs like the following:

[..]
Warning: creating filesystem that does not conform to ISO-9660.
genisoimage 1.1.8 (Linux)
Scanning etc
Scanning ppc
Scanning ppc/chrp
  28   706
  29   332 etc
  30   448 ppc
  31   204 chrp
Cache hit for '/..'
      37    19010 initrd.cgz
   19011    29170 /tmp/rear.wBJNqEyYRNSbHYB/tmp/kernel
   29171    29171 etc/yaboot.conf
   29172    29172 ppc/bootinfo.txt
Cache hit for 'chrp/.'
Creating 1 PReP boot partition(s)
CHRP boot partition 1
Writing:   HFS volume header                       Start Block 0
Done with: HFS volume header                       Block(s)    4
Writing:   Initial Padblock                        Start Block 4
Done with: Initial Padblock                        Block(s)    12
Writing:   Primary Volume Descriptor               Start Block 16
Done with: Primary Volume Descriptor               Block(s)    1
Writing:   Joliet Volume Descriptor                Start Block 17
Done with: Joliet Volume Descriptor                Block(s)    1
Writing:   End Volume Descriptor                   Start Block 18
Done with: End Volume Descriptor                   Block(s)    1
Writing:   Version block                           Start Block 19
Done with: Version block                           Block(s)    1
Writing:   Path table                              Start Block 20
Done with: Path table                              Block(s)    4
Writing:   Joliet path table                       Start Block 24
Done with: Joliet path table                       Block(s)    4
Writing:   Directory tree                          Start Block 28
Done with: Directory tree                          Block(s)    4
Writing:   Joliet directory tree                   Start Block 32
Done with: Joliet directory tree                   Block(s)    4
Writing:   Directory tree cleanup                  Start Block 36
Done with: Directory tree cleanup                  Block(s)    0
Writing:   Extension record                        Start Block 36
Done with: Extension record                        Block(s)    1
Writing:   The File(s)                             Start Block 37
Total extents scheduled to be written = 29323
 17.10% done, estimate finish Thu Jul 13 05:36:24 2017
 34.12% done, estimate finish Thu Jul 13 05:36:24 2017
 51.20% done, estimate finish Thu Jul 13 05:36:24 2017
 68.22% done, estimate finish Thu Jul 13 05:36:24 2017
 85.29% done, estimate finish Thu Jul 13 05:36:24 2017
Total translation table size: 0
Total rockridge attributes bytes: 1124
Total directory bytes: 6144
Path table size(bytes): 46
Done with: The File(s)                             Block(s)    29136
Writing:   Ending Padblock                         Start Block 29173
Done with: Ending Padblock                         Block(s)    150
Max brk space used 0
29323 extents written (57 MB)
~/rear/usr/sbin
2017-07-13 05:36:24.792446132 Wrote ISO image: /root/rear/var/lib/rear/output/rear-sles11ppc64fix.iso (58M)
[..]

but the resulting iso image is neither bootable in qemu-system-ppc64 OR on the real lpar itself.
Investigation shows that yaboot is missing in the iso image entirely:

sles11ppc64fix:~/rear/usr/sbin # mount -o loop /root/rear/var/lib/rear/output/rear-sles11ppc64fix.iso /tmp/mnt/
mount: block device /root/rear/var/lib/rear/output/rear-sles11ppc64fix.iso is write-protected, mounting read-only
sles11ppc64fix:~/rear/usr/sbin # tree /tmp/mnt/
/tmp/mnt/
|-- etc
|   `-- yaboot.conf
|-- initrd.cgz
|-- kernel
`-- ppc
    |-- bootinfo.txt
    `-- chrp

As far as i understand the chrp boot process the power system in a first step looks at a created
file ppc/bootinfo.txt which is correctly created in the filesystem layout of the REAR build directory:

 cat /tmp/rear.Pya6Ddji9I2bcRb/tmp/ppc/bootinfo.txt 
<chrp-boot>
<description>Relax-and-Recover</description>
<os-name>Linux</os-name>
<boot-script>boot &device;:\yaboot</boot-script>
</chrp-boot>

however, the referenced bootloader yaboot is not placed anywhere on the created iso image.
As such the power system is not finding any valid bootloader and fails with no operating sytem found.

I was able to make the iso file bootable by doing the following:

  1. copy kernel, yaboot and initrd.cgz to the build directorys ppc folder:
/tmp/rear.Pya6Ddji9I2bcRb/tmp/ppc/
|-- bootinfo.txt
|-- chrp
|-- initrd.cgz
|-- kernel
`-- yaboot
  1. change bootinfo.txt to append \ppc\ to the path:
<chrp-boot>
<description>Relax-and-Recover</description>
<os-name>Linux</os-name>
<boot-script>boot &device;:\ppc\yaboot</boot-script>
</chrp-boot>
  1. create iso image by using:

/usr/bin/mkisofs -v -o /tmp/test.iso -U -chrp-boot -R -J -volid RELAXRECOVER -v -graft-points etc=etc ppc=ppc /tmp/rear.Pya6Ddji9I2bcRb/tmp/ppc/kernel ppc/initrd.cgz

then the resulting ISO image can be booted both on the real LPAR and in qemu-system-ppc64

So basically what i did not yet discover is:

  1. why is yaboot missing in the created iso image (probably ppc= specified the folder to look in)
  2. why is it not happening on other systems? (other genisoimage verison?)

I guess mkisofs is simply ignoring the yaboot executable in the build dirs tmp directory ..
Yaboot is within the rear build directory but is not put on the iso image for some reason:

sles11ppc64fix:/tmp/rear.wBJNqEyYRNSbHYB # tree tmp/
tmp/
|-- boot
|-- copy-as-is-exclude
|-- copy-as-is-filelist
|-- etc
|   `-- yaboot.conf
|-- initrd.cgz
|-- kernel
|-- mappings
|   `-- routes
|-- parted
|-- partitions
|-- partitions-data
|-- partitions_unsorted
|-- ppc
|   |-- bootinfo.txt
|   `-- chrp
`-- yaboot

abbbi commented at 2017-07-13 10:01:

changing default.conf to:

 # which files to include in the ISO image
-ISO_FILES=()
+ISO_FILES=(yaboot)

makes the iso image bootable by default. But i think yaboot must be a default setting
in case of PPC.

I think the relevant part here is:

/usr/share/rear/output/ISO/Linux-ppc64/300_create_yaboot.sh

it can be seen that on RHEL Systems yaboot is copied to:
\ppc\chrp\yaboot
on SLES systems, it is copied to
\yaboot

the ISO_FILES variable is set to:

ISO_FILES=( "${ISO_FILES[@]}" etc=etc ppc=ppc )

these options end up in the -graft-points options to mkisofs, which defines what files should be
added to the iso image.

this will work on RHEL systems, but not on SLES Systems.
So in case Of SLES the ISO_FILES variable must be changed accordingly otherwise yaboot will be missing from the iso image.

Btw, im not sure why RHEL uses another path on the iso image for the yaboot loader than SLES does. It should be no matter for both distributions if yaboot is placed in \yaboot or \ppc\chrp\yaboot if bootinfo.txt is created accordingly.

abbbi commented at 2017-07-13 12:58:

As a side note: i have now also a running SLES 4 SAP instance on this Power System and it shows the same problem. As it works with version 2.1 i guess the issue was introduced by the following commit in the current master version:

https://github.com/rear/rear/commit/7124c122f855d83f0e7d373416ed95bc3d9e0cbb

schabrolles commented at 2017-07-14 13:29:

@abbbi

You are right, /yaboot is not part of the ISO anymore (may be a side effect of some big cleaning made for ppc64/ppc64le platform).
I propose a patch (#1414) which is now working for me (sles11sp4 on PowerVM & KVM). Waiting for approval from ReaR team.

abbbi commented at 2017-07-14 13:32:

@schabrolles

thanks! Is there a particular reason why RHEL yaboot is placed on a different folder than the suse yaboot?
Shouldnt it work for both RHEL and SUSE style systems if bootinfo.txt + place of yaboot are at the same directory?

schabrolles commented at 2017-07-14 14:35:

@abbbi

I think it is to "replicate" the real system.
SUSE stores yaboot at the root of the PReP partition while RedHat is should store it inside /ppc in PReP.

You proposition should work as well, but because ReaR rescue media is just build from the OS (getting kernel, rebuiding initramfs from the current OS etc ...) I think that using the same philosophy for yaboot (replicating the original OS behaviour) is may be better. People who know Suse or Redhat will find the things where they are use to be...
(it is just a personal view ... feel free to comment feedback)

Thanks to @schlomo, the patch is now merged... @abbbi, tell us if everything works now fine on your side.

jsmeix commented at 2017-07-17 10:32:

With https://github.com/rear/rear/pull/1414 merged
this issue should be fixed.

@schabrolles
as always many thanks for all your work and contributions
that make ReaR working better and better on POWER!


[Export of Github issue for rear/rear.]