.PHONY: clean .FORCE _target
.PHONY: _bootstrap _install _copy _config
+.PHONY: _fstab _initrd _init_modules
_install: _bootstrap
_copy: _install
PACKAGES += linux-image-686
endif
-export SOURCES SYSROOT CFGROOT ARCH KEYRING BOOTSTRAP
+ifdef fsuuid
+ ifndef FSTAB
+ define FSTAB :=
+UUID=${fsuuid} / btrfs auto,rw,subvol=${release} 0 0
+UUID=${fsuuid} /home btrfs auto,nofail,rw,subvol=home 0 0
+UUID=${fsuuid} /mnt/fsroot btrfs auto,nofail,rw 0 0
+LABEL=SWAP swap swap auto,nofail,sw 0 0
+LABEL=EFIBOOT /boot/efi vfat auto,nofail,ro 0 0
+ endef
+ endif
+endif
+
+ifdef FSTAB
+ _fstab: ${CFGROOT}/etc/fstab
+endif
+
+export SOURCES SYSROOT CFGROOT ARCH KEYRING BOOTSTRAP FSTAB
sys_root_${release}_${ARCH}:
btrfs subvol create "$@" || mkdir "$@"
"${release}" "$${SYSROOT}" "$${BOOTSTRAP}"
printf 'APT::Default-Release "%s";' "${release}" >"$${SYSROOT}/etc/apt/apt.conf.d/10release"
-
.PHONY: _aptkeys _norecommends
_aptkeys: ${SYSROOT}/etc/apt/trusted.gpg.d/
_norecommends: ${SYSROOT}/etc/apt/apt.conf.d/10norecommends
chroot "$${SYSROOT}" rm /usr/sbin/udevadm
_copy: ${SYSROOT} ${CFGROOT}
- cp -au "$${SYSROOT}/." "$${CFGROOT}/"
+ busybox cp -au "$${SYSROOT}/." "$${CFGROOT}/"
+
+${CFGROOT}/etc/fstab: _copy .FORCE
+ printf '%s\n' "$${FSTAB}" >"$@"
-_config:
- -ln -sf /dev/null "$${CFGROOT}/etc/systemd/network/99-default.link"
- printf '\n%s\n' \
- 'session optional pam_mkhomedir.so umask=0027' \
- >>"$${CFGROOT}/etc/pam.d/common-session"
+_init_modules: ${CFGROOT}/etc/initramfs-tools/modules
+${CFGROOT}/etc/initramfs-tools/modules: _copy .FORCE
+ printf '${fstype}\n' >>"$@"
+
+_initrd: _init_modules _fstab
mountpoint "$${CFGROOT}/proc" \
|| mount -o bind /proc "$${CFGROOT}/proc"
chroot "$${CFGROOT}" update-initramfs -u
-umount "$${CFGROOT}/proc"
+_config: _initrd
+
clean:
[ "$${SYSROOT#/}" ] && [ "$${CFGROOT#/}" ] || false # (abort receipe)
if [ -d "$${CFGROOT}" ]; then \
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
+.PHONY: _debconf_selections _keyboard
_install: _debconf_selections
_debconf_selections: ${SYSROOT}
printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
endif
_keyboard: _copy
-sed -Ei 's;^XKBLAYOUT=.*$$;XKBLAYOUT="${keyboard}";;' "$${CFGROOT}/etc/default/keyboard"
-
-ifdef raspi
- _config: _raspberry_config _raspberry_initrd
-endif
-
-_raspberry_config: _copy
- printf '%s\n' "$${RPICONFIG}" >>"$${CFGROOT}/boot/config.txt"
-
-_raspberry_initrd: _copy
- printf '${fstype}\n' >>"$${CFGROOT}/etc/initramfs-tools/modules"
- k="$$(printf '%s\n' "$${CFGROOT}"/lib/modules/* |sed 's;^.*/;;;')"; \
- [ "${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
printf 'DefaultTimeout%sSec=%s\n' Start 10s Stop 10s >>"$${CFGROOT}/etc/systemd/system.conf"
_pingcap: _copy
- chroot "$${CFGROOT}" setcap cap_net_raw+p /usr/bin/ping
+ -chroot "$${CFGROOT}" setcap cap_net_raw+p /usr/bin/ping
_files_default: _copy modules/default/
cp -a modules/default/. "$${CFGROOT}"
_config: ${CFGROOT}/etc/network/interfaces.d/wifi
ifdef wifipass
export wifi wifipass
- ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
+ ${CFGROOT}/etc/network/interfaces.d/wifi: _copy
printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
printf ' wpa-ssid "%s"\n wpa-psk "%s"\n' "$$wifi" "$$wifipass" >>$@
else
export wifi
- ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
+ ${CFGROOT}/etc/network/interfaces.d/wifi: _copy
printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
printf ' wireless-essid "%s"\n' "$$wifi" >>$@
endif
endif
-.PHONY: _fstab
-
-ifdef _fstab
- _config: ${CFGROOT}/etc/fstab
- export _fstab
+_config: ${CFGROOT}/etc/sysctl.d/quiet-console.conf
-else
- ifdef fsuuid
- define _fstab :=
-UUID=${fsuuid} / btrfs auto,rw,subvol=${release} 0 0
-UUID=${fsuuid} /home btrfs auto,nofail,rw,subvol=home 0 0
-UUID=${fsuuid} /mnt/fsroot btrfs auto,nofail,rw 0 0
-LABEL=SWAP swap swap auto,nofail,sw 0 0
-LABEL=EFIBOOT /boot/efi vfat auto,nofail,ro 0 0
-endef
- _config: ${CFGROOT}/etc/fstab
- export _fstab
-
- endif
-endif
-
-${CFGROOT}/etc/fstab: ${CFGROOT}
- printf '%s' "$${_fstab}" >"$@"
+${CFGROOT}/etc/sysctl.d/quiet-console.conf: _copy
+ printf '%s\n' "kernel.printk=3 4 1 7" >"$@"
-_config: ${CFGROOT}/etc/sysctl.d/quiet_console
+_config: ${CFGROOT}/etc/systemd/network/99-default.link
+${CFGROOT}/etc/systemd/network/99-default.link: _copy
+ -ln -sf /dev/null "$@"
-${CFGROOT}/etc/sysctl.d/quiet_console: ${CFGROOT}
- printf '%s\n' "kernel.printk=3 4 1 7" >"$@"
+_config: ${CFGROOT}/etc/pam.d/common-session
+${CFGROOT}/etc/pam.d/common-session: _copy .FORCE
+ printf '\n%s\n' \
+ 'session optional pam_mkhomedir.so umask=0027' \
+ >>"$@"