After three days and tons of googleing, I've compiled, set up, and installed the kernel for Kindle. Directions as follows:
Part 1: Prerequisites
Part 2: Compiling the kernel
- Get a root shell of your Kindle. If you don’t know, Google “usbNetworking”
- A Linux computer for compiling code
- Amazon’s sources for your version of the Kindle: http://www.amazon.com/gp/help/custom...deId=200203720
- An ARM cross-compiler. You can compile Amazon’s code, or if you’re lazy, use CodeSourcery’s precompiled toolchain: http://www.codesourcery.com/sgpp/lite/arm
- The following packages, get them from your distro’s repo: libncurses-dev (for menuconfig), uboot-mkimage (for making the kernel image), and module-init-tools (depmod)
Part 3: Installing on Kindle
- Extract the source to anywhere. If you can’t decide, use “~/src/kernel/” and “cd” to the source files.
- Now, you need to configure for the Kindle, type “make mario_mx_defconfig“
- Edit the “.config” file and look for the line that starts with “CONFIG_INITRAMFS_SOURCE“. We don’t need that, delete that line or comment (#) it out.
- Here’s the part were you make all your modifications to the kernel. You might want to do “make menuconfig” and add extra drivers/modules. I’ll wait while you do that.
- Back? Let’s do the actual compiling. Type the following: “make ARCH=arm CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- uImage”. This will make the kernel image. I assume you installed CodeSourcery’s cross compiler to your home folder (default). If your cross compiler is elsewhere, change the command to match it.
- Compile the modules into a compressed TAR archive (for easy moving to the kindle): “make ARCH=arm CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- targz-pkg” (again, if your cross compiler is installed to a different location, change it).
- For some reason, depmod refuses to run with the compile script, so we’re going to do it manually. Do the following “depmod -ae -F System.map -b tar-install -r 184.108.40.206-lab126 -n > modules.dep” Change 220.127.116.11-lab126 to your compiled kernel version.
- Open modules.dep up with a text editor and do a search & replace. Replace all instances of “kernel/” with “/lib/modules/18.104.22.168-lab126/kernel/” (again, use your version string). I’m not sure this is needed, but better safe then brick.
- Now copy arch/arm/boot/uImage, linux-22.214.171.124-lab126.tar.gz (or whatever your version is), and modules.dep to an easy to access location.
- Connect the Kindle to your computer, and open up the storage device. Copy the three files you moved from the previous part to your Kindle via USB.
- This part is mostly commands, so get a root shell to your Kindle, and do the following commands line by line. Again, anywhere the version string “126.96.36.199-lab126” is used, change it to your kernel’s version. Explanation follows.
mv /mnt/us/linux-188.8.131.52-lab126.tar.gz /mnt/us/modules.dep /mnt/us/uImage /tmp
mv /lib/modules /lib/modules.old
cd /tmp & tar xvzf /tmp/linux-184.108.40.206-lab126.tar.gz
mv lib/modules /lib/
chmod 644 modules.dep
mv modules.dep /lib/modules/220.127.116.11-lab126/
shutdown -r now
Wow, that’s a lot of commands. What did that do? Well, line by line:
- Move the files we compiled to the temp folder. That way, we don’t have to clean up.
- Back up the old kernel modules
- Go to the temp folder and untar the modules
- Install the modules
- Correct the permissions for the modules.dep file (in case something happened after copying from your computer)
- Move the module dependencies list to it’s correct folder.
- Flash the kernel (I don’t know why it has to be flashed twice to two different partitions, but if you don’t, it won’t load, maybe sig checks?)
- Make sure everything is finished writing
Source: Myself (http://www.yifanlu.com/2010/07/26/ha...ng-the-kernel/
EDIT: Deleted question, inserted directions