Multi-Boot ROM released [EMMC INSTALLATION]

Hi, here we release a multi-boot ROM for Khadas VIM, check Firmware Page to download the ROM.

Release notes

  • Attention: for VIM Pro model only!
  • Version: VimPro_DualOS_Marshmallow_Ubuntu-16.04_170124.7z
  • MD5: 436e58c3bdbd319358b2c26fc0237ade
  • For eMMC installation only
  • Android OS, based on Vim_Marshmallow_Root_170121
  • Ubuntu OS, based on Vim_Ubuntu-16.04_V170124
  • Partitions:
    • Android: around 6GB
    • Ubuntu: around 10GB

Multi-OS Switch

  • Normal boot: Android OS
  • Press Function button when power on: Ubuntu
  • Android --> Ubuntu: Long press Power button, choose Reboot to Ubuntu menu
  • Ubuntu ā€”> Android: reboot

Known issues:

  • After installation and first booting, if it take you too long time(>6mins) to boot into Android OS, just:
    • Plug-out the USB-C cable and plug-in again to continue the first booting (It will boot into Android)
    • Press the Reset and continue the first booting
      (Only the 1st booting might appears)

Upgrade guidance:

TODO

  • Smart boot with LibreELEC OS on external SD card

One more

Enjoy!

3 Likes

Can we install ā€œgrubā€ to desire which OS be the default boot ? (instead of Android as default)

1 Like

Grub is not supported yet.

I think other bootloaders also can support boot menu for desire OS, but we need further research on that.

PS: if someone know about UEFI, kindly let us know.

1 Like

I think the simplest way to make bootmenu is adding come procedure into CONFIG_EXTRA_ENV_SETTINGS in the board/khadas/config/kvim.h file.

The grub - is not our way in the embedded systems domain. :wink:

1 Like

During the experiments, to enable multi-boot on firmware version dualOS, I found an interesting behavior of VIM. If you record to external media version Armbian (something on the media was part of ROOTFS). To connect this device to VIM and run Android mode ā€œReboot to Ubuntuā€. When you start to be launched version of the ā€œrootfsā€ external media. Kernel will be taken from the internal memory, and the whole rootfs from external. For example, you can record the latest version Armbian to external media and when you start you will get a ā€œhybridā€ system, kernel the old and the new root system. :slight_smile: This way I am launched version Armbian Ubuntu Mate and performed from the backup to a compressed full backup of the internal content eMMX (command as root ā€œdd_backup_xā€).

Yes, our guys got the both U-Boot and Kernel patched with the dual OS supported:

U-Boot:

commit 2f8d9493bad6100d36d431c8f0e5fc355cfe7771
Author: terry <terry@szwesion.com>
Date:   Fri Jan 20 17:11:36 2017 +0800

    MultiOS: add multi boot property

diff --git a/arch/arm/include/asm/arch-gxl/reboot.h b/arch/arm/include/asm/arch-gxl/reboot.h
index ef7ad3e..92363ca 100644
--- a/arch/arm/include/asm/arch-gxl/reboot.h
+++ b/arch/arm/include/asm/arch-gxl/reboot.h
@@ -45,6 +45,8 @@ Reboot reason AND corresponding env setting:
 #define        AMLOGIC_CRASH_REBOOT                    11
 #define AMLOGIC_KERNEL_PANIC                   12
 #define AMLOGIC_WATCHDOG_REBOOT                        13
