Comment 3 for bug 1853977

Revision history for this message
Wowbagger (ha87psc02) wrote :

This is a stupid uninitialized variable error in the postinstall script:

case "$1" in
    configure)
        # Added manually, since we mangled the arguments, and dpkg-maintscript-helper
        # won't work
        if [ -n "$2" ] && `dpkg --compare-versions "$2" lt "340.106-0ubuntu5"`; then
            rm -f /etc/modprobe.d/nvidia-340.conf
        fi
        CURRENT_KERNEL=$(uname -r)
        NEWEST_KERNEL=$(get_newest_kernel "$KERNELS")

Variable "KERNELS" is not defined, so when get_newest_kernel tries to use dpkg to look up the kernel version it fails.

Defining "KERNELS" to be CURRENT_KERNEL allows the configure to work:

case "$1" in
    configure)
        # Added manually, since we mangled the arguments, and dpkg-maintscript-helper
        # won't work
        if [ -n "$2" ] && `dpkg --compare-versions "$2" lt "340.106-0ubuntu5"`; then
            rm -f /etc/modprobe.d/nvidia-340.conf
        fi
        CURRENT_KERNEL=$(uname -r)
        KERNELS=$CURRENT_KERNEL
        NEWEST_KERNEL=$(get_newest_kernel "$KERNELS")

Seriously - this has been an issue for over a year, and nobody bothered to look into it?