mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
rpi-update: Improve check and warning message for initramfs
Previously we were checking for an explicit ramfsfile= entry in config.txt, but these days using auto_initramfs=1 is more common and not checked for. Use device tree for check instead which should handle any scheme.
This commit is contained in:
13
rpi-update
13
rpi-update
@@ -419,17 +419,18 @@ function check_partition {
|
|||||||
|
|
||||||
function check_initramfs {
|
function check_initramfs {
|
||||||
local INITRAMFS=""
|
local INITRAMFS=""
|
||||||
if command -v vcgencmd > /dev/null; then
|
if ! [[ -f "/proc/device-tree/chosen/linux,initrd-start" ]]; then
|
||||||
INITRAMFS="$(echo =$(vcgencmd get_config ramfsfile) | cut -d'=' -f3)"
|
|
||||||
fi
|
|
||||||
if [ "$INITRAMFS" == "" ]; then
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [[ ${SKIP_WARNING} -ne 0 ]]; then
|
if [[ ${SKIP_WARNING} -ne 0 ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
echo "Updating a system with initramfs configured is not supported by rpi-update"
|
echo ""
|
||||||
echo "This could result in a system that will not boot."
|
echo "Updating a system with initramfs configured is not supported by rpi-update."
|
||||||
|
echo "If your system relies on drivers provided by the initramfs (e.g. custom filesystem options)"
|
||||||
|
echo "it may not boot without regenerating the initramfs."
|
||||||
|
echo "If you are unsure, test if your system boots with initramfs options disabled from config.txt"
|
||||||
|
echo ""
|
||||||
read -p "Would you like to proceed? (y/N)" -n 1 -r -s
|
read -p "Would you like to proceed? (y/N)" -n 1 -r -s
|
||||||
echo ""
|
echo ""
|
||||||
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
|
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user