$ -weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=web-template \ --setup-machine-id
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=web-template \ --setup-machine-id
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=web-template \ --setup-machine-id
-weight: 600;">sudo cat /mnt/golden-root/etc/locale.conf
-weight: 600;">sudo cat /mnt/golden-root/etc/hostname
-weight: 600;">sudo cat /mnt/golden-root/etc/machine-id
-weight: 600;">sudo readlink /mnt/golden-root/etc/localtime
-weight: 600;">sudo cat /mnt/golden-root/etc/locale.conf
-weight: 600;">sudo cat /mnt/golden-root/etc/hostname
-weight: 600;">sudo cat /mnt/golden-root/etc/machine-id
-weight: 600;">sudo readlink /mnt/golden-root/etc/localtime
-weight: 600;">sudo cat /mnt/golden-root/etc/locale.conf
-weight: 600;">sudo cat /mnt/golden-root/etc/hostname
-weight: 600;">sudo cat /mnt/golden-root/etc/machine-id
-weight: 600;">sudo readlink /mnt/golden-root/etc/localtime
LANG=en_US.UTF-8
web-template
3d6f5d6d8b714d55a78f55c9e08b0d47
../usr/share/zoneinfo/UTC
LANG=en_US.UTF-8
web-template
3d6f5d6d8b714d55a78f55c9e08b0d47
../usr/share/zoneinfo/UTC
LANG=en_US.UTF-8
web-template
3d6f5d6d8b714d55a78f55c9e08b0d47
../usr/share/zoneinfo/UTC
-weight: 600;">sudo systemd-firstboot \ --image=./debian-golden.raw \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=app-template \ --setup-machine-id
-weight: 600;">sudo systemd-firstboot \ --image=./debian-golden.raw \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=app-template \ --setup-machine-id
-weight: 600;">sudo systemd-firstboot \ --image=./debian-golden.raw \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=app-template \ --setup-machine-id
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --setup-machine-id
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --setup-machine-id
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --setup-machine-id
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --reset
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --reset
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --reset
openssl passwd -6
openssl passwd -6
openssl passwd -6
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --root-password-hashed='$6$rounds=10000$REPLACE_WITH_REAL_HASH'
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --root-password-hashed='$6$rounds=10000$REPLACE_WITH_REAL_HASH'
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --root-password-hashed='$6$rounds=10000$REPLACE_WITH_REAL_HASH'
-weight: 600;">sudo ls -l /mnt/golden-root/etc/passwd /mnt/golden-root/etc/shadow
-weight: 600;">sudo ls -l /mnt/golden-root/etc/passwd /mnt/golden-root/etc/shadow
-weight: 600;">sudo ls -l /mnt/golden-root/etc/passwd /mnt/golden-root/etc/shadow
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --copy-locale \ --copy-timezone
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --copy-locale \ --copy-timezone
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --copy-locale \ --copy-timezone
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --hostname=web-prod-template \ --timezone=Europe/Berlin \ --force
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --hostname=web-prod-template \ --timezone=Europe/Berlin \ --force
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --hostname=web-prod-template \ --timezone=Europe/Berlin \ --force
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=template-base
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=template-base
-weight: 600;">sudo systemd-firstboot \ --root=/mnt/golden-root \ --locale=en_US.UTF-8 \ --timezone=UTC \ --hostname=template-base
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --reset
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --reset
-weight: 600;">sudo systemd-firstboot --root=/mnt/golden-root --reset
-weight: 600;">sudo test -x /mnt/golden-root/bin/bash && echo ok
-weight: 600;">sudo test -x /mnt/golden-root/bin/bash && echo ok
-weight: 600;">sudo test -x /mnt/golden-root/bin/bash && echo ok - setting locale, timezone, and hostname in an offline image
- generating a fresh machine ID correctly
- pre-seeding root access without putting a plaintext password on the command line
- resetting first-boot state when you want an image to ask again
- verifying what changed before you ship the image - it understands both offline root directories and disk images
- it knows which files correspond to each setting
- it avoids overwriting existing values unless you explicitly ask it to
- it can generate a fresh machine ID for an offline image
- it has a supported reset workflow for returning an image to first-boot state - locale and message locale
- keyboard map
- kernel command line used by kernel--weight: 500;">install
- root password and root shell - writes /mnt/golden-root/etc/locale.conf
- creates the /mnt/golden-root/etc/localtime symlink
- writes /mnt/golden-root/etc/hostname
- creates /mnt/golden-root/etc/machine-id with a random ID - local lab image built on a trusted workstation, where host timezone and locale are intentional - CI runners or shared build hosts, where inherited settings may vary silently - Install packages and application bits.
- Set stable defaults that should be common everywhere.
- Leave machine-specific values for first-boot time. - hostnamectl
- timedatectl - systemd upstream manual, systemd-firstboot(1): https://www.freedesktop.org/software/systemd/man/latest/systemd-firstboot.html
- Debian manpage mirror for systemd-firstboot(1): https://manpages.debian.org/bookworm/systemd/systemd-firstboot.1.en.html
- ArchWiki overview: https://wiki.archlinux.org/title/Systemd-firstboot