[KERNEL] {WIP} Port Lollipop 5.1 Source -> AOSP Marshmallow 6.0 [Device_a32e] - Desire 626 Android Development

Currently Building Bootable Android 5.1 Kernel From HTC DEV Source.
(THIS IS THE STOCK 5.0.1 / RUU Version = 1.23.1550.3 CL637541 RELEASE-KEYS)
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.7 (GCC) ) #2 SMP PREEMPT Sat Oct 31 02:35:36 CST 2015
This has been compiled and will boot on the device.
NOTE: WI-FI IS NOW WORKING
NOTE: DT Blobs broken:Fixed by using Blobs pulled from the device.}
WORK IN PROGRESS !!
Currently HTC has not released the Kernel Source for Marshmallow 6.0.1.
Solution: Port the 5.0.1 HTC Source by merging with AOSP device/lge/bullhead-kernel
Current Status:
WORKING KERNEL NO CHANGES FROM STOCK
Will Build for other Devices upon request.
Anyone who wishes to contribute to this project would be appreciated.
I'm in the process of setting up the GIT and the project on XDA.
DOWNLOADS
FOR METRO - PCS VERSION OF DESIRE 626S
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Sat Oct 1 11:53:51 EDT 2016
https://drive.google.com/open?id=0B8jitdIyh2NtdW1uNWdvaWdTdG8
The modules are in the link below.
https://drive.google.com/open?id=0B8jitdIyh2NtODl4ellvd0Y5MW8
XDA:DevDB Information
HTC MSM8909 Qualcom Kernel Port, Kernel for the HTC Desire 626
Contributors
BigCountry907, hp79
Kernel Special Features: Pssible: Change Keys used for flashing firmware: Add Fastboot Commands To Custom Bootloader: Either will allow us to S-OFF
Version Information
Status: Testing
Current Stable Version: Linux version 3.10.4
Stable Release Date: 2015-10-31
Created 2016-09-28
Last Updated 2016-10-01

Setting Up To Test 3.10.49-perf-g26c2269 Kernel Build
First I would like to mention that a full LINUX Development Environment is required to perform most of these tasks. If you don't have the development environment set up then please do the necessary research.
To test YOUR development environment and the HTC-DEV Kernel Source it is necessary to perform the following steps.
1 ) If you are currently running Marshmallow 6.0.1 you will need to downgrade the device to Lollipop 5.0.1 using the RUU. Please note that the Lollipop RUU is no longer available on the HTC-DEV site. Don't worry we will be going back to Marshmallow but need to test in lollipop first.
Please see the following thread for instructions on downgrading the HTC Desire 626s.
http://forum.xda-developers.com/desire-626/development/metropcs-htc-626s-to-lollipop-t3460391
:good:
2) Download the Kernel Source Code from the HTC-DEV Site.
http://www.htcdev.com/devcenter/downloads
If you use the filter for device and select desire 626s you will see only the 626s kernel sources.
The device I have = HTC Desire 626s (a32eul) " Carrier Metro-PCS"
The Kernel Source I am using.
Device= Desire626s Carrier=HTC Region= Gen Unlock Type=CRC
Kernel Version=3.10.49 Android Version=v5.1 Size=548 MB Description=1.06.617.6

