From 32388b0a01f9edede5da2c35270f6561e8793471 Mon Sep 17 00:00:00 2001 From: "jino.cho" Date: Mon, 7 Nov 2016 17:30:52 +0900 Subject: [PATCH] packaging: add artik530 tizen build This patch supports tizen rpmbuild for artik530 and modify artik710 build. Change-Id: I755c74ea5d935b63d0c3a9d38028dbb1b1f82e4c Signed-off-by: jino.cho --- packaging/linux-artik530.spec | 179 ++++++++++++++++++++++++++++++++++++++++++ packaging/linux-artik7.spec | 1 + 2 files changed, 180 insertions(+) create mode 100644 packaging/linux-artik530.spec diff --git a/packaging/linux-artik530.spec b/packaging/linux-artik530.spec new file mode 100644 index 0000000..42f1ffe --- /dev/null +++ b/packaging/linux-artik530.spec @@ -0,0 +1,179 @@ +%define config_name artik530_raptor_defconfig +%define buildarch arm +%define target_board artik530-raptor +%define variant %{target_board} +%define vendor_name nexell + +Name: linux-artik530 +Summary: The Linux Kernel for ARTIK530 Raptor +Version: 4.1.15 +Release: 0 +License: GPL-2.0 +ExclusiveArch: %{arm} +Group: System/Kernel +Vendor: The Linux Community +URL: http://www.kernel.org +Source0: linux-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root + +%define fullVersion %{version}-%{variant} + +BuildRequires: module-init-tools +BuildRequires: bc + +%description +The Linux Kernel, the operating system core itself + +%package -n %{variant}-linux-kernel +Summary: Tizen kernel for %{target_board} +Group: System/Kernel +Provides: %{variant}-kernel-profile-%{profile} = %{version}-%{release} +Provides: %{variant}-kernel-uname-r = %{fullVersion} + +%description -n %{variant}-linux-kernel +This package contains the Linux kernel for Tizen (%{profile} profile, arch %{buildarch}, target board %{target_board}) + +%package -n %{variant}-linux-kernel-modules +Summary: Kernel modules for %{target_board} +Group: System/Kernel +Provides: %{variant}-kernel-modules = %{fullVersion} +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}-linux-kernel-headers +Summary: Header files for the Linux kernel for use by glibc +BuildArch: noarch +Obsoletes: kernel-headers +Provides: kernel-headers = %{fullVersion} +Group: Development/System + +%description -n %{variant}-linux-kernel-headers +Kernel-headers includes the C header files that specify the interface +between the Linux kernel and userspace libraries and programs. The +header files define structures and constants that are needed for +building most standard programs and are also needed for rebuilding the +glibc package. + +%package -n %{variant}-linux-kernel-devel +Summary: Prebuilt linux kernel for out-of-tree modules +Group: Development/System +Provides: kernel-devel = %{fullVersion} +Provides: kernel-devel-uname-r = %{fullVersion} +Requires: %{variant}-linux-kernel = %{version}-%{release} + +%description -n %{variant}-linux-kernel-devel +Prebuilt linux kernel for out-of-tree modules. + +%prep +%setup -q -n linux-%{version} + +%build +# Make sure EXTRAVERSION says what we want it to say +sed -i "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}-%{variant}/" Makefile + +# 1. Compile sources +make %{config_name} +make %{?_smp_mflags} + +# 2. Build Image +make zImage %{?_smp_mflags} +make dtbs %{?_smp_mflags} + +# 3. Build modules +make modules %{?_smp_mflags} + +# 4. Create tar repo for build directory +tar cpf linux-kernel-build-%{fullVersion}.tar . + +%install +QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT + +# 1. Destynation directories +mkdir -p %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} +mkdir -p %{buildroot}/boot/ +mkdir -p %{buildroot}/lib/modules/%{fullVersion} + +# 2. Install Image, System.map, ... +install -m 755 arch/arm/boot/zImage %{buildroot}/boot/ +install -m 644 arch/arm/boot/dts/*.dtb %{buildroot}/boot/ + +install -m 644 System.map %{buildroot}/boot/System.map-%{fullVersion} +install -m 644 .config %{buildroot}/boot/config-%{fullVersion} + +# 3. Install modules +make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=%{buildroot} modules_install KERNELRELEASE=%{fullVersion} + +# 4. Install kernel headers +make INSTALL_PATH=%{buildroot} INSTALL_MOD_PATH=%{buildroot} INSTALL_HDR_PATH=%{buildroot}/usr headers_install KERNELRELEASE=%{fullVersion} + +# 5. Restore source and build irectory +tar -xf linux-kernel-build-%{fullVersion}.tar -C %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} +mv %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/arch/arm . +mv %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/arch/Kconfig . +rm -rf %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/arch/* +mv arm %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/arch/ +mv Kconfig %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/arch/ + +# 6. Remove files +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name ".tmp_vmlinux*" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name ".gitignore" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name ".*dtb*tmp" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.*tmp" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "vmlinux" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "zImage" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "test-*" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.cmd" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.ko" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.o" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.S" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.s" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -name "*.c" -exec rm -f {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion} -size 0c -exec rm -f {} \; +find %{buildroot}/usr/include -name "\.install" -exec rm -f {} \; +find %{buildroot}/usr -name "..install.cmd" -exec rm -f {} \; + +rm -rf %{buildroot}/boot/vmlinux* +rm -rf %{buildroot}/System.map* +rm -rf %{buildroot}/vmlinux* +rm -rf %{buildroot}/lib/firmware + +# 6.1 Clean Documentation directory +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/Documentation -type f ! -name "Makefile" ! -name "*.sh" ! -name "*.pl" -exec rm -f {} \; + +# 7. Update file permisions +%define excluded_files ! -name "*.h" ! -name "*.cocci" ! -name "*.tst" ! -name "*.y" ! -name "*.in" ! -name "*.gperf" ! -name "*.PL" ! -name "lex*" ! -name "check-perf-tracei.pl" ! -name "*.*shipped" ! -name "*asm-generic" ! -name "Makefile*" ! -name "*.lds" ! -name "mkversion" ! -name "zconf.l" ! -name "README" ! -name "*.py" ! -name "gconf.glade" ! -name "*.cc" ! -name "dbus_contexts" ! -name "*.pm" ! -name "*.xs" ! -name "*.l" ! -name "EventClass.py" ! -name "typemap" ! -name "net_dropmonitor.py" + +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/tools/perf/scripts/ -type f %{excluded_files} -exec chmod 755 {} \; +find %{buildroot}/usr/src/linux-kernel-build-%{fullVersion}/scripts/ -type f %{excluded_files} -exec chmod 755 {} \; +find %{buildroot}/usr -type f ! -name "check-perf-tracei.pl" -name "*.sh" -name "*.pl" -exec chmod 755 {} \; +find %{buildroot}/lib/modules/ -name "*.ko" -type f -exec chmod 755 {} \; + +# 8. Create symbolic links +rm -f %{buildroot}/lib/modules/%{fullVersion}/build +rm -f %{buildroot}/lib/modules/%{fullVersion}/source +ln -sf /usr/src/linux-kernel-build-%{fullVersion} %{buildroot}/lib/modules/%{fullVersion}/build + +%clean +rm -rf %{buildroot} + +%files -n %{variant}-linux-kernel-modules +/lib/modules/ + +%files -n %{variant}-linux-kernel-devel +%defattr (-, root, root) +/usr/src/linux-kernel-build-%{fullVersion} +/lib/modules/%{fullVersion}/modules.* +/lib/modules/%{fullVersion}/build + +%files -n %{variant}-linux-kernel +%license COPYING +/boot/zImage +/boot/*.dtb +/boot/System.map* +/boot/config* + +%files -n %{variant}-linux-kernel-headers +%defattr (-, root, root) +/usr/include diff --git a/packaging/linux-artik7.spec b/packaging/linux-artik7.spec index a19cb0a..f0940f2 100644 --- a/packaging/linux-artik7.spec +++ b/packaging/linux-artik7.spec @@ -9,6 +9,7 @@ Summary: The Linux Kernel for ARTIK710 Raptor Version: 4.1.15 Release: 0 License: GPL-2.0 +ExclusiveArch: aarch64 Group: System/Kernel Vendor: The Linux Community URL: http://www.kernel.org -- 2.7.4