DEFAULT: _target
nul_:=
-comma_:=,
-space_:=${nul_} ${nul_}
+comma_:= ,
+space_:= ${nul_} ${nul_}
.PHONY: clean .FORCE
.PHONY: _config_raspi _partition_raspi
include modules/default.mk
ifdef modules
-include $(addsuffix .mk, $(addprefix modules/, $(subst ${comma_},${space},${modules})))
+include $(addsuffix .mk, $(addprefix modules/, $(subst ${comma_},${space_},${modules})))
endif
ifeq "${ARCH}" "amd64"
cp keys/*.gpg "$@"
_install: ${SYSROOT} _aptkeys _norecommends
- printf %s "$${SOURCES}" >"$${SYSROOT}/etc/apt/sources.list"
+ printf '%s\n' "$${SOURCES}" >"$${SYSROOT}/etc/apt/sources.list"
-cp /etc/resolv.conf "$${SYSROOT}/etc/"
-chroot "$${SYSROOT}" sh -c 'apt-mark showmanual |xargs apt-mark auto'
-chroot "$${SYSROOT}" apt-get update
.PHONY: _common_config
_config: _common_config
-_common_config: ${CFGROOT} cfg_seed/
+_common_config: ${CFGROOT}
ln -sf /dev/null "$${CFGROOT}/etc/systemd/network/99-default.link"
printf 'LABEL=FSROOT / ext4 auto,nofail,rw 0 0\nLABEL=BOOT /boot vfat auto,nofail,ro 0 0\n' \
>"$${CFGROOT}/etc/fstab"
--- /dev/null
+define approx_original_sources :=
+${SOURCES}
+endef
+export approx_original_sources
+
+ifdef approx
+
+BOOTSTRAP := ${approx}
+define SOURCES =
+deb ${approx} stretch main
+endef
+
+else ifdef raspi
+
+BOOTSTRAP := http://localhost/raspbian
+define SOURCES =
+deb http://localhost/raspbian stretch main non-free firmware rpi
+deb http://localhost/rpidebian stretch main
+endef
+
+else
+
+BOOTSTRAP := http://localhost/debian
+define SOURCES =
+deb http://localhost/debian stretch main
+endef
+
+endif
+
+.PHONY: _approx_restore_sources
+_config: _approx_restore_sources
+_approx_restore_sources: ${CFGROOT}
+ printf '%s\n' "$${approx_original_sources}" >"$${CFGROOT}/etc/apt/sources.list"