Skip to content

Commit 9b2ff25

Browse files
authored
scripts/halium: fix super partition detection logic (#40)
"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
1 parent b663991 commit 9b2ff25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/halium

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ mountroot() {
487487
mount -o discard,$OPTIONS $path /tmpmnt
488488

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

0 commit comments

Comments
 (0)