Skip to content

Commit

Permalink
ignition-ostree-transposefs: check if we need to use the root set by …
Browse files Browse the repository at this point in the history
…the multipath-generator

When enabling multipath the root partition label is set by the  multipath-generator
this change makes sure to use the multipath one if needed.
This was reported via: https://issues.redhat.com/browse/OCPBUGS-16157
  • Loading branch information
jmarrero committed Jul 28, 2023
1 parent 208630a commit a35dbbc
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ prep_typeguid=9e1a2d38-c612-4316-aa26-8b49521e5a8b
# out a way to ask Ignition directly whether there's a filesystem with label
# "root" being set up.
ignition_cfg=/run/ignition.json
root_part=/dev/disk/by-label/root
boot_part=/dev/disk/by-label/boot
esp_part=/dev/disk/by-label/EFI-SYSTEM
bios_part=/dev/disk/by-partlabel/BIOS-BOOT
Expand Down Expand Up @@ -139,13 +138,15 @@ should_autosave_rootfs() {
return
fi
local agcount
eval $(xfs_info "${root_part}" | grep -o 'agcount=[0-9]*')
xfsinfo=$(xfs_info "${root_part}")
agcount=$(echo "$xfsinfo" | grep -o 'agcount=[0-9]*' | tr -dc '0-9')
# Semi-arbitrarily chosen: this is roughly ~64G currently (based on initial
# ag sizing at build time) which seems like a good rootfs size at which to
# discriminate between "throwaway/short-lived systems" and "long-running
# workload systems". It's not like XFS performance is way worse at 128.
echo "Filesystem agcount is $agcount"
if [ "$agcount" -lt 128 ]; then
echo "Filesystem agcount is $agcount; skipping" >&2
echo "Filesystem agcount < 128; skipping" >&2
echo 0
return
fi
Expand Down Expand Up @@ -205,6 +206,13 @@ check_and_set_secex_config() {
# info from config, so just check cached one and reset to secex.ign now
check_and_set_secex_config

root_part=$(karg root)
if test -z "${root_part}"; then
root_part=/dev/disk/by-label/root
fi
echo "root_part is: ${root_part}"


case "${1:-}" in
detect)
# Mounts are not in a private namespace so we can mount ${saved_data}
Expand Down

0 comments on commit a35dbbc

Please sign in to comment.