+#define AMLOGIC_UBUNTU_REBOOT           14
+#define AMLOGIC_LIBREELEC_REBOOT          15
 
 /*
 old version env
diff --git a/common/cmd_reboot.c b/common/cmd_reboot.c
index 2f304a7..32bd673 100644
--- a/common/cmd_reboot.c
+++ b/common/cmd_reboot.c
@@ -90,6 +90,16 @@ int do_get_rebootmode (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
                        setenv("reboot_mode","watchdog_reboot");
                        break;
                }
+               case AMLOGIC_UBUNTU_REBOOT:
+               {
+                       setenv("reboot_mode","ubuntu_reboot");
+                       break;
+               }
+               case AMLOGIC_LIBREELEC_REBOOT:
+               {
+                       setenv("reboot_mode","libreelec_reboot");
+                       break;
+               }
 
                default:
                {
@@ -127,6 +137,10 @@ int do_reboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        reboot_mode_val = AMLOGIC_CRASH_REBOOT;
                else if (strcmp(mode, "kernel_panic") == 0)
                        reboot_mode_val = AMLOGIC_KERNEL_PANIC;
+               else if (strcmp(mode, "ubuntu_reboot") ==0)
+                       reboot_mode_val = AMLOGIC_UBUNTU_REBOOT;
+               else if (strcmp(mode, "libreelec_reboot") ==0)
+                       reboot_mode_val = AMLOGIC_LIBREELEC_REBOOT;
                else {
                        printf("Can not find match reboot mode, use normal by default\n");
                        reboot_mode_val = AMLOGIC_NORMAL_BOOT;

Linux Kernel:

commit 8d09e64bbd17c40106895e0af155a68c43e2bf37
Author: terry <terry@szwesion.com>
Date:   Fri Jan 20 17:17:24 2017 +0800

    MultiOS: add multi boot support

diff --git a/drivers/amlogic/reset/gxbb_poweroff.c b/drivers/amlogic/reset/gxbb_poweroff.c
index df7d213..b62d151 100644
--- a/drivers/amlogic/reset/gxbb_poweroff.c
+++ b/drivers/amlogic/reset/gxbb_poweroff.c
@@ -55,6 +55,8 @@
 #define MESONGXBB_HIBERNATE                                    0x6
 #define        MESONGXBB_CRASH_REBOOT                                  11
 #define        MESONGXBB_KERNEL_PANIC                                  12
+#define MESONGXBB_UBUNTU_BOOT                   14
+#define MESONGXBB_LIBREELEC_BOOT                  15
 
 
 #define AO_RTI_STATUS_REG1     ((0x00 << 10) | (0x01 << 2))
@@ -80,6 +82,10 @@ static u32 parse_reason(const char *cmd)
                        reboot_reason = MESONGXBB_UBOOT_SUSPEND;
                else if (strcmp(cmd, "hibernate") == 0)
                        reboot_reason = MESONGXBB_HIBERNATE;
+               else if (strcmp(cmd, "ubuntu") == 0)
+                       reboot_reason = MESONGXBB_UBUNTU_BOOT;
+               else if (strcmp(cmd, "libreelec") == 0)
+                       reboot_reason = MESONGXBB_LIBREELEC_BOOT;
        } else {
                if (kernel_panic) {
                        if (strcmp(kernel_panic, "kernel_panic") == 0)

Hello,
Iā€™m very new to this forum an to the khadas VIM (Iā€™ve the pro version);
Iā€™ve installed the dual OS to my emmc;
iā€™m happy enough with both the android and the ubuntu.

But can someone please tell if it is possible to upgrade only the ubuntu ā€œpartitionā€ now that an updated img has been published ?
All the instruction Iā€™ve found seem to only deal with single OS contexts wher fully replacing the emmc content with the ubuntu img is the norm.

Thanks in adavnce
Regards.

Hi, Ravelo:
I think itā€™s possible to archive this, but I also need some research. And following are the thinking:
1) Upack the new released Ubuntu ROM and get boot.img and rootfs.img
2) Boot into U-Boot mode
3) Follow U-Boot usage guidance to upgrade the boot.img and rootfs.img manually.

Enjoy!

1 Like

Hi Gouwa.
There is an option to automate the update process. Alternatively, if you have enabled multiboot. Multiboot is in fact the autostart script with the specified name. The contents of a script can be very different. Including procedure updates. Creates a script to record the desired image (boot.img rootfs.img u-boot.img android-system.img etc). Creates an image with this script and a set of archives. The user downloads the image. Write to the media. VIM connects to and enables it. The script overwrites all the machine itself (the dd command with the necessary parameters communication file archive=section for updates).

By the way, you can make universal image (to run from external media SD or USB) minimum system and script (s905_autoscript) , which will automatically connect to an external server on Your side. Checks specific files , downloads, verifies the checksum and if everything is correct the automatic updates section in the internal memory (eMMC). The user that does not need to be done in manual (will not be problems and mistakes from wrong user actions). You can add validation of the model and the size of the internal memory.

4 Likes

Okay, since I spent a bunch of time trying to understand this and asking my self how/why this was the case, for those of you who happen to choose to use the Dual Boot image listed here and you end up with a Ubuntu rootfs volume that is only 4GB in size, it is because for some reason at first boot either the script didnā€™t run or doesnā€™t exist to perform the needed resize2fs on the rootfs volume. In my case I ended up with only a 4GB /dev/rootfs volume, though when running fdisk -l /dev/rootfs showed it was 8GB in size. I was perplexed because it seems you can not make/edit partitions on the eMMc like you would a normal disk, so I was stuck asking my self, how do I resize the partition on this thing?

So after thinking about this, while it would still be nice to know how you can manually make changes to the partition table, the answer was, at least in my case, it had failed to run ā€˜resize2fs /dev/rootfsā€™ on my volume after/on first boot. Running this will enlarge the volume to take up the full 8GB and allow you full access to the 8GB promised. (Side note: in the topic it mentions 6GB for Android and 10Gb for Ubuntu, this is in GB instead of GiB, so in reality you end up with 6GiB Android and 8GiB Ubuntu for a total of 14.6GiB or 16GB).

Also, @Gouwa if you can point me to how you can make manual partition table changes on the eMMc it would be appriciated.

Hopefully this helps someone out!

my 2 cents.

Cheers!

hi, Acottrill:
Regarding the partitions, you can check the partitions table for the details.

1) Table for Ubuntu only:

2) Table for Ubuntu + Android Dualboot:

Hi, Iā€™m very new to khada and have managed to get android working with the VimPro_DualOS_Marshmallow_Ubuntu-16.04_170124 image although Iā€™ve not managed to boot into Ubuntu.

When I press and hold the power button I donā€™t get the options listed in the screenshot. Just Power off and Reboot. Equally pressing the function button while turning on boots into Android and not Ubuntu.

Have I missed anything or or there another way? Thanks in advance.

PS: Iā€™m using the Vim Pro.

The VIM canā€™t boot ubuntu when you press the function button.
You need to boot into android system and long press power button. Then you can reboot to ubuntu
Yes, it is very unfriendy
The better method is that always boot to what you selected, until you change it and then always boot that.
what do you think about this?
We will add support for that in next release DualOS.

I see on the screen there is a restart LE, you already have a working version of the menu ? :slight_smile:

No, It is only a old picture for VIM. :grinning:

Oops. I have already added the desired items to Linux and LE. To create a complete system, lacking only menu in Android. :slight_smile:

1 Like

Having Ubuntu_XFCE installed on EMMC.
And would like to try a 2nd OS on SD card.

  • grub is one way out, booting by OS
  • and something like BIOS can do the trick as well, we boot by choosing devices (EMMC or SD card)

Anyway, how can I boot from SD card instead of EMMC for now???