[GUIDE] How to build AOSP kernel from source S4 Mini (i9195 & i9190) - Galaxy S 4 Mini General

Welcome to Kernel build guide.
WITH THIS METHOD YOU WILL GET installable zip for your kernel.
My english is not best but i think you all will understand this guide . I write this guide because i dont own S4 Mini anymore and unfortunally i cant build kernels or roms anymore for s4 mini.
this is my kernel build method. you will have everything (tools) for build a kernel for s4 mini device. if you have questions, then ask it here. this kernel method is working only aosp based kernel (not tested for tw kernel but it may also work but you need ramdisk of tw kernel)
be sure you have packages installed for build something like this, or edit or clone a github source. look at cm kernel build guides.
1. Download build-s4-mini-kernel.zip [here]
extract it to root of your user directory (my is /home/proxuser/)
2. We need toolchain 4.7.4 by Christopher83 original thread [here]
download
arm-unknown-linux-gnueabi-linaro_4.7.4-2013.07-build_2013_07_12.tar.bz2
extract arm-unknown-linux-gnueabi-linaro_4.7.4-2013.07 folder to toolchains folder (home/yourusername/toolchains) and name it linaro_4.7.4
Download Build scripts from my source here
download:
- abooteur_3g.img
- abooteur_lte.img
- build_all.sh
- build_eur_3g.sh
- build_eur_lte.sh
- build_master.sh
- mkbootfs
- mkbootimg
and put them to your kernel folder "root folder of your kernel".
if you want clone a kernel source: example CyanogenMod's cm-10.2 kernel then
open Terminal, and be in user root folder /home/yourusername (just open terminal and your there)
Code:
git clone https://github.com/CyanogenMod/android_kernel_samsung_msm8930-common.git -b cm-10.2
if you want clone my Kartal kernel then
Code:
git clone https://github.com/proxuser/kartal.git -b master
it will named "if you cloned cyanogenmod kernel android_kernel_samsung_msm8930-common" if you clone my kernel then it will named "kartal"
you can rename kernel folder, its not problem.
if you want change of kernel name(example kartal), then go yourkernel/arch/arm/configs/kartal_defconfig and edit CONFIG_LOCALVERSION="-Kartal" change only "Kartal" for your kernel's name. if you want change defconfig example "kartal_defconfig" to "yourkernel_defconfig" then you need change it in build_master.sh too that it builds with your config file.
if you downloaded your kernel source and your build tools are there then lets start
Open terminal
type
Code:
cd yourkernelfolder
for build both phones i9195 & i9190
Code:
./build_all.sh
if it denies access for build_all.sh then type
Code:
chmod 777 build_all.sh
you can give all files access with this command.
for build i9195
Code:
./build_eur_lte.sh
for build i9190
Code:
./build_eur_3g.sh
finally it will start building. it will done within 4-5 min. depend your pc speed.
after it builds succesfully, your kernel will be in your /home/yourusername/Packages/ folder
IF YOU WANT add new changes from CM or other kernel to your kernel
then open Terminal
cd yourkernelfolder
git remote add CyanogenMod https://github.com/CyanogenMod/android_kernel_samsung_msm8930-common.git
git fetch CyanogenMod
this will fetch CyanogenMod kernel changes but it will not apply to your kernel. you will add changes step by step yourself. copy commits SHA from CyanogenMod kernel and
open Terminal
Code:
git cherry-pick 2108e6c3109ae126590a81876145a1f17d6771b5
if you get success on pick a commit then you will get a message like this
Code:
[email protected]:~/kernel$ git cherry-pick a41564437a0eb910d0347d274456f3f0116c3c77
[master 5dd0694] net-fixes: flow_dissector: prevent an infinite loop (CVE-2013-4348)
Author: Eric Dumazet <[email protected]>
1 file changed, 3 insertions(+), 1 deletion(-)
if you get an error like this
Code:
[email protected]:~/kernel$ git cherry-pick 63ee35463ea3ec5d4e8f2c60ad0f70abd8463733
error: could not apply 63ee354... ARM: 7809/1: perf: fix event validation for software group leaders
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
thats mean it is not applied to your files. just type "git status" to see what files are not modified.
then type: git reset --hard for go to your last commit.
this will make changes of error commit back.
Work always with git because with this way you can save a lot your changes and you can restore anything anytime.
Credits:
XDA Community
Christopher83 for toolchain
ktoonsez for build scripts
arco68 for s4 mini kernel development
cyanogenmod

I really appreciate these posts! :good:

wonderful. thank you very much :good:

Srry wrong topik..

I have built your kernel successfully, but after flashing the .zip the device is stuck on the "Samsung Galaxy S4mini" Bootscreen.
I tested it with the this two roms:
- cm-10.2-20131102-SNAPSHOT-M1-serranoltexx
- CARBON-JB-UNOFFICIAL-20131026-1327-serranoltexx
Do you have any idea why it's not working?
Edit: I used arcos source and it is working fine now

@junkyde
Can't get the stock kartal kernel to build.
What for OS are you running in your virtual box? ubuntu? 86x or 64x?
Did you install any other buildtools?

there isn't a stock kartal kernel. kartal kernel is aosp. I am using Linux Mint 15 in a 64bit version on Virtual Box.
Ps: I had also my troubles with ubuntu x86 and x64, thats why I switched.

junkyde said:
there isn't a stock kartal kernel. kartal kernel is aosp. I am using Linux Mint 15 in a 64bit version on Virtual Box.
Ps: I had also my troubles with ubuntu x86 and x64, thats why I switched.
Click to expand...
Click to collapse
Thanks for you reply!
With "stock" I meant: without changing anything....
I will try mint 15 64bit with xfce!

