0.3.2: register boot integration in config.xml (loaderconf + rc postinit); stop editing generated files

This commit is contained in:
Claw committed 2026-11-17 20:30:40 +01:00
1 parent 29365ce649
commit 5bdd3c82c6
5 files changed
+157 -18

No files matched your search

+8 -16
View File
@@ -111,25 +111,17 @@ ensure_kmods() {
}
ensure_loader_conf() {
# /boot/loader.conf.local is generated from /conf/config.xml at boot, so
# writing it here would not survive a reboot. Only report the state; the
# entries are registered through the GUI (Configuration > Register).
conf="/boot/loader.conf.local"
changed=0
if [ ! -f "${conf}" ]; then
touch "${conf}" || { log "WARNING: cannot create ${conf}"; return 0; }
fi
for entry in 'vmm_load="YES"' 'nmdm_load="YES"'; do
key=${entry%%=*}
if ! grep -q "^${key}=" "${conf}" 2>/dev/null; then
if [ "${changed}" -eq 0 ]; then
cp -p "${conf}" "${conf}.vmmngr.bak" 2>/dev/null || true
fi
printf '%s\n' "${entry}" >> "${conf}"
log "added ${entry} to ${conf}"
changed=1
for key in vmm_load nmdm_load; do
if grep -q "^${key}=" "${conf}" 2>/dev/null; then
log "loader.conf.local: ${key} present"
else
log "HINT: ${key} missing - open Extensions > VM Manager > Configuration and press 'Register in config.xml'"
fi
done
if [ "${changed}" -eq 1 ]; then
log "NOTE: ${conf} changed - modules are loaded at next boot; kldload covers the current session"
fi
}
# ---------------------------------------------------------------- symlinks