[Guide][SM-T500] Galaxy Tab A7 10.4 - Flash LineageOS or any other GSI rom.

Search This thread

Tirofog

Senior Member
Dec 6, 2011
452
122
Unable to resize logical system partition in adb, I get this:

mount /dev/block/bootdevice/by-name/system /system_root
mount: /dev/block/bootdevice/by-name/system: need -t


This wasn't happening previously, tried flashed stock firmware but no luck.
 

paziusss

Senior Member
Jan 3, 2014
58
96
Unable to resize logical system partition in adb, I get this:

mount /dev/block/bootdevice/by-name/system /system_root
mount: /dev/block/bootdevice/by-name/system: need -t


This wasn't happening previously, tried flashed stock firmware but no luck.
That's because you flashed a non vndklite variant, with ext4 shared blocks.

You have two options:

1. Use the vndklite, already rw
2. Use a ro variant and unshare blocks. You can follow https://github.com/phhusson/sas-creator/blob/master/securize.sh as a template. You will need simg2img to convert the sparse image into an ext image before mounting/resizing/modifying system.img and img2simg before flashing that image with fastboot
 
  • Like
Reactions: Tirofog

Tirofog

Senior Member
Dec 6, 2011
452
122
That's because you flashed a non vndklite variant, with ext4 shared blocks.

You have two options:

1. Use the vndklite, already rw
2. Use a ro variant and unshare blocks. You can follow https://github.com/phhusson/sas-creator/blob/master/securize.sh as a template. You will need simg2img to convert the sparse image into an ext image before mounting/resizing/modifying system.img and img2simg before flashing that image with fastboot
Thank you..
I've tried a few GSI's but experienced freezing in Chrome, XDA and other apps, making the tablet almost unusable.. pity.
 

paziusss

Senior Member
Jan 3, 2014
58
96
Someone please corrent me if I am wrong, but I think the stock kernel needs to have Halium patches applied to it for UbPorts to work. I am not sure what exactly is involved in doing this, but I believe that it is possible. Though that does not mean it will not have bugs without major work being done beyond patching the kernel.

AFAICT just need defconfig changes in order to boot sucesfully. Keep in mind that "succesful boot" means a ssh shell over USB: https://docs.ubports.com/en/latest/porting/build_and_boot/Boot_debug.html

Currently it fails to mount vendor partition, so debugging ends there. The required change was already merged a couple of months ago, in https://gitlab.com/ubports/core/rootfs-builder-debos/-/merge_requests/61 but it is currently unavailable in their CI images.

So we need to wait a bit until ubports/halium is ready for a11. Unless somebody wants to tackle the task of building the entire thing from source.
 
These are instructions to flash LineageOS 18.1 GSI builds on our SM-T500. The same instructions should work for any other GSI rom out there.

Some instructions here, like flashing an empty product.img and resizing system partition, are not necessary if you want to flash a rom that fits in system and bundles gapps with it.

Prerequisites:

* SM-T500 with BUJ1 FW
* Unlocked bootloader
* Verified Boot disabled
* TWRP installed
* fastboot and adb installed on your computer.


Step 1: boot to fastboot.

Boot in TWRP and press "reboot" -> "fastboot". Wait until the tablet reboots and, after a few seconds, check that you can see your device with
Code:
fastboot devices

Now flash product.img and system.img and resize system image to the entire available size of the super partition:

Code:
fastboot flash product product.img
fastboot erase system
fastboot flash system lineage-18.1-20211214-UNOFFICIAL-treble_arm64_bvS-vndklite.img
fastboot resize-logical-partition system 3940000000
fastboot reboot recovery
Where do you find lineage-18.1-20211214-UNOFFICIAL-treble_arm64_bvS-vndklite.img
 

Juppy99

Member
Nov 10, 2016
15
7
AFAICT just need defconfig changes in order to boot sucesfully. Keep in mind that "succesful boot" means a ssh shell over USB: https://docs.ubports.com/en/latest/porting/build_and_boot/Boot_debug.html

Currently it fails to mount vendor partition, so debugging ends there. The required change was already merged a couple of months ago, in https://gitlab.com/ubports/core/rootfs-builder-debos/-/merge_requests/61 but it is currently unavailable in their CI images.

So we need to wait a bit until ubports/halium is ready for a11. Unless somebody wants to tackle the task of building the entire thing from source.
aww sucks to hear, would be nice to try ubports or halium. Maybe sometime in the future
 

skills10

Senior Member
Jun 24, 2010
74
9
Liverpool
this worked spot on thanks alot dude apart from brightness? now running lineage OS 19 on my tablet
 
Last edited:

skills10

Senior Member
Jun 24, 2010
74
9
Liverpool
no mate, i installed micro G via magisk, i also flashed the brightness fix but based on what ive read afterwards it needs updating
 
For anyone who is struggling to get microG work with the Magisk module, try to install MinMicroG through TWRP instead.
Before you do though, format data. Also, add "system-" in front of "MinMicroG....zip" so it looks like "system-MinMicroG....zip".
Then just follow the steps in OP's guide for installing GApps (Instead of GApps flash MinMicroG in TWRP). 😄
 
  • Like
Reactions: skills10

DJ_BARO

Senior Member
Sep 9, 2014
120
28
Mainz
Great effort and work, thank you very much!

Unfortunately, Pixel Experience Android 12 in the vndkite AB ARM 64 Variante wont boot up, even with the kernel fix.

Somebody made any expierences to solve this?

EDIT: Tested Lineage 19 GSI:

