From 351e7c41f390f891d136b330729f9708fc5546dc Mon Sep 17 00:00:00 2001 From: Zhe Yuan Date: Sat, 5 Sep 2026 20:31:32 -0400 Subject: [PATCH] Require the OpenWrt root in add-external-repos.sh Every path in the script is relative to the current directory, so running it from anywhere else cloned the packages into that directory instead. Now that the helper checkout lives at openwrt/helper/, running it there would populate helper/package/ rather than the real package/. Use the same guard the other helper scripts already have. Co-Authored-By: Claude Opus 5 --- add-external-repos.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/add-external-repos.sh b/add-external-repos.sh index d8e8318..6ab0c73 100755 --- a/add-external-repos.sh +++ b/add-external-repos.sh @@ -4,6 +4,16 @@ set -e # Exit immediately if any command fails umask 022 # Set default file permissions (files=644, dirs=755) +# --- Check if inside OpenWRT source directory --- +# Every path below is relative to the current directory, so running this from +# the helper checkout would clone into helper/package/ instead of the real +# OpenWRT package/ directory. +if [ ! -f "feeds.conf.default" ] || [ ! -d "package" ]; then + echo "[ERROR] Must run inside OpenWRT root directory." + echo "[ERROR] From the OpenWrt root, run it as: ./helper/add-external-repos.sh" + exit 1 +fi + # Define repositories in the format: "git_url branch local_dir" REPOS=( "https://github.com/muink/luci-app-netspeedtest.git master package/luci-app-netspeedtest"