rpi-update
可能无法开机(引导)、无法恢复,仅可重装。
为了解决"Module .. not found in directory /lib/modules/.."、"raspberrypi-kernel-headers"进行的尝试,但导致了故障。
命令
Raspberry Pi Documentation - Raspberry Pi OS
-
will update OS kernel and VideoCore firmware to the latest pre-release versions.
options documented in the rpi-update repository.
-
提到backup与get back (if bootable).
rpi-update
repository
raspberrypi/rpi-update: An easier way to update the firmware of your Raspberry Pi (github.com)
参数(options)中提及backup。
making backup of /boot
and /lib/modules
。
参见执行过程中的备份、更新。
升级至指定版本
upgrade / downgrade
如rpi-update 3750f3204096f6bb365ceaf484a496584e46782b
(对应4.19.66)
You need to use rpi-update with the relevant commit hash as described in the rpi-update docs https://github.com/Hexxeh/rpi-update/blob/master/README.md. You can get the commit hash from the rpi-firmware repo https://github.com/Hexxeh/rpi-firmware/commits/master(见restore/recover backup)
Hash values for all commits can be found at: https://github.com/Hexxeh/rpi-firmware/commits
执行过程
初次运行rpi-update
命令时会建立备份(backup)
$ sudo rpi-update
* Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
* Performing self-update
* Relaunching after update
* Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
* We're running for the first time
* Backing up files (this will take a few minutes)
* Backing up firmware
* Backing up modules 5.10.17-v7l+
#######################################################
WARNING: This update bumps to rpi-5.15.y linux tree
See: https://forums.raspberrypi.com/viewtopic.php?t=322879
'rpi-update' should only be used if there is a specific
reason to do so - for example, a request by a Raspberry Pi
engineer or if you want to help the testing effort
and are comfortable with restoring if there are regressions.
DO NOT use 'rpi-update' as part of a regular update process.
########################################################
* Updating firmware
* Updating kernel modules
* depmod 5.15.49+
* depmod 5.15.49-v8+
* depmod 5.15.49-v7l+
* depmod 5.15.49-v7+
* Updating VideoCore libraries
* Using HardFP libraries
* Updating SDK
* Running ldconfig
* Storing current firmware revision
* Deleting downloaded files
* Syncing changes to disk
* If no errors appeared, your firmware was successfully updated to 1a0493c1fd14b30a6055899b803b0ba3812a84d6
以上过程提及备份、更新:
- backing up - firmware, modules <版本>,
- updating - firmware, kernel modules, VideoCore libraries, SDK
restore/recover backup
-
当可以进入系统(bootable),使用命令
sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
-
当不可引导,尝试:
(我尝试失败,参见故障)-
How to use the backup created by rpi-update? · Issue #273 · Hexxeh/rpi-update (github.com)提及:
- a backup of
/boot
called/boot.bak
- a backup of
/lib/modules
called/lib/modules.bak
. - (见论坛提及
rpi-update
除以上路径,还会改变/opt/vc?
(VideoCore),但未见backup)
- a backup of
-
Option to restore backup · Issue #287 · Hexxeh/rpi-update (github.com)
-
Moving Linux Kernel to 5.15 - Raspberry Pi Forums
rpi-update
命令执行时给出的链接。-
Q: How do I get back to 5.15 at this point, since full-upgrade downgraded to 5.10?
A: Delete /boot/.firmware_revision, then reissue sudo rpi-update next -- now back at 5.15.0-v71+. -
sudo rm /boot/.firmware_revision
BRANCH=next sudo rpi-updateupdate '.firmware_revision' and overwrite the first six bytes with 'aabbcc' to avoid rpi-update taking a backup.
没有找到'.firmware_revision'
-
-
Downgrade Firmware - Raspberry Pi Forums
All the original files were saved by
rpi-update
, but there's no-revert
switch or the like
-
变更对照
-
modules
以下modules文件夹是原始的,modules.broken是
rpi-update
改动后的。
(rpi-update
会把原始的加后缀".bak"更名以备份,此处是我改回原名,并更名改动后的加后缀".broken"更名以留存)$ ls -l modules* modules: total 4 drwxr-xr-x 4 root root 4096 Jun 27 11:15 5.10.17-v7l+ modules.broken: total 44 drwxr-xr-x 4 root root 4096 Jun 27 14:17 4.19.66+ drwxr-xr-x 4 root root 4096 Jun 27 14:17 4.19.66-v7+ drwxr-xr-x 3 root root 4096 Jun 27 14:17 4.19.66-v7l+ drwxr-xr-x 3 root root 4096 May 7 2021 5.10.17+ drwxr-xr-x 3 root root 4096 May 7 2021 5.10.17-v7+ drwxr-xr-x 4 root root 4096 Jun 27 11:15 5.10.17-v7l+ drwxr-xr-x 3 root root 4096 May 7 2021 5.10.17-v8+ drwxr-xr-x 3 root root 4096 Jun 27 12:35 5.15.49+ drwxr-xr-x 3 root root 4096 Jun 27 12:35 5.15.49-v7+ drwxr-xr-x 3 root root 4096 Jun 27 13:49 5.15.49-v7l+ drwxr-xr-x 3 root root 4096 Jun 27 12:35 5.15.49-v8+ modules-load.d: total 0
-
boot
rpi-update
执行后仅生成了名为boot的空文件夹?
(有待用ls -a
确认)(
rpi-update
后reboot
未能成功启动,所以boot为空?)
感觉modules变化不至于导致无法启动,而变动后的boot为空很异常,而且不应只有这些改变。
参考执行过程中的备份、更新。
故障
- 使用
rpi-update
命令自动升级至最新,重启正常,但未达到预期;
中途包含尝试升级至指定版本。 - 指定版本参数进行降级(降级但非恢复,指定的非初始版本),重启后,无法进入系统,报错'unsupport board type'(ACT Green LED 4长4短所表示,参见LED Warning Flash Codes - Raspberry Pi Documentation - Configuration)。
参考执行过程中的备份、更新。
访问tf卡
不可引导、启动时,尝试访问microSD(tf)卡,手动恢复。
-
读卡器(OTG)+Android,"ES文件浏览器"只能看到vfat分区。
锤子系统自带文件管理器,除vfat分区,可以看到ext4分区,但内容为空;
华为系统仅识别fat分区。 -
Windows电脑上安装软件+读卡器,仅可看到fat分区。
参考:Reading SD Card with Windows - Raspberry Pi Forums
提及安卓手机、DiskInternals。 -
另外用U盘制作Raspbian系统(选了最新版本、Lite版),可以识别、挂载,正常访问。
参考External Storage Configuration
涉及命令sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL
、sudo blkid
(get the location of the disk partition)、sudo mount /dev/sda1 /mnt/mydisk
(挂载)
涉及路径"/dev/sdxy"。 -
diskgenius
How To Access Ext4 Partition in Windows 10/8/7? (diskgenius.com)
支持全面访问。
需访问的最终目标,参见restore/recover backup。
内核版本
以uname
(-a
)查询为准。
与/lib/modules/
、/usr/src
(、/usr/share/..
)可能不一致。
版本不一致,但不是问题,参考:Installing Kernel Headers for Raspbian and understanding the internals of apt install
关键词:recover restore backup access read tf microSD from Windows, Firmware#, rpi-update
#, raspberry-kernel#