linux-update: install works with versions other then the latest. postinst: depmod added, nvidia-drivers: install does not modprobe

This commit is contained in:
Denis Knauf 2012-11-24 17:16:01 +01:00 committed by Denis Knauf
parent 621f3663ed
commit ff5c27ec03
3 changed files with 28 additions and 7 deletions

View file

@ -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

View file

@ -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

7
postinst.d/99-depmod Executable file
View file

@ -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"