[v1.2] Linux for Samsung Galaxy J120F - Samsung Galaxy J1 ROMs, Kernels, Recoveries, & Oth

This thread is about Linux port for J120F. Test build is currently in beta state. But if you're a Linux user you can try it.
Status:
Display and touchscreen work
Hardware and software keyboards work
Wi-Fi works (and Firefox onboard )
USB works as OTG or serial gadget with a console (115200n8). UART JIG also works
Bluetooth. You can run hciattach (@115200) to get BT device but most tools don't see it
Known issues:
Touchscreen won't work if phone was started by attaching USB or charger. That's because Android can't start this way (phone shows battery status and goes off).
For same time after boot you can't click anything but cursor moves. Just wait ~30 sec.
This will be fixed in v1.3. Or you can execute:
Code:
rpm -ev --nodeps xinput-calibrator
Fixed:
Onscreen keyboard doesn't work. Sad but true
"Connect to Wi-Fi" button is out of screen. It's next to "DHCP" combobox in TAB order.
Display goes to sleep and can't be turned back on. You can restart X from SSH or USB console to turn it on again. (No timeout - no bug )
How to install:
Create 3 partitions on SD card. 1st is FAT for your Android data. 2nd for Link2SD (make it tiny if not needed). 3rd is ext2 for Linux (500 MB should be enough for now).
Extract rootfs.tar.xz contents to 3rd partition. It should be done as root and from terminal. GUI tools aren't good for this.
Flash kernel (boot.img) with heimdall. It can work as recovery too. In this case you will get dualboot.
Milestones:
1.0 Make it boot
1.1 Bring up major hardware
1.2 Make ROM easier for testing and building
1.3 Organize included software
My next major tasks:
Improve BSP. Make image recipe.
Make toggle screen on/off feature by power button.
Improve onscreen keyboard layout. Make keys bigger.
Done tasks:
Sort out all the patches I've made to FS. Make a BSP (OpenEmbedded machine layer).
Find a problem with USB serial gadget and make it work as console. For now I use UART JIG but only few people have such hardware.
Get Wi-Fi to work. Smartphone is not a smartphone without internet connectivity.
Make connman-gnome window usable with such small display. Currently you need to do blind TAB to connect to Wi-Fi.
Find a problem with on screen keyboard. The only way to input text now is USB keyboard over OTG.
Improve BSP. Integrate FS patches into it. Fix kernel so it can be built inside OE.
Fix screen timeout bug. (Timeout disabled so far)
Photos:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Link to my ROMs folder on MEGA.
Kernel source on GitHub.
OpenEmbedded Layer (BSP) source on GitHub.

Wi-Fi works!
dmesg from Android helped me to start Wi-Fi. To finish initialization you need to run
Code:
cat /proc/deferred_initcalls
Seriously!

Good news!
SSH is working over Wi-Fi.
USB gadget works after all!
To activate it do:
Code:
echo connect > /sys/class/udc/13580000.usb/soft_connect
Now I will try to make a build with all those things activated on boot

Version 1.1 released. It's MUCH more user-friendly but you still need some skills to install and use it.

It's possible to do this on Galaxy J120H?

jlfedmmc456 said:
It's possible to do this on Galaxy J120H?
Click to expand...
Click to collapse
OS image should start on J120H but you need a special kernel. So there are two answers on two kinds of questions:
1) No. This is impossible to [just] install kernel and OS from J120F to J120H because of different hardware.
2) Yes. This is possible to port this project to J120H. It's easy if you're ROM maker.

Good job. Thank you for this ROM.

Set up both keyboards.
To activate software one:
/etc/X11/Xsession.d/80matchboxkeyboard.sh
Code:
#!/bin/sh
. /etc/formfactor/config
CMD="matchbox-keyboard -d"
if [ "$CMD" ]; then
# Delay to make sure the window manager is active
# by waiting for the desktop to say its finished loading
dbus-wait org.matchbox_project.desktop Loaded && $CMD &
fi
To activate hardware one you need new kernel. It is on MEGA already (linux_1_2_boot.img).
Buttons:
RECENT -> Context menu
HOME -> My Computer
BACK -> Esc
Power and Vol keys are Power and Vol keys
To make HOME work as "show desktop" button add:
Code:
XF86MyComputer=desktop
to kbdconfig file.
That's all for now

Fixed Samsung kernel. Now it builds inside OE.
IIRC bitbake should be able now to build OS image without any "tricks".

BSP v1.2
Made proto BSP in a form of diffs. Changes are listed in fs_files.diff file. New files are in files folder. Patches are in diffs folder. New packages are in rpms folder.

Hey really great work; I have created 2 forks of your project for J120A here in the states... I haven't used bitbake before. I went and installed it, but not sure how to use it with the 2 projects you've uploaded. I tried "bitbake J120A" and "bitbake world" but that doesn't seem to be the thing to do. Can't seem to build the kernel manually with "make" either. Could you tell me what commands/config I need to do with bitbake to get this working? Thanks again for your hard work!

