pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kernel detection in /etc/rc.conf

On Sun, May 22, 2011 at 09:58:53AM -0600, Sverre Froyen wrote:
> Hi,
> Is there a way to detect kernel version in /etc/rc.conf. I am attempting 
> something like the following:
> if uname -v | grep XEN3_DOM0 > /dev/null
> then
>         xend=YES
>         xenbackendd=NO
>         xendomains=NO
> else
>         xend=NO
>         xenbackendd=NO
>         xendomains=NO
> fi
> but both uname and grep are missing when /etc/rc.conf is processed. I can 
> presumable use /rescue/grep instead of grep but I cannot find an alternative 
> for uname. Any suggestions?

how about using $(sysctl -n machdep.booted_kernel) ?  (it's in /sbin)

(I bet, though, that there's a way wiser way to do all this, e.g.
using newbtconf(8) -- not saying that this is your solution, just
something to maybe look at for five minutes ;) )



Home | Main Index | Thread Index | Old Index