Summary: | sysutils/etc_os-release: version number becomes obsolete after system updates | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Ting-Wei Lan <lantw44> |
Component: | Individual Port(s) | Assignee: | Tobias C. Berner <tcberner> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | alien.xupypr, emaste, ian.laurie, imp, lwhsu |
Priority: | --- | Flags: | tcberner:
maintainer-feedback+
|
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any | ||
URL: | https://reviews.freebsd.org/D22271 |
Description
Ting-Wei Lan
2019-07-03 07:51:50 UTC
Hit there Yeah, that is not great. But as long as that is not part of the base system there is no easy fix for this, other than following the rule to upgrade ports after a system upgrade. As that file is only needed to display some Operating System information in Qt and Gtk applications, a slight mismatch won't likely cause any problems other than confusion :) mfg Tobias (In reply to Tobias C. Berner from comment #1) Instead of shipping an os-release file directly in the package, do you think it will be better if it ships a script which can be used to update the os-release file? It can also include necessary files to update it during boot in a way similar to motd or drop a file into /usr/local/etc/cron.d to check and update it every hour. (In reply to Ting-Wei Lan from comment #2) That sounds like a bit of overkill for what we use it for at the moment. If stuff some day really requires it to be accurate, I think it should be shipped as part of the base system, and thereby be up to date through system upgrades. Since the /usr/local/etc/os-release file is provided by the package etc_os-release can't the package version number simply be bumped, with the corrected text, so that it updates with a "pkg update && pkg upgrade" like other packages? This has caused me a lot of grief because although I could confirm my kernel upgraded correctly, I thought there was a userland upgrade issue because this file didn't upgrade with the userland programs. I've been trying to hunt down what went wrong. I think this issue is rather serious. Is there a way to force the 11.3 version of etc_os-release package to replace the 11.2 version I have? (In reply to nixuser from comment #4) First of all, sorry for my long timeout here. The only proper way is to ship this file in base -- our "well, at least we have something now"-workaround to shipping this file unfortunately has this limitation. There is no good way to bump the pkg when needed (because how should the repo know when you updated your installation). [Well the is a very overkill version: the port could install an rc-file that updates the ${PREFIX}/etc/os_release on boot :) ] mfg Tobias No Problem. I created a script that can create the file manually as needed. In the hope someone else may find it useful here it is: #!/bin/sh # # This script will generate a new os-release file in the current directory. # Normally the file lives in /usr/local/etc/ on freeBSD systems. VERSION=`freebsd-version -u` VERSION_ID=`echo "$VERSION" | sed "s/^\([0-9\.]*\).*$/\1/"` echo "NAME=FreeBSD" > os-release echo "VERSION=$VERSION" >> os-release echo "VERSION_ID=$VERSION_ID" >> os-release echo "ID=freebsd" >> os-release echo "ANSI_COLOR=\"0;31\"" >> os-release echo "PRETTY_NAME=\"FreeBSD $VERSION\"" >> os-release echo "CPE_NAME=cpe:/o:freebsd:freebsd:$VERSION_ID" >> os-release echo "HOME_URL=https://freebsd.org/" >> os-release echo "BUG_REPORT_URL=https://bugs.freebsd.org" >> os-release This should be in base and generated on each boot... imp@ posted https://lists.freebsd.org/pipermail/freebsd-arch/2019-November/019774.html and created a patch: https://reviews.freebsd.org/D22271 A commit references this bug: Author: imp Date: Wed Nov 20 23:45:33 UTC 2019 New revision: 354922 URL: https://svnweb.freebsd.org/changeset/base/354922 Log: Create /etc/os-release file. Each boot, regenerate /var/run/os-release based on the currently running system. Create a /etc/os-release symlink pointing to this file (so that this doesn't create a new reason /etc can not be mounted read-only). This is compatible with what other systems do and is what the sysutil/os-release port attempted to do, but in an incomplete way. Linux, Solaris and DragonFly all implement this natively as well. The complete standard can be found at https://www.freedesktop.org/software/systemd/man/os-release.html Moving this to the base solves both the non-standard location problem with the port, as well as the lack of update of this file on system update. Bump __FreeBSD_version to 1300060 PR: 238953 Differential Revision: https://reviews.freebsd.org/D22271 Changes: head/etc/Makefile head/libexec/rc/rc.conf head/libexec/rc/rc.d/Makefile head/libexec/rc/rc.d/os-release head/share/man/man5/Makefile head/share/man/man5/os-release.5 head/sys/sys/param.h A commit references this bug: Author: tcberner Date: Sat Nov 23 20:19:23 UTC 2019 New revision: 518270 URL: https://svnweb.freebsd.org/changeset/ports/518270 Log: sysutils/etc-os-release: use the one provided by base if the system is new enough PR: 238953 Reviewed by: zeising Differential Revision: https://reviews.freebsd.org/D22488 Changes: head/devel/kf5-kcoreaddons/Makefile head/devel/qt5-core/Makefile head/sysutils/etc_os-release/Makefile head/sysutils/gnome-control-center/Makefile Committed Nov 23 20:19:23 UTC 2019 as r518270. ^Triage: assign to committer that resolved. |