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 22.05.2011 17:58, Sverre Froyen wrote:
> 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?

I would just test the presence of the /kern/xen node. If it's present,
you are under a Xen environment. If it's not, it's a "native" system.

if [ -e /kern/xen ]; then
   ...
else
   ...
fi

Note: this might change in the future (when everything will eventually
go into /dev). There will be a sysctl (under machdep. probably) to
provide an equivalent check, but nothing is decided for now.

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index