packaging: packaging: Add spec file for TM2 and Odroid-XU3/4
authorInki Dae <inki.dae@samsung.com>
Mon, 19 Nov 2018 08:12:47 +0000 (17:12 +0900)
committerInki Dae <inki.dae@samsung.com>
Mon, 3 Dec 2018 00:56:49 +0000 (09:56 +0900)
Change-Id: Iefcde80b71ac44f5c3aff8206a61175e524b4e12
Signed-off-by: Inki Dae <inki.dae@samsung.com>
packaging/baselibs.conf [new file with mode: 0644]
packaging/linux-exynos-tm2.spec [new file with mode: 0644]
packaging/odroid-linux-kernel.spec [new file with mode: 0644]

diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..4c91303
--- /dev/null
@@ -0,0 +1,9 @@
+arch aarch64 targets armv7l:aarch64
+arm64-tm2-linux-kernel
+       +/
+arm64-tm2-linux-kernel-debuginfo
+       +/
+arm64-tm2-linux-kernel-devel
+       +/
+arm64-tm2-linux-kernel-modules
+       +/
diff --git a/packaging/linux-exynos-tm2.spec b/packaging/linux-exynos-tm2.spec
new file mode 100644 (file)
index 0000000..ad891f9
--- /dev/null
@@ -0,0 +1,209 @@
+%define config_name tizen_tm2_defconfig
+%define buildarch arm64
+%define target_board tm2
+%define variant %{buildarch}-%{target_board}
+
+Name: %{target_board}-linux-kernel
+Summary: The Linux Kernel for TM2/TM2E board
+Version: 4.14.24
+Release: 0
+License: GPL-2.0
+ExclusiveArch: %{arm} aarch64
+Group: System/Kernel
+Vendor: The Linux Community
+URL: https://www.kernel.org
+Source0:   linux-kernel-%{version}.tar.xz
+BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root
+
+%define fullVersion %{version}-%{variant}
+%define __spec_install_post /usr/lib/rpm/brp-compress || :
+%define debug_package %{nil}
+
+BuildRequires: bc
+BuildRequires: module-init-tools
+BuildRequires: u-boot-tools >= 2016.03
+
+%description
+The Linux Kernel, the operating system core itself
+
+%ifarch aarch64
+%package -n %{variant}-linux-kernel
+License: GPL-2.0
+Summary: Tizen kernel for %{target_board}
+Group: System/Kernel
+Provides: %{variant}-kernel-profile-mobile = %{version}-%{release}
+Provides: %{variant}-kernel-uname-r = %{fullVersion}
+Provides: linux-kernel = %{version}-%{release}
+
+%description -n %{variant}-linux-kernel
+This package contains the Linux kernel for Tizen (mobile 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-debuginfo
+License: GPL-2.0
+Summary: Linux support debug symbol
+Group: System/Kernel
+
+%description -n %{variant}-linux-kernel-debuginfo
+This package provides the %{target_board} linux kernel's debugging files.
+
+%package -n %{variant}-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}
+Provides: %{variant}-kernel-devel-uname-r = %{fullVersion}
+
+%description -n %{variant}-linux-kernel-devel
+This package provides kernel map and etc information.
+%endif
+
+%package -n %{variant}-linux-kernel-headers
+License: GPL-2.0
+Summary: Linux support headers for userspace development
+Group: System/Kernel
+Provides: kernel-headers-tizen-dev
+
+%description -n %{variant}-linux-kernel-headers
+This package provides userspaces headers from the Linux kernel. These
+headers are used by the installed headers for GNU glibc and other system
+ libraries.
+
+%prep
+%setup -q -n linux-kernel-%{version}
+
+%build
+%{?asan:/usr/bin/gcc-unforce-options}
+%{?ubsan:/usr/bin/gcc-unforce-options}
+
+# Make sure EXTRAVERSION says what we want it to say
+sed -i "s/^EXTRAVERSION.*/EXTRAVERSION = -%{variant}/" Makefile
+
+# 1-1. extract uapi headers
+mkdir -p uapi-headers/usr
+make mrproper
+make headers_check
+make headers_install INSTALL_HDR_PATH=uapi-headers/usr
+
+%ifarch aarch64
+# 1-2. set config file
+make %{config_name}
+
+# 1-3. Build Image/Image.gz
+make %{?_smp_mflags}
+
+# 1-4. Build dtbs
+make dtbs %{?_smp_mflags}
+
+# 1-5. Build u-boot itb image
+mkimage -f arch/arm64/boot/tizen-tm2.its kernel.img
+
+# 1-6. Build modules
+make modules %{?_smp_mflags}
+%endif
+
+%install
+QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT
+
+# 2-1. Destination directories
+mkdir -p %{_builddir}/boot
+%ifarch aarch64
+mkdir -p %{_builddir}/lib/modules
+
+# 2-2. Install kernel.img
+install -m 644 kernel.img %{_builddir}/boot/
+
+# 2-3. Install Image.gz, dtbs, System.map, ...
+install -m 644 arch/%{buildarch}/boot/Image.gz %{_builddir}/boot/
+install -m 644 arch/%{buildarch}/boot/dts/exynos/*.dtb %{_builddir}/boot/
+install -m 644 System.map %{_builddir}/boot/
+install -m 644 .config %{_builddir}/boot/config-%{fullVersion}
+install -m 644 vmlinux %{_builddir}/boot/
+install -m 644 COPYING %{_builddir}/boot/
+
+# 2-4. Install modules
+make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=%{_builddir} modules_install
+%endif
+
+# 2-5. Install uapi headers
+find uapi-headers/usr/include -name ".install" -delete
+find uapi-headers/usr/include -name "..install.cmd" -delete
+rm -f uapi-headers/usr/include/asm*/atomic.h
+rm -f uapi-headers/usr/include/asm*/io.h
+mv uapi-headers/usr %{_builddir}/
+
+# 3-1. remove unnecessary files to prepare for devel package
+rm -rf arch/%{buildarch}/boot/vmlinux*
+rm -rf System.map*
+rm -rf vmlinux*
+rm -rf kernel.img
+rm -rf uapi-headers
+rm -f tools/mkimage*
+find %{_builddir}/linux-kernel-%{version} -name "*\.HEX" -type f -delete
+find %{_builddir}/linux-kernel-%{version} -name ".tmp_vmlinux*" -delete
+find %{_builddir}/linux-kernel-%{version} -name ".gitignore" -delete
+find %{_builddir}/linux-kernel-%{version} -name "\.*dtb*tmp" -delete
+find %{_builddir}/linux-kernel-%{version} -name "\.*dtb" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.*tmp" -delete
+find %{_builddir}/linux-kernel-%{version} -name "vmlinux" -delete
+find %{_builddir}/linux-kernel-%{version} -name "Image" -delete
+find %{_builddir}/linux-kernel-%{version} -name "Image.gz" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*.cmd" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.ko" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.o" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.S" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.c" -not -path "%{_builddir}/linux-kernel-%{version}/scripts/*" -delete
+
+# 3-2. move files for devel package
+cd %{_builddir}
+mv %{_builddir}/usr %{buildroot}/
+%ifarch aarch64
+mv linux-kernel-%{version} kernel-devel-%{variant}
+mkdir -p linux-kernel-%{version}
+
+# 4. Move files for each package
+mkdir -p %{buildroot}/boot/kernel/devel
+mv %{_builddir}/boot/COPYING %{buildroot}/
+mv %{_builddir}/boot/* %{buildroot}/boot/
+rm -rf %{_builddir}/boot
+mv %{_builddir}/lib %{buildroot}/
+mv %{_builddir}/kernel-devel-%{variant} %{buildroot}/boot/kernel/devel/
+%endif
+
+%clean
+rm -rf %{buildroot}
+rm -rf %{_builddir}/COPYING
+rm -rf %{_builddir}/boot
+rm -rf %{_builddir}/lib
+rm -rf %{_builddir}/usr
+rm -rf %{_builddir}/kernel-devel-%{variant}
+
+%ifarch aarch64
+%files -n %{variant}-linux-kernel
+%license /COPYING
+/boot/kernel.img
+
+%files -n %{variant}-linux-kernel-modules
+/lib/modules/
+
+%files -n %{variant}-linux-kernel-devel
+/boot/kernel/devel/*
+
+%files -n %{variant}-linux-kernel-debuginfo
+/boot/Image.gz
+/boot/*.dtb
+/boot/System.map*
+/boot/config*
+/boot/vmlinux*
+%endif
+
+%files -n %{variant}-linux-kernel-headers
+/usr/include/*
diff --git a/packaging/odroid-linux-kernel.spec b/packaging/odroid-linux-kernel.spec
new file mode 100644 (file)
index 0000000..d3c0ea1
--- /dev/null
@@ -0,0 +1,143 @@
+%define config_name tizen_odroid_defconfig
+%define buildarch arm
+%define target_board odroidxu3
+%define variant %{buildarch}-%{target_board}
+
+Name: odroid-linux-kernel
+Summary: The Linux Kernel for ODROID XU3
+Version: 4.14.24
+Release: 0
+License: GPL-2.0
+ExclusiveArch: %{arm}
+Group: System/Kernel
+Vendor: The Linux Community
+URL: http://www.kernel.org
+Source0:   linux-kernel-%{version}.tar.xz
+BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root
+
+%define fullVersion %{version}-%{variant}
+
+BuildRequires: module-init-tools
+BuildRequires: u-boot-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}-odroid-kernel-profile_common = %{version}-%{release}
+Provides: %{variant}-odroid-kernel-profile_mobile = %{version}-%{release}
+Provides: %{variant}-odroid-kernel-profile_tv = %{version}-%{release}
+Provides: %{variant}-odroid-kernel-profile_ivi = %{version}-%{release}
+Provides: %{variant}-kernel-uname-r = %{fullVersion}
+Provides: linux-kernel = %{version}-%{release}
+
+%description -n %{variant}-linux-kernel
+This package contains the Linux kernel for Tizen (common/mobile/tv/ivi 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-devel
+License: GPL-2.0
+Summary: Linux support kernel map and etc for other packages
+Group: System/Kernel
+Provides: %{variant}-kernel-devel = %{fullVersion}
+Provides: %{variant}-kernel-devel-uname-r = %{fullVersion}
+
+%description -n %{variant}-linux-kernel-devel
+This package provides kernel map and etc information for odroid kernel.
+
+%prep
+%setup -q -n linux-kernel-%{version}
+
+%build
+%{?asan:/usr/bin/gcc-unforce-options}
+%{?ubsan:/usr/bin/gcc-unforce-options}
+
+# 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 zImage
+make zImage %{?_smp_mflags}
+make dtbs %{?_smp_mflags}
+
+# 3. Build modules
+make modules %{?_smp_mflags}
+
+%install
+QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT
+
+# 1. Destynation directories
+mkdir -p %{buildroot}/boot/
+mkdir -p %{buildroot}/lib/modules/%{fullVersion}
+
+# 2. Install zImage, System.map, ...
+install -m 755 arch/arm/boot/zImage %{buildroot}/boot/
+install -m 644 arch/arm/boot/dts/*odroid*.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}
+
+rm -rf %{buildroot}/boot/vmlinux*
+rm -rf %{buildroot}/System.map*
+rm -rf %{buildroot}/vmlinux*
+
+# 7. Update file permisions
+find %{buildroot}/lib/modules/ -name "*.ko" -type f -print0 | xargs -0 chmod 755
+
+# 8. Create symbolic links
+rm -f %{buildroot}/lib/modules/%{fullVersion}/build
+rm -f %{buildroot}/lib/modules/%{fullVersion}/source
+
+# 9-1. remove unnecessary files to prepare for devel package
+rm -f tools/mkimage*
+find %{_builddir}/linux-kernel-%{version} -name "*\.HEX" -type f -delete
+find %{_builddir}/linux-kernel-%{version} -name "vdso.so.raw" -type f -delete
+find %{_builddir}/linux-kernel-%{version} -name ".tmp_vmlinux*" -delete
+find %{_builddir}/linux-kernel-%{version} -name ".gitignore" -delete
+find %{_builddir}/linux-kernel-%{version} -name "\.*dtb*tmp" -delete
+find %{_builddir}/linux-kernel-%{version} -name "\.*dtb" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.*tmp" -delete
+find %{_builddir}/linux-kernel-%{version} -name "vmlinux" -delete
+find %{_builddir}/linux-kernel-%{version} -name "zImage" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*.cmd" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.ko" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.o" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.S" -delete
+find %{_builddir}/linux-kernel-%{version} -name "*\.c" -not -path "%{_builddir}/linux-kernel-%{version}/scripts/*" -delete
+
+# 9-2. copy devel package
+mkdir -p %{buildroot}/boot/kernel/devel
+cp -r %{_builddir}/linux-kernel-%{version} %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
+
+%clean
+rm -rf %{buildroot}
+
+%files -n %{variant}-linux-kernel-modules
+/lib/modules/*
+
+%files -n %{variant}-linux-kernel-devel
+/boot/kernel/devel/*
+
+%files -n %{variant}-linux-kernel
+%license COPYING
+/boot/zImage
+/boot/*.dtb
+/boot/System.map*
+/boot/config*