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

Search This thread

tokoam

Senior Member
Jun 24, 2007
930
167
Plantation
fyi, running a stock ota update on an unlocked bootloader DID NOT relock it. It did replace recovery, but that's to be expected. I guess it would be trivial enough for them to trigger a relock in any future update, but this one didn't do so, at least. I ran the unlock command again just to be sure and when it rebooted my apps were still installed, and I was able to reinstall custom recovery.
how do I install the ota update ? When I do it In Andriod Tv OS it it boots to recovery and tells me failed signature check . How do we install this update ? via posted link . Also I have a silly question when we flash the recovery does it still retain the stock recovery ? . I'm asking cause it looks as if it booted to the stock recovery .
 

npjohnson

Recognized Developer
how do I install the ota update ? When I do it In Andriod Tv OS it it boots to recovery and tells me failed signature check . How do we install this update ? via posted link . Also I have a silly question when we flash the recovery does it still retain the stock recovery ? . I'm asking cause it looks as if it booted to the stock recovery .
The update he linked is the stock OS - you'd need to install it from the stock recovery.
 
  • Like
Reactions: tokoam

hp420

Senior Member
Jul 31, 2011
2,573
1,431
Gainesville, Fl
Google Nexus 4
T-Mobile LG G2
fyi, running a stock ota update on an unlocked bootloader DID NOT relock it. It did replace recovery, but that's to be expected. I guess it would be trivial enough for them to trigger a relock in any future update, but this one didn't do so, at least. I ran the unlock command again just to be sure and when it rebooted my apps were still installed, and I was able to reinstall custom recovery.
It's also worth noting, the update i installed was a TRUE OTA update, not sideloaded. I don't know if that makes a difference or not 🤷 I'm using the factory rom and I was prompted to install an update via popup notification.
 

npjohnson

Recognized Developer
Thanks. Is it already save to compile from source? Should I use TheMuppets or your github for vendor?
The muppets, BUT you will need to pick a few commits:
And because it's dynamic you won't be able to flash Gapps until we calculate their size, you'd either need to bake them in or not use them.
 
Last edited:
  • Like
Reactions: kennkanniff

npjohnson

Recognized Developer
Has anyone been able to disable encryption (say, by flashing the disabler zip)?

You should be able to adb root && adb remount after enabling it in dev settings, then adb shell and edit /vendor/etc/fstab.amlogic to remove the encryption options, reboot, fastboot -w, and boot up.

But idk why you would - it won't make things faster.
 

p0werpl

Senior Member
Aug 30, 2021
68
8
Yes (without encryption). Some graphics issues (the display has weird colors and font), but it's functional.

About your suggestion to edit fstab.amlogic, aren't those partitions forced read-only? Have you been able to remount them rw?

Does wireless adb work in lineage? How?
 
  • Like
Reactions: hp420

p0werpl

Senior Member
Aug 30, 2021
68
8
Finally:
 

Attachments

  • twrp.jpg
    twrp.jpg
    146.7 KB · Views: 169

npjohnson

Recognized Developer
Yes (without encryption). Some graphics issues (the display has weird colors and font), but it's functional.

About your suggestion to edit fstab.amlogic, aren't those partitions forced read-only? Have you been able to remount them rw?

Does wireless adb work in lineage? How?
adb root && adb remount on lineage. on stock yeah, not possible. Nice! I can help with this if you want to add me to your TWRP device tree.

For colors it's pixel type, see the lineage tree.
 

p0werpl

Senior Member
Aug 30, 2021
68
8
adb root && adb remount on lineage. on stock yeah, not possible. Nice! I can help with this if you want to add me to your TWRP device tree.

For colors it's pixel type, see the lineage tree.
I will PM the device tree. I will warn you there isn't much there. I just had enough to build and be able to backup (unencrypted) data using twrp commandline.

The bigger challenge was expanding /vendor (and other individual partitions in /super). Since they are dynamically created from super.img, mounting them rw is only a small part of the challenge. There's no space in vendor.img to make any changes to fstab (even if it can be mounted rw).

So, the first step is to expand the sizes of the individual partitions and then repack them into a super.img. I used this: https://forum.xda-developers.com/t/script-android-10-universal-mount-system-read-write-r-w.4247311/. The issue here is that the script does everything on the device and there isn't enough space on /dev/block/data for the original super.img, the individual (vendor, system, product, and odm) partitions, and the repacked super.img. So, this will need a usb-c otg hub with a flash drive to store the original and repacked super images and only the intermediate files (individual partitions) will need to be stored on /data (for which there's enough space).

