Whamcloud - gitweb
LU-1406 ofd: add procfs values
[fs/lustre-release.git] / build / find_linux_rpms
1 #!/bin/bash
2
3 # this is an alternative FD for stdout, to be used especially when we are
4 # taking stdout from a function as it's return value.  i.e. foo=$(bar)
5 # this is a workaround until a version of bash where we can put xtrace
6 # on a specific FD
7 #exec 3>&1; STDOUT=3
8 STDOUT=2
9
10 . ${0%/find_linux_rpms}/funcs.sh
11
12 TOPDIR=$PWD
13
14 # same as lbuild's --kernelrpm switch
15 KERNELRPMSDIR="$1"
16
17 DISTRO=$(autodetect_distro)
18
19 source ${0%/*}/lbuild-$DISTRO
20
21 TARGET_ARCH="$(uname -m)"
22 TARGET_ARCHS="$(uname -m)"
23 TARGET_ARCHS_ALL="$(uname -m)"
24
25 # need lnxmaj from the target file
26 TARGET=$(autodetect_target "$DISTRO")
27 TARGET_FILE="$TOPDIR/lustre/kernel_patches/targets/$TARGET.target"
28 . "$TARGET_FILE"
29
30 if ! kernelrpm=$(find_linux_rpms "-$DEVEL_KERNEL_TYPE" "$KERNELRPMSDIR"); then
31     fatal 1 "Could not find the kernel-$DEVEL_KERNEL_TYPE RPM in ${KERNELRPMSDIR}"
32 fi
33
34 echo "$kernelrpm"