OSDN Git Service

init: avoid finding system partition too aggressive
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 2 Dec 2019 10:48:00 +0000 (18:48 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 2 Dec 2019 10:48:00 +0000 (18:48 +0800)
If SRC is specified, do not use a system-like partition. This avoids
misuse.

initrd/init

index 8da4565..df1949f 100755 (executable)
@@ -114,7 +114,7 @@ check_root()
        elif [ -d /mnt/$SRC/system ]; then
                remount_rw
                mount --bind /mnt/$SRC/system system
-       elif [ -e /mnt/build.prop ]; then
+       elif [ -z "$SRC" -a -e /mnt/build.prop ]; then
                mount --bind /mnt system
        else
                rm -rf *