LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-07-2007, 01:57 AM   #1
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Rep: Reputation: 15
915resolution


I am using "915resolution 38 1280 800 24" to fix my resolution on my laptop, but is there anyway to get this command to run before x starts up?

At the moment I have to run it, then restart x to get 1280 x 800 resolution.

Anyway so make this automatically run at start-up before it boots into x?
 
Old 01-07-2007, 05:41 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Try this thread:
http://www.linuxquestions.org/questi...d.php?t=499102
 
Old 01-07-2007, 09:29 AM   #3
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
Edited all files, ran all terminal commands. Must be doing something wrong though as I cannot get it working!
 
Old 01-07-2007, 09:42 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
What, no errors?
Please post the output of
Code:
ls -l /etc/init.d/915resolution
and
Code:
cat /etc/init.d/915resolution
 
Old 01-07-2007, 10:46 AM   #5
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
ls -l:

Code:
-rwxr-xr-x 1 root root 2685 2006-09-19 03:03 /etc/init.d/915resolution
cat:

Code:
#! /bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
PROG=/usr/sbin/915resolution
VBETOOL=/usr/sbin/vbetool
NAME=915resolution
DESC=915resolution
CONFIG=/etc/default/915resolution

test -x $DAEMON || exit 0

# Include 915resolution defaults if available
if [ -f "$CONFIG" ] ; then
        . "$CONFIG"
fi
if [ "$MODE" = auto -a \! -x "$VBETOOL" ] \
 || [ "$MODE" != auto -a \( -z "$MODE" -o -z "$XRESO" -o -z "$YRESO" \) ] ; then
   echo "*** Your 915resolution hasn't been configured! ***"
   echo "Please read /usr/share/doc/915resolution/README.Debian and define"
   echo "MODE, XRESO, and YRESO or install the 'vbetool' package."
   exit 0
fi

auto_select_modes()
{
    if [ ! -x "$VBETOOL" ] || ! panelsize=`$VBETOOL vbefp panelsize` ; then
        echo "*** Your 915resolution was not automatically configured! ***"
        echo "Please read /usr/share/doc/915resolution/README.Debian then define"
        echo "MODE, XRESO, and YRESO manually in $CONFIG or install 'vbetool'."
        exit 1
    fi

    # If the native panel-size is already in the BIOS mode list, we
    # don't have to do anything, yippee!
    bios_list=`$PROG -l`
    if echo "$bios_list" | grep -q "^Mode .* $panelsize" ; then
        #echo 'Correct panel-size is already listed, skipping'
        return
    fi

    # For want of a better approach to selecting modelines for stealing;...
    # this expression grabs us the highest *numbered* mode in each
    # bit-depth that the BIOS already lists.
    #
    # An argument for using the highest mode-number, rather than the
    # highest resolution is that if we've already reprogrammed the
    # mode to be a lower resolution it will no longer be the highest.
    # If this has changed over a suspend cycle, that consequences
    # might not be so good.  -Paul Sladen
    target_modes=`echo "$bios_list" | awk '/^Mode [^T]/{sub(",","",$4); print $5,$4,$2}' | tac | sort -n -u | cut -d' ' -f3`

    for m in $target_modes ; do
        # The 'tr' converts '1024x768' -> '1024' '768'
        # and the bitdepth is missed off because we have one of each depth
        $PROG $m $(echo $panelsize | tr x ' ')
    done
}

set -e

case "$1" in
  start|restart|force-reload)
        echo -n "Starting $DESC: "
        if [ "$MODE" = "auto" ] ; then
            auto_select_modes
        else
            $PROG $MODE $XRESO $YRESO $BIT
        fi
        echo "$NAME."
        ;;
  stop)
        #echo -n "Stopping $DESC: "
        #echo "$NAME."
        ;;
# Move this to 'start' so there is only one code-path
# restart|force-reload)
#       #echo -n "Stopping $DESC: "
#       #echo "$NAME."
#       echo -n "Starting $DESC: "
#       $PROG $MODE $XRESO $YRESO $BIT
#       echo "$NAME."
#       ;;
  *)
        N=/etc/init.d/$NAME
        # echo "Usage: $N start" >&2
        echo "Usage: $N start" >&2
        exit 1
        ;;
esac

exit 0
 
Old 01-07-2007, 10:58 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
ls ...: OK, so 915resolution is owned by root, and is executable, which is good.
cat ...: Yikes! Some complicated shell script. I am sure it is very clever...
But maybe you have something wrong with the config file it needs.
What do you get with cat /etc/default/915resolution ?
Are there any clues in your logs? ( cat /var/log/messages | grep 915resolution )
 
Old 01-07-2007, 11:16 AM   #7
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
cat /etc/default/915resolution:

Code:
#
# 915resolution default
#
# find free modes by  /usr/sbin/915resolution -l
# and set it to MODE or set to 'MODE=auto'
#
# With 'auto' detection, the panel-size will be fetched from the VBE
# BIOS if possible and the highest-numbered mode in each bit-depth
# will be overwritten with the detected panel-size.
MODE=5c
#
# and set resolutions for the mode.
# e.g. use XRESO=1024 and YRESO=768
XRESO=1280
YRESO=800
#
# We can also set the pixel mode.
# e.g. use BIT=32
# Please note that this is optional,
# you can also leave this value blank.
BIT=
 
Old 01-07-2007, 11:53 AM   #8
DaaNMaGeDDoN
LQ Newbie
 
