CE+EE dual-bootable image

Just as a side note, this is mentioned in the category description:

and also the home of community guided developments that can be PR’d to CoreELEC GitHub for official support

Wow, so this is a new category just added several hours ago? Thank you for your side-note.

So project-wise this will be achieved with multiple parts:

  1. A dedicated config file format should be defined, it can be json, xml, yaml, but simple key=value config is enough.
  2. Bootup script cfgload should be updated to support optional subfolder prefix. It always falls back to no-prefix boot directly from root folder for compatibility
  3. A helper tool/script that translate one of the above config file will be invoked by busybox/init. Its functionality is not included in busybox/init directly so merging upstream LibreELEC changes won’t become more tedious
  4. A section should be added in busybox/init that invokes the above helper to update certain bootup arguments. This is done during init, before sysroot mounted.
  5. A userspace tool with optional GUI should be added for managing multi-boot and switch between OSs. For implementation in kodi some easy python code is enough.
  6. A multi-platform converter that can convert any LibreELEC format update tarboll onto a valid subfolder onto the drive.

Yes, it’s new. As we’re adding new soc’s to the list and new devices are being supported we have to finally (not without a bit of sadness) move the EOL devices, CE based on Leia and other unsupported features to an own place. I think it will better highlight people efforts and will bring more support from the community.

In fact two days ago Amlogic-old device was brought back at EmuELEC. So with some effort I believe the community can also bring it back to CE.

This sounds very complicated which means lot of testing which means don’t expect anything like this to be included soon.

I think I will try to do something much easier without much overhead.

Will not happen. Not because it is not doable (I already have everything set) but because it is too much work to handle.

I didn’t expect you to include this, considering you are busy bringing support to s905x4 and a311d2 these days. I was planning to do all of these by myself. It’s doable in my sight even I can’t guarantee it’s achieved at anytime soon.

It’s not “just to be added or doable”, it need to be maintain and kept alive.
We already have to take alive 2 CE-branches, 2 Kodi branches, 1 kernel and 1 media-modules.
This will be increase again with 5.4 kernel to 3 Kodi branches (as Matrix will not be on 5.4), 2 kernel and 2 media-modules. So if the old kernel or Kodi Leia is coming back on new devices you can just multiply all by 2. It’s just not doable because of missing manpower. And all branches aren’t compatible, so each commit need to be checked and if needed adapted and tested again…

I didn’t say bringing back Amlogic-old is doable. I meant a generic multi-boot environment with my planned project structure for CE and all Amlogic CE-forks is doable. And I meant doable for me, not for Team CE. I’m doing all these for personal challenge and expect no help or manpower from any other.

About Amlogic-old, I meant community can try to bring it back (3.14 kernel + old media modules + Matrix) not that should be brought back by Team CE and kept alive. I helped fixing problems bringing Amlogic-old back in EE so I can see the possibility.

it’s doable for sure,

just as hint:

-> 3.14             | -> 4.9                  | -> 5.4
GXXB -> GXL -> GXM -> G12B -> G12A -> SM1 -> SC2 -> S4 -> T7...

SC2 is almost done, since S4 it’s maybe only 5.4 kernel.
You see it does not make really sense to work on 5 generation old SoC when you just can buy a “cheap” new generation SoC. This will never pay off.

Yeah, just got a SC2 box for only 200CNY for myself for future-proof and it is way faster than my GXBB and GXL boxes. I’m happy with it and will use it as my main media box. But there’s always some “enthusiast” wanting to squeeze the last 1% performance and willing to pay tens of even hundres of hours to do so :rofl:.
My tinkering with CE and EE actually starts with me digging through my old storage and happened to find a Xiaomi Mibox MDZ-16-AA (gxbb) that worths nothing yet I put almost a week to reverse-engineer all kinds of Xiaomi’s proprietary stuff and that ended up with a USB Bunring Tool flashable image for CE9.2.8+EE4.3 with full Xiaomi support and that is the base of the current generic Amlogic-ng HybridELEC.

I trying with your suggestions too, with gparted live, or my windiskmanager, deleted the full eeroms, than in the next install just resized and shrinked eeroms. With all method at the end, the results good until the first reboot. Than the emuelec not mount anymore my second usb drive with gameroms … Coreelec works good.

