Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157160921
D22271.id64082.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D22271.id64082.diff
View Options
Index: etc/Makefile
===================================================================
--- etc/Makefile
+++ etc/Makefile
@@ -57,6 +57,8 @@
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
+ ${INSTALL_SYMLINK} ../var/run/os-release \
+ ${DESTDIR}/etc/os-release
.if ${MK_UNBOUND} != "no"
if [ ! -e ${DESTDIR}/etc/unbound ]; then \
${INSTALL_SYMLINK} -T "package=unbound" \
Index: libexec/rc/rc.conf
===================================================================
--- libexec/rc/rc.conf
+++ libexec/rc/rc.conf
@@ -676,6 +676,9 @@
entropy_save_num="8" # Number of entropy cache files to save.
harvest_mask="511" # Entropy device harvests all but the very invasive sources.
# (See 'sysctl kern.random.harvest' and random(4))
+osrelease_enable="YES" # Update /var/run/os-release on boot (or NO)
+osrelease_file="/var/run/os-release" # File to update for os-release
+osrelease_perms="444" # default permission for os-release file.
dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
watchdogd_enable="NO" # Start the software watchdog daemon
watchdogd_flags="" # Flags to watchdogd (if enabled)
Index: libexec/rc/rc.d/Makefile
===================================================================
--- libexec/rc/rc.d/Makefile
+++ libexec/rc/rc.d/Makefile
@@ -77,6 +77,7 @@
nsswitch \
ntpdate \
${_opensm} \
+ os-release \
pf \
pflog \
pfsync \
Index: libexec/rc/rc.d/os-release
===================================================================
--- /dev/null
+++ libexec/rc/rc.d/os-release
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: os-release
+# REQUIRE: mountcritremote FILESYSTEMS
+# BEFORE: LOGIN
+
+. /etc/rc.subr
+
+: ${osrelease_file:=/var/run/os-release}
+: ${osrelease_perms:=444}
+name="osrelease"
+desc="Update ${osrelease_file}"
+start_cmd="osrelease_start"
+stop_cmd=":"
+
+osrelease_start()
+{
+ check_startmsgs && echo -n 'Updating ${osrelease_file} '
+ VERSION=$(freebsd-version -u)
+ VERSION_ID=${VERSION%%[^0-9.]*}
+ t=$(mktemp -t motd)
+ cat > "$t" <<-__EOF__
+ NAME=FreeBSD
+ VERSION=$VERSION
+ VERSION_ID=$VERSION_ID
+ ID=freebsd
+ ANSI_COLOR="0;31"
+ PRETTY_NAME="FreeBSD $VERSION"
+ CPE_NAME=cpe:/o:freebsd:freebsd:$VERSION_ID
+ HOME_URL=https://freebsd.org/
+ BUG_REPORT_URL=https://bugs.freebsd.org/
+__EOF__
+ install -C -o root -g wheel -m ${osrelease_perms} "$t" "${osrelease_file}"
+ rm -f "$t"
+ check_startmsgs && echo 'done.'
+}
+
+load_rc_config $name
+run_rc_command "$1"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 9:48 PM (2 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33329201
Default Alt Text
D22271.id64082.diff (2 KB)
Attached To
Mode
D22271: Create /etc/os-release file.
Attached
Detach File
Event Timeline
Log In to Comment