summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-08-05 20:19:54 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:00:24 +0900
commit2371cfaf55a3c5db661be01c73fc878b38a3bdd2 (patch)
tree9921fd79045f0964ff41e2870a51d7796943a249 /packaging
parente246ac1f2336f68d3088b7a9da5a655c628d24bc (diff)
downloadlinux-3.10-2371cfaf55a3c5db661be01c73fc878b38a3bdd2.tar.gz
linux-3.10-2371cfaf55a3c5db661be01c73fc878b38a3bdd2.tar.bz2
linux-3.10-2371cfaf55a3c5db661be01c73fc878b38a3bdd2.zip
packaging: support odroid kernel build
This patch supports odroid kernel build. I think we can use a single binary for odroid and trats2(rd-pq). However, I didn't merge it at this point because I don't want to disturb current odroid development. I'll try to merge it to single binary later. Change-Id: I9064affe86510107b992d9e5fbe7c77c81c0d223 Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/linux-kernel-odroid.spec103
1 files changed, 103 insertions, 0 deletions
diff --git a/packaging/linux-kernel-odroid.spec b/packaging/linux-kernel-odroid.spec
new file mode 100644
index 00000000000..1cedd1de11e
--- /dev/null
+++ b/packaging/linux-kernel-odroid.spec
@@ -0,0 +1,103 @@
+%define config_name tizen_odroid_defconfig
+%define abiver 1
+%define build_id %{config_name}.%{abiver}
+%define buildarch arm
+
+Name: linux-kernel-odroid
+Summary: The Linux Kernel for ODROID U3
+Version: 3.10.39
+Release: 1
+License: GPL-2.0
+ExclusiveArch: %{arm}
+Group: System Environment/Kernel
+Vendor: The Linux Community
+URL: http://www.kernel.org
+Source0: %{name}-%{version}-%{build_id}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root
+
+%define fullVersion %{version}-%{build_id}
+
+BuildRequires: module-init-tools
+BuildRequires: u-boot-tools
+BuildRequires: bc
+BuildRequires: e2fsprogs >= 1.42.11
+
+Provides: kernel-odroid = %{version}-%{release}
+Provides: kernel-odroid-uname-r = %{fullVersion}
+
+%description
+The Linux Kernel, the operating system core itself
+
+%package modules
+Summary: Kernel modules
+Group: System/Kernel
+Provides: kernel-odroid-modules = %{fullVersion}
+Provides: kernel-odroid-modules-uname-r = %{fullVersion}
+
+%description modules
+Kernel-modules includes the loadable kernel modules(.ko files).
+
+%prep
+%setup -q
+
+%build
+# 1. Compile sources
+make EXTRAVERSION="-%{build_id}" %{config_name}
+make EXTRAVERSION="-%{build_id}" %{?_smp_mflags}
+
+# 2. Build uImage
+make EXTRAVERSION="-%{build_id}" uImage %{?_smp_mflags}
+make EXTRAVERSION="-%{build_id}" dtbs %{?_smp_mflags}
+
+# 3. Build modules
+make EXTRAVERSION="-%{build_id}" 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 uImage, System.map, ...
+install -m 755 arch/arm/boot/uImage %{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
+
+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 -exec chmod 755 {} \;
+
+# 8. Create symbolic links
+rm -f %{buildroot}/lib/modules/%{fullVersion}/build
+rm -f %{buildroot}/lib/modules/%{fullVersion}/source
+
+# 9. Calculate modules.img size
+BIN_SIZE=`du -s %{buildroot}/lib/modules | awk {'printf $1;'}`
+let BIN_SIZE=${BIN_SIZE}+1024+512
+
+dd if=/dev/zero of=%{buildroot}/boot/modules.img count=${BIN_SIZE} bs=1024
+/usr/sbin/mke2fs -t ext4 -F -d %{buildroot}/lib/modules/ %{buildroot}/boot/modules.img
+
+rm -rf %{buildroot}/lib/modules/%{fullVersion}
+
+%clean
+rm -rf %{buildroot}
+
+%files modules
+/boot/modules.img
+
+%files
+%license COPYING
+/boot/uImage
+/boot/*.dtb
+/boot/System.map*
+/boot/config*