2024-01-27 22:44:24 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-27 23:04:13 -05:00
|
|
|
kernel_version="6.7.2"
|
|
|
|
zen_version="zen1"
|
|
|
|
source_url="https://github.com/zen-kernel/zen-kernel/archive/refs/tags/v${kernel_version}-${zen_version}.tar.gz"
|
|
|
|
source_file="v${kernel_version}-${zen_version}.tar.gz"
|
|
|
|
|
2024-01-27 22:44:24 -05:00
|
|
|
is_package_installed() {
|
|
|
|
dnf list installed "$1" &> /dev/null
|
|
|
|
return $?
|
|
|
|
}
|
|
|
|
|
2024-01-27 23:04:13 -05:00
|
|
|
if [ -f "SOURCES/${source_file}" ]; then
|
|
|
|
rm -f "SOURCES/${source_file}"
|
2024-01-27 22:44:24 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
for dir in BUILD BUILDROOT RPMS SOURCES SPECS SRPMS; do
|
|
|
|
if [ ! -d "$dir" ]; then
|
|
|
|
mkdir "$dir"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
required_packages=(gcc make flex bison ncurses-devel elfutils-libelf-devel openssl-devel clang llvm rpm-build redhat-rpm-config rpmdevtools dwarves)
|
|
|
|
|
|
|
|
for package in "${required_packages[@]}"; do
|
|
|
|
if ! is_package_installed "$package"; then
|
|
|
|
sudo dnf install -y "$package"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2024-01-27 23:04:13 -05:00
|
|
|
if [ ! -f "SOURCES/${source_file}" ]; then
|
|
|
|
wget -P SOURCES/ "${source_url}"
|
2024-01-27 22:44:24 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
rpmbuild -ba --define "_topdir $PWD" SPECS/linux-zen.spec
|
|
|
|
|