#!/bin/sh # $version can be 21.02 or 19.07. version=19.07.7 if [ ! -d /tmp/openwrt ]; then cd /tmp git clone https://github.com/openwrt/openwrt.git cd openwrt fi cd /tmp/openwrt git -c advice.detachedHead=false checkout v$version export TOPDIR=$PWD cd target/linux >targets.git for target in *; do [ -d $target ] || continue subtargets=$(make -C $target --no-print-directory DUMP=1 TARGET_BUILD=1 val.SUBTARGETS 2>/dev/null) [ "$subtargets" ] || subtargets=generic for subtarget in $subtargets; do echo $(make -C $target --no-print-directory DUMP=1 TARGET_BUILD=1 SUBTARGET=$subtarget 2>/dev/null | egrep '^(Target:|Target-Arch-Packages:)' | cut -d: -f2) >>targets.git done done targets=$(curl -s https://downloads.openwrt.org/releases/$version/targets/ | grep 'targets.sdk for target in $targets; do subtargets=$(curl -s https://downloads.openwrt.org/releases/$version/targets/$target/ | grep '>targets.sdk done done cat >parse-targets.py <