How to: Linux Android OpenELEC triple boot (with boot menu)

Moderators: mdrjr, odroid

How to: Linux Android OpenELEC triple boot (with boot menu)

Unread postby loboris » Sat Jan 24, 2015 7:37 am

I've created the scripts to enable triple booting Ubuntu/Debian linux, Android and OpenELEC from the same SD Card.
You can also download prepared triple boot 8GB image with Hardkernel's Android 4.4.2 (v1.5)+Gapps, Ubuntu 15.04 (Vivid) with Mate desktop and OpenELEC 5.0.5 (see bottom of the post).

I recommend to test with minimal linux image created with my other scripts (http://forum.odroid.com/viewtopic.php?f=112&t=8075).
Everthing works great and procedure is quite simple:

Download scripts from: http://loboris.eu/tripleboot.tar.gz
Last update: 2015-05-30 23:20 UTC

- Script(s) must be run on Linux PC, tested on Ubuntu 14.04, 14.10, 15.04.
- to work with sd card images you must have kpartx installed
Code: Select all
sudo apt-get install kpartx

- to prepare OpenElec por triple boot must have u-boot-tools installed
Code: Select all
sudo apt-get install u-boot-tools

You will need:
  • working Android SD Card (odroid Self-installation Image after initialization)
  • Linux SD Card or image.
  • OpenElec sd card or image.

BUILDING PROCEDURE:

Extract Android:

    - Insert Odroid-C1 Android sd card into USB reader
    - Change directory to the script directory
    - Edit "params.sh", set your sdcard block device (/dev/sdX) and desired output directory
    - Run the script:
    Code: Select all
     sudo ./extract_android
    This will extract android u-boot section and system, userdata, cache and storage partitions to your output directory.
Extract Linux (Ubuntu/Debian):

    You can skip this step, and create only dualboot Android/OpenELEC sd card if you want.
    If you also skip OpenELEC you will have only Android, without multiboot.

    - Insert Odroid-C1 Linux sd card into USB reader if not using sd card image
    - Change directory to the script directory
    - Edit "params.sh", set your sdcard block device (/dev/sdX) or image name and desired output directory
    - Run the script:
    Code: Select all
     sudo ./extract_linux
    This will extract fat and linux (ext4) partitions to your output directory.
Extract OpenELEC:

    You can skip this step, and create only dualboot Android/Linux sd card if you want.
    If you also skip Linux you will have only Android, without multiboot.

    - Insert OpenElec sd card into USB reader if not using sd card image (recommended)
    - Change directory to the script directory
    - Edit "params.sh", set your sdcard block device (/dev/sdX) or image name and desired output directory
    - Run the script:
    Code: Select all
     sudo ./extract_openelec
    This will extract OpenELEC partitions to your output directory and prepare them for triple-boot.

Prepare SD Card:

    - Insert SD Card to be used for triple boot (or prepare sdcard image)
    - SD card must be at least 8 GB (4 GB is enough for minimal linux/android system).
    - Edit "params.sh", set your sdcard block device (/dev/sdX) or image file name, source directory and desired partition sizes.
      "linux" partition will allways be extended to the end of sd card (remaining space after allocating android and OpenElec partitions)
      You can set option to format linux partition as btrfs. Partition will be mounted with compress option and you can save up to 40% in sd card space.
      :!: If you want to create dual boot Android/Linux, set skip_OpenELEC to "yes"
    Run the script:
    Code: Select all
    sudo ./create_tripleboot_sd
      :!: It is possible to create sd card image, instead to format physical sd card.
    New partition layout is now:
    • storage (android internal sdcard) (mmcblk0p1)
    • system (mmcblk0p2)
    • userdata (mmcblk0p3)
    • EXTENDED PARTITION
      • cache (mmcblk0p5)
      • openElec (mmcblk0p6)
      • linux (mmcblk0p7)
    :!: After sd card is created, you can edit bootandroid.ini, bootlinux.ini and bootoelec.ini in STORAGE partition to se desired boot parameters (resolution, UHS, etc)

Copy (restore) saved Android/linux/openElec partitions to sd card:

    - Edit "params.sh", set your sdcard block device (/dev/sdX) or image file name and source directory
    Run the script:
    Code: Select all
    sudo ./copy_to_sdcard
      :!: It is possible to write to the card image, instead to sd card.

Your sd card is now ready for triple boot Android/Linux/OpenELEC on your Odroid-C1.

Notes:
  • boot.ini, uImage, uInitrd and meson8b_odroidc.dtb (from linux directory) and OpenELEC files
    will be placed on your storage (android internal sdcard) partition (mmcblk0p1, FAT32)
  • fstab.odroidc in android system partition will be modified to enable cache partition mounting from partition mmcblk0p5
  • boot.ini will be created in a way to enable boot menu and booting from linux partition mmcblk0p6
  • storage partition (android internal sdcard) is accessible under linux in /media/android
  • on boot you are presented with boot menu to select boot to android, linux or OpenELEC (if used)
  • edit bootsel.ini to select your default OS and boot timeout
  • you can mount linux partition (mmcblk0p7) from android, but it is not default
  • You can upgrade OpenElec simply by coppying SYSTEM, INITRD & KERNEL files from OpenELEC upgrade package to STORAGE (FAT32) partition
  • First sd card partition is FAT32 formated and is readable under windows
  • If your SD Card is large enough (16 or 32 GB) the scripts can be easily adapted to boot android + more the one linux instalation !
  • WARNING: do not delete any of the files in the root of the FAT (STORAGE) partition !
  • After upgrading linux kernel, don't forget to copy uImage, uInitrd and meson8b_odroidc.dtb to /media/android (FAT partition)

    Additional scripts:
      "update_uboot" to update android boot section (u-boot and others) without erasing sd card
      "backup_from_sdcard" to backup your sd card to directory
      "restore_to_sdcard" to restore your sd card from backup
      :!: You can use backup/restore scripts to move your installation to larger/smaller sd card or to change partitions sizes.

You can download script package and image ready to be copied to sd card from:
https://mega.co.nz/#F!A99jXBJZ!ZbWNk_-cRNOMj7ZOCSdauA

  • odroid-tripleboot.img.xz contains prepared triple boot 8GB image with Hardkernel's Android 4.4.2 (v1.5)+Gapps, Ubuntu 15.04 (Vivid) with Mate desktop and OpenELEC 5.0.5
    Extract with unxz:
    Code: Select all
    unxz -k odroid-tripleboot.img.xz

    You can copy the image to 8GB sd card (sudo dd of=/dev/sdX if=odroid-tripleboot.img bs=1M) or use it for instalation on larger sd card (16GB, 32GB):
    • Extract image to directory with "backup_from_sdcard" script ( set odroid-tripleboot.img as source in "params.sh")
    • Prepare your sd card with "create_tripleboot_sd" script (adjust "params.sh" first, set desired partitions sizes)
    • Copy extracted image to prepared sd card with "restore_to_sdcard" script
  • Ubuntu 15.04 works great, mali drivers & video acceleration enabled, kodi installed and works great.
    You can check OpenGL ES2 performance running glmark2-es2 in terminal.
    Basic desktop applications are installed, you can install more using synaptic.
    Mate desktop is far better-looking than LXDE.
    You can enable overclock to 1.728 GHz in "/etc/rc.local".
  • Android upgraded with some useful apps.
    Kodi is removed, MX Player installed (with codecs from xda developers forum), works great.
    In Android, you can change max CPU frequency with Odroid Utility.
    Google Apps and PlayStore are installed.
  • OpenElec is unmodified, Youtube plugin installed for testing.
  • You can test H265/HEVC decoding in Android & Ubuntu playing Big Buck Bunny video (1080p) from http://www.elecard.com/en/download/videos.html
Last edited by loboris on Sat Jul 11, 2015 12:33 am, edited 46 times in total.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux/Android dual boot

Unread postby loboris » Sun Jan 25, 2015 12:03 am

:!:
Updated: some improvements, added script to extract linux sd card or image.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux/Android dual boot

Unread postby Saruk » Sun Jan 25, 2015 6:56 am

I've increased the size of my android system partition to 9.82G (10055.68M) and was wondering if you can tell me what I need to change in the scripts...
I get a Bad partition error trying the extract android script

Thanks,
Chuck
Saruk
 
Posts: 11
Joined: Tue Mar 25, 2014 4:37 am
languages_spoken: english
ODROIDs: Odroid - U3

Re: How to: Linux/Android dual boot

Unread postby loboris » Sun Jan 25, 2015 7:08 am

Saruk wrote:I've increased the size of my android system partition to 9.82G (10055.68M) and was wondering if you can tell me what I need to change in the scripts...
I get a Bad partition error trying the extract android script

Thanks,
Chuck

Can you be more specific about what were you doing, and where exactly the error occurred?
There are no point in increasing the size of the android system partition. You can increase the size of "userdata" (where the installed apps are, and storage (android internal "sdcard")
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux/Android dual boot

Unread postby Saruk » Sun Jan 25, 2015 10:04 am

OK. Sorry, I meant the userdata. I kept running out of space on the 2 Gig partition so I increased it to about 10 Gig. I have a 32 Gig SD so I had plenty of room. What I have is this and in this order per GParted: /dev/sdb2 - ext4 - 1Gib, /sdb3 - ext4 - 9.82 GiB /sdb4 ext4 - 130 MiB & /sdb1 - fat32 - 18.74 GiB.
extract_android gives me this:
sdcard size: 62518272 blocks, 30526 M
-----------------------------------------------------------
storage part: 23080960 62388223 19193 M
system part: 131072 2228223 1024 M
userdata part: 2228224 22814719 10052 M
cache part: 22814720 23080959 130 M
-----------------------------------------------------------
Bad SDCard partition structure (start) !

Whew - hope this helps

Chuck
Saruk
 
Posts: 11
Joined: Tue Mar 25, 2014 4:37 am
languages_spoken: english
ODROIDs: Odroid - U3

Re: How to: Linux/Android dual boot

Unread postby loboris » Sun Jan 25, 2015 10:42 am

Saruk wrote:OK. Sorry, I meant the userdata. I kept running out of space on the 2 Gig partition so I increased it to about 10 Gig. I have a 32 Gig SD so I had plenty of room. What I have is this and in this order per GParted: /dev/sdb2 - ext4 - 1Gib, /sdb3 - ext4 - 9.82 GiB /sdb4 ext4 - 130 MiB & /sdb1 - fat32 - 18.74 GiB.
extract_android gives me this:
sdcard size: 62518272 blocks, 30526 M
-----------------------------------------------------------
storage part: 23080960 62388223 19193 M
system part: 131072 2228223 1024 M
userdata part: 2228224 22814719 10052 M
cache part: 22814720 23080959 130 M
-----------------------------------------------------------
Bad SDCard partition structure (start) !

Whew - hope this helps

Chuck

Script extract_android checks for the standard odroid android partition layout (http://odroid.com/dokuwiki/doku.php?id=en:c1_partition_table) and expects first partition to be at position 49152 (blocks).
Yours is at 131072, so the check fails.
If you have manually changed partition layout, and this sd card is bootable android card, you can try to edit the script and comment the block of code that checks start of first partition, so that it looks like:
Code: Select all
#if [ "${dualb}" = "" ]; then
#   if [ ! "${system_start}" = "49152" ]; then
#      echo "Bad SDCard partition structure (start) !"
#      exit 1
#   fi
#else
#   if [ ! "${storage_start}" = "49152" ]; then
#      echo "Bad SDCard partition structure (start)!"
#      exit 1
#   fi
#   echo "SDCard is dualboot card!"
#fi

If you successfully extract your card, I suggest that you partition your 32 G card something like this:
storage_size=10240
system_size=1024
userdata_size=8192
cache_size=512
# calculated automaticaly, to fit sd card size !
linux_size=0 # will be around 11G, and you can use android storage partition too
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby karlkloss » Tue Jan 27, 2015 1:31 am

loboris, If you could find the time to put Hardkernels Lubuntu and Android images into one dual boot image and upload it somewhere, then I'm sure that many people will be very greatful.

-- Karkloss
User avatar
karlkloss
 
Posts: 141
Joined: Tue Jan 13, 2015 9:34 pm
languages_spoken: english
ODROIDs: C1

Re: How to: Linux & Android dual boot

Unread postby loboris » Tue Jan 27, 2015 2:10 am

karlkloss wrote:loboris, If you could find the time to put Hardkernels Lubuntu and Android images into one dual boot image and upload it somewhere, then I'm sure that many people will be very greatful.

-- Karkloss

I did it for myself and it works great. But, the purpose of the development board (like Odroid-C1) is that you learn something, so it is much better if you do it yourself.
I'll upload it later.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby loboris » Tue Jan 27, 2015 9:25 pm

:!:
Updated: some improvements, added option to format sd card image and write to sd card image instead of phisical sd card.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby marcoooo » Wed Jan 28, 2015 12:11 am

following this and patiently waiting on the image :roll:

on the otherhand i will pick up a Sdcard this afternoon and will give it a go and see whats happens :)
marcoooo
 
Posts: 27
Joined: Thu Jan 15, 2015 8:07 pm
languages_spoken: english
ODROIDs: Odroid-C1

Re: How to: Linux & Android dual boot

Unread postby loboris » Wed Jan 28, 2015 1:17 am

:!: I've uploaded the Android & Ubuntu-trusty dual boot image for 16GB card, created with my script.
Android & Ubuntu are Hardkernel's images with some small changes.
First boot is to Android, to boot to Ubuntu, rename boot.ini.bak to boot.ini and reboot (use QuickReboot).

Download from:
image: https://mega.co.nz/#!BNR3iAjI!JO9k_GsIJ5vGaW2eEwkG2tH9lli1moAr0VBJR0dk_Pk
md5sum: https://mega.co.nz/#!EBBmhb7D!TOFRpqbrudRxkmzGSTK3-WuSXbj3JlHurIhKheOmSn4

Please delete console=ttyS0,115200n8 from setenv bootargs in boot.ini.bak before booting, or replace with the following:

Code: Select all
ODROIDC-UBOOT-CONFIG

# Possible screen resolutions
# Uncomment only a single Line! The line with setenv written.
# At least one mode must be selected.

# setenv m "vga"             # 640x480
# setenv m "480p"            # 720x480
# setenv m "576p"            # 720x576
# setenv m "800x480p60hz"    # 800x480
# setenv m "800x600p60hz"    # 800x600
# setenv m "1024x600p60hz"   # 1024x600
# setenv m "1024x768p60hz"   # 1024x768
# setenv m "1360x768p60hz"    # 1360x768
# setenv m "1366x768p60hz"   # 1366x768
# setenv m "1440x900p60hz"   # 1440x900
# setenv m "1600x900p60hz"   # 1600x900
# setenv m "1680x1050p60hz"   # 1680x1050
# setenv m "720p"            # 720p 1280x720
# setenv m "800p"            # 1280x800
# setenv m "sxga"            # 1280x1024
setenv m "1080p"           # 1080P 1920x1080
# setenv m "1920x1200"       # 1920x1200

# HDMI DVI Mode Configuration
setenv vout_mode "hdmi"
# setenv vout_mode "dvi"

# HDMI BPP Mode
setenv m_bpp "32"
# setenv m_bpp "24"
# setenv m_bpp "16"

# UHS Card Configuration
# Uncomment the line below to __DISABLE__ UHS-1 MicroSD support
# This might break boot for some brand models of cards.
# setenv disableuhs "disableuhs"


# Disable VPU (Video decoding engine, Saves RAM!!!)
# 0 = disabled
# 1 = enabled
setenv vpu "1"

# Disable HDMI Output (Again, saves ram!)
# 0 = disabled
# 1 = enabled
setenv hdmioutput "1"

# Default Console Device Setting
# setenv condev "console=ttyS0,115200n8"        # on serial port
setenv condev "console=tty0"                    # on display (HDMI)
# setenv condev "console=ttyS0,115200n8 console=tty0"   # on both

# Boot Arguments
setenv bootargs "root=/dev/mmcblk0p6 rootwait ro \${condev} no_console_suspend vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=\${m} m_bpp=\${m_bpp} vout=\${vout_mode} \${disableuhs}"

# Booting
fatload mmc 0:1 0x21000000 uImage
fatload mmc 0:1 0x22000000 uInitrd
fatload mmc 0:1 0x21800000 meson8b_odroidc.dtb
fdt addr 21800000

if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi

if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi

bootm 0x21000000 0x22000000 0x21800000

It is full 16GB image, so it will take some time to unpack and copy to sd card.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby navarisun » Thu Jan 29, 2015 2:01 am

Can this wonderful method be having a boot menu at the start so i can choose between both OSes ??
navarisun
 
Posts: 23
Joined: Sun Jan 11, 2015 9:58 pm
languages_spoken: english
ODROIDs: C1

Re: How to: Linux & Android dual boot

Unread postby dreamcat4 » Tue Feb 03, 2015 10:21 pm

It would be interesting to see grub2 boot loader included on this image. e.g. boot this pre-made image to new SD card. Boot into ubuntu. Compile grub2. Then run grub-install <device>. Test if it works then dd from the same SD card back to a new image file.
dreamcat4
 
Posts: 47
Joined: Mon Jan 26, 2015 8:42 am
languages_spoken: english

Re: How to: Linux & Android dual boot

Unread postby loboris » Wed Feb 04, 2015 7:03 pm

dreamcat4 wrote:It would be interesting to see grub2 boot loader included on this image. e.g. boot this pre-made image to new SD card. Boot into ubuntu. Compile grub2. Then run grub-install <device>. Test if it works then dd from the same SD card back to a new image file.

It could be done (it is not so easy), but what would be the purpose?
Boot menu could be implemented from recovery partition or custom initd easier, but it also requires much work, and I don't see much need for it.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby dreamcat4 » Wed Feb 04, 2015 7:35 pm

Well something else we could try to do is make a triple-boot, to add openelec partition. Then openelec image for C1 is available now.
dreamcat4
 
Posts: 47
Joined: Mon Jan 26, 2015 8:42 am
languages_spoken: english

Re: How to: Linux & Android dual boot

Unread postby loboris » Thu Feb 05, 2015 8:16 am

dreamcat4 wrote:Well something else we could try to do is make a triple-boot, to add openelec partition. Then openelec image for C1 is available now.

It is easy to adapt the script to create more then one linux partition (mmcblk0p6, mmcblk0p7, ...). In boot.ini we just have to select which linux partition to boot from, or rename it to boot android.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby loboris » Sat Feb 07, 2015 8:21 am

:!: Update:
Scripts now create dual boot image/sd card with boot menu.

Triple boot Android&Linux&OpenELEC next week...
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android dual boot

Unread postby dreamcat4 » Sat Feb 07, 2015 10:16 am

loboris wrote:...


Awesome. I am learning more each day about the various OS support for C1. One thing has become clearer to me now is that some of the current images for C1 e.g. like ubuntu 14.04 may / can have specific issue regarding either performance, or drivers, or other software compatibility. Android perhaps has issue too (of different kinds).

But generally in regards for overall system overheads perhaps Debian jessie is a bit less demanding than ubuntu. Or else another 'leaner than ubuntu' linux distro e.g. Arch Linux etc. I'm not saying that it is bad to have ubuntu. It is actually very good. Just that some C1 users may appreciate the other mainstream linux distro(s) available too. When there exist images for Jessie and so on.

Other recent C1 Images:

* OpenMediaVault Image is now available (for NAS with web GUI).
* Ubuntu core ('snappy') image is also available now. Which is not adopted much yet. But works good as a host for docker and in other ways for future too.

One problem can encounter with certain OS is about their partition scheme. Like ubuntu core (snappy) has 2 swap-over partitions. Which is used when upgrading versions. Could be OpenElec too has some of it's own special partitioning consideration. I don't know. It needs more researching. Not got my SD card reader yet so have not experiment anything yet.

Here is my opinion so far:

* OpenElec+Kodi is likely to be the highest demanded OS for the C1 user base.
* Android is of course also remain very popular too for, SmartTV apps and tablet-like or in-car function (with LCD screen).
* Ubuntu OR debian OR {other proven mainstream linux distro}. Is needed also. Can they co-exist easily with each other? Probably yes.
* OpenMediaVault provide the best simple NAS function. And consistent set of users who need it. But fewer require it than Openelec/Kodi.
* Ubuntu Core is still too new and low uptake at the moment. But it's popularity and useful-ness may increase in future. It is attractive as a 'low overheads' platform. But it is already a good choice for running Docker (micro-server role).

So looking at all of those OSes. It is hard to cut down the list. So in future may eventually end up with 5+ to think about for multi-boot. It depends how many of those platforms we can keep adding to your existing scripts. There is not any hurry at all. But I thought it is worth mentioning for consideration about how to improve the flexibility of the script. When different people want to build a different selection of OS choices. For example: person A might want to create his SD Card image for OpenElec+Andriod only. Wheras Person B wants to build his image for Debian + OpenMediaVault + Ubuntu Core ('snappy').

Want to find time to look at your scripts in next few days, or maybe wait until after you have had a crack at OpenElec. It's hard to find the time to check your scripts and the boot.ini, etc. properly right now… not having SD card reader either which has not arrived yet.

Really appreciate your work on these multi-boot images. Looking forward to trying them out when I can boot my C1 up the first time.
dreamcat4
 
Posts: 47
Joined: Mon Jan 26, 2015 8:42 am
languages_spoken: english

Re: How to: Linux & Android triple boot (with boot menu)

Unread postby loboris » Sun Feb 08, 2015 6:39 am

:!: Update:
Many improvements.
Added triple boot option, sd card can now contain Android, Linux (Ubuntu/Debian) and OpenELEC.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux & Android triple boot (with boot menu)

Unread postby dreamcat4 » Sun Feb 08, 2015 8:04 am

Great. That was about 1 week faster than anticipated. :D Good job adding the openelec image. Will backup my openelec/kodi settings and move them over to new 3 boot image. Now I have had time to read your scripts and learn a little about what boot is… so grub is no point (not needed) because boot is meant best for this platform, and simpler. I understand now.

When I look at your script, I can see you have made 3 script that are largely duplicate of each other. With no functions whatsoever. It seem good idea to merge common functionality together, to make cleaner and accommodate more easily other OS addition. I also see now you are the same guy who make ubuntu core work with boot.ini. Which is great to know something about.

Anyway. Others don't care about that. Just about OpenElec for smoother jodi experience. Most of them don't know this new image available yet (who are on the 3 other openelec threads) so may be good idea to let them know. For can come download it from here.
dreamcat4
 
Posts: 47
Joined: Mon Jan 26, 2015 8:42 am
languages_spoken: english

Re: How to: Linux & Android triple boot (with boot menu)

Unread postby loboris » Sun Feb 08, 2015 8:32 pm

dreamcat4 wrote:..
When I look at your script, I can see you have made 3 script that are largely duplicate of each other
...

Thank you for your comments.
The scripts I've created are meant to be the learning aid, so it is great you noticed that many things can be improved. You are welcome to modify them in any way.
This board is a development board and it is very important that it is used for development and learning.
There are at least 50 tv-sticks or tv-boxes in the same price range which can be used as media players.
It is great that that Odroid-C1 can play HD videos, but it makes not much sense to use it for that purpose only.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby theBOSS » Tue Feb 10, 2015 2:15 am

Excelent work! It´s very interisting

Best regards
http://lordpedal.ddns.net... la culminación de un fin es el comienzo de una realidad.
theBOSS
 
Posts: 75
Joined: Sat Jan 17, 2015 2:06 am
languages_spoken: spanish, english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby robgee65 » Thu Feb 19, 2015 5:22 am

Help please iam doing everything to the letter and i get this error msg
odroid-tripleboot.img1 49152 6340607 3145728 c W95 FAT32 (LBA)
odroid-tripleboot.img2 6340608 8437759 1048576 83 Linux
odroid-tripleboot.img3 8437760 12632063 2097152 83 Linux
odroid-tripleboot.img4 12632064 30881791 9124864 5 Extended
odroid-tripleboot.img5 12634112 13682687 524288 83 Linux
odroid-tripleboot.img6 13684736 15781887 1048576 83 Linux
odroid-tripleboot.img7 15783936 30881791 7548928 83 Linux

Formating partitions ...
storage partition formated.
ERROR unmapping with kpartx
ERROR formating system partition.
root@robgee-desktop:/android/dualboot#

iam creating a img not to sdcard
robgee65
 
Posts: 2
Joined: Thu Feb 19, 2015 5:10 am
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby foreverg » Wed Feb 25, 2015 6:27 pm

great work loboris, you saved me a lot of time.. I've planned to do something similar since I ordered my C1 more than a month ago!

It works flawlessly! I suppose that I can change default OS changing boot.ini accordly to the OS I need. Am I right? I'll make a simple app for Android and an sh script to do this automatically from GUI: for user like me that use the C1 without a keyboard is very difficult to change OS at boot time! ;)

BTW great work again
foreverg
 
Posts: 2
Joined: Wed Feb 25, 2015 6:17 pm
languages_spoken: english, italian

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby dreamcat4 » Wed Feb 25, 2015 8:17 pm

It would be good to update openelec now… because the original openelec 5.0.0.0 image did not shut down or reboot cleanly. That has been fixed in the openelec 5.0.1.0 build. Available here from zalaare's post 1:

viewtopic.php?f=79&t=5915
dreamcat4
 
Posts: 47
Joined: Mon Jan 26, 2015 8:42 am
languages_spoken: english

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby DESE » Wed Mar 04, 2015 4:30 am

Hello and thanks loboris. I've seen inside partitions from 8 GB img you have and see that the Openelec partition has no data, only I few folders but no system. Do I have to download and manual install from your scriptt?.

Thanks.
DESE
 
Posts: 49
Joined: Sat Jan 17, 2015 3:49 pm
languages_spoken: english, spanish
ODROIDs: Odroid C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby robgee65 » Fri Mar 13, 2015 7:46 am

Hi ive posted a few weeks ago and no ones came up with help and ive been pulling my hair out
no mater what i try i cant get my sd card to boot if i make my own image with the script on here
a prebuilt one works fine

32 gig card

ubuntu 14.04
robgee65
 
Posts: 2
Joined: Thu Feb 19, 2015 5:10 am
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby keg188 » Tue Mar 24, 2015 10:16 pm

Awesome work getting multiboot up and running for the C1.

I am using ur 16gb tripleboot image on a 32gb card.

After having some problems with my ubuntu build I decided to replace it with a clean image.
I deleted to contents of the linux partition and copied over the second partition from the odroid c1 ubuntu image.
Ubuntu now boots fine but I don't get the boot menu for android or openelec.

(Update: I see how ur copy_to_sdcard script updates the rc.local file to replace the boot.ini with bootsel.ini)

Only the linux partition was changed.

My google skills have failed me as I cant find how or where the menu is defined or created.

(Update: I found the menu at the bottom of the init script in dualboot/bootselramfs/init )

Please advise how to fix my broken uboot menu and maybe point to some documentation.
keg188
 
Posts: 2
Joined: Tue Mar 24, 2015 10:02 pm
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby nexusefr » Tue Mar 31, 2015 5:52 pm

Is it necessary to run ODROID utility to repartition the root disk trusty ubuntu 16gb triple boot image ?
Thx!
nexusefr
 
Posts: 10
Joined: Fri Jan 16, 2015 12:11 am
languages_spoken: english spanish
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby keg188 » Fri Apr 03, 2015 10:13 pm

nexusefr wrote:Is it necessary to run ODROID utility to repartition the root disk trusty ubuntu 16gb triple boot image ?
Thx!


I don't think so.

I used the 16gb image on my 32gb card and have not used the utility to extend the partition. My mmcblk0p7 (Linux partition) is 7730MB. This fills the remainder of the 16gb image and I have 16gb unused (for now).
keg188
 
Posts: 2
Joined: Tue Mar 24, 2015 10:02 pm
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby k4yl0rd » Fri May 08, 2015 6:31 pm

It's awesome, multiboot on C1 is exactly what I was looking for.
But... Question: in case of distros which does not actually support online updates, is there any way to substitute a distribution once the multi-boot microsd has been prepared?
I
k4yl0rd
 
Posts: 37
Joined: Thu Apr 09, 2015 10:02 pm
languages_spoken: english, italian
ODROIDs: C1 (with RTL and CEC-enabled)
C2

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby dreamcat4 » Fri May 08, 2015 8:00 pm

k4yl0rd wrote:any way to substitute a distribution once the multi-boot microsd has been prepared?


Hello!
If you follow the loboris instructions, the correct time to choose linux distro is before creating the multi boot image (not after). Else effectively you are just repeating some of the same last steps.

Anyway that does't matter now. What I am currently making is a build tool, which will support a plugins mechanism. Whereby each build target can be used by other targets. So then (using my new tool to cross compile on ubuntu). We first make the kernels. As one build target / build product. Then we make linux distro (e.g. ubuntu or debian), android distro (kitkat or lollipop). And also we optionally make kalaare's Openelec (with Kodi 14 or 15 stable, or isenguard / nighties). So each of those are their own build target producing a standalone build product (e.g. disk image). Then a meta-target should be able to build from those selections a multi boot image (either dual boot or triple boot). By specifying the desired combination of linux / android / openelec.

I am still implementing the core part of the build tool. But it has been coming along nicely so far. Once it is done we just split up and re-write loboris various build scripts atomically into the tool's generic and uniform API methods of fetch, sync, build, assemble. Doing that also allows us to hack on them in-between stages. For example to add our own kernel patches for specific devices (if missing support on 3.10) etc.

I haven't pushed up any new code for this last 1 week, just because it is still being worked upon. It is improving it every day. For example yesterday, i just got pre_ and post_ hook intermediate stages working. And also the platforms handling (for differentiating between C1, XU3, rpi[2] etc).

So don't try to use it yet! But you can see the full description of it here:

https://github.com/dreamcat4/drb

Actually I promised loboris I would do all this ages ago. Sorry for the waiting.
dreamcat4
 
Posts: 47
Joined: Mon Jan 26, 2015 8:42 am
languages_spoken: english

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Sun May 10, 2015 8:21 am

:!: Update. Scripts cleaned, reorganized and optimized.
Added backup/restore scripts, can be used to backup/restore your triple boot card or to change sd card size and partitions sizes (see opening post).
Added prepared downloadable triple boot sd card image with latest Hardkernel's Android (with Gapps installed), OpenELEC and Ubuntu 15.04 with Mate desktop.
Image can be copied to 8GB sd card, or used for instalation on larger sd card (see opening post).
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby odroid » Sun May 10, 2015 12:14 pm

Great improvement!
Changed to STICKY.
User avatar
odroid
Site Admin
 
Posts: 28230
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Fri May 15, 2015 6:58 am

:!: Update:
  • Using bootandroid.ini to set initial boot parameters for Android.
  • Option to use btrfs for linux partition, mounted with compress option it can save up to 40% space. btrfs-tools must be installed in linux!
  • Option to skip OpenELEC installation if you don't need it.
  • Added colours in boot menu.
  • Some minor bugs corrected.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby wrxtasy » Sat May 16, 2015 3:28 am

Thanks for all your hard work loboris :D

If its not too much of a problem and the resulting .img is not too large, can I request a Triple Boot of the latest Android + OpenElec + Ubuntu 14.04lts please ?
Unless your current image has Kodi Isengard packaged with Ubuntu 15.04 ?

Kodi Isengard packaged with Ubuntu 14.04 is superior to all other distros when it comes to 24p / H265 / H264 sync and robust decoding of video.
My old Ubuntu Laptop nearly has smoke coming out of it it takes so long to extract anything !

Thanks.
LibreELEC Krypton C1(+) HERE
LibreELEC Krypton C2 HERE
User avatar
wrxtasy
 
Posts: 1288
Joined: Wed May 13, 2015 1:59 pm
Location: Australia
languages_spoken: english
ODROIDs: C1, C1+, C2

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby mohirt » Sun May 17, 2015 11:30 am

This is seriously great loboris. I've been following this thread for a while and your project has made all my Odroid wishes come true, thank-you for your hard work.
mohirt
 
Posts: 3
Joined: Wed Apr 22, 2015 4:51 am
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby mohirt » Tue May 19, 2015 12:28 am

keg188 wrote:
(Update: I found the menu at the bottom of the init script in dualboot/bootselramfs/init )

Please advise how to fix my broken uboot menu and maybe point to some documentation.


Did you ever figure this out? I am using the 8gb tripleboot image on a 32gb card and am running into this exact same problem. I can boot Android or Open Elec then restart and I am presented with the boot menu, however if I boot Linux then restart I am no longer presented with a boot menu, it automatically boots linux thereafter.
Last edited by mohirt on Tue May 19, 2015 7:19 am, edited 1 time in total.
mohirt
 
Posts: 3
Joined: Wed Apr 22, 2015 4:51 am
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Tue May 19, 2015 1:04 am

:!: Which OS is booted on power on/reboot is determined by the content of boot.ini file (in fat32, STORAGE partition)
  • To enter boot menu boot.ini = bootsel.ini
  • After you select to boot to linux, boot.ini = bootlinux.ini.
  • After Linux is started bootsel.ini is copyed to boot.ini again (in /etc/rc.local cp /media/android/bootsel.ini /media/android/boot.ini).
  • If that line is missing in rc.local, there will be no boot menu. (you can execute copy command in terminal, and place it to rc.local to correct this).
  • Same is true for Android and OpenELEC, onli bootandroid.ini and bootoelec.ini are used.
Last edited by loboris on Sun May 31, 2015 11:31 pm, edited 1 time in total.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby mohirt » Tue May 19, 2015 7:31 am

Thanks for clarifying how the bootsel.ini is working, it makes perfect sense. I haven't been able to properly boot Linux so when I do a hardware reset of course Linux isn't getting a chance to copy to bootsel.ini.

Has anyone heard of Ubuntu hanging on boot after loading "bridge socket events into upstart [OK]" it just stalls.
mohirt
 
Posts: 3
Joined: Wed Apr 22, 2015 4:51 am
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Wed May 20, 2015 8:25 pm

:!: Update:
  • Some small fixes.
  • If skipping OpenElec, swap partition is created instead of OpenElec partition and used in Linux.
  • Uploaded updated full image with mali drivers and video acceleration in Ubuntu (see opening post for details).
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby tristank » Mon May 25, 2015 10:58 pm

Im trying to extract a minimal wheezy installation from the sdcard but for some reason it fails. I'm using the images from http://odroidc1.reactsoft.com/debian-minimal/ .

Code: Select all
$  sudo ./extract_linux

Mon May 25 15:38:48 CEST 2015
***************************************************
* Extracting structure of odroid linux SD Card    *
* and copying partitions data to directories      *
***************************************************


Analyzing sd card ...
./extract_linux: line 54: (2048 - * + 1) / 2048 : syntax error: operand expected (error token is "* + 1) / 2048 ")

  SDCard size: 31116288 blocks, 15193 M
------------------------------------------------
     FAT part:backup_from_sdcardbootselramfscompress_imagecopy_to_sdcardcreate_tripleboot_sdextract_androidextract_linuxextract_openelec     func.shodroid_triple_boot   params.shrestore_to_sdcard update_boot        2048         M
   linux part:                                 M
------------------------------------------------



Any suggestions?
tristank
 
Posts: 11
Joined: Tue Feb 03, 2015 6:49 pm
languages_spoken: english
ODROIDs: Odroid C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Tue May 26, 2015 12:13 am

tristank wrote:Im trying to extract a minimal wheezy installation from the sdcard but for some reason it fails. I'm using the images from http://odroidc1.reactsoft.com/debian-minimal/ .

Code: Select all
$  sudo ./extract_linux

Mon May 25 15:38:48 CEST 2015
***************************************************
* Extracting structure of odroid linux SD Card    *
* and copying partitions data to directories      *
***************************************************


Analyzing sd card ...
./extract_linux: line 54: (2048 - * + 1) / 2048 : syntax error: operand expected (error token is "* + 1) / 2048 ")

  SDCard size: 31116288 blocks, 15193 M
------------------------------------------------
     FAT part:backup_from_sdcardbootselramfscompress_imagecopy_to_sdcardcreate_tripleboot_sdextract_androidextract_linuxextract_openelec     func.shodroid_triple_boot   params.shrestore_to_sdcard update_boot        2048         M
   linux part:                                 M
------------------------------------------------



Any suggestions?


Problem was that image have first partition with boot flag set, and the script wrongly interpreted the partitions structure.
I corrected the script, and now that specific image can be extracted.
Please download the corected script and try again.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby tristank » Thu May 28, 2015 9:01 pm

Thanks that worked. Is there anyway to extract your android image (with gaps) and integrate it with another custom OS. Or maybe you could offer a customized boot image with your android version and a minimal debian wheezy. I also noticed that OpenElec in your tripleboot image is frozen at the splash bootscreen.
tristank
 
Posts: 11
Joined: Tue Feb 03, 2015 6:49 pm
languages_spoken: english
ODROIDs: Odroid C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Fri May 29, 2015 12:37 am

tristank wrote:Thanks that worked. Is there anyway to extract your android image (with gaps) and integrate it with another custom OS. Or maybe you could offer a customized boot image with your android version and a minimal debian wheezy. I also noticed that OpenElec in your tripleboot image is frozen at the splash bootscreen.


Just use extract/backup/restore/create scripts to do anything you want with image. Read opening post for details.
You can extract Android from my tripleboot image, extract any Linux distribution from sdcard/image and combine into new image.

:!: I've just uploaded new version of the scripts. Now you can set option to skip Linux. If you also select to skip OpenElec, you will end up with Android image, without multiboot,

If you have problem with OpenElec, you can upgrade/REPLACE OpenElec simply by copying SYSTEM & KERNEL files from OpenELEC upgrade package to STORAGE (FAT32) partition.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby varma » Sat May 30, 2015 5:00 am

hi loboris!

thank you for your wonderful job!
I love it really much and I used it immediately
it works great, except my Samsung SD card at boot...but that's its fault not yours, and a little annoying white square at top left I have under linux and openelec
I installed latest stock lubunt 14.04 and latest openelec...

but that was just to report some very little issue
what I'm here asking is:

Is possible to choose the default boot OS and the wait time??

because I really use the ODROID quite exclusively as Media player, so I'd like to set OpenELEC as default boot with no more than 5 seconds wait.
I take android and linux just to have them, for an eventual use!

thank you all!
varma
 
Posts: 18
Joined: Fri Feb 27, 2015 3:56 pm
languages_spoken: english, italian
ODROIDs: ODROID C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Sat May 30, 2015 6:51 am

varma wrote:....
Is possible to choose the default boot OS and the wait time??

because I really use the ODROID quite exclusively as Media player, so I'd like to set OpenELEC as default boot with no more than 5 seconds wait.
I take android and linux just to have them, for an eventual use!

thank you all!

It is a good idea, it can be done, and I'll do it when I find some time. Thank you.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Sun May 31, 2015 8:21 am

:!: Update:
  • some small changes
  • you can now select default OS to boot and timeout to boot without key pressed. Edit bootsel.ini to set the options.
  • ini files are now external to script, so you can more easily adjust boot options to your needs
You can modify your existing installation simply by copying bootselramfs/uInitrd.sel and bootsel.ini from scripts directory to STORAGE partition on your sd card.
Also copy bootsel.ini to boot.ini on your sd card.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby areafo » Sun May 31, 2015 7:22 pm

Hello loboris,

thank you for your work. I have downloaded your triple boot image. Under ubuntu I have no network, under android it is working great. Can you help me to enable network? Ethernet is not visible under ifconfig.

Thanks in advance
_______________


I fixed it, all i have to do is to gksudo pluma /etc/network/interfaces

There i have to change all eth0 to eth1
Last edited by areafo on Sun May 31, 2015 8:06 pm, edited 2 times in total.
areafo
 
Posts: 3
Joined: Sun Apr 19, 2015 4:45 pm
languages_spoken: english
ODROIDs: C1

Re: How to: Linux Android OpenELEC triple boot (with boot me

Unread postby loboris » Sun May 31, 2015 7:52 pm

areafo wrote:Hello loboris,

thank you for your work. I have downloaded your triple boot image. Under ubuntu I have no network, under android it is working great. Can you help me to enable network? Ethernet is not visible under ifconfig.

Thanks in advance

Maybe you have some problem with dhcp. You can try to configure static IP address and/or add DNS entry in /etc/network/interfaces
Code: Select all
auto eth0
iface eth0 inet static
        address 192.168.0.200
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

#dns servers
dns-nameservers 8.8.8.8

Adjust addresses acording to your router configuration.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Next

Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 1 guest