LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   Changing Resolution in Console (http://www.linuxquestions.org/questions/showthread.php?t=4175497180)

binarybob0001 03-05-2014 08:12 PM

Changing Resolution in Console
 
I recently changed nvidia drivers from free to non-free. In the process, I lost my high resolution console. I now get the statndard 80 by 20 character Bash shell, although X looks nice. Can someone tell me how to get high resolution in the console again like 1024 by 768.

The output of lsmod is
Code:

acpi_cpufreq          12972  0
aes_generic            33026  2 aes_x86_64,aesni_intel
aesni_intel            50669  0
aes_x86_64            16843  1 aesni_intel
ahci                  25049  2
ata_generic            12479  0
auth_rpcgss            37213  2 nfs,nfsd
binfmt_misc            12957  1
bluetooth            119579  10 rfcomm,bnep
bnep                  17564  2
button                12937  0
cdrom                  35212  1 sr_mod
coretemp              12854  0
crc16                  12343  1 bluetooth
crc32c_intel          12747  0
crc_itu_t              12347  1 firewire_core
crc_t10dif            12348  1 sd_mod
cryptd                14560  2 aesni_intel,ghash_clmulni_intel
ehci_hcd              40284  0
evdev                  17576  14
ext3                  162377  1
fat                    45842  1 vfat
firewire_core          48520  1 firewire_ohci
firewire_ohci          35773  0
fscache                36714  1 nfs
ghash_clmulni_intel    13168  0
hid                    77232  1 usbhid
i2c_core              23959  3 i2c_i801,nvidia,videodev
i2c_i801              12876  0
iTCO_vendor_support    12704  1 iTCO_wdt
iTCO_wdt              17091  0
jbd                    53247  1 ext3
joydev                17282  0
libahci                22907  1 ahci
libata                140813  3 libahci,ahci,ata_generic
lockd                  67355  2 nfs,nfsd
loop                  23002  0
lp                    17160  0
mbcache                13114  1 ext3
media                  18148  2 videodev,uvcvideo
mii                    12675  1 r8169
Module                  Size  Used by
mperf                  12453  1 acpi_cpufreq
mxm_wmi                12515  0
nfs                  309624  0
nfs_acl                12511  2 nfs,nfsd
nfsd                  212620  2
nls_cp437              16553  0
nls_utf8              12456  0
nvidia              11239399  40
parport                31858  3 lp,ppdev,parport_pc
parport_pc            22409  0
pcspkr                12616  0
ppdev                  12763  0
processor              28206  1 acpi_cpufreq
r8169                  47229  0
rfcomm                33675  0
rfkill                19062  3 bluetooth
scsi_mod              162481  5 libata,sr_mod,sd_mod,usb_storage,sg
sd_mod                36049  3
serio_raw              12885  0
sg                    25877  0
shpchp                31390  0
snd                    52809  20 snd_timer,snd_seq_device,snd_seq,snd_pcm,snd_hwdep,snd_hda_codec,snd_hda_intel,snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_rawmidi,snd_usbmidi_lib,snd_usb_audio
snd_hda_codec          78254  3 snd_hda_intel,snd_hda_codec_realtek,snd_hda_codec_hdmi
snd_hda_codec_hdmi    30767  4
snd_hda_codec_realtek  188923  1
snd_hda_intel          26260  3
snd_hwdep              13189  2 snd_hda_codec,snd_usb_audio
snd_page_alloc        13003  2 snd_pcm,snd_hda_intel
snd_pcm                63946  4 snd_hda_codec,snd_hda_intel,snd_hda_codec_hdmi,snd_usb_audio
snd_rawmidi            23041  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                45165  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device        13176  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_seq_midi          12848  0
snd_seq_midi_event    13316  1 snd_seq_midi
snd_timer              22812  2 snd_seq,snd_pcm
snd_usb_audio          85009  1
snd_usbmidi_lib        23337  1 snd_usb_audio
soundcore              13065  1 snd
sr_mod                21899  0
sunrpc                173882  6 lockd,auth_rpcgss,nfs_acl,nfs,nfsd
thermal_sys            18084  1 processor
usb_common            12354  1 usbcore
usbcore              128810  8 xhci_hcd,ehci_hcd,usb_storage,usbhid,snd_usbmidi_lib,snd_usb_audio,uvcvideo
usbhid                36564  0
usb_storage            43892  0
uvcvideo              57806  0
v4l2_compat_ioctl32    16619  1 videodev
vfat                  17366  0
videodev              70918  1 uvcvideo
wmi                    13243  1 mxm_wmi
xhci_hcd              73632  0

The output from lspci is
Code:

00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)
00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5)
00:1f.0 ISA bridge: Intel Corporation Z68 Express Chipset Family LPC Controller (rev 05)
00:1f.2 RAID bus controller: Intel Corporation 82801 SATA Controller [RAID mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 PCI bridge: NVIDIA Corporation NF200 PCIe 2.0 switch (rev a3)
02:00.0 PCI bridge: NVIDIA Corporation NF200 PCIe 2.0 switch (rev a3)
02:02.0 PCI bridge: NVIDIA Corporation NF200 PCIe 2.0 switch (rev a3)
03:00.0 VGA compatible controller: NVIDIA Corporation GF114 [GeForce GTX 560 Ti] (rev a1)
03:00.1 Audio device: NVIDIA Corporation GF114 HDMI Audio Controller (rev a1)
06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
07:00.0 PCI bridge: Integrated Technology Express, Inc. Device 8892 (rev 10)
08:03.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
09:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
0a:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
0b:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
0c:00.0 IDE interface: Marvell Technology Group Ltd. Device 91a3 (rev 11)
0d:00.0 IDE interface: Marvell Technology Group Ltd. Device 91a3 (rev 11)

I'm pretty sure there's a vga module missing. Or maybe, I can use the current nvidia module to change the resolution. If anyone knows where to start, I would appreciate the help. Thank you.

Emerson 03-05-2014 08:30 PM

There is no nVidia solution for this, just use VGA framebuffer. With open source nouveau you were using KMS - which cannot be used with blob.

binarybob0001 03-12-2014 07:53 PM

Thank you for your answer Emerson. You are correct, but something else must be going on. I openned my config file for make just to check if I had VGA or VESA drivers built into the kernel. I do. I still don't have a high-res frame buffer though. Anyone know a command to change the resolution manually? If it works, I can add it to the init scripts or at least search for it? BTW, I have made progress in creating a high resolution grub2 boot screen, but the resolution changes back as soon as the kernel is loaded.
Here's my configuration files.
In /etc/defaul/grub
Code:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#  info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=30
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1360x768x32
GRUB_GFXPAYLOAD=1360x768x32

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

In /etc/grub.d/51_Linux
Code:

#!/bin/sh -e
echo "Adding Debian Wheezy UUID" >&2
cat << EOF
menuentry "Debian Wheezy UUID" {
    linux /boot/vmlinuz-3.2.51 root=UUID=fadcf9ae-80f4-4a5e-9809-605264a7fc33 ro quiet ata_generic.all_generic_ide=1
    initrd /boot/initrd.img-3.2.51
}
EOF

You can see I added the lines to change the graphics mode.
GRUB_GFXMODE=1360x768x32
GRUB_GFXPAYLOAD=1360x768x32
While the graphics mode is changed in grub2 (which was really cool and unexpected), the changes don't hold during boot. Any guesses?

binarybob0001 03-12-2014 09:38 PM

I solved the problem. It turns out that the graphics mode wasn't supported by my hardware (or at least as far as grub2 can see). I had to play around in the grub command line and find out the supported modes using vbeinfo. I had to edit my /etc/default/grub and /etc/grub.d/00_header files and ulitmately set the gfxpayload variable to 1024x768 before load_video is called. That did the trick.

If anyone is interested in seeing a working configuration, here it is:
/etc/default/grub
Code:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#  info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=30
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768
GRUB_GFXPAYLOAD=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

/etc/grub.d/00_header
Code:

#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

transform="s,x,x,"

prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"
locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}`
grub_lang=`echo $LANG | cut -d . -f 1`

. "${datarootdir}/grub/grub-mkconfig_lib"

# Do this as early as possible, since other commands might depend on it.
# (e.g. the `loadfont' command might need lvm or raid modules)
for i in ${GRUB_PRELOAD_MODULES} ; do
  echo "insmod $i"