Registered: Dec 2006
Distribution: Slackware
Posts: 7

Rep: Reputation: 0
Really there is a more elegant way to set your framebuffer res at startup:
get vbetest from the vesautils (google for it).
run vbetest and get the number at the left of your preferred resulution.
Add 512 to this number.
The result should be passed to the kernel as a parameter.
Edit /etc/lilo.conf (dont know about grub), look for your kernel section and add append = "vga=$NUMBER" where $NUMBER is the calculated result.
Worked for me on a Toshiba laptop with a 1280x800 lcd, boots in its native resolution, looks verry nice.
For X you will have to manually edit the "Screen" section in xorg.conf.
Good luck!
 
Old 01-07-2007, 12:06 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Thank you.
All very puzzling, (but then I'm new to this init.d stuff)
Was there anything cat /var/log/messages | grep 915resolution ?
Maybe the script is not being called properly.
I am not using gnome, but KDE has this "system services" GUI that shows me what processes are started (or not) at boot time, you need to find the equivalent for gnome and make sure that 915resolution is both listed and set to start at boot. There's also a command-line thingy to do this but I forget its name right now.
You could edit the second line of /etc/init.d/915resolution to say echo 915 was called > /home/matt/915.log
Reboot & see if the script was called.
Or, try DaaNMaGeDDoN's suggestion, but it should be possible to do it the "right" way!
 
Old 01-08-2007, 08:09 AM   #10
DaaNMaGeDDoN
LQ Newbie
 
Registered: Dec 2006
Distribution: Slackware
Posts: 7

Rep: Reputation: 0
Quote:
Originally Posted by tredegar
....
Reboot & see if the script was called.
Or, try DaaNMaGeDDoN's suggestion, but it should be possible to do it the "right" way!
Hm, can't see why one way is more 'right' than the other, that must be personal.

Some notes on the 'taskmanager': 915setresoltution is something you could run from /etc/rc.d/rc.local (rc.local could reside somewhere else, try to find it), and sets the resolution somewhere during the running of the init scipts. I really do not think 915resolution stays resident after running (would make no sense). So trying to find it with 'ps aux' from the command line, or with kde taskmanager wouldn't help you. The other method of writing some text to a file in your home dir will tell you if it ran, but did it run succesfully?

The way i described there is no need to run a script, as the resolution gets set directly after loading the kernel. All that stuff you see during boot (dmesg) will be shown in the right resolution. That is not the case with 915setresolution, which is run as a command rather than a kernel bootparameter.

Really i would recommend finding the right vga=.... mode. After that, try to find out what boot loader you use and edit your bootloader config to pass it to the kernel as a bootparameter.
In case you use lilo: edit /etc/lilo.conf and save it, after that run 'lilo' and reboot.
In case you use grub: edit /boot/grub/menu.lst and save it, run 'update-grub' and reboot. (grub could involve more work).

After a reboot, run 'dmesg | less' to see (at the top) what bootparams where passed to the kernel. It should read something like /path/to/kernel root=/dev/hda? ro initrd=... vga=... etc. But successfully setting the right vga mode would be quite obvious
This method is successfully used on a toshiba latop with a 1280x800 screen behind a intel 945GM chip, wich is a family member of the 915-family if im not mistaken.

If you have a 945GM (try 'lspci' to find out) you can safely try vga=865, for other chips you will have to compute it yourself. Besides that there is no guarantee your kernel recognizes the 915 chip, it is possible for the kernel to use the 'universal' vesafb, try to look for it in dmesg. To make your kernel using the 915 properly you might have to recompile your kernel, but that's another story...
Let us know if you had any succes.
 
Old 01-09-2007, 09:11 AM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
Hm, can't see why one way is more 'right' than the other, that must be personal
LOL, no nothing personal, just that the OP was asking how to make 915resolution run automatically, and that's what I was trying to answer.
Don't know if he has it working yet, but I think the problem is the script isn't being called. He can either set it to be run at boot time with the "System Services" menu of his GUI, or (now I have remembered the command) use update-rc.d (see the man page before you try this!), or mayve vga=xxx as a kernel parameter will solve the problem another way...
 
Old 01-10-2007, 01:12 AM   #12
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
Thanks for your responses. I have not had chance to try yet, but will attempt it tonight and let you know how I get on.
 
Old 01-10-2007, 10:28 AM   #13
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
WORKING AT LAST

Having installed Pardus to try it out, I reinstalled Ubuntu as I prefered it hands down. It was then I came accross http://www.mail-archive.com/laptop-t.../msg01018.html.

Quote:
1) Resolution at 1024x768 instead of 1280x800 - Fixed with 915resolution
package (sudo apt-get install 915resolution) - All I had to do was restart X
and it was working.
I ran the apt-get and restarted x. To my amazement it automatically fixed my resolution, 1280 x 800 worked!

Thanks for your help
 
Old 01-11-2007, 11:40 AM   #14
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Well, there you go!
Congratulations. (And I learnt some stuff about the linux boot sequence.....)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
915resolution on x startup timoioi Ubuntu 2 12-10-2006 02:41 PM
How do I install 915resolution? aznluvsmc Fedora 1 11-26-2006 10:27 AM
915resolution on Debian Etch glenerik Linux - Laptop and Netbook 6 11-08-2006 01:27 PM
915resolution LuvdemHeels Ubuntu 4 01-31-2006 10:05 AM
klaptop, hibernate and 915resolution rob666 Linux - Laptop and Netbook 0 08-23-2005 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration