mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-09-27 16:51:12 -07:00
scripts/docs: fail loudly, fix names, document bring-up-only status
install-forgefirm.sh completed silently broken when the download, flash write, mount or uEnv rewrite failed - add die() checks around every critical step (audit N13/M12) and download the release asset under the exact Scarthgap artifact name (forgefirm-image-glowforge.rootfs.wic.gz) so uploads need no renaming. ffboot no longer depends on the never- provisioned /etc/fw_env_mmcblk2.config: it falls back to /etc/fw_env.config (which both the factory and ForgeFIRM images ship, pointing at the eMMC env) and checks fw_setenv results (audit N16). BUILD.md gets the real artifact name and marks the built u-boot reference-only; INSTALL.md drops the stale script/ogboot names and the cloud-connect promise, stating the image is bring-up-only (audit N11).
This commit is contained in:
+15
-6
@@ -70,18 +70,27 @@ case "$1" in
|
||||
exit 2
|
||||
esac
|
||||
|
||||
if [ -d "/factory" ]; then
|
||||
FWCONFIG="/etc/fw_env.config"
|
||||
else
|
||||
# The env always lives on the eMMC (mmcblk2 0x80000/0x82000). On the factory
|
||||
# firmware and on the ForgeFIRM image, /etc/fw_env.config already points
|
||||
# there; the mmcblk2-specific override is honored if someone provisioned one,
|
||||
# but nothing ships it, so fall back rather than failing on a missing file
|
||||
# (audit N16).
|
||||
if [ -f "/etc/fw_env_mmcblk2.config" ] && [ ! -d "/factory" ]; then
|
||||
FWCONFIG="/etc/fw_env_mmcblk2.config"
|
||||
else
|
||||
FWCONFIG="/etc/fw_env.config"
|
||||
fi
|
||||
if [ ! -f "$FWCONFIG" ]; then
|
||||
echo "ERROR: $FWCONFIG not found; cannot switch boot device" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MMCROOT="/dev/mmcblk"$(($MMCDEV + 1))"p"$MMCPART
|
||||
|
||||
echo "Setting to boot from $MMCROOT"
|
||||
fw_setenv -c $FWCONFIG mmcdev $MMCDEV
|
||||
fw_setenv -c $FWCONFIG mmcpart $MMCPART
|
||||
fw_setenv -c $FWCONFIG mmcroot $MMCROOT
|
||||
fw_setenv -c $FWCONFIG mmcdev $MMCDEV || { echo "ERROR: fw_setenv mmcdev failed" >&2; exit 1; }
|
||||
fw_setenv -c $FWCONFIG mmcpart $MMCPART || { echo "ERROR: fw_setenv mmcpart failed" >&2; exit 1; }
|
||||
fw_setenv -c $FWCONFIG mmcroot $MMCROOT || { echo "ERROR: fw_setenv mmcroot failed" >&2; exit 1; }
|
||||
|
||||
if [ $REBOOT -gt 0 ]; then
|
||||
echo "Rebooting..."
|
||||
|
||||
Reference in New Issue
Block a user