puargs said:
Hey really great work; I have created 2 forks of your project for J120A here in the states... I haven't used bitbake before. I went and installed it, but not sure how to use it with the 2 projects you've uploaded. I tried "bitbake J120A" and "bitbake world" but that doesn't seem to be the thing to do. Can't seem to build the kernel manually with "make" either. Could you tell me what commands/config I need to do with bitbake to get this working? Thanks again for your hard work!
Click to expand...
Click to collapse
You don't need bitbake. You need OpenEmbedded.
https://www.openembedded.org/wiki/Getting_started
https://www.openembedded.org/wiki/OE-Core_Standalone_Setup
Then add some layers. I have:
meta (oe-core)
meta-oe
meta-multimedia
meta-networking
meta-filesystems
meta-gnome
meta-initramfs
meta-perl
meta-python
meta-webserver
meta-xfce
meta-browser
meta-j120f
Setup a MACHINE to build for.
Code:
MACHINE ?= "j120f"
And allow non-free licenses
Code:
LICENSE_FLAGS_WHITELIST += "commercial"
Now you can try to build "core-image-sato". OE needs huge amount of free space and time to build! (~100GB)
You can also build packages: bitbake firefox
I doubt that F kernel will run on A version. So you need to port all my patches to the Samsung kernel source for J120A. It shouldn't be hard.
Then diff my linux defconfig with original one (for j120f) and add those changes to your (j120a) defconfig.
After that unpack stock boot.img for your device. And pack your zImage with original DT file.
This is how I do this:
Code:
android_img_repack_tools/mkbootimg --kernel zImage --ramdisk NONE --dt boot.img-dt --base 10000000 --pagesize 2048 --board SRPOI21A000RU -o new_boot.img
Now you can flash new_boot.img with heimdall
Code:
heimdall flash --BOOT new_boot.img
I think you should start with kernel. Patch, build, pack img and flash it. (Don't forget to unlock bootloader first!) Then you can install my OS build on SD card (replace /etc/wifi and /lib/firmware with your files). I hope v1.2 will be released already. And if it works you can start to build your own OS image

This is really great information, thank you so much for the assistance! I have gone through and started work on what you mention, but I realized I'm not sure which Kernel you originally downloaded for your device. There are a lot available for the J120F:
https://imgur.com/a/OeI9u
Do you remember which one you started with? It will make filtering down the diff a lot easier.
-W_O_L_F- said:
You don't need bitbake. You need OpenEmbedded.
https://www.openembedded.org/wiki/Getting_started
https://www.openembedded.org/wiki/OE-Core_Standalone_Setup
Then add some layers. I have:
meta (oe-core)
meta-oe
meta-multimedia
meta-networking
meta-filesystems
meta-gnome
meta-initramfs
meta-perl
meta-python
meta-webserver
meta-xfce
meta-browser
meta-j120f
Setup a MACHINE to build for.
Code:
MACHINE ?= "j120f"
And allow non-free licenses
Code:
LICENSE_FLAGS_WHITELIST += "commercial"
Now you can try to build "core-image-sato". OE needs huge amount of free space and time to build! (~100GB)
You can also build packages: bitbake firefox
I doubt that F kernel will run on A version. So you need to port all my patches to the Samsung kernel source for J120A. It shouldn't be hard.
Then diff my linux defconfig with original one (for j120f) and add those changes to your (j120a) defconfig.
After that unpack stock boot.img for your device. And pack your zImage with original DT file.
This is how I do this:
Code:
android_img_repack_tools/mkbootimg --kernel zImage --ramdisk NONE --dt boot.img-dt --base 10000000 --pagesize 2048 --board SRPOI21A000RU -o new_boot.img
Now you can flash new_boot.img with heimdall
Code:
heimdall flash --BOOT new_boot.img
I think you should start with kernel. Patch, build, pack img and flash it. (Don't forget to unlock bootloader first!) Then you can install my OS build on SD card (replace /etc/wifi and /lib/firmware with your files). I hope v1.2 will be released already. And if it works you can start to build your own OS image
Click to expand...
Click to collapse

puargs said:
This is really great information, thank you so much for the assistance! I have gone through and started work on what you mention, but I realized I'm not sure which Kernel you originally downloaded for your device. There are a lot available for the J120F:
https://imgur.com/a/OeI9u
Do you remember which one you started with? It will make filtering down the diff a lot easier.
Click to expand...
Click to collapse
You don't need to know it. Just take a look at commits: https://github.com/LONELY-WOLF/kernel-j120f/commits/master

Version 1.2 ready
ROM made more user friendly. Most patches are integrated in BSP. It's far more easier to test and build ROM now.
Fixes not included in 1.2:
xinput-calibrator should be removed as it's useless for modern touchscreens
keyboard layout was reworked but I still need to make keys bigger
removed "Ethernet" option from connman-gnome. This fix is available in proto_BSP_1.2 archive
Version 1.3 will be about included packages.
I want to delete and install some packages. Busybox will be replaced first!
BSP will get image recipe.

BSP builds without errors! My Ryzen 1700 (OC to 3800MHz) builds OS image in ~1 hour.

-W_O_L_F- thanks for leading work on a custom kernel and Linux userspace on SM-J120x. Great to see the improvements you've made on top of the vendor kernel to make it easier for developers to test (e.g. packaged boot.img, and userspace).
puargs: I'd also like to see a version for SM-J120A, however I expect we will be blocked running custom RECOVERY as the SM-J120A ships with a locked bootloader. So far I've been unable to find any bootloader unlock methods for SM-J120A.
Tried flashing linux_1_2_boot.img to RECOVERY with heimdall in "download mode" as a test, with no success.
The download mode recognizes an unexpected RECOVERY image, and reports "SECURE CHECK FAIL : (RECOVERY)" on the device.
Have you had any success? Perhaps you found a method that works?

Wow, this is some serious development going on for the SM-J120F! I'm surprised to see such projects for the Exynos platform.
Keep up the good work and may your project become successful!

Project moved to new hardware: Galaxy Note9.
https://forum.xda-developers.com/ga...linux-porting-native-linux-to-galaxy-t3936077

Related

【R&D】 ☆.☆.☆ .. debDroid & "Linux Installer"= full Linux chroot distro on SGY .. ☆.☆.☆

【R&D】 ☆.☆.☆ .. debDroid & "Linux Installer"= full Linux chroot distro on SGY .. ☆.☆.☆
this is a research and development thread
the aim is to discuss the feasibility and implementation of SGY as a pure Linux environment.
introducing (debian style) alternatives to Android on an SGY is not an easy feat. Given the highly motivated developer base of planet SGY, it makes perfect sense, however, to look into the matter.
--------------------------------------------------------------------
LI = http://android.galoula.com/en/LinuxInstall
debDroid link list:
HTC evo - Motorola droid 4 - Samsung epic - epic 4 G - - - - - - - - - - - -- - - - - - - - - -
http://gitbrew.org/debdroid/ - wiki -
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
sure, Stevie ?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
read some salient quotes from above sources:
"Debdroid supports any Android device with loopback devices and ext2, flashable zip works on ICS/GB.
Succesfully tested on Samsung Galaxy SII, Epic 4G Touch, Motorola Atrix, HTC EVO, HTC Incredible."
Apk:
com.afrosec.debdroid.apk - apk wrapper that essentially launches "bash debshell"
Known Bugs: Exit deployment does not work, you must kill the application by holding the back button or hitting exit deployment until it allows you to FC
-- posting to be continued --
this project seems to be fun...the original article mentioned about root bash shell. I'll check about it.
EDIT: I've checked it. our stock rom doesn't have any bash command, but I can see bash command in some of custom rom in system/bin. is this what he mean with root bash shell?
we have sh instead of bash, but that is no big deal.
bash needs to be compiled & tested. but its a character based binary, so its not too tuff
I'm using a custom rom with bash shell command. I could install the program (debdroid) manually without any problem even if I haven't installed all of the files provided in the zip file. i'm not sure if it will really work since the linux img file is so big that I couldn't download any at this moment. nevertheless, the command provided in the zip file doesn't use any bash command. it seems to be doable in our device.
edit: don't forget the busybox
this thing has got to be kickass quality.
some of the bins u get with BotBrew do not quite work.
therefore we need full standard LINUX system
some simple things work with botbrew already, tho
you can get bash command from myss v3.4 anyway...does the app already work on your device?
which app u mean ?
this one --> com.afrosec.debdroid.apk
chrooted debian sid on SGY
Hai mai77,
I uses a ch-rooted small Debian Sid in my SGY (with the help of sqashfs and aufs ).
I uses this environment for compiling and editing some kernel code (you may know 'OTG driver').since currently i couldn't connect my SGY through usb
I uses a statically compiled bash (outside this debian) as my shell.
for the fun, I tried installing 'icewm desktop' in the debian and i run xsession through 'vnc-viewer' . It worked.
Are you talking about thiss?
or any of the above said info is related to your thread??
quite a pull-off
no question: xsession over vncviewer to some SGY would kinda make ya a hero in dis forum, dude !
here come the master
You should have a chat with lilsteve as he has successfully ported ubuntu and debian to the asus transformer tf101. Also i know i saw somewhere that someone created a script to reverse the internal memory and external memory designations. So if you wanted to access the internal memory you would have to go to /removable/MicroSD and if you wanted to get to the MicroSD you would have to go to
/sdcard
http://forum.xda-developers.com/showthread.php?t=1280774
Sent from my GT-S5360 using Tapatalk
mai77 said:
no question: xsession over vncviewer to some SGY would kinda make ya a hero in dis forum, dude !
Click to expand...
Click to collapse
Thanks Bro...
I have already uploaded the statically compiled bash in this thread http://forum.xda-developers.com/showthread.php?p=22157679#post22157679
For runnig chrooted debian, i uses a my custom kernel in which aufs2.2 stand alone patch is appiled.
I uses combintion of a squshfs readonly image and read/write'able ext3 image whith the help of aufs, like in the ubuntu live cd
I uses squash fs beacuse of space restriction (I have 2GB sdcard)
Kernel compiling, flashing etc are very easy now.(I use this http://forum.xda-developers.com/showthread.php?t=1567276 for flashing kernel)
so we can easly use this feature
great makeBootImage that you provide in your above post.
using botBrew we can already do some native compiling, no crosscompile req'd
quote from your readme:
"First find md5sum of zImage (say b18758380a23ba2f487e0adf01086fdb )
make boot.img whith this command
./mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 0x81600000 --kernelMD5 b18758380a23ba2f487e0adf01086fdb -o gboot.img
NOTE the '--base' opion it is constant for all GT-S5360 phones"
find harish's bash binary here
http://forum.xda-developers.com/showpost.php?p=22157679&postcount=1
SGY wireless chip bcm4330 has FM (transmitter and receiver)
does anyone know how to enable (or get driver for ) the FM transmitter?
I guess that is propietary stuff which is kept back
I wonder whether transmission might still require some external circuitry to properly transmit and whether that is in place on SGY.
maybe the GSM unit can be hacked into custom transmission mode
SGY chip set bcm21553 supports usb OTG host mode, but current driver does not quite.
mai77 said:
great makeBootImage that you provide in your above post.
using botBrew we can already do some native compiling, no crosscompile req'd
quote from your readme:
"First find md5sum of zImage (say b18758380a23ba2f487e0adf01086fdb )
make boot.img whith this command
./mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 0x81600000 --kernelMD5 b18758380a23ba2f487e0adf01086fdb -o gboot.img
NOTE the '--base' opion it is constant for all GT-S5360 phones"
find harish's bash binary here
http://forum.xda-developers.com/showpost.php?p=22157679&postcount=1
SGY wireless chip bcm4330 has FM (transmitter and receiver)
does anyone know how to enable (or get driver for ) the FM transmitter?
I guess that is propietary stuff which is kept back
I wonder whether transmission might still require some external circuitry to properly transmit and whether that is in place on SGY.
maybe the GSM unit can be hacked into custom transmission mode
SGY chip set bcm21553 supports usb OTG host mode, but current driver does not quite.
Click to expand...
Click to collapse
Sorry ,the link to the tool used for flashing kernel was wrong..
I really mean this http://forum.xda-developers.com/showthread.php?t=1567276
this is more simpler than the previous one
Now edited that post
sorry
this one works
https://play.google.com/store/apps/details?id=com.galoula.LinuxInstall
http://android.galoula.com/en/LinuxInstall/
guYs,
above is Linux installer, another Linux chroot system, that does work on SGY.
testing it
use ARMEL
use override a lot
-------------------------
then it works like a charm
this is a cool full Linux environment !
check it out
mai77 said:
https://play.google.com/store/apps/details?id=com.galoula.LinuxInstall
guYs,
above is Linux installer, another Linux chroot system, that does work on SGY.
testing it rite now
Click to expand...
Click to collapse
Did u try it mai??
Sent from my GT-S5360 using xda premium
Linux installer
see screenies
adbd
after the research of some japanese fella it has come to light that u can actually run Android adbd in Ubuntu ARM distro w/o recompile
andBuntu
https://code.google.com/p/andbuntu/
project to run Ubuntu on Android phones

Multiboot Linux on Infinity tf700 v0.8.3 (project closed)

Hi, Guys
Currently I'm working on preparing Linux boot and rootfs image for tf700 device.
Project is based on Nexus 7 Ubuntu installer, Linaro distribution and Hundsbuah kernel.
Release version 0.8.3
Developers thread is here
Warning!
You can brick your device or loose all your data. I'm not to be held responsible if you damage or brick your device. Please, be careful.
This manual has been prepared for the advanced users. You are an advanced user?
You have linux experience
If there is a problem - you contact support and provide all the necessary information (devices info, steps to reproduce, logs)
Please, change password for ubuntu user at first login. Default password is "ubuntu".
Components:
This system consists of several components:
Installer (v0.8.3)
- is standart Android ZIP update file with Aroma interface.
Features:
Pretty simple touch interface
Installing and usage Linux without a keyboard or dock
Detailed localization of install process (rus, eng)
Any device to install rootfs (usb media, sdcards or internal virtual disk file)
You can skip rootfs preparation and install only bootimage (if dualboot has been replaced by another installation)
Data2sd option supported
Use android /data partition as /home directory for users
Autobackup of old virtual rootfs image file and ubuntu user
Select boot priority - you can select default system to boot (Basic or Linux)
Next release features:
Review of initrd options scheme
Install additional system to directory
Rootfs archive finder search maxdepth 3
Save log into internal memory
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Bootimage (v0.8.3)
- contains Linux kernel (zImage) and initial ramdisk (initramfs). It is created during installation and stored in a special LNX partition on your device.
Features:
Support of many basic systems - Android (CleanROMv3.x, CleanROMv3.x+Data2SD, CM10.x) and Ubuntu-Touch
Any media booting - you can boot SDcard, microSD or usbdisk
Virtual Disk multiboot - possible to select need virtual disk (up to 9)
Android & Ubuntu-Touch booting - can boot android system init from media or virtual disks
File system checker - before mounting filesystem should be checked by fsck.
Hundsbuah kernel - v2.1 optimized kernel
Next release features:
Support for 4.2 android (CleanROMv4.x)
Run additional system from directory
RootFS archive
- compressed tar archive with root file system of OS. It is unpacked during installation to a prepared ext4 filesystem (in file or media device).
Ubuntu 12.10 (v0.8.0)
Archive contain prepared Ubuntu 12.10 environment with last updates, based on Unity (3d) with Cube Desktop. You can install any software (like lxdm or xfce) to improve desktop performance, but (for now) only Unity will be supported.
Features:
Pad-mode - you can use your device as pad without dock
Keyboard remapping - Special keys is replaced to default (Esc, F1-12, Ins, Print, Break, Del, Home->Alt, Search->Meta4) by evdev keymap.
WiFi - You can connect to internet or lan through wifi
Touchpad 2 fingers scrolling - Move 2 fingers up-down to scrolling. 2 finger tap - is mouse 3rd button.
Touchscreen - Supports right click by touch one finger and click by second finger.
OpenGL ES - 3D, games (eduke32, Jagged Alliance 2) and nice browsing by Chromium
Audio and Video up to 1080p - Use nvgstplayer to HW decoding FullHD video
nvgstplayer --sas="audioconvert ! pulsesink" -i <videofile> - Fullscreen mode
nvgstplayer --svs="nvxvimagesink" --sas="audioconvert ! pulsesink" -i <videofile> - Window mode
Problems:
Unity has some problems with performance and ram eating - this is place for optimizations.
Going to suspend is freezing device
HDMI FullHD is not working (but HD is ok)
Bluetooth not working
Disable speaker if headphones connected
Totem is not support nvidia gstreamer plugins
No flash player - only HTML5
Skype and any proprietary software (we need ARM binary, not x86)
Ubuntu-Touch preview (v0.5.2 2013/03/25)
Features:
Smooth touch interface
WiFi support (fixed)
Frontal Camera
Ubuntu 13.04 - development
First release features:
Packages for specific tf700t and tegra3 components (tf700 ppa)
Wayland + Weston + libhybris optional support
Install Manual:
For now installation is very simple)) No console operations needed!
Requirements:
Access to recovery & zip upgrade
> 3Gb free space in tf700 /sdcard folder or external storage
Process:
Get linux-install-0.8.3.zip (12 Mb), (mirror) MD5: 46e458791d232dafa7df49a7b506beca
Get need rootfs:
Ubuntu: rootfs-ubuntu-12.10-0.8.0.tar.lzma (687 Mb), (mirror) MD5: 6dbf50fe8623ceef3e5771e01ba52938
Ubuntu-Touch preview: rootfs-ubuntu-touch-tf700t-0.5.2_20130325.tar.lzma (444 Mb), (mirror) MD5: d50b7fe310f0feb23729e9f857e5c157
Arch (workdowg): arch linux thread
Copy linux-install-*.zip and rootfs-*.tar.lzma to your SDcard or /sdcard on your tf700
Reboot to recovery mode
Run linux-install-*.zip
Next, next, next ))
Wait, wait...
Done, now you can reboot and see four penguins!
If you have a problem with installation process - please, save install log and attach it to your help request message with good description.
Uninstall:
Really? I feel so sad
To complete uninstall multiboot & linux you need:
Reinstall your Android distributive or kernel part of it (this is replaces bootimage with multiboot)
Remove /data/media/linux directory with linux root file systems
Epilogue:
Currently we have basic linux environment with graphics and internet. For now, Android is more friendly to the user on a Tablet PC, but we can tilt the balance to Ubuntu advantage.
If you have any question about usage - please, post it here.
Really appreciate you effort! Why not post this in the developers forum, where you might get some good inputs from other brainy people like yourself.
rahulunni said:
Really appreciate you effort! Why not post this in the developers forum, where you might get some good inputs from other brainy people like yourself.
Click to expand...
Click to collapse
I would like to prepare this howto (after stabilization and fixing minor bugs) for general users. But thanx for you response - brainy people do not come here?
How does this vary from the other Ubuntu effort? Why not combine resources?
http://forum.xda-developers.com/showthread.php?t=1988170
danger-rat said:
How does this vary from the other Ubuntu effort? Why not combine resources?
http://forum.xda-developers.com/showthread.php?t=1988170
Click to expand...
Click to collapse
That would be great! At the moment I'm trying to run their environment using fastboot and find differences. I already sent message to jaybob413 and we try to combine our resources.
rabits said:
I would like to prepare this howto (after stabilization and fixing minor bugs) for general users. But thanx for you response - brainy people do not come here?
Click to expand...
Click to collapse
I am sure they do. Just that the developers forum seemed more appropriate. Anyway, good luck and will wait for your work to finish!
rabits said:
fastboot boot boot.img
Click to expand...
Click to collapse
Good idea to boot via fastboot, that should save the hassle of permanent reflashing the kernel - however it doesn't work for me, at least with the kernel from the other Ubuntu project.
First try: use a raw kernel+ramdisk image (starting with "ANDROID!"):
Code:
[email protected] ~/android/tf700/ubuntu $ fastboot boot blob.LNX
downloading 'boot.img'...
OKAY [ 2.829s]
booting...
FAILED (remote: ()
finished. total time: 2.830s
Second try: use the complete blob:
Code:
[email protected] ~/android/tf700/ubuntu $ fastboot boot blob
creating boot image...
creating boot image - 6281216 bytes
downloading 'boot.img'...
OKAY [ 7.318s]
booting...
FAILED (remote: ()
finished. total time: 7.319s
Fastboot itself works, because after that I issued "continue" and it booted the installed Android kernel just fine:
Code:
[email protected] ~/android/tf700/ubuntu $ fastboot continue
resuming boot...
OKAY [ 0.000s]
finished. total time: 0.000s
Any idea?
What's also interesting is that last time I flashed stuff with fastboot some weeks ago, "fastboot devices" used to show all "??????" and I had to use the well-known "-i 0xb05" option. Today "fastboot devices" showed a proper serial number and I could omit the option (also tried specifying it anyway, but it did not make any difference). Maybe that was repaired with a recent bootloader.
You typically have to include the device ID in the fastboot command for this device... might be worth a try?
For example:
fastboot -i 0x0B05 flash recovery twrp.blob
Not quite sure what the syntax is to boot an image...
danger-rat said:
You typically have to include the device ID in the fastboot command for this device... might be worth a try?
Click to expand...
Click to collapse
Read my post to the end...
_that said:
Code:
[email protected] ~/android/tf700/ubuntu $ fastboot boot blob.LNX
downloading 'boot.img'...
OKAY [ 2.829s]
booting...
FAILED (remote: ()
finished. total time: 2.830s
Any idea?
Click to expand...
Click to collapse
I see - you use blob. It's wrong - you need to unpack blob (see the blobunpack on this forum). Fastboot can flash only images. Blob - is used from zip and sdcard.
_that said:
Read my post to the end...
Click to expand...
Click to collapse
Yes, sorry, saw that afterwards...
rabits said:
I see - you use blob. It's wrong - you need to unpack blob (see the blobunpack on this forum). Fastboot can flash only images. Blob - is used from zip and sdcard.
Click to expand...
Click to collapse
blob.LNX is actually the output of blobunpack, and it's a boot image starting with the "ANDROID!" magic. As you can see above, I tried both variants and neither worked.
rabits said:
I see - you use blob. It's wrong - you need to unpack blob (see the blobunpack on this forum). Fastboot can flash only images. Blob - is used from zip and sdcard.
Click to expand...
Click to collapse
I believe you can flash blobs - see my earlier post. I'm pretty sure that's how I flashed recovery...
Thank you for your work and this awesome project!! If this becomes stable and usable, I'll be buying the keyboard dock for my Infinity!! Congratulations on your progress thus far, and a big thank you!!! I was just thinking the other day how much I would love to have this capability!! Would give me a Ubuntu system for me to easier work on various Android phones
Sent from my EVO 4G LTE using xda premium
Nothing have ever excited me more than this. Thank you so much for all your work! Im not a big linux programmer, but iv been using it for the better part of my life. If i can help in any way, Im in!
Thanx for your response - now I prepare rootfs for publication and I'll do this in near time.
rabits said:
Thanx for your response - now I prepare rootfs for publication and I'll do this in near time.
Click to expand...
Click to collapse
Awesome!!!!!
Take your time man. We're in no rush and my Infinity will probably never leave me, especially if you get this going!!! Thanks again!!!
Sent from my EVO 4G LTE using xda premium
Looks like you're making good progress
rabits said:
Thanx for your response - now I prepare rootfs for publication and I'll do this in near time.
Click to expand...
Click to collapse
Great news really looking forward to this. :good:
Nice. Its always good to options when it comes operating systems.
Also, is this bloated at all? Because, Ubuntu for non-embedded systems has been very bloated since 11.04 and got worse with 11.10.

SailfishOS 3 for Photon Q and siblings

Code:
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it!
SailfishOS 3 for Photon Q
Continuation from 2.0 thread to keep most important information in first post. Thanks to vevgeniev for initial port, without it I would never buy Photon Q.
Repo with my apps is added to image. Packages can by installed via terminal:
Code:
devel-su zypper in "package name"
Images
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Installation
Download and flash cm-11-20150626-SNAPSHOT-XNG3CAO1L8-moto_msm8960_jbbl.zip via twrp-3.0.2-0-asanti_c.img according to ordinary cm instruction. Use ext4 filesystem for /data partition. Boot to android and make sure everything works.
Download SailfishOS 4 image (open browser in private mode if onedrive ask you to login) and flash it over cyanogenmod. It's compressed tarball so installation may take even 10 minutes.
OTA
Read about Stop Releases and make backup using TWRP
Code:
/usr/share/sfos-moto_msm8960_jbbl-adaptation/upgrade.sh
# after reboot execute pkcon refresh to update all repositories
For any issues with upgrade.sh script download more up-to-date version, add --verbose argument or execute commands from real-upgrade.sh manually: https://build.sailfishos.org/packag...bl:4.4.0.68/sfos-moto_msm8960_jbbl-adaptation
At first boot tracker might slow down phone and eat a lot of storage. If it's too resource hungry move your media files out of device or create .nomedia empty file to exclude particular directory from tracker. Then force reset it:
Code:
tracker reset --hard
Custom Bootlogo
vevgeniev created a custom bootlogo:
Instruction how to use it
Known issues
Half screen mirror glitch occurs sometimes. Blank/unblank display fixes it
Sometimes removing files does not have any effect, i.e. free space doesn't increase and sdcard can't be unmounted. Could be easily triggered by mtp or dd usage. For sdcard access use FileZilla (SFTP).
QProcess:startDetached can hang randomly. Workaround added to fingerterm. Looks like it's bug in Qt and it is not photon q specific: https://together.jolla.com/question/202337/bug-fingerterm-terminal-freezes-after-opening-new-window
There are no 2.XG, 3.XG network indicators.
glReadPixels() return empty content in some cases. This means no screen recording, screenshots and thumbnails in browser. Workaround for screenshots added to lipstick.
All bugs at first boot are features.
FAQ
Q: How to run apk?
A: It's not android, you can't
Q: Can I switch between hardware keyboard layouts?
A: Default xkb layout switch shortcut: "shift + sym". You need to also set second keyboard layout:
dconf write /desktop/lipstick-jolla-home/layout "'us,ru'"
Click to expand...
Click to collapse
In newer releases layouts can be enabled in settings and switched via "shift + space"
Tips
Fast way to restart lipstick:
shift + tab + k
Alt + Tab like switching (if you have sailfishos-alttab-patch installed):
OK + tab
To disable volume media keys:
dconf write /apps/photonq-helper/mediaKeysEnabled 0
batt_health can cause reported battery capacity decrease which I am not sure works correctly at least on my aging battery. It's disabled since 3.3.0 in 2 places in /init.target.rc. Therefore btry will not report Aged Capacity anymore.
To use h264 (hardware accelerated) decoder in youtube set in about:config media.mediasource.webm.enabled to false
user name is still 'nemo' instead 'defaultuser' even for latest releases
Changelog
4.4.0.68
* Partially usable browser. Javascript doesn't cause crash on almost all sites like in 4.0-4.3 sfos. Tabs in landscape mode are unusable.
* Using browser probably breaks video encoding/decoding ('vid_dec_open() max number of clientslimit reached' in dmesg). Killing minimediaservice/browser usually helps.
* Disabled sailjail, and enabled start up boosters back.
* Few general sfos bugs more (see patchmanager catalogue for my patches)
4.3.0.15 - No for daily use, just required Stop Release
4.2.0.21 - No for daily use, just required Stop Release
4.1.0.24 - No for daily use, just required Stop Release
4.0.1.48
Broken browser
3.4.0.24 - Latest usable version
Fix memory leak when taking screenshot
Add workaround for remembering wlan state after reboot in airplane mode
Media keys works only in locked screen
3.3.0.16
NFC pn544 plugin added
batt_health disabled in /init.target.rc
glibc 2.30, gcc 8.3
3.1.0.12
kernel: hold volume up/down to select next/previous song
droid-hal-init: disable mpdecision due to constant cpu usage
3.0.3.9
Patch glibc for 3.0 kernel
3.0.2.8
Handle system and data partition automatically
New methods to wake up sensors
3.0.1.11
kernel: Fix crashes caused by new firewall rules
kernel: Experimental multi LUNs support
droidmedia: Fix random audio/video fail in browser
usb-moded: Mass storage was dropped in upstream. Use patched one
Click to expand...
Click to collapse
XDA:DevDB Information
SailfishOS 3 for Photon Q, ROM for the Motorola Photon Q 4G LTE
Contributors
elros34, vevgeniev
Source Code: https://github.com/elros34?utf8=✓&tab=repositories&q=msm8960&type=&language=
ROM OS Version: 4.4.x KitKat
ROM Kernel: Linux 3.0.x
Based On: CyanogenMod
Version Information
Status: Alpha
Created 2018-11-23
Last Updated 2019-08-20
Thanks for maintaining this for our devices @elros34
I have been meaning to try Sailfish for some time on my RAZR HD (xt926) and i finally got around to it the other day only to find that it wont boot up.
As per the 2.0 thread i can flash CM11 and that will boot and work fine but once i flash Sailfish over the top it wont boot past the bootloader unlocked logo. I have tried both the xt907 and photonq zips but neither will boot.
The xt907 zip did shown some signs of something happening since the led would light up either orange or white but after leaving it for 45 mins with no other signs of life i gave up on it.
Please find attached a list of my device drivers using the following command:
Code:
ls -alR /dev
Are there any chances of this running on my xt926 ?
Thanks, so it has xt907 like partition table, you can't use photon q image. LED glowing means system is booting.
Boot to TWRP then:
Code:
rm /data/.stowaways/sailfishos/init_disable_telnet
Now reboot, connect phone to usb and telnet to it:
Code:
telnet 192.168.2.15 2323
In windows you can use putty but it's hard to copy logs from it.
Then wait a while so logs are complete and run:
Code:
dmesg
journalctl --no-page
logcat
evdev_trace -I
elros34 said:
Thanks, so it has xt907 like partition table, you can't use photon q image. LED glowing means system is booting.
Boot to TWRP then:
Code:
rm /data/.stowaways/sailfishos/init_disable_telnet
Now reboot, connect phone to usb and telnet to it:
Code:
telnet 192.168.2.15 2323
In windows you can use putty but it's hard to copy logs from it.
Then wait a while so logs are complete and run:
Code:
dmesg
journalctl --no-page
logcat
evdev_trace -I
Click to expand...
Click to collapse
Thanks @elros34
Please find attached the various logs from my xt926.
Note i'm still running Sailfish 2.1.3.7, i figured it would be easier to start with that but if needed i can re-run these on 3.0.0.8
I have no idea what most of it means for the most part but a few errors did stand out to me in particular
Code:
Dec 12 20:20:16 Sailfish systemd[1407]: Failed to start The lipstick UI.
Could this possibly explain why its not booting any further?
Lipstick fails to start because xt926 use different touchscreen driver. Change "/dev/touchscreen" to "/dev/input/event1" in /var/lib/environment/compositor/droid-hal-device.conf
Also paste output of:
Code:
udevadm info -a /dev/input/event1
elros34 said:
Lipstick fails to start because xt926 use different touchscreen driver. Change "/dev/touchscreen" to "/dev/input/event1" in /var/lib/environment/compositor/droid-hal-device.conf
Also paste output of:
Code:
udevadm info -a /dev/input/event1
Click to expand...
Click to collapse
Thanks @elros34 its working now after changing the touchscreen driver boots up fine. I'm not seeing any immediate issues but will see how i get on with it. First impressions are very good, a really nice os i'm actually surprised at how fast and fluid it is.
Here is the output of
Code:
udevadm info -a /dev/input/event1
Code:
sh-3.2# udevadm info -a /dev/input/event1
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/i2c-3/3-0048/input/input1/event1':
KERNEL=="event1"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/i2c-3/3-0048/input/input1':
KERNELS=="input1"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="melfas-ts"
ATTRS{phys}=="3-0048/input0"
ATTRS{properties}=="2"
ATTRS{uniq}==""
looking at parent device '/devices/i2c-3/3-0048':
KERNELS=="3-0048"
SUBSYSTEMS=="i2c"
DRIVERS=="melfas-ts"
ATTRS{drv_debug}=="Debug Setting: 0"
ATTRS{drv_reset}=="Reset: HIGH"
ATTRS{hw_irqstat}=="Interrupt line is HIGH."
ATTRS{ic_reflash}=="No firmware loading in progress."
ATTRS{irq_enabled}=="Interrupt: 1"
ATTRS{latency_debug}=="Latency Debug Setting: 0"
ATTRS{latency_times}==""
ATTRS{latency_values}=="Touch Latency Time: Average 0uS, High 0uS,0 interrupts of 0 were slow"
ATTRS{name}=="melfas-ts"
looking at parent device '/devices/i2c-3':
KERNELS=="i2c-3"
SUBSYSTEMS=="i2c"
DRIVERS==""
ATTRS{name}=="QUP I2C adapter"
I'll also see if i can convert some of the other xt925 and xt926 users for testing.
Absolutely love this - haven't had a single problem yet. Thank you so much elros34.
Could somebody check what "getprop ro.product.device" returns for xt926 or xt907 with sailfish installed?
mounting /dev/mmcblk0p39 on /data failes
Hi,
at first i would like to thank you for building SFOS3 for the Photon Q series, i bought another XT907 to finally get SF running on this pretty nice and tiny handset.
As @drkdeath5000 i stuck at the bootloader unlocked screen but with another problem as the touchscreen driver for his XT926.
I think it's a problem with the partition table here the error from /init.log
mount: mounting /dev/mmcblk0p39 on /data failed: No such file or directory
I followed the installation instructions you provided and flashed cm11, which is booting without issues. I already tried it with and without wiping dalvik/cache, with and without booting to cm11 first. So i would really appreciate your help. If i can provide some more detail just tell me.
Best regards
André
rkdeath5000 get further because he used old xt907 image, you can't use photon q image in XT907.
I have tried to support all devices in one image. I even prepared untested script to update kernel but need a nice way to distingnues between devices. No feedback so far.
Few days ago I came up with different an idea how to auto detect correct partitions in all devices but so far I am struggling with some serious issue in 3.0.2 so I am not sure when I will release it.
elros34 said:
Could somebody check what "getprop ro.product.device" returns for xt926 or xt907 with sailfish installed?
Click to expand...
Click to collapse
On my XT907 it returns scorpion_mini
Thank you for your fast response,
as you recommended Version Alpha3 is running but of course i would like to run SFOS3 So i would like to help you in any way possible.
Best regards
André
If you could test whether this image works (boots without issue and touchscreen works) then it would be great. This is image I just built with new method to detect correct partitions but without all needed patches for middleware so other bugs are not important for now.
Thank you so much! I can hardly tell you how happy you made me I always wanted i tiny handset running on SFOS and finally after i already had given up on that your rom make it happen.
I just started some basic testing on it, as i want to wait for the screen protector before starting to really use it so i'll give you a feedback on the rom later.
3.0.2.8 Released as OTA and new image probably for all moto_msm8960_jbbl devices.
Also I created new patch for Alt+Tab (OK + Tab key) like switching between windows. It's added to my obs repo.
So far the new version alpha9 installs without issues on the XT907. Right now i have just one problem, as in version alpha8 I'm not able to send text messages (SMS). I tried different sim cards from two different networks, so i think it's a problem within the ROM. How could i help you on this? Maybe collecting some logs?
What about Alpha3 or android? To boot android you don't have to flash whole system, just boot cm11 kernel via fastboot. Have you tried to set "Prefer 3G" in cellular settings?
To get most basic logs, reboot phone and try to send sms, then:
Code:
dmesg
journalctl --no-page
logcat -b radio
If it's something more serious then you will need to follow:
https://jolla.zendesk.com/hc/en-us/articles/203761078-How-to-collect-SMS-logs-
Thanks so much for 3.0.2.8 - works great. Really hope you're able to give us a 3.0.3 with the updated browser.
Don't know if you have any interest/knowledge on Maemo Leste or PMOS, but since you're the most knowledgeable person on the Photon Q, just wondered if you could hazzard a guess as to how possible it might be to get them working on this device further down the line?
Thanks again.
Yes, updated browser is tempting so I will definitely bring 3.0.3 when it will be available for ported devices.
Unfortunately I have never ported Leste or Postmarketos so I have limited knowledge here.
With Photon there are several issue like: no sim without modification and no flex cable to buy. Also we are stuck with android drivers and ancient 3.0 kernel with no chance for upstream. It means to run anything (in usable form) other than android we need libhybris. I think there are better devices with more active developers for these systems: droid 4 - have ongoing upstream efforts, Fxtec pro1 for sure will have 4.x or even 5.x kernel. That's why you will not find photon in actively supported devices in postmarketos or leste site.
- Leste use hildon-desktop (x window manager) so it would be probably not trivial to get libhybris based ui acceleration if it's possible at all. Is that os even daily usable?
- After a quick read of Postmarketos wiki looks like it support wayland based compositor like weston so it is a good sign. I was able to run libhybris accelerated weston in ubuntu chroot in sailfish. It has some touch issues but it may be because I run it nested in lipstick. From what I understand if device doesn't have upstream kernel then postmarketos requires ported halium and lxc containers. That might be not possible because of 3.0 kernel but you will never know until you try.
Take everything I said with a grain of salt and start porting. For halium you will probably need newer base than cm11. There are few important commits which are needed otherwise kernel will not work.
SMS issue could be general ofono bug: https://together.jolla.com/question...installing-3028/?answer=205366#post-id-205366
Jolla is focused on android8 base so older bases are neglected. Upstream libhybris is also broken for hybris-11 base.

KVM (Kernel Virtual Machine) on Samsung Galaxy A6 (Exynos 7870)

I have an Galaxy A6 which has the Exynos 7870 CPU. I downloaded the kernel source from the Samsung source page, and when I typed
Bash:
make menuconfig
it has the Virtualization option. So does that mean the CPU itself support KVM? Thanks!
I just compile the kernel, pack it to boot.img, put boot.img to the AP and flash it using Odin but not work. I want to try if KVM exist to run Windows ARM in QEMU kvm in Termux
I have the very same device and am currently working on a patch for KVM to work on it. Will post here if I get it working reliably. On the other hand this SoC has its own quirks, I'm not sure if it'll ever be possible to run unpatched guest OSes (some registers are only writable from EL3 (TrustZone), not initialized by that, guest VMs read them, and it can't be trapped).
I tried installing a root kernel with stock rom but then it said there is some illegal operation and force me to reset the phone. I have no important data on it so I reset it and then it still displays the error. So I guess if we need root to use
Code:
/dev/kvm
(or at least add user to kvm group)
WDYM by "root kernel"? Magisk?
Yeah the magisk patched kernel.
raspiduino said:
Yeah the magisk patched kernel.
Click to expand...
Click to collapse
Very weird. For me it once got into "KG state: Prenormal", but was fine otherwise. I first reverted it to full stock, then flashed TWRP from github, then flashed magisk apk via TWRP, then after reboot installed the apk normally. There is a notification about "unauthorized actions", but it does not force anything, I can just ignore it.
This seems to work for me. qemu-system-aarch64 in Linux Deploy works with -enable-kvm.
Attached a kernel with KVM enabled + latest Magisk: https://mega.nz/file/d8lGhY7b#NKQZEL3G6bT7SetrHLh4rNgmgg0L5EXJ0Lir_QjAebA
EDIT: uploaded the patch to Github: https://github.com/sleirsgoevy/exynos-kvm-patch
Oh thanks you so much! I will try this right now!
Just 3 questions:
- How do you build and pack the kernel? I tried both "make Image" and "make Image.gz" then unpack boot.img using android image kitchen but it did not boot when I flash with Odin.
- Do you get a factory reset prompt when first boot this kernel with stock firmware? I got it once when I tried patching stock kernel with magisk.
- If you get the factory reset prompt in question 2: after reset and setup Android, I cannot get the phone's pin lock and password work anymore. So how to fix this?
Thank you very much!
{Mod edit: Quoted post deleted}
Yeah you somehow can boot Windows ARM on it (natively)
raspiduino said:
Oh thanks you so much! I will try this right now!
Just 3 questions:
- How do you build and pack the kernel? I tried both "make Image" and "make Image.gz" then unpack boot.img using android image kitchen but it did not boot when I flash with Odin.
- Do you get a factory reset prompt when first boot this kernel with stock firmware? I got it once when I tried patching stock kernel with magisk.
- If you get the factory reset prompt in question 2: after reset and setup Android, I cannot get the phone's pin lock and password work anymore. So how to fix this?
Thank you very much!
Click to expand...
Click to collapse
I used magiskboot for repacking the kernel. Unpack boot.img with `magiskboot unpack boot.img`, replace `kernel` with `Image` (not `Image.gz`), then repack with `magiskboot repack boot.img`, and flash `new-boot.img`. The magiskboot binary can be found in the Magisk installation zip.
Edit: It does boot and run but the lock screen does not work . There is an issue thread in Magisk's github page and it only solve the problem temporarily . After reboot it asked again for password.
I will try to fix this.
A small status update: Windows on ARM currently halts due to missing support for performance counters in Linux 3.18's KVM. Linux handles its registers as "read all zeroes, write ignored", but Windows expects the counters to actually tick. Probably a proper implementation needs to be backported from newer Linux.
I tried your patch on my device, modified a little bit for calling your "preinit_hyp_mode()" function from "init/main.c". I can boot into stock rom, install termux on it and then install qemu-system-arm and qemu-system-aarch64. I also run "chmod 666 /dev/kvm". Then I tried qemu-system-aarch64 with --enable-kvm but it said kvm not found. I also tried qemu-system-arm but it said "kvm_init_vcpu failed: invalid argument". "/dev/kvm" is available. What am I doing wrong?
Also my hard keys (volume up/down and power key) don't work after booting with that kernel but it work with stock rom, although this is not the main problem.
Thanks!
Blame Samsung, not yourself. This phone has a 64-bit kernel but 32-bit Android system, thus (the 32-bit build of) qemu-aarch64 thinks that the architecture is incompatible, and qemu-arm cannot utilize the 64-bit interface the kernel is providing. What I did was to install an aarch64 chroot using Linux Deploy, and install qemu on it.
I tried installing Debian arm64, Ubuntu arm64, Fedora aarch64 and a Debian Bootstrap .tar.gz from debian.org but none of them work, always falls with "Bad system call" or "sh not found". So could you be more detailed, like which option do you use in Linux Deploy? Thanks!
This should not happen, unless for some reason you are trying to do it without using root. If you're using the proper root-enabled chroot, and not the proot hack, changing the architecture in settings should be enough.
I see the message "Linux deploy was granted superuser right", but the arm64 install failed, configure failed, deploy failed, ssh and vnc failed and if I use Linux deploy telnet then "su -" and "linuxdeploy shell" it said "/system/bin/sh not found" . I installed Magisk, busybox extension from magisk. Only the armhf work on my phone.
-------------------------------------------------------------------------------
NOT THAT FAST
I sloved it
Just install armhf chroot like normal in Linux Deploy, then VNC to that chroot. Type "dpkg --add-architecture arm64" then "apt update" then "apt install qemu-system-arm:arm64". Then "chmod 666 /dev/kvm" and "qemu-system-aarch64 -M virt -cpu host --enable-kvm" It just work I loved it !
I can confirm that file "qemu-system-aarch64" is aarch64 executable and it run on my phone
Thanks sleirsgoevy my friend )
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
How did you boot Linux on it? I tried Debian ARM64 netinst vmlinuz and initrd but it does not output anything, even with "-nographic" or "-vga std". I checked QEMU monitor and it show that the register does change.
I also tried Windows ARM but no luck. qemu_efi.fd does not bring up a EFI interface or anything and the registers value doesn't change.
For debugging, add proper earlycon options to kernel command line, 'coz it is probably panicking way before late serial is initialized.
Steps to boot Linux:
* dump DTB from your QEMU installation: `qemu -M virt,dumpdtb=dtb.bin`
* use dtc tool from the Linux kernel source to translate it to dts
* modify the dts file as follows:
```
timer {
interrupts = <0x1 0xd 0x304 0x1 0xe 0x304 0x1 0xb 0x304 0x1 0xa 0x304>;
always-on;
compatible = "arm,armv8-timer", "arm,armv7-timer";
clock-frequency = <0x18cba80>; <-- add this
};
```
* now recompile it to dtb and provide to qemu via the -dtb flag
Attached my own patched DTB for -M virt.
Linux now boot, thanks!

Development Installing GSI by repacking super.img on SM-A127F and SM-A325F (Linux)

repacksuper
===========
Copyleft uluruman 2021-2022
(for LINUX/WSL only)
This is the minimalistic set of tools + a script for Linux for the automated
ground-up repacking and flashing of the Samsung Galaxy super.img, replacing
the stock Android system with something much less intrusive and obtrusive
(e.g. LineageOS). Or just some other GSI (Generic System Image).
Additional included scripts (since v1.1) simplify flashing of stock firmware or
separate image files under Linux using Heimdall.
Theoretically should work for any Samsung A-series phones, and may be even for
some others. Tested on SM-A127F/DSN made in India and Vietnam and SM-A325F/DS
made in India, on Debian Linux 11 x64. There are reports of successful flashing
of SM-A127M, SM-A032M and SM-A226B.
Why this method?
----------------
Repacking of super.img is the only method which allows changing of the phone's
operating system without screwing up the Verified Boot (VB) protection
mechanism. Keeping the VB allows you to be sure that everything besides the
platform was indeed compiled by Samsung and wasn't tampered with, no matter from
where you downloaded your stock firmware.
The other reason is that although there are alternative methods of changing the
OS, for phones with dynamic partitioning and no working version of TWRP
available they may be even more complicated than repacking of super.img
externally by this script.
Requirements
------------
Install the following tools from the official repositories of your Linux distro:
simg2img xz-utils lz4 unzip gzip jq file
Basic instructions
------------------
repacksuper.sh: main script for changing your phone's operating system
heimdall_flash_stock.sh: script for flashing stock firmware under Linux
heimdall_flash.sh: script for flashing any custom image file under Linux
Just run a script without any arguments to see help.
Extra tools used (x64 binaries and sources included)
----------------------------------------------------
GitHub - LonelyFool/lpunpack_and_lpmake: android super.img tools
android super.img tools. Contribute to LonelyFool/lpunpack_and_lpmake development by creating an account on GitHub.
github.com
GitHub - amo13/Heimdall: Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices. This is a fork of the original repository with a few crucial pull requests merged.
Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices. This is a fork of the original repository with a few crucial pull requests merged....
github.com
Additional notes
----------------
The included binaries for the lpunpack, lpmake and Heimdall were compiled for
the x86_64 architecture. If your PC architecture is different (e.g. x86 32-bit
or ARM) you have to compile these tools yourself. The full source code is
included (or otherwise available on GitHub).
Spoiler: Changelog
0.9: Initial release
0.91: Non-sparse new system is now correctly moved into the super dir
0.91a: Bug in the new system file format checking fixed
0.91b: Better support for spaces in paths
0.92: Added checking for system requirements and an optional parameter for
setting of the final tar archive name.
0.92a: Fixed file ownership issues inside the tar distribution archive
0.93: Added support for SM-A325F. Several minor improvements.
0.94: Added support for gzip-packed GSI images. Packing into .tar is now done
without question if the command line parameter is given. Tar parameter
now can include the full path. Without the full path the default tar
location is now the same as the GSI. Several other minor changes.
1.0: Finally added working native Linux flashing using Heimdall (HUGE thanks
to amo13 and Benjamin Dobell). Two new options: using empty product.img
and silent (non-interactive) mode. Colored text. Bugfixes and minor
changes.
1.01: Option to specify the SUPER partition name manually (needed for flashing
SM-A127F with Heimdall). Now it is possible to place output .img and .tar
files in any directory and give them any name. Text terminology a bit
clarified, help text expanded. Done many internal optimizations,
additional sanity checks and minor changes.
1.02: Support for SM-A032F/M and similar firmwares with non-packed super.img.
Support for firmwares with/without additional partitions. Support for
arbitrary partition group names. Very experimental option to use empty
system_ext.img for additional privacy (applicable to some phone models/
regions). Lots of minor fixes.
1.03: Multiple .img files are now supported in GSI archive files (one of them
should be system.img in that case), e.g. Android AOSP zip files are now
supported directly. The logic of flashing with Heimdall now includes more
complex cases, such as flashing in two steps with a reboot. Unnecessary
code in GZ unpacking removed. Some other small fixes and optimizations.
1.1: New scripts heimdall_flash_stock.sh and heimdall_flash.sh added.
Lots of refactoring in repacksuper.sh (because of that there may be some
bugs left), improved and clarified UI logic, changes in where the files are
now placed (see help for details), direct work with stock Zip firmware
files, lots of minor changes.
1.11: Colored text now should be correctly displayed in almost any shell that
supports it except if it's explicitly disabled with NO_COLOR.
1.11.1: heimdall_flash.sh now can flash Super partitions unconditionally in one
step when using both the -s parameter and manually specifying parition
name (e.g. SUPER for SM-A127F).
1.12: The heimdall_flash_stock.sh script was significantly upgraded with lots of
new features. Now it theoretically allows upgrading of stock firmware
without erasing user data, keeping the GSI and custom recovery, etc.
(although it's not that straightforward, read the help for details).
A couple of fixes in the other scripts.
1.12.1: changed unlz4 to lz4 -d, as some distros don't have the needed symlink
1.13: In repacksuper.sh support added for the Vendor DLKM and ODM DLKM
partitions, as well as the experimental -v option to add or replace Vendor
DLKM with a custom image. A couple of minor fixes.
1.14: Greatly improved logic of heimdall_flash.sh, now it's possible to specify
both or either custom partition name and custom file name, and acquiring
PIT from device is done only when it's needed. Versioning scheme of the
scripts was unified: the script that was updated receives the updated
version number of the whole pack, the rest retain the old numbers.
1.15: up_param_tool.sh script was added: it allows altering of the boot
sequence images (logo, "not official" warning, etc.), as well as the
Recovery and Download internal graphics. Happy hacking, but please pay
attention to the warning displayed after extracting the JPEG files.
A couple of minor fixes in the other scripts.
1.15.1: Bug with failing LZ4 uncompression fixed in repacksuper.sh and
heimdall_flash_stock.sh.
1.15.2: Added the Ctrl+C trap in heimdall_flash_stock.sh, so now the temporarily
renamed files are correctly renamed back in case of flashing being
aborted with Ctrl+C. Upgraded Heimdall with the git pull requests, but
it seems those still do not cure the relatively rare issue when flashing
specific files gets completely stuck at some point.
1.15.3: The "file" tool used to identify PIT files was replaced with direct
reading of the file header as the first method proved to be unreliable.
1.15.4: Fixed a bug in heimdall_flash.sh (missing g flag in sed)
1.15.5: Fixed the compatibility issue with the older LZ4 compressors
1.15.6: Fixed compatibility issues with systems where /bin/sh is Bash, such as
ArchLinux
1.15.7: repacksuper.sh: fixed using the existing "repacksuper" dir as source,
also in this mode you can now specify "-" as new system image to reuse
everything inside the "super" subdir. New experimental -w parameter.
All scripts: the Ctrl+C trap now switched on and off the correct way.
Several other fixes.
1.15.8: Fixed using the heimdall_flash_stock dirs as source for repacksuper.sh.
A couple of other fixes.
1.15.9: heimdall_flash_stock.sh: fixed skipping of duplicate partitions (e.g.
vbmeta) for some shells; fixed upgrade-flashing of Galaxy A32 (default
behavior).
Spoiler: Known issues
During the script run you can see several "Invalid sparse file format at header
magic" warnings, just ignore them.
For some firmware files Heimdall may not work at all (freeze indefinitely or
exit with an error), in that case you have to resort to Odin. In many cases
Heimdall freezes when uploading files for some time, but that does not mean it
is completely frozen, just be patient.
In LineageOS, Dot OS and some other GSIs I tried on SM-127F the touch screen
remains not responsive for about 6 seconds after waking up. The problem is not
present at least with SM-127F/DSN phones made in India, but present at least in
those made in Vietnam. Another problem in the most, if not all, GSIs is that the
MTP USB file transfer does not work (at least on Linux) because of the "wrong"
(Samsung's instead of Google's) default MPT driver used by the kernel.
Both of the aforementioned problems can be solved by installing the fixed and
recompiled kernel.
For the last problem alternative solutions include using apps such as
Warpinator, Syncthing or ftpd.
Spoiler: Food for thought
When choosing a GSI to install I really don't recommend using ones which include
GApps and therefore use any of the Google services. Don't let corporations
gather your data. You bought the phone and from now on it should be all yours,
with all of its data, like a PC in the good old days. You own your device, and
nobody has the right to stick their nose into how you use your phone, gather any
statistics and push you any ads. You always have a choice to turn down
privacy-unfriendly stuff, the price of that "inconvenience" is actually
ridiculous. From my point of view, there is simply no point in using non-stock
systems if they are still littered with the privacy-unfriendly bloatware.
For the step-by-step guide (slightly outdated) read this and this post. Also be sure to read this post concerning the importance of optics.img. Concerning the up_param_tool.sh be sure to read this post.
The included binaries for the lpunpack, lpmake and Heimdall were compiled for the x86_64 architecture. If your PC architecture is different (e.g. x86 32-bit or ARM) you have to compile these tools yourself. The full source code is included (or otherwise available on GitHub).
Latest stable combinations of stock firmware and LineageOS (updated February 5, 2023):
SM-A127F: A127FXXU7BVI4 + LineageOS 20.0-td 20230115 arm64 bvS
SM-A325F: A325FXXU2CVK3+ LineageOS 20.0-td 20230115 arm64 bvS
Some recommendations (updated February 5, 2023):
If you are a newbie and don't know how to do unlock the bootloader and other such stuff, here is a good guide by LAST_krypton (follow the "Unlocking the booloader" section) or a shorter guide by cldkrs.
First flash the phone with the whole set of stock firmware using the heimdall_flash_stock.sh (Linux only) script with the -d parameter: the latter forces flashing the unsafe partitions, which are needed for complete re-flashing.
If you're on Windows use Odin instead. Although there is a "leaked" Linux version of Odin, it's still closed-source (of course), so I don't recommend using it on your main Linux PC. For using the Windows version of Odin on Linux you have to either use Windows in QEMU (tested and works) or probably Wine (untested). When using QEMU remember to add the SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="685d", MODE:="0666" line to the udev rules (e.g. /etc/udev/rules.d/30-qemu.rules) to enable the write access to the phone.
Sometimes Heimdall cannot flash the stock firmware and gets stuck at some particular file. Although you can successfully flash such a firmware using Odin, I recommend to better to find another firmware, may be one release older, because that may indicate some sort of incompatibility with your particular version of the phone.
The stock firmware comes in different revision numbers (also known as the baseband version), which are upgraded about once a year. Generally it should be beneficial to use the latest revision, but note that once you have upgraded it to a later revision there is no way back (at least known to me). In case you want to experiment with flashing of special kernels and other flavors provided by the XDA developers, if possible, you should probably stick to the very first revision.
If you already have the bootloader unlocked (OEM unlock) then after flashing the stock firmware there is no need to set up the Android, just go straight into the download mode again and flash the repacked super.img.
When downloading LineageOS or any other GSI select the normal arm64 bvS version, not vndklite version.
After flashing the OS go into the Recovery mode (hold volume up and power when rebooting) straight away and do the Factory reset. If you cannot get into the Recovery mode be sure to connect the USB cable before trying to.
If flashing with Heimdall completely freezes at some point make sure you've downloaded and repacked the correct arm64 b or a/b GSI and not arm and not a or a-only variant. If "sw rev check fail" message appears on the screen at some point just ignore it.
You can forcefully reboot your phone at any time, even if it seems bricked, by holding the volume down and power buttons for several seconds.
To upgrade your system to the recent version of the same OS just repackage it again using the same script and flash it normally. If the phone does not boot, get into the Recovery mode and try wiping the Cache partition (all your apps and settings should remain intact).
Most probably you don't need TWRP or any other 3rd party recovery tool at all, as the stock recovery tool works fine for just the factory reset after flashing the super file.
Try to avoid using Magisk if you just want to install another OS and nothing else. It is also not needed for LineageOS bvS version as it already has the su utility integrated, you just need to install the additional Superuser app by Pierre-Hugues HUSSON from the F-Droid store (although it's very old it works just fine).
It's possible that SM-127F/DSN internally is not A12 but actually M12, at least most of the tools and kernels made for M12 work on SM-127F/DSN while those made specifically for SM-125 and even other SM-127 versions do not. Therefore you can find more relevant info and tools in the corresponding XDA thread (my script is still remains relevant though).
I should test this for a127f
Bugs fixed: v0.91 & v0.91a
Bug fixed: v0.91b
Added the "file" utility to the list of requirements, updated readme.txt.
Thanks A LOT, this works! I am finally able to run LineageOS on my phone!
For Windows 10+ users: WSL runs this script just fine with a few additional steps.
1. Install WSL 2 and any Linux distribution from Microsoft Store
2. Run the distribution to finish setup
3. Install the required packages from the post (sudo apt install for Ubuntu/Debian)
4. Shift + Right Click in the folder where you have the script, the AP and the GSI packages
5. Open Linux shell there
6. Unpack & run script as stated in its help
Voila!
Wow ! Great job! I want to try it, but i'm getting many "Invalid sparse file format at header magic" while running the script, is it OK to flah the super.tar anyway?
jadfa said:
Wow ! Great job! I want to try it, but i'm getting many "Invalid sparse file format at header magic" while running the script, is it OK to flah the super.tar anyway?
Click to expand...
Click to collapse
It is totally OK
jadfa said:
Wow ! Great job! I want to try it, but i'm getting many "Invalid sparse file format at header magic" while running the script, is it OK to flah the super.tar anyway?
Click to expand...
Click to collapse
Yes, it is fine. These are just warnings produced by lpmake, they can not be suppressed. I could only suppress all the stdout/stderr from lpmake but it's no good in case of more serious warnings.
Updated to v0.92 with a couple of minor improvements.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
What should I do next with the raw file?
"Unknown super file format" is this how it should be?
ANDARXapi said:
View attachment 5490897What should I do next with the raw file?
"Unknown super file format" is this how it should be?
Click to expand...
Click to collapse
Of course not. The format of each file is checked using the "file" utility, it should return the string "Android super image". Try to run file /home/toor/APfilles/super.stock.raw . What is the response? And try doing it all without sudo. There is no need in root privileges.
uluruman said:
Of course not. The format of each file is checked using the "file" utility, it should return the string "Android super image". Try to run file /home/toor/APfilles/super.stock.raw . What is the response? And try doing it all without sudo. There is no need in root privileges.
Click to expand...
Click to collapse
The raw file opens as a picture
uluruman said:
Of course not. The format of each file is checked using the "file" utility, it should return the string "Android super image". Try to run file /home/toor/APfilles/super.stock.raw . What is the response? And try doing it all without sudo. There is no need in root privileges.
Click to expand...
Click to collapse
run without sudo: 168: ./lpunpack_and_lpmake/lpunpack: Permission denied Cannot correctly unpack the super file. Exiting ...
I managed to fix the script, you just need to give chmod +x rights to the files in the folder "lpunpack_and_lpmake": lpunpack, lpmake, lpflash, lpdump, lpadd
ANDARXapi said:
I managed to fix the script, you just need to give chmod +x rights to the files in the folder "lpunpack_and_lpmake": lpunpack, lpmake, lpflash, lpdump, lpadd
Click to expand...
Click to collapse
Hmmm. I have updated it, may be it'll help. Could you please test the latest version (v0.92a)? I want to work it out of the box for everyone, without sudo or any tweaks.
uluruman said:
Hmmm. I have updated it, may be it'll help. Could you please test the latest version (v0.92a)? I want to work it out of the box for everyone, without sudo or any tweaks.
Click to expand...
Click to collapse
Okay, I'll test it tomorrow, today I want to relax at the computer all day
uluruman said:
Hmmm. I have updated it, may be it'll help. Could you please test the latest version (v0.92a)? I want to work it out of the box for everyone, without sudo or any tweaks.
Click to expand...
Click to collapse
Checked, it works right away
Is there a way to install magisk and root?

Categories

Resources