mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00:00
test: Fix testenv-root lingering in build dir
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
1 parent
6b7ae50fbb
commit
2f439194e5
12 files changed
+80
-125
No files matched your search
@@ -0,0 +1,67 @@
|
||||
.PHONY: clean check
|
||||
|
||||
DEST ?= ./testenv-root
|
||||
srcdir ?= ./
|
||||
|
||||
ARCH ?= x86_64
|
||||
|
||||
FINITBIN ?= ./sbin/finit
|
||||
|
||||
BBVER ?= 1.31.0
|
||||
BBBIN = busybox-$(ARCH)
|
||||
BBURL ?= https://www.busybox.net/downloads/binaries/$(BBVER)-defconfig-multiarch-musl/$(BBBIN)
|
||||
|
||||
binaries = $(DEST)/bin/cat \
|
||||
$(DEST)/bin/cp \
|
||||
$(DEST)/bin/date \
|
||||
$(DEST)/bin/echo \
|
||||
$(DEST)/bin/env \
|
||||
$(DEST)/bin/find \
|
||||
$(DEST)/bin/kill \
|
||||
$(DEST)/bin/ls \
|
||||
$(DEST)/bin/mkdir \
|
||||
$(DEST)/bin/mkfifo \
|
||||
$(DEST)/bin/mknod \
|
||||
$(DEST)/bin/mount \
|
||||
$(DEST)/bin/printf \
|
||||
$(DEST)/bin/pgrep \
|
||||
$(DEST)/bin/ps \
|
||||
$(DEST)/bin/rm \
|
||||
$(DEST)/bin/sh \
|
||||
$(DEST)/bin/sleep \
|
||||
$(DEST)/bin/top \
|
||||
$(DEST)/bin/touch
|
||||
|
||||
dirs = $(DEST)/bin \
|
||||
$(DEST)/dev \
|
||||
$(DEST)/etc \
|
||||
$(DEST)/proc \
|
||||
$(DEST)/sbin \
|
||||
$(DEST)/sys \
|
||||
$(DEST)/test_assets \
|
||||
$(DEST)/tmp
|
||||
|
||||
_libs_src = $(shell ldd $(FINITBIN) | grep -Eo '/[^ ]+')
|
||||
libs = $(foreach path,$(_libs_src),$(abspath $(DEST))$(path))
|
||||
|
||||
all: $(dirs) $(binaries) $(libs) $(DEST)/bin/chrootsetup.sh
|
||||
|
||||
$(dirs):
|
||||
mkdir -p $@
|
||||
|
||||
$(DEST)/bin/$(BBBIN):
|
||||
wget -O $@ $(BBURL)
|
||||
chmod +x $@
|
||||
# md5sum -c $(BBBIN).md5
|
||||
|
||||
$(DEST)/bin/chrootsetup.sh:
|
||||
cp $(srcdir)/$(notdir $@) $@
|
||||
|
||||
$(binaries): $(DEST)/bin/$(BBBIN)
|
||||
cd $(DEST)/bin; \
|
||||
rm -f $(notdir $@); \
|
||||
ln -s $(BBBIN) $(notdir $@)
|
||||
|
||||
$(libs):
|
||||
mkdir -p $(dir $@)
|
||||
cp $(patsubst $(abspath $(DEST))%,%,$@) $@
|
||||
Reference in new issue
Block a user