d3adfb
%global commit_firmware_long  fd15e0700e45d9b7db83e30696aba299b9f2f31d
d3adfb
#%global commit_firmware_short %(c=%{commit_firmware_long}; echo ${c:0:7})
b1eb58
%global commit_linux_long 414511a0cc482de90eec5791b7015b2c2d99408e
d3adfb
#%global commit_linux_short %(c=%{commit_linux_long}; echo ${c:0:7})
17e114
17e114
%define Arch arm
17e114
%define local_version v7
17e114
%define extra_version 1
17e114
17e114
Name:           raspberrypi2
b1eb58
Version:        4.19.28
17e114
Release:        %{local_version}.%{extra_version}%{?dist}
17e114
Summary:        Specific kernel and bootcode for Raspberry Pi
17e114
17e114
License:        GPLv2
17e114
URL:            https://github.com/raspberrypi/linux
d3adfb
Source0:        https://github.com/raspberrypi/linux/archive/%{commit_linux_long}.tar.gz
d3adfb
Source1:        https://github.com/raspberrypi/firmware/archive/%{commit_firmware_long}.tar.gz
17e114
BuildRequires: kmod, patch, bash, sh-utils, tar
17e114
BuildRequires: bzip2, xz, findutils, gzip, m4, perl, perl-Carp, make, diffutils, gawk
17e114
BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc
17e114
BuildRequires: net-tools, hostname, bc
17e114
BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison flex xz-devel
17e114
BuildRequires: audit-libs-devel
17e114
BuildRequires: pciutils-devel gettext ncurses-devel
d3adfb
BuildRequires: openssl-devel
17e114
17e114
# Compile with SELinux but disable per default
17e114
Patch0:         bcm2709_selinux_config.patch
17e114
17e114
%description
17e114
Specific kernel and bootcode for Raspberry Pi
17e114
17e114
%package kernel
17e114
Group:          System Environment/Kernel
17e114
Summary:        The Linux kernel
17e114
Provides:       kernel = %{version}-%{release}
17e114
Requires:	coreutils
17e114
#Requires:	dracut
17e114
17e114
%description kernel
17e114
The kernel package contains the Linux kernel (vmlinuz), the core of any
17e114
Linux operating system.  The kernel handles the basic functions
17e114
of the operating system: memory allocation, process allocation, device
17e114
input and output, etc.
17e114
17e114
17e114
%package kernel-devel
17e114
Group:          System Environment/Kernel
17e114
Summary:        Development package for building kernel modules to match the kernel
17e114
Provides:       kernel-devel = %{version}-%{release}
d7e7dd
Provides:       kernel-devel-uname-r = %{version}-%{release}
17e114
17e114
%description kernel-devel
17e114
This package provides kernel headers and makefiles sufficient to build modules
17e114
against the kernel package.
17e114
17e114
17e114
#%package kernel-firmware
17e114
#Group:          Development/System
17e114
#Summary:        Firmware files used by the Linux kernel
17e114
#Provides:       kernel-firmware = %{version}-%{release}
17e114
17e114
#%description kernel-firmware
17e114
#Kernel-firmware includes firmware files required for some devices to
17e114
#operate.
17e114
17e114
17e114
%package firmware
17e114
Summary:        GPU firmware for the Raspberry Pi computer
17e114
License:        Redistributable, with restrictions; see LICENSE.broadcom
17e114
Obsoletes:      grub, grubby, efibootmgr
17e114
17e114
%description firmware
17e114
This package contains the GPU firmware for the Raspberry Pi BCM2835 SOC
17e114
including the kernel bootloader.
17e114
17e114
17e114
%prep
d3adfb
%setup -q -n linux-%{commit_linux_long}
17e114
%patch0 -p1
17e114
perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}/" Makefile
17e114
perl -p -i -e "s/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=/" arch/%{Arch}/configs/bcm2709_defconfig
17e114
17e114
%build
17e114
export KERNEL=kernel7
17e114
make bcm2709_defconfig
d3adfb
make %{?_smp_mflags} zImage modules dtbs
17e114
17e114
%install
17e114
# kernel
17e114
mkdir -p %{buildroot}/boot/overlays/
17e114
mkdir -p %{buildroot}/usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays
d3adfb
cp -p -v COPYING %{buildroot}/boot/COPYING.linux-4.19
17e114
cp -p -v arch/%{Arch}/boot/dts/*.dtb %{buildroot}/usr/share/%{name}-kernel/%{version}-%{release}/boot
17e114
cp -p -v arch/%{Arch}/boot/dts/overlays/*.dtb* %{buildroot}/usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays
17e114
cp -p -v arch/%{Arch}/boot/dts/overlays/README %{buildroot}/usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays
d3adfb
#scripts/mkknlimg arch/%{Arch}/boot/zImage %{buildroot}/boot/kernel-%{version}-%{release}.img
d3adfb
cp -p -v arch/%{Arch}/boot/zImage %{buildroot}/boot/kernel-%{version}-%{release}.img
17e114
make INSTALL_MOD_PATH=%{buildroot} modules_install
17e114
17e114
# kernel-devel
17e114
DevelDir=/usr/src/kernels/%{version}-%{release}
17e114
mkdir -p %{buildroot}$DevelDir
17e114
# first copy everything
17e114
cp -p -v Module.symvers System.map %{buildroot}$DevelDir
17e114
cp --parents `find  -type f -name "Makefile*" -o -name "Kconfig*"` %{buildroot}$DevelDir
17e114
# then drop all but the needed Makefiles/Kconfig files
17e114
rm -rf %{buildroot}$DevelDir/Documentation
17e114
rm -rf %{buildroot}$DevelDir/scripts
17e114
rm -rf %{buildroot}$DevelDir/include
17e114
cp .config %{buildroot}$DevelDir
17e114
cp -a scripts %{buildroot}$DevelDir
17e114
cp -a include %{buildroot}$DevelDir
17e114
17e114
if [ -d arch/%{Arch}/scripts ]; then
17e114
  cp -a arch/%{Arch}/scripts %{buildroot}$DevelDir/arch/%{_arch} || :
17e114
fi
17e114
if [ -f arch/%{Arch}/*lds ]; then
17e114
  cp -a arch/%{Arch}/*lds %{buildroot}$DevelDir/arch/%{_arch}/ || :
17e114
fi
17e114
rm -f %{buildroot}$DevelDir/scripts/*.o
17e114
rm -f %{buildroot}$DevelDir/scripts/*/*.o
17e114
cp -a --parents arch/%{Arch}/include %{buildroot}$DevelDir
17e114
# include the machine specific headers for ARM variants, if available.
17e114
if [ -d arch/%{Arch}/mach-bcm2709/include ]; then
17e114
  cp -a --parents arch/%{Arch}/mach-bcm2709/include %{buildroot}$DevelDir
