commit d01109bfeb780e0554223610edf2718217a77d4e parent 0ba4fc5e1cacfc32cdec70bd006587b3bd5990a7 Author: parazyd <parazyd@dyne.org> Date: Mon, 8 Jan 2018 18:32:55 +0100 Implement separate function for installing kernel modules. Diffstat:
M | boards/raspberry-pi2.sh | | | 9 | +-------- |
M | lib/helpers | | | 20 | ++++++++++++++++++++ |
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/boards/raspberry-pi2.sh b/boards/raspberry-pi2.sh @@ -93,14 +93,7 @@ build_kernel_armhf() { ARCH=arm \ CROSS_COMPILE=$compiler || zerr - # install kernel modules - sudo -E PATH="$PATH" \ - make \ - $MAKEOPTS \ - ARCH=arm \ - CROSS_COMPILE=$compiler \ - INSTALL_MOD_PATH=$strapdir \ - modules_install || zerr + install-kernel-mods arm || zerr popd clone-git "$rpifirmware" "$R/tmp/kernels/$device_name/${device_name}-firmware" diff --git a/lib/helpers b/lib/helpers @@ -43,6 +43,26 @@ get-kernel-firmware() { clone-git "$linuxfirmware" "$R/tmp/linux-firmware" } +install-kernel-mods() { + fn install-kernel-mods + req=(MAKEOPTS PATH compiler strapdir) + ckreq || return 1 + + # We need this function to avoid sudo -E calls, which are + # forbidden by jenkins. + cat <<EOF > install_mods +#!/bin/sh +export PATH="${PATH}" +sudo make \ + ${MAKEOPTS} \ + ARCH="${1}" \ + CROSS_COMPILE=${compiler} \ + INSTALL_MOD_PATH=${strapdir} \ + modules_install || exit 1 +EOF + chroot-script -d install_mods || zerr +} + clone-git() { fn clone-git "$@" req=(giturl clonepath)