Handle /proc/cpuinfo not existing (#308)

I run rpi-update within a chroot on my NFS server for my diskless
Raspberry Pis, /proc/cpuinfo isn't in the chroot. This patch handles
that more gracefully.
This commit is contained in:
Andrew Ruthven
2020-08-17 22:01:01 +12:00
committed by GitHub
parent d4d7c377a4
commit 06a1d9a641

View File

@@ -212,8 +212,12 @@ function check_eeprom_version {
return return
fi fi
rev="$(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)" rev=
if [ $(((0x$rev >> 23) & 1)) -ne 0 ] && [ $(((0x$rev >> 12) & 15)) -eq 3 ]; then if [ -f /proc/cpuinfo ]; then
rev="$(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)"
fi
if [ -n $rev ] && [ $(((0x$rev >> 23) & 1)) -ne 0 ] && [ $(((0x$rev >> 12) & 15)) -eq 3 ]; then
HAVE_BOOTLOADER_EEPROM=1 HAVE_BOOTLOADER_EEPROM=1
fi fi