Updating kernel of remote Ubuntu or Debian machine

I chose my devlopment environment Debian based as I am familiar with the kernel roll out infrastructure. I will update the kernel of a test machine which runs Ubuntu. I will compile the kernel on another deleopment machine.

This may not work for non-debian based Linux environment like redhat.

Step 1. Kernel sources: I have cloned a git for HID next and will be using it as an example. You can download any Linux kernel from kernel.org website. Unzip the kernel sources and change directory to the top most directory of kernel source.
So pwd and ls gives me the following result

prajosh@test-box:~/Project/hid_next/hid$ pwd
prajosh@test-box:~/Project/hid_next/hid$ ls
arch     Documentation  init     lib             net             security
block    drivers        ipc      MAINTAINERS     README          sound
COPYING  firmware       Kbuild   Makefile        REPORTING-BUGS  tools
CREDITS  fs             Kconfig  mm              samples         usr
crypto   include        kernel   Module.symvers  scripts         virt

Step 2. I will use the default i386 kernel configuration so run the command

$ make i386_defconfig

You can customise using the command make menuconfig

Step 3. To produce a .deb which can be used to install kernel in another machine run the following command. This is part of the Debian kernel make infrastructure for details refer the references section below

$ fakeroot make-kpkg kernel_image --initrd binary

This will take some time. Once the make is complete, please check the directory above Linux source directory and you will be able to see some .deb files.

prajosh@test-box:~/Project/hid_next/hid$ cd ..
prajosh@test-box:~/Project/hid_next$ ls

Step 4. Copy the linux image to the test machine

$ scp linux-image-3.11.0-rc4+_3.11.0-rc4+-10.00.Custom_i386.deb test@

where test and are user-name and IP of the test machine respectively

Step 5. Login to the test machine using SSH by using the command

$ ssh test@

and do the following commands to install the kernel

$ sudo dpkg –i linux-image-3.11.0-rc4+_3.11.0-rc4+-10.00.Custom_i386.deb

Once complete you can reboot your machine and you can see the new kernel version using the command

$ uname –a



One thought on “Updating kernel of remote Ubuntu or Debian machine

  1. Pingback: An easy kernel development environment | Prajosh Premdas

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s