Linux Kernel Customization on Acer Aspire One

Discussion in 'Linux' started by sideways, Aug 25, 2008.

  1. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    Custom Kernel on Acer Aspire One Linpus Lite
    =================================================

    NB: The compile process takes ~ half a gig of hard disk space

    Open a terminal (alt+f2, 'terminal')

    1.
    Backup your original kernel:
    Code:
    sudo cp /boot/bzImage /boot/bzImage.orig
    2.
    Install minimal development packages:
    Code:
    sudo yum install binutils gcc glibc-devel glibc-headers kernel-headers libgomp make patch ncurses-devel
    3.
    Download the kernel source from here:
    http://www.kernel.org/pub/linux/kernel/ ... .9.tar.bz2

    4.
    Prepare the kernel source tree:
    Code:
    cd /usr/src
    sudo tar xvf /home/user/Downloads/linux-2.6.23.9.tar.bz2
    sudo mv linux-2.6.23.9 linux-2.6.23.9lw
    cd linux-2.6.23.9lw
    5.
    Copy the current kernel config file:
    Code:
    sudo cp /boot/config_080627 .config
    sudo make oldconfig
    (optional) set a unique EXTRAVERSION in the Makefile (it will be set to .9) so module_install doesn't overwrite old modules (DON'T do this if you are just compiling a few missing modules for the default kernel)

    6.
    Set custom kernel/module options and compile:
    Code:
    sudo make menuconfig  (add any custom device drivers or kernel options here)
    time sudo make all
    This takes ~20mins.

    (If you just want to compile some kernel modules (and not install a whole new kernel) then use 'sudo make modules' it is a bit faster, and new modules (*.ko files) can be copied directly to the current kernel driver directory (then run 'sudo depmod'). This is how I created the custom dvb (digital video broadcast) modules for a Hauppauge adapter (In 'make menuconfig' I went to Device Drivers ---> Multimedia devices ---> DVB/ATSC adapters, and selected 'Support for various USB DVB devices' and the DiBcom devices as modules (M), the *.ko files end up in /usr/src/linux-2.6.23.9lw/drivers/media/dvb/dvb-usb/ and /usr/src/linux-2.6.23.9lw/drivers/media/dvb/frontends/))

    Then to install the new kernel:
    Code:
    sudo make install
    (ignore LILO error)

    and to install kernel modules (this is only necessary if you used a unique EXTRAVERSION or if you have added new modules)
    Code:
    sudo make modules_install
    Now edit /boot/grub/grub.conf, and add a stanza pointing to the new kernel /boot/vmlinuz, so it looks something like this:

    Code:
    default=0
    timeout=10
    color=green/black
    #splashimage=(hd0,0)/boot/grub/spash.xpm.gz
    #hiddenmenu
    
    title Custom Kernel
    	rootnoverify (hd0,0)
    	kernel /boot/vmlinuz ro root=LABEL=linpus vga=0x314 selinux=0 splash=silent loglevel=1 console=tty1 nolapic_time
            initrd /boot/initrd-splash.img
    
    (To boot the original kernel, edit the kernel line to point to /boot/bzImage.orig)

    (I couldn't get the grub menu to appear by increasing the timeout and removing 'hiddenmenu', anyone have a fix for that?)
    EDIT: grub problem FIXED see my post at the bottom of page 2 (grub must be updated)


    Now reboot and pray! :)
     
    sideways, Aug 25, 2008
    #1
  2. sideways

    shillson

    Joined:
    Aug 24, 2008
    Messages:
    5
    Likes Received:
    0
    >>> Now edit /boot/grub/grub.conf, and add a stanza pointing to the new kernel /boot/vmlinuz, so it looks something like this:

    Question: it's been a VERY long time since I've tinkered with Linux. Can't seem to actually edit/replace grub.conf. It opens "read-only". If I try to rename it, I get a permission denied error. If I try chmod, I get a permission denied error. I've tried both sudo and su (at least I think I have!).

    Any thoughts/suggestions?

    Thanks!
    -Steve
     
    shillson, Aug 25, 2008
    #2
  3. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    Try
    Code:
    sudo  mousepad /boot/grub/grub.conf
    if you are proficient with vi use
    Code:
    sudo vi /boot/grub/grub.conf
    make a backup of the old grub.conf in case you mess things up (You shouldn't try modding the kernel unless you are confident of what you're doing, make sure you have a working recovery usb stick in case things get really messed up)
     
    sideways, Aug 25, 2008
    #3
  4. sideways

    shillson

    Joined:
    Aug 24, 2008
    Messages:
    5
    Likes Received:
    0
    Thanks, sideways.

    I'm relatively proficient (or used to be). My problem is that I can't seem to write to, or overwrite the grub.conf file (using vi or mousepad). I left the one at work :-(, so it'll have to wait until tomorrow. I've probably just forgotten to use sudo (or su). Time for more coffee...

    -Steve
     
    shillson, Aug 25, 2008
    #4
  5. sideways

    shillson

    Joined:
    Aug 24, 2008
    Messages:
    5
    Likes Received:
    0
    Actually, I bought the one just so I can screw things up and not have to worry about screwing up my real work! :mrgreen:
     
    shillson, Aug 25, 2008
    #5
  6. sideways

    clairvaux

    Joined:
    Aug 18, 2008
    Messages:
    26
    Likes Received:
    0
    What does this custom kernel accomplish? For those of us who are newblets
     
    clairvaux, Aug 25, 2008
    #6
  7. sideways

    zhark

    Joined:
    Aug 20, 2008
    Messages:
    1
    Likes Received:
    0
    Is it possible to use the newest Linux kernel in Linpus as well?
     
    zhark, Aug 26, 2008
    #7
  8. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    Most importantly, It enables you to add missing device drivers (there are hundreds available in the 'make menuconfig' menu) - this is the main use for 'normal' users.

    There are several successful reports on this forum already, with stuff like modems, bluetooth, tv adapters etc

    It also allows you to test new kernels (you needn't use the 2.6.23 kernel source), and add advanced features like extra filesystem support (this would be more of interest to the hacker type)
     
    sideways, Aug 26, 2008
    #8
  9. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    Yup, though I haven't tried anything in the 2.6.27 branch yet. You'll probably see a few problems with devices like the webcam, maybe wifi, do report if you test such a kernel (You'll have to run make modules_install to install the modules compiled against the new kernel), they should automatically go in a new directory in /lib/modules.
     
    sideways, Aug 26, 2008
    #9
  10. sideways

    Los_Andros

    Joined:
    Aug 14, 2008
    Messages:
    2
    Likes Received:
    0
    I've installed a 2.6.27-3 Kernel and the uvcdriver (webcam) is supported out of the box.
    There the latest atheros drivers are included, so you could use them for wlan instead of the madwifi drivers (but then you have to live without the nice blinking leds, so I installed the madwifi drivers to get my leds working).

    I compiled my kernel from source, but it is difficult to select the kernel modules you really need, so if you don't know exactly what to do, you could also just install a pre-compiled 2.6.27 like offered in many distribution repositories. I use openSUSE 11.0 and there you can add e.g. this http://download.opensuse.org/repositori ... SUSE_11.0/ repository and install a 2.6.27 kernel.

    This works for me and my girl friends A150L.
     
    Los_Andros, Aug 27, 2008
    #10
  11. sideways

    katbert

    Joined:
    Sep 4, 2008
    Messages:
    11
    Likes Received:
    0
    Dear all,
    I encounter a problem. Would you please help me?
    The following error message appear:

    [user@localhost linux-2.6.23.9lw]$ make oldconfig
    HOSTCC scripts/basic/fixdep
    In file included from /usr/include/sys/socket.h:36,
    from /usr/include/netinet/in.h:25,
    from /usr/include/arpa/inet.h:23,
    from scripts/basic/fixdep.c:117:
    /usr/include/bits/socket.h:320:24: error: asm/socket.h: No such file or directory
    scripts/basic/fixdep.c:399: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied
    compilation terminated.
    make[1]: *** [scripts/basic/fixdep] Error 1
    make: *** [scripts_basic] Error 2
     
    katbert, Sep 5, 2008
    #11
  12. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    you didn't follow the instructions, it should be
    Code:
    sudo make oldconfig

    I would recommend having a bootable livecd linux distro on usb if you are playing around with the kernel, since you'll invariable get an unbootable machine, with the livecd you can just mount /dev/sda1 and copy the originall kernel back to /boot/bzimage, and restore the original /boot/grub/grub.conf
     
    sideways, Sep 5, 2008
    #12
  13. sideways

    katbert

    Joined:
    Sep 4, 2008
    Messages:
    11
    Likes Received:
    0
    Thanks. I am a newbie to the Linux.
    I ran the command again in root. The same error message came out. What's happening?

    [root@localhost linux-2.6.23.9lw]# make oldconfig
    HOSTCC scripts/basic/fixdep
    In file included from /usr/include/sys/socket.h:36,
    from /usr/include/netinet/in.h:25,
    from /usr/include/arpa/inet.h:23,
    from scripts/basic/fixdep.c:117:
    /usr/include/bits/socket.h:320:24: error: asm/socket.h: No such file or directory
    make[1]: *** [scripts/basic/fixdep] Error 1
    make: *** [scripts_basic] Error 2
     
    katbert, Sep 5, 2008
    #13
  14. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    you must be using an incompatible kernel, try another or just stick to the vanilla 2.6.23.9 one
     
    sideways, Sep 5, 2008
    #14
  15. sideways

    Bushmills

    Joined:
    Sep 5, 2008
    Messages:
    18
    Likes Received:
    0
    Location:
    Germany
    sideways, to see the grub boot menu, you may need to set text colours, like:
    color white/blue
    Otherwise grub shows the menu in black on black. It did so here, before I added a colour setting.
     
    Bushmills, Sep 5, 2008
    #15
  16. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    thanks, that does make a menu appear, but it seems to be disabled, you can't chose between multiple selections with the cursor keys (and you can't edit it by pressing 'e' or 'a', or go to a grub command prompt by pressing 'c')

    This is weird.
     
    sideways, Sep 5, 2008
    #16
  17. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    Horay, I fixed the grub problem by updating grub and reinstalling (thanks for the color hint)
    EDIT: This may cause shutdown problems, so if in doubt, use macles solution

    Code:
    sudo yum update grub
    sudo grub
    grub> root (hd0,0)
    grub> setup (hd0)
    grub> quit
    Then reboot.

    This makes kernel tinkering much safer since you can keep an entry in /boot/grub/grub.conf for the original kernel (/boot/bzImage), the build process outlined above creates a kernel called /boot/vmlinuz so it won't overwrite the original :)

    Here's my /boot/grub/grub.conf:

    Code:
    default=0
    timeout=10
    #splashimage=(hd0,0)/boot/grub/splash.xpm.gz
    color=green/black
    
    title Default Kernel Aspire One
            rootnoverify (hd0,0)
            kernel /boot/bzImage ro root=LABEL=linpus vga=0x314 selinux=0 splash=silent loglevel=1 nolapic_timer
            initrd /boot/initrd-splash.img
    
    title Custom Kernel Aspire One
            rootnoverify (hd0,0)
            kernel /boot/vmlinuz ro root=LABEL=linpus vga=0x314 selinux=0 splash=silent loglevel=1 nolapic_timer
            initrd /boot/initrd-splash.img
    
    Acer must have crippled the original grub, silly beggers!

    (NB: in normal fedora linux /etc/grub.conf is a symbolic link to /boot/grub/grub.conf, this is not the case with linpus lite on the Aspire One, so do not bother editing /etc/grub.conf, it is ignored by the boot process)
     
    sideways, Sep 5, 2008
    #17
  18. sideways

    macles

    Joined:
    Jul 22, 2008
    Messages:
    198
    Likes Received:
    0
    Press TAB and grub will appear. The hint is in the filename: grub-0.97-19.src.rpm_show_splash_by_tab_finally.
     
    macles, Sep 5, 2008
    #18
  19. sideways

    sideways

    Joined:
    Aug 21, 2008
    Messages:
    172
    Likes Received:
    0
    Didn't work for me, I had to update grub.
     
    sideways, Sep 5, 2008
    #19
  20. sideways

    macles

    Joined:
    Jul 22, 2008
    Messages:
    198
    Likes Received:
    0
    There is only a small window, but it works when you keep on pressing repeatedly.
     
    macles, Sep 5, 2008
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.