Skip to content

Commit

Permalink
scripts/halium: fix super partition detection logic (#40)
Browse files Browse the repository at this point in the history
"test -n" just checks if "the length of STRING is nonzero", which
obviously is wrong when the existence of a path is in question.

Replace it with "test -b" which is true if "FILE exists and is block special"

Initramfs test on Volla Phone X23:

  / # ls -l /dev/disk/by-partlabel/super
  lrwxrwxrwx    1 0        0               11 May 13 13:37 /dev/disk/by-partlabel/super -> ../../sdc57
  / # [ -b /dev/disk/by-partlabel/super ] && echo true
  true
  • Loading branch information
JamiKettunen authored May 31, 2024
1 parent b663991 commit 9b2ff25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/halium
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ mountroot() {
mount -o discard,$OPTIONS $path /tmpmnt

# setup super partition if exists
if [ -n "/dev/disk/by-partlabel/super" ]; then
if [ -b /dev/disk/by-partlabel/super ]; then
tell_kmsg "trying to parse and dmsetup subpartitions from super partition"
/sbin/parse-android-dynparts /dev/disk/by-partlabel/super | sh
fi
Expand Down

0 comments on commit 9b2ff25

Please sign in to comment.