You can replace the aml_autoscript in the freshly burnt HybridELEC image with the following one, for first boot it will always boot into CoreELEC, thus the fs-resize will be done by CoreELEC, and thus the partition layout is 2 partition only: 2G system + a storage partition that fills the remaining space

The force-ee-first script and force-ce-first will be included in the next full image release of HybridELEC.

It was my fault that I didn’t include these scripts that can force you boot into any of the OS you like, and by doing so I force you to have a 3 partition EE-style layout.

aml_autoscript_ce_first (1.5 KB)

With this, you can just: flash the image, place the dtbs, replace the autoscript, and boot staright up to CE and have a 2 partition layout instead of the 3 partition one created by EE

As long as there’s EEROMS partition on the same drive EE is booting, it won’t mount that from other drives. You shrinked EEROMS instead of deleting it, so EEROMS is still there, and it will be mounted from the SAME drive instead of your second usb.

Sorry, not work. I made new install, CE installed first. Next install EE.
EE not mount my Second USB drive, not even if force mount.
Another usb installation, Single normal 4.5 EE, boot fine, and mount the external usb roms.There is EEROMS partition as well.

Is your EEROMS a fat32 fs? If not you need to copy ee_fstype fron the old installation under EMUELEC partition to HYBRIDELEC partitoon. The init process in EE will mount EEROMS with corresponding fs type recorded in this file. And maybe you’ve modified it yet forgot to migrate it?

##############################################
#                 EmuELEC                    #
#     Retro emulation for Amlogic Devices    #
#             Based on CoreELEC              #
##############################################
EmuELEC (7Ji): v4.5-hybrid (Amlogic-ng.aarch64)
EMUELEC:~ # df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                483.5M      4.0K    483.5M   0% /dev
tmpfs                   195.5M     14.7M    180.8M   8% /run
/dev/mmcblk1p1            2.0G      1.2G    815.6M  60% /flash
/dev/loop0              986.5M    986.5M         0 100% /
/dev/mmcblk1p2           27.3G    510.1M     26.8G   2% /data
/dev/mmcblk1p2           27.3G    510.1M     26.8G   2% /storage
/dev/sda                 57.6G      5.7M     57.6G   0% /storage/roms
/dev/sda                 57.6G      5.7M     57.6G   0% /storage/.update
tmpfs                   488.8M         0    488.8M   0% /dev/shm
tmpfs                     4.0M         0      4.0M   0% /sys/fs/cgroup
tmpfs                   488.8M      3.0M    485.8M   1% /var
tmpfs                   488.8M         0    488.8M   0% /tmp
none                     27.3G    510.1M     26.8G   2% /tmp/assets
none                     27.3G    510.1M     26.8G   2% /tmp/cores
none                     27.3G    510.1M     26.8G   2% /tmp/database
none                     27.3G    510.1M     26.8G   2% /tmp/joypads
none                     27.3G    510.1M     26.8G   2% /tmp/overlays
none                     27.3G    510.1M     26.8G   2% /tmp/shaders
ports                    27.3G    510.1M     26.8G   2% /storage/roms/ports_scripts

EEROMS on second drive works totally fine for each of tests I’ve done. Can you confirm if the second drive (in my case /dev/sda) is even recognized? If you are using both under a same usb-hub then chances are they can overburn the limited power delivery capacity of it

Also a side-note, EEROMS on a different drive is not suggested nor supported by the developer of EE.

To complete the fs-tree, both drives (the one containing system and storage, and the one containing EEROMS partition) should be AVAILABLE during init (when you see the splash screen and version info at top-left). Afterwards EEROMS can no longer be properly mounted (you can manually mount it to /storage/roms, but bind-mount of /storage/roms/.update => /storage/.update can’t be done easily for you, and port-scripts also need to mounted on top of the EEROMS partition, the whole process is tedious and troublesome)

Well, I done just what Emuelec wiki written.
I formatted my 128Gb fat32 drive, then created one folder in the root directory called roms, and included a *file named “emuelecroms” (without extension) inside the roms directory.
My Original emuelec mount that folder, without issue.
Hybrid version mount not. Usb drive seen on Emuelec, in mount options, but not visible in settings > drives.

