Refactor scripts to be POSIX compliant

This commit is contained in:
2025-04-23 13:49:43 +01:00
parent dd90999805
commit 78294df50d
14 changed files with 138 additions and 148 deletions

View File

@@ -1,20 +1,20 @@
#! /bin/bash
#! /bin/sh
YELLOW="\e[33m"
NC="\e[0m"
echo -e "\n${YELLOW}Downloading APT dependencies...${NC}\n"
echo "\n${YELLOW}Downloading APT dependencies...${NC}\n"
sudo apt install build-essential git -y
sudo apt build-dep linux -y
echo -e "\n${YELLOW}Downloading kernel source...${NC}\n"
mkdir linux-parent && cd linux-parent
echo "\n${YELLOW}Downloading kernel source...${NC}\n"
mkdir linux-parent && cd linux-parent || exit 1
git clone --depth 1 https://github.com/torvalds/linux
cd linux
cd linux || exit 1
cp /boot/config-$(uname -r) .config # Copy current kernel config
make nconfig # Edit the current kernel configuration
diff /boot/config-$(uname -r) .config # Check your changes
cp /boot/config-"$(uname -r)" .config # Copy current kernel config
make nconfig # Edit the current kernel configuration
diff /boot/config-"$(uname -r)" .config # Check your changes
# Do not include debugging symbols. Alternatively, use `strip` to remove them. (these configs are working as of 6.14)
scripts/config --undefine GDB_SCRIPTS
@@ -26,14 +26,14 @@ scripts/config --set-val DEBUG_INFO_NONE y
scripts/config --set-val DEBUG_INFO_DWARF5 n
scripts/config --disable DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
echo -e "\n${YELLOW}Compiling the kernel...${NC}\n"
make -j$(nproc) deb-pkg LOCALVERSION=-custom
echo "\n${YELLOW}Compiling the kernel...${NC}\n"
make -j"$(nproc)" deb-pkg LOCALVERSION=-custom
echo -e "\n${YELLOW}Installing the generated dpkg packages...${NC}\n"
echo "\n${YELLOW}Installing the generated dpkg packages...${NC}\n"
sudo dpkg -i ../linux-headers*-custom*.deb
sudo dpkg -i ../linux-image*-custom*.deb
echo -e "\n${YELLOW}Cleaning up...${NC}\n"
echo "\n${YELLOW}Cleaning up...${NC}\n"
cd ../..
rm -rf linux-parent