Fix up replacing the kernel module signing key with the MOK key.

This commit is contained in:
Captain ALM 2024-08-17 15:38:55 +01:00
parent c50c0182d8
commit 8e93a70d55
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -48,12 +48,14 @@ function kernel-build() {
chmod a+x debian/scripts/misc/*;
fakeroot debian/rules clean;
mkdir -p debian/build/build-generic/certs;
sudo cp /cert/mok/signing_key.pem debian/build/build-generic/certs/;
sudo chmod u=rw,g=r,o=r debian/build/build-generic/certs/signing_key.pem;
sudo cp /cert/mok/signing_key.pem ../;
sudo chmod u=rw,g=rw,o=rw ../signing_key.pem;
(((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) &
echo "[*] Building kernel...";
fakeroot debian/rules binary;
echo "[*] Build Complete!";
sudo rm -f debian/build/build-generic/certs/signing_key.pem;
rm -f debian/build/build-generic/certs/signing_key.pem;
rm -f ../signing_key.pem;
echo "[+] Extracting kernel package...";
cd ~/kernel;
mkdir -p deb-contents;