LibreELEC for Khadas VIM1 VIM2 VIM3 (SD & USB & eMMC)

Thanks for your work. Is the video playing smoothly? I’ll check only in the evening.

The video I tested, working fine. But I have not tested all the options. By the way, maybe it’s a coincidence, but I noticed that the version of the image I see is much more available Wi-Fi networks than on the way from Kszaq. It would be nice if someone had checked this information.

Just to clarify: if i DON’T have Android 6 (aka Marshmellow) on my VIM, i need to download the kvim.dtb from your Yadi.sk folder (20170801) and replace the one included in the image with the one i just downloaded?
– Edit: rename it to dtb.img obv as well :wink:

Yes, you need to download, rename and replace “dtb.img” on the media. I wrote about Android-6 in order to understand how u-boot I test my build. Maybe the firmware with Android 7 (with the data used in u-boot from the firmware) the behavior of the LE will be different, I have not tested it.

hi @balbes150,
why is there no simple img file we can use to flash LE directly to emmc using the same windows and usb-c tool like for ubuntu ?

Using the flash file with USB cable - is dangerous procedure. Running the system from external media in multi-boot mode saves the contents of the internal eMMC and allows the user to preview the system. To check all its functions and to make sure this system suits him. I know a lot of cases when users , after some time of use, refuse from this system, in this case, they really just return to their previous state (without having to perform a potentially dangerous procedure of flashing). Many users use multi-upload that would to have multiple systems (Android + Le + Linux).

Hi balbes,
i had the latest official nugat build (170612) installed on mmc, flashed via manually creating a burncard with u_boot_nugat_170512. Was working ok, but all my PCs run linux, so i wanted linux on my VIM aswell.
I dd’ed your previous LibreElec 20170705.img to my sdcard, renamed dtb.img to _dtb.img_ and renamed remote.vim to remote.conf. Then i ran the Update&restore utility, pointed to the aml_…zip-file and after short the system rebooted.
But it never got out of the boot-animation. So i updated my SDcard with your new image (dd…; ren dtb.img __dtb.img; cp …/…/kvim.dtb dtb.img). I can’t get the image to boot, the system will only boot to the android boot animation and never finish. I have access to uboot, here’s the boot log: https://pastebin.com/q1KmV6iF
As i’m completely new to uboot, what should i do now?
(Oh, and if this is the wrong thread, please move it to another.)
THX :slight_smile:

Show the output of “printenv” from u-boot.

printenv output:
_=/system/bin/printenv
ANDROID_DATA=/data
TMPDIR=/data/local/tmp
ANDROID_ROOT=/system
EXTERNAL_STORAGE=/sdcard
ANDROID_BOOTLOGO=1
ANDROID_ASSETS=/system/app
ASEC_MOUNTPOINT=/mnt/asec
BOOTCLASSPATH=/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache-xml.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/droidlogic.jar:/system/framework/droidlogic.frameworks.pppoe.jar
HOSTNAME=kvim
DOWNLOAD_CACHE=/data/cache
ANDROID_STORAGE=/storage
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
SYSTEMSERVERCLASSPATH=/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar

I need the output of this command from u-boot. Stop boot in the UART console and execute the command “printenv”.

sorry, never knew that those where two different env’s :blush:
https://pastebin.com/R19aigsu

You have not activated multiupload.

bootcmd=run storeboot

If multiboot is enabled, this string should contain

bootcmd=run start_autoscript; run storeboot;

1 Like

It works now, thank you :+1: :+1: .
I extracted the text from aml_autoscript and executed all lines manually in the console, b/c none of the env-vars were set.
Now it boots beautifully :smile:
If someone with a similar problem comes along, here’s the script:

setenv bootfromrecovery 0
setenv bootfromnand 0
setenv bootcmd “run start_autoscript; run storeboot;”
setenv start_autoscript “if usb start ; then run start_usb_autoscript; fi; if mmcinfo; then run start_mmc_autoscript; fi;”
setenv start_mmc_autoscript “if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi;”
setenv start_usb_autoscript “if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 1 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 2 1020000 s905_autoscript; then autoscr 1020000; fi; if fatload usb 3 1020000 s905_autoscript; then autoscr 1020000; fi;”
setenv upgrade_step “2”
saveenv
sleep 1
reboot

Ok, but it seems that having an android firmware in the emmc is mandatory because it is the only way to have a multiboot u-boot; can anyone confirm that ?
If so,
we need to be able to re-build a multiboot u-boot from its source;
@Gouwa, does these sources exist somewhere ?
tks all

The presence of Android in eMMC is not required. There are other options to activate the multi-boot, but they are more difficult to use and require more skill. So for normal users I recommend to use the option of using firmware Android and the regular upgrade procedure. I have several times offered to add in a regular u-boot from the original support multi-boot, then users do not need or what to do in the manual, any system (which uses a universal-boot) will run automatically on VIM. I had previously sent requests for inclusion in the source Khadas all the right elements for both multi-boot options (for Android and for DualOS). But while it is not included.

i m sorry your work proposal did not yet get positive answer from the khadas team;
but for the non normal users ,
i think we should make an upgraded uboot (forked from khadas uboot) and augment it with whatever convenient functions we need to make us more efficient and comfortable while we build , experiment and iterate new home made mainline kernels;

@balbes150 are you talking about this pull request
Are you sure the “1020000” is correct ${loadaddr} ? I see in every u-boot i flashed this value “loadaddr=1080000” and “dtb_mem_addr=0x1000000” .

Also maybe you should not hardcore this value but use variable:

fatload mmc 0:1 ${loadaddr} uImage
fatload mmc 0:1 $dtb_mem_addr dtb/amlogic/meson-gxl-s905x-khadas-vim.dtb
bootm ${loadaddr} - $dtb_mem_addr

Also you added ext4 to u-boot, but never use it. For example if I have everything on one root “/” partition it will not load anything from microSD card. I am talking about this

kvim# setenv bootargs "console=ttyAML0,115200 root=/dev/mmcblk0p1 rootwait=1 rootdelay=2 rw ipv6.disable=1 init=/usr/bin/init"
kvim# ext4load mmc 0:1 ${loadaddr} /boot/uImage
kvim# ext4load mmc 0:1 $dtb_mem_addr /boot/dtbs/amlogic/meson-gxl-s905x-khadas-vim.dtb

if everything successful then boot the ArchLinuxARM system on microSD card

kvim# bootm ${loadaddr} - $dtb_mem_addr

Yes, this is the right address. It loads a script (binary data) that should not interfere with the load and use the default address (1080000 , 1000000 etc) which can be used in the startup script.

Yes, I added in the patch the ability to use u-boot with EXT4. I don’t use EXT4 in their scripts as my scripts are designed for use in standard u-boot (where there is no support for ext4). This is done to ensure that my images (scenarios) could work on all TV boxes. If you have EXT4 partitions, you can use them to write your own script s905_autoscript. By the way, I see that many people do not use improved command run the 64 bit kernel “booti”.

Hi, balbes150.
The last build (20170801) works flawlessly.
The video plays smoothly.

I have met some problem:

  1. Play 3d video in 3d mode
  2. Open player control.
  3. Switch to 2D mode
  4. No signal to display/receiver
  5. Press x on keyboard to stop
  6. Video signal comes again.

Can you test this @balbes150?