patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob a65f2d004efed9dcf218dd806cf66071fb115db1 1813 bytes (raw)
name: lib/erofs.mk 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
override basedir ::= $(dir $(lastword $(MAKEFILE_LIST)))/..

override BUILD_FILES ::= $(BUILD_FILES) build/etc/s6-rc/compiled
# No override here so that it can be overridden in host/rootfs/default.nix.
dest ::= build/rootfs.erofs

all:
.PHONY: all
$(dest): $(basedir)/scripts/make-erofs.sh $(PACKAGES_FILE) $(addprefix image/,$(FILES)) $(BUILD_FILES) build/empty build/fifo file-list.mk
	set -euo pipefail; ( \
	    cat $(PACKAGES_FILE) ;\
	    for file in $(FILES) $(LINKS); do printf 'image/%s\n%s\n' "$$file" "$$file"; done ;\
	    for file in $(BUILD_FILES); do printf '%s\n%s\n' "$$file" "$${file#build/}"; done ;\
	    $(and $(DIRS),printf 'build/empty\n%s\n' $(DIRS);)\
	    $(and $(FIFOS),printf 'build/fifo\n%s\n' $(FIFOS);)\
	) | $(basedir)/scripts/make-erofs.sh $@

clean:
	-chmod -Rf +w build
	rm -rf build
.PHONY: clean

build/fifo:
	mkdir -p build
	mkfifo -m 0600 $@

build/empty:
	mkdir -p $@

update-file-list:
	$(basedir)/scripts/genfiles.awk image > file-list.mk

.PHONY: update-file-list
.PHONY:
	$(error cannot make .PHONY!)

# s6-rc-compile's input is a directory, but that doesn't play nice
# with Make, because it won't know to update if some file in the
# directory is changed, or a file is created or removed in a
# subdirectory.  Using the whole source directory could also end up
# including files that aren't intended to be part of the input, like
# temporary editor files or .license files.  So for all these reasons,
# only explicitly listed files are made available to s6-rc-compile.
build/etc/s6-rc/compiled: $(addprefix image/,$(S6_RC_FILES)) file-list.mk
	mkdir -p build/etc/s6-rc
	rm -rf $@
	set -euo pipefail; \
	dir=$$(mktemp -d); \
	{ tar -C image -c $(S6_RC_FILES) | tar -C "$$dir" -x --strip-components 2;}; \
	s6-rc-compile $@ $$dir; \
	exit=$$?; rm -r $$dir; exit $$exit

debug log:

solving a65f2d004efed9dcf218dd806cf66071fb115db1 ...
found a65f2d004efed9dcf218dd806cf66071fb115db1 in https://inbox.spectrum-os.org/spectrum-devel/20250903-genfiles-v1-4-cc993fcb1e4c@gmail.com/
found b3fc112f5e793725977cd8c4b2e71d6ed8d888c4 in https://inbox.spectrum-os.org/spectrum-devel/20250903-genfiles-v1-3-cc993fcb1e4c@gmail.com/

applying [1/2] https://inbox.spectrum-os.org/spectrum-devel/20250903-genfiles-v1-3-cc993fcb1e4c@gmail.com/
diff --git a/lib/erofs.mk b/lib/erofs.mk
new file mode 100644
index 0000000000000000000000000000000000000000..b3fc112f5e793725977cd8c4b2e71d6ed8d888c4


applying [2/2] https://inbox.spectrum-os.org/spectrum-devel/20250903-genfiles-v1-4-cc993fcb1e4c@gmail.com/
diff --git a/lib/erofs.mk b/lib/erofs.mk
index b3fc112f5e793725977cd8c4b2e71d6ed8d888c4..a65f2d004efed9dcf218dd806cf66071fb115db1 100644

Checking patch lib/erofs.mk...
Applied patch lib/erofs.mk cleanly.
Checking patch lib/erofs.mk...
Applied patch lib/erofs.mk cleanly.

index at:
100644 a65f2d004efed9dcf218dd806cf66071fb115db1	lib/erofs.mk

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).