merge kernel-*-modules into main kernel package; fix depmod after moving System.map away from /boot [release 5.4.51.20200902-2mamba;Sun Oct 04 2020]

This commit is contained in:
Silvan Calarco 2024-01-06 01:27:47 +01:00
parent 90910dd10e
commit c41bd0d00a
3 changed files with 9203 additions and 85 deletions

View File

@ -5,5 +5,5 @@ The kernel package contains the Linux kernel (%{KIMAGE_DEST}), the operating sys
The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc. The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc.
This is the source package used to build kernel for different architectures and targets. This is the source package used to build kernel for different architectures and targets.
This kernel was build for %{_target_cpu} architecture and the following target: rpi-v7l. This kernel was build for %{_target_cpu} architecture and the following target: .

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
# openmamba kernel specfile for embedded kernels # openmamba kernel specfile for embedded kernels
# Copyright (C) 2011-2020 by Silvan Calarco # Copyright (C) 2011-2021 by Silvan Calarco
# #
# To build a specific target: # To build a specific target:
# #
@ -18,12 +18,13 @@
%define kernel_majver %(echo %version | cut -d. -f1-2) %define kernel_majver %(echo %version | cut -d. -f1-2)
%define gitdirver 1.%(echo %version | cut -d. -f4) %define gitdirver 1.%(echo %version | cut -d. -f4)
%ifarch aarch64
%define KERNEL_TARGET rpi-v8
%else
%if "%{?KERNEL_TARGET}" == "" %if "%{?KERNEL_TARGET}" == ""
%define KERNEL_TARGET rpi-v7l %define KERNEL_TARGET rpi-v7l
%endif
%endif %endif
# define short kernel target name for Lilo
%define KERNEL_TARGET_SHORT %{KERNEL_TARGET}
%if "%{_target_cpu}" == "arm" %if "%{_target_cpu}" == "arm"
%define KIMAGE arch/arm/boot/zImage %define KIMAGE arch/arm/boot/zImage
@ -32,12 +33,19 @@
%define target_cpu %{_target_cpu} %define target_cpu %{_target_cpu}
%endif %endif
%if "%{_target_cpu}" == "aarch64"
%define KIMAGE arch/arm64/boot/Image
%define KIMAGE_DEST kernel
%define DEPMOD /sbin/depmod
%define target_cpu arm64
%endif
# disable internal dependency generator for scriptlets # disable internal dependency generator for scriptlets
%define _use_internal_dependency_generator 1 %define _use_internal_dependency_generator 1
Name: kernel-rpi Name: kernel-rpi
Version: 5.4.51.20200902 Version: 5.4.51.20200902
Release: 1mamba Release: 2mamba
Summary: The Linux Kernel, the operating system core itself for the RaspberryPI Summary: The Linux Kernel, the operating system core itself for the RaspberryPI
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Vendor: openmamba Vendor: openmamba
@ -45,21 +53,25 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/raspberrypi/linux URL: https://github.com/raspberrypi/linux
Source0: git://github.com/raspberrypi/linux.git/raspberrypi-kernel_%{gitdirver}-1/linux-%{version}.tar.bz2 Source0: git://github.com/raspberrypi/linux.git/raspberrypi-kernel_%{gitdirver}-1/linux-%{version}.tar.bz2
#Source0: git://github.com/raspberrypi/linux.git/rpi-%{gitdirver}.y/linux-%{version}.tar.bz2
Source20: kernel-rpi-logo.png Source20: kernel-rpi-logo.png
Source100: %{name}-v7-%{kernel_majver}-arm-config Source100: %{name}-v7-%{kernel_majver}-arm-config
Source101: %{name}-%{kernel_majver}-arm-config Source101: %{name}-%{kernel_majver}-arm-config
Source102: kernel-rpi-v7l-%{kernel_majver}-arm-config Source102: kernel-rpi-v7l-%{kernel_majver}-arm-config
Source103: kernel-rpi-v8-%{kernel_majver}-aarch64-config
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libperl BuildRequires: libperl
BuildRequires: perl-devel BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: /bin/bash /bin/sh /usr/bin/perl BuildRequires: /bin/bash
BuildRequires: /bin/sh
BuildRequires: /usr/bin/perl
BuildRequires: kmod BuildRequires: kmod
BuildRequires: mkbootimg Provides: kernel-%{KERNEL_TARGET}-modules
Obsoletes: kernel-%{KERNEL_TARGET}-modules
Provides: kernel Provides: kernel
Provides: kernelmodules
Requires(post): dracut Requires(post): dracut
Requires: linux_firmware Requires: linux_firmware
Requires: raspberrypi-firmware Requires: raspberrypi-firmware
@ -77,14 +89,19 @@ This kernel was build for %{_target_cpu} architecture and the following target:
%package -n kernel-%{KERNEL_TARGET} %package -n kernel-%{KERNEL_TARGET}
Group: Development/Kernel Group: Development/Kernel
Summary: The Linux Kernel, the operating system core itself for the RaspberryPI (%{KERNEL_TARGET}) Summary: The Linux Kernel, the operating system core itself for the RaspberryPI (%{KERNEL_TARGET})
Provides: kernel-%{KERNEL_TARGET}-modules
Obsoletes: kernel-%{KERNEL_TARGET}-modules
%if "%{KERNEL_TARGET}" == "rpi-v7" %if "%{KERNEL_TARGET}" == "rpi-v7"
Provides: kernel-rpi2 Provides: kernel-rpi2
Obsoletes: kernel-rpi2 Obsoletes: kernel-rpi2
Provides: kernel-rpi2-modules
Obsoletes: kernel-rpi2-modules
%endif
Provides: kernel Provides: kernel
Provides: kernelmodules
Requires(post): dracut Requires(post): dracut
Requires: linux_firmware Requires: linux_firmware
Requires: raspberrypi-firmware Requires: raspberrypi-firmware
%endif
%description -n kernel-%{KERNEL_TARGET} %description -n kernel-%{KERNEL_TARGET}
The Linux Kernel, the operating system core itself for the Raspberry PI. The Linux Kernel, the operating system core itself for the Raspberry PI.
@ -137,32 +154,6 @@ Obsoletes: kernel-rpi2-headers-sanitised
Sanitised kernel headers used for glibc build. Sanitised kernel headers used for glibc build.
This kernel sanitised headers are configured for %{TARGET_CPU} architecture and the following target: %{?KERNEL_TARGET}. This kernel sanitised headers are configured for %{TARGET_CPU} architecture and the following target: %{?KERNEL_TARGET}.
%package -n kernel-%{KERNEL_TARGET}-modules
Group: System/Kernel and Hardware
Summary: The kernel base modules normally used by the device
Requires: kernel-%{KERNEL_TARGET} == %{version}-%{release}
Provides: kernelmodules
%if "%{KERNEL_TARGET}" == "rpi-v7"
Provides: kernel-rpi2-modules
Obsoletes: kernel-rpi2-modules
%endif
%description -n kernel-%{KERNEL_TARGET}-modules
The kernel-modules package contains the base modules normally used by the device
%package -n kernel-%{KERNEL_TARGET}-modules-extra
Group: System/Kernel and Hardware
Summary: The kernel extra modules not normally used by the device
Requires: kernel-%{KERNEL_TARGET} == %{version}-%{release}
Provides: kernelmodulesextra
%if "%{KERNEL_TARGET}" == "rpi-v7"
Provides: kernel-rpi2-modules-extra
Obsoletes: kernel-rpi2-modules-extra
%endif
%description -n kernel-%{KERNEL_TARGET}-modules-extra
The kernel-modules-extra package contains extra modules not normally used by the device.
%package -n kernel-%{KERNEL_TARGET}-firmware %package -n kernel-%{KERNEL_TARGET}-firmware
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Summary: Firmware files used by %{name} Summary: Firmware files used by %{name}
@ -177,6 +168,14 @@ Obsoletes: kernel-rpi2-firmware
%description -n kernel-%{KERNEL_TARGET}-firmware %description -n kernel-%{KERNEL_TARGET}-firmware
Firmware files used by the Linux Kernel. Firmware files used by the Linux Kernel.
%package -n kernel-%{KERNEL_TARGET}-dtbs
Group: System/Kernel and Hardware
Summary: Device Tree blobs provided with %{name}
Requires: kernel-%{KERNEL_TARGET} == %{version}-%{release}
%description -n kernel-%{KERNEL_TARGET}-dtbs
Device Tree blobs provided with %{name}.
%prep %prep
%setup -q -n linux-%{version} %setup -q -n linux-%{version}
#-D -T #-D -T
@ -204,6 +203,11 @@ make mrproper
rpi-v7l) kernel_cfg=%{SOURCE102} ;; rpi-v7l) kernel_cfg=%{SOURCE102} ;;
esac esac
%endif %endif
%if %{_target_cpu} == aarch64
case %{?KERNEL_TARGET} in
rpi-v8) kernel_cfg=%{SOURCE103} ;;
esac
%endif
cp $kernel_cfg ./.config cp $kernel_cfg ./.config
cp Makefile Makefile.orig cp Makefile Makefile.orig
@ -219,7 +223,7 @@ pngtopnm %{SOURCE20} | ppmquant -plain 224 > drivers/video/logo/logo_linux_clut2
# #
ARCH=%{target_cpu} make oldconfig ARCH=%{target_cpu} make oldconfig
ARCH=%{target_cpu} make CROSS_COMPILE=%{_target_platform}- %{?_smp_mflags} ARCH=%{target_cpu} make CROSS_COMPILE=%{_target_platform}- %{?_smp_mflags}
ARCH=%{target_cpu} make CROSS_COMPILE=%{_target_platform}- %{?_smp_mflags} dtbs ARCH=%{target_cpu} make CROSS_COMPILE=%{_target_platform}- %{?_smp_mflags} modules dtbs
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -244,14 +248,19 @@ rm -f build && ln -sf /usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET} build )
esac esac
%endif %endif
%if %{_target_cpu} == aarch64
case %{?KERNEL_TARGET} in
rpi-v8) kimage_dest="kernel8.img" ;;
esac
%endif
cp %{KIMAGE} %{buildroot}/boot/${kimage_dest} cp %{KIMAGE} %{buildroot}/boot/${kimage_dest}
#cp System.map %{buildroot}/boot/System.map-%{kernel_ver}-%{?KERNEL_TARGET} cp System.map %{buildroot}/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/System.map
# install dtbs # install dtbs
#cp arch/arm/boot/dts/*.dtb %{buildroot}/boot/ install -d -m0755 %{buildroot}/boot/overlays/
#install -d -m0755 %{buildroot}/boot/overlays/ #cp arch/%{target_cpu}/boot/dts/*.dtb %{buildroot}/boot/
#cp arch/arm/boot/dts/overlays/*.dtb* %{buildroot}/boot/overlays/ cp arch/arm/boot/dts/overlays/*.dtb* %{buildroot}/boot/overlays/
#cp arch/arm/boot/dts/overlays/README %{buildroot}/boot/overlays/
# recreate kernel sources # recreate kernel sources
[ -e kernel-headers.files ] && rm -f kernel-headers.files [ -e kernel-headers.files ] && rm -f kernel-headers.files
@ -268,6 +277,12 @@ ARCH=%{target_cpu} make mrproper
esac esac
%endif %endif
%if %{_target_cpu} == aarch64
case %{?KERNEL_TARGET} in
rpi-v8) kernel_cfg=%{SOURCE103} ;;
esac
%endif
cp $kernel_cfg %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.config cp $kernel_cfg %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/.config
cp %{_builddir}/linux-%{version}/Module.symvers %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET} cp %{_builddir}/linux-%{version}/Module.symvers %{buildroot}/usr/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}
ARCH=%{target_cpu} make oldconfig ARCH=%{target_cpu} make oldconfig
@ -301,9 +316,8 @@ cd %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}
splitdirs="block crypto drivers fs ipc kernel lib mm net security sound" splitdirs="block crypto drivers fs ipc kernel lib mm net security sound"
case %{_target_cpu} in case %{_target_cpu} in
i586|x86_64) headers_arch="x86" ;;
arm) headers_arch="arm" ;; arm) headers_arch="arm" ;;
ppc) headers_arch="ppc" ;; aarch64) headers_arch="arm64" ;;
esac esac
find $splitdirs -name *.h -exec \ find $splitdirs -name *.h -exec \
@ -356,15 +370,11 @@ rm -rf %{buildroot}%{_prefix}/src/linux-%{kernel_ver}-%{KERNEL_TARGET}/.github
%post -n kernel-%{KERNEL_TARGET} %post -n kernel-%{KERNEL_TARGET}
# new install or upgrade # new install or upgrade
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/sbin/depmod -A -F /boot/System.map-%{kernel_ver}-%{?KERNEL_TARGET} \ /sbin/depmod -A -F /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/System.map \
%{kernel_ver}-%{?KERNEL_TARGET} &>/dev/null %{kernel_ver}-%{?KERNEL_TARGET} &>/dev/null
mkinitrd -f /boot/initramfs-%{kernel_ver}-%{?KERNEL_TARGET}.img %{kernel_ver}-%{?KERNEL_TARGET} #mkinitrd -f /boot/initramfs-%{kernel_ver}-%{?KERNEL_TARGET}.img %{kernel_ver}-%{?KERNEL_TARGET}
fi fi
#[ -e /dev/mtd3 ] && { :
# flash_eraseall /dev/mtd3
# cat /boot/%{KIMAGE_DEST}-%{kernel_ver}-%{?KERNEL_TARGET} > /dev/mtd3
#}
exit 0
%postun -n kernel-%{KERNEL_TARGET} %postun -n kernel-%{KERNEL_TARGET}
# erase this package # erase this package
@ -372,36 +382,30 @@ if [ $1 -eq 0 ]; then
[ -f /boot/%{KIMAGE_DEST}-%{kernel_ver}-%{?KERNEL_TARGET} ] || [ -f /boot/%{KIMAGE_DEST}-%{kernel_ver}-%{?KERNEL_TARGET} ] ||
rm -f /boot/initramfs-%{kernel_ver}-%{?KERNEL_TARGET}.img rm -f /boot/initramfs-%{kernel_ver}-%{?KERNEL_TARGET}.img
fi fi
exit 0 :
%post -n kernel-%{KERNEL_TARGET}-headers %post -n kernel-%{KERNEL_TARGET}-headers
# touch file so it results up-to-date on make # touch file so it results up-to-date on make
touch %{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/include/config/MARKER touch %{_prefix}/src/linux-%{kernel_ver}-%{?KERNEL_TARGET}/include/config/MARKER
exit 0 :
%post -n kernel-%{KERNEL_TARGET}-modules
# new install or upgrade
if [ $1 -ge 1 ]; then
/sbin/depmod -A -F /boot/System.map-%{kernel_ver}-%{?KERNEL_TARGET} \
%{kernel_ver}-%{?KERNEL_TARGET} &>/dev/null
fi
exit 0
%post -n kernel-%{KERNEL_TARGET}-modules-extra
# new install or upgrade
if [ $1 -ge 1 ]; then
/sbin/depmod -A -F /boot/System.map-%{kernel_ver}-%{?KERNEL_TARGET} \
%{kernel_ver}-%{?KERNEL_TARGET} &>/dev/null
fi
exit 0
%files -n kernel-%{KERNEL_TARGET} %files -n kernel-%{KERNEL_TARGET}
%defattr (-, root, root) %defattr (-, root, root)
#/boot/System.map-%{kernel_ver}-%{?KERNEL_TARGET}
/boot/kernel*.img /boot/kernel*.img
%dir /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/System.map
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.bin
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.alias.bin
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.modinfo
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.order
%dir /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/kernel
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/kernel/*
%files -n kernel-%{KERNEL_TARGET}-dtbs
%defattr (-, root, root)
#/boot/*.dtb* #/boot/*.dtb*
#/boot/overlays/*.dtb* /boot/overlays/*.dtb*
%files -n kernel-%{KERNEL_TARGET}-source %files -n kernel-%{KERNEL_TARGET}-source
#-f kernel-source.files #-f kernel-source.files
@ -451,23 +455,15 @@ exit 0
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/build /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/build
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/source /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/source
%files -n kernel-%{KERNEL_TARGET}-modules
%defattr (-, root, root)
%dir /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.bin
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.alias.bin
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.builtin.modinfo
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/modules.order
%dir /lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/kernel
/lib/modules/%{kernel_ver}-%{?KERNEL_TARGET}/kernel/*
#%files -n kernel-%{KERNEL_TARGET}-firmware #%files -n kernel-%{KERNEL_TARGET}-firmware
#%defattr (-, root, root) #%defattr (-, root, root)
#%dir /lib/firmware #%dir /lib/firmware
#/lib/firmware/* #/lib/firmware/*
%changelog %changelog
* Sun Oct 04 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4.51.20200902-2mamba
- merge kernel-*-modules into main kernel package; fix depmod after moving System.map away from /boot
* Thu Oct 01 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4.51.20200902-1mamba * Thu Oct 01 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4.51.20200902-1mamba
- update to 5.4.51.20200902 - update to 5.4.51.20200902