mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
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:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user