CE+EE dual-bootable image

The project is named HybridELEC, and supports devices supported by generic Amlogic-ng images of BOTH CE and EE, devices that need specialized images can’t be supported since I don’t have any of them to verify(Odroid N2, etc)

I’ve been waiting for EmuELEC v4.6 to be released to work on this yet I feel like it is not coming soon so I made this image based on CoreELEC 19.4-Matrix and EmuELEC v4.5 instead

The image can be downloaded here, you can check the project repo of HybridELEC to know the installation method (basically the same as official CE/EE yet two dtbs ce_dtb.img and ee_dtb.img should be placed) and differences to official CE/EE images.

Switching between EE and CE is very easy, you just need to press ‘REBOOT TO COREELEC’ in EE quick access menu, or ‘Reboot to EmuELEC’ in CE power button icon menu. The first boot after flashing will always lead you to EE since its 3-partitions layout can only be achieved this way.

The kernel and system images in the hybrid image are mostly provided as-is, but there are major tweaks so they can’t be mixed with official CE/EE images. And merging these major changes into upsteam CE/EE will break the backwards-compatibility which is neither Team CE, Team EE or I would like to see, so I’ll maintain these in my own project.

Since this is an non-official build of CE and EE, you shouldn’t seek for upstream help from Team CE and EE. Feel free to open an issue on the repo if you have any problem that can’t be reproduced on corresponding official CE/EE releases.

5 Likes

Cool, this is what I wanted for a long time.
Can I downgrade CE to 19.3, with update tar?
I have fully fully deployed and configured 19.3 system, and EE 4.5 too, can I migrate those with the new dual boot system?
I use my own specal modified skin, how can I find reboot to emu command for the dialogbuttonmenu?
All folder both emu and ce browseable from windows like in the original?
My EE roms in one separate 256Gb usb drive, can I use that?
Thanks

No, you can’t mix official images with HybridELEC ones (the image here means kernel.img and SYSTEN), the bootup logic is completely different and mixing them will either not work or break your storage partition.

So you can’t just downgrade it with a official CE 19.3 tarboll. You can check my repo and try to backport my modifications to 19.3.

The folders can be browsed directly at /data/coreelec and /data/emuelec using SFTP client such as WinSCP, but aren’t available by default under samba shares. Samba shares are still the same and one-system only unless you configure it to share content under /data.

For migration, I suggest using Linux and rsync, to avoid wierd permission issues brought by Windows

Clone content of old STORAGE partition of EmuELEC to the emuelec subfolder of the new STORAGE partition

Clone content of old STORAGE partiton of CoreELEC to the coreelec subfolder of the bew STORAGE partition

The mount logic of EEROMS is not changed, so it’ll try to mount EEROMS from the same drive as system first. Using a Linux machine you can delete the EEROMS on the HybridELEC drive, and resize STORAGE to fit the remaining of the disk. The. EEROMS will be guaranteed to be mounted from your 256G drive, instead of from the same drive

Edit: if you are using a Linux machine anyway, you can just resize STORAGE and delete the .please_resize_me mark, and migrate in one go, without even plugging the drive to box.

This is the modification I’ve done to CE’s Estuary skin.

You need to modify xml/DialogButtonMenu.xml to add a button that’ll run /usr/sbin/hybrid_reboot_ee then reboot

thanks, 19.3 stable for me… Im not Linux expert. It seems all my folders can I copy over winscp, and ee rom mounting will be good to. Maybe I will try your 19.4 first using new usb3 pendrive, well see…

This is a rather nice option to consider exploring for some and solves the issue of not having an updated EMUElec addon for CE.

It could even potentially inspire official options to further CE’s versatility.

Ok, first dual boot install ok. I have in 32 GB usb3 disk installed. How can I divide and expand the unused emuelec ext4 partition, current 25 GB. I like to add 5 Gb for Emuelec, and other 20 Gb add to coreelec. I have just winscp and there putty. No Linux machine.

Omit EEROMS and resize STORAGE and CE and EE will share the 27G STORAGE partiton. All these could be done on the box through SSH directly (for 4GB drives, EEROMS will always be automatically omitted). The following should be done on Hybird/CE since on EE the EEROMS partition will be mounted to roms and bind-mounted to .update, then ports will be mounted on top of it. Umounting it on EE will be more complex for you:
The following is extremely dangerous as we are operating on a running system. You are suggested to modify it offline on a Linux machine if possible. If you fail at any of the step, do not continue as you’ll brick your installation

  1. Run mount to check for which partition is mounted, you’ll see many lines
