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

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
# Generated artefacts: full package lists and saved buildinfo.
# Regenerate with gen-package-list.sh / download-config.sh --save-buildinfo
.generated/

View File

@@ -1,7 +1,7 @@
# OpenWrt Build Helper Scripts
## Overview
This repository contains shell scripts that streamline preparing, configuring, and building OpenWrt from source on Debian/Ubuntu systems (x86_64 and ARM64). It also includes convenience utilities to manage package selections, fetch device config.buildinfo, apply a DAHDI driver patch, and add external LuCI packages.
This repository contains shell scripts that streamline preparing, configuring, and building OpenWrt from source on Debian/Ubuntu systems (x86_64 and ARM64). It also includes convenience utilities to manage package selections, fetch a device's official configuration, and add external LuCI packages.
## Whats included
- prepare-openwrt-env.sh
@@ -32,9 +32,9 @@ This repository contains shell scripts that streamline preparing, configuring, a
- Downloads to a temp file and validates it before touching .config, and keeps a .config.download.bak.
- Prints the official sysupgrade/factory URLs (taken from profiles.json, so they are always correct) and a Firmware Selector link.
- gen-package-list.sh
- Generates the `##built-in` package list for a device from the official profiles.json (default_packages + device_packages + the packages the Firmware Selector adds), so it no longer has to be copied by hand for each release.
- Writes config_<version>/packages_<device>_<version>.txt, replacing only the generated block and preserving your own packages and the `##module` section verbatim.
- `--stdout` prints the list, `--apply` applies it straight to .config.
- Builds a device's complete package list: the built-in part from the official profiles.json (default_packages + device_packages + the packages the Firmware Selector adds), combined with your own packages from `packages/<device-id>.txt`.
- The built-in part never has to be copied by hand for a new release, and your packages are version independent — a new release needs no file changes at all.
- Writes the combined list to `.generated/` (not kept in git); `--apply` applies it straight to .config, `--full-stdout` just prints it.
- add-openwrt-packages.sh
- Applies a package list to .config: `##built-in` → =y, `##module` → =m, `##remove` or a `-pkg` prefix → =n.
- Rewrites existing CONFIG_PACKAGE_ lines in place, so repeated runs do not grow .config.
@@ -42,11 +42,7 @@ This repository contains shell scripts that streamline preparing, configuring, a
- After make defconfig it reports any package whose final state differs from what you asked for (a dependency pulling a removed package back in, for example).
- update-go-path.sh
- Detects the latest Go installation under /usr/lib/go-* and sets CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT in .config.
- apply-dahdi-patches.sh
- Writes a DAHDI driver patch into package/feeds/telephony/dahdi-linux/patches/300-fix-dahdi-max-attempts.patch.
- Fixes MAX macro naming collisions in multiple DAHDI modules for OpenWrt 24.10.4 builds.
## System requirements
- OS: Debian/Ubuntu, Fedora/RHEL, Arch, openSUSE or Alpine (the other scripts are developed and tested on Debian/Ubuntu)
- Architectures: x86_64/amd64 and aarch64/arm64
- Tools: git, wget, curl, bash, python3 (used to read the official JSON indexes; jq is not required)
@@ -83,25 +79,43 @@ This repository contains shell scripts that streamline preparing, configuring, a
- Add `--with-packages` to also generate the device's package list in the same run.
- Preview without changing anything: `./helper/download-config.sh --device linksys_mx8500 -n`
5) Enable additional packages from a list (optional)
- Generate the built-in list for your device:
5) Enable additional packages (optional)
- Your own packages live in `helper/packages/<device-id>.txt`, one file per device, independent of the OpenWrt version.
- Apply the built-in list plus your packages in one step:
- ./helper/gen-package-list.sh --device linksys_mx8500 --apply
- Or write the combined list out first and review it before applying:
- ./helper/gen-package-list.sh --device linksys_mx8500
- Edit config_<version>/packages_<device>_<version>.txt and add your own packages below the generated block.
- Apply it from the OpenWrt root:
- ./helper/add-openwrt-packages.sh helper/config_<version>/packages_<device>_<version>.txt
- ./helper/add-openwrt-packages.sh helper/.generated/packages_linksys_mx8500_<version>.txt
### Adding a device
1. `./helper/gen-package-list.sh --device <id> --init-extras` — creates `packages/<id>.txt`
2. Edit `packages/<id>.txt` and list the packages you want on top of the defaults
3. `./helper/gen-package-list.sh --device <id> --apply`
Use `./helper/download-config.sh` without `--device` to search for the id by name.
### Upgrading to a new OpenWrt release
Nothing to edit. Check out the new version, then:
```
./helper/download-config.sh --device <id> -y
./helper/gen-package-list.sh --device <id> --apply -y
```
The built-in list is re-fetched for the new release and your `packages/<id>.txt` is reused as is.
### Files
- `packages/<device-id>.txt` — your packages, one file per device, kept in git and edited by hand.
- `.generated/` — combined package lists and saved buildinfo. Build artefacts, not kept in git.
### Package list format
Used by both `packages/<device-id>.txt` and the generated lists:
```
##built-in packages after this are set to =y (the default)
# >>> generated built-in list - do not edit by hand
... regenerated by gen-package-list.sh; do not edit
# <<< generated built-in list
curl yq luci-app-ttyd your own packages, any number per line
curl yq luci-app-ttyd packages, any number per line, set to =y
-luci-app-wol a leading '-' removes a package (=n)
##module packages after this are set to =m
##remove packages after this are set to =n
##built-in back to =y (the default)
pkg # note text after a single '#' is a comment
```
Text after a single `#` is a comment. Everything outside the generated block is preserved when the list is regenerated.
### Buildbot flags
The official config.buildinfo is the buildbot's own configuration: it enables every
@@ -121,17 +135,14 @@ and `--all-profiles` to build every model in the target.
- This sets CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT to the latest /usr/lib/go-X.XX/ found.
- You can override it manually in .config if necessary.
7) Apply DAHDI patch (only if you build telephony/dahdi-linux)
- Ensure telephony feed is installed:
- ./scripts/feeds update telephony
- ./scripts/feeds install -a
- Then run:
- ./helper/config_24.10.4/apply-dahdi-patches.sh
- Build the package:
- make package/feeds/telephony/dahdi-linux/{clean,prepare} V=s
- make package/feeds/telephony/dahdi-linux/compile V=s
8) Build OpenWrt
- Build the package:
- Common commands:
- make menuconfig
- make -j$(nproc) download world
@@ -153,8 +164,6 @@ and `--all-profiles` to build every model in the target.
- The script installs cross multilib packages for better compatibility, but not all targets need them. If apt errors on specific multilib packages, remove or adjust as appropriate for your environment.
## Troubleshooting
- Telephony feed not found when applying DAHDI patch:
- Run feeds update/install for telephony as shown above.
- Version detection in download-config.sh:
- It uses, in order: an explicit `--version`/`--snapshot`; the exact tag at HEAD; the branch (`main`/`master` → SNAPSHOT, `openwrt-XX.YY` → the newest matching tag merged into HEAD); otherwise it asks. If HEAD is ahead of the tag it warns that the downloaded config describes the release rather than your tree.
- If the device symbol does not survive `make defconfig`, the script stops and tells you the tree does not match that release, and points at the .config.download.bak it kept.

