From 111c5967fdc3f252cfe1f3204f57b7522cb56e45 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 29 Mar 2023 11:01:33 -0500 Subject: [PATCH] build-squashfs: Allow defining pseudo files The `mksquashfs` command accepts a `-pf` argument, which specifies a file that defines "pseudo files." Each line in the file defines some file path and an operation to perform on that path *in the generated filesystem image*. This allows, e.g. creating files, changing their permissions, etc. that cannot be done in the source directory for whatever reason. Aimee OS now allows a variant to provide a pseudo file definition file for `mksquashfs` by creating a `squashfs.pseudo` file in its configuration directory. --- Makefile | 5 +++++ build-squashfs.sh | 1 + 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index a45baa7..3814b02 100644 --- a/Makefile +++ b/Makefile @@ -59,9 +59,14 @@ $(O)/squashfs.exclude: \ mkdir -p $(O) sort $^ > $@ +$(O)/squashfs.pseudo: \ + $(wildcard $(CONFIGDIR)/squashfs.pseudo) + sort /dev/null $^ > $@ + $(IMAGESDIR)/rootfs.squashfs: \ build-squashfs.sh \ $(O)/squashfs.exclude \ + $(O)/squashfs.pseudo \ $(O)/.ready ./build-squashfs.sh "$(O)" "$(IMAGESDIR)" diff --git a/build-squashfs.sh b/build-squashfs.sh index c90af07..c622d07 100755 --- a/build-squashfs.sh +++ b/build-squashfs.sh @@ -14,6 +14,7 @@ mksquashfs \ "${IMAGESDIR}"/rootfs.squashfs \ -comp gzip \ -ef "${O}"/squashfs.exclude \ + -pf "${O}"/squashfs.pseudo \ -no-exports \ -noappend \ -wildcards