distro-files: generate machine-id on first boot

This commit is contained in:
Matheus
2026-09-22 02:01:33 -03:00
parent 42e5974e02
commit 0fcb7c0be1
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -1,4 +1,15 @@
if [ ! -f "/var/lib/.first_boot_done" ] ; then
if [ ! -s /etc/machine-id ]; then
machine_id=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n')
if [ "${#machine_id}" -ne 32 ]; then
echo "Failed to generate /etc/machine-id" >&2
exit 1
fi
printf '%s\n' "$machine_id" > /etc/machine-id
chmod 444 /etc/machine-id
fi
mkdir -p /var/log
xbps-reconfigure -a > /var/log/first_install_reconfigure.log
+1 -1
View File
@@ -1,5 +1,5 @@
name=distro-files
revision=8
revision=9
from_source=distro-files
package() {