summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/chroot-tools/distcc-tool40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool
index 840a5aa..00156ac 100755
--- a/src/chroot-tools/distcc-tool
+++ b/src/chroot-tools/distcc-tool
@@ -23,13 +23,10 @@
# - bash: I don't know what version, I use fairly modern features
# - socat
# - cat: any version
-# - grep: any version
-# - mkdir: any version
# - rm: any version
# - sed: any version
-# - sleep: any version
# On Parabola, this means the packages:
-# bash, coreutils, grep, sed, socat
+# bash, coreutils, sed, socat
panic() {
echo 'panic: malformed call to internal function' >&2
@@ -117,8 +114,8 @@ parse_DISTCC_HOSTS() {
# SSH_HOST
*@*)
# SSH_HOST doesn't allow custom port numbers, and even if it
- # did, ssh would complain about MITM. Instead, we configure an
- # ssh ProxyCommand so that ssh works fine.
+ # did, ssh would complain about MITM. Instead, we'll count on
+ # ssh ProxyCommand being configured to used `client`.
newhosts+=("$HOSTSPEC")
;;
# GLOBAL_OPTION
@@ -208,30 +205,6 @@ client() {
# High-level routines #
################################################################################
-# Usage: configure_ssh
-# Edits ~/.ssh/config to use `client` as a ProxyCommand so that ssh can work
-# inside of the chroot.
-configure_ssh() {
- [[ $# -eq 0 ]] || panic
- if ! grep "^\s*ProxyCommand $0 client" ~/.ssh/config &>/dev/null; then
- [[ -d ~/.ssh ]] || mkdir ~/.ssh
- echo 'Host *' >> ~/.ssh/config
- echo " ProxyCommand $0 client %h %p" >> ~/.ssh/config
- fi
-}
-
-# Usage: idaemon DISTCC_HOSTS
-# Sets things up inside of the chroot to forward distcc hosts out.
-# It configures an ssh ProxyCommand.
-idaemon() {
- [[ $# -eq 1 ]] || panic
- local DISTCC_HOSTS=$1
-
- configure_ssh
-
- parse_DISTCC_HOSTS true "$DISTCC_HOSTS"
-}
-
# Usage: odaemon CHROOTPATH
# Listens on "$CHROOTPATH/socket" and spawns a `server` for each new connection.
odaemon() {
@@ -242,6 +215,13 @@ odaemon() {
socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$0 server"
}
+# Usage: idaemon DISTCC_HOSTS
+# Sets things up inside of the chroot to forward distcc hosts out.
+idaemon() {
+ [[ $# -eq 1 ]] || panic
+ parse_DISTCC_HOSTS true "$1"
+}
+
# Usage: rewrite DISTCC_HOSTS
# Prints a modified version of DISTCC_HOSTS for inside the chroot.
rewrite() {