diff options
author | William Hubbs <williamh@gentoo.org> | 2021-09-24 18:05:36 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2021-09-24 18:05:36 -0500 |
commit | 57c250e24c70f8f9581860654cdec0d049345292 (patch) | |
tree | eb131a931c6f082b34b3da6ac0cdb514d7648f77 | |
parent | create /etc/gentoo-release here instead of in the ebuild (diff) | |
download | baselayout-57c250e24c70f8f9581860654cdec0d049345292.tar.gz baselayout-57c250e24c70f8f9581860654cdec0d049345292.tar.bz2 baselayout-57c250e24c70f8f9581860654cdec0d049345292.zip |
generate /usr/lib/os-release dynamically
This allows the os name and version to be dynamic.
Bug: https://bugs.gentoo.org/788190
Signed-off-by: William Hubbs <williamh@gentoo.org>
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | etc.BSD/os-release | 7 | ||||
-rw-r--r-- | etc.Linux/os-release | 7 | ||||
-rwxr-xr-x | make_os_release | 15 |
4 files changed, 18 insertions, 14 deletions
@@ -66,6 +66,9 @@ install: echo "Gentoo Base System release ${PV}" > ${DESTDIR}/etc/gentoo-release $(INSTALL_DIR) $(DESTDIR)/usr/share/baselayout cp -pPR share.$(OS)/* $(DESTDIR)/usr/share/baselayout/ + $(INSTALL_DIR) $(DESTDIR)/usr/lib + ./make_os_release $(OS) $(PV) > $(DESTDIR)/usr/lib/os-release + ln -snf ../usr/lib/os-release ${DESTDIR}/etc/os-release layout-dirs: # Create base filesytem layout diff --git a/etc.BSD/os-release b/etc.BSD/os-release deleted file mode 100644 index d1d93391..00000000 --- a/etc.BSD/os-release +++ /dev/null @@ -1,7 +0,0 @@ -NAME=Gentoo -ID=gentoo -PRETTY_NAME="Gentoo/BSD" -ANSI_COLOR="1;32" -HOME_URL="https://www.gentoo.org/" -SUPPORT_URL="https://www.gentoo.org/support/" -BUG_REPORT_URL="https://bugs.gentoo.org/" diff --git a/etc.Linux/os-release b/etc.Linux/os-release deleted file mode 100644 index b8274bc8..00000000 --- a/etc.Linux/os-release +++ /dev/null @@ -1,7 +0,0 @@ -NAME=Gentoo -ID=gentoo -PRETTY_NAME="Gentoo Linux" -ANSI_COLOR="1;32" -HOME_URL="https://www.gentoo.org/" -SUPPORT_URL="https://www.gentoo.org/support/" -BUG_REPORT_URL="https://bugs.gentoo.org/" diff --git a/make_os_release b/make_os_release new file mode 100755 index 00000000..f764309c --- /dev/null +++ b/make_os_release @@ -0,0 +1,15 @@ +#!/bin/sh +if [ -z "${1}" ] || [ -z "${2}" ]; then + printf 'usage: %s [os] [version]' "${0##*/}" >&2 + exit 1 +fi +cat <<EOF +NAME=Gentoo +ID=gentoo +PRETTY_NAME="Gentoo ${1}" +ANSI_COLOR="1;32" +HOME_URL="https://www.gentoo.org/" +SUPPORT_URL="https://www.gentoo.org/support/" +BUG_REPORT_URL="https://bugs.gentoo.org/" +VERSION_ID="${2}" +EOF |