Re: Determine system ver (Debian vs. other Linuxes) at runtime?



Matt England wrote:
> In my cross-platform-programming quests, I'm looking for ways to
> determine via my Makefiles which system/platform said build process is
> running on, so I can automatically pull in the correct libraries, build
> to the correct target directories, use the correct platform-specific
> code, etc.
>
> Back in the "old days" for me (mid 1990s), the Unix builds I was making
> were mostly Solaris, HP-UX, Irix, Digital-Unix, AIX....etc etc. In such
> cases, 'uname -rs' all had distinctly different outputs.
>
> Now, 'uname -rs' (and the newer 'uname -o') all say "Linux" or
> "GNU/Linux" for all the Linux distributions.
>
> So I'm left with figuring out much harder ways to tell system revs
> apart. I'm guessing I'm going to have to make an application which does
> nothing but evaluate a system and report it's variant (Redhat vs SuSE
> vs. Debian) and revision (Debian Woody/3.0, Sarge/3.1, etc).
>
> Thing is, I don't even know where to start. Will some uname-based
> analysis work by itself? Haven't seen anything yet that will
> distinguish between the different Linux distros. I suspect there will
> be other cmds/APIs I can use to do stuff. I'm looking for suggestions.
>
> -Matt
>
>
G'day

Have you tried to use the contents of /etc/issue ? Typically for
RedHat/Fedora this will have the release in it, and (for Sarge at least)
this is also the case for Debian. I've done a dist-upgrade on this box
and the file shows the correct version number at least...

user@debian:~# cat /etc/issue
Debian GNU/Linux 3.1 \n \l

Regards,

Russell


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Determine system ver (Debian vs. other Linuxes) at runtime?
    ... determine via my Makefiles which system/platform said build process is running on, so I can automatically pull in the correct libraries, build to the correct target directories, use the correct platform-specific code, etc. ... nothing but evaluate a system and report it's variant (Redhat vs SuSE ... if Debian then also check /etc/apt/sources.list for the right distribution. ...
    (Debian-User)
  • Redhat 9 install going comatose on me
    ... I just replaced my Windows XP OS with Redhat 9, ... it's working pretty darn well. ... To unsubscribe send: ...
    (RedHat)
  • Re: OT: Linux or Cisco
    ... from LPI and RedHat. ... I have some 2 years' Linux ... experience but am equally interested in CCNA/networking. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: sound problem with my laptop
    ... Metan ... > This is for redhat but it might be some help. ... To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org ...
    (Debian-User)
  • Re: Best File System for partitions over 600GB
    ... Tell that to our admins who run redhat and suse. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)