Backup the device boot.img & Unpack / Split the kernel + ramdisk + dt.img.
Now we are all on the same page. " Same Setup Fresh Install "
Lets get down to business.
I'm going to go through the steps that I use. If you plan to work along with this project I recommend that you keep the same directory structure that I have. This way all the commands I give you will work. You may wish to change the directory structure but if you do.... remember you will need to adjust the commands accordingly.
So from a brand new fresh install.
#1 install twrp recovery
#2 install supersu
#3 Open supersu on phone
#4 Make sure usb debugging is turned on ect. ect. ect.
#5 Lets get the boot.img from the device.
Connect the device to the computer
From this point forward all commands are executed in the Linux terminal shell.
Code:
adb shell
Code:
su
Copy boot partition to the external sd card.
Code:
dd if=/dev/block/bootdevice/by-name/boot of=sdcard2/Boot.img
Pull the boot.img to the computer.
If still in adb shell exit out.
Code:
exit
exit
adb pull /sdcard2/Boot.img
#6 Setup some directories and move the boot.img into our project.
Code:
mkdir ~/a32e-kernel-build/
mkdir ~/a32e-kernel-build/Device-Files/
mkdir ~/a32e-kernel-build/Device-Files/Boot
mkdir ~/a32e-kernel-build/Tools
mkdir ~/a32e-kernel-build/Tools/AIK-Linux/
mv Boot.img ~/a32e-kernel-build/Device-Files/Boot
cd ~/a32e-kernel-build/Tools/AIK-Linux/
cp ~/a32e-kernel-build/Device-Files/Boot/Boot.img ~/a32e-kernel-build/Tools/AIK-Linux/
#7 We need AIK-Linux boot tools. Download them from the link below.
http://forum.xda-developers.com/showthread.php?t=2073775
Please do use these bootimg tools. You might have others but AIK-Linux unpacks and repacks the image files as "ROOT".
Using other tools or not unpacking / repacking as ROOT will cause a bootloop specifically in Marshmallow even if the boot.img is good.
Code:
mv ~/Downloads/AIK-Linux-v2.4-ALL.tar.gz ~/a32e-kernel-build/Tools/AIK-Linux
tar -xvzf ~/a32e-kernel-build/Tools/AIK-Linux/AIK-Linux-v2.4-ALL.tar.gz
rm -f ~/a32e-kernel-build/Tools/AIK-Linux/AIK-Linux-v2.4-ALL.tar.gz
mv -v ~/a32e-kernel-build/Tools/AIK-Linux/AIK-Linux/* ~/a32e-kernel-build/Tools/AIK-Linux/
rm -d ~/a32e-kernel-build/Tools/AIK-Linux/AIK-Linux
Ok I know ????????
You want to know what we need the boot image for anyway !!
The a32e_defconfig file that comes with the HTC-DEV source code is not the exact configuration that HTC used when they built the kernel.
We want to start out with the same configuration RIGHT!!
Yes we do...... and after we have a verified working Kernel.......then we can start making changes.
In a nutshell /proc/config.gz will not work to pull the existing configuration. HTC did not enable that option. Lucky for us there is another way to generate the configuration file & that's reason #1 that we need the boot.img. There is another reason but we will get to that later. ( Other than having a Backup of the boot.img LOL. )
#8 Unpack the boot.img
Code:
sudo ./unpackimg.sh Boot.img
Make sure you use "sudo" it is nessessary.
The output should be
~/a32e-kernel-build/Tools/AIK-Linux$ sudo ./unpackimg.sh Boot.img
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
Supplied image: MM-Boot.img
Removing old work folders and files...
Setting up work folders...
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 user_debug=31 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk vmalloc=400m androidboot.selinux=enforcing androidboot.hardware=htc_a32e androidusb.pid=0x0668
BOARD_KERNEL_BASE 80000000
BOARD_NAME boot:0
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 02000000
BOARD_TAGS_OFFSET 01e00000
BOARD_DT_SIZE 731136
Unpacking ramdisk to "ramdisk/"...
Compression used: gzip
6560 blocks
Done!
#9 Move our unpacked boot.img to our project folder.
Code:
sudo mv ramdisk ~/a32e-kernel-build/Device-Files/Boot/
sudo mv split_img ~/a32e-kernel-build/Device-Files/Boot/
sudo cp ~/a32e-kernel-build/Device-Files/Boot/split_img/Boot.img-dtb ~/a32e-kernel-build/Device-Files/Boot/Boot.img-dtb
sudo cp ~/a32e-kernel-build/Device-Files/Boot/split_img/Boot.img-zImage ~/a32e-kernel-build/Device-Files/Boot/Boot.img-zImage
sudo cp ~/a32e-kernel-build/Device-Files/Boot/Boot.img-zImage ~/a32e-kernel-build/Device-Files/Boot/kernel

Getting Running Kernel Configuration
#1 Lets get the current running Kernel Version
Code:
cd ~/a32e-kernel-build/Device-Files/Boot/
Code:
dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version'
My output is as follows.
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.7 (GCC) ) #2 SMP PREEMPT Sat Oct 31 02:35:36 CST 2015
7202481+0 records in
7202481+0 records out
7202481 bytes (7.2 MB, 6.9 MiB) copied, 5.4281 s, 1.3 MB/s
Hopefully you see or know why this is important to us.
In order for our new kernel to load and not reject existing modules the version of the new kernel must match.
Linux version 3.10.49-perf-g26c2269
And also the 26c2269 is the number we need,
to match the exact commit of the source code that this specific kernel was built upon.
In theory when we checkout a branch and that would be used as part of the tag.
Right now the most important thing to us is the "-perf"
And the ".-g26c2269"
We will need those soon.
Now lets get that .config / a32e_defconfig file.
Wayy back in step number 2 of the 1st post you were supposed to get the HTC-DEV Kernel source.
If you didn't it's time we need it now.
http://www.htcdev.com/devcenter/downloads
When you get to the HTC-DEV download page just filter by device and select desire 626s.
#1 Set Up Basic HTC-DEV Source Directory Structure
Code:
cd
mkdir ~/android
mkdir ~/android/device
mkdir ~/android/device/a32e
mkdir ~/android/device/a32e/platform
#2 Setup the Kernel Source
Code:
mv ~/Downloads/a32eul-3.10.49-perf-ga4d7327.zip ~/android/device/a32e/a32eul-3.10.49-perf-ga4d7327.zip
unzip ~/android/device/a32e/a32eul-3.10.49-perf-ga4d7327.zip -d ~/android/device/a32e/
rm -f ~/android/device/a32e/a32eul-3.10.49-perf-ga4d7327.zip
cd ~/android/device/a32e/
tar -xvzf ~/android/device/a32e/248_kernel_a32eul-3.10.49-perf-ga4d7327.tar.gz
rm ~/android/device/a32e/248_kernel_a32eul-3.10.49-perf-ga4d7327.tar.gz
mv -v ~/android/device/a32e/248_kernel_a32eul-3.10.49-perf-ga4d7327/* ~/android/device/a32e/
rm -rf ~/android/device/a32e/248_kernel_a32eul-3.10.49-perf-ga4d7327
mv ~/android/device/a32e/platform.tar.gz ~/android/device/a32e/platform/
#3 Pull the config from the kernel
Code:
cd ~/android/device/a32e/scripts/
./extract-ikconfig ~/a32e-kernel-build/Device-Files/Boot/Boot.img-zImage > Big-Country_defconfig
mv -f Big-Country_defconfig ~/android/device/a32e/arch/arm/configs
mkdir ~/a32e-kernel-build/Device-Files/Configs/ORIGINAL/
cp -f ~/android/device/a32e/arch/arm/configs/Big-Country_defconfig ~/a32e-kernel-build/Device-Files/Configs/ORIGINAL/
Open up the Big-Country_defconfig
It is in the folder ~/android/device/a32e/arch/arm/configs
Open it with G-Edit or whatever text editor you use.
Search for CONFIG_LOCALVERSION=
and change it to CONFIG_LOCALVERSION="-g26c2269"
Open up the main makefile. in the folder ~/android/device/a32e/Makefile
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 49
EXTRAVERSION =
NAME = TOSSUG Baby Fish
At the top of the file change EXTRAVERSION =
EXTRAVERSION = -perf
Now lets backup the edited Big-Country_defconfig.
Code:
cp -f ~/android/device/a32e/arch/arm/configs/Big-Country_defconfig ~/a32e-kernel-build/Device-Files/
Now were cooking.

Preparing and Building the Kernel
#1 Get the GCC Toolchain
First if you have a dev environment set up you should have a repo set up.
If not go to aosp site to see how yo set up a repo.
https://source.android.com/source/downloading.html
Then get the toolchain
Code:
cd
mkdir ~/android/Toolchains
mkdir ~/android/Toolchains/prebuilts
cd ~/android/Toolchains/prebuilts
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
Were gonna use the 4.8 toolchain.
[email protected]:~/android/Toolchains/prebuilts$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
Cloning into 'arm-eabi-4.8'...
remote: Sending approximately 28.69 MiB ...
remote: Counting objects: 158, done
remote: Finding sources: 100% (158/158)
remote: Total 354 (delta 71), reused 354 (delta 71)
Receiving objects: 100% (354/354), 28.74 MiB | 2.09 MiB/s, done.
Resolving deltas: 100% (71/71), done.
Checking connectivity... done.
#2 Initialize the Kernel Build
Go to the home path of the kernel
Code:
cd
cd ~/android/device/a32e/
Export the required variables.
Code:
export TOP=~/android/Toolchains/
export PATH=$TOP/prebuilts/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=~/android/Toolchains/prebuilts/arm-eabi-4.8/bin/arm-eabi-
Clean out any old left over stuff from previous builds.
Code:
make clean
make mrproper
Dont worry about this warning it's not a problem.
/home/bigcountry/android/device/a32e/arch/arm/boot/dts/Makefile:228: warning: overriding recipe for target `dtbs'
/home/bigcountry/android/device/a32e/arch/arm/boot/dts/Makefile:228: warning: ignoring old recipe for target `dtbs'
Initialize the configuration for our device.
Code:
make Big-Country_defconfig
This warning is also ok.
In file included from scripts/kconfig/zconf.tab.c:2503:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
jump->offset = r->len - 1;
^
scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here
struct jump_key *jump;
^
If your curious and want to see how many settings there are.
Just don't change anything for the first run.
Code:
make menuconfig
Were ready to compile
set -j to the number of cores your computer has.
Code:
make prepare
make all -j8
In about 5 min or less you will have a compiled kernel.
after you see the zimage output message
The last 2 lines output from the build.
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Code:
make modules -j8
Then you should see:
[email protected]:~/android/device/a32e$ make modules -j8
CHK include/generated/uapi/linux/version.h
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 24 modules
During the build:
You will see 1 warning message for an uninitialized jump.
And 4 warning messages about relying on default adress.
Thats the broken dtb issue.
No worry for now. We will repack the boot.img with the new kernel zImage and use the original dt.img.
Good enough for this test.
Also as i mentioned we have to build the wifi module out of the tree.
We will get to that. So in this state the kernel will boot and the device functions with exception to wifi.
Remember this run is just to test the baseline system and source code.

Packing The Kernel Into Boot.img
First lets backup our kernel config files.
Code:
mkdir ~/a32e-kernel-build/Device-Files/Configs
cp -f ~/android/device/a32e/.config ~/a32e-kernel-build/Device-Files/Configs
cp -f ~/android/device/a32e/.config.old ~/a32e-kernel-build/Device-Files/Configs
cp -f ~/android/device/a32e/arch/arm/configs/Big-Country_defconfig ~/a32e-kernel-build/Device-Files/Configs
Now lets copy all the modules and kernel z-image we built.
Code:
mkdir ~/a32e-kernel-build/Device-Files/zimage
mkdir ~/a32e-kernel-build/Device-Files/modules
cp -f ~/android/device/a32e/arch/arm/boot/zImage ~/a32e-kernel-build/Device-Files/zimage/kernel
cp -f ~/android/device/a32e/arch/arm/boot/zImage-dtb ~/a32e-kernel-build/Device-Files/
shopt -s globstar
cp **/*.ko ~/a32e-kernel-build/Device-Files/modules/
Compare the new kernel version to the original version.
Code:
cd ~/a32e-kernel-build/Device-Files/zimage
dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version'
Code:
cd ~/a32e-kernel-build/Device-Files/Boot/
dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version'
Output Comparison On My System
[email protected]:~/a32e-kernel-build/Device-Files$ cd ~/a32e-kernel-build/Device-Files/zimage
[email protected]:~/a32e-kernel-build/Device-Files/zimage$ dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version'
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Sat Oct 1 11:53:51 EDT 2016
7162737+0 records in
7162737+0 records out
7162737 bytes (7.2 MB, 6.8 MiB) copied, 5.16669 s, 1.4 MB/s
[email protected]:~/a32e-kernel-build/Device-Files/zimage$ cd ~/a32e-kernel-build/Device-Files/Boot/
[email protected]:~/a32e-kernel-build/Device-Files/Boot$ dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version'
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.7 (GCC) ) #2 SMP PREEMPT Sat Oct 31 02:40:46 CST 2015
7202505+0 records in
7202505+0 records out
7202505 bytes (7.2 MB, 6.9 MiB) copied, 4.70855 s, 1.5 MB/s
[email protected]:~/a32e-kernel-build/Device-Files/Boot$
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Sat Oct 1 11:53:51 EDT 2016
Linux version 3.10.49-perf-g26c2269 ([email protected]) (gcc version 4.7 (GCC) ) #2 SMP PREEMPT Sat Oct 31 02:40:46 CST 2015
Linux version 3.10.49-perf-g26c2269 MATCHES.
Repack the Boot Image.
For now we are just using the original ramdisk and original dt.img.
Later on we will make some changes and then repack.
Were just making sure things boot first.
We have to do this as root.
Code:
sudo
Copy all files needed to AIK Linux for Repacking.
Code:
sudo cp -r ~/a32e-kernel-build/Device-Files/Boot/ramdisk ~/a32e-kernel-build/Tools/AIK-Linux/ramdisk
sudo cp -r ~/a32e-kernel-build/Device-Files/Boot/split_img ~/a32e-kernel-build/Tools/AIK-Linux/split_img
sudo cp -f ~/android/device/a32e/arch/arm/boot/zImage ~/a32e-kernel-build/Tools/AIK-Linux/split_img/Boot.img-zImage
Repack the Boot.img.
Code:
cd ~/a32e-kernel-build/Tools/AIK-Linux
sudo ./repackimg.sh
Yaaayyyy Now we have a boot.img we can flash. (For Testing / Developing Only)
Copy the boot image to our project.
Code:
mkdir ~/a32e-kernel-build/Device-Files/New-Boot
sudo cp -f ~/a32e-kernel-build/Tools/AIK-Linux/image-new.img ~/a32e-kernel-build/Device-Files/New-Boot/image-new.img

