+ PACKAGES += $(subst ${comma_},${space_},${packages})
+endif
+
+export DEBCONF RPICONFIG
+
+define DEBCONF :=
+${DEBCONF}
+
+keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
+keyboard-configuration keyboard-configuration/variant select English (US) - English (Macintosh)
+
+console-setup console-setup/charmap47 select UTF-8
+console-setup console-setup/codeset47 select # Latin1 and Latin5 - western Europe and Turkic languages
+endef
+
+ifndef rpivmem
+ rpivmem := 128
+endif
+
+define RPICONFIG :=
+${RPICONFIG}
+
+dtoverlay=vc4-fkms-v3d,cma-${rpivmem}
+endef
+
+.PHONY: _debconf_selections _raspberry_config _keyboard
+_install: _debconf_selections
+_debconf_selections: ${SYSROOT}
+ printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
+
+ifdef keyboard
+ _config: _keyboard
+endif
+_keyboard: ${CFGROOT}
+ -sed -Ei 's;^XKBLAYOUT=.*$$;XKBLAYOUT="${keyboard}";;' "$${CFGROOT}/etc/default/keyboard"
+
+ifdef raspi
+ _config: _raspberry_config _raspberry_initrd
+endif
+
+_raspberry_config: ${CFGROOT}
+ printf '%s\n' "$${RPICONFIG}" >>"$${CFGROOT}/boot/config.txt"
+
+_raspberry_initrd: ${CFGROOT}
+ printf '${fstype}\n' >>"$${CFGROOT}/etc/initramfs-tools/modules"
+ k="$$(printf '%s\n' "$${CFGROOT}"/lib/modules/* |sed 's;^.*/;;; /-/d')"; \
+ [ "${kernel}" ] && k="${kernel}"; \
+ chroot $${CFGROOT} update-initramfs -c -k "$${k##*/}"; \
+ printf 'initramfs initrd.img-%s\n' "$${k##*/}" >>"$${CFGROOT}/boot/config.txt"
+
+.PHONY: _timezone _locales
+
+ifdef timezone
+ export timezone
+ PACKAGES += tzdata
+ _config: _timezone