File: Makefile

package info (click to toggle)
golang-github-opencontainers-runtime-tools 0.9.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,108 kB
  • sloc: sh: 557; makefile: 104
file content (33 lines) | stat: -rw-r--r-- 958 bytes parent folder | download | duplicates (4)
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
ARCHES ?= amd64

all: $(ARCHES:%=rootfs-%.tar.gz)

rootfs-%.tar.gz: rootfs/%/bin/echo
	tar -czf $@ -C rootfs/$* .

.PRECIOUS: rootfs/%/bin/busybox
rootfs/%/bin/busybox: downloads/stage3-%-current.tar rootfs-files
	gpg --verify $<.DIGESTS.asc
	(cd downloads && \
		grep -A1 '^# SHA512 HASH' stage3-$*-current.tar.DIGESTS.asc | \
		grep -v '^--' | \
		sha512sum -c)
	sudo rm -rf rootfs/$*
	sudo mkdir -p rootfs/$*
	sudo tar -xvf downloads/stage3-$*-current.tar -C rootfs/$* \
		--no-recursion --wildcards $$(cat rootfs-files)
	sudo touch $@

.PRECIOUS: rootfs/%/bin/echo
rootfs/%/bin/echo: rootfs/%/bin/busybox
	sudo sh -c 'COMMANDS=$$($< --list | grep -v "^busybox$$") || exit 1; for COMMAND in $${COMMANDS}; do \
		test -L "rootfs/$*/bin/$${COMMAND}" || ln -rs $< "rootfs/$*/bin/$${COMMAND}" || exit; \
	done'

downloads/stage3-%-current.tar: get-stage3.sh
	STAGE3_ARCH=$* ./$<
	touch downloads/stage3-$*-*.tar

clean:
	rm -f downloads/*
	sudo rm -rf rootfs