Installing on old S905 TV box

  • How can I boot a s905 tvbox that already runs coreelec 9.2.x from its internal storage? I downloaded the image of le 11 b1, flashed it on the sd card, edited the uEnv.ini file, but all I get is a blue-tinted image of the amlogic boot picture, then complete darkness, followed by a non-tinted image, followed by the regular boot to coreelec. All that happens in like 5 seconds.

    Normally, the amlogic boot picture is not tinted, shows up only once and right after that it boots to coreelec.

    Its device tree is

    Code
    # cat /proc/device-tree/amlogic-dt-id
    gxb_p200_1g

    so I wrote this on the uEnv.ini file

    Code
    dtb_name=/dtb/meson-gxbb-p200.dtb
    bootargs=boot=UUID=2001-4326 disk=UUID=1f15e972-a53f-4d06-9d5f-a1195c38a657 quiet systemd.debug_shell=ttyAML0 console=ttyAML0,115200n8 console=tty0

    None of the four options mentioned in the wiki apply to it, that is why, back when I installed coreelec on it, I had to use a terminal-like android app to boot to recovery, then boot from the sd and do the rest.

  • I did it! Good news first. I sshed to coreelec and I ran "reboot update", just like I did when I installed coreelec on it (I found the howto I had followed back then).

    On the next boot, and right after that blue tinted screen, it booted from the sd card and reached kodi after a while. I am so excited!

    I will work on it sometime this weekend. I will also need to do the same on that testing image that is for s805, once I get the all black mxq in my hands

    The bad news is that

    - systemd pops a failed service on boot, ethmactool-config.service. No idea what this is.

    - when the card is not on the tvbox, it just stops at that blue tinted screen and does not boot to coreelec anymore ;(

    I had faced that last issue again when I had tried coreelec from the sd, but I do not remember how I had solved it. Somehow I made it boot back to android, but how?

    p.s. That blue tint might be an issue with my old dell monitor. It does not happen at all on the tv.

    Edited once, last by jim_p (February 3, 2023 at 4:51 PM).

  • The "reboot update" triggers recovery boot mode causing the SoC to search for boot scripts in the first partition on the SD card. The LE boot scripts are then found, which sets params in the vendor u-boot environment to use LE boot files and if you reach Kodi then everything has worked. To revert to CE you will need to trigger recovery boot mode again. In most cases that's done with the toothpick method, which (with SD card removed) will find their boot scripts and set boot params to use CE boot files. On most boxes (but it depends on what customisation was done in vendor u-boot) both OS are tweaking the same boot params to suit themselves which prevents a simple swap between OS(es) by removing the SD card.

    The ethmactool-config service creates a unique MAC address based on the CPU serial to avoid issues where vendor code sets the same MAC for all boxes (and users have more than one of the same box causing conflicts) or where the MAC was not set in the factory and changes on each boot. As long as you have a static MAC address "systemctl mask ethmactool-config" will disable the service on future boots and stop the message from showing up.

    Not sure about the blue tint, but as long as it doesn't happen on the TV it's not something I'll be interested in chasing. Vendor u-boot does a few weird things.

    NB: If the S805 image is AMLMX .. it is pre-Alpha state and is not even remotely supported.

  • p.s. thread title changed because you have done clean install from SD card and are not technically updating from CE; which is something I have no interest in trying to support with users as too much has changed and too much stuff breaks.

  • p.s. thread title changed because you have done clean install from SD card and are not technically updating from CE; which is something I have no interest in trying to support with users as too much has changed and too much stuff breaks.

    Thread title was my baby, but it's OK :) . I've separated those two posts from another thread.

  • Thank you for all the info. I just booted it and this time I completed that "first run wizard" so as to get to a working enviroment.

    I now have le11 running on it, so here are the 2 major issues I noticed with a first glance.

    There is no networking, wired or wireless. For the wireless part, the first run wizard showed no wireless networks to connect to, so I went to libreelec settings > network. There is no switch in there to turn the wireless interface on.

    Moreover, the switch for the wired interface, under the same menu, turns off the second I turn it on! Could it be related to the systemd service error above?If it helps, it has no wire connected to it. That is because the monitor I connect my stuff to is away from the router and I do not have a long cable for it.

    If I move the tvbox close to the router to connect it via ethernet, thus lose the video output to see what is going on, the leds on the network card light up, but it gets no ip as I can see from my router's settings.

    And no network means no ssh access. And no ssh access means I can not provide a log. Also, since it can not boot to ce anymore, providing any info for the hardware itself, e.g. its wifi card, is impossible.


    I just tried dtech's image for s905 and it simply stops at the amlogic logo. I tried all 3 dtb files availble.

    I am now flashing le 11 b1 back to it.

    Edited once, last by jim_p: Merged a post created by jim_p into this post. (February 5, 2023 at 6:34 PM).

  • The same things happen with that image as well.

    In order to update it, because there is no network access, I had to insert the sd card on my pc, go to the .update folder and manually download the file in there. The update process was started at next boot and finished successfully. although it popped up some messages on the screen right before it auto-rebooted.

    Before giving up, because it is 7am here and I have just woken up, I tried the wireless usb card I used on my rpi zero non-w, a tplink wn722n (the v1 version that came with atheros chipset and has great linux compatibility), but there is still no wireless option in libreelec settings.

  • If you add "textmode" to boot params in uEnv.ini the box boots to a text console instead of Kodi and you can attach/use a USB keyboard to run commands. To retrieve the logs, make the SD card read-write with "mount -o remount,fw /flash" and then dump the boot log content to /flash with "journalctl > /flash/journal.log" .. then connect the SD back to something you can retrieve and pastebin the log file from.

    AFAIK all the atheros USB chips are enabled in the kernel but we are probably missing the firmware, which should be obvious if you look in dmesg for the chip being probed. This might get it working: "mkdir -p /storage/.config/firmware && cd /storage/.config/firmware && wget https://git.kernel.org/pub/scm/linux/…plain/ar9271.fw && reboot"

  • There you go. The keyboard and the wifi stick were already plugged in at boot.
    https://paste.debian.net/hidden/c19d5833/

    Stuff I noticed

    - there is no wired interface in ifconfig, just loopback

    - there is no wireless interface in ifconfig, although the driver for the wifi stick appears loaded in lsmod

    - there is no rebootfromnand or installtointernal anymore :(

    As for the dtb, I know here are other dtb files in there, but I hesitate to use another one in case it bricks the tvbox. When I was trying ce on it, its wiki was mentioning a gxl_p212_1g. It did not work at all and I had to find the proper dtb with the command I mention above.

  • Code
    Jan 01 00:00:10 pain kernel: usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
    Jan 01 00:00:10 pain kernel: usbcore: registered new interface driver ath9k_htc
    Jan 01 00:00:11 pain kernel: usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
    Jan 01 00:00:12 pain kernel: usb 1-1: Service connection timeout for: 257
    Jan 01 00:00:12 pain kernel: ath9k_htc 1-1:1.0: ath9k_htc: Unable to initialize HTC services
    Jan 01 00:00:12 pain kernel: ath9k_htc: Failed to initialize the device
    Jan 01 00:00:12 pain kernel: usb 1-1: ath9k_htc: USB layer deinitialized

    ^ The kernel supports the driver and we already include the correct firmware (listed in the driver code) so the device is probed, but fails to load the firmware. I've Googled the error and it doesn't show up much (no clues, and nothing current).

    I'd suggest experimenting with other device trees. GXBB boxes deviate more from reference designs than newer S905X/D and S912 do.

  • Does this mean I can delete the firmware file I "installed" earlier? I also added "nosplash progress" as boot parameters, so as to check if any other systemd service fails, but the forementioned one is the only one that does.

    I will give meson-gxbb-p201.dtb a try right now.


    Yaaay it worked! It booted to the tty without poping that error about ethmactool and ifconfig does show eth0.

    I connected it to my router and I can now access it via ssh.

    I also noticed it can not access the emmc module at all. It is not visible in blkid and emmctool says "no emmc module detected". This means I can say goodbye to any hopes of booting it again from its internal storage.

    Edited once, last by jim_p: Merged a post created by jim_p into this post. (February 6, 2023 at 11:38 AM).

  • The right firmware should already be in the image so you can delete that file.

    On eMMC: Amlogic invented their own partition scheme which is only used and understood by their own legacy kernels and tools so upstream Linux and utils used for partitioning and formatting in modern LE cannot can see any valid partitions on the eMMC device. Any attempt to repartition the device with tools that don't know about the special scheme will break the device-specific u-boot that is booting the box.

    If you have the original vendor u-boot sources for the specific box it's possible to extract things and make custom images, but these days nobody still has the sources for boxes made in 2015 so that option is almost always a non-starter. The technical challenge is that the process of signing u-boot with Amlogic magic uses files with box/device specific RAM timings so generic support for e.g. p200/p201 doesn't exist. We have the signing sources for the original p201 reference board; but there is zero guarantee your p201 derived box uses the exact same RAM chips as the Amlogic reference board (more likely you can guarantee it doesn't) and if the RAM timings are wrong you've "bricked" the box and now have a complicated process to recover it to a usable state (most users baulk at the idea of opening the box and shorting pins to disable eMMC and thus force boot from SD/USB) and that also assumes you have a working u-boot binary (and you probably don't).

    So we don't support internal installs unless the sources do exist, i.e. the WeTek boxes and a couple of SBC boards. NB: From my own testing the real-world difference between a modern SD card and most eMMC chips in boxes of this era is marginal.

  • I do not really care about the speed of each component, but I think that emmcs last longer than sd cards. Ideally though, I would rather have a small usb stick, like the sandisk fit series, in usb1 than have an sdcard pop out from the side.

    Any ideas on dtb files? I do not expect some dtb that is specific to a device to work, e.g. the... 90% of the files in /flash/dtb/, but I do not know which one to try next. Moreover, the path to the device tree id has now changed to

    Code
    # cat /proc/device-tree/model
    Amlogic Meson GXBB P201 Development Board

    ---edit
    I forgot to mention the wifi. Wlan0 does not even exist as an interface!

    Code
    # ifconfig wlan0 up
    ifconfig: ioctl 0x8913 failed: No such device
  • Anything that starts with "meson-gxbb" is a candidate. No value in trying others (won't work). As for WiFi, please share the Brand/Model of the box (hoping it's not something super-generic) and the URL from "pastekodi" so I can see what state things are in. If you have pics of the board inside it can help with chip guessing.

  • You are right, I did not mention the most important thing! So, it's an mxq pro 4k, with s905, 1gb or ram, 100Mbps ethernet... and no idea about the wireless.

    And from all the dtb files in there, the ones that are generic and start with meson-gxbb-* are meson-gxbb-p200 and meson-gxbb-p201.

    Here is pastekodi with all the info.

    http://ix.io/4njx