diff --git a/bash_aliases b/bash_aliases index 79cbb3d..2612672 100644 --- a/bash_aliases +++ b/bash_aliases @@ -104,14 +104,6 @@ function kernel-build() { chmod a+x debian/scripts/*; chmod a+x debian/scripts/misc/*; fakeroot debian/rules clean; - mkdir -p debian/build/build-generic/certs; - sudo cp /cert/mok/signing_key.pem ../ -f; - sudo chmod u=rw,g=rw,o=rw ../signing_key.pem; - sudo cp /var/lib/shim-signed/mok/MOK.der ../signing_key.x509 -f; - sudo chmod u=rw,g=rw,o=rw ../signing_key.x509; - cp ../signing_key.x509 debian/build/build-generic/certs/signing_key.der -f; - (((until [ -f debian/build/build-generic/certs/signing_key.pem ]; do sleep 0.1; done) && while lsof debian/build/build-generic/certs/signing_key.pem; do sleep 0.1; done) && mv -f ../signing_key.pem debian/build/build-generic/certs/signing_key.pem) & - (((until [ -f debian/build/build-generic/certs/signing_key.x509 ]; do sleep 0.1; done) && while lsof debian/build/build-generic/certs/signing_key.x509; do sleep 0.1; done) && mv -f ../signing_key.x509 debian/build/build-generic/certs/signing_key.x509) & else echo "[-] Failed to obtain sources!"; doNotContinueKernelBuild=1; @@ -120,6 +112,14 @@ function kernel-build() { fi; fi; if [ $doNotContinueKernelBuild -eq 0 ]; then + mkdir -p debian/build/build-generic/certs; + sudo cp /cert/mok/signing_key.pem ../ -f; + sudo chmod u=rw,g=rw,o=rw ../signing_key.pem; + sudo cp /var/lib/shim-signed/mok/MOK.der ../signing_key.x509 -f; + sudo chmod u=rw,g=rw,o=rw ../signing_key.x509; + cp ../signing_key.x509 debian/build/build-generic/certs/signing_key.der -f; + (((until [ -f debian/build/build-generic/certs/signing_key.pem ]; do sleep 0.1; done) && while lsof debian/build/build-generic/certs/signing_key.pem; do sleep 0.1; done) && mv -f ../signing_key.pem debian/build/build-generic/certs/signing_key.pem) & + (((until [ -f debian/build/build-generic/certs/signing_key.x509 ]; do sleep 0.1; done) && while lsof debian/build/build-generic/certs/signing_key.x509; do sleep 0.1; done) && mv -f ../signing_key.x509 debian/build/build-generic/certs/signing_key.x509) & echo "[*] Building kernel..."; fakeroot debian/rules binary; if [ $? -eq 0 ]; then