Flashing the New Boot Image
Flash and test Boot the new Kernel
#1 Boot the phone into download mode
Connect the device to the computer
Boot into download mode using the power and volume down key after turning off the device.
Or boot to download mode using adb.
Code:
adb reboot download
#2 Flash the boot image
Code:
cd ~/a32e-kernel-build/Device-Files/New-Boot/
fastboot flash boot image-new.img
Output is
[email protected]:~/a32e-kernel-build/Device-Files/New-Boot$ fastboot flash boot image-new.img
target reported max download size of 725000000 bytes
sending 'boot' (10476 KB)...
OKAY [ 1.877s]
writing 'boot'...
(bootloader) HOSD CL#637541
(bootloader) [email protected]
(bootloader) [email protected]%
(bootloader) Update partition OK
(bootloader) [email protected]
OKAY [ 2.759s]
finished. total time: 4.636s
Reboot the phone and test it out
I am happy to say that WIFI is working WE are Building the Prima Module
.

Building Proprietary Modules / Not Included in the Source
Adding the New Modules
All 24 of the modules currently being compiled are Tested and Work.
Please carefully install the modules as I demonstrate here.
Do not execute commands against the /system/lib/modules/ using wildcards.
#1 Get rid of any old modules created by previous compiles.
Code:
rm -f ~/a32e-kernel-build/Device-Files/modules/*.ko
#2 Copy our new modules from the source compile
Code:
cp ~/android/device/a32e/crypto/ansi_cprng.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/evbug.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/spi/spidev.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/fs/ecryptfs/ecryptfs.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/gud/mcDrvModule.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/gud/mcKernelApi.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/arch/arm/mach-msm/dma_test.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_axis.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/usb/host/ice40-hcd.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_event.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_input.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_matrix.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_output.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_oobtest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_pagetest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_readtest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_speedtest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_stresstest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_nandbiterrs.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_nandecctest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_subpagetest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_torturetest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/media/radio/radio-iris-transport.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/platform/msm/msm_bus/msm-buspm-dev.ko ~/a32e-kernel-build/Device-Files/modules/
#3 Create a modules directory on the external sd card
Code:
adb shell "su -c 'mkdir /sdcard2/modules/'"
#4 Erase old modules from sd card if there are any
Code:
adb shell "su -c 'rm -f /sdcard2/modules/*.ko'"
#5 Copy the new modules to the sd card
Code:
adb push ~/a32e-kernel-build/Device-Files/modules/ansi_cprng.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/dma_test.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/ecryptfs.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/evbug.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_axis.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_event.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_input.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_matrix.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_output.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/ice40-hcd.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mcDrvModule.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mcKernelApi.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/msm-buspm-dev.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_nandbiterrs.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_nandecctest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_oobtest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_pagetest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_readtest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_speedtest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_stresstest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_subpagetest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_torturetest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/radio-iris-transport.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/spidev.ko /sdcard2/modules/
#6 Connect the phone and start shell
Code:
adb shell
su
#7 Delete the existing modules from the device
Code:
mount -o rw,remount,rw /system
Code:
rm -rf /system/lib/modules/ansi_cprng.ko
rm -rf /system/lib/modules/dma_test.ko
rm -rf /system/lib/modules/ecryptfs.ko
rm -rf /system/lib/modules/evbug.ko
rm -rf /system/lib/modules/gpio_axis.ko
rm -rf /system/lib/modules/gpio_event.ko
rm -rf /system/lib/modules/gpio_input.ko
rm -rf /system/lib/modules/gpio_matrix.ko
rm -rf /system/lib/modules/gpio_output.ko
rm -rf /system/lib/modules/ice40-hcd.ko
rm -rf /system/lib/modules/mcDrvModule.ko
rm -rf /system/lib/modules/mcKernelApi.ko
rm -rf /system/lib/modules/msm-buspm-dev.ko
rm -rf /system/lib/modules/mtd_nandbiterrs.ko
rm -rf /system/lib/modules/mtd_nandecctest.ko
rm -rf /system/lib/modules/mtd_oobtest.ko
rm -rf /system/lib/modules/mtd_pagetest.ko
rm -rf /system/lib/modules/mtd_readtest.ko
rm -rf /system/lib/modules/mtd_speedtest.ko
rm -rf /system/lib/modules/mtd_stresstest.ko
rm -rf /system/lib/modules/mtd_subpagetest.ko
rm -rf /system/lib/modules/mtd_torturetest.ko
rm -rf /system/lib/modules/radio-iris-transport.ko
rm -rf /system/lib/modules/spidev.ko
#7 Copy the new modules to the device
Code:
cp -rf /sdcard2/modules/ansi_cprng.ko /system/lib/modules
cp -rf /sdcard2/modules/dma_test.ko /system/lib/modules
cp -rf /sdcard2/modules/ecryptfs.ko /system/lib/modules
cp -rf /sdcard2/modules/evbug.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_axis.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_event.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_input.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_matrix.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_output.ko /system/lib/modules
cp -rf /sdcard2/modules/ice40-hcd.ko /system/lib/modules
cp -rf /sdcard2/modules/mcDrvModule.ko /system/lib/modules
cp -rf /sdcard2/modules/mcKernelApi.ko /system/lib/modules
cp -rf /sdcard2/modules/msm-buspm-dev.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_nandbiterrs.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_nandecctest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_oobtest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_pagetest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_readtest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_speedtest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_stresstest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_subpagetest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_torturetest.ko /system/lib/modules
cp -rf /sdcard2/modules/radio-iris-transport.ko /system/lib/modules
cp -rf /sdcard2/modules/spidev.ko /system/lib/modules
#8 Set the correct permissions
Code:
chmod 0644 /system/lib/modules/ansi_cprng.ko
chmod 0644 /system/lib/modules/dma_test.ko
chmod 0644 /system/lib/modules/ecryptfs.ko
chmod 0644 /system/lib/modules/evbug.ko
chmod 0644 /system/lib/modules/gpio_axis.ko
chmod 0644 /system/lib/modules/gpio_event.ko
chmod 0644 /system/lib/modules/gpio_input.ko
chmod 0644 /system/lib/modules/gpio_matrix.ko
chmod 0644 /system/lib/modules/gpio_output.ko
chmod 0644 /system/lib/modules/ice40-hcd.ko
chmod 0644 /system/lib/modules/mcDrvModule.ko
chmod 0644 /system/lib/modules/mcKernelApi.ko
chmod 0644 /system/lib/modules/msm-buspm-dev.ko
chmod 0644 /system/lib/modules/mtd_nandbiterrs.ko
chmod 0644 /system/lib/modules/mtd_nandecctest.ko
chmod 0644 /system/lib/modules/mtd_oobtest.ko
chmod 0644 /system/lib/modules/mtd_pagetest.ko
chmod 0644 /system/lib/modules/mtd_readtest.ko
chmod 0644 /system/lib/modules/mtd_speedtest.ko
chmod 0644 /system/lib/modules/mtd_stresstest.ko
chmod 0644 /system/lib/modules/mtd_subpagetest.ko
chmod 0644 /system/lib/modules/mtd_torturetest.ko
chmod 0644 /system/lib/modules/radio-iris-transport.ko
chmod 0644 /system/lib/modules/spidev.ko
Reboot the device and you will be running the newly compiled modules.

Proprietary Modules
Building Proprietary Modules / Not Included in the Source
Lets take a look at the modules that did not build.
-rw-r--r-- root root 137370 2015-10-30 14:45 core_ctl.ko
lrw-r--r-- root root 2015-10-30 14:43 crypto_test_mod.ko -> crypto_test_mod.ko.3.10
-rw-r--r-- root root 287076 2015-10-30 14:43 crypto_test_mod.ko.3.10
lrw-r--r-- root root 2015-10-30 14:43 moc_crypto.ko -> moc_crypto.ko.3.10
-rw-r--r-- root root 510307 2015-10-30 14:43 moc_crypto.ko.3.10
-rw-r--r-- root root 40 2015-10-30 14:43 moc_crypto.ko.sig.3.10
lrw-r--r-- root root 2015-10-30 14:43 moc_crypto_api_tmpl.ko -> moc_crypto_api_tmpl.ko.3.10
-rw-r--r-- root root 176510 2015-10-30 14:43 moc_crypto_api_tmpl.ko.3.10
lrw-r--r-- root root 2015-10-30 14:43 moc_platform_mod.ko -> moc_platform_mod.ko.3.10
-rw-r--r-- root root 8541 2015-10-30 14:42 moc_platform_mod.ko.3.10
-rw-r--r-- root root 258697 2015-10-30 14:41 texfat.ko
lrw-r--r-- root root 2015-10-30 14:34 wlan.ko -> /system/lib/modules/pronto/pronto_wlan.ko
These are the modules we need to fix / get source for.
#1 core_ctl.ko
#2 crypto_test_mod.ko.3.10
#3 moc_crypto.ko.3.10
#4 moc_crypto.ko.sig.3.10
#5 moc_crypto_api_tmpl.ko.3.10
#6 moc_platform_mod.ko.3.10
#7 texfat.ko
#8 /system/lib/modules/pronto/pronto_wlan.ko
These modules require the following symlinks.
#1 crypto_test_mod.ko -> crypto_test_mod.ko.3.10
#2 moc_crypto.ko -> moc_crypto.ko.3.10
#3 moc_crypto_api_tmpl.ko -> moc_crypto_api_tmpl.ko.3.10
#4 moc_platform_mod.ko -> moc_platform_mod.ko.3.10
#5 wlan.ko -> /system/lib/modules/pronto/pronto_wlan.ko
Who is Who and What is What
This is the prima/pronto wireless net driver.
/system/lib/modules/pronto/pronto_wlan.ko
We will need to get source code for this module to build it.
The Mocana Cryptographic Loadable Kernel Module
crypto_test_mod.ko.3.10
moc_crypto.ko.3.10
moc_crypto.ko.sig.3.10
moc_crypto_api_tmpl.ko.3.10
moc_platform_mod.ko.3.10
http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1903.pdf
We will need to get source code from somewhere.
This I believe is a Qualcomm Module for the MSM8909 Board
core_ctl.ko
We will need to figure this one out.
This Is for large sd card support
texfat.ko
We will need to figure this one out.
So far with our extraversion and localversion settings during compile the original modules still work.
Long term we really want to be able to build theese
Building the Prima WIFI Module.
SEE INSTRUCTIONS ON THE NEXT PAGE
Building the msm_core_ctl module .
Export sched_setscheduler_nocheck() so that external kernel modules can use it.
A) Open ~/android/device/a32e/kernel/sched/core.c in a text editor
Search for do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
It is about line number 4239
add
Code:
EXPORT_SYMBOL(sched_setscheduler_nocheck);
The file should look like this
Code:
return __sched_setscheduler(p, &attr, false);
}
[COLOR="Green"][SIZE="4"]EXPORT_SYMBOL(sched_setscheduler_nocheck);[/SIZE][/COLOR]
static int
do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
Save and close the file.
ADD THE MODULE TO BUILD FILES
B) Open ~/android/device/a32e/drivers/soc/qcom/Kconfig in a text editor
config MSM_CORE_CTL_HELPER
It is about line number 558
add
Code:
config MSM_CORE_CTL
tristate "Core control module"
help
Add support for the Qualcomm core control module
The file should look like this
Code:
config MSM_PACMAN
bool "Enable the Peripheral Access Control Manager (PACMan)"
help
Add support for the Peripheral Access Control Manager (PACMan)
This driver allows reconfiguration of the Bus Access Manager
Low Speed Peripheral (BLSP) ownership.
[COLOR="Green"][SIZE="4"]config MSM_CORE_CTL
tristate "Core control module"
help
Add support for the Qualcomm core control module[/SIZE][/COLOR]
config MSM_CORE_CTL_HELPER
tristate "Core control helper functions for dynamically hotplug CPUs"
help
Provide helper functions for core control driver. Core control
driver dynamicatlly hotplugs CPUs from kernel based on current
system load and state. It also supports limiting min and
max online CPUs from userspace.
Save and close the file.
C) Open ~/android/device/a32e/drivers/soc/qcom/Makefile in a text editor
Search for obj-$(CONFIG_MSM_CORE_CTL_HELPER) += core_ctl_helper.o
It is about line number 62
add
Code:
obj-$(CONFIG_MSM_CORE_CTL) += msm_core_ctl.o
msm_core_ctl-objs := core_ctl_$(ARCH).o
The file should look like this
Code:
obj-$(CONFIG_MSM_PERFORMANCE) += msm_performance.o
[COLOR="Green"]obj-$(CONFIG_MSM_CORE_CTL) += msm_core_ctl.o
msm_core_ctl-objs := core_ctl_$(ARCH).o[/COLOR]
obj-$(CONFIG_MSM_CORE_CTL_HELPER) += core_ctl_helper.o
Save and close the file.
D) Open ~/android/device/a32e/arch/arm/configs/Prima_Big-Country_defconfig in a text editor
Search for CONFIG_MSM_CORE_CTL_HELPER
It is about line number 3471
add
Code:
CONFIG_MSM_CORE_CTL=m
CONFIG_MSM_CORE_CTL_HELPER=y
The file should look like this
Code:
# CONFIG_MSM_SHARED_HEAP_ACCESS is not set
# CONFIG_MSM_SYSTEM_HEALTH_MONITOR is not set
# CONFIG_QCOM_EARLY_RANDOM is not set
# CONFIG_MSM_PACMAN is not set
[COLOR="DarkGreen"]CONFIG_MSM_CORE_CTL=m
CONFIG_MSM_CORE_CTL_HELPER=y[/COLOR]
# CONFIG_MSM_PERFORMANCE is not set
CONFIG_HTC_DEBUG_RIL_PCN0002_DUMP_STACK=y
CONFIG_HTC_DEBUG_RIL_PCN0005_HTC_DUMP_SMSM_LOG=y
CONFIG_HTC_DEBUG_RIL_PCN0006_HTC_DUMP_BAM_DMUX_LOG=y
CONFIG_MEM_SHARE_QMI_SERVICE=y
Save and close the file.
E) DOWNLOAD THE SOURCE FILE.
https://drive.google.com/open?id=0B8jitdIyh2NtNjU3NFBIcU1NY0k
Copy the source to the TREE.
Code:
cp -rf ~/Downloads/core_ctl_arm.o_shipped /android/device/a32e/drivers/soc/qcom/core_ctl_arm.o_shipped
Now Go to the Build Prima Module Section on the next page and follow all instructions.

DE-Compile The Factory DT.img To DTB & DTS
How to Compile The Prima / (" PRONTO ") Wlan Module -->>> IN KERNEL TREE
# 1 ) Get the required Source Code ( DOWNLOAD HERE ) or attached to the DEVDB.
https://drive.google.com/open?id=0B8jitdIyh2NtMzB2a2pNeU1iWDg
#2 ) Add it to our Project & Kernel Source Tree
Code:
mkdir ~/a32e-kernel-build/Qualcom-Vendor-Opensource/
mv ~/Downloads/qualcom-vendor-opensource.zip ~/a32e-kernel-build/Qualcom-Vendor-Opensource/
unzip ~/a32e-kernel-build/Qualcom-Vendor-Opensource/qualcom-vendor-opensource.zip -d ~/a32e-kernel-build/Qualcom-Vendor-Opensource/
rm -rf ~/a32e-kernel-build/Qualcom-Vendor-Opensource/qualcom-vendor-opensource.zip
cp -rf ~/a32e-kernel-build/Qualcom-Vendor-Opensource/vendor/qcom/opensource/wlan/prima ~/android/device/a32e/drivers/staging/prima
#2 ) Configure The Module to build in the Kernel Source Tree
A) Open in a text Editor ~/android/device/a32e/drivers/staging/prima/Kconfig
Add to the bottom of the file:
Code:
[COLOR="SeaGreen"][SIZE="4"]config WLAN_OFFLOAD_PACKETS
bool "Enable offload packets feature"
default n[/SIZE][/COLOR]
[COLOR="SeaGreen"][SIZE="4"]config QCOM_TDLS
bool "Enable TDLS (Tunnel Direct Link Setup) feature"
default n[/SIZE][/COLOR]
Or download my Kconfig file
https://drive.google.com/open?id=0B8jitdIyh2Ntc0p6UFNlTGxJNkU
Copy the file to the tree. ( ONLY IF YOU DOWNLOADED IT )
Code:
mv ~/Downloads/Kconfig ~/android/device/a32e/drivers/staging/prima/Kconfig
B) Open in a text Editor ~/android/device/a32e/drivers/staging/Kconfig
Add to the bottom of the file:
Code:
[COLOR="SeaGreen"][SIZE="4"]source "drivers/staging/prima/Kconfig"[/SIZE][/COLOR]
C ) Open in a text Editor ~/android/device/a32e/drivers/staging/Makefile
Add to the bottom of the file:
Code:
[COLOR="SeaGreen"][SIZE="4"]
obj-$(CONFIG_PRIMA_WLAN) += prima/
obj-$(CONFIG_PRONTO_WLAN) += prima/
[/SIZE][/COLOR]
#4 ) Edit the Big-Country_defconfig File
I have made several Changes - USE THIS DOWNLOAD for now.
https://drive.google.com/open?id=0B8jitdIyh2NtZ3VtTTV6Z3dhb0E
Copy the new config to the tree
Code:
cp ~/Downloads/Prima_Big-Country_defconfig ~/android/device/a32e/arch/arm/configs/Prima_Big-Country_defconfig
#4 ) Compile the Kernel and it will build the wlan.ko
Code:
[SIZE="4"][COLOR="DarkGreen"]cd
cd ~/android/device/a32e/
export TOP=~/android/Toolchains/
export PATH=$TOP/prebuilts/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=~/android/Toolchains/prebuilts/arm-eabi-4.8/bin/arm-eabi-
make clean
make mrproper
make Prima_Big-Country_defconfig
make prepare
make all -j8
make modules[/COLOR][/SIZE]
You Should see this output.
[email protected]:~/android/device/a32e$ make modules
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
Building modules, stage 2.
MODPOST 26 modules
Now we have 26 modules instead of 24.
A new wlan.ko which will get renamed to pronto_wlan.ko.
We also have the WCNSS file for the wlan.
Code:
[SIZE="4"][COLOR="Blue"]
~/android/device/a32e/drivers/staging/prima/wlan.ko
~/android/device/a32e/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat
~/bigcountry/android/device/a32e/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini
~/bigcountry/android/device/a32e/drivers/staging/prima/firmware_bin/WCNSS_qcom_wlan_nv.bin
~/android/device/a32e/drivers/bluetooth/bluetooth-power.ko
[/COLOR][/SIZE]
Now we are ready to load the new Kernel and Modules
load the new Kernel
Code:
sudo cp -r ~/a32e-kernel-build/Device-Files/Boot/ramdisk ~/a32e-kernel-build/Tools/AIK-Linux/ramdisk
Code:
sudo cp -r ~/a32e-kernel-build/Device-Files/Boot/split_img ~/a32e-kernel-build/Tools/AIK-Linux/split_img
Code:
sudo cp -f ~/android/device/a32e/arch/arm/boot/zImage ~/a32e-kernel-build/Tools/AIK-Linux/split_img/Boot.img-zImage
Code:
cd ~/a32e-kernel-build/Tools/AIK-Linux
sudo ./repackimg.sh
sudo cp -f ~/a32e-kernel-build/Tools/AIK-Linux/image-new.img ~/a32e-kernel-build/Device-Files/New-Boot/image-new.img
adb reboot download
sleep 10s
cd ~/a32e-kernel-build/Device-Files/New-Boot/
fastboot flash boot image-new.img
echo ""
echo ""
echo "Finished Flashing Kernel"
read -p "Press [Enter] to Reboot..."
fastboot reboot
Clean out our project directory.
Code:
rm -f ~/a32e-kernel-build/Device-Files/modules/*.ko
Copy compiled modules to our project directory.
Code:
cp ~/android/device/a32e/drivers/staging/prima/wlan.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/staging/prima/firmware_bin/WCNSS_qcom_wlan_nv.bin ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/bluetooth/bluetooth-power.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/crypto/ansi_cprng.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/evbug.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/spi/spidev.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/fs/ecryptfs/ecryptfs.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/gud/mcDrvModule.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/gud/mcKernelApi.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/arch/arm/mach-msm/dma_test.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_axis.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/usb/host/ice40-hcd.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_event.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_input.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_matrix.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/input/misc/gpio_output.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_oobtest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_pagetest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_readtest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_speedtest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_stresstest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_nandbiterrs.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_nandecctest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_subpagetest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/mtd/tests/mtd_torturetest.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/media/radio/radio-iris-transport.ko ~/a32e-kernel-build/Device-Files/modules/
cp ~/android/device/a32e/drivers/platform/msm/msm_bus/msm-buspm-dev.ko ~/a32e-kernel-build/Device-Files/modules/
Clean the sdcard temporary directory.
Code:
adb shell "su -c 'rm -f /sdcard2/modules/*.ko'"
Copy the new modules to the sd card temp directory.
Code:
adb push ~/a32e-kernel-build/Device-Files/modules/wlan.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/WCNSS_cfg.dat /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/WCNSS_qcom_cfg.ini /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/WCNSS_qcom_wlan_nv.bin /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/bluetooth-power.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/ansi_cprng.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/dma_test.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/ecryptfs.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/evbug.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_axis.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_event.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_input.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_matrix.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/gpio_output.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/ice40-hcd.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mcDrvModule.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mcKernelApi.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/msm-buspm-dev.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_nandbiterrs.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_nandecctest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_oobtest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_pagetest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_readtest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_speedtest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_stresstest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_subpagetest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/mtd_torturetest.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/radio-iris-transport.ko /sdcard2/modules/
adb push ~/a32e-kernel-build/Device-Files/modules/spidev.ko /sdcard2/modules/
NOW connect the device and start a shell
Code:
adb shell
su
Re-Mount System as Read Write.
Code:
mount -o rw,remount,rw /system
Remove the existing modules from the device .
Code:
rm -rf /system/lib/modules/wlan.ko
rm -rf /system/lib/modules/pronto/pronto_wlan.ko
rm -rf /system/etc/firmware/wlan/prima/WCNSS_cfg.dat
rm -rf /system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
rm -rf /system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin
rm -rf /system/lib/modules/bluetooth-power.ko
rm -rf /system/lib/modules/ansi_cprng.ko
rm -rf /system/lib/modules/dma_test.ko
rm -rf /system/lib/modules/ecryptfs.ko
rm -rf /system/lib/modules/evbug.ko
rm -rf /system/lib/modules/gpio_axis.ko
rm -rf /system/lib/modules/gpio_event.ko
rm -rf /system/lib/modules/gpio_input.ko
rm -rf /system/lib/modules/gpio_matrix.ko
rm -rf /system/lib/modules/gpio_output.ko
rm -rf /system/lib/modules/ice40-hcd.ko
rm -rf /system/lib/modules/mcDrvModule.ko
rm -rf /system/lib/modules/mcKernelApi.ko
rm -rf /system/lib/modules/msm-buspm-dev.ko
rm -rf /system/lib/modules/mtd_nandbiterrs.ko
rm -rf /system/lib/modules/mtd_nandecctest.ko
rm -rf /system/lib/modules/mtd_oobtest.ko
rm -rf /system/lib/modules/mtd_pagetest.ko
rm -rf /system/lib/modules/mtd_readtest.ko
rm -rf /system/lib/modules/mtd_speedtest.ko
rm -rf /system/lib/modules/mtd_stresstest.ko
rm -rf /system/lib/modules/mtd_subpagetest.ko
rm -rf /system/lib/modules/mtd_torturetest.ko
rm -rf /system/lib/modules/radio-iris-transport.ko
rm -rf /system/lib/modules/spidev.ko
Copy the New Compiled Modules to the device .
Code:
cp -rf /sdcard2/modules/wlan.ko /system/lib/modules/pronto/pronto_wlan.ko
cp -rf /sdcard2/modules/WCNSS_cfg.dat /system/etc/firmware/wlan/prima/
cp -rf /sdcard2/modules/WCNSS_qcom_cfg.ini /system/etc/firmware/wlan/prima/
cp -rf /sdcard2/modules/WCNSS_qcom_wlan_nv.bin /system/etc/firmware/wlan/prima/
cp -rf /sdcard2/modules/bluetooth-power.ko /system/lib/modules/
cp -rf /sdcard2/modules/ansi_cprng.ko /system/lib/modules
cp -rf /sdcard2/modules/dma_test.ko /system/lib/modules
cp -rf /sdcard2/modules/ecryptfs.ko /system/lib/modules
cp -rf /sdcard2/modules/evbug.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_axis.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_event.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_input.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_matrix.ko /system/lib/modules
cp -rf /sdcard2/modules/gpio_output.ko /system/lib/modules
cp -rf /sdcard2/modules/ice40-hcd.ko /system/lib/modules
cp -rf /sdcard2/modules/mcDrvModule.ko /system/lib/modules
cp -rf /sdcard2/modules/mcKernelApi.ko /system/lib/modules
cp -rf /sdcard2/modules/msm-buspm-dev.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_nandbiterrs.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_nandecctest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_oobtest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_pagetest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_readtest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_speedtest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_stresstest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_subpagetest.ko /system/lib/modules
cp -rf /sdcard2/modules/mtd_torturetest.ko /system/lib/modules
cp -rf /sdcard2/modules/radio-iris-transport.ko /system/lib/modules
cp -rf /sdcard2/modules/spidev.ko /system/lib/modules
Create the pronto_wlan.ko / wlan.ko symlink .
Code:
ln -s /system/lib/modules/pronto/pronto_wlan.ko /system/lib/modules/wlan.ko
set the permissions for all the new modules.
Code:
chmod 0644 /system/lib/modules/wlan.ko
chmod 0644 /system/lib/modules/pronto/pronto_wlan.ko
chmod 0644 /system/etc/firmware/wlan/prima/WCNSS_cfg.dat
chmod 0644 /system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
chmod 0644 /system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin
chmod 0644 /system/lib/modules/bluetooth-power.ko
chmod 0644 /system/lib/modules/ansi_cprng.ko
chmod 0644 /system/lib/modules/dma_test.ko
chmod 0644 /system/lib/modules/ecryptfs.ko
chmod 0644 /system/lib/modules/evbug.ko
chmod 0644 /system/lib/modules/gpio_axis.ko
chmod 0644 /system/lib/modules/gpio_event.ko
chmod 0644 /system/lib/modules/gpio_input.ko
chmod 0644 /system/lib/modules/gpio_matrix.ko
chmod 0644 /system/lib/modules/gpio_output.ko
chmod 0644 /system/lib/modules/ice40-hcd.ko
chmod 0644 /system/lib/modules/mcDrvModule.ko
chmod 0644 /system/lib/modules/mcKernelApi.ko
chmod 0644 /system/lib/modules/msm-buspm-dev.ko
chmod 0644 /system/lib/modules/mtd_nandbiterrs.ko
chmod 0644 /system/lib/modules/mtd_nandecctest.ko
chmod 0644 /system/lib/modules/mtd_oobtest.ko
chmod 0644 /system/lib/modules/mtd_pagetest.ko
chmod 0644 /system/lib/modules/mtd_readtest.ko
chmod 0644 /system/lib/modules/mtd_speedtest.ko
chmod 0644 /system/lib/modules/mtd_stresstest.ko
chmod 0644 /system/lib/modules/mtd_subpagetest.ko
chmod 0644 /system/lib/modules/mtd_torturetest.ko
chmod 0644 /system/lib/modules/radio-iris-transport.ko
chmod 0644 /system/lib/modules/spidev.ko
RE-Boot and run your new kernel and modules with a smile.

Customizing the Kernel
Changing and Customizing The Kernel

SUCCESS !! ( Build the Prima / Pronto Wlan Module)
Fix ADD the DTB Blob to the Source
reserved space

I'm so glad somone is doing this I've been wanting a new kernel for a while and I think this might help make a path to new roms

This looks great. Can't wait to see where this goes. What can I do to help?

@zixxorb
You can run through with all of this and get the kernel running on your device.
Right now im working on getting the missing modules to build.
So you can work on that to.
The modules that are generated during the compile function properly.

Ok, so I'm more of a noob to doing anything with kernels, idk what I need to do exactly. Plus I'm already on 6.0 (this is my main phone)

The Most Valuable Document Ever
This is exactly what we need to answer some questions.
Authored by Qualcomm and one of the hardest things to find.
Make sure to copy this wile you can.
It's practically Top Secret.
https://github.com/dante198406/Qual...0-NR964-4_C_MSM8909_LA_SW_User_Manual_SPD.pdf
Get it wile you can !!

Just a general update.
I have updated the modules install section.
It now includes the instructions for installing the new modules.
The modules have been tested and seem to operate without issues.

Will this work for the sprint variant?
I'm a noob so pls permit me if this question sounds foolish. All through the tutorial, it seems this kernel is for the Metro PCs. Will it work for the sprint variant of 626s?

This tutorial is based off of the Metro-Pcs version.
The HTC-DEV site has separate source code for each device carrier.
You would follow everything exactly except.
1 ) From the HTC-DEV site download the source code for your specific carrier.
For sprint download sprint.
For t-mobile download t-mobile.
Set the device filter on the website to be desire626s
and you will get this.
2 ) in the section #2 Setup the Kernel Source
There are commands for unzipping the source file.
You will need to change the filename in the command to match the filename you downloaded.
After the first untar / unpack you will need to get the kernel filename.
Change that filename in the commands as well.
3) When you edit the version info.
Open up the Big-Country_defconfig
It is in the folder ~/android/device/a32e/arch/arm/configs
Open it with G-Edit or whatever text editor you use.
Search for CONFIG_LOCALVERSION=
and change it to CONFIG_LOCALVERSION="-g26c2269"
CHANGE
CONFIG_LOCALVERSION="-g26c2269"
CONFIG_LOCALVERSION="-your device version"
You can get the version as i showed you in previous post.
4) The rest is all the same.
AS far as the kernel and modules that have been uploaded here, they are for the Metro Pcs Version. ( And Lollipop NOT Marshmallow)
I will build the others later when i finish more of this project.
ALSO YOU CAN USE THIS TUTORIAL TO BUILD THE KERNEL FOR ANY DEVICE.
Things will change here and there but generally speaking all of the steps you need to follow are the same.

Related

[HOWTO] Root Nexus One 2.2.1 FRG83D without OEM unlock

This guide is for people who want root but want to keep their stock rom, not breaking the warranty, unlocking bootloader etc.
A proud ubuntu user, I am writing this in a new thread purely because the manual rageagainstthecage method and SuperOneClick method did not not work for me, see link to my conclusion below if you care
http://forum.xda-developers.com/showpost.php?p=11305312&postcount=2526
What did work however was via adb shell using psneuter and its fairly simple if you follow the following commands.
This guide assumes you know how to get access to the shell via adb, if you dont then search elsewhere for a useful guide
OK lets get to business!
1. Download the attached nexus_one_softroot.tar from the bottom of this post and extract contents to the same folder as adb
2. Open up your terminal, cd to the same folder as adb and the extracted files
3. Enter the following commands:
Code:
sudo ./adb push psneuter /data/local/tmp/psneuter
sudo ./adb push busybox /data/local/tmp/busybox
sudo ./adb push su /data/local/tmp/su
sudo ./adb shell chmod 755 /data/local/tmp/psneuter
sudo ./adb shell chmod 755 /data/local/tmp/busybox
sudo ./adb shell chmod 755 /data/local/tmp/su
sudo ./adb shell
After this you should see only a $ which tells us that we at the android command line with user privileges only, lets continue
Code:
$ cd /data/local/tmp
$ ls
busybox
su
psneuter
$ ./psneuter
property service neutered.
killing adbd. (should restart in a second or two)
You will now be kicked out of android shell, lets go back in
Code:
sudo ./adb shell
After this you should see only a # which tells us that we root baby! If you want to double check issue this command
Code:
# id
uid=0(root) gid=0(root)
Lets continue on. From this point we will install busybox and su which will make root permanent
Code:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /data/local/tmp
# ./busybox cp busybox /system/bin
# chmod 4755 /system/bin/busybox
# busybox cp su /system/bin
# chmod 4755 /system/bin/su
# exit
For some reason I sometimes have to enter exit twice to leave the android shell. Again, re-access the android shell
Code:
sudo ./adb shell
Now in the android shell we can finish up
Code:
# su
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
# exit
# exit
Lastly we must install Superuser, and I did this from the android market so I knew its the latest version, its simple to get, less command input etc.
Now you have root! I hope this was simple enough to follow, I have not really written a guide before but from lots of searching I just could not find a solution for my Nexus One 2.2.1 FRG83D, especially any guide that uses psneuter.
Anyway, glad to contribute
EDIT - also, being new to starting threads, this may not quite be in the right section of the forum, sorry if thats the case mods
Added link to the thread from Wiki.
upgraded to gingerbread 2.3.3. after copying and setting permissions, got this:
PHP:
$ cd /data/local/tmp
$ ls -l
-rwxr-xr-x shell shell 26248 2010-07-22 10:20 su
-rwxr-xr-x shell shell 1062992 2010-10-16 22:29 busybox
-rwxr-xr-x shell shell 585731 2011-01-08 18:02 psneuter
su
busybox
psneuter
$ ./psneuter
Failed to set prot mask (Inappropriate ioctl for device)
second time threw me out of shell. again adb shell gives this:
PHP:
$ id
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet)
mfkr said:
upgraded to gingerbread 2.3.3. after copying and setting permissions, got this:
Code:
$ ./psneuter
Failed to set prot mask (Inappropriate ioctl for device)
Click to expand...
Click to collapse
I believe this is due to a change in the kernel as it is upgraded into gingerbread, the input/output controls have changed, leaving psneuter out of date with the current kernel.
However if an exploit is found with the kernel used in 2.3.3, you can use it in place of psneuter with the above method.

Help,attach file is logcat information.

refer to GUID(http://forum.xda-developers.com/showthread.php?t=2125196) to add recovery menu item.
1.Update framework-res.apk to device.device status is ok(reboot and device can normal go into os).
2.use dexopt-wrapper reodex ,get android.policy.odex
3.copy android.policy.odex to /system/framework/android.policy.odex and set 644 permissions
4.reboot device and stay at samsung logo frame
5.attach file is logcat information.The log file alway display "DexOpt: Some deps went away"
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
Stop opening more threads related to the same problem, please.
You have already your problem here and there and here again.

ssh/dropbear password

Got password protected ssh with dropbear working
Needed files: dropbearmulti
search for dropbear static binary. On landlay page it's in download binaries extras armv6 is working fine.
We need rw on /etc
cp -rp /system/etc /data/etc
mount -o bind /data/etc /system/etc
Now we need to create some files needed of dropbear and add root user
cd /etc
touch passwd group shells shadow
adduser root -g root
add default shells
echo "/bin/sh" > shells
echo "/bin/ash" >> shells
edit passwd and change home dir and shell path, both must exist in CC and shell
also change 1000 to 0
root:x:0:0::/data:/bin/ash
edit group file, change all 1000 to 0
cd /data
chmod +x dropbearmulti
ln dropbearmulti -s dropbear
chmod 755 dropbearmulti
dropbear -p 2222 (dropbear -E -F -p 2222 if you want a log)
Copy the old keys to /etc/dropbear or create new ones

BUG REPORT: SuperSU v2.65 doesn’t know how to cd /sdcard/Download/

SU v2.65 doesn’t know how to cd /sdcard/Download/ - it apparently doesn’t know how to resolve the sdcard symbolic link. The work-around is you have to either
cd /sdcard/Download/ ​before​ you su
exit from su so you can cd /sdcard/Download/ then re-run su
[email protected]:/ # cd /sdcard/Download/
tmp-mksh: cd: /sdcard/Download: No such file or directory
[email protected]:/ # exit
[email protected]:/ $ cd /sdcard/Download/
[email protected]:/sdcard/Download $ pwd
/sdcard/Download
[email protected]:/sdcard/Download $ su
[email protected]:/mnt/shell/emulated/0/Download #
​
This did not happen prior to updating SuperSU.
Environment: Samsung Tab-S (SM-T800), Android 5.0.2, Kernel version 3.4.39-5941801

[Q] How to bypass ADB block (or how to reinstall ADB) on Android system?

I have a 65 inch XiaomiTV 3 (note, this is a different flavor of OS from MiBox), it works great until Xiaomi starts to push video ads everytime I turn on the TV. Xiaomi has disabled (likely completely removed ADB) from their system (mine is 1.12.10, any newer version would not be allow u to gain root access in anyway, unless you prove me wrong). Since there is no way to install a new recovery on XiaomiTV 3 (not that I know of, I should add), I tried the only tool that can root this system with an exploit, the 360 Root (http://root.360.cn/). Now this tool itself has some ads, so I will need to remove it later. But at least it allows me to use `su` in a terminal emulator.
Once I gain the root access on my device, I first tried to use ADB by running (and I need to add, XiaomiTV 3 does not have USB debugging port) a terminal emulator (I use Android Terminal Emulator):
Code:
su
stop adbd
setprop service.adb.tcp.port 5555
start adbd
Then I try to connect to my XiaomiTV 3 (its ip is 192.168.123.123) by:
Code:
adb connect 192.168.123.123
It connects, meaning ADB is not removed completely. However if I type `adb devices` it shows 192.168.123.123 is offline.
I then upgraded my Android platform tools and adb by:
Code:
android update sdk no-ui
android update adb
Restart the adb server:
Code:
adb kill-server
adb connect 192.168.123.123
Here it still shows offline, so I restarted both the XiaomiTV 3 and my laptop, and regain root (I will lose root everytime I reboot XiaomiTV 3), did the above all over again. No luck. Then I thought to copy my `~/.android/adbkey.pub` to a usb drive, and then plug it in to XiaomiTV 3, then use a terminal emulator to:
Code:
su
mv /mnt/usb/sdcard/adbkey.pub /data/misc/adb/adb_keys
Then
Code:
stop adbd
setprop service.adb.tcp.port 5555
start adbd
Still, after I
Code:
adb kill-server
adb connect 192.168.123.123
the device is still offline.
Then I tried another approach to get get SuperSU to the system by first copying supersu to a USB drive and then copy it to `/data/superuser` in XiaomiTV 3.
Then I did:
Code:
su
mount -o rw,remount /system
mkdir /system/bin/.ext
chmod 777 /system/bin/.ext
chown root /system/bin/.ext
cp /data/superuser/su /system/bin/.ext/.su
chmod 6755 /system/bin/.ext/.su
chown root /system/bin/.ext/.su
cp /data/superuser/su /system/xbin/su
chmod 755 /system/xbin/su
chown root /system/xbin/su
cp /data/superuser/su /system/xbin/daemonsu
chmod 755 /system/xbin/daemonsu
chown root /system/xbin/daemonsu
cp /data/superuser/supolicy /system/xbin/supolicy
chmod 755 /system/xbin/supolicy
cp /data/superuser/libsupol.so /system/lib/libsupol.so
chmod 644 /system/lib/libsupol.so
mkdir /system/etc/init.d
chmod 644 /system/etc/init.d
cp /data/superuser/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon
chmod 744 /system/etc/init.d/99SuperSUDaemon
busybox_xm touch /system/etc/.installed_su_daemon
echo 1 >> /system/etc/.installed_su_daemon
chmod 644 /system/etc/.installed_su_daemon
mkdir /system/app/SuperSU
chmod 755 /system/app/SuperSU
cp /data/superuser/SuperSU.apk /system/app/SuperSU/SuperSU.apk
chmod 644 /system/app/SuperSU/SuperSU.apk
cp /data/superuser/install-recovery.sh /system/etc/install-recovery.sh
chmod 755 /system/etc/install-recovery.sh
ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh
Then I reboot, apparently, the system overwrites the `/system/xbin/su` (either by 360 root or Xiaomi's OS). So I redid everything above, without reboot. Sadly, SuperSU still asks me to upgrade/update my binary file.
So this is when I stopped knowing what to do next. Any ideas?

Categories

Resources