Skip to contentSkip to conversation

kbuild, link-vmlinux: Don't delete output files with make -i

PATCH In review Andi Kleen 3 participants 3 messages Apr 25, 2021 – Apr 26, 2021 Kbuild

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 kbuild, link-vmlinux: Don't delete output files with make -i

From: Andi Kleen <[email protected]>

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.

---
 scripts/link-vmlinux.sh | 5 +++++
 1 file changed, 5 insertions(+)
scripts/link-vmlinux.sh +5 -0
index 0e039a4cf2cb..a1a57f214c58 100755
@@ -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
Signature · 1 line
2.25.4
#1 lore raw
Quoted 29 lines · Andi Kleen

From: Andi Kleen <[email protected]>

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.

---
 scripts/link-vmlinux.sh | 5 +++++
 1 file changed, 5 insertions(+)
scripts/link-vmlinux.sh +5 -1
index 0e039a4cf2cb..a1a57f214c58 100755
@@ -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
--
Quoted 2 lines

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.

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 5 lines

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