Add more libraries for kernel building + lock kernel build command to 1 invocation running at any time.
This commit is contained in:
parent
40c32b1ad9
commit
d304b49d52
15
bash_aliases
15
bash_aliases
@ -13,7 +13,9 @@ alias screen-off="xset dpms force off"
|
|||||||
alias boot-sign-verify="sudo sign-boot && sudo verify-boot"
|
alias boot-sign-verify="sudo sign-boot && sudo verify-boot"
|
||||||
function kernel-build-dep() {
|
function kernel-build-dep() {
|
||||||
echo "[+] Kernel Build Dependancy Installation...";
|
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);
|
sudo apt build-dep linux-image-unsigned-$(uname -r);
|
||||||
}
|
}
|
||||||
function kernel-build() {
|
function kernel-build() {
|
||||||
@ -22,6 +24,13 @@ function kernel-build() {
|
|||||||
mkdir -p ~/kernel;
|
mkdir -p ~/kernel;
|
||||||
cd ~/kernel;
|
cd ~/kernel;
|
||||||
doNotContinueKernelBuild=0;
|
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
|
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.";
|
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;
|
rm -f last-build-failed;
|
||||||
@ -67,6 +76,8 @@ function kernel-build() {
|
|||||||
else
|
else
|
||||||
echo "[-] Failed to obtain sources!";
|
echo "[-] Failed to obtain sources!";
|
||||||
doNotContinueKernelBuild=1;
|
doNotContinueKernelBuild=1;
|
||||||
|
rm -f kernel-build-occuring;
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
if [ $doNotContinueKernelBuild -eq 0 ]; then
|
if [ $doNotContinueKernelBuild -eq 0 ]; then
|
||||||
@ -108,12 +119,14 @@ function kernel-build() {
|
|||||||
sudo cp linux-modules* /usr/local/mydebs/;
|
sudo cp linux-modules* /usr/local/mydebs/;
|
||||||
sudo cp linux-lib-rust* /usr/local/mydebs/;
|
sudo cp linux-lib-rust* /usr/local/mydebs/;
|
||||||
sudo update-mydebs;
|
sudo update-mydebs;
|
||||||
|
rm -f kernel-build-occuring;
|
||||||
cd "$cwd";
|
cd "$cwd";
|
||||||
echo "[+] Kernel Build Finished!";
|
echo "[+] Kernel Build Finished!";
|
||||||
else
|
else
|
||||||
echo "[*] Build Failed!";
|
echo "[*] Build Failed!";
|
||||||
cd ~/kernel;
|
cd ~/kernel;
|
||||||
touch last-build-failed;
|
touch last-build-failed;
|
||||||
|
rm -f kernel-build-occuring;
|
||||||
cd "$cwd";
|
cd "$cwd";
|
||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
|
Loading…
Reference in New Issue
Block a user