Page 8 of 8

Re: [NC10] Kernel 2.6.31

Posted: 23 Oct 2009, 23:27
by voria
I'm uploading right now a new kernel with a patch applied which should fix your problem.
It will be available in the next few hours, the time to build it.
Let me know if it works.

Re: [NC10] Kernel 2.6.31

Posted: 25 Oct 2009, 07:53
by JMFTheVCI
Hi voRia, your application of the fix was good. I am now able to use my 3g USB modem again. [To make this post.]

Sorry it took such a long time to test it. I tried to do a dual-boot with Karmic and the 9.10 installer partitioner crashed and hosed my Jaunty ext3 filesystem. It took about 18 hours for fsck to fix all the errors!

Back up and running. Thanks.

Re: RE: [NC10] Kernel 2.6.31

Posted: 04 Feb 2011, 07:08
by SometimesRomano
Hey all, brand new to the forum but came here looking for a way to fix the brightness issues on my Samsung N150 Plus.

The bash script posted by voRia wasn't working for me 'out of the box' so to speak. I have modified it slightly, my first time messing with bash scripts.

Code: Select all


#!/bin/sh


# adjust backlight via setpci and dpms via vbetool


# Check if root called this script
USER=`whoami`
if [ $USER != "root" ]; then
   echo "Need to be root to run this script."
   exit 1
fi

# Get old value
OLD2=`setpci -s 00:02.0 F4.B`

OLD=0x$OLD2

case "$1" in
   inc)
        # Check if value given for increase
      if [ -z "$2" ]; then
         echo "Usage: $0 $1 <value>"
         exit 1
      fi

      # Take second argument as value to increment
      NEW=$(( $OLD + $2 ))

      # Set new value
      $0 set $NEW
   ;;

   dec)
        # Check if value given for decrease
      if [ -z "$2" ]; then
         echo "Usage: $0 $1 <value>"
         exit 1
      fi
      
      # Take second argument as value to decrement
      NEW=$(( $OLD - $2 ))

      # Set new value
      $0 set $NEW
   ;;

   set)
      # Check if value given
      if [ -z "$2" ]; then
         echo "Usage: $0 $1 <value>"
         exit 1
      fi
      
      # Take second argument as value to set
      NEW=$2

      # Check if value less than 0
      if [ "$NEW" -lt "0" ]; then
         NEW=0
      fi

      # Check if value greater than 255
      if [ "$NEW" -gt "255" ]; then
         NEW=255
      fi
   
      # Set new value
      setpci -s 00:02.0 F4.B=`echo "obase=16; ibase=10; $NEW" | bc`
   ;;

   toggle)
      # Path to logfile
      LOG=/tmp/backlight.log

      # Check if logfile does not exist
           if [ ! -f $LOG ]; then
         vbetool dpms off
         touch $LOG
      else
         vbetool dpms on
         rm -rf $LOG
      fi
   ;;

   *)
      echo "Usage: $0 (inc <value>|dec <value>|set <value>|toggle)"
      echo "Current Value: $OLD2"
      exit 1
   ;;
esac

exit 0


Usage is for me:

Code: Select all

gksudo ./myscript.sh
I've added a line to the script to echo the current set value if you don't give parameters.
And:

Code: Select all

gksudo ./myscript.sh set XX
gksudo ./myscript.sh inc XX
gksudo ./myscript.sh dec XX
set value must be decimal from 0-255
inc value must be decimal from 0-255 (increase)
dec value must be decimal from 0-255 (decrease)

Be careful setting the value to 0 or decreasing the value to 0, as it turns off the display backlight completely.

I know I've kicked up something pretty old on this forum but I needed a fix, maybe other do to :)

Let me know if there are any issues/questions

and thanks to voRia for most of the hard work

-SometimesRomano
2.6.35-25-generic
Ubutnu 10.10
Samsung N150 Plus
250GB HD
1GB RAM