Please select To the mobile version | Continue to access the desktop computer version
123Next
Return to list New
View: 2302|Reply: 24

A Boot-Disk That Allow GT King Pro To Boot Linux UEFI-Arm64 Image -- Fedora 36

[Copy link]

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
Post time 2022-05-31 22:28:54 | Show all posts |Read mode
Edited by JFL at 2022-12-01 01:23

Update: 2022-12-01

Remove outdated links.
For further details please visit Tripole's Gitlab.  There are links for pre-built Debian Bullseye, Ubuntu-Jammy, Ubuntu-Kinetic, Arch Linux Arm64 and also guides on how to convert linux images to be bootable using u-root-bootdisk or petit-bootdisk.

Some of the Tripole pre-built images have a unique feature where it allows you to install multiple linux kernels and you can select which kernel to boot up using u-root-bootdisk or petit-bootdisk or you can also use u-boot to boot up.

Update: 2022-06-11 -- Non-Chainloader Version:- "u-root-bootdisk-nc_0v2.img.gz"
@tripole had developed another "u-root-bootdisk-nc_0v2".  The "nc" stands for NO Chainloader, meaning the u-boot.ext is not required for booting up the "u-root-bootdisk".

The advantages of the No Chainloader "u-root-bootdisk" are:
-  Faster Boot Speed
-  Boot from any USB Ports on GT King Pro.
-  Both "u-root-bootdisk-nc_0v2" USB Flash and your UEFI image on USB Flash can be inserted into the GT King Pro USB Ports and power up.
-  Reboot, in a sense work as it will return you to the menu where you select which UEFI image kernel to boot.
-  In theory it will allow more Amlogic TV Boxes to be able to work with this "u-root-bootdisk-nc" as the search for the correct chainloader for the device no longer required.  

The downside with "u-root-bootdisk-nc_0v2" compared to "u-root-bootdisk_0v2" is that HTOP will report that the device has less memory available.  

For example, on my GT King Pro with "u-root-bootdisk_0v2", HTOP will report available RAM as 3.66GB and with 'u-root-bootdisk-nc_0v2", HTOP will report available RAM as 3.23GB.

Hi Beelink-GT King/Pro Users,
Would like to introduce you to “u-root-bookdisk.img” by @tripole. This “u-root-bootdisk.img” basically will allow Beelink GT King/Pro users to boot some of the linux UEFI-Arm64 images as is. It might also work for other Amlogic Devices with the appropriate dtb. But not all UEFI-Arm64 works though.

Instruction:
  • Flash “u-root-bootdisk.img.gz” on to a USB Flash drive using Rufus or Balena Etcher. The image is small less 300MB (new version size is 105MB)
  • Edit /boot_uroot/extlinux/extlinux.conf to reflect the correct dtb for your device. Already preset for GT King Pro.
  • Download a Linux UEFI-Arm64 image, example “Fedora-Workstation-36-1.5.aarch64.raw.xz” from Download Fedora Workstation.
  • Flash the Linux UEFI-Arm64 image onto USB Flash Drive (Fedora 36 requires a 16GB Flash Driver).
  • Insert the USB Flash with “u-root-bootdisk.img” into OTG USB Port and Power Up. It will proceed to boot the “u-root”. At the stage where it says “Starting kernel…”
  • Insert the USB Flash with Linux UEFI-Arm64 image example “Fedora-Workstation-36-1.5.aarch64.raw.xz” into any of the other USB Port. It will take a while to boot and the screen might even indicate “No Signal” on the HDMI monitor. When the u-root is booted up with the “u-root” logo:
  • Type: boot and hit return. The UEFI-Arm64 image will proceed to boot.


I have personally tested “Fedora 36 Workstation”.  Ethernet, Wifi, Sound and Bluetooth works. But on my GT King Pro to get wifi working, need to copy the missing wifi driver brcm/brcmfmac4356-sdio.txt from another image to /lib/firmware/brcm/

Note: I have not tested new "Fedora 37 Workstation" image.  The link for Fedora 36 Workstation is now Fedora 37 Workstation.

To get sound, you might need to run "g12_sound.sh" and reboot.

Download Links


Links for UEFI/Grub Linux Images:

Fedora Alternate Architecture Buillds Link:  https://alt.fedoraproject.org/alt/  (link added on 2022-06-15)
Fedora-Workstation-36-1.5.aarch64.raw.xz Download Fedora Workstation