17e114
fi
17e114
cp include/generated/uapi/linux/version.h %{buildroot}$DevelDir/include/linux
17e114
touch -r %{buildroot}$DevelDir/Makefile %{buildroot}$DevelDir/include/linux/version.h
17e114
ln -T -s $DevelDir %{buildroot}/lib/modules/%{version}-%{release}/build --force
17e114
ln -T -s build %{buildroot}/lib/modules/%{version}-%{release}/source --force
17e114
17e114
# kernel-firmware
17e114
#rm .config
17e114
#make INSTALL_FW_PATH=%{buildroot}/lib/firmware firmware_install
17e114
17e114
# firmware
17e114
#   precompiled GPU firmware and bootloader
17e114
pushd %{buildroot}
d3adfb
tar -xf %{_sourcedir}/%{commit_firmware_long}.tar.gz \
d3adfb
    firmware-%{commit_firmware_long}/boot/start* \
d3adfb
    firmware-%{commit_firmware_long}/boot/fixup* \
d3adfb
    firmware-%{commit_firmware_long}/boot/LICENCE.broadcom \
d3adfb
    firmware-%{commit_firmware_long}/boot/bootcode.bin \
17e114
    --strip-components=1
17e114
popd
17e114
17e114
%files kernel
17e114
%defattr(-,root,root,-)
17e114
/lib/modules/%{version}-%{release}
17e114
/usr/share/%{name}-kernel/%{version}-%{release}
17e114
/usr/share/%{name}-kernel/%{version}-%{release}/boot
17e114
/usr/share/%{name}-kernel/%{version}-%{release}/boot/*.dtb
17e114
/boot/overlays/
17e114
/usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/*
17e114
%attr(0755,root,root) /boot/kernel-%{version}-%{release}.img
d3adfb
%doc /boot/COPYING.linux-4.19
17e114
17e114
d61e93
%posttrans kernel
17e114
cp /boot/kernel-%{version}-%{release}.img /boot/kernel7.img
17e114
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/*.dtb /boot/
17e114
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/*.dtb* /boot/overlays/
17e114
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/README /boot/overlays/
17e114
#/usr/sbin/dracut /boot/initramfs-%{version}-%{release}.img %{version}-%{release}
17e114
17e114
%postun kernel
94eb3c
cp $(ls -1 /boot/kernel-*-*|sort -V|tail -1) /boot/kernel7.img
94eb3c
cp $(ls -1d /usr/share/%{name}-kernel/*-*/|sort -V|tail -1)/boot/*.dtb /boot/
94eb3c
cp $(ls -1d /usr/share/%{name}-kernel/*-*/|sort -V|tail -1)/boot/overlays/*.dtb* /boot/overlays/
94eb3c
cp $(ls -1d /usr/share/%{name}-kernel/*-*/|sort -V|tail -1)/boot/overlays/README /boot/overlays/
17e114
d3adfb
17e114
%files kernel-devel
17e114
%defattr(-,root,root)
17e114
/usr/src/kernels/%{version}-%{release}
17e114
17e114
17e114
#%files kernel-firmware
17e114
#%defattr(-,root,root)
17e114
#/lib/firmware/*
17e114
17e114
17e114
%files firmware
17e114
%defattr(-,root,root,-)
17e114
/boot/bootcode.bin
17e114
/boot/fixup*
17e114
/boot/start*
17e114
%doc /boot/LICENCE.broadcom
17e114
17e114
%changelog
40bfa9
* Wed Mar 13 2019 Pablo Greco <pablo@fliagreco.com.ar> - 4.19.28-v7.1.el7
d7e7dd
- readded kernel-devel-uname-r, fixed back in 4.14.58
b1eb58
- Update to version 4.19.28
d7e7dd
d3adfb
* Sat Mar 09 2019 Jacco Ligthart <jacco@redsleeve.org> - 4.19.27-v7.1.el7
d3adfb
- update to version 4.19.27
d3adfb
- added 'sort -V' to the scripts
d3adfb
- changed download location from 'tarball' to 'archive'
d3adfb
- moves from 'post' script to 'posttrans'
d3adfb
- moved 'COPYING.linux' to 'COPYING.linux-4.19'
d3adfb
- added 'README' to the overlays dir
17e114
d3adfb
* Thu Dec 20 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.14.89-v7.1.el7
d3adfb
- update to version 4.14.89
17e114
d3adfb
* Wed Oct 10 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.14.74-v7.1.el7
d3adfb
- update to version 4.14.74
17e114
d3adfb
* Fri Aug 10 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.14.61-v7.1.el7
d3adfb
- update to version 4.14.61
17e114
d3adfb
* Fri Jun 15 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.14.49-v7.1.el7
d3adfb
- update to version 4.14.49
17e114
d3adfb
* Thu May 24 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.14.42-v7.1.el7
d3adfb
- update to version 4.14.42
d3adfb
- stop makeing the kernel-firmware subpackage
17e114
d3adfb
* Fri Mar 16 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.9.80-v7.2.el7
d3adfb
- update to latest git for raspberry pi 3 B+ support
17e114
d3adfb
* Wed Feb 28 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.9.80-v7.1.el7
e0ef85
- update to version 4.9.80, probably the last in the 4.9 series
17e114
d3adfb
* Sat Jan 27 2018 Jacco Ligthart <jacco@redsleeve.org> - 4.9.78-v7.1.el7
d3adfb
- update to version 4.9.78
17e114
d3adfb
* Sun Dec 17 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.69-v7.1.el7
d3adfb
- update to version 4.9.69
17e114
d3adfb
* Mon Nov 27 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.65-v7.1.el7
d3adfb
- update to version 4.9.65
17e114
d3adfb
* Sun Oct 29 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.59-v7.1.el7
d3adfb
- update to version 4.9.59
17e114
d3adfb
* Mon Oct 02 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.52-v7.1.el7
d3adfb
- update to version 4.9.52
17e114
d3adfb
* Thu Aug 17 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.43-v7.1.el7
d3adfb
- update to version 4.9.43
17e114
d3adfb
* Sat Jul 22 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.39-v7.1.el7
d3adfb
- update to version 4.9.39
17e114
d3adfb
* Sat Jul 01 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.35-v7.1.el7
d3adfb
- update to version 4.9.35
17e114
d3adfb
* Mon Jun 19 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.33-v7.1.el7
d3adfb
- update to version 4.9.33
17e114
d3adfb
* Mon Jun 05 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.30-v7.1.el7
d3adfb
- update to version 4.9.30
17e114
d3adfb
* Fri May 12 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.27-v7.1.el7
d3adfb
- update to version 4.9.27
17e114
d3adfb
* Wed Apr 19 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.23-v7.1.el7
d3adfb
- update to version 4.9.23
17e114
d3adfb
* Thu Mar 30 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.19-v7.1.el7
d3adfb
- update to version 4.9.19
17e114
d3adfb
* Wed Mar 15 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.14-v7.1.el7
d3adfb
- update tp version 4.9.14
17e114
d3adfb
* Mon Feb 27 2017 Jacco Ligthart <jacco@redsleeve.org> - 4.9.13-v7.1.el7
d3adfb
- update to version 4.9.13
17e114
d3adfb
* Sat Dec 24 2016 Jacco Ligthart <jacco@redsleeve.org> - 4.4.39-v7.1.el7
d3adfb
- update to version 4.4.39
17e114
d3adfb
* Wed Nov 16 2016 Jacco Ligthart <jacco@redsleeve.org> - 4.4.32-v7.1.el7
d3adfb
- update to version 4.4.32
17e114
17e114
* Fri Oct 21 2016 Jacco Ligthart <jacco@redsleeve.org> - 4.4.26-v7.1.el7
17e114
- update to version 4.4.26 which includes a fix for CVE-2016-5195
17e114
17e114
* Tue Sep 27 2016 Jacco Ligthart <jacco@redsleeve.org> - 4.4.21-v7.3.el7
17e114
- changed versioning scheme, added EXTRAVERSION to makefile
17e114
- lost dificult linking in /lib/modules
17e114
- added all dirs under /usr/share/%{name}-kernel/ to the %files
17e114
17e114
* Sat Sep 24 2016 Jacco Ligthart <jacco@redsleeve.org> - 4.4.21-2
17e114
- removed dracut I don't see why we need a initramfs
17e114
- fixed the preun scripts. they blocked uninstall
17e114
- removed -b0 from %setup, the source was extracted twice
17e114
17e114
* Sat Sep 24 2016 Jacco Ligthart <jacco@redsleeve.org> - 4.4.21-1
17e114
- updated to 4.4.21
17e114
- moved the Requires: to the kernel subpackage
17e114
- added /boot/overlays to the %files
17e114
17e114
* Mon Jul 11 2016 Fabian Arrotin <arrfab@centos.org> - 4.4.14-2
17e114
- Fixed the dracut call for %{release}
17e114
17e114
* Thu Jul 7 2016 Fabian Arrotin <arrfab@centos.org>
17e114
- upgrade to kernel 4.4.14
e0ef85
- Moved some *dtb* files to /usr/share/raspberrypi2-kernel/boot/
17e114
- Using %post to put those in /boot/*
17e114
- generating initramfs in %post
17e114
17e114
* Fri Jun 17 2016 Johnny Hughes <johnny@centos.org>
17e114
- upgrade to kernel 4.4.13
17e114
- modified to copy *.dtb* to /boot/overlays/
17e114
17e114
* Sun Mar 13 2016 Fabian Arrotin <arrfab@centos.org>
17e114
- Added kmod/libselinux as BuildRequires (for the depmod part)
17e114
- Added audit support in the bcm2709_selinux_config.patch
17e114
17e114
* Fri Mar 11 2016 Henrik Andersson <henrik.4e@gmail.com>
17e114
- updated to 4.1.19
17e114
- build kernel from source instead of using binaries from firmware
17e114
- use only GPU firmware and bootloader from firmware
17e114
17e114
* Mon Jan 25 2016 Fabian Arrotin <arrfab@centos.org>
17e114
- updated to 4.1.16
17e114
- contains the patch fro CVE-2016-0728
17e114
17e114
* Thu Jan 21 2016 Fabian Arrotin <arrfab@centos.org>
17e114
- updated to 4.1.15
17e114
e0ef85
* Thu Nov 26 2015 Fabian Arrotin <arrfab@centos.org>
17e114
- Added %{?dist} rpm macro in the name
17e114
17e114
* Sat Oct 24 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- updated to 4.1.11
17e114
17e114
* Fri Sep 04 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- updated to 4.1.6
17e114
17e114
* Fri Jun 26 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- updated to 4.0.6
17e114
17e114
* Sun May 10 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- updated to 3.18.13
17e114
17e114
* Sun Mar 29 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- updated to 3.18.10
17e114
- fixed a bcm2708 vs. bcm2709 issue with include dirs
17e114
17e114
* Sat Mar 14 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- updated to 3.18.9
17e114
17e114
* Fri Feb 20 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- converted for raspberrypi model2 (kernel7 / version *-v7+ )
17e114
17e114
* Fri Feb 20 2015 Jacco Ligthart <jacco@redsleeve.org>
17e114
- update to version 3.18 (coming from 3.12)
17e114
- require coreutils