【R&D】 ☆.☆.☆ .. debDroid & "Linux Installer"= full Linux chroot distro on SGY .. ☆.☆.☆ - Galaxy Y GT-S5360 Android Development

【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

Related

[APP]Ubuntu Install Guide - Galaxy Note Testers wanted - 12.04 in testing

I have working on a project in the form of an app, which guides you through the installation of Ubuntu within android via chroot. It includes a ubuntu 10.10 image I have been working on which includes lots of program to allow users to develop program/scripts etc within Ubuntu on there phone/tablet.
However I have I have yet to get much testing on this device and would like more feedback from users!
Please post your device/kernel/rom along with what did and didn't work, so I can draw up what I need to change in the next release of the app/ubuntu build.
Website
http://linuxonandroid.blogspot.com/
Video
http://www.youtube.com/watch?v=UCqzs8yQTM8
App Download
Free App
Paid App
Boot Script
ubuntu.sh(V5)
Full Image
This image is 1.5GB to download, once extracted 3.5GB, and include alot of programs like openoffice, thunderbird, firefox and over programs for 'developing' - Also allows you to switch between the LXDE and Gnome desktops, and you can define screen size on boot!
ubuntuV5-image.zip
Lightweight Image - This is yet to be included in an app, will be included in the next release (aka 2.0 ), so get it now before anyone else!
This image is just under 500MB to download, once extracted 2.5GB, and include only programs needed (LXDE desktop, web browser, + other basic programs) also allows you to define screen size on boot
ubuntuV5-sm-image.zip
12.04 images
I have now started work on building new 12.04 images these come in core (just the bear-bones ubuntu) and full (ubuntu with GUI and other programs) and will be updated as 12.04 moves through its milestones (and when I make new updates to the mods I make from the main stream arm port).
These are for testing ONLY until 12.04 reaches stable release.
You can view the images here:
http://sourceforge.net/projects/linuxonandroid/files/Ubuntu/12.04/
I also want to build up a small group of testers who I can email with new images and scripts, these will include all future distros that I do. If you are interested in joining this test group please PM me or send a email to [email protected]
The only requirement is that your willing to test and send feedback along with screen shoots etc where required, it would also be good if your willing to try different roms and kernels for your device!
Sig Banner
Show your love of ubuntu on android with my sig banner:
{
"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"
}
image url is "http://dl.dropbox.com/u/11206993/ubuntuuser.png"
Other Guides
Like this guide? want to try something different? then check out my other guides for different distro's
Backtrack - This is a distro that is based around security testing, it also includes the Gnome desktop environment and a range of other programs.
Updates
18/02/12
*New 12.04 images started building, for now not included in the app but once a bit more stable will be included
29/01/12
*New V5 small image, featuring fixed Java, even more lightweight (now around 1.2GB free) and user can set screen size on boot
*PAID New Build guide which shows you how to build your own Ubuntu images
*Brand new UI To make the whole thing more useable
*PAID new 'one click boot' feature to allow quick booting from either the widget or inside the app
*PAID new widget to activate the one click boot
*PAID app install guide changed in light of 'one click boot'
*Fixed keyboard mapping of random letters in Gnome
18/01/12
*Large ubuntu image now allows user to set screen size on boot!
*Large Ubuntu image now lets you select between LXDE and Gnome desktops
*Large Ubuntu image has been recompiled to fix the likes of Java (note some of the above changes will be included in the small image in the future)
*FAQ section updated with more answers to questions I have been getting
*Install guide updated in light of the new large image
06/01/12
*PAID app file downloads now use new fast FTP server and support direct downloading (click the button to download a image and it starts to download right away)
*New boot script which has fixed problems with it not booting on alot of devices, and fixed problem which some people getting a grey screen when loading UI
*Boot script now downloaded in zip file to fix problems with downloading script
*Both apps fixed to support low resolutions
*Both apps cleaned up
28/12/11
*PAID app now supports 960x540 'qHD' resolution
*ALL Ubuntu lightweight images cleaned up even more saved another 300MB of space
*ALL Ubuntu images updated with all new updates
*ALL Ubuntu images now in .zip format to fix problems with some peoples devices failing to extract the .rar files
*Boot script updated, once booted now terminal acts like a command line interface for Ubuntu, and some boot problems now fixed
*Image and boot script now downloadable separately to allow easier updating
19/12/11
New 'lighter' ubuntu image options for all resolutions already supported
15/12/11
New ubuntu images with all updates up to 15/11/11
FREE app ubuntu image resized to fit 800x480 resolution
PAID app ubuntu images now includes 4 images for 800x480, 854x480, 1024x600 and 1280x800 resolutions
http://forum.xda-developers.com/showpost.php?p=20598548&postcount=83
Samsung Galaxy Note G7000
FM 1.5 Kernel
RocketRom V10 (14Toggle, smoothnessupdate, addperformance, stock theme)
Note freezes after executing ubuntu.sh, only restarting by holding powerbutton helps...
It's a pity, I thought booting ubuntu is only possible on a Rom with loop devices capabilities and now I read that only the stock rom is working
tried ubuntuv3.sh see picture:
http://imageshack.us/f/808/sc20111223042953.png/
Allamann said:
http://forum.xda-developers.com/showpost.php?p=20598548&postcount=83
Samsung Galaxy Note G7000
FM 1.5 Kernel
RocketRom V10 (14Toggle, smoothnessupdate, addperformance, stock theme)
Note freezes after executing ubuntu.sh, only restarting by holding powerbutton helps...
It's a pity, I thought booting ubuntu is only possible on a Rom with loop devices capabilities and now I read that only the stock rom is working
tried ubuntuv3.sh see picture:
http://imageshack.us/f/808/sc20111223042953.png/
Click to expand...
Click to collapse
Indeed its VERY odd that stock works but custom roms do not work...should really be the other way round, perhaps something to do with how the device file system in custom roms is different or something?
I don't know, this is the problem trying to support as many devices as possible, I don't have the device to test and work out what's wrong, just got to keep basically stabbing into the dark until I hit something
Change log for new release (release will be in the next few days for paid end of next week for free) - all new images etc will be added to the first post as they are finished and uploaded!
*PAID app now supports 960x540 'qHD' resolution
*ALL Ubuntu lightweight images cleaned up even more saved another 300MB of space
*ALL Ubuntu images updated with all new updates
*ALL Ubuntu images now in .zip format to fix problems with some peoples devices failing to extract the .rar files
*Boot script updated, once booted now terminal acts like a command line interface for Ubuntu, and some boot problems now fixed
*Image and boot script now downloadable separately to allow easy updating of the script
*+more likely before release
Allamann said:
http://forum.xda-developers.com/showpost.php?p=20598548&postcount=83
Samsung Galaxy Note G7000
FM 1.5 Kernel
RocketRom V10 (14Toggle, smoothnessupdate, addperformance, stock theme)
Note freezes after executing ubuntu.sh, only restarting by holding powerbutton helps...
It's a pity, I thought booting ubuntu is only possible on a Rom with loop devices capabilities and now I read that only the stock rom is working
tried ubuntuv3.sh see picture:
http://imageshack.us/f/808/sc20111223042953.png/
Click to expand...
Click to collapse
+1 I got it to boot with cf kernel but not with fm or abyss kernel.
Sent from my GT-N7000 using xda premium
timstanley1985 said:
+1 I got it to boot with cf kernel but not with fm or abyss kernel.
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
Odd so I'm guessing the two kernels that don't work don't have loop support...best talk with the kernel developer
Sent from my HTC Desire S using XDA App
timstanley1985 said:
+1 I got it to boot with cf kernel but not with fm or abyss kernel.
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
Yep, I was really enjoying - had PHP and mysql installed and working as a wee test environment, then flashed FM and no more Ubuntu.
Thanks for the work - appreciated
If I manually downloaded the script and the image, where do I put
the extracted content of the zip, and the script ? on the root of external SD or phone storage ?
lucid said:
If I manually downloaded the script and the image, where do I put
the extracted content of the zip, and the script ? on the root of external SD or phone storage ?
Click to expand...
Click to collapse
Place them in a folder called ubuntu on either your sdcard or internal memory as you have both either should work
Sent from my HTC Desire S using XDA App
Thanks, by pressing ahead without knowing I put the files there, however, in terminal emulator, after aquiring superuser persmissions, changing to the ubuntu folder wont work. I must be doing something wrong. I came as far as cd /sdcard but /sdcard/ubuntu fails. Asking ls -a says dir is empty ? Linux noob
lucid said:
Thanks, by pressing ahead without knowing I put the files there, however, in terminal emulator, after aquiring superuser persmissions, changing to the ubuntu folder wont work. I must be doing something wrong. I came as far as cd /sdcard but /sdcard/ubuntu fails. Asking ls -a says dir is empty ? Linux noob
Click to expand...
Click to collapse
check in a file explorer where the sdcard is mounted, sometimes the internal memory is mounted as the sdcard directory and then the sdcard itself is mounted in another directory within that.
Once you work out where its mounted then just cd to that location
Got it to work. Copied the ubuntu folder to /
Pretty responsive in 24bit colour. Working with cassies ultralight v4.
lucid said:
Got it to work. Copied the ubuntu folder to /
Pretty responsive in 24bit colour. Working with cassies ultralight v4.
Click to expand...
Click to collapse
which Kernel/Rom?
Hi
Before run ubuntu.sh check if loop inst bussy with other kind of programs who use it.
try losetup will show you how many loop you have used and edit ubuntu.sh to get 1 free
like last 1 user will be 10 then line with busybox mknod /dev/loop11 b 7 11
and wher you see loop0 change to loop11 or any free number.
Hope will works for you.
---------- Post added at 12:06 PM ---------- Previous post was at 12:03 PM ----------
Hi,
Nice work but you forgot something.
Your image wont work on many device since the /sdcard partition if VFAT who limit the file to 2G.
converting /sdcard to ext2 or ext4 is the way to work with files larger than 2G.
B.
dahas said:
Hi
Before run ubuntu.sh check if loop inst bussy with other kind of programs who use it.
try losetup will show you how many loop you have used and edit ubuntu.sh to get 1 free
like last 1 user will be 10 then line with busybox mknod /dev/loop11 b 7 11
and wher you see loop0 change to loop11 or any free number.
Hope will works for you.
---------- Post added at 12:06 PM ---------- Previous post was at 12:03 PM ----------
Hi,
Nice work but you forgot something.
Your image wont work on many device since the /sdcard partition if VFAT who limit the file to 2G.
converting /sdcard to ext2 or ext4 is the way to work with files larger than 2G.
B.
Click to expand...
Click to collapse
Thank you very much I will integrate these changes in the next version of the script
you can also change de fstab line where root partition is mount by uuid and replace by name
losetup returns nothing...
I also asked the dev of FM kernel and he told me that it has loop capabilities
if losetup show nothing then or you dont have loop set or you not root.
for see if you r root type id and the have to show your id. If is not root type su -
For the no loop set then the original ubuntu.sh have to work.
Runs perfectly on my Note
Had rooted it yesterday with CFRootFlasher
Kernel is "KK9" (Android 2.3.6)
Tested the V3 800 first, and now running with the V4 1280 image
Btw I´m an Android noob, came from Ios 2 weeks ago, so i dont really know what is important for you to know. But if you want to know something, just ask
kevinturbo said:
Runs perfectly on my Note
Had rooted it yesterday with CFRootFlasher
Kernel is "KK9" (Android 2.3.6)
Tested the V3 800 first, and now running with the V4 1280 image
Btw I´m an Android noob, came from Ios 2 weeks ago, so i dont really know what is important for you to know. But if you want to know something, just ask
Click to expand...
Click to collapse
Thank you very much, glad to hear you have it working!
And welcome to the dark side

