Keep one extras list per device instead of per version

The package lists were stored as config_<version>/packages_<device>_<version>.txt,
but the version dimension was pure duplication: the Linksys MX8500 extras were
byte-identical across 24.10.4, 25.12.0, 25.12.2 and 25.12.4, and the Cudy lists
only ever changed with the device, never with the release.

Your packages now live in packages/<device-id>.txt, one file per device and
independent of the OpenWrt version. The built-in part is fetched per release
anyway, so upgrading needs no file changes at all.

The combined list is a build artefact and moves to .generated/, which is
gitignored, along with the buildinfo saved by --save-buildinfo --offline.

This removes work rather than adding it: because the generated file is now
entirely machine-owned, the sentinel comments, the in-section replacement state
machine and the "line containing base-files and libc is the old generated one"
migration heuristic are all gone. Hand-written content is isolated in the extras
file, generated content in .generated/.

Also fix version detection when a script is run from the helper directory. The
helper checkout is its own git repository inside the OpenWrt worktree, so git
commands there described the helper repo -- a checkout of OpenWrt 25.12.5 was
reported as SNAPSHOT because the helper repo is on main. Version queries are now
anchored to the OpenWrt tree.

The config_* archives are deleted; git history keeps them. That includes
config_24.10.4/apply-dahdi-patches.sh, which only applied to 24.10.4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-05 21:18:29 -04:00
parent 0255d2f890
commit e668221b4e
26 changed files with 205 additions and 49829 deletions

View File

@@ -21,7 +21,7 @@
# --with-packages also refresh the device's package list file
# --all-profiles keep every device in the target (upstream default)
# --keep-buildbot-flags keep ALL_KMODS / SDK / IB / ... as upstream ships
# --save-buildinfo keep a copy in config_<ver>/<id>_<ver>.buildinfo
# --save-buildinfo keep a copy in .generated/<id>_<ver>.buildinfo
# --offline use a previously saved buildinfo, no network
# --output <file> write here instead of ./.config (for testing)
# --refresh ignore the cached JSON indexes
@@ -38,6 +38,7 @@ set -euo pipefail
umask 022
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
LIB_SCRIPT_DIR="$SCRIPT_DIR"
# shellcheck source=lib-openwrt-upstream.sh
source "$SCRIPT_DIR/lib-openwrt-upstream.sh"
@@ -106,7 +107,7 @@ fi
select_device "$VER"
SAVED_BUILDINFO="$SCRIPT_DIR/config_$VER/${DEV_ID}_${VER}.buildinfo"
SAVED_BUILDINFO="$SCRIPT_DIR/.generated/${DEV_ID}_${VER}.buildinfo"
SYSUPGRADE_URL=""
FACTORY_URL=""
@@ -268,8 +269,8 @@ if [ "$WITH_PACKAGES" = true ]; then
"$SCRIPT_DIR/gen-package-list.sh" "${GEN_ARGS[@]}"
else
echo "Next steps:"
echo " ./helper/gen-package-list.sh --device $DEV_ID --version $VER"
echo " ./helper/add-openwrt-packages.sh helper/config_$VER/packages_${DEV_ID//-/_}_$VER.txt"
echo " ./helper/gen-package-list.sh --device $DEV_ID --apply"
echo " (or --out/-n first if you want to review the list before applying)"
echo " make menuconfig"
echo " make -j\$(nproc) download world"
echo