Doing it in the way EE wiki suggests also works for me:

##############################################
#                 EmuELEC                    #
#     Retro emulation for Amlogic Devices    #
#             Based on CoreELEC              #
##############################################
EmuELEC (7Ji): v4.5-hybrid (Amlogic-ng.aarch64)
EMUELEC:~ # df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                483.5M      4.0K    483.5M   0% /dev
tmpfs                   195.5M     14.7M    180.8M   8% /run
/dev/mmcblk1p1            2.0G      1.2G    815.6M  60% /flash
/dev/loop0              986.5M    986.5M         0 100% /
/dev/mmcblk1p2            2.0G    501.7M      1.5G  25% /data
/dev/mmcblk1p2            2.0G    501.7M      1.5G  25% /storage
/dev/mmcblk1p3           25.5G      2.5M     25.5G   0% /storage/.update
tmpfs                   488.8M         0    488.8M   0% /dev/shm
tmpfs                     4.0M         0      4.0M   0% /sys/fs/cgroup
tmpfs                   488.8M      3.0M    485.8M   1% /var
tmpfs                   488.8M         0    488.8M   0% /tmp
none                      2.0G    501.7M      1.5G  25% /tmp/cores
none                      2.0G    501.7M      1.5G  25% /tmp/database
none                      2.0G    501.7M      1.5G  25% /tmp/joypads
none                      2.0G    501.7M      1.5G  25% /tmp/assets
none                      2.0G    501.7M      1.5G  25% /tmp/overlays
none                      2.0G    501.7M      1.5G  25% /tmp/shaders
/dev/sda                 57.6G    128.1M     57.5G   0% /var/media/roms
/dev/mmcblk1p3           25.5G      2.5M     25.5G   0% /var/media/EEROMS
ports                     2.0G    501.7M      1.5G  25% /var/media/roms/roms/ports_scripts

The layout of the roms partition is as follows:

EMUELEC:~ # ls /var/media/roms/
System Volume Information  roms
EMUELEC:~ # ls /var/media/roms/roms/
bezels         naomi          ports
emuelecroms    nes            ports_scripts
EMUELEC:~ # ls /var/media/roms/roms/*
/var/media/roms/roms/emuelecroms

/var/media/roms/roms/bezels:
EmuELEC-1080.png         EmuELEC-1080_sl_1px.png
EmuELEC-1080_sl.png      default.cfg

/var/media/roms/roms/naomi:
mslug6.zip

/var/media/roms/roms/nes:
Contra (U).zip

/var/media/roms/roms/ports:
ecwolf

/var/media/roms/roms/ports_scripts:
2048.sh                          Hurrican.sh
Abuse.sh                         Hydra Castle Labyrinth.sh
Bermuda Syndrome.sh              Mr. Boom.sh
Blake Stone Planet Strike.sh     OpenTyrian.sh
Blake Stone.sh                   Prince of Persia.sh
Cannonball.sh                    Quake.sh
Cave Story.sh                    Rick Dangerous.sh
Cdogs-sdl.sh                     RigelEngine.sh
Commander Keen.sh                Sonic 1.sh
Diablo Hellfire.sh               Sonic 2.sh
Diablo.sh                        Sonic CD.sh
Dinothawr.sh                     Sorr.sh
Doom 2.sh                        SuperTux.sh
Doom.sh                          SuperTuxKart.sh
Duke Nukem.sh                    Supermariowar.sh
Flashback.sh                     VVVVVV.sh
Heart of Darkness.sh             gamelist.xml
Heroes of Might and Magic II.sh  images

So maybe you are using both bootup drive and roms drive under the same usb-hub and it exceeds the power provided by the usb port on box? I’ve tried a usb2.0 hub without external power and a usb3.0 hub with external power, and I can’t even use the controller connected to the 2.0 passive powered one when the usb3.0 roms drive is connected. These new usb3.0 pendrives with high I/O speed and high capacity are very power-hungry and should only be connected directly to the box if you don’t have an active powered usb-hub.

USB3 pendrive with the system is GT-King USB3 side plug. Roms with another pendrive ist in usb2 port backside of GT-King.