After this new super.img (with expanded vendor.img) is fastboot-flashed onto the device, one can remount /vendor rw and edit the fstab to delete the encryption flag. It's then a matter of doing a factory reset, setting everything up, and booting my dirty twrp to do a data backup in commandline.
 

Top Liked Posts

  • 1
    Good news, when should we expect?
    whenever it's ready - don't have an ETA.
    2
    - I noticed trying to change from charging to MTP (Media Transfer Protocol) always leads to crashing, but I need it on Linux(Fedora) in order to get permission in adb. (I do not receive an USB Debugging request on Linux somehow)
    Please use the search function, as the solutions to these issues have been posted before.

    disable USB debugging
    enable MTP
    enable USB debugging again

    It crashes because usb debug is enabled.

    ADB commands wont work unless you A) run the commands as root or B) setup udev rules for your device. After enabling MTP, non root can use ADB commands,

    Fastboot will still need to be run as root, unless you setup a udev rule for your device.
  • 3
    LineageOS 20.0 is coming for these devices, this thread will close once the builds are ready.

    Just as a heads up.
    2
    Thanks. I was just about to try it but the files aren't there anymore. The link loads but it says an error occurred.

    I'm not sure if an older unofficial version would work when the newer official version doesn't. It might be a problem with my device and not the lineage zip. I might have messed it up somehow with the huge amount of reflashing and resetting that I've done.
    new builds coming.
    2
    Searching 84 pages is daunting! Although I only needed to read page 1 and page 84.
    There are a few steps in the wiki linked on page 1 for Dopinger - Walmart Onn UHD Box that WOULD NOT WORK.
    On this page https://wiki.oddsolutions.us/devices/dopinder/install under Unlocking the Bootloader < Step 5. It states to enter this command

    fastboot oem 'setenv lock 10101000;save' && fastboot reboot bootloader && fastboot flashing unlock

    The only way I could get it to work was typing each command separately

    fastboot oem 'setenv lock 10101000;save'
    fastboot reboot bootloader
    fastboot flashing unlock


    Then under Flashing the dtb and dtbo partitions it has 2 links for the required files...and one link is DEAD! The real place to find those 2 files is INSIDE the LineageOS zip that you download (the OS Install file. It's over 700MB) kudos @XDA-DB

    Finally on Step 6 of Installing a Custom Recovery using fastboot. It states to type "fastboot reboot-recovery" but it never boots Recovery.
    Power cycling the device then puts it in a state with NO fastboot or adb connection!
    Unplug device. Hold button on device and slightly plug into PC until it powers on. When you see the Onn splash screen. Let go of button and fully plug in. You're now in Lineage Recovery that you installed. Again kudos @XDA-DB
    So, running them separately doesn't make much sense. `&&` says "run this after that if it succeeds" - this is on linux?

    DTB - ugh, I need to fix my upload scripts - will do

    reboot-recovery - fixing it.
    some special notes that could be added to the dopinder wiki as well.

    Fastboot needs to be run as root (or sudo / doas) on linux

    In order for dopinder to show up in adb, under developer options, set MPT on but turn off usb debug first or the stock OS crashes (does not occur under LOS). once MPT is enabled, re-enable usb debugging.

    Onn's booting into another mode when detecting data causes trouble for quite a few.

    And some advice for anyone looking to buy one of the devices: just buy a wade. dopinder has so many little issues (emmc burning out, overheating and freezing, the mtp slider crashing the OS, not booting recovery when connected to a pc). The only redeeming quality of dopinder is the remote (and the price).

    You don't need to give me credit for anything, jim. I don't help others for e-clout.
    Not everyone will read, not everyones native language is english, not everyone has the foundational knowledge. All we can do is try to make it as easy as possible. If those "who know" can offload the burden of the devs, they can focus on doing what they like to do best (unless you like herding cats then who am I to judge).
    fastboot - does not need root/sudo at all - it needs proper u-dev which is detailed on the wiki. You don't need to set MTP - ADB works just fine? I'm using it now.

    The half-plug thing is an interesting finding I will note the wiki - thanks.

    Wade is way better - can't agree more. IMO IR remote of wade is better even.

    Appreciate it.
    2
    No.
    Neither adb, nor fastboot.
    Using Windows 10 (but can try Linux).
    And no, device manager is not seeing the usb device.
    The last option is to open up the device and use a usb to serial to reflash it, I guess?
    This thread has 84 pages and at least a handful of people have had the exact same issue as you, with others posting the solutions. It also doesnt help most lineageOS install guides are incorrect and assume everyone knows about driver signing on windows 10+ or needing to run fastboot with elevated privs. Then there's the "i dont want to read 84 pages to find the answers already posted" and i don't blame people, who has time for that.

    Hold the button on the side of the device down, and plug the usb A male connector slowly into your PC until just the power pins make contact, then release the button. This will change how the device boots. After you do so, plug the usb A male connector fully into the port to allow a data connection. Your windows pc should make a "do doop" noise. Now see if you can get somewhere.

    For future reference for Anyone flashing their android devices (outside of samsung devices). Linux is much easier to do it from and most linux distros can boot to a live CD without needing to install. All functionality of downloading files from firefox and installing the adb fastboot tools are available without installing linux. Both Ubuntu & Mint (debian based) and EndeavourOS (arch based) work great for this.

    Google "Ventoy" for making a usb boot drive that you can use for multiple ISOs at the same time. You can partition space to allow a "permanent" storage area for said ISOs to write downloaded files to when booted into the live environments.
    2
    FYI - Anyone with a dynalink 4K that gets bricked, this is the full steps I took to unbrick it. Special thanks to npjohnson for letting be bug him with various technical questions out of the blue!



    =====================
    How to unbrick dynalink 4k if stuck at dynalink logo:
    =====================

    Assumptions made:
    - You're on ubuntu
    - All scripts run as root (sudo -iu root)
    - You can see your amlogic device listed running lsusb (also as root!)

    1. power off unit by unplugging
    2. plug unit back in to a computer while holding side button
    3. download and install https://github.com/khadas/utils/tree/master/aml-flash-tool/tools/linux-x86 on ubuntu
    4. go to the path of /home/your-user-name-here/Downloads/utils-master/aml-flash-tool/tools/linux-x86/ in a terminal window,
    5. run these cmds. you can get these files from the official lineageos page if you dont have them already.

    Note: you need to go to your own username, and of course in the future a different date will be on the recovery file, make sure to copy the file name from your specific dtb file.

    Bash:
    ./update partition dtbo /home/bryantdl7/Downloads/dtbo.img
    ./update partition _aml_dtb /home/bryantdl7/Downloads/lineage-19.1-20221024-dtb-wade.img
    ./update partition recovery /home/bryantdl7/Downloads/lineage-19.1-20221120-recovery-wade.img
    ./update bulkcmd fastboot

    6. verify you are in fastboot by doing:
    Bash:
    fastboot devices
    , it should display a device in fastboot.
    7. run
    Bash:
    fastboot reboot bootloader
    as a sanity check, sometimes it half loaded for me.
    8. download the factory images via OP's post
    9. run the flash all script inside the factory image.
    10. You are unbricked!
  • 27
    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 Official 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:

    Official Builds:

    Disclaimer: My unofficial builds have full Android TV Google Apps and some other goodies included. OTA's roll roughly once a month. Support not guaranteed or implied.

    Unofficial Builds:
    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:
    EDIT: The development boards don't boot on LineageOS 19.1 at the moment for some reason, we're looking into it.

    If you don't follow these instructions, or use 3rd party add-ons (like Magisk) please don't expect support here.

    Known Bugs:
    • Recent apps/Multitasking menu doesn't launch.
    • (sabrina only) The remote firmware sometimes gets hung up, you can reboot to solve this issue.
    • (dopinder/sabrina) L1 is currently broken, this is what is holding up official builds for these devices.
    Notes:
    • GApps are baked in on Unofficial builds - 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.
    • 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.
    • On the unofficial OTA is provided the same way officials would have them.
    • Find any more on an official build? Report them according to this guide.
    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! Play Store has it for you. Unless you're on dopinder or sabrina, but that will be fixed soon hopefully.

    • 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?

      Maybe - the only sure fire way it Magisk, as our boot loader is unlocked and can't be relocked safely.

    • 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
    • bgcngm
    • stricted
    • webgeek1234
    • deadman96385
    • trautamaki
    • luca020400
    • aleasto
    14
    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!
    7
    deadpool an wade are official again, hopefully we got it all right this time around.

    onto dopinder and Sabrina. Hoping to get those shipped soon.
    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.
    6
    wade and deadpool are official now!