OSDN Git Service

Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86
[android-x86/bootable-newinstaller.git] / initrd / init
index a97a670..dd775e6 100755 (executable)
@@ -3,8 +3,6 @@
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
 # and Thorsten Glaser <tg@mirbsd.org>
 #
-# Last updated 2018/01/26
-#
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
 # with Android-x86 project.
@@ -105,8 +103,11 @@ check_root()
                return 1
        fi
        if [ -e /mnt/$SRC/system.sfs ]; then
-               mount -o loop,noatime /mnt/$SRC/system.sfs /sfs
-               mount -o loop,noatime /sfs/system.img system
+               mount -o loop,noatime /mnt/$SRC/system.sfs system
+               if [ -e system/system.img ]; then
+                       mount --move system /sfs
+                       mount -o loop,noatime /sfs/system.img system
+               fi
        elif [ -e /mnt/$SRC/system.img ]; then
                remount_rw
                mount -o loop,noatime /mnt/$SRC/system.img system
@@ -137,6 +138,7 @@ debug_shell()
        if [ -x system/bin/sh ]; then
                echo Running MirBSD Korn Shell...
                USER="($1)" system/bin/sh -l 2>&1
+               [ $? -ne 0 ] && /bin/sh 2>&1
        else
                echo Running busybox ash...
                sh 2>&1
@@ -178,8 +180,8 @@ if [ -n "$INSTALL" ]; then
        zcat /src/install.img | ( cd /; cpio -iud > /dev/null )
 fi
 
-if [ -x system/bin/ln -a \( -n "$DEBUG" -o -n "$BUSYBOX" \) ]; then
-       mv /bin /lib .
+if [ -x system/bin/ln -a -n "$BUSYBOX" ]; then
+       mv -f /bin /lib .
        sed -i 's|\( PATH.*\)|\1:/bin|' init.environ.rc
        rm /sbin/modprobe
        busybox mv /sbin/* sbin