mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
2
Commits
4.6
...
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.md5\t"; cat ../$$file.md5 | cut -f1 -d' '; \
|
||||||
printf "$$file.sha256\t"; cat ../$$file.sha256 | cut -f1 -d' '; \
|
printf "$$file.sha256\t"; cat ../$$file.sha256 | cut -f1 -d' '; \
|
||||||
done
|
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_EXPAND_DIR(sample_conf, "$libdir/finit/sample.conf")
|
||||||
AC_DEFINE_UNQUOTED(SAMPLE_CONF, "$sample_conf", [Finit sameple.conf for initctl create])
|
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
|
# Generate all files
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
@@ -232,7 +235,7 @@ cat <<EOF
|
|||||||
------------------ Summary ------------------
|
------------------ Summary ------------------
|
||||||
$PACKAGE_NAME version $PACKAGE_VERSION
|
$PACKAGE_NAME version $PACKAGE_VERSION
|
||||||
Prefix................: $prefix
|
Prefix................: $prefix
|
||||||
Exec prefix...........: $eprefix
|
Exec prefix...........: `eval echo $exec_prefix`
|
||||||
Sysconfdir............: `eval echo $sysconfdir`
|
Sysconfdir............: `eval echo $sysconfdir`
|
||||||
Localstatedir.........: `eval echo $localstatedir`
|
Localstatedir.........: `eval echo $localstatedir`
|
||||||
Finit config file.....: $conf_path
|
Finit config file.....: $conf_path
|
||||||
|
|||||||
@@ -36,11 +36,6 @@
|
|||||||
#include <lite/lite.h>
|
#include <lite/lite.h>
|
||||||
#include <uev/uev.h>
|
#include <uev/uev.h>
|
||||||
|
|
||||||
/* just in case */
|
|
||||||
#ifndef _PATH_STDPATH
|
|
||||||
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_VARRUN
|
#ifndef _PATH_VARRUN
|
||||||
#define _PATH_VARRUN "/var/run/"
|
#define _PATH_VARRUN "/var/run/"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ fi
|
|||||||
mkdir -p "$FINIT_RCSD"
|
mkdir -p "$FINIT_RCSD"
|
||||||
|
|
||||||
tty=/dev/$(cat /sys/class/tty/console/active)
|
tty=/dev/$(cat /sys/class/tty/console/active)
|
||||||
mkfifo "$tty"
|
ln -fs /shared/pts "$tty"
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
@@ -138,7 +138,3 @@ echo "$finit_ppid" > "$TENV_ROOT"/running_test.pid
|
|||||||
log "$color_reset" 'Setup of test environment done' ''
|
log "$color_reset" 'Setup of test environment done' ''
|
||||||
|
|
||||||
finit_pid=$(retry "pgrep -P $finit_ppid")
|
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/env \
|
||||||
$(DEST)/bin/find \
|
$(DEST)/bin/find \
|
||||||
$(DEST)/bin/kill \
|
$(DEST)/bin/kill \
|
||||||
|
$(DEST)/bin/ln \
|
||||||
$(DEST)/bin/ls \
|
$(DEST)/bin/ls \
|
||||||
$(DEST)/bin/mkdir \
|
$(DEST)/bin/mkdir \
|
||||||
$(DEST)/bin/mkfifo \
|
$(DEST)/bin/mkfifo \
|
||||||
@@ -57,6 +58,7 @@ dirs = $(DEST)/bin \
|
|||||||
$(DEST)/etc \
|
$(DEST)/etc \
|
||||||
$(DEST)/proc \
|
$(DEST)/proc \
|
||||||
$(DEST)/sbin \
|
$(DEST)/sbin \
|
||||||
|
$(DEST)/shared \
|
||||||
$(DEST)/sys \
|
$(DEST)/sys \
|
||||||
$(DEST)/test_assets \
|
$(DEST)/test_assets \
|
||||||
$(DEST)/tmp
|
$(DEST)/tmp
|
||||||
|
|||||||
+4
-1
@@ -45,4 +45,7 @@ exec "$unshare" \
|
|||||||
--mount \
|
--mount \
|
||||||
--mount-proc \
|
--mount-proc \
|
||||||
--uts --ipc --net \
|
--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