]> git.plutz.net Git - blast/commitdiff
fstab entries for btrfs target
authorPaul Hänsch <paul@plutz.net>
Thu, 30 Dec 2021 14:30:51 +0000 (15:30 +0100)
committerPaul Hänsch <paul@plutz.net>
Thu, 30 Dec 2021 14:30:51 +0000 (15:30 +0100)
modules/default.mk

index ceb91ff07aee2c7f856a7a62c874991d7a25cffb..bb4f432ceadd9298c7f6e3321d36fc55f5e207e1 100644 (file)
@@ -139,3 +139,27 @@ ifdef wifi
        printf '  wireless-essid "%s"\n' "$$wifi" >>$@
   endif
 endif
+
+.PHONY: _fstab
+
+ifdef _fstab
+  _config: ${CFGROOT}/etc/fstab
+  export _fstab
+
+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}" >"$@"