From 7b4510d2d3de9bd8b849aed02806d261380c93e8 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 14 Dec 2012 16:20:34 -0800 Subject: [PATCH] compat: adjust get-compat-kernels for root usage If the user id is root then don't assume we want it under / but instead use the current directory. Signed-off-by: Luis R. Rodriguez --- bin/get-compat-kernels | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/get-compat-kernels b/bin/get-compat-kernels index ff5f1bdbd0eb..ce405e66054a 100755 --- a/bin/get-compat-kernels +++ b/bin/get-compat-kernels @@ -29,8 +29,11 @@ KSRC_PREFIX= # else, use $HOME/compat-ksrc for enabling user-mode builds. if [[ "$EUID" != "0" ]]; then KSRC_PREFIX="$HOME/compat-ksrc" +else + KSRC_PREFIX="${PWD}" fi + # Create target directories if they doesn't exist mkdir -p $KSRC_PREFIX/{usr/src,lib/modules} @@ -213,7 +216,7 @@ echo -e "" if [[ ! -n $KSRC_PREFIX ]]; then echo -e "** Running as a privileged user!" - echo -e "** You are trying to force using system-wide ${BLUE}/lib/modules${NORMAL} and ${BLUE}/usr/src${NORMAL} ..." + echo -e "** You are trying to force using ${BLUE}${KSRC_PREFIX}/lib/modules${NORMAL} and ${BLUE}${KSRC_PREFIX}/usr/src${NORMAL} ..." echo -e "** This is a terrible idea. Consider running as a regular user." echo -e "" read -p "Do you still want to continue (y/N)? " -- 2.30.2