you can also take a look into this tutorial: http://forum.xda-developers.com/showthread.php?t=1748297

junkyde said:
you can also take a look into this tutorial: http://forum.xda-developers.com/showthread.php?t=1748297
Click to expand...
Click to collapse
Got it working under Ubuntu 12.04 64bit.
Had some troubles because mkboofs and mkbootimg could not be found.
After installing : "sudo apt-get install ia32-libs" everything was fine
Now I will try to compile the 10,1 kernel from source, lets see how that goes..

Keon91 said:
After installing : "sudo apt-get install ia32-libs" everything was fine.
Click to expand...
Click to collapse
Yes I know, that this is required, when you are working with a 64bit system. But I couldn't get this installed in Ubuntu. On Mint everything worked fine. But I am glad you made it

@junkyde
After some trial and error I've succesfully compiled the cm 10.1 kernel.
Can you give me any direction on how to compile the custom liblights?
Do I need to download the full cm 10.1 source?

I used proxusers tutorial on how to build carbon rom. Downloaded full rom, modified lights.c and compiled whole rom.

Can someone build a kernel for the i257m
It would be nice if there was some kernel mods for this. especially just a near stock one with insecure root permissions.
The source is out if anyone was wondering
opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=i257

IF YOU WANT add new changes from CM or other kernel to your kernel ...
Click to expand...
Click to collapse
What do you mean by this? Add changes that cm has done after you last downloaded them or changes you want to do to customize the kernel?
git cherry-pick 2108e6c3109ae126590a81876145a1f17d6771b5
Click to expand...
Click to collapse
What does this means and where do you get that ID? I would think that after fetching the changes from the source it will have been added to all the files you have already downloaded. Thanks for the tutorial!
---------- Post added at 05:58 PM ---------- Previous post was at 05:55 PM ----------
junkyde said:
I used proxusers tutorial on how to build carbon rom. Downloaded full rom, modified lights.c and compiled whole rom.
Click to expand...
Click to collapse
junkyde here you don't mention lights.c, aren't they needed for 10.1? http://forum.xda-developers.com/showpost.php?p=49958578&postcount=215

yes you need custom liblights for BLN, but since I have compiled them already, you can use the one from inside the .zip of my kernel.

junkyde said:
yes you need custom liblights for BLN, but since I have compiled them already, you can use the one from inside the .zip of my kernel.
Click to expand...
Click to collapse
Doesn't it matter that you compiled it for 10.2? Also, where is the source for liblights?

proxuser said:
Welcome to Kernel build guide.
WITH THIS METHOD YOU WILL GET installable zip for your kernel.
Click to expand...
Click to collapse
On ubuntu I got this message after the process took a while:
KERNEL DID NOT BUILD! no zImage exist
Click to expand...
Click to collapse
At some point in the process it printed:
[email protected]:~/Development/SGS4Mini/build-s4-mini-kernel/android_kernel_samsung_msm8930-common$ ./build_all.sh
...
...
...
rm: cannot remove `/home/rpgdev/Development/SGS4Mini/build-s4-mini-kernel/Packages/AOSP/zImage': No such file or directory
rm: cannot remove `arch/arm/boot/zImage': No such file or directory
Make the kernel
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
***
*** Can't find default configuration "arch/arm/configs/kartal_defconfig"!
***
...
...
...
Click to expand...
Click to collapse
And if I go there I indeed can't find the zImage, where can I get it?
PS: Used the characters "..." to denote abridgment of the compilation verbose printout.
Forgot to add, I'm downloaded the cyanogenmod kernel from build 10.1 since that's the cyanogenmod version I use and for the one I need to make this mod, could this be the cause of the problem? Googling it seems that the kernel version you use may need a specific toolchain version.

rpgdev said:
Doesn't it matter that you compiled it for 10.2? Also, where is the source for liblights?
Click to expand...
Click to collapse
I think it doesn't matter, I used the same for different roms and it worked. Source is as I said the lights.c file inside of the rom.
rpgdev said:
Can't find default configuration "arch/arm/configs/kartal_defconfig"!
Click to expand...
Click to collapse
This is why zImage can't be build.

junkyde said:
I think it doesn't matter, I used the same for different roms and it worked. Source is as I said the lights.c file inside of the rom.
This is why zImage can't be build.
Click to expand...
Click to collapse
I'm not using kartal but the one downloaded from cm. Thought the instructions were generic and the script took into account wether you had downloaded the kernel from cm or kartal :/, I did go inside the directory with all the defconfig files, how do I know which one should I point it to on cm-10.1 kernel?
Regarding the lights.c then I just have to include that library on the same directory you put it in your kernel AND add the changes you pointed to here http://forum.xda-developers.com/showpost.php?p=49958578&postcount=215 and I would be set?
Thanks!

Related

[Q] how to flash from AOSP builded images?

