Skip to content

Commit

Permalink
s390x: skip grub.cfg
Browse files Browse the repository at this point in the history
Grub is not used on s390x architecture

Backport of: coreos#706

Signed-off-by: Alice Frosi <[email protected]>
  • Loading branch information
Alice Frosi committed Aug 14, 2019
1 parent ca16233 commit 70a9d9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gf-platformid
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ src="$1"
dest="$2"
platformid="$3"

arch=$(uname -m)

if [[ $src == *.gz ]]; then
img="$(basename "$src")"
fatal "Cannot change ignition.platform.id on $img; not an uncompressed image"
Expand Down Expand Up @@ -46,14 +48,17 @@ if [ "$(coreos_gf exists '/boot/efi')" == 'true' ]; then
else
grubcfg_path=/boot/loader/grub.cfg
fi
coreos_gf download "${grubcfg_path}" "${tmpd}"/grub.cfg

if [ "$arch" != "s390x" ]; then
coreos_gf download "${grubcfg_path}" "${tmpd}"/grub.cfg
# Remove any platformid currently there
sed -i -e 's, ignition.platform.id=[a-zA-Z0-9]*,,g' "${tmpd}"/grub.cfg
# Insert our new platformid
# Match linux16, linux and linuxefi since only linux is available on aarch64
# and linuxefi is available in grub2.cfg for UEFI
sed -i -e 's,^\(linux\(16\|efi\)\? .*\),\1 coreos.oem.id='"${platformid}"' ignition.platform.id='"${platformid}"',' "${tmpd}"/grub.cfg
coreos_gf upload "${tmpd}"/grub.cfg "${grubcfg_path}"
fi
# Now the BLS version
blscfg_path=$(coreos_gf glob-expand /boot/loader/entries/ostree-*.conf)
coreos_gf download "${blscfg_path}" "${tmpd}"/bls.conf
Expand Down

0 comments on commit 70a9d9e

Please sign in to comment.