Compare commits

...

2 Commits

Author SHA1 Message Date
optout 93304b939b
KVER config selection 2024-02-12 18:24:43 +00:00
optout 2c140340c5
Script updates for end-user KVER selection 2024-02-12 18:11:48 +00:00
2 changed files with 36 additions and 8 deletions

View File

@ -3,12 +3,26 @@
# Set VAR
KVER='6.6.15-hardened1'
#KVER='5.10.145-hardened1'
#KVER='5.15.74-hardened1'
# Dependencies
sudo dnf install binutils /usr/include/{libelf.h,openssl/pkcs7.h} \
/usr/bin/{bc,bison,flex,gcc,git,openssl,make,perl,pahole,zstd}
function set_kver() {
echo "Enter the kernel version to use (e.g., '6.6.15-hardened1'):"
while true; do
read -e -i "${KVER:-}" -p "" KVER
if [[ $(echo $KVER | grep -E '^[0-9]+\.[0-9]+\.[0-9]+(-hardened1)$') == '' ]]; then
echo "Invalid format.";
else
break;
fi
done
}
# Invoke function to prompt end-user for desired version (must be an active release in the Anthraxx Linux-Hardened repository)
set_kver
# Staging w/ error handling
if [[ ! -f /usr/src/"$KVER".tar.gz ]]; then
/usr/bin/curl --verbose --tlsv1.3 --proto =https -L -O --url "https://github.com/anthraxx/linux-hardened/archive/refs/tags/"$KVER".tar.gz"
@ -19,7 +33,7 @@ if [[ ! -d /usr/src/linux-hardened-"$KVER" ]]; then
fi
cd /usr/src/linux-hardened-"$KVER"
wget https://0xacab.org/optout/plague-kernel/-/raw/main/"$KVER".config -O .config
wget https://0xacab.org/optout/plague-kernel/-/raw/main/6.6.15-hardened1.config -O .config
# Compilation

View File

@ -1,13 +1,27 @@
#!/bin/bash
# Set VAR
KVER='6.6.15-hardened1'
# Set Kernel Version Variable
#KVER='6.6.15-hardened1'
#KVER='5.10.145-hardened1'
#KVER='5.15.74-hardened1'
# Dependencies
xbps-install -Sy make gcc xz elfutils elfutils-devel flex ncurses-devel openssl openssl-devel argp-standalone gcc-ada mpc libmpc-devel gmp-devel perl
function set_kver() {
echo "Enter the kernel version to use (e.g., '6.6.15-hardened1'):"
while true; do
read -e -i "${KVER:-}" -p "" KVER
if [[ $(echo $KVER | grep -E '^[0-9]+\.[0-9]+\.[0-9]+(-hardened1)$') == '' ]]; then
echo "Invalid format.";
else
break;
fi
done
}
# Invoke function to prompt end-user for desired version (must be an active release in the Anthraxx Linux-Hardened repository)
set_kver
# Staging w/ error handling
if [[ ! -f /usr/src/"$KVER".tar.gz ]]; then
/usr/bin/curl --verbose --tlsv1.3 --proto =https -L -O --url "https://github.com/anthraxx/linux-hardened/archive/refs/tags/$KVER.tar.gz"
@ -18,7 +32,7 @@ if [[ ! -d /usr/src/linux-hardened-"$KVER" ]]; then
fi
cd /usr/src/linux-hardened-"$KVER"
wget https://0xacab.org/optout/plague-kernel/-/raw/main/5.10-hardened.config -O .config
wget https://0xacab.org/optout/plague-kernel/-/raw/main/6.6.15-hardened1.config -O .config
# Address system and file timing for clock skew runtime compilation error
@ -31,8 +45,8 @@ make oldconfig
make menuconfig
echo "Compiling "$KVER""
make --jobs=$(nproc)
make modules_install
make -j $(nproc --all)
make modules_install INSTALL_MOD_STRIP=1 install
# Ensure /boot is rw
mount -o remount,rw /boot