KVM (Kernel Virtual Machine) on Samsung Galaxy A6 (Exynos 7870) - General Questions and Answers

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!

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

[v1.2] Linux for Samsung Galaxy J120F

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

[GUIDE]How to setup Dual Boot on legacy PC? (BlissOS and Windows 7/8.1/10)

NOTE: This guide is for MBR disks and legacy bios. If you want install on UEFI, this method can not help you.
1- Preparing the installation
a. Download BlissOS Official Roms ISO image.
b. Extract .ISO files into the *\BlissOS\ folder and create a custom size data.img (4gb for fat32 disk - Recomended 16 GB or 32 GB for NTFS disk)
* = Must be disk part. (you can select C:\ , D:\ or another diskparts)
Tips: You can create data.img file with Android PC Toolbox . Create and copy data.img into the BlissOS folder.
2- Setup grup for dual boot
a. Download EasyBCD and install it.
b. Run EasyBCD.exe > Add new entry > NeoGrub > İnstall
{
"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 Configure and delete all text. (editing menu.lst)
-Copy and paste that text there..
default 0
timeout 1
title BlissOS
root (hd0,1)
find --set-root ls /BlissOS/kernel
kernel /BlissOS/kernel quiet root=/dev/ram0 androidboot.selinux=permissive SRC=/BlissOS vga=788
initrd /BlissOS/initrd.img
boot
Click to expand...
Click to collapse
Important Note for root settings: You will change these numbers according to where you installed it.
root (hd0,1)
hd0 is your hdd number..
1 is your hdd disk volume number..
-Download Bootice for see disk numbers..
-Run Bootice.exe > Physical disk > Parts Manage - You will see disk parts.. No = hdd disk Volume number
-Rename your boot entry
-Select Count down (you can change timing "10")
-For Windows 10 / windows 8.1 os, check the "use metro bootloader" option.
-Click Save settings.
3-Setup completed. Restart your pc and have fun.
Error 15 file not found
Edit : Changed menu.lst entries. Now,It is set to be the root kernel.
WoltreX said:
Edit : Changed menu.lst entries. Now,It is set to be the root kernel.
Click to expand...
Click to collapse
I hope this works fine, I used the easy installer provided by bliss but it shows error "not all requirement are met" and it opens but I cant click anything.
jhetrosky said:
I hope this works fine, I used the easy installer provided by bliss but it shows error "not all requirement are met" and it opens but I cant click anything.
Click to expand...
Click to collapse
the installer provided by bliss is only compatible with UEFI systems. Is not compatible with legacy. And it will tell you in the output window(top right corner of the installer) which conditions are not met. Just have to look:good:
ElfinJNoty said:
the installer provided by bliss is only compatible with UEFI systems. Is not compatible with legacy. And it will tell you in the output window(top right corner of the installer) which conditions are not met. Just have to look:good:
Click to expand...
Click to collapse
Does it creates a swap partition or use ramdisk. If ramdisk, then compatibility will also depend on the RAM.
TeamPrimeOS said:
Does it creates a swap partition or use ramdisk. If ramdisk, then compatibility will also depend on the RAM.
Click to expand...
Click to collapse
There is no swap created by Bliss
There is a ramdisk
ElfinJNoty said:
There is no swap created by Bliss
There is a ramdisk
Click to expand...
Click to collapse
Thanks for the info, what is the minimum ram required then?
TeamPrimeOS said:
Thanks for the info, what is the minimum ram required then?
Click to expand...
Click to collapse
We've not had an issue with a minimum requirement.
This is an OS booting directly. Compare it to an older phone that can run Android: 1gb? 2gb?safe to assume more ram the better...
Most modern systems have at least 2gb which should be sufficient for any Blisss OS build.
As usual, why not test and find out?
#StasyBlissful
ElfinJNoty said:
We've not had an issue with a minimum requirement.
This is an OS booting directly. Compare it to an older phone that can run Android: 1gb? 2gb?safe to assume more ram the better...
Most modern systems have at least 2gb which should be sufficient for any Blisss OS build.
As usual, why not test and find out?
#StasyBlissful
Click to expand...
Click to collapse
Thanks for the info.
---------- Post added at 07:25 AM ---------- Previous post was at 07:23 AM ----------
jhetrosky said:
I hope this works fine, I used the easy installer provided by bliss but it shows error "not all requirement are met" and it opens but I cant click anything.
Click to expand...
Click to collapse
Can you list the mentioned incompatibilities.
TeamPrimeOS said:
Thanks for the info.
---------- Post added at 07:25 AM ---------- Previous post was at 07:23 AM ----------
Can you list the mentioned incompatibilities.
Click to expand...
Click to collapse
His issue was not due to incompatibility
The installer has some basic minimum requirements which is explained in the OP and Post 2. It also produces a log which would have explained his exact problem. There is also a YouTube video demonstrating the process successfully from start to finish.
*I didn't want their to be any confusion of there being something incompatible or broken about the UEFI Windows installer.exe*
Why the link for BlissOS/Android PC Toolbox has been deleted? I need it for installing Bliss OS on my not uefi pc
EDIT: Anyway I created an USB Bliss image (BlissOS 7.2 stable) and installed successfully on my hd (on a new partition formatted as ext4), I created then the entry with EasyBCD as suggested, changing the hd number, but when I choose the Bliss entry in the boot menu i got the "Error 13, invalid or unsupported executable format” message. Can anybody help me?
nerub config file for a android 9 Pie Bliss
when you click on easy BCD and install a neogrub and open neogrub install file
you i have seen someone has made a code like this >
defaul 0
timeout 10
root (hd0,X)
title 1. Normal Mode - Start Android OS in normal mode.
find --set-root /Android/kernel
kernel /Android/kernel root=/dev/ram0 SERIAL=random logo.showlogo=1 androidboot.selinux=permissive quiet SRC=Android/ DATA= CREATE_DATA_IMG=1
initrd /Android/initrd.img
boot
root (hd0,X)
title 2. Recovery Mode - Start Android OS in recovery mode.
find --set-root /Android/kernel
kernel /Android/kernel root=/dev/ram0 SERIAL=random logo.showlogo=1 androidboot.selinux=permissive quiet SRC=Android/ DATA= CREATE_DATA_IMG=1 SAVE_LO
initrd /Android/initrd.img root=/dev/ram0 androidboot.selinux=permissive vmalloc=192M buildvariant=eng nomodeset RECOVERY=1 RAMDISK=recovery.img SRC
boot
--------------------------------------------------------------------------------------
then instead of X you find your partition and like everything but
my ask for help is a code is incomplete as you see a second part a recovery more
start android in recovery mode is incomplete ? does anyone knows the ending of a code ? thank you ....its for making a better boot android neogrub menu and dual boot with windows 10 .......
@WoltreX hey, i just followed your guide for my laptop but after booting it just keeps showing a yellow animation forever any idea what's wrong ?
works on windows 10 surface tablet? without touch or bluetooth bugs?
Any suggestions on what to use if EasyBCD doesn't work states cannot run on (U)EFI.
Detecting android x86 found at Dev/sda6
Stuck at this screen plz help plz.....
Stuck at (blinkin) _
After I press the BlissOS boot option
The last phrase on the text is Android-x86. . . found at /dev/sda4
then around 20 seconds
black screen appear with blinking _ at the top corner
wtf is up with the shady as hell link for the toolbox? Russian website says I have to install Multy App to download it.
This is some bull**** right here, not touching that with goddam 10 foot pole
Do you know if this is possible in Linux Ubuntu?

[TOOL]Install Xposed Framework on MEmu w/ Android 7.1 x86_64

{
"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"
}
Xposed Framework for a MEmu instance w/ Android Nougat x86_64 image?
Actual offical XPosed Installer v3.1.5 - by rovo89, the German inventor and main developer of XPosed Framework - doesn't let you install a Xposed version that suits a MEmu instance w/ Android 7.1 64-bit: you get this screen when trying to install Xposed Framework on a MEmu's new Andoid 7.1 64-bit instance using XPosed Installer v3.1.5
Fortunately youling257 on Apr 20, 2018 published a x86_64 version of XPosed Framework v89 for Android Nougat on GitHub.
Today I show you that it's possible to successfully install Xposed Framework on a MEmu instance running Android 7.1 x86_64 image, assumed the MEmu instance in question is ROOTED and as a precaution Google Play Protect got disabled (FYI: using Xposed can sometimes trigger a safety response in your MEmu instance, which can end up disabling a few Xposed modules, courtesy of Google Safety net ). ):
How To:
1. Download archive xposed-v89-sdk25-x86_64.zip from here
2. Unzip the downloaded archive to any location of your Windows machine where MEmu App Player got installed onto, you'll get folders
a) Xposed-Android
b) XPosed-Windows
c) XPosed-APK
d) BusyBox-APK
3. Move and/or copy the extracted folder XPosed-Android to MEmu's shared folder "MEmu Download"
4. Close ALL running MEmu instances
5. Launch the Android 7.1.2 64-bit MEmu instance you want to get XPosed Framework installed on
6. Update its pre-installed BusyBox with "BusyBox v1.30.1" what is located in extracted folder BusyBox-APK !!!
7. Install Xposed Installer v3.1.5 app what is located in extracted folder XPosed-APK
( Available disk space on Android's /system partition: 324.12 MB )
( Disk space needed on Android's /system partition to install XPosed there: 27.2 MB )
8. Run the script Xposed-Installer.bat what is located in extracted folder XPosed-Windows
Screenshot:
9. Re-start MEmu instance's Android
If all went well then you'll get this screen shown when launching already installed XPosed Installer app
Note: This is ought to a severe bug in Xposed Installer v3.1.5 app - see remark below.
Nothing to Despair About!
You can install and run Android Nougat suitable XPosed modules at any time.
In order to test it installed XPosed module App Settings:
and ran it:
Additionally installed XPosed module Boot Manager et voilà it also flawlessly worked
As last one additionally installed XPosed module 3C All-in-One Toolbox Pro, what also perfectly worked
FYI:
List of XPosed modules which work or not with Andoid Nougat here
Give it a try, hope this helps.
Credits: youling257
Remark: Official Xposed Installer v3.1.5 Has a Severe Bug!
If you look inside decompiled XPosed Installer v3.1.5's apk file then you can read in file StatusInstallerFragment.java this
Code:
private void refreshInstallStatus() {
View v = getView();
TextView txtInstallError = (TextView) v.findViewById(R.id.framework_install_errors);
View txtInstallContainer = v.findViewById(R.id.status_container);
ImageView txtInstallIcon = (ImageView) v.findViewById(R.id.status_icon);
View disableWrapper = v.findViewById(R.id.disableView);
[color=red]int active = XposedApp.getActiveXposedVersion();
int installed = XposedApp.getInstalledXposedVersion();[/color]
if (installed < 0) {
txtInstallError.setText(R.string.framework_not_installed);
txtInstallError.setTextColor(getResources().getColor(R.color.warning));
txtInstallContainer.setBackgroundColor(getResources().getColor(R.color.warning));
txtInstallIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_error));
disableWrapper.setVisibility(8);
} else if (installed != active) {
txtInstallError.setText(getString(R.string.framework_not_active, new Object[]{XposedApp.getXposedProp().getVersion()}));
txtInstallError.setTextColor(getResources().getColor(R.color.amber_500));
txtInstallContainer.setBackgroundColor(getResources().getColor(R.color.amber_500));
txtInstallIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_warning));
} else {
txtInstallError.setText(getString(R.string.framework_active, new Object[]{XposedApp.getXposedProp().getVersion()}));
txtInstallError.setTextColor(getResources().getColor(R.color.darker_green));
txtInstallContainer.setBackgroundColor(getResources().getColor(R.color.darker_green));
txtInstallIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_check_circle));
}
}
If you look inside decompiled XPosed Installer v3.1.5's apk file then you can read in file XPosedApp.java this
Code:
public static int getActiveXposedVersion() {
[color=red]return -1;[/color]
}
public static int getInstalledXposedVersion() {
XposedProp prop = getXposedProp();
if (prop != null) {
return prop.getVersionInt();
}
return -1;
}
Conclusion: Status "Activated" NEVER gets correctly set, it's always set to ERROR.
Awesome, just awesome freaking tool. TY
I get this error for some reason when running the batch file. I put the folders in Program Files (x86)/Microvirt/MEmu
I even tried reinstalling memu and doing all the steps again, same error.
"Initializing ...
Executable MEmuC not found
Exiting..."
mag1x said:
I get this error for some reason when running the batch file. I put the folders in Program Files (x86)/Microvirt/MEmu
I even tried reinstalling memu and doing all the steps again, same error.
"Initializing ...
Executable MEmuC not found
Exiting..."
Click to expand...
Click to collapse
1. MEMUC was introduced with MEmu v6.
2. You don't have to make the unzipped package part of MEmu's installation: you put it anywhere on any disk of your choice.
Nice work! Fwiw, it'd be awsome if Xposed would work on Oreo 8.1...nothin' but bootloops.
https://forum.xda-developers.com/g5-plus/help/xposed-stock-oreo-t3851066
Don't know if it's just with the Moto G5+. I know I'd gladly pay for a fix to get me by, .getting the new G8 when they launch in a few months.
Any possibility or suggestion?
How would one go about porting this script to work on BlueStacks?
i commented out the first error check,
Code:
#if [ ! -f /system/lib/msf.ko ]; then
# error_abort 'Script NOT running on a MEmu instance'
#fi
then manually moved the xposed file's to /system (because the emulator seemed to crash at
Code:
\cp -rf "$XFILES/system"/* /system || error_abort "Copying $XFILES/system failed"
then updated the permissions on all the files, rebooted and xposed still says its not installed?
@XxyZ4114
JOOC: Do you have BlueStacks4 64-bit w/ Android N 64-bit installed?
I'm asking this because the XPosed Framework files provided here especially are for 64-bit Android N.
You can test this in terminal emulator:
jwoegerbauer said:
@XxyZ4114
JOOC: Do you have BlueStacks4 64-bit w/ Android N 64-bit installed?
I'm asking this because the XPosed Framework files provided here especially are for 64-bit Android N.
You can test this in terminal emulator:
Click to expand...
Click to collapse
Of coarse, otherwise the installer would download the correct zip wouldn't it?
@XxyZ4114
Where have you downloaded BS4 64-bit with Android N 64-bit from?
jwoegerbauer said:
@XxyZ4114
Where have you downloaded BS4 64-bit with Android N 64-bit from?
Click to expand...
Click to collapse
What on earth do you mean?
my browser history says.
https://www.bluestacks.com/download.html?
for a moment there i thought you were gonna say it hasn't been released yet. i had to stop my memu services just to double check.
Also, The batch script Xposed-Windows came back with memuc not found for me also. (when i was installing to memu)
I suspect it has something to do with the space in
D:\Program files\Microvirt and the fact the the variable on line 24 doesn't have quotation marks.
im not familiar with how batch variables work, so i may be wrong. To get it working for me i manually set !memuc! then enclosed all instances of it being used in quotes.
XxyZ4114 said:
What on earth do you mean?
Click to expand...
Click to collapse
I've read sometimes ago that BlueStacks is testing a 64-bit Android N. Actually don't know any source where it can be downloaded from... Maybe you can tell it me?
Yeah, i didnt do anything special to get it except not let the website determine the architecture.
You are probably right about them "testing" it, but arent the android7 images in memu still marked as beta also?
I think im just gonna stick with memu anyway.
mag1x said:
I get this error for some reason when running the batch file. I put the folders in Program Files (x86)/Microvirt/MEmu
I even tried reinstalling memu and doing all the steps again, same error.
"Initializing ...
Executable MEmuC not found
Exiting..."
Click to expand...
Click to collapse
same there, all admins right are on on exe file....
how fix it?
Its a scripting error, look back over the thread and see what I did to fix it.
XxyZ4114 said:
How would one go about porting this script to work on BlueStacks?
i commented out the first error check,
Code:
#if [ ! -f /system/lib/msf.ko ]; then
# error_abort 'Script NOT running on a MEmu instance'
#fi
then manually moved the xposed file's to /system (because the emulator seemed to crash at
Code:
\cp -rf "$XFILES/system"/* /system || error_abort "Copying $XFILES/system failed"
then updated the permissions on all the files, rebooted and xposed still says its not installed?
Click to expand...
Click to collapse
I need some help getting this to work. I have been stuck for days now.
Can you by any chance offer some help?
I keep getting the kind find Memuc error
....And when I change this line :
set "memuc=!memu_install_path!\MEmu\memuc.exe" TO "memuc=C:\Program Files\Microvirt\MEmu\memuc.exe
It finds memuc but I get two more errors as shown in the image below
lawrencee said:
I need some help getting this to work. I have been stuck for days now.
Can you by any chance offer some help?
I keep getting the kind find Memuc error
....And when I change this line :
set "memuc=!memu_install_path!\MEmu\memuc.exe" TO "memuc=C:\Program Files\Microvirt\MEmu\memuc.exe
It finds memuc but I get two more errors as shown in the image below
Click to expand...
Click to collapse
The problem is that ( default ) MEmu's installation path "C:\Program Files\Microvirt" contains a space character: the command line doesn't know where the file's pathname begins or ends, due to the space. You can try as follows
Code:
set "memuc=[color=red]'[/color]!memu_install_path![color=red]'[/color]\MEmu\memuc.exe"
means enclose all occurences of the !memu_install_path! variable by single-quote.
jwoegerbauer said:
The problem is that ( default ) MEmu's installation path "C:\Program Files\Microvirt" contains a space character: the command line doesn't know where the file's pathname begins or ends, due to the space. You can try as follows
Code:
set "memuc=[color=red]'[/color]!memu_install_path![color=red]'[/color]\MEmu\memuc.exe"
means enclose all occurences of the !memu_install_path! variable by single-quote.
Click to expand...
Click to collapse
Thanks for replying... I tried what you suggested, but it took me right back to square one : Memuc can't be found
lawrencee said:
Thanks for replying... I tried what you suggested, but it took me right back to square one : Memuc can't be found
Click to expand...
Click to collapse
Encountered that the real way to fix the problem is to convert a path filename to short path filename ( DOS-conformant filename )
Code:
set "memuc=!memu_install_path!\MEmu\memuc.exe"
[color=red]for %%f in ("!memuc!") do ( set "memuc=%%~sf")[/color]
Sorry for your inconvenience.
lawrencee said:
How would one go about porting this script to work on BlueStacks?
i commented out the first error check,
then manually moved the xposed file's to /system (because the emulator seemed to crash at
I need some help getting this to work. I have been stuck for days now.
Can you by any chance offer some help?
I keep getting the kind find Memuc error
....And when I change this line :
set "memuc=!memu_install_path!\MEmu\memuc.exe" TO "memuc=C:\Program Files\Microvirt\MEmu\memuc.exe
It finds memuc but I get two more errors as shown in the image below
Click to expand...
Click to collapse
You are starting the emulator and letting it load before running the script right?

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