]> git.plutz.net Git - blast/commitdiff
modified receipe layout
authorPaul Hänsch <paul@plutz.net>
Sun, 12 Apr 2026 18:16:35 +0000 (20:16 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 12 Apr 2026 18:16:35 +0000 (20:16 +0200)
Makefile
modules/default.mk

index 0fbcb431a2c953d6ebd5cc83acd14c3b39fd6224..dd7db45523cecdb68ace645ab3c5641e2f97c61e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ space_:= ${nul_} ${nul_}
 
 .PHONY: clean .FORCE _target
 .PHONY: _bootstrap _install _copy _config 
+.PHONY: _fstab _initrd _init_modules
 
 _install: _bootstrap
 _copy: _install
@@ -67,7 +68,23 @@ else ifeq "${ARCH}" "i386"
   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 "$@"
@@ -86,7 +103,6 @@ ${SYSROOT}/bin/sh: | ${SYSROOT}
                "${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
@@ -122,18 +138,23 @@ _install: ${SYSROOT} _aptkeys _norecommends
        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 \
index 35c5195eb5e87f75251f53935e6544ec19852ded..2be1c6f7b13e605e672751cf53f9e8b986c7b1ed 100644 (file)
@@ -20,17 +20,7 @@ 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
+.PHONY: _debconf_selections _keyboard
 _install: _debconf_selections
 _debconf_selections: ${SYSROOT}
        printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
@@ -40,21 +30,6 @@ ifdef keyboard
 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
@@ -127,7 +102,7 @@ _systemd_timeout: _copy
        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}"
@@ -137,43 +112,29 @@ ifdef wifi
   _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' \
+         >>"$@"