u-root-bootdisk-Start-Booting.jpeg
Fedora_36_Desktop.jpeg
u-root-bootup-successfully.jpeg
Reply

Use magic Report

5

Threads

198

Posts

1726

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1726
Post time 2022-06-02 13:57:05 | Show all posts
Edited by darkstar at 2022-06-02 14:01

Thank you JFL,

This is a nice work, I checked it and it is pretty useful.
2022-05-31:

Boot disk for TV boxes (e.g. Amlogic) using u-root for chainloading.

With this disk (which is just a proof-of-concept), you can use the ordinary
u-boot (including the vendor/built in parts on emmc) to boot into u-root,
which is a Linux kexec based boot loader and general swiss army knife thingy
(think busybox). From u-root, you can then easily boot into an UEFI image
of a Linux ARM64 distro (w/ valid grub setup, see below) on another SD/USB:
By issuing the command "boot" at the u-root prompt a scan over partitions for
bootable kernels is initated and the results are presented in a menu (with
bootarg options). The user can then select and boot any of these. (Many other
commands are available in u-root, hit tab at the u-root prompt to see a list.)

/Tripole

Remark: This disk does not contain any "hidden" stuff (like in the first 444
bytes in sector 0 or in the 1MB gap to sector 2048) so you can also equally
well just copy the files here onto a freashly created FAT32 (vfat) partition
of, say, 250MB on some SD/USB (and set the bootable flag, I guess).

Caveats: Our suggested method of booting with u-root uses the "boot" command
which relies on the u-root function Localboot() which scans for grub configs.
Therefore, a valid grub config must exist for this method to work but u-root
is also capable of scanning for other configs, e.g. syslinux (see the docs).

This bootdisk has been tested on Ugoos Am6 and Beelink GT King Pro (thx JFL!).

Usage
=====

