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
parent 621f3663ed
commit f7725ea531
3 changed files with 28 additions and 7 deletions

View file

@ -57,6 +57,14 @@ kernelversion_of() {
make -isC "$1" kernelversion make -isC "$1" kernelversion
} }
dir_of() {
w="${1}"
fetched | while read v d
do
[ "$w" = "$v" ] && echo "$d"
done
}
fetched() { fetched() {
for d in "${SOURCE_BASE_DIR}"/linux-* for d in "${SOURCE_BASE_DIR}"/linux-*
do do
@ -93,6 +101,7 @@ download_uri() {
} }
download() { download() {
echo "Download $1" >&2
curl `download_uri "${1}"` curl `download_uri "${1}"`
} }
@ -101,7 +110,7 @@ unpack() {
} }
fetch() { fetch() {
download | unpack download "${1}" | unpack
} }
update() { update() {
@ -146,8 +155,13 @@ oldconfig() {
} }
install_all() { install_all() {
echo "=====-- $1 --====="
d="${1:-`latest_fetched | print_dir`}" 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" cmd="$1"
@ -166,10 +180,10 @@ update) update ;;
help|--help|-h) help ;; help|--help|-h) help ;;
usage) usage ;; usage) usage ;;
latest_stable_is_fetched) latest_stable_is_fetched ;; latest_stable_is_fetched) latest_stable_is_fetched ;;
oldconfig) oldconfig "$@" ;; oldconfig) oldconfig "${1:+`dir_of "$1"`}" ;;
configs) configs ;; configs) configs "${1:+`dir_of "$1"`}" ;;
install) install_all ;; install) install_all "${1:+`dir_of "$1"`}" ;;
all) update && install_all ;; all) update "$1" && install_all "${1:+`dir_of "$1"`}" ;;
*) *)
usage >&2 usage >&2
exit 1 exit 1

View file

@ -5,4 +5,4 @@ which make >/dev/null 2>&1 || exit 0
[ -d "/usr/src/nvidia-drivers" ] || exit 0 [ -d "/usr/src/nvidia-drivers" ] || exit 0
echo Build NVIDIA module... >&2 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"