Skip to content

Commit

Permalink
create_disk: Fix s390x regression from previous change
Browse files Browse the repository at this point in the history
On every architecture except s390x we rely on BLS i.e.
`sysroot.bootloader=none`.

However apparently there's a bug here if we try to deploy
with the `bootloader=zipl` from the start, instead of doing
it later.  I think that's an ostree bug, but for now rework
the code so that it works the same as before on s390x.

Closes: #3067
  • Loading branch information
cgwalters authored and dustymabe committed Sep 2, 2022
1 parent 1b4f1c9 commit b4cb857
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ if [ "${rootfs_size}" != "0" ]; then
rootfs_size="+${rootfs_size}"
fi

# we use pure BLS on most architectures; this may
# be overridden below
bootloader_backend=none

# shellcheck disable=SC2031
case "$arch" in
x86_64)
Expand All @@ -188,7 +184,6 @@ case "$arch" in
-n ${ROOTPN}:0:"${rootfs_size}" -c ${ROOTPN}:root -t ${ROOTPN}:0FC63DAF-8483-4772-8E79-3D69D8477DE4
;;
s390x)
bootloader_backend=zipl
sgdisk_args=()
if [[ ${secure_execution} -eq 1 ]]; then
# shellcheck disable=SC2206
Expand Down Expand Up @@ -317,7 +312,8 @@ fi
# Now that we have the basic disk layout, initialize the basic
# OSTree layout, load in the ostree commit and deploy it.
ostree admin init-fs --modern $rootfs
ostree config --repo $rootfs/ostree/repo set sysroot.bootloader "${bootloader_backend}"
# May be overridden below (e.g. s390x)
ostree config --repo $rootfs/ostree/repo set sysroot.bootloader none
# Opt-in to https://github.com/ostreedev/ostree/pull/1767 AKA
# https://github.com/ostreedev/ostree/issues/1265
ostree config --repo $rootfs/ostree/repo set sysroot.readonly true
Expand Down Expand Up @@ -491,6 +487,7 @@ ppc64le)
install_grub_cfg
;;
s390x)
ostree config --repo $rootfs/ostree/repo set sysroot.bootloader zipl
# XXX: switch to using --append-karg once we have new enough rdcore
# https://github.com/coreos/coreos-installer/pull/950
rdcore_zipl_args=("--boot-mount=$rootfs/boot" "--kargs=ignition.firstboot")
Expand All @@ -505,7 +502,8 @@ s390x)
esac

# enable support for GRUB password
if [ "${bootloader_backend}" = "none" ]; then
# shellcheck disable=SC2031
if "$arch" != "s390x"; then
ostree config --repo $rootfs/ostree/repo set sysroot.bls-append-except-default 'grub_users=""'
fi

Expand Down

0 comments on commit b4cb857

Please sign in to comment.