Identifying a system as a LMDE

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Identifying a system as a LMDE

Postby bronto on Mon Feb 10, 2014 6:00 pm

Hi all

I am a CFEngine user (see http://cfengine.com/community). From the point of view of the cfengine agent, a "normal" Mint is indistinguishable from an Ubuntu system, and an LMDE is indistinguishable from a Debian testing. I have opened a bug with them (see https://cfengine.com/dev/issues/2278), and we are trying to find a way for the agent to correctly identify a system as a Mint system in general, and as an LMDE in particular.

The information is contained in /etc/lsb-release, however we are not sure if that file is always present in a Mint system, even when the lsb-release package is not installed. Nor we know if the same information can be found elsewhere in the system. I suggested we could look for "typical" mint packages via dpkg, but it's an heavyweight way to find that information out -- just imagine the agent running a dpkg --list every five minutes..

Can any of the Mint people here help us find a "lightweight" way to correctly identify Mint, and LMDE in particular?

Thanks in advance, ciao!
-- bronto
bronto
Level 1
Level 1
 
Posts: 6
Joined: Mon Feb 10, 2014 5:42 pm

Linux Mint is funded by ads and donations.
 

Re: Identifying a system as a LMDE

Postby Monsta on Tue Feb 11, 2014 3:32 am

Try these files:
Code: Select all
/etc/issue
/etc/os-release
Monsta
Level 8
Level 8
 
Posts: 2403
Joined: Fri Aug 19, 2011 3:46 am

Re: Identifying a system as a LMDE

Postby bronto on Tue Feb 11, 2014 4:18 am

Monsta wrote:Try these files:
Code: Select all
/etc/issue
/etc/os-release


/etc/issue is usually a file the users fiddle with, so not really suitable for OS detection. /etc/os-release seems a better fit though, thanks!
bronto
Level 1
Level 1
 
Posts: 6
Joined: Mon Feb 10, 2014 5:42 pm

Re: Identifying a system as a LMDE

Postby bronto on Mon Feb 17, 2014 5:08 pm

Unfortunately I found out that /etc/os-release is not particularly useful in a "standard" Linux Mint:

Code: Select all
NAME="Ubuntu"
VERSION="12.10, Quantal Quetzal"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu quantal (12.10)"
VERSION_ID="12.10"


Any other file that is sure to always be in the filesystem and identifies a system as a standard Linux Mint (ubuntu-derived)?

Thanks
-- M
bronto
Level 1
Level 1
 
Posts: 6
Joined: Mon Feb 10, 2014 5:42 pm

Re: Identifying a system as a LMDE

Postby caribriz on Mon Feb 17, 2014 8:09 pm

Hi,

What about /etc/linuxmint/info

In an LMDE install it says:
Code: Select all
RELEASE=1
CODENAME=debian
EDITION="Cinnamon 32-bit"
DESCRIPTION="LMDE Cinnamon Edition"
DESKTOP=Gnome
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_debian_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_debian.php
USER_GUIDE_URL=http://www.linuxmint.com/documentation.php
GRUB_TITLE=LMDE Cinnamon 32-bit


and in an LM13 Cinnamon install it says:
Code: Select all
RELEASE=13
CODENAME=maya
EDITION="Cinnamon 32-bit"
DESCRIPTION="Linux Mint 13 Maya"
DESKTOP=Gnome
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_maya_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_maya.php
USER_GUIDE_URL=http://www.linuxmint.com/documentation.php
GRUB_TITLE=Linux Mint 13 Cinnamon 32-bit


:?:
Image
Desktop: C2D E6400 / Asus P5LD2SE / 2GB ram / Asus GeForce 210 / 320GB (WinXP) & 1TB (Mint - various)
Laptop: Asus A53E-SX1455V - i5 2450M / 4GB ram / Intel HD 3000 / 500GB (Win7/Mint 17 Cinnamon)
caribriz
Level 5
Level 5
 
Posts: 867
Joined: Mon Nov 28, 2011 7:43 am

Re: Identifying a system as a LMDE

Postby bronto on Tue Feb 18, 2014 3:55 am

caribriz wrote:What about /etc/linuxmint/info


This is GREAT! Thanks, I'll start working on this immediately!!!

Thanks (also on behalf of the CFEngine community)
-- bronto
bronto
Level 1
Level 1
 
Posts: 6
Joined: Mon Feb 10, 2014 5:42 pm

Re: Identifying a system as a LMDE

Postby Monsta on Tue Feb 18, 2014 3:59 am

Note that this file is present only if any of mint-info-* packages is installed.
Monsta
Level 8
Level 8
 
Posts: 2403
Joined: Fri Aug 19, 2011 3:46 am

Re: Identifying a system as a LMDE

Postby kurotsugi on Tue Feb 18, 2014 4:02 am

there are several way to describe what linux we're using. aside what monsta have mentioned we also have /etc/lsb-release which can be called via 'lsb_release -a'. this command also have becomes standard on every linux distro. the /etc/linuxmint/info doesn't work if mintsystem got uninstalled. that file only work as a reference when /etc/lsb-release got modified.
kurotsugi
Level 5
Level 5
 
Posts: 891
Joined: Fri Jan 25, 2013 3:54 am

Re: Identifying a system as a LMDE

Postby bronto on Tue Feb 18, 2014 4:17 am

Monsta wrote:Note that this file is present only if any of mint-info-* packages is installed.


Thanks, that's an important info.

The best thing would be something on the system that is always there, even on a very basic install of Mint, and that is either unique by itself (that file is there only on Mint, it's not found on other distros), or it's unique in its content (the content of the file tell that we are on Mint).

Is there anything like that in Mint? I understand that neither /etc/lsb-release nor /etc/linuxmint/info satisfy the prerequisite of being there on any type of installation.

Thanks
-- bronto
bronto
Level 1
Level 1
 
Posts: 6
Joined: Mon Feb 10, 2014 5:42 pm

Linux Mint is funded by ads and donations.
 

Return to Other Topics

Who is online

Users browsing this forum: No registered users and 2 guests