Skip to content

Commit

Permalink
halium: fix slot suffix detection in case of multiple occurrences
Browse files Browse the repository at this point in the history
Some bootloaders have a bug that causes androidboot.slot_suffix=
to be put to kernel cmdline multiple time. Use the last provided
value as the source of truth.
  • Loading branch information
NotKit committed Jan 26, 2023
1 parent cc14887 commit b663991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/halium
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ mount_android_partitions() {
tell_kmsg "checking fstab $fstab for additional mount points"

# On systems with A/B partition layout, current slot is provided via cmdline parameter.
ab_slot_suffix=$(grep -o 'androidboot\.slot_suffix=..' /proc/cmdline | cut -d "=" -f2)
ab_slot_suffix=$(grep -o 'androidboot\.slot_suffix=..' /proc/cmdline | tail -1 | cut -d "=" -f2)
[ ! -z "$ab_slot_suffix" ] && tell_kmsg "A/B slot system detected! Slot suffix is $ab_slot_suffix"

cat ${fstab} | while read line; do
Expand Down Expand Up @@ -439,7 +439,7 @@ mountroot() {
done

# On systems with A/B partition layout, current slot is provided via cmdline parameter.
ab_slot_suffix=$(grep -o 'androidboot\.slot_suffix=..' /proc/cmdline | cut -d "=" -f2)
ab_slot_suffix=$(grep -o 'androidboot\.slot_suffix=..' /proc/cmdline | tail -1 | cut -d "=" -f2)
if [ -z "$path" ] && [ ! -z "$ab_slot_suffix" ] ; then
tell_kmsg "Searching for A/B data partition on slot $ab_slot_suffix."

Expand Down

0 comments on commit b663991

Please sign in to comment.