From 1ac2ea0fd26a0e36f02df5b6ca7b9bf0dcb329ff Mon Sep 17 00:00:00 2001 From: Adel Kara Slimane Date: Tue, 15 Aug 2023 12:39:28 +0200 Subject: [PATCH] Various fixes (#788) * install.sh: RPM: add install deps * install.sh: Fedora: remove fedora 32 code path too old by now * DEB: add dependencies * install.sh: do not install libc-dev package I don't remember why I had to keep it, but I just tried installing only the image and headers and nvidia-dkms installed just fine Closes: #772 #732 * prepare: disable CONFIG_LOCALVERSION_AUTO Closes: #729 * install.sh: gentoo: do not do initramfs and booloader config it's done directly by the kernel-install script called by make install, which gets changed in gentoo to do what needs to be done * patches: fix RPM patches for 6.4 and 6.5 --- install.sh | 24 ++++++++++----------- linux-tkg-config/prepare | 2 ++ linux-tkg-patches/6.4/0013-fedora-rpm.patch | 12 +++++++---- linux-tkg-patches/6.5/0013-fedora-rpm.patch | 12 +++++++---- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/install.sh b/install.sh index 20fcb890a..5d150f966 100755 --- a/install.sh +++ b/install.sh @@ -67,17 +67,13 @@ _install_dependencies() { fi if [ "$_distro" = "Debian" -o "$_distro" = "Ubuntu" ]; then msg2 "Installing dependencies" - sudo apt install bc bison build-essential ccache cpio fakeroot flex git kmod libelf-dev libncurses5-dev libssl-dev lz4 qtbase5-dev rsync schedtool wget zstd ${clang_deps} -y + sudo apt install bc bison build-essential ccache cpio fakeroot flex git kmod libelf-dev libncurses5-dev libssl-dev lz4 qtbase5-dev rsync schedtool wget zstd debhelper ${clang_deps} -y elif [ "$_distro" = "Fedora" ]; then msg2 "Installing dependencies" - if [ $(rpm -E %fedora) = "32" ]; then - sudo dnf install bison ccache dwarves elfutils-libelf-devel fedora-packager fedpkg flex gcc-c++ git grubby libXi-devel lz4 ncurses-devel openssl-devel pesign qt5-devel rpm-build rpmdevtools schedtool zstd ${clang_deps} -y - else - sudo dnf install perl bison ccache dwarves elfutils-devel elfutils-libelf-devel fedora-packager fedpkg flex gcc-c++ git grubby libXi-devel lz4 make ncurses-devel openssl openssl-devel perl-devel perl-generators pesign python3-devel qt5-qtbase-devel rpm-build rpmdevtools schedtool zstd -y ${clang_deps} -y - fi + sudo dnf install perl bison ccache dwarves elfutils-devel elfutils-libelf-devel fedora-packager fedpkg flex gcc-c++ git grubby libXi-devel lz4 make ncurses-devel openssl openssl-devel perl-devel perl-generators pesign python3-devel qt5-qtbase-devel rpm-build rpmdevtools schedtool zstd bc rsync -y ${clang_deps} -y elif [ "$_distro" = "Suse" ]; then msg2 "Installing dependencies" - sudo zypper install -y bc bison ccache dwarves elfutils flex gcc-c++ git libXi-devel libelf-devel libqt5-qtbase-common-devel libqt5-qtbase-devel lz4 make ncurses-devel openssl-devel patch pesign rpm-build rpmdevtools schedtool ${clang_deps} + sudo zypper install -y bc bison ccache dwarves elfutils flex gcc-c++ git libXi-devel libelf-devel libqt5-qtbase-common-devel libqt5-qtbase-devel lz4 make ncurses-devel openssl-devel patch pesign rpm-build rpmdevtools schedtool python3 rsync zstd ${clang_deps} fi } @@ -231,10 +227,9 @@ if [ "$1" = "install" ]; then fi _headers_deb="linux-headers-${_kernelname}*.deb" _image_deb="linux-image-${_kernelname}_*.deb" - _kernel_devel_deb="linux-libc-dev_${_kernelname}*.deb" cd DEBS - sudo dpkg -i $_headers_deb $_image_deb $_kernel_devel_deb + sudo dpkg -i $_headers_deb $_image_deb fi elif [[ "$_distro" =~ ^(Fedora|Suse)$ ]]; then @@ -375,10 +370,6 @@ if [ "$1" = "install" ]; then msg2 "Installing kernel" sudo make install - msg2 "Creating initramfs" - sudo dracut --force --hostonly ${_dracut_options} --kver $_kernelname - msg2 "Updating GRUB" - sudo grub-mkconfig -o /boot/grub/grub.cfg if [ "$_distro" = "Gentoo" ]; then @@ -396,6 +387,13 @@ if [ "$1" = "install" ]; then sudo emerge @module-rebuild --keep-going fi + else + + msg2 "Creating initramfs" + sudo dracut --force --hostonly ${_dracut_options} --kver $_kernelname + msg2 "Updating GRUB" + sudo grub-mkconfig -o /boot/grub/grub.cfg + fi fi diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 71f9b610b..238770427 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -866,6 +866,8 @@ _tkg_srcprep() { if [ "${_distro}" = "Arch" ]; then # Reset local version string if ever it's in the .config file scripts/config --set-str localversion "" + else + _disable "LOCALVERSION_AUTO" fi if [ -z $_debug ]; then diff --git a/linux-tkg-patches/6.4/0013-fedora-rpm.patch b/linux-tkg-patches/6.4/0013-fedora-rpm.patch index 6db150b2b..fe38371f4 100644 --- a/linux-tkg-patches/6.4/0013-fedora-rpm.patch +++ b/linux-tkg-patches/6.4/0013-fedora-rpm.patch @@ -1,20 +1,24 @@ diff --git a/scripts/package/mkspec b/scripts/package/mkspec -index 70392fd2f..34f98648f 100755 +index 8049f0e2c..de170760d 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec -@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz +@@ -53,2 +53,3 @@ $S Source2: diff.patch + Provides: kernel-$KERNELRELEASE ++ Provides: kernel-uname-r = %{version} + $S BuildRequires: bc binutils bison dwarves +@@ -69,4 +70,4 @@ $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync Group: Development/System - Obsoletes: kernel-headers Provides: kernel-headers = %{version} + Provides: installonlypkg(kernel) = %{version} %description headers -@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE +@@ -81,2 +82,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE $S$M Group: System Environment/Kernel +$S$M Provides: kernel-devel = %{version} +$S$M Provides: kernel-devel-uname-r = %{version} +$S$M Provides: installonlypkg(kernel) = %{version} $S$M AutoReqProv: no -@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package. +@@ -86,2 +90,18 @@ $S$M against the $__KERNELRELEASE kernel package. $S$M +$S # Opt out of a lot of Fedora hardening flags etc... +$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md diff --git a/linux-tkg-patches/6.5/0013-fedora-rpm.patch b/linux-tkg-patches/6.5/0013-fedora-rpm.patch index 6db150b2b..fe38371f4 100644 --- a/linux-tkg-patches/6.5/0013-fedora-rpm.patch +++ b/linux-tkg-patches/6.5/0013-fedora-rpm.patch @@ -1,20 +1,24 @@ diff --git a/scripts/package/mkspec b/scripts/package/mkspec -index 70392fd2f..34f98648f 100755 +index 8049f0e2c..de170760d 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec -@@ -63,4 +66,4 @@ $S Source: kernel-$__KERNELRELEASE.tar.gz +@@ -53,2 +53,3 @@ $S Source2: diff.patch + Provides: kernel-$KERNELRELEASE ++ Provides: kernel-uname-r = %{version} + $S BuildRequires: bc binutils bison dwarves +@@ -69,4 +70,4 @@ $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync Group: Development/System - Obsoletes: kernel-headers Provides: kernel-headers = %{version} + Provides: installonlypkg(kernel) = %{version} %description headers -@@ -75,2 +78,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE +@@ -81,2 +82,5 @@ $S$M Summary: Development package for building kernel modules to match the $__KE $S$M Group: System Environment/Kernel +$S$M Provides: kernel-devel = %{version} +$S$M Provides: kernel-devel-uname-r = %{version} +$S$M Provides: installonlypkg(kernel) = %{version} $S$M AutoReqProv: no -@@ -80,2 +86,18 @@ $S$M against the $__KERNELRELEASE kernel package. +@@ -86,2 +90,18 @@ $S$M against the $__KERNELRELEASE kernel package. $S$M +$S # Opt out of a lot of Fedora hardening flags etc... +$S # See https://src.fedoraproject.org/rpms/redhat-rpm-config//blob/rawhide/f/buildflags.md