Page MenuHomeFreeBSD

D38811.id.diff
No OneTemporary

D38811.id.diff

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -52,6 +52,9 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20230308: machine-id merged into hostid_save
+OLD_FILES+=etc/rc.d/machine-id
+
# 20230306: remove tzsetwall(3)
OLD_FILES+=usr/share/man/man3/tzsetwall.3.gz
diff --git a/etc/Makefile b/etc/Makefile
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -59,8 +59,6 @@
${_+_}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
@@ -138,6 +138,7 @@
hostid_enable="YES" # Set host UUID.
hostid_file="/etc/hostid" # File with hostuuid.
hostid_uuidgen_flags="-r" # Flags to uuidgen.
+machine_id_file="/etc/machine-id" # File with machine-id.
nisdomainname="NO" # Set to NIS domain if using NIS (or NO).
dhclient_program="/sbin/dhclient" # Path to dhcp client program.
dhclient_flags="" # Extra flags to pass to dhcp client.
@@ -696,9 +697,6 @@
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
@@ -49,7 +49,6 @@
local \
localpkg \
lockd \
- machine_id \
mixer \
motd \
mountcritlocal \
diff --git a/libexec/rc/rc.d/hostid_save b/libexec/rc/rc.d/hostid_save
--- a/libexec/rc/rc.d/hostid_save
+++ b/libexec/rc/rc.d/hostid_save
@@ -15,20 +15,32 @@
stop_cmd=":"
rcvar="hostid_enable"
+hostid_machine_id()
+{
+ local IFS
+
+ IFS=-
+ set -- ${current_hostid}
+ IFS=
+ current_machine_id=$*
+}
+
hostid_save()
{
current_hostid=`$SYSCTL_N kern.hostuuid`
- if [ -r ${hostid_file} ]; then
- read saved_hostid < ${hostid_file}
- if [ ${saved_hostid} = ${current_hostid} ]; then
- exit 0
- fi
+ read saved_hostid 2>/dev/null < ${hostid_file}
+ if [ "${saved_hostid}" != "${current_hostid}" ]; then
+ echo "${current_hostid}" > ${hostid_file} ||
+ warn "could not store hostuuid in ${hostid_file}."
fi
- echo ${current_hostid} > ${hostid_file}
- if [ $? -ne 0 ]; then
- warn "could not store hostuuid in ${hostid_file}."
+ hostid_machine_id
+
+ read saved_machine_id 2>/dev/null < ${machine_id_file}
+ if [ "${saved_machine_id}" != "${current_machine_id}" ]; then
+ echo "${current_machine_id}" > ${machine_id_file} ||
+ warn "could not store hostuuid in ${machine_id_file}."
fi
}
diff --git a/libexec/rc/rc.d/machine_id b/libexec/rc/rc.d/machine_id
deleted file mode 100644
--- a/libexec/rc/rc.d/machine_id
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/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 -c -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 1400081
+#define __FreeBSD_version 1400082
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 2:09 AM (9 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14765549
Default Alt Text
D38811.id.diff (4 KB)

Event Timeline