diff --git a/Makefile b/Makefile
index def5899b7c50a71c2754d9c9e81c6652e9edce30..3c9f7d0fe25d77ea233eefa4515539ede45519fb 100644
--- a/Makefile
+++ b/Makefile
@@ -25,19 +25,19 @@ export GLUON_TARGET
 
 
 update: FORCE
-	$(GLUONDIR)/scripts/update.sh $(GLUONDIR)
-	$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
+	$(GLUONDIR)/scripts/update.sh
+	$(GLUONDIR)/scripts/patch.sh
 
 patch: FORCE
-	$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
+	$(GLUONDIR)/scripts/patch.sh
 
 unpatch: FORCE
-	$(GLUONDIR)/scripts/unpatch.sh $(GLUONDIR)
+	$(GLUONDIR)/scripts/unpatch.sh
 
 update-patches: FORCE
-	$(GLUONDIR)/scripts/update.sh $(GLUONDIR)
-	$(GLUONDIR)/scripts/update-patches.sh $(GLUONDIR)
-	$(GLUONDIR)/scripts/patch.sh $(GLUONDIR)
+	$(GLUONDIR)/scripts/update.sh
+	$(GLUONDIR)/scripts/update-patches.sh
+	$(GLUONDIR)/scripts/patch.sh
 
 -include $(TOPDIR)/include/host.mk
 
diff --git a/scripts/modules.sh b/scripts/modules.sh
index 24f60502a404238fe1bab9a54302986f38f34518..adec8cb38c73337c919573dacf5d5c844ba19dc0 100644
--- a/scripts/modules.sh
+++ b/scripts/modules.sh
@@ -1,5 +1,5 @@
-. "$1"/modules
-[ ! -f "$1"/site/modules ] || . "$1"/site/modules
+. "$GLUONDIR"/modules
+[ ! -f "$GLUON_SITEDIR"/site/modules ] || . "$GLUON_SITEDIR"/site/modules
 
 GLUON_MODULES=openwrt
 
diff --git a/scripts/patch.sh b/scripts/patch.sh
index 36948530587749c7a498914d599ca6cb2a75c907..e14726b7e84056c19cc95a6fbd7ee0afe9cdc7e2 100755
--- a/scripts/patch.sh
+++ b/scripts/patch.sh
@@ -3,14 +3,14 @@
 set -e
 shopt -s nullglob
 
-. "$1"/scripts/modules.sh
+. "$GLUONDIR"/scripts/modules.sh
 
 for module in $GLUON_MODULES; do
-	cd "$1"/$module
+	cd "$GLUONDIR"/$module
 	git checkout -B patching base
 
-	if [ "$(echo "$1"/patches/$module/*.patch)" ]; then
-		git am --whitespace=nowarn "$1"/patches/$module/*.patch || (
+	if [ "$(echo "$GLUONDIR"/patches/$module/*.patch)" ]; then
+		git am --whitespace=nowarn "$GLUONDIR"/patches/$module/*.patch || (
 			git am --abort
 			git checkout patched
 			git branch -D patching
diff --git a/scripts/unpatch.sh b/scripts/unpatch.sh
index a484d61a9bfb4363e52fe2a5e50c9ff48b62ede5..1f0f6f128e7c2703f58ebca51d7a0ba82b5103e0 100755
--- a/scripts/unpatch.sh
+++ b/scripts/unpatch.sh
@@ -2,9 +2,9 @@
 
 set -e
 
-. "$1"/scripts/modules.sh
+. "$GLUONDIR"/scripts/modules.sh
 
 for module in $GLUON_MODULES; do
-	cd "$1"/$module
+	cd "$GLUONDIR"/$module
 	git checkout base
 done
diff --git a/scripts/update-patches.sh b/scripts/update-patches.sh
index 5e029570c887d0d5551aa707947b349c068df8e2..4c9eaa95538269324ab41fa3bf6670949072b662 100755
--- a/scripts/update-patches.sh
+++ b/scripts/update-patches.sh
@@ -3,17 +3,17 @@
 set -e
 shopt -s nullglob
 
-. "$1"/scripts/modules.sh
+. "$GLUONDIR"/scripts/modules.sh
 
 for module in $GLUON_MODULES; do
-	rm -f "$1"/patches/$module/*.patch
-	mkdir -p "$1"/patches/$module
+	rm -f "$GLUONDIR"/patches/$module/*.patch
+	mkdir -p "$GLUONDIR"/patches/$module
 
-	cd "$1"/$module
+	cd "$GLUONDIR"/$module
 
 	n=0
 	for commit in $(git rev-list --reverse --no-merges base..patched); do
 		let n=n+1
-		git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$1"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch"
+		git show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$GLUONDIR"/patches/$module/"$(printf '%04u' $n)-$(git show -s --pretty=format:%f $commit).patch"
 	done
 done
diff --git a/scripts/update.sh b/scripts/update.sh
index f7319748bb8c40abece23a213b7e5af3333eaffc..5f0e684ebc38fa1731eeb22c8b8384537f401f73 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -2,7 +2,7 @@
 
 set -e
 
-. "$1"/scripts/modules.sh
+. "$GLUONDIR"/scripts/modules.sh
 
 for module in $GLUON_MODULES; do
 	var=$(echo $module | tr '[:lower:]/' '[:upper:]_')
@@ -10,8 +10,8 @@ for module in $GLUON_MODULES; do
 	eval branch=\${${var}_BRANCH}
 	eval commit=\${${var}_COMMIT}
 
-	mkdir -p "$1"/$module
-	cd "$1"/$module
+	mkdir -p "$GLUONDIR"/$module
+	cd "$GLUONDIR"/$module
 	git init
 
 	git checkout $commit 2>/dev/null || git fetch $repo $branch