The person who wrote that blog is a bit of a twit. You do not need anything other than the cross-compiler to build and install a kernel. Ignore anything that involves the separate "tools" directory.
i was able to complete the configuration setup and compilation
Good. Go into the arch/arm/boot
subdirectory. There should be a file there 2-4 MB in size called zImage
, presuming your configuration used gzip as the compression mode. If not (you can check this in menuconfig, it's General setup -> Kernel compression mode), it may be called bzImage
for bzip2; I'm not sure what it will be for the other modes.
Copy that onto the first (vfat) partition of the SD card. Rename it, e.g., test-kernel
. Now edit the config.txt
file in that partition and comment out the current kernel=
line and add a replacement:
#kernel=kernel.img
kernel=test-kernel
Now copy the modules and firmware over into the /lib
directory on the second (ext4) partition. First, I would back up the current firmware directory, since there's only one, and I have no idea how responsible Simon's choice of configuration was. From inside the lib directory:
tar -cjf firmware.tb2 firmware
This should leave a firmware.tb2
file behind. You can leave it there or store it somewhere else. If you need to restore things later you can use tar -xjf firmware.tb2
from inside the same directory.
Simon says to erase the current firmware and modules directory. NO. NO. NO. DO NOT. Just use the two cp -a
commands to copy stuff in. This will overwrite as necessary and leave whatever isn't being replaced.
You can now try to boot. If it doesn't work, you can edit config.txt
again and comment out your new line and uncomment the old one to return to the original kernel. In this case, if you want to try again, I would recommend starting with the config used for the original kernel, then add to that in menuconfig. You need to get that from a running pi; it will be /proc/config.gz
.1 It is not actually on the SD card so don't bother looking for it. You can put that file in the top level of the kernel source and:
gunzip config.gz
mv config .config
This will replace the one that's there. Now fire up make menuconfig
, do whatever, and go through the build and install process again.
1. If you can't find it, try sudo modprobe configs
and look again.