Hello!
Im currently trying to build a vannila froyo 2.2 rom from the source! How do i flash the images when im ready? Is there something like fastboot on the g1 or htc magic?
Landroid
I haven't had the time to try to build myself, but wouldn't you be better off starting with the Samsung open source for your carrier/model rather than trying to figure out all the changes you'd need to make to get AOSP to run on the Tab?
BuglessFan said:
I haven't had the time to try to build myself, but wouldn't you be better off starting with the Samsung open source for your carrier/model rather than trying to figure out all the changes you'd need to make to get AOSP to run on the Tab?
Click to expand...
Click to collapse
Erhh - Samsung open source only contains the kernel. You need the rest of Android, which is what the AOSP is for!
Regards,
Dave
Don't know about the others, but the one for the SCH-I800 on VZW is not just the kernel. All of the things like the custom notification bar/settings for white and black levels, et cetera, go well beyond vanilla android in the Tab. I haven't gone through the platform.tar, but it has notices about stuff for, TouchWiz, et cetera (now whether it can actually run as built directly from what they've made available all bets are off, I know a direct compile of the kernel code didn't work for me, but I haven't had time to do more than a simple straight attempt to build and may have screwed something simple up). It's around 85MB for the DJ11 code for Verizon.
Edit: I'd understand if you needed most of it from AOSP though for a full build, and stand corrected.
And how do i flash the created system.img and data.img? The kernel will be in the zImage format as im going to build the kernel from samsung's opensource files!
Landroid said:
And how do i flash the created system.img and data.img? The kernel will be in the zImage format as im going to build the kernel from samsung's opensource files!
Click to expand...
Click to collapse
You don't. Samsung uses different partition layout and formats.
Use the Samsung tar files to overlay over AOSP as described in their readme file.
Ah ok! Thank you
from Readme file:
How to build:
< Kernel >
1. Unzip SPH-P100_Kernel.tar.
( You can find SPH-P100_Kernel.tar in the same directory with this README.txt . )
2. Refer another "README.txt" in the tar file to build the kernel source code.
< Platform >
* NOTICE *
Galaxy Tab is launched in many countries, including Europe and North Amarica.
S/W is almost the same but there are some differences between the European version(GT-P1000) and the US Sprint version(SPH-P100).
The open source codes to be open here are only the differences.
1. Get Android open source code:
: version info - Android froyo 2.2 (android-cts-2.2_r2)
( Download site : http://source.android.com )
2. Get GT-P1000 open source code
: GT-P1000_OpenSource.zip
( Download site : http://opensource.samsung.com )
Unzip it, then you will see the file GT-P1000_Platform.tar.bz2 which includes the platform source code.
3. Overwrite GT-P1000 Platform OpenSource to the Android open source.
4. Get SPH-P100 open source code:
: SPH-P100_OpenSource.zip
( Download site : http://opensource.samsung.com , version info : DJ14 )
5. Overwrite SPH-P100_Platform_DJ14 OpenSource to the Android + GT-P1000(European) Platform open source code.
6. Overwrite the Platform source code that comes from the Sprint version(SPH-P100_Platform_DJ30).
7. Do "make"
Click to expand...
Click to collapse
Landroid said:
And how do i flash the created system.img and data.img? The kernel will be in the zImage format as im going to build the kernel from samsung's opensource files!
Click to expand...
Click to collapse
If I understand correct. (for the kernel at least) You could just take a package like monks then swap out the zImage and *.ko files for the samsung ones. resign the zip. Then flash it from the clockworkmod recovery.
I believe we need repo init -b android-cts-2.2_r2 ... and overlay the Samsung tar contents on top of it.

[Q] build CM7 for Galaxy Y GT-S5363 from source

Hi all.
I have successfully flashed PsychoGame's CyanogenMod 7 ROM for GT-s5360 together with its kernel.
Now i would like to make some changes in the source code of CM7 and to build it from source. Unfortunately i have spent already 4 days without success.
Those are the steps that i did:
1. I have downloaded CM7 source code from git://github.com/CyanogenMod/android.git -b gingerbread
2. I have cloned PsychoGame's totoro device code into /devices/samsubg/totoro
3. i have connected my device via USB and run the script extract-files.sh which successfully extracted all files.
4. during the building i realized that the above script extract all essential files (like camera related), so i cloned PsychoGame's vendor directory from github.com/PsychoGame/android_vendor_samsung_totoro.git
5. now i realized that the file cyanogem_totoro.mk in the directory vendor/cyanogen/products is missing. where i can find a suitable file?
i have found somewhere such file and succeeded to build an ROM, unfortunately CWM does't let me to flash it because the assert command checks that the current device in "totoro" but it fails. i have tried to open the zip file of the ROM and to delete the assert command but CWM still can''t flash the new ROM.
can somebody please help me with some guild about how PsychoGame built his last vertion of CM - CyanogenMod 7 Alpha 5 Release
Thank you very much!
Use percys source code - It has more fixes
Compare build.prop and update binary & scripts for cwm flashing
marcussmith2626 said:
Use percys source code - It has more fixes
Compare build.prop and update binary & scripts for cwm flashing
Click to expand...
Click to collapse
Hi, thank you for the information about gigngerDX. i found the github of the device but can you please tell me where to find all other files to build this rom? do i need to buld it without the kernel? how to do that?
thank you again!
yuripo said:
Hi, thank you for the information about gigngerDX. i found the github of the device but can you please tell me where to find all other files to build this rom? do i need to buld it without the kernel? how to do that?
thank you again!
Click to expand...
Click to collapse
Percys github is
https://github.com/percy-g2
I haven’t compiled a Cyanogen rom before
If you would like to contribute to the building of Cyanogen roms the best person to talk to is percy
I haven’t compiled a Cyanogen rom before
If you would like to contribute to the building of Cyanogen roms the best person to talk to is percy[/QUOTE]
can please somebody explain how to build only Percys ROM without the kernel?
thank you
Hi all.
Can somebody please give a small guide for how to build percy's CM7 ROM from source?
which directories in the CM7 i should replace? does the process of building is the same as with official ports?
Thank you!

MiPatcher: A MIUI forking utility

No more free rides
Donor is Port Rom?
Black_Eyes said:
Donor is Port Rom?
Click to expand...
Click to collapse
Yes
Tqr said:
{
"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"
}
Introduction
Runs on Windows & Linux with WINE
MiPatcher is designed to append MIUI to any CM base that shares the same 'Build.id'. This can be found in build.prop.
At the same time this will also serve as a technical guide for folks just starting out with porting MIUI in the 4.4 era, those doing this by hand or others who are just returning to the game.
MiPatcher is not a substitute for PatchROM and is not the same in function by any means although it can use Patch components on the most basic level.
This is geared more toward people who are trying to build a functional MIUI for neglected devices and also for people testing various bases who may not yet be configured to build from source to accommodate some of MIUIs functionality.
MiPatcher is as of right now very straight-forward; you pick the resolution for the device you are porting for and it will adjust the Donor MIUI to 'look right' on your device.
Requirements
- Autohotkey (Only if you intend to run the source for this)
- CyanogenMod 11
*Disabled SELinux
*Boot.img edits (for full functionality if not using PatchROM)
*Modified seapp_contexts (At Kernel level for use with PatchROM, at source level for manual porting/using this tool)
**Stock CM with init.d support may also be used; although it will be sloppy.
- MIUI donor firmware with the same 'Build.id' found in /system/build.prop
- PatchROM resources (If your Donor is a different resolution, you do not 'need' them unless things look terrible)
*Or get PatchROM resources here if you intend to grab for every resolution; it's half the size of the one on Github better compression
- WinRAR or 7zip
Features
- Automatically append MIUI to any same code-base firmware.
- Append init.d on supported devices to force boot without changes to the kernel
Prep-work
Only three files must be edited for test-ports, which I'll cover now.
Framework-res.apk
Open your Base and donor Framework-res.apk, navigate to res/xml and import the following XMLs:
Code:
Storage List
Power Profile
Build.prop
Code:
ro.build.version.incremental=x.xx.xx
persist.sys.root_access=0
ro.config.notification_sound=xxx.ogg
ro.config.alarm_alert=xxx.ogg
ro.config.ringtone=xxx.ogg
ro.skia.use_data_fonts=1
ro.miui.ui.version.code=3
ro.miui.ui.version.name=V5
qemu.hw.mainkeys=0 **[U] If you have no physical HW keys.[/U]
Updater-Script
Code:
set_perm(0, 0, 06755, "/system/xbin/lbesec"); ***If LBEsec exists in your donor
set_perm(0, 1000, 06750, "/system/xbin/shelld");
set_perm(0, 0, 06755, "/system/xbin/su");
With these most basic edits, MIUI will boot but with the need to install MIUI Lite to fix themes partially; as native ThemeManager, updater and backup will FC continuously.
Planning to use PatchROM? If you have an unlocked BL device or a device that will accept an unsigned kernel you can split your boot.img's ramdisk and add the following entries to 'seapp_contexts' immediately under user=shell, like this :
user=shell domain=shell type=shell_data_file
Code:
user=theme seinfo=platform domain=platform_app type=platform_app_data_file
user=backup seinfo=platform domain=platform_app type=platform_app_data_file
user=updater seinfo=platform domain=platform_app type=platform_app_data_file
And above anything else that may follow user=shell.
If you are not planning on using PatchROM, you will have to disable SELinux fully and edit your 'seapp_contexts' in source. In CyanogenMod11 source it is located in the following directory:
Code:
external/sepolicy/seapp_contexts
Now it's time to kill SELinux, navigate to your Kernels config folder in source; generally found at:
Code:
kernel/brand name/kernelname-common/arch/arm/configs
and find 'kernelname_defconfig' or 'kernelname_selinux_defconfig', change the following value to 'n':
Code:
CONFIG_SECURITY_SELINUX=[B]n[/B]
This will yield a functional CyanogenMod11 that can be used with PatchROM without issue, and can also be used to just fork firmware which is useful in the case of unified device builds, which Patch does not really like so much.
Now that you've built your base the following edits must be made to the kernel's Ramdisk:
Init.rc
Add this line at the very end of init.rc
Code:
import /init.miui.rc
init.miui.rc
Create this file in the root of your ramdisk and place the following inside:
Code:
#service for shelld
service shelld /system/xbin/shelld
class main
#service for su
service su_daemon /system/xbin/su --daemon
class main
oneshot
service lbesec /system/xbin/lbesec
class main
oneshot
init.superuser.rc
Code:
Delete this file
init.cm.rc
Add a '#' to the following line to disable the calling of init.superuser.rc
Code:
[B]#[/B]import /init.superuser.rc
Default.prop
Change the following values:
Code:
ro.adb.secure=[B]0[/B]
ro.secure=[B]0[/B]
ro.allow.mock.location=[B]1[/B]
Once these edits have been made your base can now be adapted to MIUI.
MiPatcher Instructions
1. Extract the contents of baserom.zip to 'base'
2. Extract the contents of miuidonor.zip to 'donor'
3. Inside of the PatchROM resources zip, extract 'HDPI' 'xHDPI' and 'xxHDPI' into the 'PatchROM' folder
4. Run MiPatcher, select your resolution and if you haven't made any kernel editing or done special source building, use soft-mods.
5. Zip the contents of 'Base' and flash it.
6. If this yields a non-booting build your codebase is too distant from your donor, find another same Build.ID release and try again if not proficient with ADB.
Current version:0.01
0.01: First release, Basic functionality and enough to produce one-shot ports when the base is properly prepared.
0.01: x64 x86 stand-alone .exe
Next Version:0.02
0.02: Clean up redundant/inefficient code.
0.02: Add options for boot.img, build.prop, meta-inf backup and loading.
*to avoid having to edit or manually move these with each attempt on base.
Download
9/28/2014: MiPatcher x86&x64
This is stand-alone and requires nothing to run, PatchROM parts are optional but suggested nonetheless.
Source
To use this source as an executable 'program' you must download and install Autohotkey, after right-click on your desktop to create a new '.ahk' file, paste the contents of this inside of it and save.
Create the following folders in the same folder as your .ahk file, the folder structure should mimic the following in terms of layout with extracting things:
-base
*META-INF
*System
*Boot.img
-donor
*META-INF
*System
*Boot.img
-mod create two notepad++ files with no extension, name them the following and place the respective content inside:
*00lbesec
Code:
#!/system/bin/sh
/system/xbin/lbesec &
*00shelld
Code:
#!/system/bin/sh
/system/xbin/shelld &
-patchrom
*HDPI
*xHDPI
*xxHDPI
AHK source:
http://paste.ee/p/balNM
FAQ
Q: My ROM isn't booting!
A: Try another MIUI that uses the same Build ID as yours, or use ADB to debug your build as it will be really close either way.
Q: Is there any difference between using a .ahk file and a .exe?
A: Yes. It's easier to update by pasting new code into a .ahk text file than to download packed .exe files in the longrun; however when using a .exe you don't need to install Autohotkey.
I will make standalone .exe for this at some point soon today.
Q: Theme/Updater/Backup is FCing!
A: It's a SELinux related error, sounds like you may be using PatchROM or a unified build; in this case build from source with the Seapp_context, and with SELinux turned off.
Q: Storage isn't mounting!/File Explorer is closing!
A: Import CyanogenMod11's 'StorageList' located in Framework-res.apk/res/xml into MIUI's along with the 'PowerProfile' to resolve unreadable storage
Q: [Insert name] App is crashing...
A: Debug using ADB or find another donor if you're feeling lazy, most of the time this yields perfect results but some things will maybe need a little polish depending on how far the codebase from the Donor and your Base firmware are.
Big TY to:
Code:
* Sijav
* Chevelle
* Yun
* All the Russian firmware developers, ahead of everyone else by a bit..
XDA:DevDB Information
MiPatcher: A MIUI forking utility, Tool/Utility for all devices (see above for details)
Contributors
Tqr
Version Information
Status: Testing
Stable Release Date: 2014-10-04
Beta Release Date: 2014-09-30
Created 2014-09-28
Last Updated 2014-09-28
Click to expand...
Click to collapse
What's the "MIUI donor firmware" ? Doest it work on Ubuntu with Wine ?
h2o64 said:
What's the "MIUI donor firmware" ? Doest it work on Ubuntu with Wine ?
Click to expand...
Click to collapse
Any MIUI firmware as long as it has the same build.id as your base
Edit: Yes this tool works in ubuntu with WINE, but only as a .exe, it can't run as a .ahk file I believe.. I mean I've never tried running raw .ahk files in Linux
Tqr said:
Any MIUI firmware as long as it has the same build.id as your base
Edit: Yes this tool works in ubuntu with WINE, but only as a .exe, it can't run as a .ahk file I believe.. I mean I've never tried running raw .ahk files in Linux
Click to expand...
Click to collapse
Okok.. I'll use CM 11 of my Moto G with the Nexus 5 build.
Can I post here if I've trouble with the software?
h2o64 said:
Okok.. I'll use CM 11 of my Moto G with the Nexus 5 build.
Can I post here if I've trouble with the software?
Click to expand...
Click to collapse
Sure, I don't mind Q&A
h2o64 said:
Okok.. I'll use CM 11 of my Moto G with the Nexus 5 build.
Can I post here if I've trouble with the software?
Click to expand...
Click to collapse
Nexus 5 won't be Good
what about a little wait and We will Port from Moto x ? @h2o64
Black_Eyes said:
Nexus 5 won't be Good
what about a little wait and We will Port from Moto x ? @h2o64
Click to expand...
Click to collapse
I'll try from one plus one (4.4.4)
If we need to wait. I prefer waiting for Redmi 1S which have a configuration very near to Moto G's one.
---------- Post added at 04:53 PM ---------- Previous post was at 04:22 PM ----------
Tqr said:
Sure, I don't mind Q&A
Click to expand...
Click to collapse
Works perfectly fine on Ubuntu 14.04 64 bits (I've used x64 one).
I'll flash the zip file. Keep you updated.
Black_Eyes said:
Nexus 5 won't be Good
what about a little wait and We will Port from Moto x ? @h2o64
Click to expand...
Click to collapse
I just made a post for the Moto X, sorry about that lol
Tqr said:
I just made a post for the Moto X, sorry about that lol
Click to expand...
Click to collapse
Which base did You use?
Help us to Boot it on Moto g
Black_Eyes said:
Which base did You use?
Help us to Boot it on Moto g
Click to expand...
Click to collapse
ok, I'll have to build you guys CyanogenMod from my code-base.. give me a few hours and I'll get it built by the end of today
Edit: I'm going to automate this in a very strong way; by the time this tool reaches 'stable' I will have ideally automated everything so that people with a totally unsupported device can have everything done for them from building to having MIUI applied without having to manually do anything.
It will not be as recent as a PatchROM build but it will be a 'sure bet' for anyone looking to use a pretty recent internal version of MIUI; I'm not trying to make a platform to replace PatchROM It's essential but I am trying to make a platform to enable people to just use MIUI without having to pull teeth over it
Tqr said:
ok, I'll have to build you guys CyanogenMod from my code-base.. give me a few hours and I'll get it built by the end of today
Click to expand...
Click to collapse
Ok Thanks i will be waiting
---------- Post added at 08:06 PM ---------- Previous post was at 08:02 PM ----------
Tqr said:
ok, I'll have to build you guys CyanogenMod from my code-base.. give me a few hours and I'll get it built by the end of today
Edit: I'm going to automate this in a very strong way; by the time this tool reaches 'stable' I will have ideally automated everything so that people with a totally unsupported device can have everything done for them from building to having MIUI applied without having to manually do anything.
It will not be as recent as a PatchROM build but it will be a 'sure bet' for anyone looking to use a pretty recent internal version of MIUI; I'm not trying to make a platform to replace PatchROM It's essential but I am trying to make a platform to enable people to just use MIUI without having to pull teeth over it
Click to expand...
Click to collapse
That will be Great :good:
Tqr said:
ok, I'll have to build you guys CyanogenMod from my code-base.. give me a few hours and I'll get it built by the end of today
Edit: I'm going to automate this in a very strong way; by the time this tool reaches 'stable' I will have ideally automated everything so that people with a totally unsupported device can have everything done for them from building to having MIUI applied without having to manually do anything.
It will not be as recent as a PatchROM build but it will be a 'sure bet' for anyone looking to use a pretty recent internal version of MIUI; I'm not trying to make a platform to replace PatchROM It's essential but I am trying to make a platform to enable people to just use MIUI without having to pull teeth over it
Click to expand...
Click to collapse
Amazing ...
Is the source code available ?
@Tqr the tutorial stays a bit un-clear :
Why using patchrom after porting ? Can we use it during porting ?
All the stuff about patchROM is a bit complicated.
We need to re-build an entire CM11 without Selinux ?
h2o64 said:
Amazing ...
Is the source code available ?
@Tqr the tutorial stays a bit un-clear :
Why using patchrom after porting ? Can we use it during porting ?
All the stuff about patchROM is a bit complicated.
We need to re-build an entire CM11 without Selinux ?
Click to expand...
Click to collapse
He will Build for Us
Black_Eyes said:
He will Build for Us
Click to expand...
Click to collapse
I'm a dev. I want to try it myself and to learn how to do.
I've work a lot on it :'( :'( :'(
h2o64 said:
Amazing ...
Is the source code available ?
@Tqr the tutorial stays a bit un-clear :
Why using patchrom after porting ? Can we use it during porting ?
All the stuff about patchROM is a bit complicated.
We need to re-build an entire CM11 without Selinux ?
Click to expand...
Click to collapse
When using PatchROM you can leave SELinux intact, when porting manually/using this tool you must fully disable SELinux or use a base that does not have it to begin with.
You don't even need to touch PatchROM to use this, or Linux honestly.. even the PatchROM Resources aren't required unless you're coming from a device with a different resolution sometimes.. but not always
Edit: Otherwise make the following edits I've outlined to CyanogenMod in source, I feel I was pretty clear on what to change
Tqr said:
When using PatchROM you can leave SELinux intact, when porting manually/using this tool you must fully disable SELinux or use a base that does not have it to begin with.
You don't even need to touch PatchROM to use this, or Linux honestly.. even the PatchROM Resources aren't required unless you're coming from a device with a different resolution sometimes.. but not always
Edit: Otherwise make the following edits I've outlined to CyanogenMod in source, I feel I was pretty clear on what to change
Click to expand...
Click to collapse
You just have to say the two first line of this post because they are perfectly understable and help me a lot .
Can I just re-built the kernel without Selinux ?
h2o64 said:
You just have to say the two first line of this post because they are perfectly understable and help me a lot .
Can I just re-built the kernel without Selinux ?
Click to expand...
Click to collapse
@h2o64 Yes
and i think that's why Rom doesn't boot with manually Porting
---------- Post added at 08:37 PM ---------- Previous post was at 08:33 PM ----------
How can i disable SELinux without Building the Kernel ?
h2o64 said:
You just have to say the two first line of this post because they are perfectly understable and help me a lot .
Can I just re-built the kernel without Selinux ?
Click to expand...
Click to collapse
No; you will still have Fingerprint errors

[DEV][TEMPLATE] Kerneller - Modify Ramdisk, dt, zImage, and SELinux on the fly

༼ つ ◕_◕ ༽つIn the name of our great lord Helix!༼ つ ◕_◕ ༽つ
Kerneller, a flashable Zip template for ramdisk modifications
Google what a kerneller is​
Many of you have no doubt heard of osm0sis' Anykernel2 and previously koush's Anykernel. Kerneller is an alternative designed solely around Sony's Xperia lineup, taking into account the 'recovery-inside-ramdisk' situation we've found ourselves in. However, the script should also support other devices such as Nexus. (I say should because I can only test on the Xperia devices I own -- if anyone could help test, I would be very grateful!)
And with the release of Android 5.0 Lollipop, users have been facing a dilemma: To download a permissive or enforcing version of the kernel? Kerneller fixes that issue by combining the two in a single zip using a slightly modified version of keycheck, allowing the user to choose what will be installed at the time of flashing.
Source: https://github.com/someone755/kerneller
Any questions, tips, or comments are welcome!
Credits & Thanks: All authors of the included binaries. osm0sis for AnyKernel2 and porting the binaries. koush for the original AnyKernel concept. Everyone who helped test. Myself5 for the inspiration and oshmoun for the help.
XDA:DevDB Information
Kerneller, Tool/Utility for the OEM Cross Device Development
Contributors
someone755
Version Information
Status: Stable
Created 2015-12-26
Last Updated 2015-12-31
This is something, i was expecting.
Thank you very much.
Black_Eyes said:
This is something, i was expecting.
Thank you very much.
Click to expand...
Click to collapse
I'm glad you like it but I can't say that's the reaction I was expecting lol. Please do let me know if anything bothers you though.
Just by the way, I moved the thing into its own repo and added a small script to compress and sign it. Cheers!
work for lock or un lock?thank you
xsj said:
work for lock or un lock?thank you
Click to expand...
Click to collapse
I'm sorry to say I don't understand the question. This script cannot lock or unlock anything.
It modifies the boot sector of your device. For that to be possible in the first place, you need an unlocked bootloader.
thank you,Im lockbootloader now,and that's what I want to know
Sorry for noob question,but where to download?Cant find the link.Want to try this on my m2 aqua.
mariosenta said:
Sorry for noob question,but where to download?Cant find the link.Want to try this on my m2 aqua.
Click to expand...
Click to collapse
Your best bet would be using 'git clone', though you can also just download the whole repo as a zip file (here, if you're having trouble finding it). Note though that the packing script won't work in Windows unless you have a *nix shell emulator (such as Cygwin or win-bash)!
You can still zip the thing together yourself using 7zip or WinRAR, however it will not be a signed zip (so some recoveries -- like Cyanogen Recovery -- may refuse to flash it, but you could use the bash script to figure out what you have to do in Windows to sign your new zip).
If you do eventually get it to run, I'd be very glad if you could send me the recovery.log of the flash via PM!
TouchWiz?
This tool works on touchwiz Lollipop 5.1.1 Roms or not?
Stock kernel is Enforcing and I tried various methods to make it permissive, nothing works
Pavan l said:
This tool works on touchwiz Lollipop 5.1.1 Roms or not?
Stock kernel is Enforcing and I tried various methods to make it permissive, nothing works
Click to expand...
Click to collapse
I don't know if your device's boot image is assembled using mkbootimg (like Nexus devices). If so, you may be able to.
But you'll need to pack the device tree binary and zImage into the zip (just use unpackbootimg).
So, I'm very confused, I usually build boot.imgs right out of the AOSP source code... how could I leverage this?
HaoZeke said:
So, I'm very confused, I usually build boot.imgs right out of the AOSP source code... how could I leverage this?
Click to expand...
Click to collapse
It's not really meant for people who compile ROMs, but more for kernel devs or testers who only compile the kernel.
Instead of always having to extract the ramdisk from boot images (whenever the ramdisk changes, which we kernel people can't know and check for every single kernel, nor do we care) and then using mkbootimg (meaning you have to release one boot image for every ramdisk you need to support, i.e. if you want to support ROMs with vastly different ramdisk implementations, where mixing ramdisks would cause a bootloop).
With this, you go around the problem. Compile the kernel outside of the ROM tree (which takes a few minutes vs several hours that compiling the entire ROM can take), grab the zImage-dtb (or adjust the script to use zImage + dt.img), and package the thing together. (There are options to also include kernel modules in the zip, and scripts that will compress and sign the zip for you.)
The highlight of this project used to be being able to switch Selinux status when flashing the zip, instead of adding androidboot.selinux=permissive for each boot image, and then uploading two images. Nowadays compatibility of this switch with various devices and Android versions is questionable (I can't test personally because of how limited Xperia devices have become recently -- the 3.10 kernel does not work with enforcing selinux), but the core idea of using it to avoid having to create boot images is still alive and kicking.

[Solved][help] from custom kernel developers

Regarding this thread https://forum.xda-developers.com/moto-g4-plus/development/kalilinux-nethunter-t3639411
The OP tywinlannister did not patch the kernel source code with Android USB HID PATCH To use the Android device as keyboard or mouse..This should be applied for nethunter ROM, But he didn't..
And I asked resurrection remix ROM maintainer Jleeblanch for Athene to look at this issue he did it , after applying the patch it didn't successfully compile ,there were errors..By seeing the error he said that the official kernel is partially patched already,so it is causing those errors..
If anybody looks into the problem it would be appreciated just in your free time only ...
The link to kernel source of Jleeblanch is the "Kali branch" https://github.com/Jleeblanch/android_kernel_motorola_msm8952
Any problem or suggestions regarding to this can be discussed here itself , that others can address the issue..
I too have been waiting for a working kernel so I am going to attempt to compile a working kernel with hid with my limited kernel development knowledge. I think it probably won't work as two far better devs than me have yet been unable however I will try anyway
Any help from fellow devs would be greatly appreciated
Dougleplex said:
I too have been waiting for a working kernel so I am going to attempt to compile a working kernel with hid with my limited kernel development knowledge. I think it probably won't work as two far better devs than me have yet been unable however I will try anyway
Any help from fellow devs would be greatly appreciated
Click to expand...
Click to collapse
I am also a newbie to kernel development but I manually patched the hid sources to kernel source..
But when we complied it all those errors.
First I think we should delete all those hid patches all applied to the stock kernel source. Then compile it and then apply the patch by pelya...
My ROM s kernel developer say MM kernel will be easy but it is also partially patch
You may give it a try
Dhanush-raj said:
I am also a newbie to kernel development but I manually patched the hid sources to kernel source..
But when we complied it all those errors.
First I think we should delete all those hid patches all applied to the stock kernel source. Then compile it and then apply the patch by pelya...
Click to expand...
Click to collapse
I'm going to attempt to patch jleeblanch's rr kernel and then work backwards depending on the errors as last time I did something like this (s7 edge nethunter kernel) the error was a corrupted source and could easily have been fixed by finding a different repository rather than starting from scratch (what we did). I'm unsure as to what will happen after that however your idea is just as valid and I will try straight after (if you haven't already)
Test this kernel
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Code:
git clone https://github.com/LineageOS/android_kernel_motorola_msm8952.git
cd android_kernel_motorola_msm8952
git checkout cm-14.1
git remote add invicta https://gitlab.com/sileshn/android_kernel_motorola_athene.git
git fetch invicta
git cherry-pick 04aa0b10521b76e57226b2d1633e2b91cfa40263
If you don't get errors, you are good to go. If it errors, it needs more changes.
Silesh.Nair said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Code:
git clone https://github.com/LineageOS/android_kernel_motorola_msm8952.git
cd android_kernel_motorola_msm8952
git checkout cm-14.1
git remote add invicta https://gitlab.com/sileshn/android_kernel_motorola_athene.git
git fetch invicta
git cherry-pick 04aa0b10521b76e57226b2d1633e2b91cfa40263
If you don't get errors, you are good to go. If it errors, it needs more changes.
Click to expand...
Click to collapse
Kernel version 3.10.105 was initially the kernel I tried patching. I was easily able to merge the patch, but compiling it was a different story. According the errors I got, a lot of thing we're duplicated. I told the guy above that the MM based kernel (3.10.84 - which is the same version for MM thru Nougat on stock) would probably be the best bet. Looks like you had little trouble at all with merging into your Invicta Kernel (which is also kernel version 3.10.84).
Good job and thank you [emoji41]
Silesh.Nair said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
If you don't get errors, you are good to go. If it errors, it needs more changes.
Click to expand...
Click to collapse
Thanks @Silesh.Nair I have been waiting long time for this patch. Once again thank you sir...
The patch is working perfectly in 3.10.105 i.e jleeblanch kernel source..
Linux version 3.10.107-lineageOS ([email protected]) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #1 SMP PREEMPT Sat Aug 5 04:20:04 PDT 2017
And thank you @Jleeblanch Also
boot tool
Silesh.Nair said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Code:
git clone https://github.com/LineageOS/android_kernel_motorola_msm8952.git
cd android_kernel_motorola_msm8952
git checkout cm-14.1
git remote add invicta https://gitlab.com/sileshn/android_kernel_motorola_athene.git
git fetch invicta
git cherry-pick 04aa0b10521b76e57226b2d1633e2b91cfa40263
If you don't get errors, you are good to go. If it errors, it needs more changes.
Click to expand...
Click to collapse
Hey which tool did you used to make boot.img.
Marella ram_youtubr said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Hey which tool did you used to make boot.img.
Click to expand...
Click to collapse
I am using lazyflasher
https://github.com/jcadduono/lazyflasher
Just clone this repo and place the zimage in there and type make, you will get a zip file. Just flash it through twrp recovery. Because only the kernel is changed , so i am just replacing the zimage. No need of unpacking and repacking of boot image.:good:
i have compiled a zimage from kali_defconfig from above source.but when i flased it to phone the phone is not booting.
I NEED A FIX FOR THIS
Marella ram_youtubr said:
i have compiled a zimage from kali_defconfig from above source.but when i flased it to phone the phone is not booting.
I NEED A FIX FOR THIS
Click to expand...
Click to collapse
Which toolchian did you use, and what kernel source and rom you are using .
Give me as detailed information as possible!
Dhanush-raj said:
Which toolchian did you use, and what kernel source and rom you are using .
Give me as detailed information as possible!
Click to expand...
Click to collapse
Kernel Source:-https://github.com/Jleeblanch/android_kernel_motorola_msm8952/tree/kali-nougat
toolchain:- https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 nougat-release
rom:- lineage 14.1 official
Marella ram_youtubr said:
Kernel Source:-https://github.com/Jleeblanch/android_kernel_motorola_msm8952/tree/kali-nougat
toolchain:- https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 nougat-release
rom:- lineage 14.1 official
Click to expand...
Click to collapse
Don't use that source it isn't patched correctly, although i said mr. Jleeblanch to try , so he created it. The hid patch is merged into his resurrected kernel, but for mac injection i dont remember. So you better start from the first.
Use lineage kernel source and apply the patch from this thread #6th post, and see what toolchain is used to build lineage 14 kernel and use it. And additionally you have to make some changes in the defconfig, which is explained in the kali-nethunter github page.
Dhanush-raj said:
Don't use that source it isn't patched correctly, although i said mr. Jleeblanch to try , so he created it. The hid patch is merged into his resurrected kernel, but for mac injection i dont remember. So you better start from the first.
Use lineage kernel source and apply the patch from this thread #6th post, and see what toolchain is used to build lineage 14 kernel and use it. And additionally you have to make some changes in the defconfig, which is explained in the kali-nethunter github page.
Click to expand...
Click to collapse
thanks buddy
Dhanush-raj said:
Don't use that source it isn't patched correctly, although i said mr. Jleeblanch to try , so he created it. The hid patch is merged into his resurrected kernel, but for mac injection i dont remember. So you better start from the first.
Use lineage kernel source and apply the patch from this thread #6th post, and see what toolchain is used to build lineage 14 kernel and use it. And additionally you have to make some changes in the defconfig, which is explained in the kali-nethunter github page.
Click to expand...
Click to collapse
sileshn has removed his source
Marella ram_youtubr said:
sileshn has removed his source
Click to expand...
Click to collapse
https://forum.xda-developers.com/mo...ustom-kernel-developers-t3641363/post73257121
Dhanush-raj said:
https://forum.xda-developers.com/mo...ustom-kernel-developers-t3641363/post73257121
Click to expand...
Click to collapse
He had deleted his repo from gitlab
Marella ram_youtubr said:
He had deleted his repo from gitlab
Click to expand...
Click to collapse
use this bro...
Dhanush-raj said:
use this bro...
Click to expand...
Click to collapse
Actually my orginal phone is honor 6x.I love portable hacking.Like with nethunter.I tried to build nethunter kernel for honor 6x.But i failed at HID.So i took by brothers old phone That is moto g4 plus.later i found that moto g4 plus at android 7 is 32 bit.As there is no nethunter for 32 bit i have decided that atleast i should use linux deploy.But later i suck at wifi drivers.When i enable wifi drivers in kernel then phone doenst boot.
The final thing is can anyone help me in fixing this so that i can build a complete usable kernel with Net Hunter support

Categories

Resources