OSDN Git Service

Allow to show the specified OS title
authorChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 14 Feb 2018 07:09:46 +0000 (15:09 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 14 Feb 2018 07:09:46 +0000 (15:09 +0800)
Android.mk
boot/isolinux/isolinux.cfg
install/grub2/efi/boot/android.cfg
install/scripts/1-install

index b314108..14b1208 100644 (file)
@@ -59,6 +59,7 @@ $(INITRD_RAMDISK): $(initrd_bin) $(systemimg) $(TARGET_INITRD_SCRIPTS) | $(ACP)
        $(if $(TARGET_INITRD_SCRIPTS),$(ACP) -p $(TARGET_INITRD_SCRIPTS) $(TARGET_INITRD_OUT)/scripts)
        ln -s /bin/ld-linux.so.2 $(TARGET_INITRD_OUT)/lib
        echo "VER=$(VER)" > $(TARGET_INITRD_OUT)/scripts/00-ver
+       $(if $(RELEASE_OS_TITLE),echo "OS_TITLE=$(RELEASE_OS_TITLE)" >> $(TARGET_INITRD_OUT)/scripts/00-ver)
        $(if $(INSTALL_PREFIX),echo "INSTALL_PREFIX=$(INSTALL_PREFIX)" >> $(TARGET_INITRD_OUT)/scripts/00-ver)
        $(if $(PREV_VERS),echo "PREV_VERS=\"$(PREV_VERS)\"" >> $(TARGET_INITRD_OUT)/scripts/00-ver)
        $(MKBOOTFS) $(<D) $(TARGET_INITRD_OUT) | gzip -9 > $@
@@ -83,6 +84,7 @@ $(ISO_IMAGE): $(boot_dir) $(BUILT_IMG)
        @echo ----- Making iso image ------
        $(hide) sed -i "s|\(Installation CD\)\(.*\)|\1 $(VER)|; s|CMDLINE|$(BOARD_KERNEL_CMDLINE)|" $</isolinux/isolinux.cfg
        $(hide) sed -i "s|VER|$(VER)|; s|CMDLINE|$(BOARD_KERNEL_CMDLINE)|" $</efi/boot/android.cfg
+       sed -i "s|OS_TITLE|$(if $(RELEASE_OS_TITLE),$(RELEASE_OS_TITLE),Android-x86)|" $</isolinux/isolinux.cfg $</efi/boot/android.cfg
        genisoimage -vJURT -b isolinux/isolinux.bin -c isolinux/boot.cat \
                -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot \
                -input-charset utf-8 -V "Android-x86 LiveCD" -o $@ $^
index 5ebea7c..01ff90e 100644 (file)
@@ -2,7 +2,7 @@ default vesamenu.c32
 timeout 600
 
 menu background android-x86.png
-menu title Android-x86 Live & Installation CD VER
+menu title OS_TITLE Live & Installation CD VER
 menu color border 0 #ffffffff #00000000
 menu color sel 7 #ffffff00 #ff000000
 menu color title 0 #ffffffff #00000000
@@ -12,7 +12,7 @@ menu color hotsel 0 #ffffff00 #ff000000
 menu color hotkey 7 #ffffff00 #00000000
 
 label livem
-       menu label Live CD - ^Run Android-x86 without installation
+       menu label Live CD - ^Run OS_TITLE without installation
        kernel /kernel
        append initrd=/initrd.img CMDLINE quiet SRC= DATA=
 
@@ -22,7 +22,7 @@ label debug
        append initrd=/initrd.img CMDLINE DEBUG=2 SRC= DATA=
 
 label install
-       menu label ^Installation - Install Android-x86 to harddisk
+       menu label ^Installation - Install OS_TITLE to harddisk
        kernel /kernel
        append initrd=/initrd.img CMDLINE INSTALL=1 DEBUG=
 
@@ -45,7 +45,7 @@ label auto_install
        append initrd=/initrd.img CMDLINE AUTO_INSTALL=0 DEBUG=
 
 label auto_update
-       menu label Audo_^Update - Auto update Android-x86
+       menu label Audo_^Update - Auto update OS_TITLE
        kernel /kernel
        append initrd=/initrd.img CMDLINE AUTO_INSTALL=update DEBUG=
 
index dae2a57..f26dcbc 100644 (file)
@@ -1,7 +1,7 @@
 # $1 Title
 # $2... Kernel cmdline
 function add_entry {
-       menuentry "Android-x86 VER $1" "$@" --class android-x86 {
+       menuentry "OS_TITLE VER $1" "$@" --class android-x86 {
                shift 2
                savedefault
                set root=$android
index 2afe9c9..3b96995 100644 (file)
@@ -1,6 +1,5 @@
 #
 # By Chih-Wei Huang <cwhuang@linux.org.tw>
-# Last updated 2018/02/08
 #
 # License: GNU Public License
 # We explicitely grant the right to use the scripts
@@ -11,6 +10,7 @@ tempfile=/tmp/temp-$$
 menufile=/tmp/menu-$$
 
 CPIO=cpio
+OS_TITLE=${OS_TITLE:-Android-x86}
 
 rebooting()
 {
@@ -69,7 +69,7 @@ list_disks()
 auto_partition()
 {
        [ "$AUTO_INSTALL" = "force" ] || dialog --title " Auto Installer " --defaultno --yesno \
-               "\nYou have chosen the AUTO installation.\n\nThe installer will erase the whole /dev/$1 and install Android-x86 to it.\n\nThis is the last confirmation. Are you sure to do so?" 12 61
+               "\nYou have chosen the AUTO installation.\n\nThe installer will erase the whole /dev/$1 and install $OS_TITLE to it.\n\nThis is the last confirmation. Are you sure to do so?" 12 61
        [ $? -ne 0 ] && rebooting
 
        if [ -z "$efi" ]; then
@@ -181,7 +181,7 @@ select_dev()
        } END {
                printf("\"\" \"\"\n\"Create/Modify partitions\" \"\"\n\"Detect devices\" \"\"")
        }' > $menufile
-       choose "Choose Partition" "Please select a partition to install Android-x86:\n\nRecommended minimum free space - 4GB  |  Optimum free space >= 8GB\n\nPartition | Filesystem | Label            | Size     | Drive name/model"
+       choose "Choose Partition" "Please select a partition to install $OS_TITLE:\n\nRecommended minimum free space - 4GB  |  Optimum free space >= 8GB\n\nPartition | Filesystem | Label            | Size     | Drive name/model"
        return $retval
 }
 
@@ -250,10 +250,10 @@ create_menulst()
        [ -n "$VESA" ] && vga=" vga=788 modeset=0"
        echo -e "${GRUB_OPTIONS:-default=0\ntimeout=6\nsplashimage=/grub/android-x86.xpm.gz\n}root (hd0,$1)\n" > $menulst
 
-       create_entry "Android-x86 $VER" quiet $cmdline
-       create_entry "Android-x86 $VER (Debug mode)" $cmdline DEBUG=2
-       create_entry "Android-x86 $VER (Debug nomodeset)" nomodeset $cmdline DEBUG=2
-       create_entry "Android-x86 $VER (Debug video=LVDS-1:d)" video=LVDS-1:d $cmdline DEBUG=2
+       create_entry "$OS_TITLE $VER" quiet $cmdline
+       create_entry "$OS_TITLE $VER (Debug mode)" $cmdline DEBUG=2
+       create_entry "$OS_TITLE $VER (Debug nomodeset)" nomodeset $cmdline DEBUG=2
+       create_entry "$OS_TITLE $VER (Debug video=LVDS-1:d)" video=LVDS-1:d $cmdline DEBUG=2
 }
 
 create_winitem()
@@ -440,7 +440,7 @@ install_to()
                fi
                mkdir -p `dirname $grubcfg` efi$efidir
                cp -af grub2/efi/boot/* efi$efidir
-               sed -i "s|VER|$VER|; s|CMDLINE|$cmdline|" efi$efidir/android.cfg
+               sed -i "s|VER|$VER|; s|CMDLINE|$cmdline|; s|OS_TITLE|$OS_TITLE|" efi$efidir/android.cfg
                [ -s efi/boot/grub/grubenv ] || ( printf %-1024s "# GRUB Environment Block%" | sed 's/k%/k\n/; s/   /###/g' > efi/boot/grub/grubenv )
 
                echo -e 'set timeout=5\nset debug_mode="(DEBUG mode)"' > $grubcfg
@@ -495,7 +495,7 @@ install_to()
        cd hd/$asrc
        rm -rf system*
        ( ( cd /; find $files | $CPIO -H newc -o ) | pv -ns ${size}k | ( $CPIO -iud > /dev/null; echo $? > /tmp/result )) 2>&1 \
-               | progress_bar "Installing Android-x86 to $1" "Expect to write $size KB..."
+               | progress_bar "Installing $OS_TITLE to $1" "Expect to write $size KB..."
        result=$((`cat /tmp/result`*255))
 
        if [ $result -eq 0 ]; then
@@ -565,14 +565,14 @@ do_install()
        until install_hd; do
                if [ $retval -eq 255 ]; then
                        dialog --title ' Error! ' --yes-label Retry --no-label Reboot \
-                               --yesno '\nInstallation failed! Please check if you have enough free disk space to install Android-x86.' 8 51
+                               --yesno '\nInstallation failed! Please check if you have enough free disk space to install $OS_TITLE.' 8 51
                        [ $? -eq 1 ] && rebooting
                fi
        done
 
-       [ -n "$VESA" ] || runit="Run Android-x86"
+       [ -n "$VESA" ] || runit="Run $OS_TITLE"
        dialog --clear --title ' Congratulations! ' \
-               --menu "\n Android-x86 is installed successfully.\n " 11 51 13 \
+               --menu "\n $OS_TITLE is installed successfully.\n " 11 51 13 \
                "$runit" "" "Reboot" "" 2> $tempfile
        case "`cat $tempfile`" in
                Run*)