Samsung Galaxy Tab 2 7.0" (samsung-espresso7)

Contributors

 * Mighty
 * AAT596 (testing in espressowifi variant)

How to enter flash mode

 * Press +  to enter download/odin mode.
 * Press +  to enter recovery.

Installation
follow the general pmbootstrap instructions to build your own.

Prerequisites: TWRP installed on the Tab, see the LineageOS wiki for instructions: espressowifi, use the espresso3g TWRP image if you have the espresso3g tablet.

Make sure to backup your data and store this somewhere safe if you care about the stock OS and/or your files!

Run pmbootstrap init and configure your installation. Flashing the image to the device is in 2 parts; the rootfs and the kernel. If this installation process does not go well for you, please try the alternative installation instead.

rootfs
There are 2 ways to go about installing the rootfs, depending on where you want to install it to.
 * For an sdcard use:

Make sure to specify the mountpoint of the sdcard plugged into your computer.


 * For installing on the internal filesystem use TWRP

By default this will install on the (fairly limited) 1GB /system partition.

To specify a different partion (for example the 8/16 GB /data partition), add  to the first line.


 * For installing on the internal /data partition use:

When asked, boot your device into TWRP, wipe cache and your partion. Then go into advanced and start sideload mode, wait for this to finish.

kernel
After the rootfs is installed, insert the SDcard (if you used this) and boot the device into download mode. run This will flash the kernel to the device and reboot it. If you land in TWRP, just go to reboot and click system. It might complain about missing an OS, but do not worry! You should see some tuxes and be dropped in the OS!

Alternative install
In your PC, type these commands to generate and export the flashable installation (defaults flashing to /system partition), please see this section for more details:

use Community pre-built image
works running from a SD card

as explained in Installation - Flashing - From SD Card Our device can boot SD card, USB stick or other external storage.

preparation in a way to easily switch between Android_OS and PostmarketOS
from your actual Android_OS install file (AP_Stock_Samsung_Firmware.tar.md5 or Custom_Android_Based_OS.zip), extract the boot.img and copy it to your TWRP folder in internal storage (/sdcard/TWRP)

Download the pmOS pre-built image
from the download page

insert a MicroSDcard into your Computer
and find its name by running

$ lsblk

make sure it is the right one as you will overwrite everything on it. Use a path without partition number at the end,

such as /dev/mmcblk0, or /dev/sdd

decompress the downloaded file and write it to your MicroSDcard :
$ xz --decompress --stdout path-to-pmos-samsung-espresso7.img.xz | sudo dd of=/dev/name-of-your-SDcard bs=4M status=progress

Wait until the command completes and eject the SD card.

insert the MicroSDcard into your device, and boot it into TWRP
using the mount feature, unselect all /partitions except "MicroSDcard",

using the install feature, switch to "install image" rather than "install ZIP"

navigate to the "/external_sd/boot.img", and flash it to the /boot partition

reboot system
The rootfs image will boot right into postmarketOS. You are done with installing postmarketOS, congratulations! default login is user and password is 147147

to restore your Android_OS
boot the device into TWRP mode,

and simply using the install feature, switch to "install image" rather than "install ZIP"

navigate to the previously stored "/sdcard/TWRP/boot.img", and flash it to the /boot partition

to restore your PostmarketOS
boot the device into TWRP mode,

and simply using the install feature, switch to "install image" rather than "install ZIP"

navigate to the "/external_sd/boot.img", and flash it to the /boot partition

Supported variants

 * samsung-espressowifi, which is almost identically similar to samsung-espresso3g, but with the exception that it has no modem.

Display
OMAPDRM works fine.

Display seems to be running at 45Hz due to the clock speed for 60Hz not working properly.

Battery
Fuel gauge works fine. The charger driver is WIP, if connected to usb during boot, then only it charges.

Camera
OMAP4 has different subsystem (Ducati) for camera which is non free. Probably will never work on mainline.

3D GPU Acceleration
3D acceleration works fine with out-of-tree code and blobs. As a result, these are kept outside of pmaports. SGX540 blobs also seem to be missing some EGL configs, so UIs like plasma-mobile do not work. Video decoding does not work as it is done by Ducati subsystem.

Phosh
This is no more needed, as you can unlock it with scale as 1, kept for future reference.

By default phosh has a scaling 1, this makes us unable to unlock the screen. So we need to set it to 0.75 (https://wiki.postmarketos.org/wiki/Phosh#Manual_Scaling) by adding

[output:LVDS-1]

scale = 0.75 in /usr/share/phosh/phoc.ini. You can revert it back to 1 to get better performance. wlr-randr can also be used.

WiFi not working after reboot
workaround : always boot the device to TWRP first, then from there, reboot to system.

See https://gitlab.com/postmarketOS/pmaports/-/issues/1211

Fixes with patch in kernel: https://github.com/hansemro/kc1-linux/blob/v5.16.x/patches/0006-Add-clk32kg-to-twl6030.patch

Graphic desktop not launching
For Phosh (and maybe other wayland desktops?): create a  file in   and add the following text. See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2790

always shutdown the device from the Linux interface
otherwise (buttons or TWRP) it will immediatly reboot to system

if you want to charge the device during it stays off, plug it before shutdown from the Linux interface, because plugging the USB charger make the device booting

Never let the battery fall down to 0%
because of the partialy fonctional charging feature

otherwise even plugged to an USB power supply, the device will enter in an endless bootloop. and you will have to open the device, disconnect the motherboard from the charge module to wait some times, letting the battery charging in peace

Non-free unofficial GPU support
As said in the Status section, GPU support can be enabled by copying additional PostmarketOS pmaports in your work directory, called pvrports.

pvrports are basically non-free PowerVR blobs and quirks with Phosh and Plasma Mobile, and not specific for this device. This means that any device that has a PowerVR SGX Series 5 GPU could be enabled by adding this repository.


 * See here

Videos

 * Showcasing Plasma Mobile: https://youtu.be/7DCXtpDmrPQ
 * Showcasing Phosh: https://youtu.be/uG7LSFHO_Vg