Message ID | 20210425213521.3159899-1-ak@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | kbuild, link-vmlinux: Don't delete output files with make -i | expand |
On Mon, Apr 26, 2021 at 6:35 AM Andi Kleen <ak@linux.intel.com> wrote: > > From: Andi Kleen <andi@firstfloor.org> > > make -i is useful to see output files which normally get deleted on an > error. Make this work with link-vmlinux.sh too. Don't delete the output > files on error when make -i is used. > > Signed-off-by: Andi Kleen <ak@linux.intel.com> > --- > scripts/link-vmlinux.sh | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh > index 0e039a4cf2cb..a1a57f214c58 100755 > --- a/scripts/link-vmlinux.sh > +++ b/scripts/link-vmlinux.sh > @@ -300,6 +300,11 @@ sorttable() > # Delete output files in case of error > cleanup() > { > + # don't delete for make -i > + case "$MFLAGS" in > + *-i*) return ;; > + esac > + > rm -f .btf.* > rm -f .tmp_System.map > rm -f .tmp_initcalls.lds > -- > 2.25.4 > How about removing on_exit() and on_signals() entirely? .DELETE_ON_ERROR target removes vmlinux on error anyway. Leaving intermediate files is safe, I think.
> How about removing on_exit() and on_signals() entirely? > > .DELETE_ON_ERROR target removes vmlinux on error anyway. > > Leaving intermediate files is safe, I think. My guess is it because the tmp vmlinux can be rather big. But makes sense. Build dirs shouldn't be that space constrained. We just need to make sure make clean cleans them too. -Andi
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 0e039a4cf2cb..a1a57f214c58 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -300,6 +300,11 @@ sorttable() # Delete output files in case of error cleanup() { + # don't delete for make -i + case "$MFLAGS" in + *-i*) return ;; + esac + rm -f .btf.* rm -f .tmp_System.map rm -f .tmp_initcalls.lds