From 01c15f072556b77ca6e79d1b9eac9651a0c86dee Mon Sep 17 00:00:00 2001 From: a-gave Date: Fri, 22 Nov 2024 21:58:43 +0100 Subject: [PATCH] fix: add-lime-repos: read arch from apk + minors; multi-arch-build: rename openwrt_branch_path --- .github/workflows/multi-arch-build.yml | 16 +++++++------- .../files/etc/uci-defaults/92_add-lime-repos | 22 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/multi-arch-build.yml b/.github/workflows/multi-arch-build.yml index a16470241..52cb03ce8 100644 --- a/.github/workflows/multi-arch-build.yml +++ b/.github/workflows/multi-arch-build.yml @@ -58,9 +58,9 @@ jobs: && echo "snapshots/packages" || echo "releases/packages-$version") echo $VERSION_PATH - OUTPUT_PATH=$([ "$version" == "main" ] \ + OPENWRT_BRANCH_PATH=$([ "$version" == "main" ] \ && echo "openwrt_main" || echo "openwrt_$version") - echo $OUTPUT_PATH + echo $OPENWRT_BRANCH_PATH wget -r -nH --no-parent --level 1 --accept html -P. \ --directory-prefix=. https://downloads.openwrt.org/$VERSION_PATH/ @@ -69,7 +69,7 @@ jobs: [[ $FIRST_BUILD -ne 1 ]] && JSON="$JSON"',' FIRST_BUILD=0 - JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "output_path": "'"$OUTPUT_PATH"'" }' + JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "openwrt_branch_path": "'"$OPENWRT_BRANCH_PATH"'" }' echo $JSON done done @@ -87,8 +87,8 @@ jobs: matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} # matrix: # include: - # - { version: main, arch: x86_64, output_path: 'openwrt_main'} - # - { version: main, arch: arc_archs, output_path: 'openwrt_main'} + # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'} + # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'} steps: - uses: actions/checkout@v4 @@ -123,8 +123,8 @@ jobs: matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} # matrix: # include: - # - { version: main, arch: x86_64, output_path: 'openwrt_main'} - # - { version: main, arch: arc_archs, output_path: 'openwrt_main'} + # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'} + # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'} steps: - uses: actions/checkout@v4 @@ -139,4 +139,4 @@ jobs: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} external_repository: libremesh/lime-feed publish_dir: ./artifacts/ - destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.output_path }}/${{ matrix.arch }}/ + destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.openwrt_branch_path }}/${{ matrix.arch }}/ diff --git a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos index 1c8245f28..4433e1acf 100755 --- a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos +++ b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos @@ -10,11 +10,13 @@ feeds_file='/etc/apk/repositories.d/limefeeds.list' dist_feeds_file='/etc/apk/repositories.d/distfeeds.list' main_feed_path='apk/' + arch="$(cat /etc/apk/arch)" } || ([ -f /etc/opkg/distfeed.conf ] && { repo='opkg' feeds_file='/etc/opkg/limefeeds.conf' dist_feeds_file='/etc/opkg/distfeeds.conf' main_feed_path='' + arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" key_name="a71b3c8285abd28b" key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" }) @@ -29,10 +31,7 @@ exit 0; } -arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" - openwrt_branch_ref="$(grep -m 1 "openwrt.org/" $dist_feeds_file | sed 's|.*openwrt.org/\(.*\)|\1|' )" -echo $openwrt_branch_ref if [ '' != "$openwrt_branch_ref" ]; then $(echo $openwrt_branch_ref | grep -q 'snapshots') && { @@ -47,25 +46,24 @@ fi [ "$LIME_CODENAME" == "development" ] && { packages_url="http://feed.libremesh.org/${main_feed_path}master"; - arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch/"; + arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch"; } || { packages_url="http://feed.libremesh.org/${main_feed_path}$LIME_RELEASE" - arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch/"; + arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch"; } profiles_url="http://feed.libremesh.org/${main_feed_path}profiles" echo "Configuring official LibreMesh $repo feeds" +[ $repo == 'apk' ] && { +echo "$packages_url/packages.adb" > "$feeds_file" +echo "${arch_packages_url}/packages.adb" >> "$feeds_file" +echo "$profiles_url/packages.adb" >> "$feeds_file" +} || ( [ $repo == 'opkg' ] && { echo "src/gz libremesh $packages_url" > "$feeds_file" echo "src/gz libremesh_arch_packages $arch_packages_url" >> "$feeds_file" echo "src/gz profiles $profiles_url" >> "$feeds_file" echo "untrusted comment: signed by libremesh.org key $key_name" > "/etc/opkg/keys/$key_name" echo "$key_content" >> "/etc/opkg/keys/$key_name" -} -[ $repo == 'apk' ] && { -proto=https -echo "$packages_url/packages.adb" > "$feeds_file" -echo "${arch_packages_url}packages.adb" >> "$feeds_file" -echo "$profiles_url/packages.adb" >> "$feeds_file" -} +})