• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

bootable/newinstaller


Commit MetaInfo

Révisiona157295e4aed7f07042e372863d30813f2ee2796 (tree)
l'heure2015-07-26 16:43:50
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86

Change Summary

Modification

--- a/Android.mk
+++ b/Android.mk
@@ -75,7 +75,7 @@ $(INITRD_RAMDISK): $(initrd_bin) $(systemimg) $(TARGET_INITRD_SCRIPTS) | $(ACP)
7575 $(MKBOOTFS) $(TARGET_INSTALLER_OUT) | gzip -9 > $@
7676
7777 INSTALL_RAMDISK := $(PRODUCT_OUT)/install.img
78-$(INSTALL_RAMDISK): $(wildcard $(LOCAL_PATH)/install/*/*) | $(MKBOOTFS)
78+$(INSTALL_RAMDISK): $(wildcard $(LOCAL_PATH)/install/*/* $(LOCAL_PATH)/install/*/*/*/*) | $(MKBOOTFS)
7979 $(if $(TARGET_INSTALL_SCRIPTS),$(ACP) -p $(TARGET_INSTALL_SCRIPTS) $(TARGET_INSTALLER_OUT)/scripts)
8080 $(MKBOOTFS) $(dir $(dir $(<D))) | gzip -9 > $@
8181
@@ -109,7 +109,7 @@ $(EFI_IMAGE): $(wildcard $(LOCAL_PATH)/boot/efi/*/*) $(BUILT_IMG) $(ESP_LAYOUT)
109109 done; \
110110 size=$$(($$(($$(($$(($$(($$size + $$(($$size / 100)))) - 1)) / 32)) + 1)) * 32)); \
111111 rm -f $@.fat; mkdosfs -n Android-x86 -C $@.fat $$size
112- $(hide) mcopy -Qsi $@.fat $(dir $(<D)) $(BUILT_IMG) ::
112+ $(hide) mcopy -Qsi $@.fat $(<D)/../../../install/grub2/efi $(BUILT_IMG) ::
113113 $(hide) mcopy -Qoi $@.fat $(@D)/grub.cfg ::efi/boot
114114 $(hide) cat /dev/null > $@; $(edit_mbr) -l $(ESP_LAYOUT) -i $@ esp=$@.fat
115115 $(hide) rm -f $@.fat
--- a/boot/efi/boot/grub.cfg
+++ b/boot/efi/boot/grub.cfg
@@ -1,18 +1,18 @@
11 menuentry 'Android-x86 VER Live' --class android-x86 {
22 search --file --no-floppy --set=root /system.sfs
3- linuxefi /kernel CMDLINE sdhci.debug_quirks=0x8000 quiet DATA=
3+ linuxefi /kernel CMDLINE quiet DATA=
44 initrdefi /initrd.img
55 }
66
77 menuentry 'Android-x86 VER DEBUG mode' --class android-x86 {
88 search --file --no-floppy --set=root /system.sfs
9- linuxefi /kernel CMDLINE sdhci.debug_quirks=0x8000 DATA= DEBUG=2
9+ linuxefi /kernel CMDLINE DATA= DEBUG=2
1010 initrdefi /initrd.img
1111 }
1212
1313 menuentry 'Android-x86 VER Installation' --class android-x86 {
1414 search --file --no-floppy --set=root /system.sfs
15- linuxefi /kernel CMDLINE sdhci.debug_quirks=0x8000 DEBUG= INSTALL=1
15+ linuxefi /kernel CMDLINE DEBUG= INSTALL=1
1616 initrdefi /initrd.img
1717 }
1818
Binary files /dev/null and b/install/bin/cgdisk differ
Binary files /dev/null and b/install/lib/libgcc_s.so.1 differ
Binary files /dev/null and b/install/lib/libstdc++.so.6 differ
Binary files a/install/lib/libuuid.so.1 and b/install/lib/libuuid.so.1 differ
--- a/install/scripts/1-install
+++ b/install/scripts/1-install
@@ -60,7 +60,12 @@ partition_drive()
6060 choose "Choose Drive" "Please select a drive to edit partitions:"
6161 fi
6262 if [ $retval -eq 0 ]; then
63- cfdisk /dev/$choice
63+ dialog --title " Confirm " --defaultno --yesno "\n Do you want to use GPT?" 7 29
64+ if [ $? -eq 0 ]; then
65+ cgdisk /dev/$choice
66+ else
67+ cfdisk /dev/$choice
68+ fi
6469 if [ $? -eq 0 ]; then
6570 retval=1
6671 else
@@ -72,12 +77,31 @@ partition_drive()
7277
7378 select_dev()
7479 {
75- fdisk -l | grep ^/dev | cut -b6-12,55- | awk '{
76- if (!match($2, "Extended")) {
77- printf("\"%-28s", $0)
78- system("echo -n `cat /sys/block/*/"$1"/../device/model`")
79- printf("\" \"\"\n")
80- }
80+ blkid | grep -v -E "^/dev/block/|^/dev/loop" | cut -b6- | sort | awk '{
81+ t="unknown"
82+ for (i = NF; i > 1; --i)
83+ if (match($i, "^TYPE")) {
84+ t=$i
85+ break
86+ }
87+ gsub(/TYPE=|"/, "", t)
88+ printf("%s\t%s\n", $1, t)
89+ }' > $tempfile
90+
91+ lsblk=`ls /sys/block | grep -v -E "loop|ram|sr|boot|rpmb"`
92+ for d in $lsblk; do
93+ p=0
94+ for i in /sys/block/$d/$d* /sys/block/$d; do
95+ [ -e $i/partition ] && p=1
96+ [ $p -eq 1 -a "$i" = "/sys/block/$d" ] && break
97+ echo $i | grep -q -E "boot|rpmb" && continue
98+ [ -d $i ] && ( grep "`basename $i:`" $tempfile || echo "`basename $i` unknown" )
99+ done
100+ done | awk '{
101+ sub(/:/, "", $1)
102+ printf("\"%-13s%-17s", $1, $2)
103+ system("cd /sys/block; for f in "$1"/device/model "$1"/device/name */"$1"/../device/model */"$1"/../device/name; do [ -e $f ] && echo -n `cat $f` && break; done")
104+ printf("\" \"\"\n")
81105 } END {
82106 printf("\"Create/Modify partitions\" \"\"\n\"Detect devices\" \"\"")
83107 }' > $menufile
@@ -116,7 +140,7 @@ format_fs()
116140 ;;
117141 esac
118142 if [ -n "$cmd" ]; then
119- dialog --title " Confirm " --no-label Skip --yesno \
143+ dialog --title " Confirm " --defaultno --yesno \
120144 "\n You chose to format $1 to $choice.\n All data in that partition will LOSE.\n\n Are you sure to format the partition $1?" 10 51
121145 [ $? -ne 0 ] && return 1
122146 $cmd Android-x86 /dev/$1 | awk '{
@@ -139,7 +163,6 @@ create_menulst()
139163 menulst=/hd/grub/menu.lst
140164 [ -n "$VESA" ] && vga=" vga=788 modeset=0"
141165 echo -e "${GRUB_OPTIONS:-default=0\ntimeout=6\nsplashimage=/grub/android-x86.xpm.gz\n}root (hd0,$1)\n" > $menulst
142- cmdline=`cat /proc/cmdline | sed "s|\(initrd.*img\s*\)||; s|quiet\s*||; s|\(vga=\w\+\?\s*\)||; s|\(DPI=\w\+\?\s*\)||; s|\(INSTALL=\w\+\?\s*\)||; s|\(SRC=\S\+\?\s*\)||; s|\(DEBUG=\w\+\?\s*\)||; s|\(BOOT_IMAGE.*\)||"`
143166
144167 create_entry "Android-x86 $VER" quiet $cmdline
145168 create_entry "Android-x86 $VER (Debug mode)" $cmdline DEBUG=2
@@ -215,6 +238,20 @@ try_upgrade()
215238 done
216239 }
217240
241+get_part_info()
242+{
243+ d=0
244+ while [ 1 ]; do
245+ h=`echo $d | awk '{ printf("%c", $1+97) }'`
246+ for part in /sys/block/[shv]d$h/$1 /sys/block/mmcblk$d/$1; do
247+ [ -d $part ] && break 2
248+ done
249+ d=$(($d+1))
250+ done
251+ p=`cat $part/partition`
252+ disk=$(basename `dirname $part`)
253+}
254+
218255 install_to()
219256 {
220257 cd /
@@ -228,20 +265,15 @@ install_to()
228265 done
229266
230267 fs=`cat /proc/mounts | grep /dev/$1 | awk '{ print $3 }'`
268+ cmdline=`sed "s|\(initrd.*img\s*\)||; s|quiet\s*||; s|\(vga=\w\+\?\s*\)||; s|\(DPI=\w\+\?\s*\)||; s|\(INSTALL=\w\+\?\s*\)||; s|\(SRC=\S\+\?\s*\)||; s|\(DEBUG=\w\+\?\s*\)||; s|\(BOOT_IMAGE=\S\+\?\s*\)||" /proc/cmdline`
231269
232270 asrc=android-$VER
233271 [ "$fs" != "ext4" ] && dialog --title " Confirm " --no-label Skip --defaultno --yesno \
234272 "\n Do you want to install boot loader GRUB?" 7 47
235273 if [ $? -eq 0 ]; then
236274 cp -af /grub /hd
237- d=0
238- while [ 1 ]; do
239- h=`echo $d | awk '{ printf("%c", $1+97) }'`
240- [ -d /sys/block/[shv]d$h/$1 ] && break
241- d=$(($d+1))
242- done
243- p=$((`echo $1 | cut -b4-`-1))
244- disk=`echo $1 | cut -b-3`
275+ get_part_info $1
276+ p=$(($p-1))
245277 create_menulst $p
246278 create_winitem $1 $d
247279 rm -f /hd/boot/grub/stage1
@@ -250,6 +282,31 @@ install_to()
250282 [ $? -ne 0 ] && return 255
251283 fi
252284
285+ dialog --title " Confirm " --no-label Skip --defaultno --yesno \
286+ "\n Do you want to install EFI GRUB2?" 7 39
287+ if [ $? -eq 0 ]; then
288+ get_part_info $1
289+ for i in /sys/block/$disk/$disk*; do
290+ [ 0`cat $i/partition` -eq 1 ] && break
291+ done
292+ boot=`basename $i`
293+ mountpoint -q /hd && umount /hd
294+ dialog --title " Confirm " --defaultno --yesno \
295+ "\n Do you want to format the boot partition\n /dev/$boot?" 8 45
296+ [ $? -eq 0 ] && mkdosfs -n EFI /dev/$boot
297+ try_mount rw /dev/$boot /hd
298+ cp -af /grub2/efi /hd
299+ grubcfg=/hd/efi/boot/grub.cfg
300+ echo -e "set timeout=6" > $grubcfg
301+ echo -e "menuentry \"Android-x86 $VER\" {\n\tsearch --set=root --file /$asrc/kernel\n\tlinuxefi /$asrc/kernel quiet $cmdline \n\tinitrdefi /$asrc/initrd.img\n}" >> $grubcfg
302+ echo -e "menuentry \"Android-x86 $VER (DEBUG mode)\" {\n\tsearch --set=root --file /$asrc/kernel\n\tlinuxefi /$asrc/kernel $cmdline DEBUG=2\n\tinitrdefi /$asrc/initrd.img\n}" >> $grubcfg
303+ if [ -e /hd/EFI/Microsoft/Boot/bootmgfw.efi ]; then
304+ echo -e "menuentry \"Windows (UEFI)\" {\n\tsearch --set=root --file /EFI/Microsoft/Boot/bootmgfw.efi\n\tchainloader /EFI/Microsoft/Boot/bootmgfw.efi\n}" >> $grubcfg
305+ fi
306+ mountpoint -q /hd && umount /hd
307+ try_mount rw /dev/$1 /hd
308+ fi
309+
253310 dialog --title " Question " --yesno \
254311 "\nDo you want to install /system directory as read-write?\n\nMaking /system be read-write is easier for debugging, but it needs more disk space and longer installation time." 10 61
255312 instal_rw=$?
@@ -278,11 +335,13 @@ install_to()
278335 result=$((`cat /tmp/result`*255))
279336
280337 if [ $result -eq 0 ]; then
281- chmod 644 *
282- chown 0.0 *
283338 for d in android mnt sfs ./$SRC; do
284339 [ -d $d ] && mv $d/* . && rmdir $d
285340 done
341+ chown 0.0 *
342+ for f in *; do
343+ [ -d $f ] || chmod 644 $f
344+ done
286345
287346 case "$fs" in
288347 vfat|fuseblk)
@@ -294,6 +353,7 @@ install_to()
294353 esac
295354 fi
296355
356+ dialog --infobox "\n Syncing to disk..." 5 27
297357 sync
298358
299359 return $result