Message ID | 20191002154235.34486-1-freifunk@adrianschmutzler.de |
---|---|
State | Accepted |
Headers | show |
diff --git a/buildscript b/buildscript index c2de5759..81974a97 100755 --- a/buildscript +++ b/buildscript @@ -212,6 +212,8 @@ prebuild() { build() { prebuild + rm_firmware + opath=$(pwd) cd "$target" cpus=$(grep -c processor /proc/cpuinfo) @@ -269,6 +271,12 @@ config() { cd "$opath" } +rm_firmware() { + [ -n "$subtarget" ] || subtarget="generic" + + rm -rf $target/bin/targets/${chipset}/${subtarget} +} + cp_firmware() { [ -n "$subtarget" ] || subtarget="generic"
Reviewed-by: Fabian Bläse <fabian@blaese.de> Fabian On 02.10.19 17:42, Adrian Schmutzler wrote: > So far, if build fails, but images from last successful build are > present in OpenWrt build directory (build/bin/targets/...), those > are copied even after unsuccessful build. > > This results in the old images being copied to the bin folder and > being labelled with the new firmware revision. (!) > As our error check also only looks at whether images are there, > the image copying process will look like a success. > > This patch deletes old images of the target/subtarget to be built, > so that the copy-firmware step will find nothing if the build > stop to early. > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> > --- > buildscript | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/buildscript b/buildscript > index c2de5759..81974a97 100755 > --- a/buildscript > +++ b/buildscript > @@ -212,6 +212,8 @@ prebuild() { > build() { > prebuild > > + rm_firmware > + > opath=$(pwd) > cd "$target" > cpus=$(grep -c processor /proc/cpuinfo) > @@ -269,6 +271,12 @@ config() { > cd "$opath" > } > > +rm_firmware() { > + [ -n "$subtarget" ] || subtarget="generic" > + > + rm -rf $target/bin/targets/${chipset}/${subtarget} > +} > + > cp_firmware() { > [ -n "$subtarget" ] || subtarget="generic" > >
Applied.
So far, if build fails, but images from last successful build are present in OpenWrt build directory (build/bin/targets/...), those are copied even after unsuccessful build. This results in the old images being copied to the bin folder and being labelled with the new firmware revision. (!) As our error check also only looks at whether images are there, the image copying process will look like a success. This patch deletes old images of the target/subtarget to be built, so that the copy-firmware step will find nothing if the build stop to early. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> --- buildscript | 8 ++++++++ 1 file changed, 8 insertions(+)