2 ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 3 ))")
5 PACKAGES += btrfs-tools bzip2 ca-certificates cron deborphan firmware-linux-free gzip htop ifupdown iputils-ping irqbalance isc-dhcp-client less make net-tools nmap ntpdate openssh-client psmisc rsync sshfs sudo traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip
8 PACKAGES += $(subst ${comma_},${space_},${packages})
11 export DEBCONF RPICONFIG
16 keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
17 keyboard-configuration keyboard-configuration/variant select English (US) - English (Macintosh)
23 dtoverlay=vc4-fkms-v3d,cma-128
26 .PHONY: _debconf_selections _raspberry_config
27 _install: _debconf_selections
28 _debconf_selections: ${SYSROOT}
29 printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
32 _config: _raspberry_config
34 _raspberry_config: ${CFGROOT}
35 printf '%s\n' "$${RPICONFIG}" >>"$${CFGROOT}/boot/config.txt"
37 .PHONY: _timezone _locales
51 printf '%s\n' "$${timezone}" >"$${CFGROOT}/etc/timezone"
52 ln -sf /usr/share/zoneinfo/"$${timezone}" "$${CFGROOT}/etc/localtime"
55 for l in $(subst ${comma_},${space_},${locales}); do \
56 printf '%s %s\n' "$${l}" "$${l#*.}"; \
57 done >"$${CFGROOT}/etc/locale.gen"
58 printf 'LANG=%s\n' "$(firstword $(subst ${comma_},${space_},${locales}))" >"$${CFGROOT}/etc/default/locale"
59 chroot "$${CFGROOT}" locale-gen
61 .PHONY: _rootpass _users _hostname
83 chroot "$${CFGROOT}" usermod -p "$$(openssl passwd "$${rootpass}")" root
86 ssh-keygen -N '' -f "$${rootkey}"
88 _rootkey: ${CFGROOT} ${rootkey}.pub
89 mkdir -m 700 "$${CFGROOT}/root/.ssh/"
90 cp "$${rootkey}.pub" "$${CFGROOT}/root/.ssh/authorized_keys"
93 for u in $(subst ${comma_},${space_},${users}); do \
94 chroot "$${CFGROOT}" useradd -m -s /bin/bash -p "$$(openssl passwd "")" "$$u"; \
98 printf '%s\n' "$${hostname}" >"$${CFGROOT}/etc/hostname"
101 _config: ${CFGROOT}/etc/network/interfaces.d/wifi
104 ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
105 printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
106 printf ' wpa-ssid "%s"\n wpa-psk "%s"\n' "$$wifi" "$$wifipass" >>$@
109 ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
110 printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
111 printf ' wireless-ssid "%s"\n' "$$wifi" >>$@