KimToms

Kim Toms

Email: <Kim.Toms AT SPAMFREE Gmail DOT Com>

I'm a laptop user; currently using Sony Vaio VGN-SZ470N. I wanted a place to record my experience, hence here.

I started by installing 7.04 (feisty fawn), but I accidently enabled the NVIDIA restricted driver and couldn't figure out how to get it turned off. So, I re-installed, and thought I'd keep a log to help me remember what to do. According to some things I've read on the web, the kernel version in feisty (2.6.20) does not support several features of the VAIO laptop which are supported under 2.6.22. So, the first thing to do is build a new kernel. I started by attempting to duplicate the 2.6.20-generic kernel. From some pages on the Ubuntu Forums I found some instructions for kernel compilation. However, I think these are for an older version of the kernel, so here's what I did: (Please note, I started from an absolutely clean installation, although I'm using the restricted Intel(R) PRO/Wireless 3945 Network Connection Driver for Linux

1. Install needed packages

  • Create a terminal window - Applications -> Accessories -> Terminal

  • Switch your terminal window to a root shell:
    •     me@me-laptop:~$ sudo bash
          root@me-laptop:~#
  • Install packages needed
    •     root@me-laptop:~# apt-get update
          root@me-laptop:~# apt-get install build-essential kernel-package \
              gcc libncurses5 libncurses5-dev libqt3-mt-dev linux-source
  • Change directory and unpack source
    •     root@me-laptop:~# cd /usr/src
          root@me-laptop:/usr/src# tar xjvf linux-source-2.6.20.tar.bz2
  • Change PS1 so I don't have to type really long strings
    •     root@me-laptop:/usr/src# PS1="# "
  • Change directory to the source directory and copy config file
    •     # cd linux-source-2.6.20
          # cp ../linux-headers-2.6.20-15-generic/.config .
  • Configure kernel according to .config file
    •     # make oldconfig
  • Make a kernel. Since my laptop has two CPUs, I use -j3 to make sure they're both used. -j2 would allow some idle time. There's also plenty of memory, so the swap is never hit. This process takes a few minutes to complete.
    •     # make -j3
  • Install kernel and modules
    •     # make install
          # make modules_install
  • Prepare grub for new kernel; feel free to use something other than vi
    •     # cd /boot/grub
          # cp menu.lst menu.lst.save
          # vi menu.lst
          # diff -u menu.lst menu.lst.save
      My diff results
          --- menu.lst    2007-08-26 11:54:30.000000000 -0400
          +++ menu.lst.bak        2007-08-26 11:54:19.000000000 -0400
          @@ -123,6 +123,12 @@
       
           ## ## End Default Options ##
       
          +title          Experimental ubuntu
          +root           (hd0,2)
          +kernel         /boot/vmlinuz root=UUID=945dab8-99f2-4435-bc5b-97c0cb7672b9 ro quiet splash
          +initrd         /boot/initrd.img-2.6.20-15-generic
          +quiet
          +
           title          Ubuntu, kernel 2.6.20-15-generic
           root           (hd0,2)
           kernel         /boot/vmlinuz-2.6.20-15-generic root=UUID=a945dab8-99f2-4435-bc5b-97c0cb7672b9 ro quiet splash

Needless to say, the above procedure doesn't work, it hangs when booting. After removing the 2 'quiet' from the menu.lst file, and rebooting, it hangs right after saying 'waiting for root filesystem'. Looking around, I found little information in a few minutes, so I decided that maybe the ramdisk should be rebuilt, since I was using one from the older kernel. So, I searched around on how to do that. Turns out there is a command, mkinitramfs. There is a directory /etc/initramfs.conf which contains the configuration. When I performed the 'make modules_install' a new directory was created in /lib/modules; and this is the directory whose name must be specified on the mkinitramfs command line. So, after creating a new initrd, placing it into /boot, and modifying grub's menu.lst file (/boot/grub/menu.lst), I was able to boot into a new kernel.

Of course, now my wireless didn't work, because I had not installed the restricted modules for my new kernel. When I attempted to start the restricted modules manager, it said I needed to install the package linux-restricted-modules-2.6.20.3-ubuntu1, which of course does not exist (much later, the correct named turns out to be linux-restricted-modules-2.6.20). So, I'm off to find out how to get a restricted modules and/or rebuild them before I can go to the next step, which will be building a completely custom kernel (assuming I can figure this out).


Of course, the whole page above describes the wrong way to build a kernel - albeit able to produce a working one. Apparently there's a bunch of utilities from debian such as dpkg which are used to actually build the _packages_ which are then _installed_ in order to accomplish this.

After I finish building the kernel "The hard way", I'll try to figure out "The easy way", assuming I can decode the cryptic dpkg command(s)


The page https://wiki.ubuntu.com/KernelCustomBuild discusses how to build a custom kernel; and I'm following its instructions now to see if I can't make a new version of the kernel I'm already running. However, the build command (make-kpkg) doesn't seem to have a way to set the -j option to make, so there is no way to use all of my cpus. A minor annoyance.

I will also have to perform the steps described under the l-r-m if I can figure out how to get the source. (see note above about linux-restricted-modules-2.6.20)

Of course, building the restricted modules requires some qt3-development libraries, so I'm installing the 49 packages that are needed now.


CategoryHomepage

KimToms (last edited 2008-08-06 16:39:14 by localhost)