mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
odroidm1: fix flashcp --partition non-usage for old mtd-utils (bullseye etc)
This commit is contained in:
@@ -39,8 +39,17 @@ function post_family_config__uboot_config() {
|
||||
# We don't use u-boot-rockchip-spi.bin here; instead, write SPL and u-boot individually
|
||||
# If we're deinfesting from Petitboot, clear the environment too; PREBOOT will save a new one for mainline
|
||||
function write_uboot_platform_mtd() {
|
||||
flashcp -v -p "${1}/idbloader-spi.img" /dev/mtd0 # write SPL
|
||||
flashcp -v -p "${1}/u-boot.itb" /dev/mtd2 # write u-boot
|
||||
declare extra_opts_flashcp="-p" # -p is: "read the flash and only write blocks that are actually different"
|
||||
# if on bullseye, flashcp/mtd-utils is old, and doesn't have --partition/-p
|
||||
if flashcp -h | grep -q -e '--partition'; then
|
||||
echo "Confirmed flashcp supports --partition/-p -- read and write only changed blocks." >&2
|
||||
else
|
||||
extra_opts_flashcp=""
|
||||
echo "flashcp does not support --partition/-p, will write full SPI flash blocks." >&2
|
||||
fi
|
||||
|
||||
flashcp -v "${extra_opts_flashcp}" "${1}/idbloader-spi.img" /dev/mtd0 # write SPL
|
||||
flashcp -v "${extra_opts_flashcp}" "${1}/u-boot.itb" /dev/mtd2 # write u-boot
|
||||
if fw_printenv | grep -q -i petitboot; then # Petitboot leaves a horrible env behind, clear it off if so
|
||||
echo "Found traces of Petitboot in SPI u-boot environment, clearing SPI environment..." >&2
|
||||
flash_erase /dev/mtd1 0 0 # clear u-boot env
|
||||
|
||||
Reference in New Issue
Block a user