How to installtointernal on empty eMMC? (LePotato)

I wiped the eMMC. Is there a way to install to a clean block device and have it setup all of the partitions? Or is there an existing script to do it?

Hi @daxue

Sorry I did receive your PM about the installtointernal issue with LePotato, I totally forgot to reply.

Ideally I wouldn’t want to have to replicate all of the Android partitions if we can avoid it, it would be preferable to just have boot/system and data to maximise the available space that can be used on the eMMC.

The current script we use isn’t appropriate for this use-case, we will have to create a separate script to handle LePotato devices with an empty eMMC and then try and unify it in the future into the current script, I still have my board and the eMMC module so I will look into this.

The only difference between the SD card version and an eMMC version should really just be minor changes in u-boot that is the output of Amlogic signing tools and how it is written to the boot area. I’d say just blow out the Android partitioning altogether since that isn’t really necessary.

I will play around with the CoreELEC build system as well. I don’t think it is very complicated but I am up to my neck in work on upstream images.

Thanks for looking into this.

We have made some changes for LePotato in u-boot and in the boot.ini configuration and booting from the eMMC now works.

A test build is available here.

Just dd the image onto a blank eMMC, we still need to make a script to automate this for users or modify our existing installtointernal script.

I will try it out. Is it in master or local to you? I may also add some performance mods to u-boot. Thanks for looking into this. Should we modify installtointernal or something else altogether?

@daxue: I’ve included a emmc_timeout into boot.ini this morning. Basically you just use a SD card with CoreELEC now and set in /flash/boot.ini emmc_timeout to 1.
This will add a “sleep 30” before the kernel is loaded in u-boot. So you reboot your board with SD card and you pop in your emmc while it is sleeping for 30s. This way CE will boot and not Android.
Once in CE you can use dd to flash an image.

This is still the first steps. Next step is to write a install script for this. I’m thinking it will work like this:
-Ask the user if he is sure?
-Tell the user that an emmc_timeout will be set to 30s and that the board is going to reboot now.
-bootlogo in uboot will be used with the words “Please insert your emmc now! 30s”
-CoreELEC will boot again and the script will continue
-Script will check if emmc is present and ask the user again telling that all data will be deleted
-Script will repartition the emmc and copy all the data and files and also override uboot on emmc
-Script will tell the user to shutdown the board and remove the SD card

The changes have been pushed to master already and the latest nightly builds include the changes and can be direct installed to a blank eMMC by using dd.

Ray is already working on modifying the install script to automate the installation to eMMC.

I’m curious about these u-boot mods?

On a side note I think the LePotato is the teams favourite device, I would love to see a S905D version with Gbit in the future :wink: or something with an AC wifi chip in it, or both… the market really needs something like this.

@Ray All of our future platforms will have SPI and skip this non-sense thankfully. The stick eMMC on at a certain time hack is our only solution ATM. I think that’s the only way to do it.

@anon88919003 It’s coming after Chinese New Year along the lines of Renegade Elite. WiFi and Bluetooth is not onboard though. We have RTL8822BS module.

A small little msd to emmc adapter as Hardkernel offers would have been Gold here I have to say. Sometimes something small like this can make a huge difference :wink:

It gives you the same freedom as an sd card with the speed benefits.
I guess with our changes the user will have almost the same experience (maybe even more noob friendly). Optimally it would be great @daxue if LibreComputer would preflash CoreELEC and sell those emmc separately. Hardkernel is doing this with selling models for Android and Linix preflashed. Of course this is the same model and can be reflashed by the user.

@daxue that sounds great :slight_smile: I look forward to seeing what’s coming.

The board itself can act as a flasher. You don’t need a separate adapter. I just have to write the code when I have some free time which is an luxury these days.

Can you clarify? Do you mean the image now works both on MicroSD card and eMMC if using straight dd?

This is not elegant and user friendly.
Anyway after some testing the timeout code in boot.ini does not work. It is too hard for users to insert the emmc in the right time to boot CoreELEC from SD card with emmc.

This is a dead end and we cannot support it like that. I can not recommend this emmc to anyone wanting CE on it.

@daxue yes it does now with the latest nightly image.

You can test it with the following.

dd if=CoreELEC-S905.arm-9.0-nightly_20181220-LePotato.img of=/dev/mmcblk0

We have encountered an issue when Android is installed on the eMMC though, the board will default to boot from eMMC if it is inserted and thus users can not boot into CoreELEC to erase it.

I think this is @Ray gripe with no adapter being available to wipe it, it was extremely difficult for me to erase the eMMC that I had available which had Android installed.

If the eMMC is blank then it is not an issue as the board will then boot from the SD and the eMMC can then be flashed with CoreELEC.

If you know of anyway to force booting from the SD when an eMMC is inserted which has Android installed then we could work around it.

I will release a tool for this to flash the eMMC directly through dd akin to sunxi-mass-storage.

That would be extremely useful… even more so if it works from Windows.

I found a way. Will push a fix later.

@daxue I managed to get this to work now. I also finished with an install script (will test it team internally). I’d say this is now user friendly and easy. Hopefully our next beta will include this already.

I now have to find a way to selectively enable suspend on Lepotato then the Lepotato will be our best out of the box experience device with full HDR support with auto Colorspace switching, eMMC support, Suspend2Ram, CEC wakeup from suspend and power off, Wakeonlan from suspend and poweroff, IR wakeup.

I really enjoy that device personally now! Personally I don’t need Gigabit but if you manage to make the same device with Gigabit it will be a winner.


We are working towards mainline as well on our end with BayLibre. Currently we are targeting basic SBC use cases but we want to be feature complete by end of 2019.

Thank you guys for holding the fort while we do this. End users are picky and CoreELEC is invaluable.

1 Like

We appreciate the efforts for mainline and we will switch over to mainline too but as you say end users are picky. You can’t take away features they are used to.
Everyone is always complaining about AML’s code and the stone-age Kernel but frankly it is not that bad.
Nevertheless our goal is to use mainline too and we have some code ready. In fact we might start with public mainline alpha’s soon.

1 Like