Skip to contentSkip to conversation

compat: Add ability to run as non-root

PATCH In review Ozan Çağlayan 2 participants 2 messages Jul 11, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 compat: Add ability to run as non-root

get-compat-kernels now extracts the kernel headers into $HOME/compat-ksrc if the user is not root.

Similarly, ckmake tries first to use $HOME/compat-ksrc if it exists. If not, it fallbacks to system-wide /usr/src silently.

---
 bin/ckmake             |    9 +++++-
 bin/get-compat-kernels |   76 ++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 68 insertions(+), 17 deletions(-)
bin/ckmake +8 -1
index 2a0bb3d..72e9b7e 100755
@@ -34,7 +34,14 @@ RET_FILE="ret-tmp.txt"
 
 RET=""
 
-for i in $(find /lib/modules/ -type d -name \*generic\* | sort -n -r | grep -v -E '\-[[:alnum:]]{1,2}\-'); do
+# If $HOME/compat-ksrc is found use that, otherwise use system-wide
+# sources in /usr/src.
+KSRC_PREFIX=
+if [[ -d "$HOME/compat-ksrc" ]]; then
+	KSRC_PREFIX="$HOME/compat-ksrc"
+fi
+
+for i in $(find $KSRC_PREFIX/lib/modules/ -type d -name \*generic\* | sort -n -r | grep -v -E '\-[[:alnum:]]{1,2}\-'); do
 	KLIBS="$KLIBS $i"
 done
 
bin/get-compat-kernels +60 -16

138 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 7 lines · Ozan Çağlayan

get-compat-kernels now extracts the kernel headers into $HOME/compat-ksrc if the user is not root.

Similarly, ckmake tries first to use $HOME/compat-ksrc if it exists. If not, it fallbacks to system-wide /usr/src silently.

Applied and pushed, thanks!

Luis