done

if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi

# Use these to set the graphics mode
GRUB_GFXMODE=1024x768
GRUB_GFXPAYLOAD=1024x768

if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
if [ "x${GRUB_GFXPAYLOAD}" = "x" ] ; then GRUB_GFXPAYLOAD=640x480 ; fi

if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi
if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi
if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT" ; fi

cat << EOF
if [ -s \$prefix/grubenv ]; then
  load_env
fi
EOF
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
    cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
  set default="${GRUB_DEFAULT_BUTTON}"
else
  set default="${GRUB_DEFAULT}"
fi
EOF
else
    cat <<EOF
set default="${GRUB_DEFAULT}"
EOF
fi
cat <<EOF
if [ "\${prev_saved_entry}" ]; then
  set saved_entry="\${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "\${boot_once}" ]; then
    saved_entry="\${chosen}"
    save_env saved_entry
  fi
}

function load_video {
EOF
if [ -n "${GRUB_VIDEO_BACKEND}" ]; then
    cat <<EOF
  insmod ${GRUB_VIDEO_BACKEND}
EOF
else
    # Insert all available backends; GRUB will use the most appropriate.
    have_video=0;
    for backend in $(cat "${GRUB_PREFIX}/video.lst"); do
        have_video=1;
        cat <<EOF
  insmod ${backend}
EOF
    done
    if [ x$have_video = x0 ]; then
        echo "true"
    fi
fi
cat <<EOF
}

EOF

serial=0;
gfxterm=0;
for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
    if [ xserial = "x$x" ]; then
        serial=1;
    fi
    if [ xgfxterm = "x$x" ]; then
        gfxterm=1;
    fi
