Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

bootable-newinstaller: Commit

bootable/newinstaller


Commit MetaInfo

Revisióna0c195c7e550abd0384291fd7042d2ebca92e303 (tree)
Tiempo2019-12-02 20:03:10
AutorMichael Goffioul <michael.goffioul@linc...>
CommiterChih-Wei Huang

Log Message

Mount system partition at root

Cambiar Resumen

Diferencia

--- a/Android.mk
+++ b/Android.mk
@@ -46,7 +46,7 @@ TARGET_INITRD_OUT := $(PRODUCT_OUT)/initrd
4646 INITRD_RAMDISK := $(TARGET_INITRD_OUT).img
4747 $(INITRD_RAMDISK): $(initrd_bin) $(systemimg) $(TARGET_INITRD_SCRIPTS) | $(ACP) $(MKBOOTFS)
4848 $(hide) rm -rf $(TARGET_INITRD_OUT)
49- mkdir -p $(addprefix $(TARGET_INITRD_OUT)/,android hd iso lib mnt proc scripts sfs sys tmp)
49+ mkdir -p $(addprefix $(TARGET_INITRD_OUT)/,android apex hd iso lib mnt proc scripts sfs sys tmp)
5050 $(if $(TARGET_INITRD_SCRIPTS),$(ACP) -p $(TARGET_INITRD_SCRIPTS) $(TARGET_INITRD_OUT)/scripts)
5151 ln -s /bin/ld-linux.so.2 $(TARGET_INITRD_OUT)/lib
5252 echo "VER=$(VER)" > $(TARGET_INITRD_OUT)/scripts/00-ver
@@ -79,7 +79,7 @@ $(boot_dir): $(shell find $(LOCAL_PATH)/boot -type f | sort -r) $(isolinux_files
7979 mkdosfs -n EFI $$img; mmd -i $$img ::boot; \
8080 mcopy -si $$img $@/efi ::; mdel -i $$img ::efi/boot/*.cfg
8181
82-BUILT_IMG := $(addprefix $(PRODUCT_OUT)/,ramdisk.img initrd.img install.img) $(systemimg)
82+BUILT_IMG := $(addprefix $(PRODUCT_OUT)/,initrd.img install.img) $(systemimg)
8383 BUILT_IMG += $(if $(TARGET_PREBUILT_KERNEL),$(TARGET_PREBUILT_KERNEL),$(PRODUCT_OUT)/kernel)
8484
8585 ISO_IMAGE := $(PRODUCT_OUT)/$(TARGET_PRODUCT).iso
--- a/initrd/init
+++ b/initrd/init
@@ -98,32 +98,23 @@ check_root()
9898 mount -o loop /iso/$iso /mnt/iso
9999 SRC=iso
100100 fi
101- if [ -e /mnt/$SRC/$RAMDISK ]; then
102- zcat /mnt/$SRC/$RAMDISK | cpio -id > /dev/null
103- elif [ -b /dev/$RAMDISK ]; then
104- zcat /dev/$RAMDISK | cpio -id > /dev/null
105- else
106- return 1
107- fi
108101 if [ -e /mnt/$SRC/system.sfs ]; then
109- mount -o loop,noatime /mnt/$SRC/system.sfs system
110- if [ -e system/system.img ]; then
111- mount --move system /sfs
112- mount -o loop,noatime /sfs/system.img system
102+ mount -o loop,noatime /mnt/$SRC/system.sfs android
103+ if [ -e android/system.img ]; then
104+ mount --move android /sfs
105+ mount -o loop,noatime /sfs/system.img android
113106 fi
114107 elif [ -e /mnt/$SRC/system.img ]; then
115108 remount_rw
116- mount -o loop,noatime /mnt/$SRC/system.img system
109+ mount -o loop,noatime /mnt/$SRC/system.img android
117110 elif [ -d /mnt/$SRC/system ]; then
118111 remount_rw
119- mount --bind /mnt/$SRC/system system
120- elif [ -z "$SRC" -a -e /mnt/build.prop ]; then
121- mount --bind /mnt system
112+ mount --bind /mnt/$SRC/system android
113+ elif [ -z "$SRC" -a -e /mnt/default.prop ]; then
114+ mount --bind /mnt android
122115 else
123- rm -rf *
124116 return 1
125117 fi
126- mkdir -p mnt
127118 echo " found at $1"
128119 rm /sbin/mke2fs
129120 hash -r
@@ -143,14 +134,13 @@ debug_shell()
143134 USER="($1)" system/bin/sh -l 2>&1
144135 else
145136 echo Running busybox ash...
146- sh 2>&1
137+ busybox sh 2>&1
147138 fi
148139 }
149140
150141 echo -n Detecting Android-x86...
151142
152143 [ -z "$SRC" -a -n "$BOOT_IMAGE" ] && SRC=`dirname $BOOT_IMAGE`
153-[ -z "$RAMDISK" ] && RAMDISK=ramdisk.img || RAMDISK=${RAMDISK##/dev/}
154144
155145 for c in `cat /proc/cmdline`; do
156146 case $c in
@@ -162,8 +152,7 @@ for c in `cat /proc/cmdline`; do
162152 esac
163153 done
164154
165-mount -t tmpfs tmpfs /android
166-cd /android
155+cd /
167156 while :; do
168157 for device in ${ROOT:-/dev/[hmnsv][dmrv][0-9a-z]*}; do
169158 check_root $device && break 2
@@ -172,23 +161,20 @@ while :; do
172161 sleep 1
173162 echo -n .
174163 done
164+cd /android
175165
176166 ln -s mnt/$SRC /src
177167 ln -s android/system /
178168 ln -s ../system/lib/firmware ../system/lib/modules /lib
179169
180-if [ -n "$INSTALL" ]; then
181- zcat /src/install.img | ( cd /; cpio -iud > /dev/null )
170+if [ -d system/apex/com.android.runtime.debug ]; then
171+ ln -s ../android/system/apex/com.android.runtime.debug /apex/com.android.runtime
172+else
173+ ln -s ../android/system/apex/com.android.runtime.release /apex/com.android.runtime
182174 fi
183175
184-if [ -x system/bin/ln -a \( -n "$DEBUG" -o -n "$BUSYBOX" \) ]; then
185- mv -f /bin /lib .
186- sed -i 's|\( PATH.*\)|\1:/bin|' init.environ.rc
187- rm /sbin/modprobe
188- busybox mv /sbin/* sbin
189- rmdir /sbin
190- ln -s android/bin android/lib android/sbin /
191- hash -r
176+if [ -n "$INSTALL" ]; then
177+ zcat /src/install.img | ( cd /; cpio -iud > /dev/null )
192178 fi
193179
194180 # load scripts
--- a/install/scripts/1-install
+++ b/install/scripts/1-install
@@ -334,7 +334,7 @@ try_upgrade()
334334 [ -d $1 ] && return
335335
336336 for d in hd/*; do
337- [ -e "$d"/ramdisk.img -a -n "`ls "$d"/system* 2> /dev/null`" ] && echo \"`basename $d`\" \"\"
337+ [ -n "`ls "$d"/system* 2> /dev/null`" ] && echo \"`basename $d`\" \"\"
338338 done | sort -r > $menufile
339339
340340 count=`wc -l < $menufile`
@@ -507,7 +507,7 @@ install_to()
507507 else
508508 sysimg="mnt/$SRC/system.*"
509509 fi
510- files="mnt/$SRC/kernel mnt/$SRC/initrd.img mnt/$SRC/$RAMDISK $sysimg"
510+ files="mnt/$SRC/kernel mnt/$SRC/initrd.img $sysimg"
511511 size=0
512512 for s in `du -sk $files | awk '{print $1}'`; do
513513 size=$(($size+$s))
@@ -515,7 +515,7 @@ install_to()
515515 try_upgrade hd/$asrc
516516 mkdir -p hd/$asrc
517517 cd hd/$asrc
518- rm -rf system*
518+ rm -rf system* *.img
519519 ( ( cd /; find $files | $CPIO -H newc -o ) | pv -ns ${size}k | ( $CPIO -iud > /dev/null; echo $? > /tmp/result )) 2>&1 \
520520 | progress_bar "Installing $OS_TITLE to $1" "Expect to write $size KB..."
521521 result=$((`cat /tmp/result`*255))
Show on old repository browser