|
@@ -1,4 +1,5 @@
|
|
|
%bcond_with systemd
|
|
|
+%bcond_without compat_grub_legacy
|
|
|
|
|
|
%define _noVersionedDependencies 1
|
|
|
%define _minimum_patches 0
|
|
@@ -39,7 +40,7 @@
|
|
|
# adding some text to the end of the version number.
|
|
|
#
|
|
|
%define sublevel 4
|
|
|
-%define patchlevel 109
|
|
|
+%define patchlevel 111
|
|
|
%define kversion 5.%{sublevel}
|
|
|
%define rpmversion 5.%{sublevel}.%{patchlevel}
|
|
|
%define release 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
@@ -142,7 +143,7 @@
|
|
|
# Packages that need to be installed before the kernel is, because the %post
|
|
|
# scripts use them.
|
|
|
#
|
|
|
-%define kernel_prereq fileutils, %{kmod}, initscripts >= 8.80, %{mkinitrd} >= %{mkinitrd_version}, linux-firmware >= 20110601-1
|
|
|
+%define kernel_prereq fileutils, %{kmod}, initscripts >= 8.80, %{mkinitrd} >= %{mkinitrd_version}, linux-firmware >= 20110601-1, /usr/bin/kernel-install
|
|
|
|
|
|
#
|
|
|
# stop to remove %%{buildroot} before %%install
|
|
@@ -613,6 +614,7 @@ cd linux-%{kversion}
|
|
|
BuildKernel() {
|
|
|
|
|
|
# Pick the right config file for the kernel we're building
|
|
|
+ KVERREL_SUFFIX=$1
|
|
|
if [ -n "$1" ] ; then
|
|
|
Config=kernel-%{kversion}-%{_target_cpu}-$1.config
|
|
|
DevelDir=/usr/src/kernels/%{KVERREL}-$1-%{_target_cpu}
|
|
@@ -649,7 +651,7 @@ BuildKernel() {
|
|
|
|
|
|
make -s ARCH=$Arch olddefconfig > /dev/null
|
|
|
# This ensures build-ids are unique to allow parallel debuginfo
|
|
|
- perl -p -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"%{KVERREL}\"/" .config
|
|
|
+ perl -p -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"%{KVERREL}${KVERREL_SUFFIX}\"/" .config
|
|
|
|
|
|
make -s ARCH=$Arch %{?_smp_mflags} %{make_target}
|
|
|
make -s ARCH=$Arch %{?_smp_mflags} modules || exit 1
|
|
@@ -960,135 +962,96 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
### scripts
|
|
|
###
|
|
|
|
|
|
-# load the loop module for upgrades...in case the old modules get removed we have
|
|
|
-# loopback in the kernel so that mkinitrd will work.
|
|
|
-%pre
|
|
|
-/sbin/modprobe loop 2> /dev/null > /dev/null || :
|
|
|
-exit 0
|
|
|
-
|
|
|
-%pre pae
|
|
|
-/sbin/modprobe loop 2> /dev/null > /dev/null || :
|
|
|
-exit 0
|
|
|
-
|
|
|
-%post
|
|
|
-[ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade
|
|
|
-if [ -x /sbin/new-kernel-pkg ]; then
|
|
|
- if [ -x /usr/bin/dracut ]; then
|
|
|
- /sbin/new-kernel-pkg --mkinitrd --dracut \
|
|
|
- --host-only --depmod --install %{KVERREL}
|
|
|
- else
|
|
|
- /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}
|
|
|
- fi
|
|
|
+%if %{with compat_grub_legacy}
|
|
|
+%post
|
|
|
+cd /boot
|
|
|
+KVERREL=%{KVERREL}
|
|
|
+
|
|
|
+currentkernel=vmlinuz-`uname -r`
|
|
|
+currentinitrd=initrd-`uname -r`.img
|
|
|
+if [ ! -f "${currentkernel}" -o ! -f "${currentinitrd}" ]; then
|
|
|
+ currentkernel=`readlink -e vmlinuz`
|
|
|
+ currentinitrd=`readlink -e initrd.img`
|
|
|
fi
|
|
|
|
|
|
-cd /boot
|
|
|
# vmlinuz symlinks to new default kernel
|
|
|
-ln -sf vmlinuz-%{KVERREL} vmlinuz
|
|
|
-ln -sf System.map-%{KVERREL} System.map
|
|
|
-ln -sf initrd-%{KVERREL}.img initrd.img
|
|
|
-# vmlinuz.old symlink to current running kernel
|
|
|
-current=`uname -r`
|
|
|
-if [ ! -f vmlinuz-${current} ]; then
|
|
|
- ln -sf vmlinuz-%{KVERREL} vmlinuz.old
|
|
|
- ln -sf System.map-%{KVERREL} System.map.old
|
|
|
- ln -sf initrd-%{KVERREL}.img initrd.old.img
|
|
|
-else
|
|
|
- ln -sf vmlinuz-${current} vmlinuz.old
|
|
|
- ln -sf System.map-${current} System.map.old
|
|
|
- ln -sf initrd-${current}.img initrd.old.img
|
|
|
-fi
|
|
|
+ln -sf vmlinuz-${KVERREL} vmlinuz
|
|
|
+ln -sf initramfs-${KVERREL}.img initrd.img
|
|
|
|
|
|
-[ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
|
|
|
-depmod -a -F /boot/System.map-%{KVERREL} %{KVERREL}
|
|
|
-
|
|
|
-# if preffered bootloader is LILO, execute lilo.
|
|
|
-%ifarch i586 i686
|
|
|
-if [ -f /etc/sysconfig/bootloader ]; then
|
|
|
- source /etc/sysconfig/bootloader
|
|
|
- if [ "$BOOTLOADER" = "lilo" ]; then
|
|
|
- if [ -x /sbin/lilo -a -f /etc/lilo.conf ]; then
|
|
|
- /sbin/lilo > /dev/null
|
|
|
- exit 0
|
|
|
- fi
|
|
|
- fi
|
|
|
+if [ -z "${currentkernel}" -o ! -f "${currentkernel}" -o \
|
|
|
+ -z "${currentinitrd}" -o ! -f "${currentinitrd}" ]; then
|
|
|
+ ln -sf vmlinuz-${KVERREL} vmlinuz.old
|
|
|
+ ln -sf initramfs-${KVERREL}.img initrd.old.img
|
|
|
+else
|
|
|
+ ln -sf `basename ${currentkernel}` vmlinuz.old
|
|
|
+ ln -sf `basename ${currentinitrd}` initrd.old.img
|
|
|
fi
|
|
|
%endif
|
|
|
|
|
|
-# update grub/menu.lst
|
|
|
-GRUB_MENULST="/boot/grub/menu.lst"
|
|
|
-if [ -f $GRUB_MENULST ]; then
|
|
|
- if ( grep -q "resume2=" $GRUB_MENULST ) ; then
|
|
|
- sed -i.rpmsave 's/resume2=/resume=/g' $GRUB_MENULST
|
|
|
- fi
|
|
|
+%posttrans
|
|
|
+depmod -a "%{KVERREL}"
|
|
|
+if [ -x %{_sbindir}/weak-modules ]; then
|
|
|
+ %{_sbindir}/weak-modules --add-kernel %{KVERREL} || exit $?
|
|
|
+fi
|
|
|
+if [ -x %{_bindir}/kernel-install ]; then
|
|
|
+ %{_bindir}/kernel-install add %{KVERREL} /boot/vmlinuz-%{KVERREL} || exit $?
|
|
|
fi
|
|
|
|
|
|
-%post pae
|
|
|
-[ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade
|
|
|
-if [ -x /sbin/new-kernel-pkg ]; then
|
|
|
- if [ -x /usr/bin/dracut ]; then
|
|
|
- /sbin/new-kernel-pkg --mkinitrd --dracut \
|
|
|
- --host-only --depmod --install %{KVERREL}pae
|
|
|
- else
|
|
|
- /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}pae
|
|
|
- fi
|
|
|
+%preun
|
|
|
+if [ -x %{_bindir}/kernel-install ]; then
|
|
|
+ %{_bindir}/kernel-install remove %{KVERREL} /boot/vmlinuz-%{KVERREL} || exit $?
|
|
|
+fi
|
|
|
+if [ -x %{_sbindir}/weak-modules ]; then
|
|
|
+ %{_sbindir}/weak-modules --remove-kernel %{KVERREL} || exit $?
|
|
|
fi
|
|
|
+rm -f /lib/modules/"%{KVERREL}"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
|
|
|
|
|
|
+
|
|
|
+%if %{buildpae}
|
|
|
+%if %{with compat_grub_legacy}
|
|
|
+%post pae
|
|
|
cd /boot
|
|
|
-# vmlinuz-pae symlinks to new default pae kernel
|
|
|
-ln -sf vmlinuz-%{KVERREL}pae vmlinuz-pae
|
|
|
-ln -sf System.map-%{KVERREL}pae System.map-pae
|
|
|
-ln -sf initrd-%{KVERREL}pae.img initrd-pae.img
|
|
|
-# vmlinuz.old symlink to current running kernel
|
|
|
-current=`uname -r`
|
|
|
-ln -sf vmlinuz-${current} vmlinuz.old
|
|
|
-ln -sf System.map-${current} System.map.old
|
|
|
-ln -sf initrd-${current}.img initrd.old.img
|
|
|
-
|
|
|
-[ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
|
|
|
-depmod -a -F /boot/System.map-%{KVERREL}pae %{KVERREL}pae
|
|
|
-
|
|
|
-# add PAE kernel entry to grub menu.list
|
|
|
-GRUB_MENULST="/boot/grub/menu.lst"
|
|
|
-if [ -f $GRUB_MENULST ]; then
|
|
|
- if ( ! grep -q "PAE kernel" $GRUB_MENULST ) ; then
|
|
|
- if [ -x /sbin/grubby ]; then
|
|
|
- /sbin/grubby --title="Vine Linux (PAE kernel)" \
|
|
|
- --add-kernel=/boot/vmlinuz-pae \
|
|
|
- --initrd=/boot/initrd-pae.img \
|
|
|
- --copy-default \
|
|
|
- --config-file=$GRUB_MENULST >& /dev/null ||:
|
|
|
- fi
|
|
|
- fi
|
|
|
+KVERREL=%{KVERREL}pae
|
|
|
+
|
|
|
+currentkernel=vmlinuz-`uname -r`
|
|
|
+currentinitrd=initrd-`uname -r`.img
|
|
|
+if [ ! -f "${currentkernel}" -o ! -f "${currentinitrd}" ]; then
|
|
|
+ currentkernel=`readlink -e vmlinuz`
|
|
|
+ currentinitrd=`readlink -e initrd.img`
|
|
|
fi
|
|
|
|
|
|
-# if preffered bootloader is LILO, execute lilo.
|
|
|
-%ifarch i586 i686 x86_64
|
|
|
-if [ -f /etc/sysconfig/bootloader ]; then
|
|
|
- source /etc/sysconfig/bootloader
|
|
|
- if [ "$BOOTLOADER" = "lilo" ]; then
|
|
|
- if [ -x /sbin/lilo -a -f /etc/lilo.conf ]; then
|
|
|
- /sbin/lilo > /dev/null
|
|
|
- exit 0
|
|
|
- fi
|
|
|
- fi
|
|
|
+# vmlinuz symlinks to new default kernel
|
|
|
+ln -sf vmlinuz-${KVERREL} vmlinuz
|
|
|
+ln -sf initramfs-${KVERREL}.img initrd.img
|
|
|
+
|
|
|
+if [ -z "${currentkernel}" -o ! -f "${currentkernel}" -o \
|
|
|
+ -z "${currentinitrd}" -o ! -f "${currentinitrd}" ]; then
|
|
|
+ ln -sf vmlinuz-${KVERREL} vmlinuz.old
|
|
|
+ ln -sf initramfs-${KVERREL}.img initrd.old.img
|
|
|
+else
|
|
|
+ ln -sf `basename ${currentkernel}` vmlinuz.old
|
|
|
+ ln -sf `basename ${currentinitrd}` initrd.old.img
|
|
|
fi
|
|
|
%endif
|
|
|
|
|
|
-# update grub/menu.lst
|
|
|
-GRUB_MENULST="/boot/grub/menu.lst"
|
|
|
-if [ -f $GRUB_MENULST ]; then
|
|
|
- if ( grep -q "resume2=" $GRUB_MENULST ) ; then
|
|
|
- sed -i.rpmsave 's/resume2=/resume=/g' $GRUB_MENULST
|
|
|
- fi
|
|
|
+%posttrans pae
|
|
|
+depmod -a "%{KVERREL}pae"
|
|
|
+if [ -x %{_sbindir}/weak-modules ]; then
|
|
|
+ %{_sbindir}/weak-modules --add-kernel %{KVERREL}pae || exit $?
|
|
|
+fi
|
|
|
+if [ -x %{_bindir}/kernel-install ]; then
|
|
|
+ %{_bindir}/kernel-install add %{KVERREL}pae /boot/vmlinuz-%{KVERREL}pae || exit $?
|
|
|
fi
|
|
|
-
|
|
|
-%preun
|
|
|
-/sbin/modprobe loop 2> /dev/null > /dev/null || :
|
|
|
-[ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}
|
|
|
|
|
|
%preun pae
|
|
|
-/sbin/modprobe loop 2> /dev/null > /dev/null || :
|
|
|
-[ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}pae
|
|
|
+if [ -x %{_bindir}/kernel-install ]; then
|
|
|
+ %{_bindir}/kernel-install remove %{KVERREL}pae /boot/vmlinuz-%{KVERREL}pae || exit $?
|
|
|
+fi
|
|
|
+if [ -x %{_sbindir}/weak-modules ]; then
|
|
|
+ %{_sbindir}/weak-modules --remove-kernel %{KVERREL}pae || exit $?
|
|
|
+fi
|
|
|
+rm -f /lib/modules/"%{KVERREL}pae"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
###
|
|
@@ -1209,6 +1172,10 @@ fi
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Mon Apr 12 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.4.111-1
|
|
|
+- updated to 5.4.111.
|
|
|
+- switched to kernel-install from grubby.
|
|
|
+
|
|
|
* Wed Mar 31 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.4.109-1
|
|
|
- updated to 5.4.109.
|
|
|
|