summaryrefslogtreecommitdiff
path: root/bin/bump_nvidia_drivers
blob: 4598056ec08a1cba626c3750264b775228e0fe83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

. /kogaion/bin/kernels.inc
packages="x11-drivers/nvidia-drivers::kogaion-desktop"

# build for latest kernel
KERNEL_DIR="/usr/src/linux-${running_kernel}" emerge $packages media-video/nvidia-settings::kogaion-desktop
echo -5 | etc-update
eit commit

for kernel in $kernels; do
        if [ "${kernel}" = "${running_kernel}" ]; then
                continue
        fi
        rm -rf /usr/portage/packages/*
        KERNEL_DIR="/usr/src/linux-${kernel}" emerge -B ${packages} || { echo "ouch unable to build" && exit 1; }
        built_pkgs=$(find /usr/portage/packages -name "*.tbz2" | xargs echo)
        [[ -z "${built_pkgs}" ]] && echo "ouch no kernel pkgs" && exit 2
        eit inject ${built_pkgs} || { echo "ouch unable to inject" && exit 3; }
        echo
done

echo "Now you should remove old packages..."