Message ID | 1508795051-24559-1-git-send-email-freifunk@adrianschmutzler.de |
---|---|
State | Accepted |
Headers | show |
diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp index f5ee15b..fdf4cf4 100644 --- a/bsp/board_ar71xx.bsp +++ b/bsp/board_ar71xx.bsp @@ -1,5 +1,6 @@ machine=ar71xx chipset=ar71xx +subtarget=generic target=$builddir/$machine images=("lede-ar71xx-generic-cpe210-220-squashfs-sysupgrade.bin" "lede-ar71xx-generic-cpe510-520-squashfs-sysupgrade.bin" diff --git a/bsp/board_wdr4900.bsp b/bsp/board_wdr4900.bsp index cc7157d..30791e4 100644 --- a/bsp/board_wdr4900.bsp +++ b/bsp/board_wdr4900.bsp @@ -1,5 +1,6 @@ machine=wdr4900 chipset=mpc85xx +subtarget=generic target=$builddir/$machine images=( diff --git a/buildscript b/buildscript index 434b5d3..8572d6b 100755 --- a/buildscript +++ b/buildscript @@ -277,19 +277,21 @@ cp_firmware() { local community="fff" fi + [ -n "$subtarget" ] || subtarget="generic" + for image in ${images[@]}; do filename_build=${image//lede/${community}-${version}} filename_build=${filename_build//generic/g} - cp "$target/bin/targets/${chipset}/generic/$image" "./bin/$filename_build" + cp "$target/bin/targets/${chipset}/${subtarget}/$image" "./bin/$filename_build" for region in "" "-eu" "-us"; do image_factory=${image/sysupgrade/factory$region} - if [[ -f "$target/bin/targets/${chipset}/generic/$image_factory" ]]; then + if [[ -f "$target/bin/targets/${chipset}/${subtarget}/$image_factory" ]]; then filename_build_factory=${filename_build/sysupgrade/factory$region} if [ ${#image_factory} -lt ${#filename_build_factory} ]; then echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware." fi - cp "$target/bin/targets/${chipset}/generic/$image_factory" "./bin/$filename_build_factory" + cp "$target/bin/targets/${chipset}/${subtarget}/$image_factory" "./bin/$filename_build_factory" fi done done
Hi Und applied. Tim Am Montag, den 23.10.2017, 23:44 +0200 schrieb Adrian Schmutzler: > Prepares a subtarget variable for cases where it is not 'generic' > > Introduced in v3, no changes in v4 and v5. > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > Reviewed-by: Fabian Bläse <fabian@blaese.de> > --- > bsp/board_ar71xx.bsp | 1 + > bsp/board_wdr4900.bsp | 1 + > buildscript | 8 +++++--- > 3 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp > index f5ee15b..fdf4cf4 100644 > --- a/bsp/board_ar71xx.bsp > +++ b/bsp/board_ar71xx.bsp > @@ -1,5 +1,6 @@ > machine=ar71xx > chipset=ar71xx > +subtarget=generic > target=$builddir/$machine > images=("lede-ar71xx-generic-cpe210-220-squashfs-sysupgrade.bin" > "lede-ar71xx-generic-cpe510-520-squashfs-sysupgrade.bin" > diff --git a/bsp/board_wdr4900.bsp b/bsp/board_wdr4900.bsp > index cc7157d..30791e4 100644 > --- a/bsp/board_wdr4900.bsp > +++ b/bsp/board_wdr4900.bsp > @@ -1,5 +1,6 @@ > machine=wdr4900 > chipset=mpc85xx > +subtarget=generic > target=$builddir/$machine > > images=( > diff --git a/buildscript b/buildscript > index 434b5d3..8572d6b 100755 > --- a/buildscript > +++ b/buildscript > @@ -277,19 +277,21 @@ cp_firmware() { > local community="fff" > fi > > + [ -n "$subtarget" ] || subtarget="generic" > + > for image in ${images[@]}; do > filename_build=${image//lede/${community}-${version}} > filename_build=${filename_build//generic/g} > - cp "$target/bin/targets/${chipset}/generic/$image" > "./bin/$filename_build" > + cp "$target/bin/targets/${chipset}/${subtarget}/$image" > "./bin/$filename_build" > > for region in "" "-eu" "-us"; do > image_factory=${image/sysupgrade/factory$region} > - if [[ -f > "$target/bin/targets/${chipset}/generic/$image_factory" ]]; then > + if [[ -f > "$target/bin/targets/${chipset}/${subtarget}/$image_factory" ]]; then > filename_build_factory=${filename_build/sysupgrade/fac > tory$region} > if [ ${#image_factory} -lt ${#filename_build_factory} > ]; then > echo "Warning: The factory image file name > (${filename_build_factory}) is longer than the OpenWrt one, which > might be incompatibility with the stock firmware." > fi > - cp > "$target/bin/targets/${chipset}/generic/$image_factory" > "./bin/$filename_build_factory" > + cp > "$target/bin/targets/${chipset}/${subtarget}/$image_factory" > "./bin/$filename_build_factory" > fi > done > done > -- > 2.7.4 >