From a34a252595191ff0ff17a5c46f2581205e366b84 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Fri, 3 Nov 2017 15:36:49 +0900 Subject: [PATCH] Create Linux 4.4 Kernel Headers for KO build Kernel objects (kernel module objects) build requires headers and Makefiles. This is to be noarch as well. Soon, we need to create JIRA-TRE issue to make an OBS-package for the new devices that are going to use a lot of .ko modules out of kernel source tree. Change-Id: Ib200a3654368c58bd0da7db6daf0ba11be5c2b38 Signed-off-by: MyungJoo Ham --- packaging/linux-kernel-modulebuild.spec | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 packaging/linux-kernel-modulebuild.spec diff --git a/packaging/linux-kernel-modulebuild.spec b/packaging/linux-kernel-modulebuild.spec new file mode 100644 index 0000000..cf7d3c88 --- /dev/null +++ b/packaging/linux-kernel-modulebuild.spec @@ -0,0 +1,69 @@ +Name: linux-kernel-modulebuild +Summary: Linux Kernel Module Build Files +Version: 4.4.35 +Release: 1 +License: GPL-2.0 +Group: System Environment/Kernel +Vendor: The Linux Community +URL: http://www.kernel.org +Source0: %{name}-%{version}.tar.gz +BuildRequires: linux-glibc-devel +BuildRequires: tar + +%description +Module build support for The Linux Kernel, the operating system core itself + +%package header +Summary: Header files for /usr/include +%description header +Header of The Linux Kernel, the operating system core itself + +%prep +%setup -q + +%build +%ifarch %{arm} +make arm_tizen_emul_defconfig +%endif +%ifarch %{ix86} +make tizen_emul_defconfig +%endif +%ifarch aarch64 +make defconfig +%endif +%ifarch x86_64 +make x86_64_defconfig +%endif + +make modules_prepare + +find -wholename "*/include/*" > headers +find -name "Kconfig" >> headers +find -name "Kbuild" >> headers +find -name "Makefile" >> headers +find -name "Makefile.boot" >> headers + +%install +QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT + +mkdir -p %{buildroot}/usr/src/linux-headers-%{version}-%{release} +tar -cf - -T headers |(pushd %{buildroot}/usr/src/linux-headers-%{version}-%{release} && tar -xvf - && popd) + +mkdir -p %{buildroot}/usr/src/linux-headers-%{version}-%{release}/scripts +cp -pR scripts/* %{buildroot}/usr/src/linux-headers-%{version}-%{release}/scripts/ + +cp include/config/kernel.release %{buildroot}/usr/src/linux-headers-%{version}-%{release}/include/config/ + +pushd %{buildroot}/usr/src +ln -s linux-headers-%{version}-%{release} linux-headers-%{version} +ln -s linux-headers-%{version}-%{release} linux-headers-4.4 +ln -s linux-headers-%{version}-%{release} linux-headers +popd + +make INSTALL_PATH=%{buildroot} INSTALL_MOD_PATH=%{buildroot} INSTALL_HDR_PATH=%{buildroot}/usr headers_install + +%files +/usr/src/* + +%files header +/usr/include/* -- 2.7.4