From ff5c27ec03d84095064b43b9941b7c009fb92d32 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Sat, 24 Nov 2012 17:16:01 +0100 Subject: [PATCH] linux-update: install works with versions other then the latest. postinst: depmod added, nvidia-drivers: install does not modprobe --- linux-update | 26 ++++++++++++++++++++------ postinst.d/10-nvidia-drivers | 2 +- postinst.d/99-depmod | 7 +++++++ 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100755 postinst.d/99-depmod diff --git a/linux-update b/linux-update index ed21dbf..c55826c 100755 --- a/linux-update +++ b/linux-update @@ -57,6 +57,14 @@ kernelversion_of() { make -isC "$1" kernelversion } +dir_of() { + w="${1}" + fetched | while read v d + do + [ "$w" = "$v" ] && echo "$d" + done +} + fetched() { for d in "${SOURCE_BASE_DIR}"/linux-* do @@ -93,6 +101,7 @@ download_uri() { } download() { + echo "Download $1" >&2 curl `download_uri "${1}"` } @@ -101,7 +110,7 @@ unpack() { } fetch() { - download | unpack + download "${1}" | unpack } update() { @@ -146,8 +155,13 @@ oldconfig() { } install_all() { + echo "=====-- $1 --=====" d="${1:-`latest_fetched | print_dir`}" - oldconfig && make -C "$d" all modules_install install + echo "===== $d =====" + oldconfig "$d" && \ + make -j3 -C "$d" all && \ + make -j3 -C "$d" modules_install && \ + make -j3 -C "$d" install } cmd="$1" @@ -166,10 +180,10 @@ update) update ;; help|--help|-h) help ;; usage) usage ;; latest_stable_is_fetched) latest_stable_is_fetched ;; -oldconfig) oldconfig "$@" ;; -configs) configs ;; -install) install_all ;; -all) update && install_all ;; +oldconfig) oldconfig "${1:+`dir_of "$1"`}" ;; +configs) configs "${1:+`dir_of "$1"`}" ;; +install) install_all "${1:+`dir_of "$1"`}" ;; +all) update "$1" && install_all "${1:+`dir_of "$1"`}" ;; *) usage >&2 exit 1 diff --git a/postinst.d/10-nvidia-drivers b/postinst.d/10-nvidia-drivers index 41ec1f0..62ee586 100755 --- a/postinst.d/10-nvidia-drivers +++ b/postinst.d/10-nvidia-drivers @@ -5,4 +5,4 @@ which make >/dev/null 2>&1 || exit 0 [ -d "/usr/src/nvidia-drivers" ] || exit 0 echo Build NVIDIA module... >&2 -exec make -C /usr/src/nvidia-drivers SYSSRC="/lib/modules/$1/build" install +exec make -C /usr/src/nvidia-drivers SYSSRC="/lib/modules/$1/build" module-install diff --git a/postinst.d/99-depmod b/postinst.d/99-depmod new file mode 100755 index 0000000..6eecb2f --- /dev/null +++ b/postinst.d/99-depmod @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +[ -e "$0.disabled" ] && exit 0 +which depmod >/dev/null 2>&1 || exit 0 + +echo depmod -a >&2 +exec depmod -a "$1"