Skip to contentSkip to conversation

make mrproper cleanup more file

PATCH In review Stephen Hemminger 2 participants 7 messages Apr 14, 2017 – Jun 5, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

cover make mrproper cleanup more file

The point of mrproper is to cleanup all the machine specific files from the build.

Stephen Hemminger (2):
kbuild: cleanup signing keys with mrproper
kbuild: remove initramfs cpio with mrproper

 Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 kbuild: cleanup signing keys with mrproper

When 'make mrproper' is run it was supposed to remove the signing keys in the certs directory, but only the filename is given rather than the pathanme which is necessary to cause cleanup.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
index efa267a92ba6..04ca211552f7 100644
@@ -1274,9 +1274,9 @@ MRPROPER_DIRS  += include/config usr/include include/generated          \
 		  arch/*/include/generated .tmp_objdiff
 MRPROPER_FILES += .config .config.old .version .old_version \
 		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
-		  signing_key.pem signing_key.priv signing_key.x509	\
-		  x509.genkey extra_certificates signing_key.x509.keyid	\
-		  signing_key.x509.signer vmlinux-gdb.py
+		  certs/signing_key.pem certs/signing_key.priv certs/signing_key.x509	\
+		  certs/x509.genkey certs/extra_certificates certs/signing_key.x509.keyid \
+		  certs/signing_key.x509.signer vmlinux-gdb.py
 
 # clean - Delete most, but leave enough to build external modules
 #
Signature · 1 line
2.11.0
#5 lore raw

PATCH 2/2 kbuild: remove initramfs cpio with mrproper

In reply to Stephen Hemminger

When 'make mrproper' is done, it should also remove the initramfs cpio file. I ran into this while doing test build on one machine, followed by make mrproper and rsync to a target machine. The build on the target machine would succeed but be unbootable because of the bad initramfs.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 04ca211552f7..954292695bf6 100644
@@ -1276,7 +1276,8 @@ MRPROPER_FILES += .config .config.old .version .old_version \
 		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
 		  certs/signing_key.pem certs/signing_key.priv certs/signing_key.x509	\
 		  certs/x509.genkey certs/extra_certificates certs/signing_key.x509.keyid \
-		  certs/signing_key.x509.signer vmlinux-gdb.py
+		  certs/signing_key.x509.signer vmlinux-gdb.py \
+		  usr/initramfs_data.cpio.gz
 
 # clean - Delete most, but leave enough to build external modules
 #
Signature · 1 line
2.11.0
#6 lore raw

Re: [PATCH 2/2] kbuild: remove initramfs cpio with mrproper

Hi Stephen,

2017-04-15 6:54 GMT+09:00 Stephen Hemminger <[email protected]>:

Quoted 4 lines

When 'make mrproper' is done, it should also remove the initramfs cpio file. I ran into this while doing test build on one machine, followed by make mrproper and rsync to a target machine. The build on the target machine would succeed but be unbootable because of the bad initramfs.

I think initramfs_data.cpio.* is unneeded for external modules.

So, shouldn't it removed by 'make clean', instead of 'make mrproper'?

Quoted 10 lines
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index 04ca211552f7..954292695bf6 100644

Makefile MRPROPER_FILES += .config .config.old .version .old_version \ · line 1281

Quoted 7 lines
Makefile +2 -1
@@ -1276,7 +1276,8 @@ MRPROPER_FILES += .config .config.old .version .old_version \
                  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
                  certs/signing_key.pem certs/signing_key.priv certs/signing_key.x509   \
                  certs/x509.genkey certs/extra_certificates certs/signing_key.x509.keyid \
-                 certs/signing_key.x509.signer vmlinux-gdb.py
+                 certs/signing_key.x509.signer vmlinux-gdb.py \
+                 usr/initramfs_data.cpio.gz
 

As you see usr/Makefile,
datafile_y = initramfs_data.cpio$(suffix_y)

The suffix could be .gz, .bz2, .xz, etc.

Why only initramfs_data.cpio.gz?

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

Re: [PATCH 1/2] kbuild: cleanup signing keys with mrproper

In reply to Stephen Hemminger

+CC David Woodhouse
+CC David Howells

2017-04-15 6:54 GMT+09:00 Stephen Hemminger <[email protected]>:

Quoted 14 lines

When 'make mrproper' is run it was supposed to remove the signing keys in the certs directory, but only the filename is given rather than the pathanme which is necessary to cause cleanup.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +0 -0
index efa267a92ba6..04ca211552f7 100644

Makefile MRPROPER_DIRS += include/config usr/include include/generated \ · line 1280

Quoted 10 lines
Makefile +3 -3
@@ -1274,9 +1274,9 @@ MRPROPER_DIRS  += include/config usr/include include/generated          \
                  arch/*/include/generated .tmp_objdiff
 MRPROPER_FILES += .config .config.old .version .old_version \
                  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
-                 signing_key.pem signing_key.priv signing_key.x509     \
-                 x509.genkey extra_certificates signing_key.x509.keyid \
-                 signing_key.x509.signer vmlinux-gdb.py
+                 certs/signing_key.pem certs/signing_key.priv certs/signing_key.x509   \
+                 certs/x509.genkey certs/extra_certificates certs/signing_key.x509.keyid \
+                 certs/signing_key.x509.signer vmlinux-gdb.py
 

The logic seems quite simple,
but I am not quite sure which file is still valid?

[1] signing_key.pem - OK, this should be certs/signing_key.pem and removed by 'make mrproper'

[2] signing_key.priv - deprecated by commit fb1179499134 ?

[3] signing_key.x509 - OK, this should be certs/signing_key.x509 and removed by 'make mrproper'

[4] x509.genkey - this is an intermediate file for generating signing_key.pem, but unneeded for installing external modules. Does it make more sense to delete this by 'make clean'?

[5] extra_certificates - I am not sure where this is generated, and used

[6] siging_key.x509.keyid - same as [5]

[7] signing_key.x509.signer - same as [5]

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw

Re: [PATCH 1/2] kbuild: cleanup signing keys with mrproper

Quoted 46 lines · On Wed, 3 May 2017 13:37:08 +0900 Masahiro Yamada…
(quoted diff) +2 -0
+CC David Woodhouse
+CC David Howells

2017-04-15 6:54 GMT+09:00 Stephen Hemminger <[email protected]>:

Quoted 14 lines

When 'make mrproper' is run it was supposed to remove the signing keys in the certs directory, but only the filename is given rather than the pathanme which is necessary to cause cleanup.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +0 -0
index efa267a92ba6..04ca211552f7 100644

Makefile MRPROPER_DIRS += include/config usr/include include/generated \ · line 1280

Quoted 10 lines
Makefile +3 -3
@@ -1274,9 +1274,9 @@ MRPROPER_DIRS  += include/config usr/include include/generated          \
                  arch/*/include/generated .tmp_objdiff
 MRPROPER_FILES += .config .config.old .version .old_version \
                  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
-                 signing_key.pem signing_key.priv signing_key.x509     \
-                 x509.genkey extra_certificates signing_key.x509.keyid \
-                 signing_key.x509.signer vmlinux-gdb.py
+                 certs/signing_key.pem certs/signing_key.priv certs/signing_key.x509   \
+                 certs/x509.genkey certs/extra_certificates certs/signing_key.x509.keyid \
+                 certs/signing_key.x509.signer vmlinux-gdb.py
 

The logic seems quite simple,
but I am not quite sure which file is still valid?

[1] signing_key.pem - OK, this should be certs/signing_key.pem and removed by 'make mrproper'

[2] signing_key.priv - deprecated by commit fb1179499134 ?

[3] signing_key.x509 - OK, this should be certs/signing_key.x509 and removed by 'make mrproper'

[4] x509.genkey - this is an intermediate file for generating signing_key.pem, but unneeded for installing external modules. Does it make more sense to delete this by 'make clean'?

Quoted 5 lines

[5] extra_certificates - I am not sure where this is generated, and used

[6] siging_key.x509.keyid - same as [5]

[7] signing_key.x509.signer - same as [5]

Retested with current Linus tree:

After build, these files are present:

	signing_key.x509

This file is never cleaned up by clean or proper.

The changes that I think are necessary:
certs/extra_certificates is no longer used, remove it from Makefile

certs/signing_key.x509 should be removed by mrproper

#4 lore raw

Re: [PATCH 1/2] kbuild: cleanup signing keys with mrproper

Hi Stephen,
Sorry for my late reply.

2017-05-12 2:25 GMT+09:00 Stephen Hemminger <[email protected]>:

Quoted 58 lines
Quoted 46 lines · On Wed, 3 May 2017 13:37:08 +0900 Masahiro Yamada…
(quoted diff) +2 -0
+CC David Woodhouse
+CC David Howells

2017-04-15 6:54 GMT+09:00 Stephen Hemminger <[email protected]>:

Quoted 14 lines

When 'make mrproper' is run it was supposed to remove the signing keys in the certs directory, but only the filename is given rather than the pathanme which is necessary to cause cleanup.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +0 -0
index efa267a92ba6..04ca211552f7 100644

Makefile MRPROPER_DIRS += include/config usr/include include/generated \ · line 1280

Quoted 10 lines
Makefile +3 -3
@@ -1274,9 +1274,9 @@ MRPROPER_DIRS  += include/config usr/include include/generated          \
                  arch/*/include/generated .tmp_objdiff
 MRPROPER_FILES += .config .config.old .version .old_version \
                  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
-                 signing_key.pem signing_key.priv signing_key.x509     \
-                 x509.genkey extra_certificates signing_key.x509.keyid \
-                 signing_key.x509.signer vmlinux-gdb.py
+                 certs/signing_key.pem certs/signing_key.priv certs/signing_key.x509   \
+                 certs/x509.genkey certs/extra_certificates certs/signing_key.x509.keyid \
+                 certs/signing_key.x509.signer vmlinux-gdb.py
 

The logic seems quite simple,
but I am not quite sure which file is still valid?

[1] signing_key.pem - OK, this should be certs/signing_key.pem and removed by 'make mrproper'

[2] signing_key.priv - deprecated by commit fb1179499134 ?

[3] signing_key.x509 - OK, this should be certs/signing_key.x509 and removed by 'make mrproper'

[4] x509.genkey - this is an intermediate file for generating signing_key.pem, but unneeded for installing external modules. Does it make more sense to delete this by 'make clean'?

Quoted 5 lines

[5] extra_certificates - I am not sure where this is generated, and used

[6] siging_key.x509.keyid - same as [5]

[7] signing_key.x509.signer - same as [5]

Retested with current Linus tree:

After build, these files are present:

Quoted 8 lines
        signing_key.x509

This file is never cleaned up by clean or proper.

The changes that I think are necessary:
certs/extra_certificates is no longer used, remove it from Makefile

certs/signing_key.x509 should be removed by mrproper

I agree.
I'd like obsolete files dropped from the list
before fixing the file paths.

Signature · 2 lines
Best Regards
Masahiro Yamada