Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A pair of nVidia helper scripts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
xo
n00b
n00b


Joined: 16 Oct 2003
Posts: 52

PostPosted: Thu Feb 19, 2004 6:46 am    Post subject: A pair of nVidia helper scripts Reply with quote

A pair of nVidia helper scripts

I wrote a couple of scripts to help me with emerging nvidia drivers after a new kernel complation and i thought i should share them.

The scripts are small and so should be self documenting. I won't explain every detail.
    swap_link.sh
    Code:
    #!/bin/bash

    if [ "$1" = "" ]; then

       # Pick the latest vanilla kernel
       dirname=$(ls -b | egrep 'linux-[0-9].[0-9].[0-9]*$' | sort | tail -n 1)

    elif [ "$1" = "latest" ]; then

       # Pick the absolute latest even if unstable
       # minor bug here:
       #    This will actually pick the last in alphabetical which isn't
       #    always correct
       #    e.g., it will pick linux-2.6.3.rc4 instead of linux-2.6.3-mm1
       dirname=$(ls -b | grep linux |sort |tail -n 1)   

    else
       # Pick the kernel named on the command line
       dirname=$1

    fi

    [ ! -d $dirname ] && echo "fucked up" && exit 1
    rm linux
    ln -s $dirname linux

    do_nvidia.sh
    Code:
    #!/bin/bash

    # save old linux link
    echo "saving link /usr/src/linux"
    old_link="$(readlink /usr/src/linux)"

    echo "swapping links to $1"
    /usr/src/swap_link.sh $1

    echo "touching files"
    find /lib/modules/ -name nvidia.ko -exec touch {} \;
    echo "merging"
    env ACCEPT_KEYWORDS="~x86" emerge nvidia-kernel

    echo "putback old link"
    /usr/src/swap_link.sh $old_link


By the way: I keep the scripts in /usr/src and i execute them from there. If you move them somewhere else they will need modification.
_________________
TyanTigerMP | GeForce2MX200 | AudigyPlatinum | PromiseUltra100TX2 | Realtek8139
Back to top
View user's profile Send private message
razamatan
Apprentice
Apprentice


Joined: 28 Feb 2003
Posts: 160

PostPosted: Thu Feb 19, 2004 7:04 am    Post subject: Reply with quote

i don't think you need to touch the nvidia.o module in the old kernel path in the 2.6 series of kernel ebuilds... config protect saves 'em.

well... at least the mm-sources branch of them...
_________________
a razamatan doth speaketh,
"Never attribute to malice, that which can be adequately explained by stupidity"
Back to top
View user's profile Send private message
xo
n00b
n00b


Joined: 16 Oct 2003
Posts: 52

PostPosted: Thu Feb 19, 2004 7:23 am    Post subject: Reply with quote

what do you mean by old kernel path?

I'm only touching the .ko module
_________________
TyanTigerMP | GeForce2MX200 | AudigyPlatinum | PromiseUltra100TX2 | Realtek8139
Back to top
View user's profile Send private message
TheEternalVortex
Apprentice
Apprentice


Joined: 15 Oct 2002
Posts: 207
Location: San Jose, CA

PostPosted: Thu Feb 19, 2004 8:59 pm    Post subject: Reply with quote

A better way to pick the latest kernel (i.e., the way I do it) is:
ls --sort=time -1 | grep linux | head -n 1
That way the latest one that you've installed will be used, even if it isn't the newest version. Also you can "manually" pick one (i.e. with touch).
_________________
-- Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum