Makefile: mrproper deletes signing_key.x509
Subsystems (2)
PATCH 1/1 Makefile: mrproper deletes signing_key.x509
deletes temporary signing_key.x509 and reserves user-defined x509.genkey
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -1589,7 +1589,7 @@ MRPROPER_FILES += include/config include/generated \ .config .config.old .version \ Module.symvers \ certs/signing_key.pem \ - certs/x509.genkey \ + certs/signing_key.x509 \ vmlinux-gdb.py \ rpmbuild \ rust/libmacros.so rust/libmacros.dylib
Signature · 1 line
2.34.1
Quoted 1 line · On Sat, Aug 09, 2025 at 08:04:05PM +0800 longguang.yue wrote:
deletes temporary signing_key.x509 and reserves user-defined x509.genkey
can you elaborate the actual problem with some more details?
certs/signing_key.x509 is removed during 'make clean' which is a dependency of 'mrproper'.
'mrproper' is meant to remove everything that might influence a subsequent call of kbuild for the sane architecture.
Without further details I cannot see any problem here.
Kind regards,
Nicolas
Nicolas Schier, Hi:
It should not delete x509.genkey because of its exsitence in gitignore.
Normally, users want to keep a self-defined x509.genkey, but mrproper deletes it, only default_x509.genkey is effective. After applying this patch, users just need to copy self-defined x509.genkey into certs directory once.
Thanks.
Quoted 15 lines · Nicolas Schier
Quoted 1 line · On Sat, Aug 09, 2025 at 08:04:05PM +0800 longguang.yue wrote:
deletes temporary signing_key.x509 and reserves user-defined x509.genkey
can you elaborate the actual problem with some more details?
certs/signing_key.x509is removed during 'make clean' which is a dependency of 'mrproper'.'mrproper' is meant to remove everything that might influence a subsequent call of kbuild for the sane architecture.
Without further details I cannot see any problem here.
Kind regards,
Nicolas
[re-ordered quote]
Quoted 16 lines · longguang.yue
Quoted 15 lines · Nicolas Schier
Quoted 1 line · On Sat, Aug 09, 2025 at 08:04:05PM +0800 longguang.yue wrote:
deletes temporary signing_key.x509 and reserves user-defined x509.genkey
can you elaborate the actual problem with some more details?
certs/signing_key.x509is removed during 'make clean' which is a dependency of 'mrproper'.'mrproper' is meant to remove everything that might influence a subsequent call of kbuild for the sane architecture.
Without further details I cannot see any problem here.
Kind regards,
Nicolas
[...]
Quoted 4 lines
It should not delete x509.genkey because of its exsitence in gitignore.
Normally, users want to keep a self-defined x509.genkey, but mrproper deletes it, only default_x509.genkey is effective. After applying this patch, users just need to copy self-defined x509.genkey into certs directory once.
'make mrproper' is meant to prepare the source tree to be as pristine as possible for the given architecture. This includes removal of any configuration file(s) that influence subsequent builds. From kbuild point of view, certs/x509.genkey is also a kind of a configuration file, as leaving it in tree after mrproper creates different build results compared to a build from a really pristine source tree.
Iff the certs/ maintainers think that retaining a user x509.genkey file over a mrproper makes sense, then we should probably adjust the rule for generating $(objtree)/certs/x509.genkey, e.g. by allowing to provide one by environment variable.
David or David, do you have an opinion on this?
Kind regards,
Nicolas
Nathan Chancellor
maintainerQuoted 26 lines · Nicolas Schier
Cc certs/ people[re-ordered quote]
Quoted 16 lines · longguang.yue
Quoted 15 lines · Nicolas Schier
Quoted 1 line · On Sat, Aug 09, 2025 at 08:04:05PM +0800 longguang.yue wrote:
deletes temporary signing_key.x509 and reserves user-defined x509.genkey
can you elaborate the actual problem with some more details?
certs/signing_key.x509is removed during 'make clean' which is a dependency of 'mrproper'.'mrproper' is meant to remove everything that might influence a subsequent call of kbuild for the sane architecture.
Without further details I cannot see any problem here.
Kind regards,
Nicolas[...]
Quoted 4 lines
It should not delete x509.genkey because of its exsitence in gitignore.
Normally, users want to keep a self-defined x509.genkey, but mrproper deletes it, only default_x509.genkey is effective. After applying this patch, users just need to copy self-defined x509.genkey into certs directory once.
Quoted 6 lines
'make mrproper' is meant to prepare the source tree to be as pristine as possible for the given architecture. This includes removal of any configuration file(s) that influence subsequent builds. From kbuild point of view,
certs/x509.genkeyis also a kind of a configuration file, as leaving it in tree after mrproper creates different build results compared to a build from a really pristine source tree.
Agreed, I think it is intentional that this is in mrproper and not clean, so I don't think we can accept this change as is, but I am happy to be told otherwise from the certs maintainers.
Quoted 6 lines
Iff the
certs/maintainers think that retaining a user x509.genkey file over a mrproper makes sense, then we should probably adjust the rule for generating $(objtree)/certs/x509.genkey, e.g. by allowing to provide one by environment variable.David or David, do you have an opinion on this?
Furthermore, if the user wanted to use a predefined x509 configuration, why can't they generate their own signing key and provide it via CONFIG_MODULE_SIG_KEY, instead of hijacking the default logic of certs/signing_key.pem? Based on my reading of certs/Makefile, it sounds like the default logic is mostly there just for allyesconfig or randconfig.
Cheers,
Nathan
Quoted 52 lines · Nathan Chancellor
Quoted 26 lines · Nicolas Schier
Cc certs/ people[re-ordered quote]
Quoted 16 lines · longguang.yue
Quoted 15 lines · Nicolas Schier
Quoted 1 line · On Sat, Aug 09, 2025 at 08:04:05PM +0800 longguang.yue wrote:
deletes temporary signing_key.x509 and reserves user-defined x509.genkey
can you elaborate the actual problem with some more details?
certs/signing_key.x509is removed during 'make clean' which is a dependency of 'mrproper'.'mrproper' is meant to remove everything that might influence a subsequent call of kbuild for the sane architecture.
Without further details I cannot see any problem here.
Kind regards,
Nicolas[...]
Quoted 4 lines
It should not delete x509.genkey because of its exsitence in gitignore.
Normally, users want to keep a self-defined x509.genkey, but mrproper deletes it, only default_x509.genkey is effective. After applying this patch, users just need to copy self-defined x509.genkey into certs directory once.Quoted 6 lines
'make mrproper' is meant to prepare the source tree to be as pristine as possible for the given architecture. This includes removal of any configuration file(s) that influence subsequent builds. From kbuild point of view,
certs/x509.genkeyis also a kind of a configuration file, as leaving it in tree after mrproper creates different build results compared to a build from a really pristine source tree.Agreed, I think it is intentional that this is in mrproper and not clean, so I don't think we can accept this change as is, but I am happy to be told otherwise from the certs maintainers.
Quoted 6 lines
Iff the
certs/maintainers think that retaining a user x509.genkey file over a mrproper makes sense, then we should probably adjust the rule for generating $(objtree)/certs/x509.genkey, e.g. by allowing to provide one by environment variable.David or David, do you have an opinion on this?
Furthermore, if the user wanted to use a predefined x509 configuration, why can't they generate their own signing key and provide it via
CONFIG_MODULE_SIG_KEY, instead of hijacking the default logic ofcerts/signing_key.pem? Based on my reading ofcerts/Makefile, it sounds like the default logic is mostly there just for allyesconfig or randconfig.
Quoted 2 lines
Cheers,
Nathan
Ok, It needs to copy x509.genkey to certs after mrproper.
As above, signing_key.x509 should be deleted, it denpends on x509.genkey and is a configuration file. Adjust this fix to delete signing_key.x509 only, is it acceptable?
Thanks.
David Howells
maintainerQuoted 7 lines · Nicolas Schier
'make mrproper' is meant to prepare the source tree to be as pristine as possible for the given architecture. This includes removal of any configuration file(s) that influence subsequent builds. From kbuild point of view,
certs/x509.genkeyis also a kind of a configuration file, as leaving it in tree after mrproper creates different build results compared to a build from a really pristine source tree.
Quoted 6 lines
Iff the
certs/maintainers think that retaining a user x509.genkey file over a mrproper makes sense, then we should probably adjust the rule for generating $(objtree)/certs/x509.genkey, e.g. by allowing to provide one by environment variable.David or David, do you have an opinion on this?
make distclean or make mrproper should delete the key. As you say, it's thoroughly cleaning out the source tree - it used to be so that you could more easily diff it for prepping a patch, I guess. make clean, OTOH, should not.
David