Results 1 to 1 of 1

Thread: HOWTO: Fix framebuffer problems after installation of new kernel in Acer Aspire 4520

  1. #1
    Join Date
    Sep 2009
    Location
    Cebu, Philippines
    Beans
    43
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    HOWTO: Fix framebuffer problems after installation of new kernel in Acer Aspire 4520

    by Kristofer Monisit

    Author's Message
    This is my first HOWTO in my whole experience with Linux. Many of the statements here are my personal opinions. I just want to give back to the community who also helped me form these opinions. I hope this would be of help. I welcome corrections and confirmations
    Statement of the Problem
    I had just installed my new custom kernel. Now the framebuffer does not work! Here are the symptoms of framebuffer problems:

    • The boot-up process has been successful, without any glitches. The GUI looks fine with the correct resolution (after having installed Nvidia proprietary drivers). BUT when I switch to a virtual console, everything is garbled, nothing is comprehensible.
    • Upon shutting down, the screen is also garbled. I couldn't see the shutdown splash (Although I could see the bootup splash).
    Hypothesis of the Cause of the Problem

    • The initrd corresponding to the new kernel does not load the needed modules for framebuffer rendering
    • The kernel boot options lack the vga option
    Objective
    Get the framebuffer to work so that I could use the virtual console.
    Overview of the Solution
    This HOWTO will be presented in four parts:

    • PART 1. Compiling and customizing the kernel
    • PART 2. Installing the kernel
    • PART 3. Installing the Nvidia proprietary drivers
    • PART 4. Fixing the framebuffer problem

    PART 1 illustrates my preferred method of compiling and installing the kernel. In this HOWTO, we will be using the 2.6.28 kernel with Ubuntu patch 15.52 It needs to be presented in order to provide a background pertaining to the important framebuffer modules.

    PART 2 contains a critical step before installing the kernel, which when followed correctly, you no longer need to proceed to PART 4.

    PART 3 provides instructions for uninstalling the Nvidia drivers (for the current kernel) and then installing them (for the new kernel) downloaded from the official Nvidia site.

    PART 4 provides step-by-step instructions for fixing the framebuffer problem AFTER your kernel image has been built and installed. You might just want to get the framebuffer to work, and your virtual console to be usable. You can jump directly to this part. If something confuses you, try reading up on the preceeding parts.
    Revision Notes

    • October 11, 2009 -- First Edition
    • October 13, 2009 -- Rearranged some initial sections, placed "Statement of the Problem" closer to the beginning.

    Author's Computer Specs (Test Platform)

    • Acer Aspire 4520 laptop
    • AMD Turion64 X2 1.8Ghz (I'm only using the 32-Bit Ubuntu)
    • 160GB HDD (12GB ext3 for Ubuntu, 4GB swap, the rest is for Windows)
    • 2GB RAM
    • Nvidia nForce 610m (motherboard chipset)
    • Nvidia GeForce 7000m (integrated graphics card)
    • Running Ubuntu 9.04 Jaunty Jackalope
    • Kernel source 2.6.28 with Ubuntu patch 15.52
    • Nvidia installer (NVIDIA-Linux-x86-185.18.36-pkg1.run)


    External References
    Ubuntu Community Wikis


    Ubuntu Forums


    Step-by-Step Solution
    Now let's get our hands dirty

    Part 1. Compiling and customizing the kernel

    1. Install the necessary packages for building the kernel
      Code:
      $ sudo apt-get install build-essential kernel-wedge kernel-package ccache makedumpfile libncurses5-dev
      $ sudo apt-get build-dep linux
    2. Create and cd into a directory at $HOME where you will store the kernel source tree
      Code:
      $ cd ~
      $ mkdir linux
      $ cd linux
    3. Get the kernel sources (DON'T use sudo here!). You have two methods. You can use either method.
      • From the official apt repositories
        Code:
        $ apt-get source linux-source-2.6.28 --download-only
      • From http://archive.ubuntu.com
        Code:
        $ wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_2.6.28.orig.tar.gz
        $ wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_2.6.28-15.52.diff.gz

    4. Unpack the source tree and the diff patch
      Code:
      $ tar xvjf linux_2.6.28.orig.tar.gz
      $ gunzip linux_2.6.28-15.52.diff.gz
    5. Patch the original source tree
      Code:
      $ cd linux-2.6.28
      $ patch -p1 -i ../linux_2.6.28-15.52.diff
    6. Update the rules
      Code:
      $ chmod +x ~/linux/linux-2.6.28/debian/rules
      $ chmod +x ~/linux/linux-2.6.28/debian.master/scripts/misc/*
      $ debian/rules updateconfigs
    7. Copy your current kernel's config file. This config will tell the compiler how to build the kernel. If you want to customize it, at least you'll have a starting point.
      Code:
      $ cp /boot/config-$(uname -r) ~/linux/linux-2.6.28/.config
    8. Customize your kernel. Now this will present a LOT of options and a LOT of possibilities to screw up. Your kernel might not compile properly or you might not be able to boot into it. I assume you'll want to learn how to customize it. The only advice I could give in this HOWTO is this. Use / to search, and ? to learn about a specific option.
      Code:
      $ make menuconfig
    9. VERY IMPORTANT: Make sure you have the following options compiled as built-in
      Code:
      Device Drivers --> Graphics Support --> Support for framebuffer devices
    10. VERY IMPORTANT: Make sure you have the following options compiled as modules
      Code:
      Device Drivers --> Graphics Support --> /dev/agpgart (AGP Support) --> NVIDIA nForce/nForce2 chipset support
      Device Drivers --> Graphics Support --> VGA 16-color graphics support
      Device Drivers --> Graphics Support --> Userspace VESA VGA graphics support
      Device Drivers --> Graphics Support --> VESA VGA graphics support
      Device Drivers --> Graphics Support --> Console display driver support --> Framebuffer Console support
    11. VERY IMPORTANT: Completely disable the following options. If you have these options enabled, the Nvidia proprietary driver installer will complain about nvidiafb.
      Code:
      Device Drivers --> Graphics Support --> nVidia Framebuffer support
      Device Drivers --> Graphics Support --> nVidia Riva support
    12. Save your kernel configuration and exit
      Code:
      Save an Alternate Configuration File --> .config
    13. Back in the terminal, compile your kernel. These commands, specifically because of make-kpkg, will create two .deb files in ~/linux which you will be able to install easily later. In --append-to-version, you can change mycustomkernel to string you want. Keep the small dash after the equals sign
      Code:
      $ fakeroot ccache make-kpkg --initrd --append-to-version=-mycustomkernel kernel-image kernel-headers
    14. The compile process takes about 2 1/2 hours on my laptop. Better go do something else worthwhile. But BEWARE! You might have done some settings in make menuconfig which might cause compile errors. Such problems are beyond the scope of this HOWTO. I have encountered such problems before. For example, the error is related to lirc, I'll just head over to make menuconfig again and disable lirc. (Dirty hack, I wouldn't recommend it)
    15. Then... Congratulations! You have just compiled your custom kernel!
    PART 2. Installing the kernel

    1. By this time you will already have two .deb files in ~/linux, for example
      Code:
      $ cd ~/linux
      $ ls | grep deb
      linux-headers-2.6.28-15.52-kit-superconfig-01_2.6.28-15.52-kit-superconfig-01-10.00.Custom_i386.deb
      linux-image-2.6.28-15.52-kit-superconfig-01_2.6.28-15.52-kit-superconfig-01-10.00.Custom_i386.deb
    2. VERY IMPORTANT: If you follow this step, you no longer need PART 4 of this HOWTO. Before you install your new .debs, edit /etc/initramfs-tools/modules and add the following lines
      Code:
      fbcon
      vesafb
    3. OPTIONAL: If you want your splash screen to look good (not stretched or placed over to the side), edit /etc/usplash.conf and make sure you have the following screen resolution settings, for example
      Code:
      xres=1024
      yres=768
    4. VERY IMPORTANT: You will need to edit your /boot/grub/menu.lst. As a best practice, back it up first
      Code:
      $ cd /boot/grub
      $ sudo cp menu.lst menu.lst.bak
    5. VERY IMPORTANT: Now edit menu.lst using any text editor you want
      Code:
      $ sudo gedit menu.lst
    6. VERY IMPORTANT: Look for the # defoptions= line and add the vga=792 option, for example (DO NOT UNCOMMENT it! Leave the # sign untouched)
      Code:
      ## If my # defoptions line looked like this
      # defoptions=quiet splash
      
      ## I can make it look like this
      # defoptions=quiet splash vga=792
    7. You can now install your new kernel and its corresponding headers
      Code:
      $ cd ~/linux
      $ sudo dpkg -i linux-headers-2.6.28-15.52-kit-superconfig-01_2.6.28-15.52-kit-superconfig-01-10.00.Custom_i386.deb
      $ sudo dpkg -i linux-image-2.6.28-15.52-kit-superconfig-01_2.6.28-15.52-kit-superconfig-01-10.00.Custom_i386.deb
    8. VERY IMPORTANT: When the linux-image installer asks about the /boot/grub/menu.lst, let it "Install the package maintainer's version".
    9. PROBLEM CHECKPOINT: If, when installing the linux-image, you encounter an error with nvidia-common, it helps to purge it and install it again
      Code:
      $ sudo apt-get purge nvidia-common
      $ sudo apt-get install nvidia-common
    10. DON'T restart yet!
    11. Congratulations! You have just installed a new kernel!

    SOME LINUX THEORY:

    • In steps 2 and 3, you edited configuration files related to the initrd (initial RAM disk). Upon installing linux-image, the update-initramfs tool will automatically run, creating a new initrd for your new kernel. The configuration files will help configure your new initrd upon building it. For example /etc/initramfs-tools/modules will tell your new initrd to load fbcon and vesafb upon bootup.
    • In steps 4 to 6, you edited a configuration file related to grub (GRand Unified Bootloader). Upon performing step 8, the update-grub tool will refer to the # defoptions= line and makes sure that every kernel listed in /boot/grub/menu.lst will have those boot options.

    PART 3. Setting up the Nvidia proprietary drivers

    1. Now we will need to uninstall the Nvidia drivers for your current kernel. Just to make sure that your next kernel will be able to load the X GUI using default (no Nvidia) configurations. You will have two methods, depending on how you installed your drivers.
      • If you installed them using System --> Administration --> Hardware Drivers, disable your current driver from there.
      • If you installed your current driver using the installer from the official site, do the following
        1. Switch and login to a virtual console by pressing Ctrl-Alt-F1
        2. Stop the X server
          Code:
          $ sudo /etc/init.d/gdm stop
        3. Uninstall the Nvidia drivers. Make sure you still have the installer. For example
          Code:
          $ sudo sh ./NVIDIA-Linux-x86-185.18.36-pkg1.run --uninstall
        4. Restart the X Server
          Code:
          $ sudo /etc/init.d/gdm start
        5. If it complains that the nvidia module does not exist, tell it to reconfigure itself using the default generic xorg.conf.
        6. Switch back to the virtual console (Ctrl-Alt-F1) and restart the X Server
          Code:
          $ sudo /etc/init.d/gdm stop
          $ sudo /etc/init.d/gdm start
        7. Your GUI should now be in an ugly resolution. That should confirm that you Nvidia drivers have been uninstalled.


    2. Shutdown your computer and turn it back on. SHUTDOWN ensures that you will be able to access the GrUB menu.
      Code:
      $ sudo shutdown -P now
    3. In the GrUB menu, boot into your new kernel. It should take you to a GUI with an ugly resolution.
    4. After the bootup process, switch to a virtual console
    5. In the virtual console, stop the X Server
      Code:
      $ sudo /etc/init.d/gdm stop
    6. Install the Nvidia drivers
      Code:
      $ sudo sh ./NVIDIA-Linux-x86-185.18.36-pkg1.run
    7. Inside the installer program, it will ask you if you want to download a precompiled kernel interface. DON'T download. Instead, let it compile a new kernel interface. This will depend on the linux-headers that you have installed previously.
    8. After installation, the program will also ask you if you want to automatically configure your xorg.conf so that the X Server will use the Nvidia drivers and render your GUI in a beautiful resolution. Let it configure automatically.
    9. PROBLEM CHECKPOINT: In my experience, at this point of the installation, the problems start flying in. When I switch back to a virtual console after installing the Nvidia drivers, the screen becomes garbled. These problems should occur if you missed Steps 2-6 in PART 2.
    10. Test your installation now by pressing Ctrl-Alt-F1
      • If it renders fine (text is readable). You're good to go!
      • If it doesn't, switch back to the GUI by pressing Ctrl-Alt-F7. Then follow the instructions in Part 4.

    11. Congratulations! You have just installed the Nvidia drivers!

    PART 4. Fix the framebuffer AFTER installation of the new kernel
    This portion of the HOWTO will be similar to a troubleshooting guide, so I will present first the solutions pertaining to the most common causes of the problem

    • CAUSE 1: You probably do not have vga=792 in the boot options in /boot/grub/menu.lst for your current kernel
      1. You will need to edit your /boot/grub/menu.lst. As a best practice, back it up first
        Code:
        $ cd /boot/grub
        $ sudo cp menu.lst menu.lst.bak
      2. Now edit menu.lst using any text editor you want
        Code:
        $ sudo gedit menu.lst
      3. Look for the # defoptions= line and add the vga=792 option, for example (DO NOT UNCOMMENT it! Leave the # sign untouched)
        Code:
        ## If my # defoptions line looked like this
        # defoptions=quiet splash
        
        ## I can make it look like this
        # defoptions=quiet splash vga=792
      4. Then update-grub
        Code:
        $ sudo update-grub
      5. Tell it to "Install the package maintainer's version"
      6. Restart your computer. Then test your installation by switching to a virtual console.


    • CAUSE 2: Your current kernel's initrd probably doesn't load the fbcon and vesafb modules. For this procedure, make sure you are running under your problematic kernel.
      1. VERY IMPORTANT:Edit /etc/initramfs-tools/modules and add the following lines
        Code:
        fbcon
        vesafb
      2. OPTIONAL: If you want your splash screen to look good (not stretched or placed over to the side), edit /etc/usplash.conf and make sure you have the following screen resolution settings, for example
        Code:
        xres=1024
        yres=768
      3. The two modifications above will only take effect after the following command
        Code:
        $ sudo update-initramfs -u
      4. Restart your computer. Then test your installation by switching to a virtual console.

    That wraps up this HOWTO. I hope this helps everyone. Post your questions and suggestions and I will update this HOWTO as I deem fit. You will be properly credited
    Last edited by mo0nykit; October 23rd, 2009 at 01:36 PM. Reason: Finish the First Edition

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •