Sunday, October 7, 2012

Using ketchup to manage kernel releases

We are going to use ketchup to download Linux kernel releases. Its a great tool written in python to automate a lot of stuff.

1. Install ketchup
$sudo apt-get install ketchup
$mkdir linux
$cd linux
2. Lets check the latest version of Linux kernel for the 3.x series
$ketchup -s 3
3.6
3. Lets download the 3.6 kernel release
$ketchup -r 3.6
.....
gpg: Signature made Monday 01 October 2012 05:25:16 AM IST using RSA key ID 00411886
gpg: Can't check signature: public key not found

ketchup: The GPG key seems not to be in the keyring. Please fix this and try again.
In the case potential malicious kernel code is not a problem,
you can skip the verifying by using --no-gpg.
ketchup: Tarball download failed
4. Oops ! You need to add the GPG key to your keyring for verification since each release is signed (Note that the RSA key ID 00411886 is mentioned in the message itself). Lets do that...
$gpg --recv-keys 00411886
gpg: requesting key 00411886 from hkp server keys.gnupg.net
gpg: key 00411886: public key "Linus Torvalds " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
6. This looks good. Lets try downloading again.
$ketchup -r 3.6
....
Downloading linux-3.6.tar.sign
--2012-10-07 17:47:06--  http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.tar.sign
....
Downloading linux-3.6.tar.xz
--2012-10-07 17:47:06--  http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.tar.xz
....
7. It will download, verify, extract the kernel sources and it will also rename the directory to "linux-3.6" to match the kernel version downloaded. Great !

8. Since our original "linux" folder has been renamed to "linux-3.6" we need to back down to parent folder and go back to the renamed "linux-3.6" folder
$cd ..
$cd linux-3.6
9. Now lets try something different. Lets download Linux kernel version 3.5
$ketchup -r 3.5
Note that it only downloads the patch file that it needs to apply/revert to 3.6 that is already downloaded to roll back to 3.5 ! Also it will rename the directory to "linux-3.5". Remember to repeat the above step 8 to go to the renamed "linux-3.5" folder.

1 comment: