Skip to content

Commit

Permalink
Switch to using upstream mk-s390image for s390 cdboot.img creation
Browse files Browse the repository at this point in the history
mk-s390-cdboot has stopped working because the kernel outgrew the
hard-coded offset it used when creating cdboot.img. IBM now has a script
in s390utils that can do the same thing so use the upstream script
instead.

This drops mk-s390-cdboot script, switches the s390 templates to use
mk-s390image from s390utils.

It adds @root@ to cdboot.prm, and sets inst.stage2 so that the installer
image will be found when booting the iso.

Resolves: rhbz#1891778
  • Loading branch information
bcl committed Nov 2, 2020
1 parent 51a4a93 commit ee2496d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 121 deletions.
2 changes: 1 addition & 1 deletion lorax.spec
Expand Up @@ -73,6 +73,7 @@ Requires: grub2-tools

%ifarch s390 s390x
Requires: openssh
Requires: s390utils >= 2.15.0-2
%endif

%ifarch %{arm}
Expand Down Expand Up @@ -166,7 +167,6 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
%{_sbindir}/livemedia-creator
%{_sbindir}/mkksiso
%{_bindir}/image-minimizer
%{_bindir}/mk-s390-cdboot
%dir %{_sysconfdir}/lorax
%config(noreplace) %{_sysconfdir}/lorax/lorax.conf
%dir %{_datadir}/lorax
Expand Down
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -19,7 +19,6 @@
data_files.append(("/usr/sbin", ["src/sbin/lorax", "src/sbin/mkefiboot",
"src/sbin/livemedia-creator", "src/sbin/mkksiso"]))
data_files.append(("/usr/bin", ["src/bin/image-minimizer",
"src/bin/mk-s390-cdboot",
"src/bin/composer-cli"]))

# get the version
Expand Down
2 changes: 1 addition & 1 deletion share/templates.d/99-generic/config_files/s390/cdboot.prm
@@ -1 +1 @@
ro
ro @ROOT@
7 changes: 4 additions & 3 deletions share/templates.d/99-generic/live/s390.tmpl
Expand Up @@ -6,6 +6,7 @@ KERNELDIR=BOOTDIR
INITRD_ADDRESS="0x02000000"
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
MKS390IMAGE="/usr/bin/mk-s390image"
# The assumption seems to be that there is only one s390 kernel, ever
kernel = kernels[0]

Expand Down Expand Up @@ -74,10 +75,10 @@ treeinfo images-${basearch} cdboot.prm ${BOOTDIR}/cdboot.prm
%endfor

## Make a combined kernel+initrd image for the iso
runcmd mk-s390-cdboot -i ${outroot}/${KERNELDIR}/kernel.img \
runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \
${outroot}/${BOOTDIR}/cdboot.img \
-r ${outroot}/${KERNELDIR}/initrd.img \
-p ${outroot}/${BOOTDIR}/cdboot.prm \
-o ${outroot}/${BOOTDIR}/cdboot.img
-p ${outroot}/${BOOTDIR}/cdboot.prm

## make boot.iso
runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
Expand Down
8 changes: 5 additions & 3 deletions share/templates.d/99-generic/s390.tmpl
Expand Up @@ -5,6 +5,7 @@ BOOTDIR="images"
KERNELDIR=BOOTDIR
INITRD_ADDRESS="0x02000000"
LORAXDIR="usr/share/lorax/"
MKS390IMAGE="/usr/bin/mk-s390image"
# The assumption seems to be that there is only one s390 kernel, ever
kernel = kernels[0]

Expand Down Expand Up @@ -32,6 +33,7 @@ install ${configdir}/generic.ins .

## configure bootloader
replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/cdboot.prm

## install kernel
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
Expand Down Expand Up @@ -70,10 +72,10 @@ treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
%endfor

## Make a combined kernel+initrd image for the iso
runcmd mk-s390-cdboot -i ${outroot}/${KERNELDIR}/kernel.img \
runcmd ${MKS390IMAGE} ${outroot}/${KERNELDIR}/kernel.img \
${outroot}/${BOOTDIR}/cdboot.img \
-r ${outroot}/${KERNELDIR}/initrd.img \
-p ${outroot}/${BOOTDIR}/cdboot.prm \
-o ${outroot}/${BOOTDIR}/cdboot.img
-p ${outroot}/${BOOTDIR}/cdboot.prm

## make boot.iso
runcmd xorrisofs ${isoargs} -o ${outroot}/images/boot.iso \
Expand Down
112 changes: 0 additions & 112 deletions src/bin/mk-s390-cdboot

This file was deleted.

0 comments on commit ee2496d

Please sign in to comment.