lars
c621a89f3f
chroot environment improved make_stunnel_cert fixed (typo) "config" action now preserves links
33 lines
723 B
Bash
Executable file
33 lines
723 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# FOR DEVELOPMENT ONLY!
|
|
#
|
|
# this script is used to prepare a chroot session for testing
|
|
#
|
|
# called by:
|
|
# - cbox-build.sh
|
|
#
|
|
|
|
set -eu
|
|
|
|
MNT_SRC=/opt/dfsruntime/runtimerd
|
|
MNT_DST=/opt/dfsruntime/runtimemnt
|
|
# the directory /tmp/ can not be used, as it is still a broken link, too
|
|
TMP_DIR="/tmp-`basename $0`-$$"
|
|
|
|
|
|
cp -a "$MNT_SRC/." "$TMP_DIR"
|
|
mount --bind "$TMP_DIR" "$MNT_DST"
|
|
|
|
[ ! -e /dev/null ] && mknod "/dev/null" c 1 3 && chmod 666 "/dev/null"
|
|
[ ! -e /dev/urandom ] && mknod "/dev/urandom" c 1 9 && chmod 444 "/dev/urandom"
|
|
[ ! -e /dev/console ] && mknod "/dev/console" c 1 5 && chmod 660 "/dev/console"
|
|
|
|
[ ! -e /proc/mounts ] && mount -t proc proc /proc
|
|
|
|
bash
|
|
|
|
umount "$MNT_DST"
|
|
umount proc
|
|
rm -r "$TMP_DIR"
|