It runs already quite good: But 2 major things unfortunately:

1. Brightness not working, also after the fix
2. weird issue with magisk: Abnormal State An "su" command that does no belong to Magisk is detected. Please remove the other unsupported su.
3. Device not certified for google play (i guess thats easy to fix)

And ideas? I would very likely to keep it as otherwise it seems to be much smoother than bloaty stock rom...
 
Last edited:
Great effort and work, thank you very much!

Unfortunately, Pixel Experience Android 12 in the vndkite AB ARM 64 Variante wont boot up, even with the kernel fix.

Somebody made any expierences to solve this?

EDIT: Tested Lineage 19 GSI:

It runs already quite good: But 2 major things unfortunately:

1. Brightness not working, also after the fix
2. weird issue with magisk: Abnormal State An "su" command that does no belong to Magisk is detected. Please remove the other unsupported su.
3. Device not certified for google play (i guess thats easy to fix)

And ideas? I would very likely to keep it as otherwise it seems to be much smoother than bloaty stock rom...
For the brightness, use the one from this thread: https://forum.xda-developers.com/t/...laxy-tab-a7-10-4-2020-lineageos-18-1.4295985/
Follow author's steps to install them.

You can ignore the Abnormal State in Magisk.
 

DJ_BARO

Senior Member
Sep 9, 2014
120
28
Mainz
Hmm, did you install the VNDKLITE variant of Lineage?
Yeah i did. But i also got weird issue after the installation of the IMG File:
Like when i type fastboot resize, it would instead show me the help section of the fastboot command.

And when i go further to mount or unmount and even typring adb shell, it would say on terminal on the recovery "inaccesialbe or not found". On PC adb shell command works but then following problems occur.
any further steps it would get an error like "no such directory found"
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    These are instructions to flash LineageOS 18.1 GSI builds on our SM-T500. The same instructions should work for any other GSI rom out there.

    Some instructions here, like flashing an empty product.img and resizing system partition, are not necessary if you want to flash a rom that fits in system and bundles gapps with it.

    Prerequisites:

    * SM-T500 with BUJ1 FW
    * Unlocked bootloader
    * Verified Boot disabled
    * TWRP installed
    * fastboot and adb installed on your computer.


    Step 1: boot to fastboot.

    Boot in TWRP and press "reboot" -> "fastboot". Wait until the tablet reboots and, after a few seconds, check that you can see your device with
    Code:
    fastboot devices

    Now flash product.img and system.img and resize system image to the entire available size of the super partition:

    Code:
    fastboot flash product product.img
    fastboot erase system
    fastboot flash system lineage-18.1-20211214-UNOFFICIAL-treble_arm64_bvS-vndklite.img
    fastboot resize-logical-partition system 3940000000
    fastboot reboot recovery

    Step 2: back in recovery

    We need to resize the logical system partition to take up all the space we asigned to it. That's only mandatory if you want to flash gapps later on. If your rom comes with gapps bundled you don't need to do this.

    Code:
    adb shell
    mount /dev/block/bootdevice/by-name/system /system_root
    umount /system_root
    e2fsck -f /dev/block/bootdevice/by-name/system
    resize2fs /dev/block/bootdevice/by-name/system 961915

    Step 3: finish it :)

    Now you need to go to "wipe" -> "format data" and confirm. After that you can flash gapps if you want. You must use MindTheGapps arm64 version.

    If you choose to flash gapps you'll need to follow https://github.com/phhusson/treble_experimentations/wiki/Frequently-Asked-Questions-(FAQ)#how-to-bypass-certified-device-after-first-boot

    Some stuff won't work out of the box (brightness, MTP, bluetooth or wired audio). Please see the next post to learn how to workaround these issues.
    2
    Known issues (and workarounds)

    1. MTP doesn't work


    You need to flash SM-T500-GSI-kernel.zip from TWRP. Do it only once unless you reverted back to stock boot.img.

    2. The rom I've flashed (mostly PixelExperience) reboots after a few seconds/minutes

    You need to flash SM-T500-GSI-kernel.zip from TWRP. Do it only once unless you reverted back to stock boot.img.

    3. Brightness doesn't work

    You need to flash SM-T500-GSI-brightness-fix.zip from TWRP. You need to repeat this again after flashing a new system.img with the same or different rom.

    4. Audio doesn't work via bluetooth/jack headphones.

    Follow the AUDIO FIX section of https://forum.xda-developers.com/t/...s-nairo-and-some-post-install-tweaks.4364963/, as suggested by @wesleyvanneck12345678


    * kernel sources: https://github.com/pazos/android_kernel_samsung_gta4lwifi/
    2
    FAQ

    Q: Which GSI variant should I choose?
    A: arm64 ab. Use the vndklite variant if you want to flash gapps or fix the brightness.

    Q: Do I need to format data after flashing a different ROM?
    A: YES

    Q:
    Do I need to format data after flashing a different version of the same ROM?
    A: Most likely YES, but you can try without formatting and see if it boots.

    Q: Do gapps survive rom changes (diffent versions of the same rom or different roms)?
    A: NOPE. You need to flash them again.

    Q:
    Do GSI roms work with Magisk?
    A: They should if they're based on PHH builds and are up-to-date.

    Q: How to bypass SafetyNet?
    A: I don't know, I don't care.
    1
    USE TWRP 3.6 from
    You need a recent version of fastboot too. Get one :)
    1
    I would like to point out that my system_root partition is /dev/block/dm-1 and not /dev/block/dm-0

    Thanks!! Never thought about it :p. Fixed!