Samsung M12 (samsung-m12)

From postmarketOS Wiki
Samsung M12
samsung m12 booting postmarket os
samsung m12 booting postmarket os
Manufacturer Samsung
Name M12
Codename samsung-m12
Model SM-M127F
Released 2021
Type handset
Hardware
Chipset Samsung Exynos 850
CPU Octa-core 2.0 GHz Cortex-A55
GPU Mali G52
Display 720x1600 PLS LCD
Storage 32GB/64GB/128GB
Memory 3GB/4GB
Architecture aarch64
Software
Original software Android
Original version 11
FOSS bootloader no
postmarketOS
Category testing
Pre-built images no
Mainline no
postmarketOS kernel 4.19.111
Features
Flashing
Works
USB Networking
Works
Internal storage
Works
SD card
Works
Battery
Works
Screen
Works
Touchscreen
Works
Stylus
Multimedia
3D Acceleration
Partial
Built-in DVB
Audio
Partial
Camera
Broken
Camera Flash
Works
Connectivity
WiFi
Works
Bluetooth
Broken
Ethernet
GPS
Broken
NFC
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
Miscellaneous
FDE
USB OTG
Works
Sensors
Accelerometer
Magnetometer
Proximity
Hall Effect
Haptics
Works
Barometer
Power Sensor


Contributors

  • Dust417

Users owning this device

How to unlock bootloader

Icon WARNING: Unlocking the bootloader will wipe all data and may void the warranty
  1. Go to Settings > About device and click on Build Number seven times
  2. Go to Settings > Enable OEM unlocking and turn it on
  3. Power down the device
  4. Hold down Volume Down+Volume Up
  5. Connect device to computer through a USB cable
  6. Long press Volume Up
  7. Press it again to confirm it

How to enter flash mode

Power off the device, hold volume up and down together, then connect it to the computer and press volume up to continue.

Installation

Backup your data. The device package and modified pmbootstrap tool has not been merged yet, so it is needed to git clone it from below

git clone https://gitlab.com/Dust417/pmbootstrap.git -b heimdall-dtbo pmbootstrap
mkdir -p ~/.local/var/pmbootstrap/cache_git/
cd pmbootstrap
git clone https://gitlab.com/postmarketOS/pmaports.git ~/.local/var/pmbootstrap/cache_git/pmaports
git clone https://gitlab.com/Dust417/pmaports.git -b samsung-m12 aports
rm -r ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing/
mv aports/device/testing ~/.local/var/pmbootstrap/cache_git/pmaports/device/

from now on you can use python3 pmbootstrap.py <command>

Use pmbootstrap to build your own installation image.

$ pmbootstrap init

If installing to sdcard

$ pmbootstrap install --sdcard=<example /dev/sdf>
Note When installing to the internal storage this technique has to be used but instead of installing it in the recovery ramdisk, it has to be installed from the pmos installed on a sd card first

If installing to the emmc

$ pmbootstrap install

before we start flashing, we must copy the directory with the generated install files because pmbootstrap looks for them at the wrong location for some reason

$ pmbootstrap chroot
# cp -r /mnt/chroot_rootfs_samsung-m12 /mnt/rootfs_samsung-m12/
# exit
Hint When flashing multiple partitions with heimdall it is possible to hold down Volume Down+Volume Up after the phone finishes flashing and begin flashing again
$ pmbootstrap flasher flash_vbmeta
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_dtbo

Display

Notice When flashing dtbo the samsung framebuffer driver gets replaced, this makes changing the brightness and turning the backlight on/off not possible

GPU acceleration

The odroid n2+ has the same gpu and support for linux, so it is possible to download and install the mali g52 proprietary driver (version 37 is the closest to the kernel version) however so far the acceleration has been working only when using ptitsebs gl4es compiled for odroid, the LIBGL_FB environment variable mustn't be set to 0 or it will cause kernel panic.

Audio

Audio is working, but only when using the alsa devices directly, without pulseaudio or pipewire. To enable speaker do

# alsaucm set _verb HiFi set _enadev Speaker

To enable headphones do

# alsaucm set _verb HiFi set _enadev Headphones

To test it

$ speaker-test -t sine -D sysdefault

Other

To enable flashlight

# echo 1 > /sys/class/camera/flash/rear_flash

To enable vibration

# echo <time in miliseconds> > /sys/class/timed_output/vibrator/enable

If using xfce4 this has to be disabled

See also