summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNathaniel Clark <[email protected]>2013-04-18 16:57:29 -0400
committerBrian Behlendorf <[email protected]>2013-06-21 16:00:45 -0700
commit389cf730cedd42dd1ef653e9358635c114e458d5 (patch)
tree0199f863cb95a140c5678f6f1f5ea0d9407d2809 /scripts
parent81eaf151071eadbb3fba74d74324a0921c5fdb5f (diff)
Make spl directory setable when building rpms and add --buildroot
This adds ability to set the location of spl via defines when building from the spec files. This is useful for build systems that build spl and zfs together without installing the actual rpms. Signed-off-by: Nathaniel Clark <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1486
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kmodtool12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/kmodtool b/scripts/kmodtool
index 2fe014c7f..6b7378098 100755
--- a/scripts/kmodtool
+++ b/scripts/kmodtool
@@ -37,6 +37,7 @@ kernel_versions_to_build_for=
prefix=
filterfile=
target=
+buildroot=
error_out()
{
@@ -305,9 +306,9 @@ print_customrpmtemplate ()
{
for kernel in ${1}
do
- if [[ -e "/usr/src/kernels/${kernel}" ]] ; then
+ if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] ; then
# this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and be happy :)
- kernel_versions="${kernel_versions}${kernel}___%{_usrsrc}/kernels/${kernel} "
+ kernel_versions="${kernel_versions}${kernel}___${buildroot}%{_usrsrc}/kernels/${kernel} "
# parse kernel versions string and print template
local kernel_verrelarch=${kernel%%${kernels_known_variants}}
@@ -382,7 +383,6 @@ myprog_help ()
echo "Usage: $(basename ${0}) [OPTIONS]"
echo $'\n'"Creates a template to be used during kmod building"
echo $'\n'"Available options:"
- # FIXME echo " --datadir <dir> -- look for our shared files in <dir>"
echo " --filterfile <file> -- filter the results with grep --file <file>"
echo " --for-kernels <list> -- created templates only for these kernels"
echo " --kmodname <file> -- name of the kmod (required)"
@@ -390,6 +390,7 @@ myprog_help ()
echo " --noakmod -- no akmod package"
echo " --repo <name> -- use buildsys-build-<name>-kerneldevpkgs"
echo " --target <arch> -- target-arch (required)"
+ echo " --buildroot <dir> -- Build root (place to look for build files)"
}
while [ "${1}" ] ; do
@@ -478,6 +479,11 @@ while [ "${1}" ] ; do
shift
build_kernels="current"
;;
+ --buildroot)
+ shift
+ buildroot="${1}"
+ shift
+ ;;
--help)
myprog_help
exit 0