summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2022-03-03 13:51:19 +0100
committerŁukasz Stelmach <l.stelmach@samsung.com>2022-03-04 02:22:02 +0100
commitea9488c6134cb8a1cd352a897106e5339918b9b1 (patch)
treed0195ef827ad8c4afd71d0c92fad9363550341bd
parent6ed5442134e7ee088c4a9cc91096a1c8f3bc8579 (diff)
downloadlinux-rpi-sandbox/lstelmach/rt.tar.gz
linux-rpi-sandbox/lstelmach/rt.tar.bz2
linux-rpi-sandbox/lstelmach/rt.zip
spec: Build rt packagessandbox/lstelmach/rt
Build a second set of packages with PREEMPT_RT enabled Change-Id: I1c0ec964f68eda41d6c628b0476a5246045171ad Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rw-r--r--packaging/linux-rpi4.spec223
1 files changed, 164 insertions, 59 deletions
diff --git a/packaging/linux-rpi4.spec b/packaging/linux-rpi4.spec
index f6f38498341f..5155e58aca86 100644
--- a/packaging/linux-rpi4.spec
+++ b/packaging/linux-rpi4.spec
@@ -2,6 +2,7 @@
%define _wrong_version_format_terminate_build 0
%define config_name tizen_bcm2711_defconfig
+%define config_name_rt tizen_bcm2711_rt_defconfig
%ifarch aarch64
%define buildarch arm64
%else
@@ -34,6 +35,7 @@ BuildRequires: rsync
%description
The Linux Kernel, the operating system core itself
+# kernel
%package -n %{variant}-linux-kernel
License: GPL-2.0
Summary: Tizen kernel for %{target_board}
@@ -44,6 +46,18 @@ Provides: linux-kernel = %{version}-%{release}
%description -n %{variant}-linux-kernel
This package contains the Linux kernel for Tizen (arch %{buildarch}, target board %{target_board})
+%package -n %{variant}-rt-linux-kernel
+License: GPL-2.0
+Summary: Tizen kernel for %{target_board}
+Group: System/Kernel
+Provides: %{variant}-kernel-uname-r = %{fullVersion}-rt
+Provides: linux-kernel = %{version}-%{release}-rt
+
+%description -n %{variant}-rt-linux-kernel
+This package contains the Linux kernel for Tizen (arch %{buildarch}, target board %{target_board})
+
+# modules
+
%package -n %{variant}-linux-kernel-modules
Summary: Kernel modules for %{target_board}
Group: System/Kernel
@@ -53,6 +67,18 @@ Provides: %{variant}-kernel-modules-uname-r = %{fullVersion}
%description -n %{variant}-linux-kernel-modules
Kernel-modules includes the loadable kernel modules(.ko files) for %{target_board}
+%package -n %{variant}-rt-linux-kernel-modules
+Summary: Kernel modules for %{target_board}
+Group: System/Kernel
+Provides: %{variant}-kernel-modules = %{fullVersion}-rt
+Provides: %{variant}-kernel-modules-uname-r = %{fullVersion}-rt
+
+%description -n %{variant}-rt-linux-kernel-modules
+Kernel-modules includes the loadable kernel modules(.ko files) for %{target_board}
+with the PREEMPT_RT patch
+
+# devel
+
%package -n %{variant}-linux-kernel-devel
License: GPL-2.0
Summary: Linux support kernel map and etc for other packages
@@ -63,6 +89,17 @@ Provides: %{variant}-kernel-devel-uname-r = %{fullVersion}
%description -n %{variant}-linux-kernel-devel
This package provides kernel map and etc information.
+%package -n %{variant}-rt-linux-kernel-devel
+License: GPL-2.0
+Summary: Linux support kernel map and etc for other packages
+Group: System/Kernel
+Provides: %{variant}-kernel-devel = %{fullVersion}-rt
+Provides: %{variant}-kernel-devel-uname-r = %{fullVersion}-rt
+
+%description -n %{variant}-rt-linux-kernel-devel
+This package provides kernel map and etc information.
+
+#headers
%package -n %{variant}-linux-kernel-headers
License: GPL-2.0
Summary: Linux support headers for userspace development
@@ -81,45 +118,41 @@ headers are used by the installed headers for GNU glibc and other system
%{?asan:/usr/bin/gcc-unforce-options}
%{?ubsan:/usr/bin/gcc-unforce-options}
-# 0. extract uapi headers
-make headers_check %{?_smp_mflags}
-make headers_install %{?_smp_mflags}
+for target in %{variant} %{variant}-rt; do
+ echo "-${target}" > localversion-tizen
+
+ # extract uapi headers
+ make O=build/${target} headers_check %{?_smp_mflags}
+ make O=build/${target} headers_install %{?_smp_mflags}
-# 1-1. Set config file
-make %{config_name} %{?_smp_mflags}
-if ! grep -q "^CONFIG_LOCALVERSION=\"-%{variant}" .config; then
- ./scripts/config --set-str CONFIG_LOCALVERSION "-%{variant}$(eval $(grep ^CONFIG_LOCALVERSION= .config); echo $CONFIG_LOCALVERSION)"
-fi
+ # Set config file
+ case $target in
+ %{variant})
+ make O=build/${target} %{config_name} %{?_smp_mflags}
+ ;;
+ %{variant}-rt)
+ make O=build/${target} %{config_name_rt} %{?_smp_mflags}
+ ;;
+ esac
-# 1-2. Build Image/Image.gz
-make %{?_smp_mflags}
+ # Build Image/Image.gz
+ make O=build/${target} %{?_smp_mflags}
-# 1-3. Build dtbs
-make dtbs %{?_smp_mflags}
+ # Build dtbs
+ make O=build/${target} dtbs %{?_smp_mflags}
-# 1-4. Build modules
-make modules %{?_smp_mflags}
+ # Build modules
+ make O=build/${target} modules %{?_smp_mflags}
+done
%install
QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT
-# 2-1. Destination directories
+# Destination directories
mkdir -p %{buildroot}/boot
mkdir -p %{buildroot}/lib/modules
-# 2-2. Install kernel binary and DTB
-%ifarch aarch64
-install -m 644 arch/%{buildarch}/boot/Image %{buildroot}/boot/
-install -m 644 arch/%{buildarch}/boot/dts/broadcom/bcm*.dtb %{buildroot}/boot/
-%else
-install -m 644 arch/%{buildarch}/boot/zImage %{buildroot}/boot/
-install -m 644 arch/%{buildarch}/boot/dts/bcm*.dtb %{buildroot}/boot/
-%endif
-
-# 2-3. Install modules
-make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=%{buildroot} modules_install
-
-# 2-4. Install boot binary files
+# Install boot binary files
%ifarch aarch64
install -m 644 rpi4/boot/config_64bit.txt %{buildroot}/boot/config.txt
%else
@@ -129,44 +162,103 @@ install -m 644 rpi4/boot/LICENCE.broadcom %{buildroot}/boot/
install -m 644 rpi4/boot/start*.elf %{buildroot}/boot/
install -m 644 rpi4/boot/fixup*.dat %{buildroot}/boot/
-# 2-5. Install kernel headers
-make headers_install %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr
-
-# 3. Copy files for devel package
-mkdir -p %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
-rsync -r \
- --include "/scripts/**.c" \
- --exclude "/debug*.list" \
- --exclude "/documentation.list" \
- --exclude "/*.manifest" \
- --exclude "/packaging/" \
- --exclude "/.gbs.conf" \
- --exclude "/.git**" \
- --exclude ".gitignore" \
- --exclude "*\.c" \
- --exclude ".tmp_vmlinux*" \
- --exclude ".*dtb*tmp" \
- --exclude ".*dtb" \
- --exclude "*.*tmp" \
- --exclude "vmlinux" \
- --exclude "Image" \
- --exclude "zImage" \
- --exclude "Image.gz" \
- --exclude "*.cmd" \
- --exclude "*.ko" \
- --exclude "*.o" \
- --exclude "*.S" \
- --exclude "*.HEX" \
-%{_builddir}/%{name}-%{version}/ %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
+# Install kernel binary and DTB
+%ifarch aarch64
+install -m 644 build/%{variant}/arch/%{buildarch}/boot/dts/broadcom/bcm*.dtb %{buildroot}/boot/
+%else
+install -m 644 build/%{variant}/arch/%{buildarch}/boot/dts/bcm*.dtb %{buildroot}/boot/
+%endif
+
+# Install kernel headers
+make O=build/%{variant} headers_install %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr
+
+for target in %{variant} %{variant}-rt; do
+ # Install kernel binary and DTB
+ case $target in
+ %{variant})
+%ifarch aarch64
+ install -m 644 build/${target}/arch/%{buildarch}/boot/Image %{buildroot}/boot/Image
+%else
+ install -m 644 build/${target}/arch/%{buildarch}/boot/zImage %{buildroot}/boot/zImage
+%endif
+ ;;
+ %{variant}-rt)
+%ifarch aarch64
+ install -m 644 build/${target}/arch/%{buildarch}/boot/Image %{buildroot}/boot/Image_rt
+%else
+ install -m 644 build/${target}/arch/%{buildarch}/boot/zImage %{buildroot}/boot/zImage_rt
+%endif
+ ;;
+ esac
+
+ # Install modules
+ make O=build/${target} INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=%{buildroot} modules_install
+
+ # Copy files for devel package
+ mkdir -p %{buildroot}/boot/kernel/devel/kernel-devel-${target}
+ rsync -r \
+ --include "/scripts/**.c" \
+ --exclude "/debug*.list" \
+ --exclude "/documentation.list" \
+ --exclude "/*.manifest" \
+ --exclude "/packaging/" \
+ --exclude "/.gbs.conf" \
+ --exclude "/.git**" \
+ --exclude ".gitignore" \
+ --exclude "*\.c" \
+ --exclude ".tmp_vmlinux*" \
+ --exclude ".*dtb*tmp" \
+ --exclude ".*dtb" \
+ --exclude "*.*tmp" \
+ --exclude "vmlinux" \
+ --exclude "Image" \
+ --exclude "zImage" \
+ --exclude "Image.gz" \
+ --exclude "*.cmd" \
+ --exclude "*.ko" \
+ --exclude "*.o" \
+ --exclude "*.S" \
+ --exclude "*.HEX" \
+ --exclude "/build/" \
+ ./ build/${target}/ %{buildroot}/boot/kernel/devel/kernel-devel-${target}
+done
%clean
rm -rf %{buildroot}
+%post -n %{variant}-rt-linux-kernel
+%ifarch aarch64
+mv /boot/Image_rt /boot/Image
+%else
+mv /boot/zImage_rt /boot/zImage
+%endif
+
+%preun -n %{variant}-rt-linux-kernel
+%ifarch aarch64
+mv /boot/Image /boot/Image_rt
+%else
+mv /boot/zImage /boot/zImage_rt
+%endif
+
%files -n %{variant}-linux-kernel-modules
-/lib/modules/*
+%ifarch aarch64
+/lib/modules/*%{variant}-v8/
+%else
+/lib/modules/*%{variant}-v7l/
+%endif
+
+%files -n %{variant}-rt-linux-kernel-modules
+%ifarch aarch64
+/lib/modules/*%{variant}-rt-v8/
+%else
+/lib/modules/*%{variant}-rt-v7l/
+%endif
%files -n %{variant}-linux-kernel-devel
-/boot/kernel/devel/*
+/boot/kernel/devel/*%{variant}/
+
+%files -n %{variant}-rt-linux-kernel-devel
+/boot/kernel/devel/*%{variant}-rt/
%files -n %{variant}-linux-kernel
%license COPYING
@@ -181,5 +273,18 @@ rm -rf %{buildroot}
/boot/start*.elf
/boot/fixup*.dat
+%files -n %{variant}-rt-linux-kernel
+%license COPYING
+%ifarch aarch64
+/boot/Image_rt
+%else
+/boot/zImage_rt
+%endif
+/boot/bcm*.dtb
+/boot/config.txt
+/boot/LICENCE.broadcom
+/boot/start*.elf
+/boot/fixup*.dat
+
%files -n %{variant}-linux-kernel-headers
/usr/include/*