[PORT] [TOOL] Carliv Touch Recovery for MediaTek devices

Old Tool
Added on Mar 05, 2014
Updated CTR v2.2 for MTK devices with ubifs ONLY
And Thanks to dhinesh77 for countless beta-testing & most importantly, Master Shifu carliv for looking into those ubifs source code to make it work on MTK devices....
{
"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"
}
Download link here...
Solution to cannot see whole sdcard is here by Master Shifu himself, it is actually a new feature/ function... :laugh:
----------------------------------------------------------
Added on Jan 27, 2014
Updated CTR v2.2 Recovery for MT6575,15, 77, 17, 89, 82, 88, 92
MT6572 (ext4 only, ubifs not supported)
Pls support by donation or at least drop your thanks here to encourage Master Shifu for further development...
Download link here
----------------------------------------------------------
Added on June 02, 2014
New Porting Tool CTRv-1.4 for ext4 devices ONLY. . .
Known problems : Touch not working on some MTK devices . . .
Any bugs report here . . .
----------------------------------------------------------
Added on June 10, 2014
New AIO Porting Tool Easy Magic CTR v2.4 Installer for MTK for ALL MTK Cortex-A9/ A7 devices ONLY with either mtd, emmc, ubifs or custpack partition . . .
Any bugs report here . . .
Updates
Thanks to surfturtle for reporting . . .
Workaround : Use Manual mode & select 720x1024 that is the screen res for 720x1280 . . .
This is an AIO porting tool so go ahead & try the differrent res at Manual mode, the unpack/ repack feature, play around with it & you'll learn what is needed for porting custom recoveries . . .
----------------------------------------------------------
Added on June 17, 2014
Users using XP & 720x1280 MTK devices use this fix . . .
----------------------------------------------------------
Added on July 01, 2014
CTRv2.5 refer to here . . .
----------------------------------------------------------
Notice to annoying n00bs & newbies
Most of your questions are already answered on this thread so pls read it...
1) Either your MTK is still ro.secure=1 then use this method here then EXIT/ CLOSE it first then re-start the porting tool...
2) i've already put in alot of error checking to make sure this porting tool works, either the Auto or Manual port, it will leave behind Ported-CTR folder then manually install it via SPFT when it fail to auto install.... Most probably why it fail to install is b'cos you use SuperSu did you bother to look at your MTK device & grant access to Root Shell... There has been cases where the stock recovery is already corrupted then this tool will also port a corrupted CTR too. Re-install your stock 3e recovery.img & make sure you can boot into it then only use the porting tool again or just use the manual port... The differences is Auto will upload whatever recovery already at your device be it older CWM or TWRP & it will repack it with CTR ramdisk. While Manual will use whatever at your stock 3e -> factory_init.project.rc, meta_init.modem.rc, ueventd.rc & etc... Refer to this by Master Shifu carliv... :good: This tool has no log b'cos it is actually a simple copy & paste program, thats what it actually do.... :laugh:
3) Pls bear in mind that this porting tool has been downloaded by many & confirmed working BUT i can't guarantee that it will work flawlessly on your MTK device so continue trying & report back the solution if you found one...
4) This has been mentioned many times on this thread, if you really can't get it to work then don't just say your porting tool doesn't work...
Instead list out everything then it'll be easier to trouble-shoot
a) What OS you are using on the PC & your MTK...
b) Did you disable UAC & Anti-Virus on your PC
c) Did you execute the porting tool at C:\ drive if you're using XP else then at your Desktop READ what the porting tool says & it will ask you to wait then wait for it to continue without pressing the OK button...
As said many times, this porting tool uses Russian Master Shifu Michfood Repack Utils Huge Credits to him, it is actually DOS program with cygwin dll working at the back so all DOS limitation still applies such as it will ONLY operate properly when it is executed at the Desktop on latest OS... Tested working on XP to 8.1
As much info as possible then it'll be easy to identify where it goes wrong & did you bother to read 5 to 10 pages from the back then you would have know what is the latest story...
Last but not least, i didn't compile CTR so any features not working / bugs found pls report it here BUT again, read the whole thread first as most already answered at that thread...
Q&A
1) Touch not working, refer to here...
2) MTK Alcatel devices refer to here & here... Supported on CTRv2.4
3) All MTK devices supported except this...
4) Inverted screen solutions -> Compile your own
5) CTRv2.5
Nice one bro.....will be helpful for many.......!!:good:
Good to see you back......!
--------------------
P.S: Thinking of creating a Multi-tool for MTK6573.......what are features that can be added bro ??
Yo, Bala bro, been quite busy with work, until now only manage to finish this tut...
Yeah, i was thinking about that too, to mod dsixda's android kitchen just for MT6573 platform that includes Bruno Martins's unpack/ repack boot.img, unpack/ repack recovery & port it to CWMR like this tut, replace a2sd with data2ext or ad2sdx; only this two mod stable on MT6573 platform so far that i have tested...
actually did try but give up half way as my scripting skill is still at novice level...
did read it on some other forum that someone is actually doing that too but i never see it got release though...
Well i guess we need dsixda expertise to be able to do that but he is retired now...
Added on Sept 04, 2012 Info Update
Dark Tremor's a2sd/ Apps2sd works well on MT6573 platform after all...
i was using the last version 2.7.5.3 Beta 04 all this while & i always use a2sd datasd all the time & it FC all apps after a few weeks of using/ sometimes a few days even after a fresh install...
After all, DT_a2sd/ apps2sd is actually apps to sd & i always push it as data2sd...
Only until recently that i play with Android Kitchen, use it to extract my system.img & update it with its built-in Darktremor Apps2SD version 2.7.5.2, it works extremely well because 2.7.5.2 doesn't support a2sd datasd feature...
So guys, if you are using DT_a2sd beta 4, don't use the command a2sd data2sd instead use a2sd cachesd...
You can checkout my other post here
great tools and description
hello y2yu,
Glad you find it informative...
According to this site, there will be another 2 new cpu after MT6575/ MT6577... (use google chrome for translation)
This means MT6573 is 5 generation behind MT6588 & it is still unexploit with all info/ tools scattered all over the web...
Thats where i decided to compile all these info & put it here... :good:
Now that i check, i've bought my first mediatek back in 2008...( never knew it until i check it just now ) :silly: It has serve me well for almost 2 years in spite of dropping, a few times from 8 feet height when i was on a ladder & it still works ! It was the last drop that spoilt the mic & render it unuseful. It can still make & receive call to date but the other side can't hear what i say...
At that time, made in china phone was famous for its extra loud speaker/ ringtone but doesn't support android back then...
haha, enough of history, have you manage to port CWMR to your MT6573 ? In fact, i have manage to create a plugin for dsixda's Android Kitchen which can port CWMR to any MT6573 with a few copy & paste features just like Android Kitchen... :good:
Still testing it, may be you would like to be the first beta tester...
Thank you so much for this. I managed to "port" cwmr to my phone without going through the build hassle. Thanks also go to koush for the builder. I had downloaded the source but hadn't managed to completely set up my build environment as there are a couple of gotchas to iron out for ROM development.
Anyway, this serves as a good precursor to actually porting a custom recovery to new devices. Just one problem - cwmr does not recognise any of the hardware buttons for the select action. I can only scroll. The phone has 2 side buttons for volume control, 1 power button on top, and at the bottom on the home row there is a home button, the menu (these 2 also scroll, in stock recovery the home button selects), the previous, and the search. [1][2]
Do you happen to have any cure for this? Is there some place I could remap hardware buttons? One more thing. I made sure root shell access was configured but adb shell will not work (insufficient permissions). Also, adb devices, as is the case for stock recovery, will return question marks. Any idea?
edit: It is important to mention that the flashing had some errors:
Code:
/mnt/sdcard # flash_image recovery recovery.img
mtd: read error at 0x00000000 (Out of memory)
mtd: read error at 0x00020000 (Out of memory)
mtd: read error at 0x00040000 (Out of memory)
mtd: read error at 0x00060000 (Out of memory)
mtd: recovery successfully wrote block at 0x00000000
mtd: recovery successfully wrote block at 0x00020000
mtd: recovery successfully wrote block at 0x00040000
mtd: recovery successfully wrote block at 0x00060000
... <snip>
... <snip>
... <snip>
mtd: recovery successfully wrote block at 0x00420000
mtd: recovery successfully wrote block at 0x00000000
The flash of the stock recovery goes without any error.
[1] http://symphony-mobile.com/index.php?route=product/product&path=63&product_id=75
[2] http://www.tinno.com/en/productinfo.aspx?proid=128
u r most welcome, jason...
i think the button key map is actually built inside /sbin/recovery so there is nothing much you can do about it unless you build the whole recovery from sources & change it from there...
i do have feedback from fellow xda member that has the same problem flashing recovery with error however he reported back, all menu options at cwm works fine...why don't you use mobileuncle tools, its easier that way...found another flashing tool for ZTE, reported unknown image but it works fine on MT6573 platform too...
As for the adb shell at cwmr, it should work by default & if it doesn't then you have the check default.prop & make sure ro.secure=0 As for stock recovery, mine doesn't work at all...
i think after 6.0.0.3 version, ported cwmr has the camera button as enter key for MT6573 if you built it from koush builder...
yuweng said:
u r most welcome, jason...
i think the button key map is actually built inside /sbin/recovery so there is nothing much you can do about it unless you build the whole recovery from sources & change it from there...
i do have feedback from fellow xda member that has the same problem flashing recovery with error however he reported back, all menu options at cwm works fine...why don't you use mobileuncle tools, its easier that way...found another flashing tool for ZTE, reported unknown image but it works fine on MT6573 platform too...
As for the adb shell at cwmr, it should work by default & if it doesn't then you have the check default.prop & make sure ro.secure=0 As for stock recovery, mine doesn't work at all...
i think after 6.0.0.3 version, ported cwmr has the camera button as enter key for MT6573 if you built it from koush builder...
Click to expand...
Click to collapse
Crap, then I have to dig through the sources really hard. This phone has no camera button.
If I'm not wrong the last time I checked "mobileuncletools" uses flash_image. Either that, or nandwrite, or failing that, dd. Coming from a Linux and UNIX background I'm more comfortable with the simpler underlying commands rather than a complex front-end wrapper around those commands. NAND images have some peculiarities so we kinda have to deal with it I guess.
I had triple-checked that ro.secure != 1 I think this is probably a hardware issue where during recovery there is no bridging interface exposed.
Anyway a couple of other things related to the documentation side of this:
* Why not just upload your own recovery.fstab to the builder instead of editing it later?
* Changing the fstab is only needed for those who have an ext-sd, i.e. a second partition for the memory card
* The bin/ folder is empty, and the lib/ folder only contains the ext2 module, so if above not needed, this is also not needed
So in the end, I think we can simply advocate use of the builder as-is. What do you think of putting up a list/database of MTK phones and some details? Like rootable or not, cwmr available or not, etc. I think RootzWiki would be a good place for that?
AFAIK, most readers at xda are non-registered, only when they are stuck somewhere or they really needed help then only they'll register & start posting; that is including me !
You can see my other post where it is nearing to 300 over downloads while the MTK phones list feedback from users is less than 10 !
AFAIK, all MT6573 are root-able & all needs data2sd mod. There are so many apps & games at google play, MT6573's 256 or 512MB internal memory gets filled up pretty fast !
On adb shell, did you have all the three adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) & on linux, i use ./adb shell to get it to work...
yuweng said:
AFAIK, most readers at xda are non-registered, only when they are stuck somewhere or they really needed help then only they'll register & start posting; that is including me !
Click to expand...
Click to collapse
Very true.
AFAIK, all MT6573 are root-able & all needs data2sd mod. There are so many apps & games at google play, MT6573's 256 or 512MB internal memory gets filled up pretty fast !
Click to expand...
Click to collapse
Indeed. I actually want to try just bind-mounting data to a second partition, but I don't know whether init scripts are supported on this phone (would be better instead of editing the init itself). But I will also try this data2sd mod, haven't looked at it yet. After clearing out loads of preincluded apps I was happy for a while, but am now running out of space again!
On adb shell, did you have all the three adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) & on linux, i use ./adb shell to get it to work...
Click to expand...
Click to collapse
Actually I have the Android SDK set up already on my system, so everything is conveniently there including adb. I will have to find some other day to troubleshoot why the bridge would not work during recovery.
re-packing error
Now I am doing this on Xubuntu so maybe that's why it doesn't work:
I get the following when trying to repack:
MTK-Tools by Bruno Martins
MT65xx repack script (last update: 31-07-2012)
Repacking recovery image...
Ramdisk size: gzip: unpack/ramdisk-repack.cpio.gz: No such file or directory
Could not open ramdisk file: ramdisk-repack.cpio.gz
Any ideas?
Unpacking is no problem.
This Android Kitchen plugins only work with cygwin...
Even unpacking shouldn't have work because mkbootimg & 7z is windows exe...
i'm in the mid of modding it so that it can work on linux too...
Thanks for your reply yuweng. 7z is available as a plugin for Ubuntu too.
In the mean time I will try another website which I already posted a link before.
http://www.slatedroid.com/topic/32450-how-to-unpack-repack-systemimg-properly-using-linux/
breaky9973 said:
Now I am doing this on Xubuntu so maybe that's why it doesn't work:
I get the following when trying to repack:
MTK-Tools by Bruno Martins
MT65xx repack script (last update: 31-07-2012)
Repacking recovery image...
Ramdisk size: gzip: unpack/ramdisk-repack.cpio.gz: No such file or directory
Could not open ramdisk file: ramdisk-repack.cpio.gz
Any ideas?
Unpacking is no problem.
Click to expand...
Click to collapse
It will work on any GNU/Linux as long as you have the proper tools installed. Almost all tutorials for Android "modding" are Cygwin-based, which basically emulates a GNU system on Windows (so you can skip all parts about "setting up" anything). Here your file does not exist, please double-check that it does. This is a perl script which utilizes gzip, gunzip, and cpio. Make sure these are available as well.
Btw, this is independent of Android Kitchen. You don't need that if you're using the builder. Android Kitchen is just a front-end to modifying ROMs. So skip the Kitchen for now and do this manually.
Again, the "another website" you link to is about backing up real filesystems (which the boot and recovery partitions are not). See: http://forum.xda-developers.com/showthread.php?t=1744265&page=2
yuweng: What benefit does using the Android Kitchen have over simply using the builder? All you need is a rebuilt /sbin/recovery along with the resources in /res, and optionally an ext2.ko if it does not exist on the phone itself.
This is just a simple tool for n00b/ newbie...
i was a n00b six months ago & even now my android knowledge is still half empty...
As the first post says, there are hundreds if not thousands of android phone based on MT6573 SoC design, each with their own recovery.img-kernel.img & AFAIK, non is compatible for use on others...
i simply provided a plugins based on Android Kitchen so that even a n00b/ newbie can port cwmr to their MT6573 simply by just drag & drop files to it... You are a programmer by profession i presume, so this is chicken feet to you but to a n00b/ newbie they don't no even where to start, like i did... :laugh:
you'll be surprise if i tell you the top download of my tuts is rooting & installing busybox !
As for the builder, you still need to unpack it, copy few files over & repack it with bgcngm's MTK-tools for it to work on MT6573...not alot of n00b/ newbie know how to do that !
the intention of this plugins is to be able to port cwmr to any mt6573 based android phone...
yuweng said:
This is just a simple tool for n00b/ newbie...
i was a n00b six months ago & even now my android knowledge is still half empty...
As the first post says, there are hundreds if not thousands of android phone based on MT6573 SoC design, each with their own recovery.img-kernel.img & AFAIK, non is compatible for use on others...
i simply provided a plugins based on Android Kitchen so that even a n00b/ newbie can port cwmr to their MT6573 simply by just drag & drop files to it... You are a programmer by profession i presume, so this is chicken feet to you but to a n00b/ newbie they don't no even where to start, like i did... :laugh:
you'll be surprise if i tell you the top download of my tuts is rooting & installing busybox !
As for the builder, you still need to unpack it, copy few files over & repack it with bgcngm's MTK-tools for it to work on MT6573...not alot of n00b/ newbie know how to do that !
the intention of this plugins is to be able to port cwmr to any mt6573 based android phone...
Click to expand...
Click to collapse
yuweng, and I thought you were the programmer! (other than bgcngm I see you as our local MTK expert)
Seriously, we are all noobs. That was my main concern :silly: Android Kitchen interface is command-based whereas the builder you just need to upload an image and you will get an image in return.
So do you mean using Android Kitchen there is no need to go through setting up Cygwin, repack, unpack, etc.? Just download the Kitchen, enter some commands, and you will have a recovery.img which you can flash directly?
i'm a half-cook programmer...
yaya, but you need to setup java, Android Kitchen & the plugins scripts will do everything... :laugh: That is for linux...For windows, you already know...
As for the builder, it works on major brands where it can be flash directly but not on mt65xx...
Ahh OK in that case I do suppose the Kitchen would be much simpler.
Ya, the MTK partitions and images are not the same as those of other devices. That's why Bruno wrote the script to help us
jason_cheng said:
yuweng, and I thought you were the programmer! (other than bgcngm I see you as our local MTK expert)
Seriously, we are all noobs. That was my main concern :silly: Android Kitchen interface is command-based whereas the builder you just need to upload an image and you will get an image in return.
So do you mean using Android Kitchen there is no need to go through setting up Cygwin, repack, unpack, etc.? Just download the Kitchen, enter some commands, and you will have a recovery.img which you can flash directly?
Click to expand...
Click to collapse
Hi Jason,
I have cpio and can execute perl scripts. gzip and gunzip are setup too. The script just cannot find the file ramdisk-repack.cpio.gz and I cannot find it anywhere.
Maybe the dump of the recovery.img was not good. I will try again.
*UPDATE*
The mkbootimg executabe I download was not correctly installed. Now the script finishes without error.
However the recovery.img doesn't do anything. I think I have to look for another mkbootimg or compile one from source myself...
For people who are interested to try the Ubuntu way:
Unpacking:
sudo perl ./unpack-MT65xx.pl recovery.img
Re-packing:
sudo perl ./repack-MT65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./recovery.img
I will attach the mkbootimg once I succeed

