Skip to content

Commit c48f2c5

Browse files
mingzhangqunigorpecovnik
authored andcommitted
bootscript: rename armbianEnv.txt.bak fallback to .dist
Per review feedback (#9953), the build-time fallback file must not collide with user backups. ".bak" is a common name users pick when editing armbianEnv.txt themselves, and it is easily removed during routine cleanup of "obsolete" backup files. Rename the fallback to ".dist" (distribution default), which signals a build-shipped asset rather than a user backup, and matches the upstream convention of shipping a default armbianEnv.txt under a distinguished name. Updates both the bootscript consumer and the build hook that creates the file.
1 parent ef4a0ca commit c48f2c5

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

config/bootscripts/boot-seeed-rk35xx.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test -n "${distro_bootpart}" || distro_bootpart=1
2121

2222
echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}"
2323

24-
# Load armbianEnv.txt with corruption detection and .bak fallback.
24+
# Load armbianEnv.txt with corruption detection and .dist fallback.
2525
# Power loss can fill the file with 0xFF (eMMC erased block) or ^@ (NUL,
2626
# on other storage media) which passes "env import -t" without error but
2727
# imports zero variables. Clear rootdev before import; if it remains
@@ -31,8 +31,8 @@ if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv
3131
env import -t ${load_addr} ${filesize}
3232
fi
3333
if test -z "${rootdev}"; then
34-
if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv.txt.bak; then
35-
echo "WARNING: armbianEnv.txt corrupt, loading .bak fallback"
34+
if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv.txt.dist; then
35+
echo "WARNING: armbianEnv.txt corrupt, loading .dist fallback"
3636
setenv rootdev
3737
env import -t ${load_addr} ${filesize}
3838
fi

config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,16 +511,16 @@ function post_family_tweaks__recomputer_rk35xx_disable_armbian_hardware_optimize
511511
rm -f "${SDCARD}"/lib/systemd/system/armbian-hardware-optimize.service
512512
}
513513

514-
# Create armbianEnv.txt.bak at build time.
514+
# Create armbianEnv.txt.dist at build time.
515515
# Protects against sed -i + power loss corruption.
516516
function pre_umount_final_image__recomputer_armbianenv_backup() {
517-
display_alert "$BOARD" "Creating armbianEnv.txt backup" "info"
517+
display_alert "$BOARD" "Creating armbianEnv.txt.dist fallback" "info"
518518

519519
local env_file="${MOUNT}/boot/armbianEnv.txt"
520-
local bak_file="${MOUNT}/boot/armbianEnv.txt.bak"
520+
local dist_file="${MOUNT}/boot/armbianEnv.txt.dist"
521521

522522
if [[ -f "${env_file}" ]]; then
523-
cp -a "${env_file}" "${bak_file}"
524-
display_alert "$BOARD" "armbianEnv.txt.bak created"
523+
cp -a "${env_file}" "${dist_file}"
524+
display_alert "$BOARD" "armbianEnv.txt.dist created"
525525
fi
526526
}

0 commit comments

Comments
 (0)