Since the European genuine HTC ROM
Code:
# uname -a
Linux localhost 2.6.35.10-g60b2609 #1 PREEMPT Sun Apr 17 01:15:33 CST 2011 armv6l GNU/Linux
has tun support disabled according to the /proc/config.gz I got with scp from my marvel,
Code:
# CONFIG_TUN is not set
I just build one
using the wildfire S kernel source code from htcdev
and
http://marakana.com/forums/android/examples/111.html
http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
but with arm toolchain from http://www.emdebian.org/crosstools.html
Code:
$ gunzip config.gz
$ cp -vp config .config
$ make xconfig -> enable tun, set CONFIG_CROSS_COMPILE="arm-linux-gnueabi-"
or use the patch in zipfile.
Code:
$ make modules_prepare
$ make modules
$ make modules_install INSTALL_MOD_PATH='../install'
Module Binary is attached, please test. Copyright is GPL >= V. 2,
md5sum
10fd212186ee8506d72d14b00aa15bf5 tun.ko.zip
a8f6e2bd1f7bab19f02371955b9eda0d tun.ko
I got problems dependency checking without building the whole kernel:
Code:
$ /sbin/depmod -ae -b ../install/modules -E ./Module.symvers 2.6.35.10
WARNING: ../install/modules/lib/modules/2.6.35.10/kernel/drivers/net/tun.ko needs unknown symbol register_netdevice
... dozens more...
$ /sbin/depmod -n /usr/local/src/htc-kernel/install/modules/lib/modules/2.6.35.10/kernel/drivers/net/tun.ko
/usr/local/src/htc-kernel/install/modules/lib/modules/2.6.35.10/kernel/drivers/net/tun.ko:
# Aliases extracted from modules themselves.
alias devname:net/tun tun
alias char-major-10-200 tun
# Soft dependencies extracted from modules themselves.
# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe.
# Aliases for symbols, used by symbol_request().
alias symbol:tun_get_socket tun
# Device nodes to trigger on-demand module loading.
tun net/tun c10:200
No questions or Support par PM or E-Mail. Report and ask here, pls.
Or tell me an IRC channel where android devs meet.
Thanks, but I suggest preference of stability and integrity before performance at experimental state kernels
Well, I start my Android world with smaller steps.
And as a conservative engineer I wouldn't overclock.
Ok, thanks.
BTW: Noone has been chasing me with an axe yet, so I assume the tun.ko module works?
Thank you for your work.
I try to load this tun.ko on Wildfire S, but module don't load.
Code:
insmod: init_module '/system/lib/modules/tun.ko' failed (Exec format error)
When I check magic number of module, here is only '2.6.35.10', but maybe right is '2.6.35.10-g60b2609'.
Please, is it possible to fix it?
(I need tun.ko because openvpn...)
Thx
Hmm, thx, I've expected the emdebian gcc is not compatible with armv6l.
You need to use the toolchain from the android sdk or the one from the CM guys site.
I know a lot of this has been posted before in other locations, but recently I have found some of that data to be incomplete when I was building a custom kernel for my GNex, so just bear with me.
--The Build Environment--
Operating System: Xubuntu 12.04 x86 (I haven't tested it on the x64 version yet)
Dependencies: (using sudo-apt get install)
Code:
git git-core gnupg flex bison gperf build-essential zip hexdump gedit \
curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 gcc \
libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib \
mingw32 tofrodos
Other Files Needed:
unpack-mkbootimg - Which I have forked from work4blue@github.
You can grab the modified version from: https://github.com/ClimberTy/unpack-mkbootimg.git
The mkbootimg.c has been modified to fix the default load addresses of the kernel with the GNex (See below for more details).
Android SDK - You just need the Android Debug Bridge (ADB) from the SDK.
Or you can grab a toolkit from here: http://forum.xda-developers.com/showthread.php?t=1848036 for a script that will get you the files you need (Internet connection required).
Needed:
Samsung Galaxy Nexus Prime (I9250)
The GNex Bootloader to be Unlocked (http://www.android.gs/how-to-unlock-galaxy-nexus-bootloader/)
Kernel files (See Kernel Source area for locations)
ADB and Fastboot
ARM Cross Compiler - grab from here. NOTE: You'll need the ARM EABI Release. You can also get the ARM Cross Compiler by following the "Downloading a prebuilt gcc" instructions from Google as well.
Place either of these ARM Compilers in the folder you are using to build your KERNELSOURCE.
Linux USB Driver Rules:
Open Terminal and type:
Code:
$ vim /etc/udev/rules.d/70-android.rules
You can use gEdit if you prefer.
Paste in (Ensuring that <username> is the name of your Linux profile):
Code:
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
# adb protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
# fastboot protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
# adb protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
# fastboot protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"
Kernel Source:
It is important that you make separate folders to put everything in. Keeping the DEV area organized will help out in the long run.
Code:
$ mkdir -p ~/Documents/Kernel/Source
CyanogenMod 10.1 Kernel from GitHub
Google's Android Kernel (See Downloading Android Kernel section below for more details)
Downloading the Android Kernel:
To download the kernel directly from Google enter in these commands.
Code:
$ git clone https://android.googlesource.com/kernel/omap.git
$ cd omap/
$ git branch -a
What you'll see in response:
Code:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/android-omap-3.0
remotes/origin/android-omap-panda-3.0
remotes/origin/android-omap-steelhead-3.0-ics-aah
remotes/origin/android-omap-tuna-3.0
remotes/origin/android-omap-tuna-3.0-ics-mr1
remotes/origin/android-omap-tuna-3.0-jb-mr0
remotes/origin/android-omap-tuna-3.0-jb-mr1
remotes/origin/android-omap-tuna-3.0-jb-mr1.1
remotes/origin/android-omap-tuna-3.0-jb-pre1
remotes/origin/android-omap-tuna-3.0-mr0
remotes/origin/android-omap-tuna-3.0-mr0.1
remotes/origin/linux-omap-3.0
remotes/origin/master
remotes/origin/sph-l700-fh05
To grab the (at this time) latest Jellybean source:
Code:
$ git checkout remotes/origin/android-omap-tuna-3.0-jb-mr1.1
Otherwise just use:
Code:
$ git clone https://github.com/CyanogenMod/android_kernel_samsung_tuna.git
--Building the Kernel--
In the ~/Documents/Kernel/KERNELSOURCE (varies depending on which kernel you downloaded. For this build I used android_kernel_samsung_tuna-jb as my source directory. The ARM Cross Compiler that I downloaded from the CodeSourcery site is located inside this folder.
In the terminal type:
Code:
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=/home/user/Documents/Kernel/KERNELSOURCE/arm-2011.03/bin/arm-none-eabi-
$ make tuna_defconfig
$ make
NOTE: The [...]/arm-none-eabi- is how it is supposed to be.
Now go grab some lunch or drink a beer or two, it could take about 30-45 mins to compile. You'll know when it is finished when you see:
Code:
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gzip
AS arch/arm/boot/compressed/piggy.gzip.o
CC arch/arm/boot/compressed/misc.o
CC arch/arm/boot/compressed/decompress.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 4 modules
CC crypto/ansi_cprng.mod.o
LD [M] crypto/ansi_cprng.ko
CC drivers/rpmsg/rpmsg_client_sample.mod.o
LD [M] drivers/rpmsg/rpmsg_client_sample.ko
CC drivers/rpmsg/rpmsg_server_sample.mod.o
LD [M] drivers/rpmsg/rpmsg_server_sample.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
The zImage is what we need because it is the compressed Linux kernel. Note the path of where the zImage is located. We also need the *.ko files (Kernel Modules). Remember their paths because you'll need to create those same paths later when you rebuild the kernel. Probably best to move these files to a new folder, I have used /home/user/Documents/Kernel/CompiledKernel/.
--Backing Up the Original Kernel--
It is important that we save a backup of the original kernel just in case there are errors in the kernel you are creating and we need to revert. Each device has their images saved in somwhat similar spots but they can change depending on device or OS.
Before these images were located on /proc/mnt location but with this model/OS they are stored elsewhere. Your phone will most likely need to be rooted prior to this operation. So either push the SuperUser app to your phone or grab Koushik Dutta's version from ROM Manager in ClockworkMod (http://download.clockworkmod.com/test/superuser-2.zip).
How to grab the images:
Code:
$ adb shell
$ su
$ ls -l /dev/block/platform/omap/omap_hsmmc.0/by-name
Result:
Code:
lrwxrwxrwx root root 2013-02-20 06:38 boot -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 2013-02-20 06:38 cache -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 2013-02-20 06:38 dgs -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 2013-02-20 06:38 efs -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 2013-02-20 06:38 metadata -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 2013-02-20 06:38 misc -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 2013-02-20 06:38 param -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 2013-02-20 06:38 radio -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 2013-02-20 06:38 recovery -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 2013-02-20 06:38 sbl -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 2013-02-20 06:38 system -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 2013-02-20 06:38 userdata -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 2013-02-20 06:38 xloader -> /dev/block/mmcblk0p1
We need to backup the boot and recovery images.
Copying the Android Images:
Code:
cat /dev/block/mmcblk0p7 > /sdcard/boot
cat /dev/block/mmcblk0p8 > /sdcard/recovery
Pulling the Images Off the Device:
Code:
$ dab pull /sdcard/IMAGE_NAME ~/Documents/Kernel/OriginalKernel/
NOTE: This assumes you have this folder already created.
--Unpacking the Kernel--
Splitting the Image:
Using the unpack-mkbootimg-master kit you can split the image by using the ./unpackbootimg binary. The command is:
Code:
$ ./unpackbootimg -i ~/Documents/Kernel/OriginalKernel/boot
The results should be similar to this:
Code:
BOARD_KERNEL_CMDLINE
BOARD_KERNEL_BASE 80000000
BOARD_OAGE_SIZE 2048
The output files in your unpack-mkbootimg-master folder should be similar to this:
Code:
drwxrwxr-x 4 user user 4.0K Mar 3 11:22 .
drwxr-xr-x 3 user user 4.0K Mar 3 11:15 ..
-rw-rw-r-- 1 user user 9 Mar 3 11:22 boot-base
-rw-rw-r-- 1 user user 1 Mar 3 11:22 boot-cmdline
-rw-rw-r-- 1 user user 2.9K Feb 28 18:00 bootimg.h
-rw-rw-r-- 1 user user 5 Mar 3 11:22 boot-pagesize
-rw-rw-r-- 1 user user 344K Mar 3 11:22 boot-ramdisk.gz
-rw-rw-r-- 1 user user 4.0M Mar 3 11:22 boot-zImage
drwxrwxr-x 2 user user 4.0K Mar 3 11:15 libmincrypt
-rw-rw-r-- 1 user user 7.3K Mar 3 11:15 libmincrypt.a
-rwxr-xr-x 1 user user 622 Feb 28 18:00 Makefile
drwxrwxr-x 2 user user 4.0K Feb 28 18:00 mincrypt
-rwxrwxr-x 1 user user 789K Mar 3 11:15 mkbootimg
-rw-rw-r-- 1 user user 7.4K Feb 28 18:00 mkbootimg.c
-rw-rw-r-- 1 user user 8.5K Mar 3 11:15 mkbootimg.o
-rw-rw-r-- 1 user user 1.1K Feb 28 18:00 README
-rwxrwxr-x 1 user user 789K Mar 3 11:15 unpackbootimg
-rw-rw-r-- 1 user user 3.9K Feb 28 18:00 unpackbootimg.c
-rw-rw-r-- 1 user user 6.6K Mar 3 11:15 unpackbootimg.o
NOTE: This is for the Samsung Galaxy Nexus (Maguro & Tuna, possibly Toro & Toroplus)
A simple hexdump (using "hex dump -n 40") of the boot image from the GNex phone should give us the results of:
Code:
0000000 41 4e 44 52 4f 49 44 21 68 54 3f 00 00 80 00 80
0000010 4d 5c 05 00 00 00 00 81 00 00 00 00 00 00 f0 80
0000020 00 01 00 80 00 08 00 00
0000028
Results may vary between Android versions. These numbers will help us in verifying that your kernel that you're creating is indeed correct.
What is needed to be taken away from this is the so called "Android Magic" which are the first four bytes of data in the hex dump.
Code:
Android Magic = 4e41 5244 494f 2144
The next two bytes are the kernel size, in this case (0x5468 0x003f).
The rest of the byes are as follows:
Code:
Kernel Base = 8000 8000
Ramdisk Address = 8100 0000
Secondary Address = 80f0 0000
Tags Address = 8000 0100
These values are what I had to change in the mkbootimg application in the unpack-mkbootimg-master. Otherwise the kernel images would be off and they would not load correctly on the device. Look at https://github.com/ClimberTy/unpack-mkbootimg/blob/master/mkbootimg.c for more details.
Splitting the Ramdisk
For organizations sake move the boot-* files to a new folder. From here we need to open the boot-ramdisk.gz.
Code:
$ mkdir UnpackedKernel
$ mv boot-* UnpackedKernel/
$ cd UnpackedKernel/
$ gunzip -c boot-ramdisk.gz | cpio -i
This splits open the boot-ramdisk.gz file so we can place our newly created kernel modules (anything listed as .KO) in their appropriate folders or make modifications to any of the other files in the UnpackedKernel/ folder.
Remember these, we'll need them later.
--Rebuilding the Kernel--
After making the modifications and placing the kernel modules in the UnpackedKernel/ folders . Again you may need to create the directories for these kernel module locations. See your compiled kernel printout for the correct paths. Now that everything is in place you need to rebuild the boot-ramdisk.gz:
Code:
$ pwd
[…]/UnpackedKernel/
$ find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
$ cd ..
Now copy in the /CompiledKernel/zImage into the /unpack-mkbootimg-master/ folder and run this command to build the kernel:
Code:
$ ./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz --base 80000000 --pagesize 2048 -o newKernel.img
Now to verify that the compiled kernel is right on par with the original kernel you need to do a hexdump.
Code:
$ hex dump -n 40 newKernel.img
Should print out results similar to this:
Code:
0000000 4e41 5244 494f 2144 cee4 0044 8000 8000
0000010 3e08 004b 0000 8100 0000 0000 0000 80f0
0000020 0100 8000 0800 0000
0000028
And as you can see all the addresses line up as they should, the only thing that should have changed is the kernel size which is expected.
--Test Flashing to the Device--
Move your newKernel.img image file into its own folder (e.g. ~/Documents/Kernel/NewKernel/) then put your device into the recovery mode to test and see if it boots, if it doesn't then "wash, rinse, and repeat".
To put your device into recovery mode, first power it off then power it back on and immediately hold down the POWER, VOLUME UP and VOLUME DOWN buttons. Select RECOVERY from the menu and press POWER to enter.
Code:
$ fastboot flash boot ~/Documents/Kernel/NewKernel/newKernel.img
$ fastboot reboot
Wait a few seconds till it boots up. If you don't receive any device response after a minute or so then put your phone back into recovery and flash the original kernel. If it works then, congratulations! If not try, try rebuilding it again and verifying you have the correct addresses or all the kernel modules installed properly.
Could not be explained better .... thanks a lot ... have included the link to your guide into my thread. :good:
Amazing job dude! Thanks for the TUT. Maybe one time in my free life time... I will try something :good:
Seems very good (because Anarkia sad it :victory: ) ... but my english is bad ...
COULD YOU translate it in german language, please ?
JOOOOKE :laugh:
Thank you for you work :good: :highfive:
Thanks for this great tutorial... Just opening a thread with all that useful info and such excellently organized need a lot of time...
Sent from my Galaxy Nexus using Tapatalk 2
salahmed said:
Thanks for this great tutorial... Just opening a thread with all that useful info and such excellently organized need a lot of time...
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Thanks I just got tired of trying to outsource my info through so many different sites, not to mention the conflicting or out of date information.
bvt-1 said:
JOOOOKE :laugh:
Click to expand...
Click to collapse
Good show ol' chap!
anarkia1976 said:
Could not be explained better .... thanks a lot ... have included the link to your guide into my thread. :good:
Click to expand...
Click to collapse
Thanks, I appreciate the work you guys are doing as well. Maybe one day I'll step up and do some ROM development and write a better tutorial about that as well. But for now I am happy just doing the kernel work.
Great guide , all the info I need in one thread , I got this one tagged
Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
Climber Ty said:
Thanks, I appreciate the work you guys are doing as well. Maybe one day I'll step up and do some ROM development and write a better tutorial about that as well. But for now I am happy just doing the kernel work.
Click to expand...
Click to collapse
I think a tutorial for create a modded ROM step by step will be a great job for xda community. :thumbup:
Sent from my Galaxy Nexus using xda app-developers app
I always get the same error, no matter which toolchain I try
Any suggestions?
See screenshot..
t0wlie said:
I always get the same error, no matter which toolchain I try
Any suggestions?
See screenshot..
Click to expand...
Click to collapse
Your path is wrong.
Wrote "export" on terminal and verify.
Copy complete link from export and do:
ll <complite link>
If there is an error your path is wrong.
[email protected]:~/Dokumente/Kernel/maguro/omap$ make
make: /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Kommando nicht gefunden
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: »include/generated/mach-types.h« ist bereits aktualisiert.
CC kernel/bounds.s
/bin/sh: 1: /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
make[1]: *** [kernel/bounds.s] Fehler 127
make: *** [prepare0] Fehler 2
[email protected]:~/Dokumente/Kernel/maguro/omap$ ll /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-rwxr-xr-x 1 marc marc 323104 Dez 4 10:58 /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc*
[email protected]:~/Dokumente/Kernel/maguro/omap$
t0wlie said:
I always get the same error, no matter which toolchain I try
Any suggestions?
See screenshot..
Click to expand...
Click to collapse
t0wlie said:
[email protected]:~/Dokumente/Kernel/maguro/omap$ make
make: /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Kommando nicht gefunden
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: »include/generated/mach-types.h« ist bereits aktualisiert.
CC kernel/bounds.s
/bin/sh: 1: /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
make[1]: *** [kernel/bounds.s] Fehler 127
make: *** [prepare0] Fehler 2
[email protected]:~/Dokumente/Kernel/maguro/omap$ ll /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-rwxr-xr-x 1 marc marc 323104 Dez 4 10:58 /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc*
[email protected]:~/Dokumente/Kernel/maguro/omap$
Click to expand...
Click to collapse
Can you post export command please.
You can try to modify:
/arm-linux-androideabi-gcc
to
/arm-linux-androideabi-
I tried (on antoher user)
export PATH=/home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin:$PATH
export CROSS_COMPILE=/home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-
make: /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Kommando nicht gefunden
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: »include/generated/mach-types.h« ist bereits aktualisiert.
CC kernel/bounds.s
/bin/sh: 1: /home/marc/Dokumente/Kernel/maguro/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
make[1]: *** [kernel/bounds.s] Fehler 127
make: *** [prepare0] Fehler 2
Try using the CodeSourcery ARM Compilers instead of the prebuilts (http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/). The version you want are the EABI release under the ARM Processors section. These compilers haven't failed me once since I've used them. Let me know if that works for you.
Thank you so much for this guide! I've been compiling my own ROM for a while now, and I feel like taking another step in development, by building my own kernel. I'm running into the following make error(s) though. I'm completely new to kernel development, so I figured I'd fire out my questions here, and hope that you guys can help me out. Below is my entire build environment (as far as I could get) - from the 'mkdir' commands to the *make* errors I'm experiencing... As you'll see, I haven't gotten very far, so I'm clearly doing something wrong at an elementary level. Any help would be appreciated. :good:
Code:
[email protected]:~$ mkdir Blowfish
[email protected]:~$ cd Blowfish
[email protected]:~/Blowfish$ mkdir kernel
[email protected]:~/Blowfish$ cd kernel
[email protected]:~/Blowfish/kernel$ mkdir source
[email protected]:~/Blowfish/kernel$ cd kerne
bash: cd: kerne: No such file or directory
[email protected]:~/Blowfish/kernel$ cd kernel
bash: cd: kernel: No such file or directory
[email protected]:~/Blowfish/kernel$ git clone https://android.googlesource.com/kernel/omap.git
Cloning into 'omap'...
remote: Sending approximately 439.05 MiB ...
remote: Counting objects: 64780, done
remote: Finding sources: 100% (18264/18264)
remote: Getting sizes: 100% (2126/2126)
remote: Compressing objects: 99% (26370/26371)
remote: Total 2138198 (delta 1785247), reused 2137592 (delta 1785041)
Receiving objects: 100% (2138198/2138198), 446.32 MiB | 340 KiB/s, done.
Resolving deltas: 100% (1786095/1786095), done.
[email protected]:~/Blowfish/kernel$ cd omap
[email protected]:~/Blowfish/kernel/omap$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/android-omap-3.0
remotes/origin/android-omap-panda-3.0
remotes/origin/android-omap-steelhead-3.0-ics-aah
remotes/origin/android-omap-tuna-3.0
remotes/origin/android-omap-tuna-3.0-ics-mr1
remotes/origin/android-omap-tuna-3.0-jb-mr0
remotes/origin/android-omap-tuna-3.0-jb-mr1
remotes/origin/android-omap-tuna-3.0-jb-mr1.1
remotes/origin/android-omap-tuna-3.0-jb-pre1
remotes/origin/android-omap-tuna-3.0-mr0
remotes/origin/android-omap-tuna-3.0-mr0.1
remotes/origin/glass-omap-xrr02
remotes/origin/glass-omap-xrr35
remotes/origin/glass-omap-xrr64b
remotes/origin/linux-omap-3.0
remotes/origin/master
remotes/origin/sph-l700-fh05
[email protected]:~/Blowfish/kernel/omap$ git checkout remotes/origin/android-omap-tuna-3.0-jb-pre1
Checking out files: 100% (37659/37659), done.
Note: checking out 'remotes/origin/android-omap-tuna-3.0-jb-pre1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at e8de0e2... video: sii9234: dynamically register and unregister input device
[email protected]:~/Blowfish/kernel/omap$ export ARCH=arm
[email protected]:~/Blowfish/kernel/omap$ export SUBARCH=arm
[email protected]:~/Blowfish/kernel/omap$ export CROSS_COMPILE='/home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi.bin'
[email protected]:~/Blowfish/kernel/omap$ make tuna_deconfig
HOSTCC scripts/basic/fixdep
make[1]: *** No rule to make target `tuna_deconfig'. Stop.
make: *** [tuna_deconfig] Error 2
[email protected]:~/Blowfish/kernel/omap$ make
make: /home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi.bingcc: Command not found
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
[email protected]:~/Blowfish/kernel/omap$
jjhiza said:
Code:
[email protected]:~/Blowfish/kernel/omap$ git checkout remotes/origin/android-omap-tuna-3.0-jb-pre1
Checking out files: 100% (37659/37659), done.
Note: checking out 'remotes/origin/android-omap-tuna-3.0-jb-pre1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at e8de0e2... video: sii9234: dynamically register and unregister input device
[email protected]:~/Blowfish/kernel/omap$ export ARCH=arm
[email protected]:~/Blowfish/kernel/omap$ export SUBARCH=arm
[email protected]:~/Blowfish/kernel/omap$ export CROSS_COMPILE='/home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi.bin'
[email protected]:~/Blowfish/kernel/omap$ make tuna_deconfig
HOSTCC scripts/basic/fixdep
make[1]: *** No rule to make target `tuna_deconfig'. Stop.
make: *** [tuna_deconfig] Error 2
[email protected]:~/Blowfish/kernel/omap$ make
make: /home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi.bingcc: Command not found
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
[email protected]:~/Blowfish/kernel/omap$
Click to expand...
Click to collapse
I have run into this issue before, and I believe what I did to solve this was delete all the files in the build directory and re-git them from a specific branch. For example building ICS I used:
Code:
$ git branch -a
$ git checkout remotes/origin/android-omap-tuna-3.0-ics-mr1
Try it and see if that works for your JB files. I think for you it's:
Code:
$ git checkout remotes/origin/android-omap-tuna-3.0-jb-mr1.1
jjhiza said:
Thank you so much for this guide! I've been compiling my own ROM for a while now, and I feel like taking another step in development, by building my own kernel. I'm running into the following make error(s) though. I'm completely new to kernel development, so I figured I'd fire out my questions here, and hope that you guys can help me out. Below is my entire build environment (as far as I could get) - from the 'mkdir' commands to the *make* errors I'm experiencing... As you'll see, I haven't gotten very far, so I'm clearly doing something wrong at an elementary level. Any help would be appreciated. :good:
Code:
[email protected]:~$ mkdir Blowfish
[email protected]:~$ cd Blowfish
[email protected]:~/Blowfish$ mkdir kernel
[email protected]:~/Blowfish$ cd kernel
[email protected]:~/Blowfish/kernel$ mkdir source
[email protected]:~/Blowfish/kernel$ cd kerne
bash: cd: kerne: No such file or directory
[email protected]:~/Blowfish/kernel$ cd kernel
bash: cd: kernel: No such file or directory
[email protected]:~/Blowfish/kernel$ git clone https://android.googlesource.com/kernel/omap.git
Cloning into 'omap'...
remote: Sending approximately 439.05 MiB ...
remote: Counting objects: 64780, done
remote: Finding sources: 100% (18264/18264)
remote: Getting sizes: 100% (2126/2126)
remote: Compressing objects: 99% (26370/26371)
remote: Total 2138198 (delta 1785247), reused 2137592 (delta 1785041)
Receiving objects: 100% (2138198/2138198), 446.32 MiB | 340 KiB/s, done.
Resolving deltas: 100% (1786095/1786095), done.
[email protected]:~/Blowfish/kernel$ cd omap
[email protected]:~/Blowfish/kernel/omap$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/android-omap-3.0
remotes/origin/android-omap-panda-3.0
remotes/origin/android-omap-steelhead-3.0-ics-aah
remotes/origin/android-omap-tuna-3.0
remotes/origin/android-omap-tuna-3.0-ics-mr1
remotes/origin/android-omap-tuna-3.0-jb-mr0
remotes/origin/android-omap-tuna-3.0-jb-mr1
remotes/origin/android-omap-tuna-3.0-jb-mr1.1
remotes/origin/android-omap-tuna-3.0-jb-pre1
remotes/origin/android-omap-tuna-3.0-mr0
remotes/origin/android-omap-tuna-3.0-mr0.1
remotes/origin/glass-omap-xrr02
remotes/origin/glass-omap-xrr35
remotes/origin/glass-omap-xrr64b
remotes/origin/linux-omap-3.0
remotes/origin/master
remotes/origin/sph-l700-fh05
[email protected]:~/Blowfish/kernel/omap$ git checkout remotes/origin/android-omap-tuna-3.0-jb-pre1
Checking out files: 100% (37659/37659), done.
Note: checking out 'remotes/origin/android-omap-tuna-3.0-jb-pre1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at e8de0e2... video: sii9234: dynamically register and unregister input device
[email protected]:~/Blowfish/kernel/omap$ export ARCH=arm
[email protected]:~/Blowfish/kernel/omap$ export SUBARCH=arm
[email protected]:~/Blowfish/kernel/omap$ export CROSS_COMPILE='/home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi.bin'
[email protected]:~/Blowfish/kernel/omap$ make tuna_deconfig
HOSTCC scripts/basic/fixdep
make[1]: *** No rule to make target `tuna_deconfig'. Stop.
make: *** [tuna_deconfig] Error 2
[email protected]:~/Blowfish/kernel/omap$ make
make: /home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi.bingcc: Command not found
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
[email protected]:~/Blowfish/kernel/omap$
Click to expand...
Click to collapse
If you haven't had luck figuring out the problem , you need to add a hyphen at the end of your toolchain , so it would be
" export CROSS_COMPILE=~/home/jjhiza/Blowfish/arm-2013.05-23-arm-none-eabi- "
that just tells it to use all the binary files that start with eabi-
Sent from my Galaxy Nexus using Tapatalk
Climber Ty said:
I know a lot of this has been posted before in other locations, but recently I have found some of that data to be incomplete when I was building a custom kernel for my GNex, so just bear with me.
Click to expand...
Click to collapse
Dude, this tutorial is f'king amazing.
For some odd reason, my kernel will boot and run just fine temporarily using the "fastboot boot" command, but I get write errors when trying to "fastboot flash" it, and flashing the new kernel fails. I've tried in xubuntu 12.04 x86, Windows 7 x64 using command line and Windows x64 using Wug's Nexus toolkit.
Any ideas?
I tried repacking the ROM that I'm using (Shiny 4.3 10/11/13 build) with my kernel and reflashing it, but no joy. I'm sure there's more to making kernel into a flashable .zip than I realize...
Hi people,
I would like to collect some dev info for the M2 which may help in future development efforts - maybe tweak the official ROMs to be less idiotic, or develop new ROMs, apps, etc.
If any of you can contribute info similar to what I have shown below, it would be greatly appreciated. I will collate and analyze the info from your replies and add it to these first couple of posts so that it serves as the main repo of this dev info.
*** DISCLAIMER *** Please do not attempt to collect any info from your device if you are not confident about or familiar with how to root your device or how to use shell commands in a root terminal shell. Any and all damage you may cause to your device in the pursuit of gathering this information is solely your responsibility and I will be neither responsible nor accountable for any such damage.
Still reading? Good. I commend your enthusiasm :good:
Guide: Block Device/Partition Information
Introduction
Here are some links explaining what Android partitions are and what they do. While some of the info in the links refers to other devices or has been superseded by changes to Android since the article was written, the basic information itself holds good:
http://www.all-things-android.com/content/review-android-partition-layout
http://donandroid.com/android-partitions-sdcard-boot-recovery-cache-data-system-misc-1043
https://sites.google.com/site/tomsgt123/adb-fastboot/understanding-android
This information is important because:
It will help us to map the contents of the official UPDATE.APP to the proper locations on the ROM Storage where they must be flashed.
It will help the developers of the Huawei Update Extractor tool to create an extractor profile specific for our M2 8.0 or 10.0 devices.
EDIT: I have actually already done this for the M2-802L, see my post on the Huawei Update extractor tool thread. Now we just need to wait for worstenbrood to integrate it into a new release of the Extractor.
It will help in the development of new ROMs.
How to get the partition info on your device
Prerequisites:
Your device needs to be rooted.
You need to be able to get a root shell terminal on your phone, either using adb or using a terminal emulator app like "Termux" or "Terminal Emulator for Android". If you're going to be using a Terminal Emulator app on your phone, you'll find that the Hacker's Keyboard app will make your life much much easier when dealing with shells on the phone (ever tried to type any control character sequence at all, like CTRL+C, using all those cute fancy soft keyboards on the play store?)
You need to know how to use a terminal emulator and be comfortable with using shell commands (see Disclaimer above).
Method
Using ADB to get a root shell on your phone:
Ensure that you have the drivers for the phone installed on the computer. If not,
For Windows: just install the HiSuite app from Huawei to get the drivers. You can uninstall HiSuite immediately after it's installed (it's a useless piece of dreck, only useful for the drivers it installs) but the drivers will remain installed.
For Linux: The Android SDK for Linux should give you the generic ADB drivers. Then see this webpage for setting a proper USB device ID for Huawei devices in case you have issues. I have not yet tested this for myself, BTW.
Ensure that you have adb on your computer. If not,
For Windows: you can grab it from the Unlock guide thread.
For Linux: The Android SDK for Linux should have given you this already. If not, something is very very wrong with your universe.
Ensure that your phone is rooted. Follow the above-linked guide if you need to only if you are confident about being able to perform what's required and don't mind voiding your warranty and risking permanent damage to your phone and sanity. If your phone is not rooted, this is not going to work.
Connect your phone to the computer via USB.
Open up a command prompt. On Windows, this involves typing "cmd" in the search bar. On Linux, fire up the terminal app of your choice. I recommend gnome-terminal. Then navigate to the directory where the adb executable is located.
Check whether your device is recognized by adb. Type the following command:
Code:
adb devices
Your output should look something like this (the device ID in the output below will be particular to your phone):
Code:
List of devices attached
AAA0A1234567890 device
If your output doesn't look like the above, you may have a problem with the setup, and subsequent steps may not work. But we'll see.
Obtain a shell into your phone from adb:
Code:
adb shell
This should return a prompt into a shell on your phone which looks something like this:
Code:
[email protected]:/ $
Now convert that plain old shell into a root shell (you are rooted by now, aren't you?):
Code:
su
You should now be in a root shell, as evidenced by the following output (notice that the $ in the previous output changed to #):
Code:
[email protected]:/ #
Using a Terminal Emulator app on the phone to get a root shell:
Fire up the terminal emulator app on your phone (see the "Prerequisites" section above for a couple of suggestions on good terminal emulators I've personally used).
Type the following to get into a root shell in the terminal:
Code:
su
You should now be in a root shell, as evidenced by your prompt changing from $ to #.
Now we actually get to business! If you successfully got a root shell, it's time to issue the command to get the device partitions and their mappings! Type the following command exactly as shown (the cleverer folk can simple copy-paste it):
Code:
ls -l /dev/block/platform/hi_mci.0/by-name | tr -s ' ' | cut -d' ' -f6-8 > /storage/sdcard0/mypartitions.txt
The above command should put a list of partitions and their mappings into a text file called mypartitions.txt on the root directory of your phone's internal SD card mountpoint (if you want it put on your external SD card mountpoint, replace /storage/sdcard0/mypartitions.txt in the command with this: /storage/sdcard1/mypartitions.txt and you should find it placed accordingly).
The file mypartitions.txt can now be transferred from your phone to your computer via USB (or you can open it directly on your phone using a text editor) and add the info to a reply here.
Good luck!
Information on individual devices
Block Device/Partition Information for individual devices
Mediapad M2 8.0 (M2-802L)
Block Device/Partitions
Code:
vrl -> /dev/block/mmcblk0p1
vrl_backup -> /dev/block/mmcblk0p2
mcuimage -> /dev/block/mmcblk0p3
reserved0 -> /dev/block/mmcblk0p4
fastboot -> /dev/block/mmcblk0p5
modemnvm_factory -> /dev/block/mmcblk0p6
nvme -> /dev/block/mmcblk0p7
oeminfo -> /dev/block/mmcblk0p8
splash -> /dev/block/mmcblk0p9
modemnvm_backup -> /dev/block/mmcblk0p10
modemnvm_img -> /dev/block/mmcblk0p11
modemnvm_system -> /dev/block/mmcblk0p12
securetystorage -> /dev/block/mmcblk0p13
3rdmodemnvm -> /dev/block/mmcblk0p14
3rdmodemnvmback -> /dev/block/mmcblk0p15
reserved1 -> /dev/block/mmcblk0p16
modem_om -> /dev/block/mmcblk0p17
splash2 -> /dev/block/mmcblk0p18
misc -> /dev/block/mmcblk0p19
modemnvm_update -> /dev/block/mmcblk0p20
recovery2 -> /dev/block/mmcblk0p21
reserved2 -> /dev/block/mmcblk0p22
teeos -> /dev/block/mmcblk0p23
trustfirmware -> /dev/block/mmcblk0p24
sensorhub -> /dev/block/mmcblk0p25
hifi -> /dev/block/mmcblk0p26
boot -> /dev/block/mmcblk0p27
recovery -> /dev/block/mmcblk0p28
dtimage -> /dev/block/mmcblk0p29
modem -> /dev/block/mmcblk0p30
modem_dsp -> /dev/block/mmcblk0p31
dfx -> /dev/block/mmcblk0p32
3rdmodem -> /dev/block/mmcblk0p33
cache -> /dev/block/mmcblk0p34
hisitest0 -> /dev/block/mmcblk0p35
hisitest1 -> /dev/block/mmcblk0p36
hisitest2 -> /dev/block/mmcblk0p37
system -> /dev/block/mmcblk0p38
cust -> /dev/block/mmcblk0p39
userdata -> /dev/block/mmcblk0p40
CPU Info (gathered by CPU-Z)
Code:
CPUs : 8
SoCs : 1
CPU 0 : AArch64 Processor rev 3 (aarch64)
Name : HiSilicon Kirin 930
CPUs : 8
Core set 0 : ARM Cortex-A53
Core set 0 Nb Cores : 4
Core set 0 Max Clock : 2016 MHz
Core set 0 Impl.id : 0x41
Core set 0 Arch.id : 0x8
Core set 0 Var.id : 0
Core set 0 Part.id : 0xd03
Core set 0 Rev.id : 3
Core set 0 Revision : r0p3
Core set 1 : ARM Cortex-A53
Core set 1 NbCores : 4
Core set 1 Max Clock : 1516 MHz
Core set 1 Part.id : 0xd03
Arch : 4x ARM Cortex-A53 @2.02 GHz+4x ARM Cortex-A53 @1.52 GHz
Codename :
Process : 28 nm
GPU Vendor : ARM
GPU Renderer : Mali-T624
Model : HUAWEI M2-802L (M2)
Manufacturer : HUAWEI
Board : mozart
Hardware : hi3635
Android Ver. : 5.1.1
Kernel Arch. : armv7l
Battery capacity : 4650
--- CPUInfos ---
abi : armeabi-v7a
abi2 : armeabi
supported abis : [arm64-v8a, armeabi-v7a, armeabi]
supported 32-bit abis : [armeabi-v7a, armeabi]
supported 64-bit abis : [arm64-v8a]
Processor : AArch64 Processor rev 3 (aarch64)
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
processor : 6
processor : 7
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 3
Hardware : Hisilicon Kirin 930
--- Debug Infos ---
16=667000000
17=120000000
18=0
19=120000000 240000000 360000000 400000000 667000000 800000000
20=cluster0=42
21=cluster1=25
22=gpu=37
23=modem=44
24=ddr=82
25=system_h=34
26=system_l=15
27=flash_led=29
28=charger=34
29=pa_0=30
30=Battery=29000
56=cluster0=41
57=cluster1=25
58=gpu=37
59=modem=44
60=ddr=82
clock 0=1516800
clock2 0=151600
clock 1=1516800
clock2 1=151600
clock 2=1516800
clock2 2=151600
clock 3=1516800
clock2 3=151600
clock 4=2016000
clock2 4=201600
clock 5=2016000
clock2 5=201600
clock 6=2016000
clock2 6=201600
clock 7=2016000
clock2 7=201600
Reserved
Reserved
Reserved 2