[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Internal make command Macro to identify linux/os distribution.
From: |
Paul Smith |
Subject: |
Re: Internal make command Macro to identify linux/os distribution. |
Date: |
Tue, 09 Sep 2008 07:57:44 -0400 |
On Tue, 2008-09-09 at 16:18 +0530, Gautam Shejwalkar wrote:
> Yes, I was referring to the distro. Actually based on the distro I
> want to decide which rpm package needs to be installed. B'coz only in
> uname -r we get the information on the distro. I am not sure if there
> are any other commands available for checking the distro type.
uname -r returns the version of the kernel. _Some_ distros will build
custom kernels and _some_ of them will put a reference to the distro
name in the kernel name. But, this is very, very far from being a
reliable test. People can rebuild their kernels for lots of reasons.
Also some distros DON'T put a distro reference in the kernel name (on my
Ubuntu 8.04 system for example, uname -r gives "2.6.24-21-generic").
The best, most portable way to tell the distro name on a Linux system is
with lsb_release; any LSB-compliant distro will have this command. You
can see the options for details, but probably you want "lsb_release
--id" if all you want is the distribution vendor ("Red Hat" etc.) or
"lsb_release --description" if you want the distro version info.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.us
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist