mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
2
Commits
4.17
...
run-unprivileged
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50c99762f1 | ||
|
|
067043b298 |
+16
@@ -29,3 +29,19 @@ release: distcheck
|
||||
printf "$$file.md5\t"; cat ../$$file.md5 | cut -f1 -d' '; \
|
||||
printf "$$file.sha256\t"; cat ../$$file.sha256 | cut -f1 -d' '; \
|
||||
done
|
||||
|
||||
run:
|
||||
srcdir=@srcdir@/test \
|
||||
top_builddir=@top_builddir@ \
|
||||
TENV_ROOT=$(tenv_root) \
|
||||
@srcdir@/test/setup-root.sh
|
||||
|
||||
mkdir -p $(dir $(tenv_root)/@FINIT_CONF@)
|
||||
echo 'tty [12345] @console linux noclear nologin' > $(tenv_root)/@FINIT_CONF@
|
||||
|
||||
-TENV_ROOT=$(tenv_root) \
|
||||
TESTENV_PATH=@sbindir@:/bin \
|
||||
FINIT_RCSD=@FINIT_RCSD@ \
|
||||
test/tenv/start.sh finit
|
||||
|
||||
run : tenv_root ?= @abs_top_builddir@/run-rootfs
|
||||
|
||||
+4
-1
@@ -224,6 +224,9 @@ AC_DEFINE_UNQUOTED(RESCUE_CONF, "$rescue_conf", [Finit rescue mode .conf])
|
||||
AC_EXPAND_DIR(sample_conf, "$libdir/finit/sample.conf")
|
||||
AC_DEFINE_UNQUOTED(SAMPLE_CONF, "$sample_conf", [Finit sameple.conf for initctl create])
|
||||
|
||||
AC_EXPAND_DIR(path_stdpath, "$sbindir:$bindir:/usr/sbin:/usr/bin:/sbin:/bin")
|
||||
AC_DEFINE_UNQUOTED(_PATH_STDPATH, "$path_stdpath", [Default PATH])
|
||||
|
||||
# Generate all files
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -232,7 +235,7 @@ cat <<EOF
|
||||
------------------ Summary ------------------
|
||||
$PACKAGE_NAME version $PACKAGE_VERSION
|
||||
Prefix................: $prefix
|
||||
Exec prefix...........: $eprefix
|
||||
Exec prefix...........: `eval echo $exec_prefix`
|
||||
Sysconfdir............: `eval echo $sysconfdir`
|
||||
Localstatedir.........: `eval echo $localstatedir`
|
||||
Finit config file.....: $conf_path
|
||||
|
||||
@@ -36,11 +36,6 @@
|
||||
#include <lite/lite.h>
|
||||
#include <uev/uev.h>
|
||||
|
||||
/* just in case */
|
||||
#ifndef _PATH_STDPATH
|
||||
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
||||
#endif
|
||||
|
||||
#ifndef _PATH_VARRUN
|
||||
#define _PATH_VARRUN "/var/run/"
|
||||
#endif
|
||||
|
||||
@@ -44,6 +44,6 @@ fi
|
||||
mkdir -p "$FINIT_RCSD"
|
||||
|
||||
tty=/dev/$(cat /sys/class/tty/console/active)
|
||||
mkfifo "$tty"
|
||||
ln -fs /shared/pts "$tty"
|
||||
|
||||
exec "$@"
|
||||
|
||||
@@ -138,7 +138,3 @@ echo "$finit_ppid" > "$TENV_ROOT"/running_test.pid
|
||||
log "$color_reset" 'Setup of test environment done' ''
|
||||
|
||||
finit_pid=$(retry "pgrep -P $finit_ppid")
|
||||
|
||||
tty=/dev/$(texec cat /sys/class/tty/console/active)
|
||||
texec cat "$tty" &
|
||||
sleep 1
|
||||
|
||||
@@ -38,6 +38,7 @@ binaries = $(DEST)/bin/cat \
|
||||
$(DEST)/bin/env \
|
||||
$(DEST)/bin/find \
|
||||
$(DEST)/bin/kill \
|
||||
$(DEST)/bin/ln \
|
||||
$(DEST)/bin/ls \
|
||||
$(DEST)/bin/mkdir \
|
||||
$(DEST)/bin/mkfifo \
|
||||
@@ -57,6 +58,7 @@ dirs = $(DEST)/bin \
|
||||
$(DEST)/etc \
|
||||
$(DEST)/proc \
|
||||
$(DEST)/sbin \
|
||||
$(DEST)/shared \
|
||||
$(DEST)/sys \
|
||||
$(DEST)/test_assets \
|
||||
$(DEST)/tmp
|
||||
|
||||
+4
-1
@@ -45,4 +45,7 @@ exec "$unshare" \
|
||||
--mount \
|
||||
--mount-proc \
|
||||
--uts --ipc --net \
|
||||
"$chroot" "$TENV_ROOT" /bin/chrootsetup.sh "$@"
|
||||
sh -c "
|
||||
ln -fs /proc/1/fd/1 $TENV_ROOT/shared/pts;
|
||||
exec $chroot $TENV_ROOT /bin/chrootsetup.sh $*
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user