Skip to content
Snippets Groups Projects
Commit a4354a40 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

rtcds CLI add check for /usr/src/linux

The RCG expects the kernel source at /usr/src/linux.  This is not
installed by default and has to be created manually, unfortunately.
Until this is fixed in the RCG we add a check for it here.

git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@4514 6dcd42c9-f523-4c6d-aada-af552506706e
parent 5a5ddcee
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,46 @@ check_env() {
done
}
# FIXME: the RCG currently requires that the kernel source be at
# /usr/src/linux. this checks that /usr/src/linux is a symlink to the
# header dir for the currently running kernel. This shouldn't be
# necessary once the RCG is fixed.
check_linux_src() {
if [ "$RCG_IGNORE_KERNEL_RELEASE" ] ; then
return
fi
local target=$(readlink /usr/src/linux)
local msg=
if [ ! -d /usr/src/linux ] ; then
msg="Missing linux source."
elif [ -z "$target" ] ; then
msg="Unknown linux source."
fi
local release=$(uname -r | sed 's/-amd64$/-common/')
for ls in /usr/src/linux-headers-${release}{,-common} ; do
if [[ "$target" == "$ls" ]] ; then
return
fi
if [ -d "$ls" ] ; then
break
fi
done
if [ -z "$msg" ] ; then
msg="Linux source does not match currently running kernel."
fi
log "$msg
The RCG expects the linux source to be at /usr/src/linux. For modern
distros this should be a symlink to the source installed as part of
the kernel header package for the running kernel. For this system:
/usr/src/linux -> $ls
Please create this link, or set the RCG_IGNORE_KERNEL_RELEASE
environment variable to bypass this check."
exit 10
}
prep_target(){
log "creating OPTRTCDS..."
mkdir -p ${OPTRTCDS}/{target,chans}/tmp
......@@ -233,6 +273,7 @@ case $cmd in
log "You must specify at least one system to build."
exit 2
fi
check_linux_src
check_env
prep_buildd
build_sys $@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment