[UNOFFICIAL] LineageOS 19.1 for Amlogic G12*/SM1 Family Devices

Search This thread

Eliminater74

Recognized Developer
I have had many people sending me messages asking for this scrip, I never heard back from @npjohnson as to the okey to posting this, so I will just post this, if he has an issue, I will delete it.. for now here is the zip..

I am not one to write instructions and so on. I only wrote a quick one. Please be smart and view the bat file before you run it. Never just take anyones word for it.. View the files before you run them.

This is not a quick fix everything for you peepz, its only to allow going back in forth a bit easier on you.
if you have no clue what worldcup or should I say USB Burn mode is, then this is prob not for you.
matter of fact I would say the whole project would prob be a bit to advanced for you.

I am sorta moving on from this, bought a Khadas Vim 3 Pro board. Which Google fully supports, and I am going to tinker with that, the Raspberry PI 4 just bored me. But I am willing to help here if I can.

Hope all continues to go well for the OP.. Its people like him that you all have options like this.

Take care..
 

Attachments

  • backup&restore_askey_adt3-20220127.zip
    20.3 MB · Views: 112
  • Like
Reactions: goapy and Sigster

goapy

Senior Member
Dec 30, 2021
119
25
... here is the zip..

Thanks! It's too bad that usb burning mode is increasingly being disabled in new model devices. The askey ASK-STI6220 (S905X4) doesn't have it. The uboot menu is missing "update - Enter v2 usbburning mode". They've replaced it with a distinct version of fastboot (different than bootloader fastboot and fastbootd). Even masking the rom brings up only this mini version of fastboot. And it is no where near as capable as usb burning mode.
 
Last edited:

Eliminater74

Recognized Developer
Thanks! It's too bad that usb burning mode is increasingly being disabled in new model devices. The askey ASK-STI6220 (S905X4) doesn't have it. The uboot menu is missing "update - Enter v2 usbburning mode". They've replaced it with a distinct version of fastboot (different than bootloader fastboot and fastbootd). Even masking the rom brings up only this mini version of fastboot. And it is no where near as capable as usb burning mode.
get your self a Khadas VIM3 Basic/Pro if you wanna play around with all that.. Google's source code officially supports it. I have already built 4 roms with only uses googles source.. but tell you the truth, I think that same device tree can be modified to work for other amlogic g12 boards..

BTW: dif beterrn the Basic and Pro are 2/16 and 4/32 both DDR4 Ram..

Not trying to Hijack thread.. because I just think with the release of all that as well with this could make something work better.
 

ojai0217

New member
Jan 28, 2022
2
0
Hi guys, I'm trying to build for the dopinder myself. After couple tweaks (e.g. fixing some paths of proprietary blobs), I got the final zip built without any failures. However, the installation of the new zip via recovery is failing with the following error:

Code:
assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))

What I noticed that the size of the zip I built is almost half size of the original working version. (390MB vs 690M). Comparing side by side on the contents of zips, I see that my build is missing 'bootloader.img' and the huge difference on the size of 'product.new.data.br' (60MB vs 337MB).

I believe that I've followed all the steps according to this. Any hints or advices?

Another question: How do I get a write access on /sys/devices/virtual/? I'm trying to create some files especially under android_usb to enable accessory mode for dopinder. Even magisk's su wont' give me enough permission. It seems to be something with dm-verity which I might need to disable by building the rom myself?
 

npjohnson

Recognized Developer
Hi guys, I'm trying to build for the dopinder myself. After couple tweaks (e.g. fixing some paths of proprietary blobs), I got the final zip built without any failures. However, the installation of the new zip via recovery is failing with the following error:

Code:
assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))

What I noticed that the size of the zip I built is almost half size of the original working version. (390MB vs 690M). Comparing side by side on the contents of zips, I see that my build is missing 'bootloader.img' and the huge difference on the size of 'product.new.data.br' (60MB vs 337MB).

I believe that I've followed all the steps according to this. Any hints or advices?

