Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

bootable-newinstaller: Commit

bootable/newinstaller


Commit MetaInfo

Révision815812a6464f62e791a85ae20ad7645991dab301 (tree)
l'heure2019-12-03 11:47:51
AuteurMichael Goffioul <michael.goffioul@linc...>
CommiterChih-Wei Huang

Message de Log

Mount system partition at root

Change Summary

Modification

--- 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
@@ -97,32 +97,23 @@ check_root()
9797 mkdir /mnt/iso
9898 mount -o loop /iso/$iso /mnt/iso
9999 fi
100- if [ -e /mnt/$SRC/$RAMDISK ]; then
101- zcat /mnt/$SRC/$RAMDISK | cpio -id > /dev/null
102- elif [ -b /dev/$RAMDISK ]; then
103- zcat /dev/$RAMDISK | cpio -id > /dev/null
104- else
105- return 1
106- fi
107100 if [ -e /mnt/$SRC/system.sfs ]; then
108- mount -o loop,noatime /mnt/$SRC/system.sfs system
109- if [ -e system/system.img ]; then
110- mount --move system /sfs
111- mount -o loop,noatime /sfs/system.img system
101+ mount -o loop,noatime /mnt/$SRC/system.sfs android
102+ if [ -e android/system.img ]; then
103+ mount --move android /sfs
104+ mount -o loop,noatime /sfs/system.img android
112105 fi
113106 elif [ -e /mnt/$SRC/system.img ]; then
114107 remount_rw
115- mount -o loop,noatime /mnt/$SRC/system.img system
108+ mount -o loop,noatime /mnt/$SRC/system.img android
116109 elif [ -d /mnt/$SRC/system ]; then
117110 remount_rw
118- mount --bind /mnt/$SRC/system system
119- elif [ -z "$SRC" -a -e /mnt/build.prop ]; then
120- mount --bind /mnt system
111+ mount --bind /mnt/$SRC/system android
112+ elif [ -z "$SRC" -a -e /mnt/default.prop ]; then
113+ mount --bind /mnt android
121114 else
122- rm -rf *
123115 return 1
124116 fi
125- mkdir -p mnt
126117 echo " found at $1"
127118 rm /sbin/mke2fs
128119 hash -r
@@ -142,14 +133,13 @@ debug_shell()
142133 USER="($1)" system/bin/sh -l 2>&1
143134 else
144135 echo Running busybox ash...
145- sh 2>&1
136+ busybox sh 2>&1
146137 fi
147138 }
148139
149140 echo -n Detecting Android-x86...
150141
151142 [ -z "$SRC" -a -n "$BOOT_IMAGE" ] && SRC=`dirname $BOOT_IMAGE`
152-[ -z "$RAMDISK" ] && RAMDISK=ramdisk.img || RAMDISK=${RAMDISK##/dev/}
153143
154144 for c in `cat /proc/cmdline`; do
155145 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))
Afficher sur ancien navigateur de dépôt.