View File

@@ -1,148 +0,0 @@
#!/bin/bash
# Apply DAHDI driver patch for OpenWRT 24.10.4
# Fixes MAX macro naming issues in dahdi-linux modules
# Author: ChatGPT (for Zhe Yuan)
set -e
umask 022
PATCH_DIR="package/feeds/telephony/dahdi-linux/patches"
PATCH_FILE="$PATCH_DIR/300-fix-dahdi-max-attempts.patch"
echo "========================================"
echo " DAHDI Linux Patch Applier for OpenWRT"
echo "========================================"
# --- Check if inside OpenWRT source directory ---
if [ ! -f "feeds.conf.default" ] || [ ! -d "package" ]; then
echo "[ERROR] This script must be run inside the OpenWRT root directory."
echo "Please 'cd' to your OpenWRT source root and run again."
exit 1
fi
# --- Check if dahdi patch directory exists ---
if [ ! -d "$PATCH_DIR" ]; then
echo "[ERROR] Patch directory not found:"
echo " $PATCH_DIR"
echo
echo "Please make sure telephony feed is installed:"
echo " ./scripts/feeds update telephony"
echo " ./scripts/feeds install -a"
exit 1
fi
# --- Create patch file ---
echo "[INFO] Writing DAHDI patch to: $PATCH_FILE"
cat > "$PATCH_FILE" <<'EOF'
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -1516,16 +1516,16 @@ static int wait_access(struct wctdm *wc, struct wctdm_module *const mod)
{
unsigned char data = 0;
int count = 0;
- #define MAX 10 /* attempts */
+ #define MAX_ATTEMPTS 10 /* attempts */
/* Wait for indirect access */
- while (count++ < MAX) {
+ while (count++ < MAX_ATTEMPTS) {
data = wctdm_getreg(wc, mod, I_STATUS);
if (!data)
return 0;
}
- if (count > (MAX-1)) {
+ if (count > (MAX_ATTEMPTS-1)) {
dev_notice(&wc->vb.pdev->dev,
" ##### Loop error (%02x) #####\n", data);
}
--- a/drivers/dahdi/opvxa1200/base.c
+++ b/drivers/dahdi/opvxa1200/base.c
@@ -868,12 +868,12 @@ static int wait_access(struct wctdm *wc, int card)
long origjiffies;
int count = 0;
- #define MAX 6000 /* attempts */
+ #define MAX_ATTEMPTS 6000 /* attempts */
origjiffies = jiffies;
/* Wait for indirect access */
- while (count++ < MAX)
+ while (count++ < MAX_ATTEMPTS)
{
data = __wctdm_getreg(wc, card, I_STATUS);
@@ -882,7 +882,7 @@ static int wait_access(struct wctdm *wc, int card)
}
- if(count > (MAX-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);
+ if(count > (MAX_ATTEMPTS-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);
return 0;
}
--- a/drivers/dahdi/wcaxx-base.c
+++ b/drivers/dahdi/wcaxx-base.c
@@ -1066,16 +1066,16 @@ static int wait_access(struct wcaxx *wc, struct wcaxx_module *const mod)
unsigned char data = 0;
int count = 0;
- #define MAX 10 /* attempts */
+ #define MAX_ATTEMPTS 10 /* attempts */
/* Wait for indirect access */
- while (count++ < MAX) {
+ while (count++ < MAX_ATTEMPTS) {
data = wcaxx_getreg(wc, mod, I_STATUS);
if (!data)
return 0;
}
- if (count > (MAX-1)) {
+ if (count > (MAX_ATTEMPTS-1)) {
dev_notice(&wc->xb.pdev->dev,
" ##### Loop error (%02x) #####\n", data);
}
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -623,11 +623,11 @@ static int wait_access(struct wctdm *wc, int card)
unsigned char data = 0;
int count = 0;
- #define MAX 6000 /* attempts */
+ #define MAX_ATTEMPTS 6000 /* attempts */
/* Wait for indirect access */
- while (count++ < MAX)
+ while (count++ < MAX_ATTEMPTS)
{
data = __wctdm_getreg(wc, card, I_STATUS);
@@ -636,7 +636,7 @@ static int wait_access(struct wctdm *wc, int card)
}
- if(count > (MAX-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);
+ if(count > (MAX_ATTEMPTS-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);
return 0;
}
EOF
echo "[SUCCESS] Patch written successfully!"
echo
echo "========================================"
echo "✅ DAHDI patch applied successfully!"
echo " File: $PATCH_FILE"
echo "========================================"
echo
echo "👉 Next step:"
echo " make package/feeds/telephony/dahdi-linux/{clean,prepare} V=s"
echo " make package/feeds/telephony/dahdi-linux/compile V=s"
echo

View File

@@ -1,193 +0,0 @@
CONFIG_TARGET_mediatek=y
CONFIG_TARGET_mediatek_filogic=y
CONFIG_TARGET_mediatek_filogic_DEVICE_cudy_tr3000-v1=y
CONFIG_ALL_KMODS=y
CONFIG_ALL_NONSHARED=y
CONFIG_DEVEL=y
CONFIG_AUTOREMOVE=y
CONFIG_BUILDBOT=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_EASYTIER_INCLUDE_WEBCONSOLE=y
CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/usr/lib/go-1.22/"
CONFIG_IB=y
CONFIG_IMAGEOPT=y
CONFIG_JSON_CYCLONEDX_SBOM=y
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NGHTTP2=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_LIBCURL_UNIX_SOCKETS=y
CONFIG_MAKE_TOOLCHAIN=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_IDEA=y
CONFIG_OPENSSL_WITH_MDC2=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SEED=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_OPENSSL_WITH_WHIRLPOOL=y
CONFIG_PACKAGE_adguardhome=y
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_e2fsprogs=m
CONFIG_PACKAGE_easytier=y
CONFIG_PACKAGE_etherwake=y
CONFIG_PACKAGE_f2fsck=m
CONFIG_PACKAGE_fdisk=m
CONFIG_PACKAGE_ip-full=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_iperf3=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-nft=y
CONFIG_PACKAGE_kmod-inet-diag=y
CONFIG_PACKAGE_kmod-ip6tables=y
CONFIG_PACKAGE_kmod-ipt-conntrack=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-core=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-ipt-ipset=y
CONFIG_PACKAGE_kmod-nf-conncount=y
CONFIG_PACKAGE_kmod-nf-ipt=y
CONFIG_PACKAGE_kmod-nf-ipt6=y
CONFIG_PACKAGE_kmod-nf-socket=y
CONFIG_PACKAGE_kmod-nf-tproxy=y
CONFIG_PACKAGE_kmod-nft-compat=y
CONFIG_PACKAGE_kmod-nft-socket=y
CONFIG_PACKAGE_kmod-nft-tproxy=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_libatomic=y
CONFIG_PACKAGE_libblkid=m
CONFIG_PACKAGE_libbpf=y
CONFIG_PACKAGE_libbz2=y
CONFIG_PACKAGE_libcap=y
CONFIG_PACKAGE_libcap-ng=y
CONFIG_PACKAGE_libcomerr=m
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libe2p=m
CONFIG_PACKAGE_libelf=y
CONFIG_PACKAGE_libext2fs=m
CONFIG_PACKAGE_libf2fs=m
CONFIG_PACKAGE_libfdisk=m
CONFIG_PACKAGE_libiperf3=y
CONFIG_PACKAGE_libipset=y
CONFIG_PACKAGE_libiptext=y
CONFIG_PACKAGE_libiptext-nft=y
CONFIG_PACKAGE_libiptext6=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_liblucihttp-ucode=y
CONFIG_PACKAGE_libminiupnpc=y
CONFIG_PACKAGE_libnatpmp=y
CONFIG_PACKAGE_libncurses=m
CONFIG_PACKAGE_libnghttp2=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libpython3=y
CONFIG_PACKAGE_librespeed-go=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libsmartcols=m
CONFIG_PACKAGE_libss=m
CONFIG_PACKAGE_libstdcpp=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuuid=y
CONFIG_PACKAGE_libuv=y
CONFIG_PACKAGE_libwebsockets-full=y
CONFIG_PACKAGE_libxtables=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-easytier=y
CONFIG_PACKAGE_luci-app-filemanager=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-mwan3=y
CONFIG_PACKAGE_luci-app-netspeedtest=y
CONFIG_PACKAGE_luci-app-package-manager=y
CONFIG_PACKAGE_luci-app-ttyd=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-app-wol=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-lib-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-light=y
CONFIG_PACKAGE_luci-lua-runtime=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-ssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_miniupnpd-nftables=y
CONFIG_PACKAGE_mkf2fs=m
CONFIG_PACKAGE_mt7986-wo-firmware=m
CONFIG_PACKAGE_mt7988-2p5g-phy-firmware=m
CONFIG_PACKAGE_mt7988-wo-firmware=m
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_partx-utils=m
CONFIG_PACKAGE_px5g-mbedtls=y
CONFIG_PACKAGE_python3-base=y
CONFIG_PACKAGE_python3-codecs=y
CONFIG_PACKAGE_python3-email=y
CONFIG_PACKAGE_python3-light=y
CONFIG_PACKAGE_python3-logging=y
CONFIG_PACKAGE_python3-openssl=y
CONFIG_PACKAGE_python3-pkg-resources=y
CONFIG_PACKAGE_python3-speedtest-cli=y
CONFIG_PACKAGE_python3-urllib=y
CONFIG_PACKAGE_python3-xml=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_rpcd-mod-ucode=y
CONFIG_PACKAGE_tailscale=y
CONFIG_PACKAGE_terminfo=m
CONFIG_PACKAGE_ttyd=y
CONFIG_PACKAGE_ucode-mod-html=y
CONFIG_PACKAGE_ucode-mod-lua=y
CONFIG_PACKAGE_ucode-mod-math=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_unzip=y
CONFIG_PACKAGE_wpad=y
# CONFIG_PACKAGE_wpad-basic-mbedtls is not set
CONFIG_PACKAGE_xtables-nft=y
CONFIG_PACKAGE_yq=y
CONFIG_PACKAGE_zerotier=y
CONFIG_PACKAGE_zlib=y
CONFIG_PACKAGE_zyxel-bootconfig=m
CONFIG_REPRODUCIBLE_DEBUG_INFO=y
CONFIG_SDK=y
CONFIG_SDK_LLVM_BPF=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_BUG_URL=""
CONFIG_VERSION_CODE=""
CONFIG_VERSION_DIST="OpenWrt"
CONFIG_VERSION_FILENAMES=y
CONFIG_VERSION_HOME_URL=""
CONFIG_VERSION_HWREV=""
CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_MANUFACTURER_URL=""
CONFIG_VERSION_NUMBER=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_REPO="https://downloads.openwrt.org/releases/24.10.4"
CONFIG_VERSION_SUPPORT_URL=""

View File

@@ -1,196 +0,0 @@
CONFIG_TARGET_qualcommax=y
CONFIG_TARGET_qualcommax_ipq807x=y
CONFIG_TARGET_qualcommax_ipq807x_DEVICE_linksys_mx8500=y
CONFIG_ALL_KMODS=y
CONFIG_ALL_NONSHARED=y
CONFIG_DEVEL=y
CONFIG_AUTOREMOVE=y
CONFIG_BUILDBOT=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_EASYTIER_INCLUDE_WEBCONSOLE=y
CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/usr/lib/go-1.22/"
CONFIG_IB=y
CONFIG_IMAGEOPT=y
CONFIG_JSON_CYCLONEDX_SBOM=y
CONFIG_KERNEL_BUILD_DOMAIN="buildhost"
CONFIG_KERNEL_BUILD_USER="builder"
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NGHTTP2=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_LIBCURL_UNIX_SOCKETS=y
CONFIG_MAKE_TOOLCHAIN=y
CONFIG_OPENSSL_ENGINE=y
CONFIG_OPENSSL_WITH_ASM=y
CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y
CONFIG_OPENSSL_WITH_CMS=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_IDEA=y
CONFIG_OPENSSL_WITH_MDC2=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SEED=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_OPENSSL_WITH_TLS13=y
CONFIG_OPENSSL_WITH_WHIRLPOOL=y
CONFIG_PACKAGE_adguardhome=y
CONFIG_PACKAGE_ath10k-board-qca9887=m
CONFIG_PACKAGE_ath10k-board-qca9984=m
CONFIG_PACKAGE_ath10k-firmware-qca9887-ct=m
CONFIG_PACKAGE_ath10k-firmware-qca9984-ct=m
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_cloudflared=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_easytier=y
CONFIG_PACKAGE_etherwake=y
CONFIG_PACKAGE_f2fs-tools=m
CONFIG_PACKAGE_f2fsck=m
CONFIG_PACKAGE_ip-full=y
CONFIG_PACKAGE_ip-tiny=y
CONFIG_PACKAGE_ip6tables-nft=y
CONFIG_PACKAGE_iperf3=y
CONFIG_PACKAGE_ipset=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-nft=y
CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y
CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=y
CONFIG_PACKAGE_kmod-crypto-lib-curve25519=y
CONFIG_PACKAGE_kmod-crypto-lib-poly1305=y
CONFIG_PACKAGE_kmod-inet-diag=y
CONFIG_PACKAGE_kmod-ip6tables=y
CONFIG_PACKAGE_kmod-ipt-conntrack=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-core=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-ipt-ipset=y
CONFIG_PACKAGE_kmod-mtd-rw=y
CONFIG_PACKAGE_kmod-nf-conncount=y
CONFIG_PACKAGE_kmod-nf-ipt=y
CONFIG_PACKAGE_kmod-nf-ipt6=y
CONFIG_PACKAGE_kmod-nf-socket=y
CONFIG_PACKAGE_kmod-nf-tproxy=y
CONFIG_PACKAGE_kmod-nft-compat=y
CONFIG_PACKAGE_kmod-nft-socket=y
CONFIG_PACKAGE_kmod-nft-tproxy=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-udptunnel4=y
CONFIG_PACKAGE_kmod-udptunnel6=y
CONFIG_PACKAGE_kmod-wireguard=y
CONFIG_PACKAGE_libatomic=y
CONFIG_PACKAGE_libbpf=y
CONFIG_PACKAGE_libbz2=y
CONFIG_PACKAGE_libcap=y
CONFIG_PACKAGE_libcap-ng=y
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libelf=y
CONFIG_PACKAGE_libf2fs=m
CONFIG_PACKAGE_libiperf3=y
CONFIG_PACKAGE_libipset=y
CONFIG_PACKAGE_libiptext=y
CONFIG_PACKAGE_libiptext-nft=y
CONFIG_PACKAGE_libiptext6=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_liblucihttp-ucode=y
CONFIG_PACKAGE_libminiupnpc=y
CONFIG_PACKAGE_libnatpmp=y
CONFIG_PACKAGE_libnghttp2=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_libpython3=y
CONFIG_PACKAGE_libqrencode=y
CONFIG_PACKAGE_librespeed-go=y
CONFIG_PACKAGE_libstdcpp=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuv=y
CONFIG_PACKAGE_libwebsockets-full=y
CONFIG_PACKAGE_libxtables=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-cloudflared=y
CONFIG_PACKAGE_luci-app-easytier=y
CONFIG_PACKAGE_luci-app-filemanager=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-mwan3=y
CONFIG_PACKAGE_luci-app-netspeedtest=y
CONFIG_PACKAGE_luci-app-openvpn=y
CONFIG_PACKAGE_luci-app-package-manager=y
CONFIG_PACKAGE_luci-app-ttyd=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-app-wol=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-lib-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-lib-uqr=y
CONFIG_PACKAGE_luci-light=y
CONFIG_PACKAGE_luci-lua-runtime=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-proto-wireguard=y
CONFIG_PACKAGE_luci-ssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_miniupnpd-nftables=y
CONFIG_PACKAGE_mkf2fs=m
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_px5g-mbedtls=y
CONFIG_PACKAGE_python3-base=y
CONFIG_PACKAGE_python3-codecs=y
CONFIG_PACKAGE_python3-email=y
CONFIG_PACKAGE_python3-light=y
CONFIG_PACKAGE_python3-logging=y
CONFIG_PACKAGE_python3-openssl=y
CONFIG_PACKAGE_python3-pkg-resources=y
CONFIG_PACKAGE_python3-speedtest-cli=y
CONFIG_PACKAGE_python3-urllib=y
CONFIG_PACKAGE_python3-xml=y
CONFIG_PACKAGE_qrencode=y
CONFIG_PACKAGE_resolveip=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_rpcd-mod-ucode=y
CONFIG_PACKAGE_tailscale=y
CONFIG_PACKAGE_ttyd=y
CONFIG_PACKAGE_ucode-mod-html=y
CONFIG_PACKAGE_ucode-mod-lua=y
CONFIG_PACKAGE_ucode-mod-math=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_unzip=y
CONFIG_PACKAGE_wireguard-tools=y
CONFIG_PACKAGE_xtables-nft=y
CONFIG_PACKAGE_yq=y
CONFIG_PACKAGE_zerotier=y
CONFIG_PACKAGE_zlib=y
CONFIG_REPRODUCIBLE_DEBUG_INFO=y
CONFIG_SDK=y
CONFIG_SDK_LLVM_BPF=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_BUG_URL=""
CONFIG_VERSION_CODE=""
CONFIG_VERSION_DIST="OpenWrt"
CONFIG_VERSION_FILENAMES=y
CONFIG_VERSION_HOME_URL=""
CONFIG_VERSION_HWREV=""
CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_MANUFACTURER_URL=""
CONFIG_VERSION_NUMBER=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_REPO="https://downloads.openwrt.org/releases/24.10.4"
CONFIG_VERSION_SUPPORT_URL=""

View File

@@ -1,3 +0,0 @@
base-files ca-bundle dnsmasq dropbear firewall4 fitblk fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload kmod-phy-aquantia libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware luci
curl yq unzip ip-full kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

View File

@@ -1,3 +0,0 @@
base-files ca-bundle dnsmasq dropbear firewall4 fitblk fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload kmod-phy-aquantia libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware luci
curl yq unzip ip-full kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

View File

@@ -1,3 +0,0 @@
ath11k-firmware-ipq8074 base-files ca-bundle dnsmasq dropbear e2fsprogs firewall4 fstools kmod-ath11k-ahb kmod-fs-ext4 kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload kmod-phy-aquantia kmod-qca-nss-dp kmod-usb-dwc3 kmod-usb-dwc3-qcom kmod-usb3 libc libgcc libustream-mbedtls logd losetup mtd netifd nftables odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-leds-pca963x ipq-wifi-linksys_mx8500 kmod-ath11k-pci ath11k-firmware-qcn9074 kmod-bluetooth luci
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
apk-mbedtls base-files ca-bundle dnsmasq dropbear firewall4 fitblk fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware luci
curl yq unzip ip-full kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

View File

@@ -1,3 +0,0 @@
apk-mbedtls ath11k-firmware-ipq8074 base-files ca-bundle dnsmasq dropbear e2fsprogs firewall4 fstools kmod-ath11k-ahb kmod-fs-ext4 kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload kmod-phy-aquantia kmod-qca-nss-dp kmod-usb-dwc3 kmod-usb-dwc3-qcom kmod-usb3 libc libgcc libustream-mbedtls logd losetup mtd netifd nftables odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-leds-pca963x ipq-wifi-linksys_mx8500 kmod-ath11k-pci ath11k-firmware-qcn9074 kmod-hci-uart luci
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +0,0 @@
##built-in
apk-mbedtls base-files ca-bundle dnsmasq dropbear firewall4 fitblk fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware luci luci-app-attendedsysupgrade
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft
luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier
##module

View File

@@ -1,9 +0,0 @@
##built-in
apk-mbedtls base-files ca-bundle dnsmasq dropbear firewall4 fitblk fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad kmod-usb3 kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware luci luci-app-attendedsysupgrade
iptables-nft ip6tables-nft curl yq unzip ip-full kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun
luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier
##module

View File

@@ -1,8 +0,0 @@
##built-in
apk-mbedtls ath11k-firmware-ipq8074 base-files ca-bundle dnsmasq dropbear e2fsprogs firewall4 fstools kmod-ath11k-ahb kmod-fs-ext4 kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload kmod-phy-aquantia kmod-qca-nss-dp kmod-usb-dwc3 kmod-usb-dwc3-qcom kmod-usb3 libc libgcc libustream-mbedtls logd losetup mtd netifd nftables odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-leds-pca963x ipq-wifi-linksys_mx8500 kmod-ath11k-pci ath11k-firmware-qcn9074 kmod-hci-uart luci luci-app-attendedsysupgrade
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft
luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier
##module

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
##built-in
apk-mbedtls ath11k-firmware-ipq8074 base-files ca-bundle dnsmasq dropbear e2fsprogs firewall4 fstools kmod-ath11k-ahb kmod-fs-ext4 kmod-gpio-button-hotplug kmod-leds-gpio kmod-nft-offload kmod-phy-aquantia kmod-qca-nss-dp kmod-usb-dwc3 kmod-usb-dwc3-qcom kmod-usb3 libc libgcc libustream-mbedtls logd losetup mtd netifd nftables odhcp6c odhcpd-ipv6only ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-leds-pca963x ipq-wifi-linksys_mx8500 kmod-ath11k-pci ath11k-firmware-qcn9074 kmod-hci-uart luci luci-app-attendedsysupgrade
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft
luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier
##module

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

View File

@@ -1,15 +1,13 @@
#!/bin/bash
# Generate the built-in package list for a device from the official index.
# Build a device's complete package list.
#
# The list is default_packages + device_packages from the target's
# profiles.json, plus the packages the Firmware Selector adds on top
# (luci, luci-app-attendedsysupgrade). This is exactly what the Selector
# shows, so it replaces copying that list by hand for every new release.
# The built-in part comes from the target's profiles.json (default_packages +
# device_packages, plus the packages the Firmware Selector adds on top), so it
# never has to be copied by hand for a new release. Your own packages live in
# packages/<device-id>.txt and are version independent.
#
# By default the list is written into config_<ver>/packages_<id>_<ver>.txt,
# replacing only the block between the generated-list sentinels inside the
# ##built-in section. Everything else in the file -- your own extra packages,
# the ##module section, blank lines -- is preserved verbatim.
# packages/<device-id>.txt your packages, kept in git, edited by hand
# .generated/ the combined list, not kept in git
#
# Usage: ./gen-package-list.sh [options]
#
@@ -17,16 +15,19 @@
# --target <t> disambiguate an id present in several targets
# --version <ver> override version detection (e.g. 25.12.5)
# --snapshot shorthand for --version SNAPSHOT
# --extras "<pkgs>" override the Firmware Selector extras
# --no-extras emit only default_packages + device_packages
# --wrap <cols> wrap the generated list (default 0 = one line)
# --file <path> write to this file instead of the default path
# --stdout print the list, one package per line, and exit
# --apply apply the list to .config instead of writing a file
# --no-migrate do not replace an existing unmarked built-in line
# --extras-file <f> use this instead of packages/<device-id>.txt
# --no-extras-file built-in packages only
# --init-extras create packages/<device-id>.txt if it is missing
# --extras "<pkgs>" override the Firmware Selector additions
# --no-extras omit the Firmware Selector additions
# --wrap <cols> wrap the built-in list (default 0 = one line)
# --out <path> write here instead of .generated/
# --stdout print the built-in list only, one per line
# --full-stdout print the complete list and exit
# --apply apply the complete list to .config
# --refresh ignore the cached JSON indexes
# -y, --yes do not ask for confirmation
# -n, --dry-run show what would change, write nothing
# -n, --dry-run show what would happen, write nothing
# -h, --help show this help
#
# Author: Zhe Yuan
@@ -35,6 +36,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"
@@ -42,15 +44,14 @@ DEVICE_ID=""
DEVICE_TARGET=""
VERSION_OVERRIDE=""
EXTRAS="$SELECTOR_EXTRAS"
EXTRAS_FILE=""
USE_EXTRAS_FILE=true
INIT_EXTRAS=false
WRAP=0
OUT_FILE=""
MODE="file" # file | stdout | apply
MIGRATE=true
MODE="file" # file | stdout | full-stdout | apply
BEGIN_MARK="# >>> generated built-in list - do not edit by hand"
END_MARK="# <<< generated built-in list"
usage() { sed -n '2,35p' "$0" | sed 's/^# \{0,1\}//;s/^#$//'; }
usage() { sed -n '2,34p' "$0" | sed 's/^# \{0,1\}//;s/^#$//'; }
need_value() {
if [ "$2" -lt 2 ] || [ -z "${3:-}" ]; then
@@ -65,13 +66,16 @@ while [ $# -gt 0 ]; do
--target) need_value "$1" $# "${2:-}"; DEVICE_TARGET="$2"; shift ;;
--version) need_value "$1" $# "${2:-}"; VERSION_OVERRIDE="$2"; shift ;;
--snapshot) VERSION_OVERRIDE="SNAPSHOT" ;;
--extras-file) need_value "$1" $# "${2:-}"; EXTRAS_FILE="$2"; shift ;;
--no-extras-file) USE_EXTRAS_FILE=false ;;
--init-extras) INIT_EXTRAS=true ;;
--extras) need_value "$1" $# "${2:-}"; EXTRAS="$2"; shift ;;
--no-extras) EXTRAS="" ;;
--wrap) need_value "$1" $# "${2:-}"; WRAP="$2"; shift ;;
--file) need_value "$1" $# "${2:-}"; OUT_FILE="$2"; shift ;;
--out) need_value "$1" $# "${2:-}"; OUT_FILE="$2"; shift ;;
--stdout) MODE="stdout" ;;
--full-stdout) MODE="full-stdout" ;;
--apply) MODE="apply" ;;
--no-migrate) MIGRATE=false ;;
--refresh) REFRESH=true ;;
-y|--yes) ASSUME_YES=true ;;
-n|--dry-run) DRY_RUN=true ;;
@@ -94,53 +98,98 @@ VER="$(detect_version)"
select_device "$VER"
PROFILES_JSON="$(fetch_profiles "$VER" "$DEV_TARGET")"
PKGS="$(profile_packages "$PROFILES_JSON" "$DEV_ID")"
# Extras go last and never duplicate something the target already provides,
# which is what keeps the output identical to the hand-written lists.
# Selector additions go last and never duplicate what the target provides.
for extra in $EXTRAS; do
if ! printf '%s\n' "$PKGS" | grep -qxF "$extra"; then
PKGS="$PKGS"$'\n'"$extra"
fi
done
COUNT="$(printf '%s\n' "$PKGS" | grep -c . || true)"
BUILTIN_COUNT="$(printf '%s\n' "$PKGS" | grep -c . || true)"
if [ "$MODE" = "stdout" ]; then
printf '%s\n' "$PKGS"
exit 0
fi
# --- Render the package block -------------------------------------------
render_block() {
echo "$BEGIN_MARK"
echo "# device: $DEV_ID target: $DEV_TARGET version: $VER"
echo "# source: profiles.json default_packages + device_packages + selector extras"
# --- Extras file ----------------------------------------------------------
if [ "$USE_EXTRAS_FILE" = true ] && [ -z "$EXTRAS_FILE" ]; then
EXTRAS_FILE="$SCRIPT_DIR/packages/$DEV_ID.txt"
fi
init_extras_file() {
mkdir -p "$(dirname "$EXTRAS_FILE")"
cat > "$EXTRAS_FILE" <<EOF
# Extra packages for $DEV_ID, on top of the built-in list that
# gen-package-list.sh pulls from the official profiles.json.
#
# Whitespace separated, any number per line. '#' starts a comment.
# '-pkg' removes a package; '##module' / '##remove' switch modes.
EOF
info "Created $EXTRAS_FILE"
}
EXTRAS_COUNT=0
if [ "$USE_EXTRAS_FILE" = true ]; then
if [ ! -f "$EXTRAS_FILE" ]; then
if [ "$INIT_EXTRAS" = true ] && [ "$DRY_RUN" != true ]; then
init_extras_file
else
warn "No extras file at $EXTRAS_FILE"
warn "Only the built-in packages will be included (--init-extras creates one)."
EXTRAS_FILE=""
fi
fi
if [ -n "$EXTRAS_FILE" ] && [ -f "$EXTRAS_FILE" ]; then
EXTRAS_COUNT="$(grep -v '^[[:space:]]*#' "$EXTRAS_FILE" | tr -s ' \t\n' '\n' |
grep -c . || true)"
fi
fi
# --- Render the complete list ---------------------------------------------
# The generated file is entirely machine-owned, so it is simply rewritten;
# everything hand-written lives in the extras file instead.
render_full() {
echo "##built-in"
echo "# Generated from profiles.json for $DEV_ID ($DEV_TARGET) at $VER."
echo "# Do not edit: regenerate with gen-package-list.sh."
if [ "$WRAP" -gt 0 ]; then
printf '%s\n' "$PKGS" | tr '\n' ' ' | fold -s -w "$WRAP" | sed 's/[[:space:]]*$//'
else
printf '%s\n' "$PKGS" | tr '\n' ' ' | sed 's/[[:space:]]*$//'
echo
fi
echo "$END_MARK"
if [ -n "$EXTRAS_FILE" ] && [ -f "$EXTRAS_FILE" ]; then
echo
echo "# --- extras from ${EXTRAS_FILE#"$SCRIPT_DIR"/} ---"
# Appended verbatim: section headers are positional, so a ##module in
# the extras file keeps working after the built-in block.
cat "$EXTRAS_FILE"
fi
}
if [ "$MODE" = "full-stdout" ]; then
render_full
exit 0
fi
if [ "$MODE" = "apply" ]; then
info "Applying $COUNT built-in packages to .config via add-openwrt-packages.sh"
info "Applying $BUILTIN_COUNT built-in + $EXTRAS_COUNT extra packages to .config"
APPLY_ARGS=()
[ "$ASSUME_YES" = true ] && APPLY_ARGS+=(-y)
[ "$DRY_RUN" = true ] && APPLY_ARGS+=(-n)
{ echo "##built-in"; printf '%s\n' "$PKGS"; } |
"$SCRIPT_DIR/add-openwrt-packages.sh" "${APPLY_ARGS[@]}" -
render_full | "$SCRIPT_DIR/add-openwrt-packages.sh" "${APPLY_ARGS[@]}" -
exit $?
fi
# --- File mode -----------------------------------------------------------
# --- File mode ------------------------------------------------------------
if [ -z "$OUT_FILE" ]; then
OUT_FILE="$SCRIPT_DIR/config_$VER/packages_${DEV_ID//-/_}_$VER.txt"
OUT_FILE="$SCRIPT_DIR/.generated/packages_${DEV_ID}_${VER}.txt"
fi
OUT_DIR="$(dirname -- "$OUT_FILE")"
echo
echo "========================================"
@@ -149,80 +198,15 @@ echo "========================================"
echo " Device : $DEV_ID ($DEV_LABEL)"
echo " Target : $DEV_TARGET"
echo " Version : $VER"
echo " Packages : $COUNT built-in ($(printf '%s\n' "$PKGS" | grep -c . || true) total)"
echo " Extras : ${EXTRAS:-(none)}"
echo " File : $OUT_FILE $([ -f "$OUT_FILE" ] && echo '(update)' || echo '(create)')"
echo " Built-in : $BUILTIN_COUNT packages (from profiles.json)"
echo " Extras : $EXTRAS_COUNT packages${EXTRAS_FILE:+ from ${EXTRAS_FILE#"$SCRIPT_DIR"/}}"
echo " Output : $OUT_FILE"
echo "========================================"
NEW_FILE="$(mktemp "${TMPDIR:-/tmp}/pkglist.XXXXXX")"
trap 'rm -f "$NEW_FILE"' EXIT
if [ -f "$OUT_FILE" ]; then
# Replace only the generated block; preserve everything the user wrote.
render_block > "$NEW_FILE.block"
awk -v blockfile="$NEW_FILE.block" -v migrate="$MIGRATE" '
function emit_block( line) {
while ((getline line < blockfile) > 0) print line
close(blockfile)
emitted = 1
}
BEGIN { inb = 0; skip = 0; emitted = 0; replaced = 0 }
/^[ \t]*##/ {
if (inb && !emitted) {
# Section ended without a marked block: insert before leaving.
emit_block()
}
inb = ($0 ~ /^[ \t]*##built-in/)
skip = 0
print
next
}
inb && index($0, "# >>> generated built-in list") == 1 { skip = 1; emit_block(); next }
inb && index($0, "# <<< generated built-in list") == 1 { skip = 0; next }
skip { next }
{
# Migration: the pre-sentinel auto-generated line is the one carrying
# both base-files and libc, which are in default_packages for every
# target and never appear in a hand-written extras line.
if (inb && !emitted && migrate == "true" && !replaced) {
has_bf = 0; has_libc = 0
for (i = 1; i <= NF; i++) {
if ($i == "base-files") has_bf = 1
if ($i == "libc") has_libc = 1
}
if (has_bf && has_libc) { emit_block(); replaced = 1; next }
}
print
}
END {
if (inb && !emitted) emit_block()
if (!emitted) {
print "##built-in"
print ""
emit_block()
}
}
' "$OUT_FILE" > "$NEW_FILE"
rm -f "$NEW_FILE.block"
else
{
echo "##built-in"
echo
render_block
echo
echo "##module"
} > "$NEW_FILE"
fi
if [ -f "$OUT_FILE" ] && cmp -s "$OUT_FILE" "$NEW_FILE"; then
info "No change: $OUT_FILE is already up to date."
exit 0
fi
if [ "$DRY_RUN" = true ]; then
echo
info "Changes that would be written:"
diff -u "$OUT_FILE" "$NEW_FILE" 2>/dev/null || true
info "Complete list that would be written:"
render_full | sed 's/^/ /'
echo
info "Dry run complete; nothing was written."
exit 0
@@ -234,23 +218,19 @@ if ! confirm "Write $OUT_FILE?" yes; then
exit 0
fi
mkdir -p "$OUT_DIR"
if [ -f "$OUT_FILE" ]; then
cp -a "$OUT_FILE" "$OUT_FILE.bak"
info "Previous version kept at $(basename "$OUT_FILE").bak"
fi
cp "$NEW_FILE" "$OUT_FILE"
mkdir -p "$(dirname -- "$OUT_FILE")"
render_full > "$OUT_FILE"
chmod 644 "$OUT_FILE"
echo
echo "========================================"
echo "OK Package list written."
echo " File: $OUT_FILE"
echo " Packages: $COUNT built-in"
echo " Packages: $BUILTIN_COUNT built-in + $EXTRAS_COUNT extra"
echo "========================================"
echo
echo "Next steps:"
echo " Edit $(basename "$OUT_FILE") to add your own packages below the generated block"
[ -n "$EXTRAS_FILE" ] && echo " Edit ${EXTRAS_FILE#"$SCRIPT_DIR"/} to change your own packages"
echo " cd $(dirname "$SCRIPT_DIR")"
echo " ./helper/add-openwrt-packages.sh helper/${OUT_FILE#"$SCRIPT_DIR"/}"
echo