Another question: How do I get a write access on /sys/devices/virtual/? I'm trying to create some files especially under android_usb to enable accessory mode for dopinder. Even magisk's su wont' give me enough permission. It seems to be something with dm-verity which I might need to disable by building the rom myself?
prop files should need no updates - you need to extract them from the deadpool r build, or an existing lineageos build, preferably existing lineageos build.

It's half the size because I build GApps in ;p you won't have that.

Bootloader.img just needs to be the same one from in the lineage package I give out, so as long as you flash that once, you're fine.

as for files on /sys - uh, that's not normally something one does? They should be made by init or the kernel.
 

ojai0217

New member
Jan 28, 2022
2
0
prop files should need no updates - you need to extract them from the deadpool r build, or an existing lineageos build, preferably existing lineageos build.

It's half the size because I build GApps in ;p you won't have that.

Bootloader.img just needs to be the same one from in the lineage package I give out, so as long as you flash that once, you're fine.

as for files on /sys - uh, that's not normally something one does? They should be made by init or the kernel.

Thanks. So, my build is OK, and I need to figure out why it doesn't get installed somehow...

For prop files, I used the onn device running the latest lineage to extract those. However, the following files were unable to be extracted.
Code:
    !! odm/etc/firmware/firmware.le: file not found in source
    !! odm/usr/idc/Vendor_000d_Product_3838.idc: file not found in source
    !! odm/usr/idc/Vendor_000d_Product_3839.idc: file not found in source
    !! odm/usr/keylayout/Vendor_000d_Product_3838.kl: file not found in source
    !! odm/usr/keylayout/Vendor_000d_Product_3839.kl: file not found in source
    !! odm/usr/keylayout/Vendor_7545_Product_0021.kl: file not found in source

    !! system/etc/audio_effects.conf: file not found in source
    !! system/etc/permissions/privapp-permissions-atv-lineage.xml: file not found in source
    !! system/etc/permissions/privapp-permissions-google-lineage.xml: file not found in source
    !! system/lib/hw/screen_source.amlogic.so: file not found in source
    !! system/lib/libmediahal_resman.system.so: file not found in source
    !! system/lib/libmediahal_tsplayer.system.so: file not found in source
    !! system/lib/libmediahal_videodec.system.so: file not found in source
The problem is that the extract util is appending /system prefix to those paths, and found out that there is no symbolic link for odm under /system in the device. Obviously, it also tries to look for /system/system/... which is invalid path.

BTW, for /sys to access usb driver, as per your comment, I sort of expected to be tweaking init and kernel anyway once I got the good-to-go builds.
 

npjohnson

Recognized Developer
Thanks. So, my build is OK, and I need to figure out why it doesn't get installed somehow...

For prop files, I used the onn device running the latest lineage to extract those. However, the following files were unable to be extracted.
Code:
    !! odm/etc/firmware/firmware.le: file not found in source
    !! odm/usr/idc/Vendor_000d_Product_3838.idc: file not found in source
    !! odm/usr/idc/Vendor_000d_Product_3839.idc: file not found in source
    !! odm/usr/keylayout/Vendor_000d_Product_3838.kl: file not found in source
    !! odm/usr/keylayout/Vendor_000d_Product_3839.kl: file not found in source
    !! odm/usr/keylayout/Vendor_7545_Product_0021.kl: file not found in source

    !! system/etc/audio_effects.conf: file not found in source
    !! system/etc/permissions/privapp-permissions-atv-lineage.xml: file not found in source
    !! system/etc/permissions/privapp-permissions-google-lineage.xml: file not found in source
    !! system/lib/hw/screen_source.amlogic.so: file not found in source
    !! system/lib/libmediahal_resman.system.so: file not found in source
    !! system/lib/libmediahal_tsplayer.system.so: file not found in source
    !! system/lib/libmediahal_videodec.system.so: file not found in source
The problem is that the extract util is appending /system prefix to those paths, and found out that there is no symbolic link for odm under /system in the device. Obviously, it also tries to look for /system/system/... which is invalid path.