[HOW TO] reverse engineer kernel

Hi,
So although companies of course are bound by law to release kernel sources, and most of them do, there are sometimes circumstances where you still would like to see the disassembly of the kernel code. For example sometimes an ASM deadlisting can be easier to understand than complicated C++ code. Or maybe you suspect that your kernel code is slightly different than the source code your manufacturer supplied, maybe due to a slightly different configuration. It happens.
Anyway, whatever reason you might have, this is a small tutorial on how to obtain that kernel code in a deadlisting.
1) First of all you need of course to dump the boot image. I normally do this via: cat /dev/block/mmcblk0p17 > /sdcard/boot.img. But it depends on which partition the boot image resides. Use a partition tool to find out.
2) Seperate the kernel image from the boot image. I use Android Image kitchen myself.
3) The kernel image is self extracting. This means that it is just the compressed kernel + the decompression code to decompress it. We want to use a regular decompression utility so we want to strip that decompression code off in order for a normal decompression utility to handle it. Now, on older kernels (up to 2013 I think) you could use a tool like this to decompress the kernel: http://forum.xda-developers.com/showthread.php?t=901152 It's based on the fact that the kernel is Gzip compressed. However newer kernels use LZO compression. Luckily it's quite easy to do it manually. First of all you need to cut off the part upto where the kernel image starts (the decompression code). You need to search for 0x89 0x4c 0x5A 0x4F. That's 0x89 followed by "LZO", which is the start of the compressed file header. Now in my case I needed the 2nd hit (in my case the 1st hit is followed by some text and then like 0x50 bytes later follows the second hit, I needed that one). So cut off the part upto that, rename the file as a .LZO file and then you can just decompress it with any LZO decompresser, for example "Universal Extractor".
4) So now we have a decompressed kernel image. You could load this up into IDA pro already but reverse engineering will be hard since all symbols are missing. So how to get the symbols ? We can dump them from your phones memory too ! However the linux kernel is since quite some versions already protected against doing that, for obvious reasons. If you're root though, you can disable that protection via issueing:
Code:
echo 0 > /proc/sys/kernel/kptr_restrict
Next you can simply dump the symbols like:
Code:
cat /proc/kallsyms >/sdcard/symbols.txt
5) You now have a file containing all the symbols. But how to convert this into an IDA pro script ? You could write a simple tool or script that does it. Luckily I already did that for you, see the attached file However the symbol file you just dumped from memory wont contain the windows carriage returns after each line, which my tool needs (sorry too lazy to fix it up, lol), so you need to add them first. I use 'edit pad lite'. In that you simply copy en paste the file and save it. Once you open it in notepad you will now see it's perfectly carriage return formatted. Now use my tool to open it and it will create an IDC script
6) ready to load it all up in IDA pro now ! Open the kernel in IDA pro, select ARM as processor (that is if you're on such a phone of course) and load the kernel to the right address. Usually it will be the first address of your IDC script. But also a tool like Android Image Kitchen will show you the correct address. Then if the kernel is opened and loaded at the correct address, simply open the IDC script and it will add all symbols.
And there you have it ! A perfect deadlisting of your android kernel, containing all symbols ! Happy reverse engineering !
very nice one. good job bro.
Sent from my GT-I8190 using XDA Forums Pro
Subscribed, amazing thread and amazing tool, thank you for the insight, any more reversing knowledge with olly or ida is greatly appreciated.
Decent introduction, but this is just the beginning... Good for comparison purposes as you mentioned, but what else? *shrug*
Sent via Tapatalk on my Xperia Z
core7x said:
very nice one. good job bro.
Click to expand...
Click to collapse
berryman13 said:
Subscribed, amazing thread and amazing tool, thank you for the insight, any more reversing knowledge with olly or ida is greatly appreciated.
Click to expand...
Click to collapse
Glad you liked it guys.
CosmicDan said:
Decent introduction, but this is just the beginning... Good for comparison purposes as you mentioned, but what else? *shrug*
Click to expand...
Click to collapse
Not sure what you mean, you want me to teach you how to read ASM and/or use IDA pro ? That's a bit beyond the purpose of this thread I'm afraid.
@gekkehenkie11 Does the kernel decompressing end eventually ???
{
"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"
}
Im trying to follow your guide and im ok so far, i got the symbols from my phone, im decompresing the kernel right now.. we will see about using your script and IDA pro later.
THANK YOU!
Edit: i have the decompressed kernel now, i used the symbols to create the ida script using your script, now... i have to learn how to use it in ida
pirej said:
Edit: i have the decompressed kernel now, i used the symbols to create the ida script using your script, now... i have to learn how to use it in ida
Click to expand...
Click to collapse
Select ARM as processor and 0Xc0008000 as the kernel loading address (verify with your symbols, should be the same address as your first symbol) ! Good luck.
When i load the symbol-script made with your tool in to ida.. i get this type of error messages, a lot of them
C0103568: can't rename byte as 'vfp_propagate_nan' because the name is already used in the program.
C0F96E58: can't rename byte as 'byte_mux_ops' because the name has a reserved prefix.
C0F242FC: can't rename byte as 'ten_thousand' because this byte can't have a name (it is a tail byte).
Click to expand...
Click to collapse
There really is "vfp_propagate_nan" twice in my symbols dumped from my phone, is this normal or i did something wrong?
And I assume this would allow us to, like, recreate a particular kernel's source code when the original sources to it are unavailable, using extant code from a similar repo, right?
blakegriplingph said:
And I assume this would allow us to, like, recreate a particular kernel's source code when the original sources to it are unavailable, using extant code from a similar repo, right?
Click to expand...
Click to collapse
Hai I am new one n forum make any sample video understand
Post any video tutorials
After achieving deadlist how do we do to get kernel source in conventional format (like they have on github)..
I'm not asking u to write a guide. I'm asking "where i can find tutorial"
I find in 4pda forum to use "snowman decompiler" plugin in ida to convert deadlist to c++
Should i use it??
Hi I m looking for Lenovo K5 Note A7020 kernel.
Can anyone guide me to right direction.
Hi,
I m looking for Lenovo K5 Note A7020a48 kernel source can anyone guide me to right direction.
Hello, first thank you for this precious guide !
I'm currently facing problems reverse engineering kernel-ranchu kernel provided to modern AVD. Tried both of your methods and I can't get a valid kernel img. Any idea why ?
flaccidattempts said:
There is no certified way to reverse source code from binary. The process in which it has been compiled has to be reversed.
Now if you want to analyze binary and cross-examine it with android from source files, then you can derive using basic lamba functions to infer missing pieces.
But..... binaries can be engineered in a way that the code becomes obvious ESPECIALLY if you have Android from Source.
Essentially, you can download android from source using google repo tool, repo the release edition, compare side by side, file for file, what is different.
I Use these linux command s
From there i use a custom python file that 'line for line' searches for the strings, if they match, it logs the match.
once done with that, it sends it over to sublime text, which for some reason, on rare occasions resolves the binaries immediately, especially when paired with the matching strings file.
For files that are obviously encrypted, i wait till the end and brute force popular hashes, map out links, use lambda functions and use general deduction to solve to source.
If you want to learn how to analyze binaries with linux watch "malware analysis" videos on youtube
Click to expand...
Click to collapse
OEM/Manufukturer has an open source policy but some of them don't publish the kernel source code. I found the helpful answer to reverse kernel and I'll put it in the right suitable place.
lol im sorry. this is what im working with
unless you are trying to get from img to bin? or trying to get bin to text? or bin to c?
blu will not post there source or email me back, so im going to reverse engineer it to piss them off. Decompilers for llvm and clang and such exist. blueline hasnt put to much effort into hiding the source. I found a json @ link file that simplified the process
flaccidattempts said:
lol im sorry. this is what im working withView attachment 5622895
unless you are trying to get from img to bin? or trying to get bin to text? or bin to c?
Click to expand...
Click to collapse
IMG_Extractor_3.0.0.zip
drive.google.com
I extracted boot.img with img extractor v3.0.0 and get a compressed kernel image. I'm not sure what format it is but I want to reverse it
download ghidra from github. start importing files to assembly code

[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

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!

Categories

Resources