Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

These are the steps I made:

  • Install Ubuntu 11.04
  • Update the system
  • Install NVidia driver
  • I fixed the Grub and plymouth resolution issue

Then a problem appeared: the login screen resolution is lower than optimal (native is 1280x800 but the problem is when resolution seems to be 1024x768), it did not happen before I tried to fix the resolution problem.

The script I used to fix the resolution is the following:

#!/bin/bash
# Usage: install_if_not_installed package_name
function install_if_not_installed
{
PACKAGE="$1"
INSTALLED=$(dpkg -L "$PACKAGE" > /dev/null 2>&1 && echo OK || echo KO)
if [ "$INSTALLED" == "KO" ]
then
sudo apt-get install "$PACKAGE" -y
fi
}

# Usage: contains regexp file
function contains
{
REGEXP="$1"
FILE="$2"

grep "$REGEXP" "$FILE" > /dev/null && echo OK || echo KO
}

install_if_not_installed v86d
install_if_not_installed hwinfo

sudo hwinfo --framebuffer
echo "---------------------------------------------------------------"
echo "Please enter the best resolution from the list above"
echo "It usualy looks like this >>Mode 0x0323: 1024x768 (+4096), 24 bits<<"
echo "And you have to enter it like this >>1024x768-24<<"
echo "---------------------------------------------------------------"
read resolution

sed 's/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\"/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\ nomodeset\ video\=uvesafb\:mode\_option\='$resolution'\,mtrr\=3\,scroll\=ywrap\"/g' /etc/default/grub > ./newgrub
sudo mv -f ./newgrub /etc/default/grub

sed 's/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\"/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"quiet\ splash\ nomodeset\ video\=uvesafb\:mode\_option\='$resolution'\,mtrr\=3\,scroll\=ywrap\"/g' /etc/default/burg > ./newburg
sudo mv -f ./newburg /etc/default/burg

sed 's/\#GRUB\_GFXMODE\=640x480/GRUB\_GFXMODE\='$resolution'/g' /etc/default/grub > ./newgrub
sudo mv -f ./newgrub /etc/default/grub

if [ "$(contains uvesafb /etc/initramfs-tools/modules)" == 'KO' ]
then
sudo echo "uvesafb mode_option=$resolution mtrr=3 scroll=ywrap" | sudo tee -a    /etc/initramfs-tools/modules
fi

if [ "$(contains FRAMEBUFFER=y /etc/initramfs-tools/conf.d/splash)" == 'KO' ]
then
echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash
fi

sed 's/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"\$GRUB\_CMDLINE\_LINUX\_DEFAULT vt\.handoff\=7\"/GRUB\_CMDLINE\_LINUX\_DEFAULT\=\"\$GRUB\_CMDLINE\_LINUX\_DEFAULT\"/g' /etc/grub.d/10_linux > ./new10linux
sudo mv -f ./new10linux /etc/grub.d/10_linux
sudo chmod +x /etc/grub.d/10_linux

sudo update-grub2
which update-burg > /dev/null 2>&1 && sudo update-burg
sudo update-initramfs -u
echo "The resolution should be fixed after a reboot"

UPDATE: It is confirmed that it is due to Nvidia driver not loading correctly upon first login (logging out fixes the problem aswell as service gdm restart)

This is the log:

[    20.115] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
[    20.115] (EE) NVIDIA:     system's kernel log for additional error messages.
[    20.115] (II) UnloadModule: "nvidia"
[    20.115] (II) Unloading nvidia
[    20.115] (EE) Failed to load module "nvidia" (module-specific error, 0)

Thanks in advance (and sorry if it was posted before)

share|improve this question
add comment

closed as too localized by fossfreedom Feb 25 '12 at 21:14

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.