BTW, for /sys to access usb driver, as per your comment, I sort of expected to be tweaking init and kernel anyway once I got the good-to-go builds.
Yeah you can't extract from a running build, I need to fix that guide, you need to extract it from a pre-built zip
 

glenb77

Senior Member
Oct 15, 2011
83
19
Thanks for developing this. On an onn. I managed to get the rom installed, but had many problems, the adb kept dropping out after different steps in the wiki. The bootloader did unlock though and the box had updated prior. Running the rom i had several issues and reverted to stock. I had no issue just going step by step from the flash-all.sh. i am in linux and needed those commands one by one and the commands prefaced by 'sudo'. I don't use the name apps, netflix etc. my main use is for mythtv as 'frontend'. most of the content is mpeg2 interlaced (over the air broadcasts), and the deinterlacing was really bad. on the stock it's perfect. so i thought i'd let you know. also at points the rom was sluggish in responding to input. Thank you for you efforts, I hope to be able to try again soon!
 

BlacKn1ght

Member
Apr 19, 2016
6
0
In the process of trying to update to a new system and recovery build, I think my dopinder is stuck at the bootloader screen (androidtv logo)? Is there any way that I can put it back in a flashable state? fastboot and adb both don't see any device, and I don't know which amlogic tool to use, if any. I'm on linux, but I also have windows.
 
Last edited:

Big Dumb Object

Senior Member
May 22, 2020
59
22
I have a few ideas to try once home from holidays.

I'm hoping 12 just fixes it, but I bricked my Deadpool hard. So. Limited atm. Lol
It seems that after another month, the last hope for fixing OMX is Android 12, isn't it? Haven't you experimented with it already? (Asking just because unofficial LOS19 builds are starting to appear all around.)
 

npjohnson

Recognized Developer
Maybe there is some not-so-elegant way, that although will shut the door to official status, but in return will make things work as they should? I think, a multimedia device without hardware codecs is like a car without seats - it rides of course, but who cares...
There's not even a non-elegant way, we have no clue why it doesn't work
 

BlacKn1ght

Member
Apr 19, 2016
6
0
In the process of trying to update to a new system and recovery build, I think my dopinder is stuck at the bootloader screen (androidtv logo)? Is there any way that I can put it back in a flashable state? fastboot and adb both don't see any device, and I don't know which amlogic tool to use, if any. I'm on linux, but I also have windows.
Anyone have any suggestions for this? I know it's not bricked at the very least 😅
 

npjohnson

Recognized Developer

