Based on cryptoboy's answer:
Create x509.genkey file
echo -e "[ req ] \n\ default_bits = 4096 \n\ distinguished_name = req_distinguished_name \n\ prompt = no \n\ x509_extensions = myexts \n\ [ req_distinguished_name ] \n\ CN = Modules \n\ \n\ [ myexts ] \n\ basicConstraints=critical,CA:FALSE \n\ keyUsage=digitalSignature \n\ subjectKeyIdentifier=hash \n\ authorityKeyIdentifier=keyid" > x509.genkey
Run:
openssl req -new -nodes -utf8 -sha512 -days 36500 -batch -x509 -config x509.genkey -outform DER -out signing_key.x509 -keyout signing_key.pem
Move key files to desired folder, for example:
mv signing_key.pem signing_key.x509 `find /usr/src/*-generic/certscerts`