[VIM3L] SD Card boot + USB storage

I am sorry for double post on Khadas and here, but this is really shared area…

I have VIM3L HTPC Kit, which has CoreELEC preinstalled on the eMMC.

If I want to run CE from the SD card (flash) and use USB stick to /storage, what procedure I should follow?

I should be able prepare SD card as usual (Rpi, Odroid). I assume for storage I just need to change disk= within /flash/cfgload or simply change label on eMMC from STORAGE to something else and label USB stick partition as STORAGE, right?

But I read on wiki, that for SD card boot there must be android on eMMC? I am not familiar with eMMC control operations and I dont want to brick my device…

What if I change
setenv rootopt "BOOT_IMAGE=kernel.img boot=LABEL=COREELEC disk=LABEL=STORAGE"

to
setenv rootopt "BOOT_IMAGE=kernel.img boot=UUID=<UUID of SD card flash partition> disk=UUID=<UUID of storage card flash partition>"

on eMMC /flash, will it work without Android? That would be less aggresive change, and quite clean also, but I am not sure about future update process…

Thank you!

VIM3L:~ # parted -l
Error: /dev/mmcblk0rpmb: unrecognised disk label
Warning: Error fsyncing/closing /dev/mmcblk0rpmb: Input/output error
Retry/Ignore? i
i
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk0rpmb: 4194kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mmcblk0boot0: unrecognised disk label
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk0boot0: 4194kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mmcblk0boot1: unrecognised disk label
Model: Generic SD/MMC Storage Card (sd/mmc)
Disk /dev/mmcblk0boot1: 4194kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mmcblk0: unrecognised disk label
Model: MMC AJTD4R (sd/mmc)
Disk /dev/mmcblk0: 15.6GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

You would have to flash a different OS to the eMMC first to do what your wanting.

Refer to the instructions here to recover CE to eMMC, this device is impossible to brick.

Thats what I was afraid of :frowning:

What about using eMMC only for read-only /flash partition. In that use case, would be sufficient to just rename STORAGE label@eMMC and place STORAGE partition on the USB stick? (or through UUID, it doesnt really matter). Or there is need to work around bootloader as well?

My goal is prevent eMMC wearout from writes (textures, etc… storage is used kinda heavilly, and I am planning 5y+ lifespan for these devices-until h265 sucessor will be there, which I gues wouldnt be soon). My thinking is, when eMMC gets corrupted, I dont want to hassle with problem “how to re-alive device with SD boot now, when eMMC has troubles”.

I see some burning guides on Khadas wiki, but nothing official regarding CE and SD usage… And from your answer my assumptions was correct, I guess I would hit trouble without “official recommend” way…

I don’t think you have anything to worry about in those regards, Khadas are using Samsung eMMC and not your typical recycled no-name junk.

You don’t have to flash another OS, I’m only recommending that as it’s the easiest way to achieve what your wanting.

You should be able to hold one of the buttons on the side (I can’t remember which) and it will initiate booting from external devices and you only need to do it once.

cfgload also can not be modified directly, it has to be compiled and its updated automatically after every reboot so you would lose any changes you make.

Ah, thanks… I am not own any “junk”, btw… I just care about things, and my precautions was beneficiall multiple times in my life…

Yes, I could doesnt care of it at all and take out-of-box functionality without any effort and spent time, and propably be fine with it for some years - even many maybe, (and I understand you prefer eMMC way in VIM case), but the device has SD slot + USB so I think this would be good to have explained other way and offered this to the users as well, and have minimize even risks, which others could considered as very small. ( example on my USB HDD setups I am used to have /storage partition on USB HDD, and it works very well).

I will try to look around the topic of Khadas VIM3 and booting, when I will have free time to spare, good to know that there is some safe net for errors… Still better avoid them :slight_smile:

Information about cfgload is crucial for me, thanks. Its a pity, as on Rpi/Odroid platforms there are no problem with booting parameters, I didnt expect hickup here. Well, hopefully VIM platform will be last to learn for a long time :slight_smile:

Anyway, if the default parameters are choosed by label (STORAGE), it should work well when I use that partition on SD Card, right? Although I usually need rootwait for USB stick, and that would be problem if I cant add custom boot param :frowning: Is that really the case of CE@VIM3, so we cant modify those parameters at all?

Following question would be: hyphotetically, if we will have whatever OS on VIM3L, booting CE from SD Card prepared correct/official CE way. Updates will be without problem, or we need say somewhere from which device is booted to the CE ((ce_in_emmc=0 etc.)?


For future references:
Creating CoreELEC Booting medium for Khadas VIM
VIM Boot Upgrade Mode
Flashing images to the eMMC

Rollback - reflashing CE into eMMC

There is contradiction between two pages though, so I understand your Android recommendation…
obrazek
obrazek

TODO:
– Keys method without Android, with CE on eMMC? It shouldnt be possible according #1 #2… But not sure about CE latest, maybe it supports it? #1 #2 are older, not sure if valid for kernel > 3.14.
– If boot change method needs to be done just once, what it actually does? Ie. whats the way to revert boot back from eMMC? Is there some boot order through devices or…
– CE updates on CE running from external media instead eMMC?
– figure out booting parameters to assign /storage to partition on USB(SD) device (is label enough?). The same for roowait boot parameter. Why is boot.ini / config.ini missing??
– is there any drawbacks using external media instead eMMC in terms of functionality? Or is it exactly same.