Top Liked Posts

  • 1
    Can anyone tell if the discussed devices have any problems with chargers more powerful than recommended 1000mA?
    The power supply for dopinder is piece of garbage, but nowadays it's not too easy to find a high-quality replacement with equal power, so I would like to power it with 2.4A, but still afraid to burn something.
    Not sure why nobody replied to this. It's completely safe. Your device will downregulate it's charge to match what it was designed to accept.
  • 3
    I was somewhat puzzled when occasionally checked this thread I almost gave up and didn't find the familiar mention of a broken OMX in the description, then found this post of yours and... Wow... Looks like a tiny revolution for Android development on Amlogic. How did you manage to do that?
    I missed one line in the kernel cmdline when I first brought these devices up to 12! Lol.

    On 11 it was legitimately broken, but on 12, all I needed was:

    use_uvm=1.

    That was it.
    3
    19.1 on dopinder is broken - rest of devices are fine.

    We know why. We know how to fix it.

    I will fix it as soon as I'm able. Noted in OP it's broken.
    2
    I missed one line in the kernel cmdline when I first brought these devices up to 12! Lol.
    That is so much... like myself 🙃

    Glad I failed to sell my four Onns purchased solely for the sake of LineageOS. Thank you for not dropping this project!
    2
    Yes! It boots to OS (I also observed that slight flicker you talked about). What steps should I follow to get back to factory unlocked? Can I just boot to fastboot from OS now?
    Just follow the usual procedure with the original exploit. Before you do any of that, however, overwrite the incompatible recovery with something that works. If you have root access, you can dd the correct recovery.img before trying anything else.

    You should be able to reboot to bootloader (not fastboot), after which you should be able to fastboot flash recovery with the correct recovery.img (assuming you weren't able to dd as above).
    2
    If you're stuck in a recovery bootloop, it's usually the result of writing an incompatible recovery image to the recovery partition. You will not be able to reboot into fastboot because that's conditional on having a working recovery. If this is your issue, you might be able to escape the bootloop by remapping recovery (temporarily) to boot normally.

    Does the led ever turn white? If it's blinking green, can you print out (via uart) what's going on?

    Try the attached file (overwrite sabrina.bootloader.bin in the original exploit package) and post your results here.
  • 19
    lineage-os-logo.png

    Amlogic G12*/SM1 Family Devices
    Code:
    - Your warranty is now void.
    - You have been warned.
    - Use at your own risk.

    Introduction:
    This is the Unofficial Lineage OS 19.1 thread for the Amlogic G12*/SM1 SoC family of devices.

    Downloads:
    Please follow the install instructions in your device's Wiki page linked below exactly, and make sure your device's firmware matches the required firmware listed:
    • deadpool - Google ADT-3
    • dopinder - Walmart Onn UHD Box - Broken at the moment - fixing it.
    • sabrina - Chromecast with Google TV
    • wade - Walmart Dynalink 4K Box
    We also support a few development boards, but at least (for now, until we have time to write up instructions), you're on your own to figure out the install process and set things up:
    If you don't follow these instructions, or use 3rd party add-ons (like Magisk) please don't expect support here.

    Known Bugs:
    • SELinux is permissive, this is only due to a lack of time to put together a decent looking sepolicy for these devices.
    • (sabrina only) The remote firmware sometimes gets hung up, you can reboot to solve this issue.
    Notes:
    • GApps are baked in - No, I will not be building without GApps included for this device. These builds are built, packaged, and signed by me, and not affiliated with LineageOS whatsoever.
    • OTA is provided the same way officials would have them.
    • Firmware is shipped in the ROM package for this device, so you'll end up on the newest version of compatible firmware after install. Please don't touch firmware partitions after install.
    FAQ:
    • Does L1 Widevine DRM break when I unlock my bootloader?

      Nope, it works fine. L1 certificates, and the mechanism that reports is all still exist and work as expected.

    • Can I haz Netflix?

      Yup, but only if your devices stock build supports it.

    • Is this Android TV or Google TV?

      Android TV, with some of the better components of Google TV.

    • Can I go back to stock and relock the bootloader?

      Yeah, grab the factory image for your device and flash it just like you would for a Pixel device, you can find the factory images here. Don't know it I'd relock though, consider that process largely untested on these device. Especially on sabrina, where you can't necessarily re-unlock should you ever want to.

    • Are these the stock codenames for these devices?

      Astute observation, no, they are not. The ADT-3 is actaully `adt3`, but earlier in production is was `deadpool`, which is much cooler. The Dynalink box internally is extremely similar to the ADT-3, so we coined it `wade` after Wade Wilson, AKA deadpool. The Onn box is in the same family, but different enough to coin it `dopinder`, after, well, go watch Deadpool the movie I guess. sabrina is actually the codename given by Google - no clue as to the reason.

    • Does it pass SafetyNet?

      Nope, SELinux is permissive, among other things. You can probably use Magisk if you really need that, but the good news is, 99% of Android TV apps don't care about SafetyNet, unlike on mobile, where a lot of them do. It will likely pass after we finish enforcing SELinux, though.

    • Does the stock remote work?

      Yup, just like it would on stock, in-remote-microphone and all! If it's an IR remote like wade's, it will even work in recovery!

    • Can we we support higher resolution than 4K, higher FPS, or HDR on non-certified screens?

      Nope.

    • I have a very similar device! Can I install these builds and use them?

      No. Please don't do that. You will brick your device, as we include firmware and bootloader images.

      If you're a developer looking to help port to a new device, contact me.

    Kernel Source: https://github.com/LineageOS/android_kernel_amlogic_linux-4.9

    Contributors:
    • npjohnson
    • stricted
    • webgeek1234
    • deadman96385
    • trautamaki
    • luca020400
    • aleasto
    • bgcngm
    12
    Yeah, you used the stock recovery. You need to fastboot flash, then fastboot boot recovery, I'll update the docs.

    For dopinder, it's needed right now.

    Found a procedure for dopinder without the need for keyboard/OTG.

    The docs under "Installing a custom recovery using fastboot" state to use "adb reboot fastboot" which doesn't work for booting recovery, needed to do "adb reboot bootloader" instead.

    Full command log (after unlocking bootloader and re-enabling USB debugging) of the install process with just a regular Micro USB to USB A cable:
    Code:
    adb reboot bootloader
    fastboot flash recovery lineage-18.1-20210805-recovery-dopinder.img
    fastboot boot lineage-18.1-20210805-recovery-dopinder.img
    adb reboot sideload
    adb sideload lineage-18.1-20210805-UNOFFICIAL-dopinder.zip
    # if successful then load bootloader and factory reset
    adb reboot bootloader
    fastboot -w
    fastboot reboot

    Successfully booted to LineageOS after this!
    6
    Note:

    Since the Lineage Android TV Builds for this little box (aka Boxes), are stable for the most part, but seems
    people are bouncing back in forth from Stock to Lineage and back to stock.

    I created a batch file that will auto flash the stock images and wipe data and so on.. pretty much it will
    make your box as it was when you first booted it after taking it home to try it.

    2nd, I also created a batch file that will backup current images.. No need for a fancy recovery or anything like the
    such. it will use the worldcup or what I like to say, USB Burn mode, and backup each and every partition.
    as well as some not so much needed ones like, misc and metadata. (Just for giggles)..

    backups will be copied to backup dir, I also created a separate batch file to restore your backup.


    I am one that hates doing things the long way over and over, so I always create ways to make things simple
    in the future for people.

    This way, you all can test your hearts out all the new lineages and still have your full Stock backup (including data).
    and restore back in forth as you wish.

    I will upload the backup_restore zip package as soon as I can and with @npjohnson permission I will link
    in thread. Otherwise you will have to just DM/PM me and ill link you the location.

    I am just trying to help the many that I seen complain and dont understand how to go back in forth.
    so with this script, it should take care of most on that. No Fancy Recovery needed...

    you will need worldcup driver for Amlogic........ you can find that on your own.

    Also, to get into USB Burn mode, press side button while plugging in USB cable.
    Keep pressing till you see the LOGO or hear the sound from your computer.

    then just run the batch file and wait..

    if its easier for you:

    Run the batch file, it will keep saying waiting for device..
    Just press the side button while plugging in USB, when you see it start, then release button...........
    and wait till finished..

    Only TESTED On Dopinder Boxes, but im sure they are all the same as for the partition layouts.
    5
    I ultimately settled on 1126400000, gives ~1.1GB to the system and accommodates the app adjustments I've been making for my builds without tripping OpenGApps' space check for TV stock
    this ended up being _wayyyyy_ to much, as this is the full value of the partition vs just the space to reserve, both will work, but we want to split it amongst partitions. One of our guys recalculated it and got it working.

    Should be good to build now from breakfast/extract-files (or syncing the muppets).

    Only thing left is hardware OMX. Hopefully we can figure it out!
    4
    It's been a month and a half since we discussed the possibility of the tablet-flavored (non-TV) release. It seems that the number of complaints has decreased and the basic quality of builds has improved enough to bother you again in this regard: are there any positive changes in this direction, or it is not worth expecting to get a full-featured Android on dopinder? (I'm still following this thread carefully to make a buying decision.)
    Eh, soon, sure.

    I'll look into making a buildable target