Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use os-release instead of lsb_release #731

Closed
schlomo opened this issue Dec 4, 2015 · 11 comments
Closed

Use os-release instead of lsb_release #731

schlomo opened this issue Dec 4, 2015 · 11 comments
Assignees
Labels
enhancement Adaptions and new features fixed / solved / done minor bug An alternative or workaround exists
Milestone

Comments

@schlomo
Copy link
Member

schlomo commented Dec 4, 2015

I think that os-release is a good thing. All systemd based distros will ship that file and the content is well defined. We can pull all or at least most of our info from there as well.

I would therefore propose a completely different approach:

  • Write code to parse os-release properly, following all the hints from the man page.
  • On distros that ship os-release remove lsb* from the package dependencies.
  • Use os-release if lsb_release is not available.

The result will be a smooth migration with minimal impact. And it is upgrade safe as we don't run any code on package installation. And it also works when you run ReaR from source code :-)

See 613ba6f for full discussion

@schlomo schlomo added the bug The code does not do what it is meant to do label Dec 4, 2015
@schlomo schlomo added this to the Rear v1.18 milestone Dec 4, 2015
schlomo referenced this issue Dec 4, 2015
… via postinst script.

Improvements are welcome! See issues #566, #468, #696
gdha added a commit that referenced this issue Jan 21, 2016
…/os.conf file.

After some discussions we decided this was not the best option. However, a final solution
is not yet in sight (I'm afraid) for Debian related distributions.
See issue #731
@gdha gdha removed this from the Rear v1.18 milestone Jan 21, 2016
@gdha
Copy link
Member

gdha commented Jan 21, 2016

Milestone (1.18) removed. No idea when this one will be fixed.

@gdha
Copy link
Member

gdha commented Feb 22, 2016

Issue #778 is a related issue.

@gdha gdha closed this as completed in 22a7337 Feb 22, 2016
@gdha gdha reopened this Feb 22, 2016
@gdha
Copy link
Member

gdha commented Feb 22, 2016

referenced to the wrong issue - should have been #778. This issue has not been resolved yet!

@gdha gdha added this to the ReaR v2.2 milestone May 15, 2017
@schlomo
Copy link
Member Author

schlomo commented Jun 20, 2017

Just had a look again, with ID and ID_LIKE and VERSION_ID it contains IMHO all that we need to know.

@jsmeix would this be a way for more recent SUSE systems to avoid creating this os.conf during the RPM build process? The big big downside of build-time configuration is that a simple make install does not yield the same result as installing the package (hit me today on SLES10).

@jsmeix
Copy link
Member

jsmeix commented Jun 20, 2017

That build-time created os.conf file should definitely be dropped
for newer ReaR versions at least for SUSE because
since #1241
the SetOSVendorAndVersion function results "the right stuff"
at least for SUSE (regardless whether or not my current
implementation is really the best way to do it).

@schlomo
I fully agree that basically all build-time settings
have the problem that they may be wrong during run-time.

FYI:
I was hit by a missing os.conf when I used a git clone via

# git clone https://github.com/rear/rear.git

# cd rear

@gdha
Copy link
Member

gdha commented Jul 11, 2017

@schlomo on SLES10 I only find /etc/lsb-release and/or /etc/SuSE-release files, so that we still need to differentiate I guess

@gdha gdha modified the milestones: ReaR v2.3, ReaR v2.2 Jul 19, 2017
@gdha
Copy link
Member

gdha commented Jul 19, 2017

post-pone to release 2.3

@gdha gdha added enhancement Adaptions and new features minor bug An alternative or workaround exists and removed bug The code does not do what it is meant to do labels Oct 3, 2017
@gdha
Copy link
Member

gdha commented Nov 28, 2017

@jsmeix Could you paste from a few SLES versions the output of grep "ID" /etc/os-release please?

@jsmeix
Copy link
Member

jsmeix commented Nov 29, 2017

SLE10:

# cat /etc/issue | grep -v '^$'
Welcome to SUSE Linux Enterprise Server 10 SP4 (x86_64) ...

# grep "ID" /etc/os-release
grep: /etc/os-release: No such file or directory

SLE11

# cat /etc/issue | grep -v '^$'
Welcome to SUSE Linux Enterprise Desktop 11 SP3 (i586) ...

# grep "ID" /etc/os-release
grep: /etc/os-release: No such file or directory

SLE12:

# cat /etc/issue | grep -v '^$'
Welcome to SUSE Linux Enterprise Server 12 SP2 (x86_64) ...

# grep "ID" /etc/os-release
VERSION_ID="12.2"
ID="sles"

openSUSE Leap (is based on SLE12):

# cat /etc/issue | grep -v '^$'
Welcome to openSUSE Leap 42.1 ...

# grep "ID" /etc/os-release
VERSION_ID="42.1"
ID=opensuse
ID_LIKE="suse"

openSUSE Tumbleweed (continuously changing rolling release):

# cat /etc/issue | grep -v '^$'
Welcome to openSUSE Tumbleweed 20170620 ...

# grep "ID" /etc/os-release
ID=opensuse
ID_LIKE="suse"
VERSION_ID="20170620"

@gdha
Copy link
Member

gdha commented Nov 29, 2017

@schlomo @jsmeix @gozora If we would remove os.conf spec generation from the spec file would it be an option to generate one on the prep work-flow? The file would be re-generated each time then, but that would fix capturing OS upgrades (VERSION_ID that would change)?

@gdha
Copy link
Member

gdha commented Dec 11, 2017

Issue #1639 will pick up where we left this issue. This one can be closed.

@gdha gdha closed this as completed Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adaptions and new features fixed / solved / done minor bug An alternative or workaround exists
Projects
None yet
Development

No branches or pull requests

3 participants