Jump to content

Recommended Posts

Posted

Hello, I'm new to embedded linux installation, so please bear with me. So I purchased an android tv box labeled h96max S905L3 from TEMU. Specifications (if the label is trustworthy): RAM: 2GB, ROM:16GB, running android 14.0. On the pcb it says: s905_zx02_v01. It features an ethernet port, 2 USB, HDMI, AV port (looks like a headphone jack) and no hidden reset button or sd card slot. I was trying to install any kind of linux to it using a bootable usb, I just need a simple shell capable of running an http server. I have tried using the remote control to trigger boot to linux, but nothing works. I have then opened the thing, and connected uart to a RP2040 and wrote a simple script as a uart bridge. I now have access to u-boot shell, interupted setup. So far I used chatgpt to guide me, but couldn't get it to boot properly. It told me how to boot manually the image from the usb, but it failed every time.

 

It told me to set these env vars, and over time it showed me different addresses. It said the issues were related to overlapping of the addresses, or using address range that was reserved. It also said the dtb which I used, the meson-gxl-s905x-p212.dtb won't work, since the device always threw an error bad_magic, even though I checked fdt header, and the magic was correct.

 

setenv kernel_addr_r 0x20000000

setenv ramdisk_addr_r 0x24000000

setenv fdt_addr_r 0x21000000

 

I would then load the files

 

fatload usb 0:1 ${kernel_addr_r} linux-android.img

fatload usb 0:1 ${ramdisk_addr_r} uInitrd

fatload usb 0:1 ${fdt_addr_r} vendor-expanded.dtb

 

Notice: I used different images, firstly the Image file, and the meson-gxl-s905x-p212.dtb. After failed boots, chatgpt told me to expand, i.e. add padding to the dtb (first with the meson...dtb, and after that with the vendor.dtb). It didn't work, so it told me to generate an android like image using

 

mkbootimg \

--kernel Image \

--dtb vendor-expanded.dtb \

--cmdline "console=ttyAML0,115200 console=ttyS0,115200 root=/dev/sda1 rootwait rootdelay=10 rw" \

--base 0x0 \

--pagesize 2048 \

--kernel_offset 0x1080000 \

--dtb_offset 0x1000000 \

-o linux-android.img

 

and boot using the extracted vendor.dtb (pulled from android) and using

 

bootm ${kernel_addr_r} instead of booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

 

The bootargs I used are setenv bootargs "root=/dev/sda1 rootfstype=ext4 rw rootwait console=ttyAML0,115200n8 console=tty0"

 

Please, any help would be appreciated as I already spent over 6 hours with this little cheap bastard that wouldn't boot anything but that chinese android. I will post output of anything, just let me know if something is needed. I'm sorry for the messiness of this post, but I tried a lot of things that chatgpt told me, explained the errors, and supplied commands for the u-boot shell.

Posted

Then

If you look in the /boot folder,

There are the scripts the Armbian system uses to get uboot to boot on amlogic.

Generally Armbian uses extlinux for booting using a chain loaded uboot binary.

Posted

Specifically the file you want to look at is aml_autoscript

 

What happens on a normal amlogic TV box is when the hidden reset button is pressed during boot, the boot loader looks for this file and runs it.

 

This file then changes the stored uboot environment such that subsequent boots follow a new boot flow to boot first from sd or USB and fall back to android.

 

If you follow the logic you can find the actual boot commands in the other files that get called.

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines