mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +00:00
Merge branch 'wip-tests' into wip-tests-build-refactor
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
commit
1efdbeda16
28 files changed
+703
-221
No files matched your search
@@ -0,0 +1,32 @@
|
||||
/bin/busybox-x86_64
|
||||
/bin/cat
|
||||
/bin/cp
|
||||
/bin/date
|
||||
/bin/echo
|
||||
/bin/env
|
||||
/bin/find
|
||||
/bin/initctl
|
||||
/bin/kill
|
||||
/bin/ls
|
||||
/bin/mkdir
|
||||
/bin/mkfifo
|
||||
/bin/mknod
|
||||
/bin/mount
|
||||
/bin/pgrep
|
||||
/bin/printf
|
||||
/bin/ps
|
||||
/bin/rm
|
||||
/bin/sh
|
||||
/bin/sleep
|
||||
/bin/top
|
||||
/bin/touch
|
||||
/dev
|
||||
/etc
|
||||
/lib64
|
||||
/proc
|
||||
/sbin
|
||||
/sys
|
||||
/test_assets
|
||||
/tmp
|
||||
/usr
|
||||
/var
|
||||
@@ -0,0 +1,73 @@
|
||||
.PHONY: clean check
|
||||
|
||||
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 = ./bin/cat \
|
||||
./bin/cp \
|
||||
./bin/date \
|
||||
./bin/echo \
|
||||
./bin/env \
|
||||
./bin/find \
|
||||
./bin/kill \
|
||||
./bin/ls \
|
||||
./bin/mkdir \
|
||||
./bin/mkfifo \
|
||||
./bin/mknod \
|
||||
./bin/mount \
|
||||
./bin/printf \
|
||||
./bin/pgrep \
|
||||
./bin/ps \
|
||||
./bin/rm \
|
||||
./bin/sh \
|
||||
./bin/sleep \
|
||||
./bin/top \
|
||||
./bin/touch
|
||||
dirs = ./dev \
|
||||
./etc \
|
||||
./proc \
|
||||
./sbin \
|
||||
./sys \
|
||||
./test_assets \
|
||||
./tmp
|
||||
|
||||
_libs_src = $(shell ldd $(FINITBIN) | grep -Eo '/[^ ]+')
|
||||
libs = $(foreach path,$(_libs_src),.$(path))
|
||||
|
||||
all: $(binaries) $(dirs) $(libs)
|
||||
|
||||
$(dirs):
|
||||
mkdir -p $@
|
||||
|
||||
./bin/$(BBBIN):
|
||||
wget -O $@ $(BBURL)
|
||||
chmod +x ./bin/$(BBBIN)
|
||||
md5sum -c $(BBBIN).md5
|
||||
|
||||
$(binaries): ./bin/$(BBBIN)
|
||||
cd ./bin; \
|
||||
rm -f $(notdir $@); \
|
||||
ln -s $(BBBIN) $(notdir $@)
|
||||
|
||||
$(libs):
|
||||
mkdir -p $(dir $@)
|
||||
cp /$@ $@
|
||||
|
||||
clean:
|
||||
rm -f ./bin/$(BBBIN)
|
||||
rm -rf $(binaries)
|
||||
rm -rf ./dev
|
||||
rm -rf ./etc
|
||||
rm -rf ./lib64
|
||||
rm -rf ./proc
|
||||
rm -rf ./sbin
|
||||
rm -rf ./sys
|
||||
rm -rf ./test_assets
|
||||
rm -rf ./tmp
|
||||
rm -rf ./usr
|
||||
rm -rf ./var
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
mount -n -t tmpfs none /dev
|
||||
# mount -t devtmpfs none /dev
|
||||
|
||||
# mknod -m 622 /dev/console c 5 1
|
||||
# mknod -m 666 /dev/null c 1 3
|
||||
# mknod -m 666 /dev/zero c 1 5
|
||||
# mknod -m 666 /dev/ptmx c 5 2
|
||||
# mknod -m 666 /dev/tty c 5 0
|
||||
# mknod -m 444 /dev/random c 1 8
|
||||
# mknod -m 444 /dev/urandom c 1 9
|
||||
# chown root:tty /dev/{console,ptmx,tty}
|
||||
|
||||
mount -t proc none /proc
|
||||
mount -t sysfs none /sys
|
||||
# mount -t tmpfs none /tmp
|
||||
# mount -t tmpfs none /etc
|
||||
|
||||
# mkdir -p /dev/pts
|
||||
# mount -t devpts none /dev/pts
|
||||
|
||||
mkdir -p "$FINIT_RCSD"
|
||||
|
||||
tty=/dev/$(cat /sys/class/tty/console/active)
|
||||
mkfifo "$tty"
|
||||
|
||||
exec "$@"
|
||||
@@ -0,0 +1 @@
|
||||
ea7e2353af0067a926d3e021e504290e bin/busybox-x86_64
|
||||
Reference in new issue
Block a user