diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-03-20 16:00:52 +0100 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2022-03-20 16:23:43 +0100 |
commit | a99d3ef7db06b85a33864add18c2882967adf25e (patch) | |
tree | 05063e4b1f1c53eea0b9056b78937a184c9bbd2f /Makefile | |
parent | 4fcdc7373ab32c218d442fb3a03e8f062fca95c1 (diff) | |
download | freebsd-wifibox-alpine-a99d3ef7db06b85a33864add18c2882967adf25e.zip |
Implement optional trimming of firmware files.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -142,7 +142,24 @@ _EXCLUDE_FILES= -ef $(EXCLUDED_FILES) _EXCLUDE_FILES= .endif +EXCLUDE_FIRMWARE_FILES= $(WORKDIR)/exclude_firmware.files + +.if defined(FIRMWARE_FILES) +.for fw_file in $(FIRMWARE_FILES) +__FW_FILES+= -name ${fw_file} -or +.endfor +_FW_FILES= -not \( ${__FW_FILES:S/ -or$//W} \) +_EXCLUDE_FW_FILES= -ef $(EXCLUDE_FIRMWARE_FILES) +.else +_EXCLUDE_FW_FILES= +.endif + $(SQUASHFS_IMG): image-contents $(INITRD_IMG) +.if defined(_FW_FILES) + (cd $(GUESTDIR) \ + && $(FIND) lib/firmware -not -type d -and $(_FW_FILES) \ + > $(EXCLUDE_FIRMWARE_FILES)) +.endif $(MKSQUASHFS) \ $(GUESTDIR) \ $(SQUASHFS_IMG) \ @@ -150,6 +167,7 @@ $(SQUASHFS_IMG): image-contents $(INITRD_IMG) -comp $(SQUASHFS_COMP) \ -wildcards \ $(_EXCLUDE_FILES) \ + $(_EXCLUDE_FW_FILES) \ -e boot -e .done -e "var/*" all: $(SQUASHFS_IMG) |