CC2099
Posts: 1
Joined: Sat Nov 18, 2017 5:58 pm

rpi-update [solution for out-of-sync kernel dpkg info]

Sat Nov 18, 2017 6:19 pm

rpi-update doesn't appear to touch the raspberrypi-kernel.list & raspberrypi-kernel.md5sums in /var/lib/dpkg/info/

As a result, searching for a kernel module Eg: "dpkg-query -S zaurus" will return incomplete results at best. It will return invalid results if you delete previous kernels & kernel modules after performing the update or the kernel update provides new kernel modules.

Here's a simple BASH script to update these dpkg info files:
(The script should be run as a privileged user Eg: root)

Code: Select all

#!/bin/bash

base=/var/lib/dpkg/info/raspberrypi-kernel
list=${base}.list
md5=${base}.md5sums

echo '/.' > $list
echo '/boot' >> $list
echo '/boot/COPYING.linux' >> $list
find /boot/bcm* | sort >> $list
find /boot/kernel* | sort >> $list
find /boot/overlays | sort >> $list
echo '/etc' >> $list
echo '/etc/default' >> $list
echo '/etc/default/raspberrypi-kernel' >> $list
echo '/lib' >> $list
find /lib/modules | sort >> $list
echo '/usr' >> $list
echo '/usr/share' >> $list
echo '/usr/share/doc' >> $list
find /usr/share/doc/raspberrypi-kernel | sort >> $list

echo -n > $md5

while read -r line; do
  if [ ! -d "$line" ]; then
    md5sum $line >> $md5
  fi
done < $list

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 17 guests