FloRider
Senior Member
- Dec 2, 2012
- 358
- 111
In this post I'll walk you through the complex task of compiling and deploying a kernel to your tablet. At this time, we only have kernel source for 4.0.4, so our efforts will only be successful on a tablet running 4.0.4 ROM. The process will be the same for Jelly Bean once we get that source, though. At this time you'll have to be running 4.0.4, stock or MCL. You'll need root access as well.
The packages we'll install should cover Ubuntu 10.04-12.04, both 32- and 64-bit. Therefore, you'll end up installing more than you need, but that won't hurt. On the other hand, if you're running a different distro, you may have to search the web to find the necessary packages to compile a kernel. Finally, almost everything we're doing has to be done in Linux, but I run Linux in a virtual machine on Windows. So, for steps 1 and 6, I won't have Linux-specific instructions. Let's divide and conquer the task before us though. There can be many hurdles to reaching our goal, so I'll try to split it into bite-sized pieces:
1 -- I won't elaborate on this one. If you're considering building and flashing a kernel, hopefully you've done this. If not, there are other posts that detail this process. I did say "walk you through", not "push the baby stroller" .
2 -- First, lets get the kernel source:
http://download.lenovo.com/consumer/open_source_code/a2109n_gpl_kernel_570.tar.bz2
Drop this somewhere on your system (e.g. /Downloads). Now, if you don't have a 4.0.4 ROM zip file, download one. MCL0103 is good choice. Extract boot.img from this file with your favorite zip tool. Next, we'll download the toolchain. We can't compile the kernel without it. It's just an 80MB download. You can get it here:
http://uniteddev.com/wordpress/files/tools/arm-eabi-4.4.3.zip
Finally, let's get the config file. We've got to connect to the tablet for this file. Copy config.gz from the /proc directory on the root of your tablet to somewhere safe on your system. Make sure you can see system files. Extract config from the gzip. Rename it to .config. Dot-something files are hidden unless you can see system files.
3 -- Open a terminal window and type
This should be more than enough for your particular installation (assuming you are on Ubuntu). If you get compiler errors, I know a few more you can install that I didn't think were necessary.
4 -- Now you need to decide the paths for the toolchain and the source code. That's up to you, but I'll use mine in the directions, so unless you already have a source tree, it'll be easier to use the same structure as mine. Also, the permissions from your /home directory will make things easier. From /home, create a directory named Development. From /Development, create a directory named kernels. Copy the kernel source bzip to /kernels and extract it in that directory. Next, find your .config file and copy it to your source root directory (/A2109N_GPL_kernel_570). Finally, let's take care of the toolchain. Copy arm-eabi-4.4.3.zip to /Development and extract it there.
5 -- Everything should be set to go. I'll talk about build options later, but let's do this the easy way. Open a terminal in /A2109N_GPL_kernel_570 and type
The number after j should be the number of cores on your machine + 1. If everything worked, your kernel will appear in /arch/arm/boot as zImage.
6 -- Now, find the boot.img file from your ROM. Make sure it's not in the same directory as your zImage and type
Delete bootimg.cfg and put zImage in a safe place. Rename it MCL_zImage so we know where it came from. Here comes the moment of truth. Boot your tablet into bootloader and type
Cross your fingers and wait for your system to boot. We've flashed over your kernel, so... don't worry . That's why we kept MCL_zImage. If it doesn't boot, repeat the above steps (flashboot steps), using MCL_zImage. That'll rescue your system.
If you're going to compile again, even if it wasnt successful, you'll have to clean up your source directory. That's easy. Go to your source root and type
Then copy .config to the root again and go ahead with step 5.
That's the process. I'll add more info later. If everything worked, give yourself a pat on the back. If not, double-check your steps... then let me know.
Thanks to anika200 and gmarkall for their valuable input.
The packages we'll install should cover Ubuntu 10.04-12.04, both 32- and 64-bit. Therefore, you'll end up installing more than you need, but that won't hurt. On the other hand, if you're running a different distro, you may have to search the web to find the necessary packages to compile a kernel. Finally, almost everything we're doing has to be done in Linux, but I run Linux in a virtual machine on Windows. So, for steps 1 and 6, I won't have Linux-specific instructions. Let's divide and conquer the task before us though. There can be many hurdles to reaching our goal, so I'll try to split it into bite-sized pieces:
- Install the Lenovo tools and IdeaTab drivers.
- Collect the files you'll need to build and deploy your kernel.
- Configure your build environment -- installing the necessary files and packages.
- Extract the source and prepare the build configuration.
- Build your kernel.
- Deploy and test your product.
1 -- I won't elaborate on this one. If you're considering building and flashing a kernel, hopefully you've done this. If not, there are other posts that detail this process. I did say "walk you through", not "push the baby stroller" .
2 -- First, lets get the kernel source:
http://download.lenovo.com/consumer/open_source_code/a2109n_gpl_kernel_570.tar.bz2
Drop this somewhere on your system (e.g. /Downloads). Now, if you don't have a 4.0.4 ROM zip file, download one. MCL0103 is good choice. Extract boot.img from this file with your favorite zip tool. Next, we'll download the toolchain. We can't compile the kernel without it. It's just an 80MB download. You can get it here:
http://uniteddev.com/wordpress/files/tools/arm-eabi-4.4.3.zip
Finally, let's get the config file. We've got to connect to the tablet for this file. Copy config.gz from the /proc directory on the root of your tablet to somewhere safe on your system. Make sure you can see system files. Extract config from the gzip. Rename it to .config. Dot-something files are hidden unless you can see system files.
3 -- Open a terminal window and type
Code:
sudo apt-get install git-core libncurses5-dev lib32stdc++6 ia32-libs lib32ncurses5-dev lib32z1-dev zlib1g-dev build-essential automake binutils libc6-dev flex bison curl abootimg
4 -- Now you need to decide the paths for the toolchain and the source code. That's up to you, but I'll use mine in the directions, so unless you already have a source tree, it'll be easier to use the same structure as mine. Also, the permissions from your /home directory will make things easier. From /home, create a directory named Development. From /Development, create a directory named kernels. Copy the kernel source bzip to /kernels and extract it in that directory. Next, find your .config file and copy it to your source root directory (/A2109N_GPL_kernel_570). Finally, let's take care of the toolchain. Copy arm-eabi-4.4.3.zip to /Development and extract it there.
5 -- Everything should be set to go. I'll talk about build options later, but let's do this the easy way. Open a terminal in /A2109N_GPL_kernel_570 and type
Code:
export ARCH=arm
export CROSS_COMPILE=/home/(your username)/Development/arm-eabi-4.4.3/bin/arm-eabi-
make oldconfig
make -j5
6 -- Now, find the boot.img file from your ROM. Make sure it's not in the same directory as your zImage and type
Code:
abootimg -x boot.img
Code:
fastboot flash:raw boot zImage initrd.img
fastboot reboot
If you're going to compile again, even if it wasnt successful, you'll have to clean up your source directory. That's easy. Go to your source root and type
Code:
make distclean
That's the process. I'll add more info later. If everything worked, give yourself a pat on the back. If not, double-check your steps... then let me know.
Thanks to anika200 and gmarkall for their valuable input.
Last edited: