Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, May 5, 2015

Compiling/Installing Mainline Linux Kernel on Ubuntu



Canonical provides Ubuntu flavors of mainline kernel. However I wanted to install the latest kernel, straight from the Linus's git repo . :)

I used a virtual machine environment to compile and install the kernel. We can install the following
software packages using Ubuntu's package manager (apt).

- Qemu - virtualization platform
- Virt-manager - GUI for qemu

I used 14.04 Ubuntu distribution - downloaded it from the canonical site.
Create a new virtual machine and install Ubuntu, log in to the machine. From here on-wards, we are inside our VM.

Now we checkout the mainline kernel from Linus's github repo.

> git clone --depth 3 https://github.com/torvalds/linux.git

Here i have selected depth as 3 to avoid entire version history checkout. Go inside the linux source directory.

> cd linux

Lets first change the target name of our kernel by editing the Makefile, change the param to,

EXTRAVERSION = -test

Now we have to prepare the configuration of the target Linux kernel. Here we are configuring the set of modules that we want to package with our kernel. Manual config is a tedious task. We have two options,

1. Get the config of the current Ubuntu distribution and reuse it.
2. Get the list of loaded modules of the currently running system and use it as the config.


If you are following the first option, then copy the config-xxx file found under /boot directory of Ubuntu to our Linux source directory as .config

>cp /boot/config-3.13.0-40-generic .config
>make oldconfig

However this config has large number of modules, which don't get loaded at runtime at all. Hence we can create a much light weight system by creating a config out of our currently loaded modules in the system.
Hence I used,

>make localmodconfig

Since our mainline kernel is the bleeding edge, it will require some entirely new configs. The config program will prompt you for input, accept the default values. (just press and hold ENTER)

Now we have config suitable for our target environment. Lets compile the kernel source,

> make > /dev/null

Once the build is complete, our shiny new kernel image can be found at:

linux/arch/x86_64/boot/bzImage

Next step would be to install it. Before that we have to install the kernel modules we built along with our kernel.

>sudo make INSTALL_MOD_STRIP=1 modules_install

This will install the new modules under,  /lib/modules/4.1.0-test+

Now install the kernel,

>sudo make install


Create the initramfs file system for our new kernel, This is the ram file system that is get loaded before real file system setup.

>sudo update-initramfs -c -k 4.1.0-test+

Finally update the grub, so it can find our new kernel during the boot process.


>sudo update-grub

Now if you examine the /boot directory, you should see newly created files,

- vmlinuz-4.1.0-test+
- System.map-4.1.0-test+
- config-4.1.0-test+

Before restart, lets configure the GRUB menu, so that we can choose our kernel during the boot process. Edit, /etc/default/grub file and comment out the below lines. Otherwise, the grub would not display the splash screen and will go on to boot the latest kernel.


#GRUB_HIDDEN_TIMEOUT=0 
#GRUB_HIDDEN_TIMEOUT_QUIET=true

Restart the virtual machine.

During the boot process select, 'advanced options' from grub menu




And select the new kernel.




Once you are log in to the system, just double check using the shell command,

>uname -a 

We are done.! 

Monday, March 30, 2009

How to view sites with IE from your Linux box.


I'm used to read weekend newspapers published here in,Sri Lanka. we can read most of them online. But the problem comes with some local news papers which is published using in native language(Sinhala). One such news paper is RIVIRA, which I love to read.But it only renders in IE, since it uses IE specific fonts. I was searching for a online IE rendering tool and found it. :D
It 's called the NETRENDERER and it renders the the webpage as it is seen in IE as a image.you can visit it here .
But it didn't solve my issue. :( . It only renders the page until the end of the current window. so if the rendering page is bit longer you won't be able to see the full page.Of course you cant click links in the rendered page since its a image.
Even thogh with this drawback , this site comes handy to web developers who want to cross-check for the browser compatibility of hteir site.
But for me this is not going to work. I have to look for some other ways to get around this.May be IE4Linux.

Saturday, November 29, 2008

OpenOffice cannot find the jre

I'm working on a ubuntu 8.10 machine(intrepid ibex). recently when i started openoffice writer it gave me a error saying that it cannot find the jre. But yet i have installed jdk 1.6 and it is working properly with my intellijIDEA & other applications.
You can add new jre to OOffice by tools-->options-->jre add button. when i gave my jre path to the application by add button it gave me a error saying no jre exists in that folder.
After a bit of google searching i managed get around it.
it seems that "openoffice.org-java-common" package is missing. So I installed it..

sudo apt-get install openoffice.org-java-common
it installs openjdk libs & jre . Then I restarted the OpenOffice writer & went to the jre option menu

tools-->options-->jre

There it is :D. the Writer has identified our newly installed jre. It seems that writer is unable to recognize Sun ' s jre. But there is a way to get sun's jre work on openoffice as well.
The links below may help you to find what are they. But the installing openjdk solved my problem....... :D

http://ubuntuforums.org/showthread.php?t=862054
https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/193139