You are not logged in.
Pages: 1
When I'm recompiling my own kernels I like to use different rc.confs for different kernels, namely for speed and/or cleanliness (if I have a module-less kernel I dont want it spitting out errors that it cant find the modules), and the past two methods Ive used I found out can be pretty dangerous. The first method that I was using was rename the old rc.conf to something like rc.conf-original, then rename the new one to rc.conf and once I was done reverse the process. This became a pain and I decided to make a folder to house all of my rc.confs and then make a symlink to whatever one I wanted, which worked fine unless you typed the path wrong (which I seemed to do upon occasion).
I also recently noticed that booting up with one rc.conf and shutting down with a different one didnt make the system too happy since it didnt unmount my HDDs and perpetually marked my ext4 partiton as dirty even though fsck.ext4 said it was clean (it finally fixed itself after about 2 days and multiple fsck's).
Is there an easier (safer) way to handle this?
Offline
Why not have one rc.conf and have things that you want to be different between kernels in a switch on uname -r? For example (untested):
case $(uname -r) in
*-dirty)
MODULES=<modules for git kernel>
;;
*-custom)
MODULES=() # Custom kernel with modules compiled in
;;
*)
MODULES=<default case>
;;
esac
Offline
I didnt know it was possible to use stuff like that in rc.conf I try it out thanks.
Offline
I didnt know it was possible to use stuff like that in rc.conf I try it out thanks.
Yeah rc.conf just gets sourced by shell scripts. I have some logic in there to only start kdm if $RUNLEVEL is 5, thus getting the best of the inittab and rc.conf way of starting X.
Offline
Interesting, I'm half afraid to mess around with system config files that dont already (explicitly) contain shell commands so thats why I didnt try it before. Hell if you have a backup I guess it doesnt hurt to try
Offline
Sorry to dig up an old thread but I had this working before and deleted my old rc.conf and I cant get it to work again, what am I doing wrong? The error I'm getting is
test: line 5: syntax error near unexpected token `('
test: line 5: ` echo MODULES=(snd-mixer-oss)'
#!/bin/bash
case $(uname -r) in
*AR*)
echo MODULES=(snd-mixer-oss)
echo mv /etc/X11/xorg.conf /etc/X11/xorg.conf-nvidia
echo mv /etc/X11/xorg.conf-nouveau /etc/X11/xorg.conf
;;
*)
echo MODULES=(r8169)
;;
esac
this is just a test script, not what im actually going to use in rc.conf
Last edited by brando56894 (2010-01-08 00:37:08)
Offline
Sorry to dig up an old thread but I had this working before and deleted my old rc.conf and I cant get it to work again, what am I doing wrong? The error I'm getting is
test: line 5: syntax error near unexpected token `('
test: line 5: ` echo MODULES=(snd-mixer-oss)'#!/bin/bash case $(uname -r) in *AR*) echo MODULES=(snd-mixer-oss) echo mv /etc/X11/xorg.conf /etc/X11/xorg.conf-nvidia echo mv /etc/X11/xorg.conf-nouveau /etc/X11/xorg.conf ;; *) echo MODULES=(r8169) ;; esac
(this is just a test script, not what im actually going to use in rc.conf)
why are you echoing things?
that code should probably be:
#!/bin/bash
case $(uname -r) in
*AR*)
MODULES=(snd-mixer-oss)
mv /etc/X11/xorg.conf /etc/X11/xorg.conf-nvidia
mv /etc/X11/xorg.conf-nouveau /etc/X11/xorg.conf
;;
*)
MODULES=(r8169)
;;
esac
//github/
Offline
Thanks, but you completely missed the point of the post. this is a test script and the echos are to make sure each case was matched properly, if I didn't echo it how am I supposed to know if it worked or not?
It's definitely something to do with the parenthesis (obviously) because after I removed them the script worked perfectly.
Offline
Parens are reserved words. Try echo "MODULES=(snd-mixer-oss)" or echo MODULES=\(snd-mixer-oss\).
Offline
Pages: 1