mirror of
https://github.com/troglobit/finit.git
synced 2026-11-21 19:51:46 +00:00
test: ask BusyBox its tools and recommended paths
Note: we need to add /usr/bin and /usr/sbin to the standard PATH
for tests and the test environment itself.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
f03206a694
commit
5c2577214d
3 files changed
+14
-37
No files matched your search
@@ -23,6 +23,7 @@
|
|||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
export PATH=$PATH:/usr/bin:/usr/sbin
|
||||||
|
|
||||||
# It would have been nice to mount /dev as devtmpfs, but unfortunately
|
# It would have been nice to mount /dev as devtmpfs, but unfortunately
|
||||||
# that's not possible if you're not privileged. For now tmpfs will
|
# that's not possible if you're not privileged. For now tmpfs will
|
||||||
|
|||||||
+12
-36
@@ -30,38 +30,16 @@ FINITBIN ?= ./sbin/finit
|
|||||||
|
|
||||||
BBVER ?= 1.31.0
|
BBVER ?= 1.31.0
|
||||||
BBBIN = busybox-$(ARCH)
|
BBBIN = busybox-$(ARCH)
|
||||||
BBURL ?= https://www.busybox.net/downloads/binaries/$(BBVER)-defconfig-multiarch-musl/$(BBBIN)
|
BBHOME ?= https://www.busybox.net/downloads/binaries
|
||||||
|
BBURL ?= $(BBHOME)/$(BBVER)-defconfig-multiarch-musl/$(BBBIN)
|
||||||
binaries = $(DEST)/bin/awk \
|
|
||||||
$(DEST)/bin/cat \
|
|
||||||
$(DEST)/bin/cp \
|
|
||||||
$(DEST)/bin/date \
|
|
||||||
$(DEST)/bin/echo \
|
|
||||||
$(DEST)/bin/env \
|
|
||||||
$(DEST)/bin/find \
|
|
||||||
$(DEST)/bin/grep \
|
|
||||||
$(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/tail \
|
|
||||||
$(DEST)/bin/top \
|
|
||||||
$(DEST)/bin/touch \
|
|
||||||
$(DEST)/bin/start-stop-daemon
|
|
||||||
|
|
||||||
dirs = $(DEST)/bin \
|
dirs = $(DEST)/bin \
|
||||||
$(DEST)/dev \
|
$(DEST)/dev \
|
||||||
$(DEST)/etc \
|
$(DEST)/etc \
|
||||||
$(DEST)/proc \
|
$(DEST)/proc \
|
||||||
$(DEST)/sbin \
|
$(DEST)/sbin \
|
||||||
|
$(DEST)/usr/bin \
|
||||||
|
$(DEST)/usr/sbin \
|
||||||
$(DEST)/var \
|
$(DEST)/var \
|
||||||
$(DEST)/run \
|
$(DEST)/run \
|
||||||
$(DEST)/sys \
|
$(DEST)/sys \
|
||||||
@@ -71,8 +49,12 @@ dirs = $(DEST)/bin \
|
|||||||
_libs_src = $(shell ldd $(FINITBIN) | grep -Eo '/[^ ]+')
|
_libs_src = $(shell ldd $(FINITBIN) | grep -Eo '/[^ ]+')
|
||||||
libs = $(foreach path,$(_libs_src),$(abspath $(DEST))$(path))
|
libs = $(foreach path,$(_libs_src),$(abspath $(DEST))$(path))
|
||||||
|
|
||||||
all: $(dirs) $(binaries) $(libs) $(DEST)/bin/chrootsetup.sh
|
all: $(dirs) $(libs) $(DEST)/bin/chrootsetup.sh $(DEST)/bin/$(BBBIN)
|
||||||
touch $(DEST)/etc/fstab
|
touch $(DEST)/etc/fstab
|
||||||
|
@(cd $(DEST); \
|
||||||
|
for prg in `./bin/$(BBBIN) --list-full`; do \
|
||||||
|
ln -sf /bin/$(BBBIN) $$prg; \
|
||||||
|
done)
|
||||||
|
|
||||||
$(dirs):
|
$(dirs):
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
@@ -80,10 +62,9 @@ $(dirs):
|
|||||||
$(DEST)/bin/$(BBBIN).md5:
|
$(DEST)/bin/$(BBBIN).md5:
|
||||||
cp $(srcdir)/tenv/$(notdir $@) $@
|
cp $(srcdir)/tenv/$(notdir $@) $@
|
||||||
|
|
||||||
.PHONY: $(DEST)/bin/$(BBBIN)
|
|
||||||
$(DEST)/bin/$(BBBIN): $(DEST)/bin/$(BBBIN).md5
|
$(DEST)/bin/$(BBBIN): $(DEST)/bin/$(BBBIN).md5
|
||||||
@cd $(dir $@)
|
@(cd $(dir $@); \
|
||||||
@if ! md5sum --status -c $(BBBIN).md5 2>/dev/null; then \
|
if ! md5sum --status -c $(BBBIN).md5 2>/dev/null; then \
|
||||||
if [ -d $(CACHE) ]; then \
|
if [ -d $(CACHE) ]; then \
|
||||||
echo "Cannot find $(BBBIN), checking $(CACHE) ..."; \
|
echo "Cannot find $(BBBIN), checking $(CACHE) ..."; \
|
||||||
cd $(CACHE); \
|
cd $(CACHE); \
|
||||||
@@ -101,17 +82,12 @@ $(DEST)/bin/$(BBBIN): $(DEST)/bin/$(BBBIN).md5
|
|||||||
fi; \
|
fi; \
|
||||||
cd $(dir $@); \
|
cd $(dir $@); \
|
||||||
md5sum -c $(BBBIN).md5; \
|
md5sum -c $(BBBIN).md5; \
|
||||||
fi
|
fi)
|
||||||
@chmod +x $@
|
@chmod +x $@
|
||||||
|
|
||||||
$(DEST)/bin/chrootsetup.sh:
|
$(DEST)/bin/chrootsetup.sh:
|
||||||
cp $(srcdir)/tenv/$(notdir $@) $@
|
cp $(srcdir)/tenv/$(notdir $@) $@
|
||||||
|
|
||||||
$(binaries): $(DEST)/bin/$(BBBIN)
|
|
||||||
cd $(DEST)/bin; \
|
|
||||||
rm -f $(notdir $@); \
|
|
||||||
ln -s $(BBBIN) $(notdir $@)
|
|
||||||
|
|
||||||
$(libs):
|
$(libs):
|
||||||
mkdir -p $(dir $@)
|
mkdir -p $(dir $@)
|
||||||
cp $(patsubst $(abspath $(DEST))%,%,$@) $@
|
cp $(patsubst $(abspath $(DEST))%,%,$@) $@
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
prefix=@prefix@
|
prefix=@prefix@
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix=@exec_prefix@
|
||||||
|
|
||||||
export TESTENV_PATH=/bin:/sbin:"@bindir@":"@sbindir@"
|
export TESTENV_PATH=/bin:/sbin:/usr/bin:/usr/sbin:"@bindir@":"@sbindir@"
|
||||||
export FINIT_CONF="@FINIT_CONF@"
|
export FINIT_CONF="@FINIT_CONF@"
|
||||||
export FINIT_RCSD="@FINIT_RCSD@"
|
export FINIT_RCSD="@FINIT_RCSD@"
|
||||||
Reference in new issue
Block a user