(1) Flash this image to a SD/USB (or copy the files to a FAT32 bootable part.).
(2) Edit extlinux/extlinux.conf to point to the right dtb file for your box.
(3) Copy the right u-boot binary for your box (found in the dir "u-boot")
    over to the name "u-boot.ext" (in the root dir). (If you cannot find a
    suitable u-boot.bin for your box, check e.g. hexdump0815's repo below).
(4) Insert this image into your TV box along with some other USB image of a
    Linux ARM64 distro packaged as a UEFI+grub image.
(5) Boot your box. You should end up at the command prompt in u-root.
    (To see the available commands there, hit tab.)
(6) At the u-root command prompt, type: boot <enter>.
(7) u-root now scans the USB bus and your other UEFI image(s) should be found.
    You will be presented with a menu of choices (boot, boot safe mode etc).
(8) Select a boot option and boot (be patient, the screen may be blank for
    up to 30s while the new kernel is booting). (If the screen goes blank for
    along time and you can still at this point reboot with Ctrl-Alt-Del then
    you at least lnow that the kernel has booted but video is not working.)

Origin of files
===============

u-boot.ext
----------
The u-boot.ext file here is the (unzipped and renamed version of the) file
g12a-u-boot.bin.gz from hexdump0815 in his release at
https://github.com/hexdump0815/u-boot-misc/releases/tag/200926-01
There are may other u-boot.bin files at hexdump0815's github repo.

Image-5.10.8-1, script files
----------------------------
The kernel image file Image-5.10.8-1, the associated modules and the boot
script files (aml_autoscript, s905_autoscript) are from Manjaro
https://manjaro.org/ (The kernel build flavor is linux-vim).

vmlinuz-5.10.118-ophub, dtbs
----------------------------
The kernel image file vmlinuz-5.10.118-ophub, the modules and the dtbs are
from ophub's github repo https://github.com/ophub/amlogic-s9xxx-armbian

Note: The kernel modules (Manjaro/ophub) are not needed to use u-boot, they
are just included in case someone wants to use u-root in more advanced ways.

initramfs-u-root*.img.gz
------------------------
The initramfs-*img.gz files are gzipped cpio archives of with code for a boot
loader which are built by me using the u-root code+framework from
https://github.com/u-root/u-root
Documentation about u-root can be found at the github repo and at
http://book.linuxboot.org
The different versions of initramfs-* contain builds with more or less of the
functions in u-root. The oldest version is initramfs-u-root.img.gz and the
newer versions are initramfs-u-root-*-v0.8.1.img.gz where the "all" version
includes everything of u-root. (Not all versions of u-root work well with all
versions of kernels, even recent ones; I have included two kernels.)

Disclaimer
==========

I put no restrictions on what you can do with the contents of this disk (and
virtually all the stuff here I have borrowed from others anyway, see above).
I hope that it can be useful and that others can take this proof-of-concept
and build on it and improve it, so please share this disk.
Also, use at your own risk (don't blame me if your box burns).

Reply Support Not support

Use magic Report

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
 Author| Post time 2022-06-02 20:31:25 | Show all posts
Edited by JFL at 2022-06-02 20:37
darkstar replied at 2022-06-02 13:57
Thank you JFL,

This is a nice work, I checked it and it is pretty useful.

Hi @darkstar,

The work is done by @tripole.  He suggested that I share it with Beelink users and hopefully, developer like yourself might pick it up and enhanced on it.

Per my understanding from @tripole, this is currently a proof of concept work but so far it works great on Fedora_36 Workstation UEFI image.  Hopefully in future with more contributions from the community this proof of concept work will flourish into something that allow GT King Pro/Amlogic Devices to be able to boot up any of the generic UEFI images.
Reply Support Not support

Use magic Report

5

Threads

160

Posts

908

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
908
Post time 2022-06-09 14:59:35 | Show all posts
Hi @jfl @darkstar

Wow great project, thanks @jfl for sharing.

Is it possible to have a boot menu to choose which system to boot on?
I have for example:
-Android on Emmc
-Coreelec on SD card
-Armbian on USB and SD Card

For the moment it is the sd card which has priority.
On Coreelec there is a command to restart the box under Android it works well.

On Android I use "reboot to libreelec.apk" it works fine too.

On the other hand, when I'm on Coreelec (SD card) and I want to restart my Armbian (SD card too) that's where the problems begin.. switching from one to the other is not easy and I often have to force several times the "reboot to libreelec" from Android after a while it works again and Armbian starts, but with Armbian there is no way to directly restart under Android.

The top would be to have at startup a menu to choose whether to boot on Emmc or on SD card or on USB.
This u-root seems to be able to allow this kind of menu..


Reply Support Not support

Use magic Report

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
 Author| Post time 2022-06-09 18:26:24 | Show all posts
gtkingpro.ac2n replied at 2022-06-09 14:59
Hi @jfl @darkstar

Wow great project, thanks @jfl for sharing.

At the moment this "u-root-bootdisk" was meant to allow users to be able to boot some "UEFI images" where it will not normally boot on GT King Pro or other Amlogic Device.  

With "u-root-bootdisk" on USB Flash, I don't seem to be able to see the Emmc.  You can try to burn the "u-root-bootdisk.img" on an SD Card in try.  I suppose u-root-bootdisk on SD Card might give better options especially for GT King Pro users.

I will refer your question to @tripole.
Reply Support Not support

Use magic Report

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
 Author| Post time 2022-06-09 22:52:39 | Show all posts
An updated version of the "u-root-bootdisk.img" had been released.  Please refer to the first post.
Reply Support Not support

Use magic Report

5

Threads

160

Posts

908

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
908
Post time 2022-06-10 00:29:52 | Show all posts
Thank @JFL
Looks promising, I'll give it a try on SD-card..
Reply Support Not support

Use magic Report

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
 Author| Post time 2022-06-11 20:01:53 | Show all posts
New version "u-root-bootdisk-nc.img.gz" available.  Non-Chainloader Version.

Faster boot speed and can boot from any of the GT King Pro USB Port.

Please refer to the first post.
Reply Support Not support

Use magic Report

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
 Author| Post time 2022-06-15 20:45:00 | Show all posts
Edited by JFL at 2022-06-17 21:16

Hi All,

Updated a new slim down version of Non-Chainloader "u-root-bootdisk-nc_0v21.img.gz" and added new link for Fedora Alternate Architecture for aarch64.  Please refer to the first post.


If you all had tried out other UEFI images that works with "u-root-bootdisk", do provide the link and your experience.

Reply Support Not support

Use magic Report

4

Threads

339

Posts

1194

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
1194
 Author| Post time 2022-06-18 23:03:13 | Show all posts
Hi All,

Updated the first post with a new link for repackaged Ubuntu-Kinetic Kudu.
Reply Support Not support

Use magic Report

You have to log in before you can reply Login | Sign up

Points Rules

Quick Reply To Top Return to the list