[opensuse-factory] How to reliably check for SUSE distribution?

DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place. DKMS needs to know distribution to decide e.g. whether it needs to do kernel source preparation or it can skip it. TIA -andrey -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

Andrey Borzenkov wrote:
DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place.
I would use /etc/SuSE-release, there are plenty of third-party scripts using that. -- Per Jessen, Zürich (11.0°C) http://www.dns24.ch/ - free DNS hosting, made in Switzerland. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On Sunday 2012-11-25 10:14, Per Jessen wrote:
Andrey Borzenkov wrote:
DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place.
I would use /etc/SuSE-release, there are plenty of third-party scripts using that.
/etc/os-release -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

Jan Engelhardt wrote:
On Sunday 2012-11-25 10:14, Per Jessen wrote:
Andrey Borzenkov wrote:
DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place.
I would use /etc/SuSE-release, there are plenty of third-party scripts using that.
/etc/os-release
Haha, yes, I guess both of those then :-) older systems won't have /etc/os-release. -- Per Jessen, Zürich (12.2°C) http://www.dns24.ch/ - free DNS hosting, made in Switzerland. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On 11/25/2012 10:11 AM, Andrey Borzenkov wrote:
DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place.
DKMS needs to know distribution to decide e.g. whether it needs to do kernel source preparation or it can skip it.
Use "lsb-release -d", this should work on other distros as well, Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

On 11/25/2012 10:22 AM, Andreas Jaeger wrote:
On 11/25/2012 10:11 AM, Andrey Borzenkov wrote:
DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place.
DKMS needs to know distribution to decide e.g. whether it needs to do kernel source preparation or it can skip it.
Use "lsb-release -d", this should work on other distros as well,
Andreas
And starting with 12.1, there's also /etc/os-release - works on all distributions that use systemd, Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org

Andreas Jaeger wrote:
On 11/25/2012 10:11 AM, Andrey Borzenkov wrote:
DKMS currently is using /etc/SuSEconfig to detect whether it is running on SUSE. As I understand SuSEconfig is scheduled to be removed entirely. What is the proper way to detect distribution? I would use /etc/SuSE-release, but may be there were reasons to use SuSEconfig in the first place.
DKMS needs to know distribution to decide e.g. whether it needs to do kernel source preparation or it can skip it.
Use "lsb-release -d", this should work on other distros as well,
It's not always installed. E.g. not in the minimum text-mode selection. -- Per Jessen, Zürich (12.1°C) http://www.dns24.ch/ - free DNS hosting, made in Switzerland. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (4)
-
Andreas Jaeger
-
Andrey Borzenkov
-
Jan Engelhardt
-
Per Jessen