devtmpfs on /dev type devtmpfs (rw,relatime,size=494488k,nr_inodes=123622,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=200244k,nr_inodes=819200,mode=755)
/dev/mmcblk1p1 on /flash type vfat (ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/loop0 on / type squashfs (ro,relatime)
/dev/mmcblk1p2 on /data type ext4 (rw,noatime,data=ordered)
/dev/mmcblk1p2 on /storage type ext4 (rw,noatime,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/debug type cgroup (rw,nosuid,nodev,noexec,relatime,debug)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /var type tmpfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,nr_inodes=409600)
sunrpc on /run/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
/dev/mmcblk1p3 on /var/media/EEROMS type vfat (rw,nosuid,nodev,noexec,noatime,fmask=0133,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
  1. In which, you can see one mounted at /var/media/EEROMS, usually the last one, it could be named /dev/mmcblk1p3 if you’re booting from SDcard, or /dev/sda3 if you’re booting from USB drive. Record the drive name on paper here: /dev/mmcblk1 (without p3) for SD, /dev/sda (without 3) for USB
  2. Unmount the EEROMS partition so we can safely delete it: umount /var/media/EEROMS
  3. Open your drive with GNU/parted: parted /dev/mmcblk1 or parted /dev/sda depending on you’re booting from SD or USB
  4. Print the partitions, make sure there’s 3 of them, otherwise maybe you’re operating on the wrong dirve: print
    Results should be like this:
CoreELEC:~ # parted /dev/mmcblk1
GNU Parted 3.4
Using /dev/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Model: SD SD (sd/mmc)
Disk /dev/mmcblk1: 31.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  2152MB  2147MB  primary  fat32        lba
 2      2152MB  4295MB  2143MB  primary  ext4
 3      4295MB  31.7GB  27.4GB  primary  fat32        lba

(parted)
  1. Delete the 3rd partiton: rm 3
  2. Print the partition table again, make sure only the 3rd one (EEROMS) is removed: print
(parted) print
print
Model: SD SD (sd/mmc)
Disk /dev/mmcblk1: 31.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  2152MB  2147MB  primary  fat32        lba
 2      2152MB  4295MB  2143MB  primary  ext4

  1. Resize the 2nd partition (STORAGE) to fit all the remaining space, and say Yes to confirm to resize it even it’s in use: resizepart 2 100% then Yes
(parted) resizepart 2 100%
resizepart 2 100%
Warning: Partition /dev/mmcblk1p2 is being used. Are you sure you want to
continue?
Yes/No? Yes
Yes
  1. Print the new partition table, make sure the 2nd one’s size has increased: print
    (parted) print
    print
    Model: SD SD (sd/mmc)
    Disk /dev/mmcblk1: 31.7GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:

Number Start End Size Type File system Flags
1 4194kB 2152MB 2147MB primary fat32 lba
2 2152MB 31.7GB 29.5GB primary ext4

  1. Quit GNU/parted,
(parted) quit
quit
Information: You may need to update /etc/fstab.
  1. Resize the EXT4 FS on the 2nd partition: resize2fs /dev/mmcblk1p2 for SD boot, resize2fs /dev/sda2 for USB boot
CoreELEC:~ # resize2fs /dev/mmcblk1p2
resize2fs 1.45.7 (28-Jan-2021)
Filesystem at /dev/mmcblk1p2 is mounted on /data; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 4
The filesystem on /dev/mmcblk1p2 is now 7205888 (4k) blocks long.
  1. Check the disk space with df -h
CoreELEC:~ # df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                482.9M      4.0K    482.9M   0% /dev
tmpfs                   195.6M     13.2M    182.4M   7% /run
/dev/mmcblk1p1            2.0G      1.2G    815.6M  60% /flash
/dev/loop0              199.0M    199.0M         0 100% /
/dev/mmcblk1p2           27.3G    503.3M     26.8G   2% /data
/dev/mmcblk1p2           27.3G    503.3M     26.8G   2% /storage
tmpfs                   488.9M         0    488.9M   0% /dev/shm
tmpfs                     4.0M         0      4.0M   0% /sys/fs/cgroup
tmpfs                   488.9M      2.2M    486.6M   0% /var
tmpfs                   488.9M         0    488.9M   0% /tmp

Now the STORAGE partition takes all the remaining space, and there’s no EEROMS anymore. You gave up the convinience of plug the drive to Windows PC and copy roms, but you can utilize more disk space now

Thanks, seems like this dual boot method, not good for me. 2gb limit for CE and ee nogo. I cannot copy my Backup systems. Both system in 99%… The 25 GB ext4 empty partition, I cannot divide and extend to the 2 systems…

You don’t divide and extend. No, the storage partition is always shared between CEand EE. It’s not CE 2G + EE 2G, it’s CE+EE 2G. The space increased will always be shared.
Doing it with the method I posted will increase the shared storage partition by 25G, and you’ll have a 27G CE+EE storage.
You should read the project repo to understand how the storage partition is shared yet data of two OSs are separate.
BTW, the EEROMS part by default is FAT32, not EXT4, if you can already do some customization like this why wouldn’t you just remove EEROMS and increase the size of STORAGE?

You feel resizing is hard because you want to do all of these on Windows. You should resize the partitions of Linux under Linux, that’s the true way to do it and everything is much easier.

Edit: if you really don’t want to install a whole Linux distro or even use Ubuntu Live, then at least use Gparted live, it’s the most light-weight method to get an environment to properly modify linux partitions with GUI: GParted -- A free application for graphically managing disk device partitions

Ok, I have made it without any Linux magic.
Just 4 clicks, deleted the 3.partition eeroms with windiskmanager, then extended the 2.storage partition to the full space. Looks like both system booted. Tomorrow trying to paste my Backup files to both system.

Now that this is moved to Unsupported SW, you know it inspires nothing

For now, maybe but inspiration often comes from what others do, so you never know what work goes on behind the scenes to improve functionality and versatility now and in the future.

Its good work and I for one and pleased to see it, as I suspect many others will be.

We moved this post to the new section to not “confuse” users.
We are thankful for any corporation and all other input helping us to improve CE!

But CoreELEC need to test and approve any items first before we can take care of maybe official needed support caused by third party software. It’s just like a sub forum where the users should be aware of maybe getting no support or help (at least from CoreELEC).

So after you calm down you become rude again? You can clearly see how much troubles such features bring.

I’m actually thinking how to make this work in more general way but with such attitude I’m putting this on hold again. Why even bother …

I’m really sorry for my attitude. I was digging through s905x4 day and night and constantly flipping through CE and EE forums/discord to give support advice on stock CE/EE and my fork HE and saw the Unsupported SW section and misunderstood it was a big no from your side (I’m not a native English speaker and have never speaken to foreigners before these months, so my words in English might seem offending when I didn’t mean to). I just slept 3 hours last night so I was not thinking straight. After Portisch’s explanation I understood it’s for better warning for users

The trouble was actually not there if you are planning to use the firmware just as-is. But it was really my fault that I didn’t include an alter-way to first boot to CE so the layout will be 2-partitions instead of 3-partitions created by EE.

In more general way it could be done, and I have idea on how to achive it. But that needs some heavy modification of the bootup process, and many tests to ensure it does not break backward-compatibility

Then explain it and share ideas. Who knows what will future bring.

I was looking into this in the past to have dual boot of 2 CE systems. Like A/B for easier testing. The question is how many partitions would be used? 2, 3 or 4? With 4 it should be pretty easy to do.

The system partition can be shared, subfolders can be used to store kernel, squashfs image and dtb for alternative system when contents of the root folder can stay the same as how it is. A env var prefix can be set during startup according to other contents(other env var, file in system partition, or with user input got from gpio, etc) or by some easy userspace tools

Fatload supports loading contents from subfolders so this will work. By default prefix is or is set to empty and will load contents in the root folder. When selected other OS, kernel, system, dtb will be loaded from subfolser

Storage partition can be shared or dedicated, a dedicated condig file in system partition can be created for this. Read during init to update DISK to other contents other than default LABEL=STORAGE, the config file can have similar format like systemd-boot configs yet it only have to record disk= like root= for systemd-boot

So minimum at 2 and maximum at the partition table format(mbr/gpt)/u-boot can handle