Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running scripts based on kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 818
Location: Vancouver, BC

PostPosted: Wed Sep 12, 2012 7:31 pm    Post subject: Running scripts based on kernel Reply with quote

What's the best way to run local.start scripts based on the current kernel version?

Is there a built-in way to do this?

I have two kernels, 3.0.x and 3.4.x, and the newer kernel needs a different script to run.
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2070

PostPosted: Wed Sep 12, 2012 8:14 pm    Post subject: Reply with quote

Code:
case $(uname -r) in
  $version-x) bla foo here ;;
  $version-y) other stuff here ;;
  *) anything else, error handling ;;
esac
?
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 818
Location: Vancouver, BC

PostPosted: Wed Sep 12, 2012 8:22 pm    Post subject: Reply with quote

I knew I could do that, I was wondering if baselayout had anything that did something similar already. Didn't want to reinvent the wheel. ;)
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2070

PostPosted: Wed Sep 12, 2012 8:36 pm    Post subject: Reply with quote

May very well be, though neither do I know about it, nor could I find something related quickly in baselayout/openrc.
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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