buildscript: copy the (optional) -eu/-us factory images

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
This commit is contained in:
Tim Niemeyer 2017-01-06 14:15:56 +01:00
parent aa970cd5bb
commit 8a459ff854
1 changed files with 10 additions and 8 deletions

View File

@ -278,14 +278,16 @@ cp_firmware() {
filename_build=${filename_build//generic/g} filename_build=${filename_build//generic/g}
cp "$target/bin/${chipset}/$image" "./bin/$filename_build" cp "$target/bin/${chipset}/$image" "./bin/$filename_build"
image_factory=${image/sysupgrade/factory} for region in "" "-eu" "-us"; do
if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then image_factory=${image/sysupgrade/factory$region}
filename_build_factory=${filename_build/sysupgrade/factory} if [[ -f "$target/bin/${chipset}/$image_factory" ]]; then
if [ ${#image_factory} -lt ${#filename_build_factory} ]; then filename_build_factory=${filename_build/sysupgrade/factory$region}
echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware." if [ ${#image_factory} -lt ${#filename_build_factory} ]; then
fi echo "Warning: The factory image file name (${filename_build_factory}) is longer than the OpenWrt one, which might be incompatibility with the stock firmware."
cp "$target/bin/${chipset}/$image_factory" "./bin/$filename_build_factory" fi
fi cp "$target/bin/${chipset}/$image_factory" "./bin/$filename_build_factory"
fi
done
done done
} }