subvol=/mnt/bookworm
release=bookworm
+mainuser=...
+fsuid=...
+
define SOURCES :=
deb http://deb.debian.org/debian bullseye main
deb http://deb.debian.org/debian ${release} main
# packages += 0ad flare-game openarena
## Hostname for the generated machine
-hostname=debian
+hostname=${mainuser}-debian
## Root password will be salted and encrypted in image
# rootpass=topsecret
## Comma separated list of users to be set up.
## User logins will start out with an empty password
## If the live module is in use, users will also be added to the sudo group
-users=adam,steve
+# users=adam,steve
+users=${mainuser}
## Wifi configuration, if a Wifi password is given, WPA encryption will be used
## without the password, the system will try to connect to an open wifi
## can be choosen to install packages from
## See modules/approx.mk if you need more flexibility
# approx=http://localhost:9000/debian
+
+CFGROOT = cfg_root/
+
+.PHONY: _fstab _sudo
+_target: _fstab _sudo
+
+_sudo: _config cfg_root
+ chroot cfg_root adduser ${mainuser} sudo
+
+_fstab: _config cfg_root
+ mkdir -p cfg_root/mnt/fsroot
+ printf '%s 0 0\n' \
+ 'UUID=${fsuid} / btrfs auto,rw,subvol=bookworm' \
+ 'UUID=${fsuid} /home btrfs auto,rw,subvol=home' \
+ 'UUID=${fsuid} /mnt/fsroot btrfs auto,rw,nofail' \
+ 'LABEL=SYSTEM /boot/efi vfat auto,ro,nofail' \
+ 'LABEL=SWAP swap swap sw,nofail' \
+ >cfg_root/etc/fstab