Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115444700
D37722.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
D37722.diff
View Options
diff --git a/etc/Makefile b/etc/Makefile
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -59,6 +59,8 @@
${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \
${DESTDIR}/etc/os-release
+ ${INSTALL_SYMLINK} -T "package=runtime" ../var/db/machine-id \
+ ${DESTDIR}/etc/machine-id
.if ${MK_UNBOUND} != "no"
if [ ! -e ${DESTDIR}/etc/unbound ]; then \
${INSTALL_SYMLINK} -T "package=unbound" \
diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -694,6 +694,9 @@
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.
+machine_id_enable="YES" # Create /var/db/machine-id on boot if missing (or NO).
+machine_id_file="/var/db/machine-id" # File to update for machine-id.
+machine_id_perms="444" # Default permissions for machine-id 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)
diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile
--- a/libexec/rc/rc.d/Makefile
+++ b/libexec/rc/rc.d/Makefile
@@ -52,6 +52,7 @@
local \
localpkg \
lockd \
+ machine_id \
mixer \
motd \
mountcritlocal \
diff --git a/libexec/rc/rc.d/machine_id b/libexec/rc/rc.d/machine_id
new file mode 100644
--- /dev/null
+++ b/libexec/rc/rc.d/machine_id
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: machine_id
+# REQUIRE: mountcritremote FILESYSTEMS
+# BEFORE: LOGIN
+
+. /etc/rc.subr
+
+: ${machine_id_file:=/var/db/machine-id}
+: ${machine_id_perms:=444}
+name="machine_id"
+desc="Update ${machine_id_file}"
+rcvar="machine_id_enable"
+start_cmd="machine_id_start"
+stop_cmd=":"
+
+
+machine_id_start()
+{
+ if [ ! -f ${machine_id_file} ] ; then
+ startmsg -n "Creating ${machine_id_file} "
+ t=$(mktemp -t machine-id)
+ /bin/uuidgen -r -o $t
+ install -C -o root -g wheel -m ${machine_id_perms} "$t" "${machine_id_file}"
+ rm -f "$t"
+ startmsg 'done.'
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/sys/sys/param.h b/sys/sys/param.h
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -76,7 +76,7 @@
* cannot include sys/param.h and should only be updated here.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1400075
+#define __FreeBSD_version 1400076
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 24, 10:00 PM (17 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17767825
Default Alt Text
D37722.diff (2 KB)
Attached To
Mode
D37722: Add new rc: machine_id to generate /etc/machine-id
Attached
Detach File
Event Timeline
Log In to Comment