Prevent systemd from starting all services on first-boot

This commit is contained in:
Gunjan Gupta 2024-02-11 00:29:42 +05:30
parent 0a784cb9b7
commit 6f1b675591

View File

@ -234,8 +234,11 @@ function create_new_rootfs_cache_via_debootstrap() {
run_host_command_logged echo "nameserver $NAMESERVER" ">" "${SDCARD}"/etc/resolv.conf
# Remove `machine-id` (https://www.freedesktop.org/software/systemd/man/machine-id.html)
# Note: This will mark machine `firstboot`
run_host_command_logged echo "uninitialized" ">" "${SDCARD}/etc/machine-id"
# Note: As we don't use systemd-firstboot.service functionality, we make it empty to prevent services
# from starting up automatically on first boot on system version 2.50+. If someone is using the same,
# please reinitialize this to uninitialized. Do note that systemd will start all services then by
# default and that has to be handled in by setting system presets.
run_host_command_logged echo -n ">" "${SDCARD}/etc/machine-id"
run_host_command_logged rm -v "${SDCARD}/var/lib/dbus/machine-id"
# Mask `systemd-firstboot.service` which will prompt locale, timezone and root-password too early.