done

if [ "x$serial" = x1 ]; then
    if ! test -e "${GRUB_PREFIX}/serial.mod" ; then
        echo "Serial terminal not available on this platform." >&2 ; exit 1
    fi

    if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
        grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used."
        GRUB_SERIAL_COMMAND=serial
    fi
    echo "${GRUB_SERIAL_COMMAND}"
fi

if [ "x$gfxterm" = x1 ]; then
    # Make the font accessible
    prepare_grub_to_access_device `${grub_probe} --target=device "${GRUB_FONT_PATH}"`

    cat << EOF
if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT_PATH}"` ; then
  set gfxmode=${GRUB_GFXMODE}
# Remove the line below if somethings goes wrong
  set gfxpayload=${GRUB_GFXPAYLOAD}
  load_video
  insmod gfxterm
EOF

# Gettext variables and module
if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then
    prepare_grub_to_access_device $(${grub_probe} --target=device ${locale_dir}) | sed -e "s/^/  /"
  cat << EOF
  set locale_dir=(\$root)$(make_system_path_relative_to_its_root ${locale_dir})
  set lang=${grub_lang}
  insmod gettext
EOF
fi

cat <<EOF
fi
EOF
fi

case x${GRUB_TERMINAL_INPUT} in
  x)
    # Just use the native terminal
  ;;
  x*)
    cat << EOF
terminal_input ${GRUB_TERMINAL_INPUT}
EOF
  ;;
esac

case x${GRUB_TERMINAL_OUTPUT} in
  x)
    # Just use the native terminal
  ;;
  x*)
    cat << EOF
terminal_output ${GRUB_TERMINAL_OUTPUT}
EOF
  ;;
esac

if [ "x$gfxterm" = x1 ]; then
    if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
        && is_path_readable_by_grub "$GRUB_THEME"; then
        echo "Found theme: $GRUB_THEME" >&2
        prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
        cat << EOF
insmod gfxmenu
EOF
        themedir="`dirname "$GRUB_THEME"`"
        for x in "$themedir"/*.pf2 "$themedir"/f/*.pf2; do
            if [ -f "$x" ]; then
                cat << EOF
loadfont (\$root)`make_system_path_relative_to_its_root $x`
EOF
            fi
        done
        if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then
            cat << EOF
insmod jpeg
EOF
        fi
        if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then
            cat << EOF
insmod png
EOF
        fi
        if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then
            cat << EOF
insmod tga
EOF
        fi
           
        cat << EOF
set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`
EOF
    elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
            && is_path_readable_by_grub "$GRUB_BACKGROUND"; then
        echo "Found background: $GRUB_BACKGROUND" >&2
        case "$GRUB_BACKGROUND" in
            *.png)        reader=png ;;
            *.tga)        reader=tga ;;
            *.jpg|*.jpeg)  reader=jpeg ;;
            *)            echo "Unsupported image format" >&2; exit 1 ;;
        esac
        prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
        cat << EOF
insmod $reader
background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"`
EOF
    fi
fi

make_timeout ()
{
    if [ "x${1}" != "x" ] ; then
        if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
            verbose=
        else
            verbose=" --verbose"
        fi
        cat << EOF
if sleep$verbose --interruptible ${1} ; then
  set timeout=${2}
fi
EOF
    else
        cat << EOF
set timeout=${2}
EOF
    fi
}

if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
    cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
echo else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
echo fi
else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
fi

if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ] && [ "x$GRUB_BUTTON_CMOS_CLEAN" = "xyes" ]; then
    cat <<EOF
cmosclean $GRUB_BUTTON_CMOS_ADDRESS
EOF
fi

# Play an initial tune
if [ "x${GRUB_INIT_TUNE}" != "x" ] ; then
  echo "play ${GRUB_INIT_TUNE}"
fi

if [ "x${GRUB_BADRAM}" != "x" ] ; then
  echo "badram ${GRUB_BADRAM}"
fi

Note that the environment variables GRUB_GFXPAYLOAD and GRUB_GFXMODE in the /etc/default/grub file do not get set like they are supposed to by the time the script reaches /etc/grub.d/00_header. That's why I set those variable in 00_header. I wonder if that's a bug? One could actually forgo editting the grub file altogether, and simply edit 00_header. Better yet, one can add set gfxpayload=1024x768 directly into one's custom grub boot scripts in the /etc/grub.d directory like so:
/etc/grub.d/50_Linux
Code:

#!/bin/sh -e
echo "Adding Debian Wheezy" >&2
cat << EOF
menuentry "Debian Wheezy" {
set gfxpayload=1024x768
set root=(hd0,4)
linux /vmlinuz root=UUID=fadcf9ae-80f4-4a5e-9809-605264a7fc33 ro quiet ata_generic.all_generic_ide=1
initrd /initrd.img
}
EOF

I hope this helps anyone who has a similar problem.


All times are GMT -5. The time now is 03:55 AM.