From 9b2ff2510fdeaa52a1aaf6d74fb33059ecfb4f49 Mon Sep 17 00:00:00 2001 From: Jami Kettunen Date: Fri, 31 May 2024 10:13:59 +0300 Subject: [PATCH] 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 --- scripts/halium | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/halium b/scripts/halium index 7511c2a..cf1d49f 100644 --- a/scripts/halium +++ b/scripts/halium @@ -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