Add more libraries for kernel building + lock kernel build command to 1 invocation running at any time.

This commit is contained in:
Captain ALM 2024-08-21 14:50:54 +01:00
parent 40c32b1ad9
commit d304b49d52
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -13,7 +13,9 @@ alias screen-off="xset dpms force off"
alias boot-sign-verify="sudo sign-boot && sudo verify-boot"
function kernel-build-dep() {
echo "[+] Kernel Build Dependancy Installation...";
sudo apt install gawk git dh-make llvm libclang-dev libclang1 sbsigntool;
sudo apt install gawk git dh-make llvm libclang-dev sbsigntool linux-libc-dev libperl-dev libpython3-dev libunwind-dev liblzma-dev lzma-dev libzstd-dev libnuma-dev libelf-dev libcap-dev linux-libc-dev;
sudo apt install zlib1g-dev libclang1 zlib1g libbpf0 libzstd1 libnuma1 libelf1;
sudo apt install libpython3.10 libunwind8 liblzma5 libcap-ng0 libcap2;
sudo apt build-dep linux-image-unsigned-$(uname -r);
}
function kernel-build() {
@ -22,6 +24,13 @@ function kernel-build() {
mkdir -p ~/kernel;
cd ~/kernel;
doNotContinueKernelBuild=0;
if [ -f kernel-build-occuring ]; then
echo "[-] Kernel Build Occuring Already!";
doNotContinueKernelBuild=1;
else
touch kernel-build-occuring;
fi;
if [ $doNotContinueKernelBuild -eq 0 ]; then
if [ -f last-build-failed ]; then
echo "[*] Resuming last build; delete last-build-failed in the kernel directory before starting a kernel build to re-obtain sources.";
rm -f last-build-failed;
@ -67,6 +76,8 @@ function kernel-build() {
else
echo "[-] Failed to obtain sources!";
doNotContinueKernelBuild=1;
rm -f kernel-build-occuring;
fi;
fi;
fi;
if [ $doNotContinueKernelBuild -eq 0 ]; then
@ -108,12 +119,14 @@ function kernel-build() {
sudo cp linux-modules* /usr/local/mydebs/;
sudo cp linux-lib-rust* /usr/local/mydebs/;
sudo update-mydebs;
rm -f kernel-build-occuring;
cd "$cwd";
echo "[+] Kernel Build Finished!";
else
echo "[*] Build Failed!";
cd ~/kernel;
touch last-build-failed;
rm -f kernel-build-occuring;
cd "$cwd";
fi;
fi;