BlueOnyx CD building - redux

Posted by: mstauber Category: Development

I finally managed to tackle a long standing nuisance in relation to building CDs for BlueOnyx: The location of the kickstart files.

The installation CDs for BlueOnyx (and our sister project Aventurine) are built in the same way: We roll them up with Revisor or Pungi (depending on the flavour) and have a custom isolinux.cfg file that presents a boot menu once you boot off the CD. Something liks this:

Depending on which option you choose, different kickstart files will be used to partition the disk(s) and to install BlueOnyx. This is the isolinux.cfg configuration for the first menu item:

label linux
  menu label Install BlueOnyx 5209R (HD Autodetect)
  text help
  This will attempt to auto-detect your disks. If more than one disk is
  found, RAID1 will be set up. Please note: The auto-detect may fail.
  Requires at least 30GB of disk space.
  endtext
  kernel vmlinuz
  append ks=cdrom:/ks/kickstart.cfg initrd=initrd.img inst.stage2=hd:LABEL=BlueOnyx-5209R-x86_64 rd.live.check qui

As you can see: The kickstart file is specified via append ks=cdrom:/ks/kickstart.cfg in that case.

The problem:

There are tons of cases where this blows up right in our face. Or the face of the person who tries to use the ISO to install BlueOnyx (or Aventurin{e}). Like when using an ISO image in an IBM blade center or generally when the environment where the install runs doesn't make /dev/cdrom available, but uses /dev/sr0 for example. In that case the kickstart script isn't found and the install proceeds with default package selection (without what we actually want to install!) and you need to partition yourself. In the end you got a minimal install of the basic OS, but neither BlueOnyx or Aventurine.

Likewise: You could not convert our ISO into an USB-stick image to install off an USB stick. Because likewise it would no longer be able to find the bloody kickstart script(s).

The work-around:

I finally went back to basics and did what we used to do ages ago: Take the initrd.img of the ISO apart and stuff the kickstart scripts into it:

#!/bin/bash

# Start sane:
rm -Rf /mnt/initrd
rm -f /mnt/initrd.img
mkdir /mnt/initrd

# Get initrd.img from CD directory:
cp /home/build_cd.5209R/5209R/images/pxeboot/initrd.img /mnt/initrd

# Unpack:
cd /mnt/initrd
/usr/lib/dracut/skipcpio initrd.img | xzcat | cpio -ivd

# Cleanup:
rm -f /mnt/initrd/initrd.img

# Populate:
mkdir /mnt/initrd/ks
cp /home/build_cd.5209R/5209R/ks/*.cfg /mnt/initrd/ks/

# Pack up again:
cd /mnt/initrd
find . -print |cpio -o -H newc | xz --format=lzma > ../initrd.img

# Shove it onto the CD:
cp /mnt/initrd.img /home/build_cd.5209R/5209R/images/pxeboot/
cp /mnt/initrd.img /home/build_cd.5209R/5209R/isolinux/

exit

That's for 5209R and CentOS 7, where the initrd.img is packed up with xz instead of gzip. This requires dracut to be installed in order to have /usr/lib/dracut/skipcpio to take the original initrd.img apart that Pungi created for us.

The last step was then to modify the append line in isolinux.cfg to point to the kickstart scripts that are now included in the initrd.img:

append inst.ks=file:///ks/kickstart.cfg initrd=initrd.img inst.stage2=hd:LABEL=BlueOnyx-5209R-x86_64 xdriver=vesa nomodeset quiet

That now uses inst.ks=file: to point to the respective kickstart scripts.

Starting with todays 5209R ISO image (20170705) new ISO images will be built with these provisions in place.


Return
General
Jul 5, 2017 Category: Development Posted by: mstauber
Next page: Features