View File

@@ -71,6 +71,21 @@ require_python3() {
fi
}
# The helper checkout is itself a git repository living inside the OpenWrt
# worktree, so plain git commands run from here describe the HELPER repo.
# Every version query must be anchored to the OpenWrt tree instead.
find_openwrt_root() {
local d
for d in "$PWD" "$(dirname -- "${LIB_SCRIPT_DIR:-$PWD}")"; do
[ -n "$d" ] || continue
if [ -f "$d/feeds.conf.default" ] && [ -f "$d/Makefile" ] && [ -d "$d/scripts" ]; then
( cd -- "$d" && pwd -P )
return 0
fi
done
return 1
}
require_openwrt_root() {
if [ ! -f feeds.conf.default ] || [ ! -f Makefile ] || [ ! -d scripts ]; then
err "Must run inside the OpenWrt root directory."
@@ -155,19 +170,24 @@ detect_version() {
return 0
fi
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
err "Not inside a Git repository and no --version given."
local root=""
if ! root="$(find_openwrt_root)"; then
err "Cannot locate the OpenWrt source tree; pass --version <ver> explicitly."
exit 1
fi
if ! git -C "$root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
err "'$root' is not a Git repository and no --version was given."
exit 1
fi
if tag="$(git describe --tags --exact-match HEAD 2>/dev/null)"; then
if tag="$(git -C "$root" describe --tags --exact-match HEAD 2>/dev/null)"; then
ver="${tag#v}"
info "HEAD is exactly at tag $tag; using version $ver."
echo "$ver"
return 0
fi
if branch="$(git symbolic-ref --quiet --short HEAD 2>/dev/null)"; then
if branch="$(git -C "$root" symbolic-ref --quiet --short HEAD 2>/dev/null)"; then
case "$branch" in
main | master)
info "On branch '$branch'; using SNAPSHOT."
@@ -177,10 +197,10 @@ detect_version() {
openwrt-* | [0-9]*)
local series="${branch#openwrt-}"
# --merged HEAD keeps tags from unrelated branches out of the picture.
tag="$(git tag --merged HEAD -l "v${series}.*" 2>/dev/null |
tag="$(git -C "$root" tag --merged HEAD -l "v${series}.*" 2>/dev/null |
grep -v -- '-rc' | sort -V | tail -n 1)"
if [ -n "$tag" ]; then
drift="$(git rev-list --count "$tag..HEAD" 2>/dev/null || echo 0)"
drift="$(git -C "$root" rev-list --count "$tag..HEAD" 2>/dev/null || echo 0)"
if [ "$drift" -gt 0 ]; then
warn "HEAD is $drift commit(s) past $tag."
warn "The downloaded config describes the release, not your tree."
@@ -194,9 +214,9 @@ detect_version() {
esac
fi
if tag="$(git describe --tags --long 2>/dev/null)"; then
if tag="$(git -C "$root" describe --tags --long 2>/dev/null)"; then
tag="${tag%-*-g*}"
drift="$(git rev-list --count "$tag..HEAD" 2>/dev/null || echo 0)"
drift="$(git -C "$root" rev-list --count "$tag..HEAD" 2>/dev/null || echo 0)"
warn "HEAD is not at a tag; nearest is $tag ($drift commit(s) behind HEAD)."
if [ "$ASSUME_YES" != true ] &&
! confirm "Use version ${tag#v}?" no; then

View File

@@ -0,0 +1,9 @@
# Extra packages for cudy_tr3000-256mb-v1, on top of the built-in list that
# gen-package-list.sh pulls from the official profiles.json.
#
# Whitespace separated, any number per line. '#' starts a comment.
# '-pkg' removes a package; '##module' / '##remove' switch modes.
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft
luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

View File

@@ -0,0 +1,9 @@
# Extra packages for cudy_tr3000-v1, on top of the built-in list that
# gen-package-list.sh pulls from the official profiles.json.
#
# Whitespace separated, any number per line. '#' starts a comment.
# '-pkg' removes a package; '##module' / '##remove' switch modes.
iptables-nft ip6tables-nft curl yq unzip ip-full kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun
luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier

View File

@@ -0,0 +1,9 @@
# Extra packages for linksys_mx8500, on top of the built-in list that
# gen-package-list.sh pulls from the official profiles.json.
#
# Whitespace separated, any number per line. '#' starts a comment.
# '-pkg' removes a package; '##module' / '##remove' switch modes.
curl yq unzip ip-full kmod-mtd-rw kmod-inet-diag kmod-nft-socket kmod-nft-tproxy kmod-tun luci-app-upnp luci-app-ttyd luci-app-filemanager luci-app-wol luci-app-mwan3 iptables-nft ip6tables-nft
luci-app-openvpn luci-proto-wireguard luci-app-cloudflared qrencode tailscale zerotier adguardhome
easytier luci-app-netspeedtest luci-app-easytier