From: Jaechul Lee Date: Thu, 26 Jan 2017 01:13:24 +0000 (+0900) Subject: packaging: Made build scripts for GBS. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f48ee98af7cc5c26fec5edfade8bb6ff93b44e32;p=profile%2Fwearable%2Fplatform%2Fkernel%2Flinux-3.18-exynos7270.git packaging: Made build scripts for GBS. Build scripts were fixed to be worked on GBS environment based on gcc6. Signed-off-by: Jaechul Lee --- diff --git a/packaging/linux-3.18-exynos7270.spec b/packaging/linux-3.18-exynos7270.spec index 58ce7cb..9a4edc8 100644 --- a/packaging/linux-3.18-exynos7270.spec +++ b/packaging/linux-3.18-exynos7270.spec @@ -1,15 +1,13 @@ %define CHIPSET exynos7270 %define KERNEL_VERSION 3.18 -%define ARM arm64 -%define IMAGE Image -%define DZIMAGE dzImage +%define MODEL tizen_tw2 Name: linux-%{KERNEL_VERSION}-%{CHIPSET} Summary: The Linux Kernel -Version: Tizen_exynos7270_20160926_1_7e68a768 +Version: Tizen_exynos7270 Release: 1 -License: GPL -Group: System Environment/Kernel +License: GPL-2.0 +Group: System/Kernel Vendor: The Linux Community URL: http://www.kernel.org Source0: %{name}-%{version}.tar.gz @@ -21,88 +19,49 @@ Provides: linux-%{KERNEL_VERSION} BuildRequires: lzop BuildRequires: binutils-devel -BuildRequires: module-init-tools elfutils-devel +BuildRequires: module-init-tools BuildRequires: python BuildRequires: gcc BuildRequires: bash -BuildRequires: system-tools -BuildRequires: sec-product-features BuildRequires: bc -BuildRequires: cross-aarch64-gcc-%{!?hostx86:x64}%{?hostx86:x86}-arm -BuildRequires: cross-aarch64-binutils-%{!?hostx86:x64}%{?hostx86:x86}-arm -ExclusiveArch: %arm %description The Linux Kernel, the operating system core itself -%if "%{?sec_product_feature_kernel_defconfig}" == "undefined" -%define MODEL tizen_solis -%else -%define MODEL tizen_%{?sec_product_feature_kernel_defconfig} -%endif - -%if "%{?sec_product_feature_system_carrier_type}" == "undefined" -%define CARRIER "" -%else -%define CARRIER %{?sec_product_feature_system_carrier_type} -%endif - -%if "%{?sec_product_feature_system_region_name}" == "undefined" -%define REGION "" -%else -%define REGION %{?sec_product_feature_system_region_name} -%endif - -%if "%{?sec_product_feature_system_operator_name}" == "undefined" -%define OPERATOR "" -%else -%define OPERATOR %{?sec_product_feature_system_operator_name} -%endif - -%if "%{?sec_product_feature_showcase_enable}" == "1" -%define SHOWCASE ifa -%else -%define SHOWCASE na -%endif - - %package -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL} -License: GPL +License: GPL-2.0 Summary: Linux support headers for userspace development -Group: System Environment/Kernel +Group: System/Kernel Requires(post): coreutils %files -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL} -/var/tmp/kernel/mod_%{MODEL} -/var/tmp/kernel/kernel-%{MODEL}/%{DZIMAGE} -/var/tmp/kernel/kernel-%{MODEL}/%{DZIMAGE}-recovery +/boot/kernel/mod_%{MODEL} +/boot/kernel/kernel-%{MODEL}/dzImage %post -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL} -mv /var/tmp/kernel/mod_%{MODEL}/lib/modules/* /lib/modules/. -mv /var/tmp/kernel/kernel-%{MODEL}/%{DZIMAGE} /var/tmp/kernel/. -mv /var/tmp/kernel/kernel-%{MODEL}/%{DZIMAGE}-recovery /var/tmp/kernel/. +mv /boot/kernel/mod_%{MODEL}/lib/modules/* /lib/modules/. +mv /boot/kernel/kernel-%{MODEL}/dzImage /boot/kernel/. %description -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL} This package provides the %{CHIPSET}_eur linux kernel image & module.img. %package -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL}-debuginfo -License: GPL +License: GPL-2.0 Summary: Linux support debug symbol -Group: System Environment/Kernel +Group: System/Kernel %files -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL}-debuginfo -/var/tmp/kernel/mod_%{MODEL} -/var/tmp/kernel/kernel-%{MODEL} +/boot/kernel/mod_%{MODEL} +/boot/kernel/kernel-%{MODEL} %description -n linux-%{KERNEL_VERSION}-%{CHIPSET}_%{MODEL}-debuginfo This package provides the %{CHIPSET}_eur linux kernel's debugging files. %package -n kernel-headers-%{KERNEL_VERSION}-%{CHIPSET} -License: GPL +License: GPL-2.0 Summary: Linux support headers for userspace development -Group: System Environment/Kernel -Provides: kernel-headers, kernel-headers-tizen-dev -Obsoletes: kernel-headers +Group: System/Kernel +Provides: kernel-headers-tizen-dev %description -n kernel-headers-%{KERNEL_VERSION}-%{CHIPSET} This package provides userspaces headers from the Linux kernel. These @@ -110,16 +69,17 @@ headers are used by the installed headers for GNU glibc and other system libraries. %package -n kernel-devel-%{KERNEL_VERSION}-%{CHIPSET} -License: GPL +License: GPL-2.0 Summary: Linux support kernel map and etc for other package Group: System/Kernel Provides: kernel-devel-tizen-dev +Provides: kernel-devel-tizen %description -n kernel-devel-%{KERNEL_VERSION}-%{CHIPSET} This package provides kernel map and etc information. %package -n linux-kernel-license -License: GPL +License: GPL-2.0 Summary: Linux support kernel license file Group: System/Kernel @@ -130,31 +90,36 @@ This package provides kernel license file. %setup -q %build -export PATH=/opt/cross/bin:$PATH -export CROSS_COMPILE=aarch64-tizen-linux-gnu- - -%if 0%{?tizen_build_binary_release_type_eng} -%define RELEASE eng -%else -%define RELEASE usr -%endif mkdir -p %{_builddir}/mod_%{MODEL} make distclean -./release_obs.sh %{RELEASE} %{MODEL} %{CARRIER} %{REGION} %{OPERATOR} %{SHOWCASE} +./release_obs.sh -cp -f arch/%{ARM}/boot/%{IMAGE} %{_builddir}/%{IMAGE}.%{MODEL} -cp -f arch/%{ARM}/boot/merged-dtb %{_builddir}/merged-dtb.%{MODEL} -cp -f arch/%{ARM}/boot/%{DZIMAGE} %{_builddir}/%{DZIMAGE}.%{MODEL} -cp -f arch/%{ARM}/boot/%{DZIMAGE} %{_builddir}/%{DZIMAGE}-recovery.%{MODEL} +cp -f arch/arm64/boot/Image %{_builddir}/Image.%{MODEL} +cp -f arch/arm64/boot/merged-dtb %{_builddir}/merged-dtb.%{MODEL} +cp -f arch/arm64/boot/dzImage %{_builddir}/dzImage.%{MODEL} cp -f System.map %{_builddir}/System.map.%{MODEL} cp -f .config %{_builddir}/config.%{MODEL} cp -f vmlinux %{_builddir}/vmlinux.%{MODEL} +# prepare for devel package +find %{_builddir}/%{name}-%{version} -name ".tmp_vmlinux*" -delete +find %{_builddir}/%{name}-%{version} -name "\.*dtb*tmp" -delete +find %{_builddir}/%{name}-%{version} -name "*\.*tmp" -delete +find %{_builddir}/%{name}-%{version} -name "vmlinux" -delete +find %{_builddir}/%{name}-%{version} -name "bzImage" -delete +find %{_builddir}/%{name}-%{version} -name "zImage" -delete +find %{_builddir}/%{name}-%{version} -name "dzImage" -delete +find %{_builddir}/%{name}-%{version} -name "*.cmd" -delete +find %{_builddir}/%{name}-%{version} -name "*\.ko" -delete +find %{_builddir}/%{name}-%{version} -name "*\.o" -delete +find %{_builddir}/%{name}-%{version} -name "*\.S" -delete +find %{_builddir}/%{name}-%{version} -name "*\.c" -not -path "%{_builddir}/%{name}-%{version}/scripts/*" -delete + #remove all changed source codes for next build cd %_builddir -rm -rf %{name}-%{version} +mv %{name}-%{version} kernel-devel-%{MODEL} /bin/tar -xf %{SOURCE0} cd %{name}-%{version} @@ -164,8 +129,8 @@ make mrproper make headers_check make headers_install INSTALL_HDR_PATH=%{buildroot}/usr -find %{buildroot}/usr/include -name ".install" | xargs rm -f -find %{buildroot}/usr/include -name "..install.cmd" | xargs rm -f +find %{buildroot}/usr/include -name ".install" -delete +find %{buildroot}/usr/include -name "..install.cmd" -delete rm -rf %{buildroot}/usr/include/scsi rm -f %{buildroot}/usr/include/asm*/atomic.h rm -f %{buildroot}/usr/include/asm*/io.h @@ -173,24 +138,28 @@ rm -f %{buildroot}/usr/include/asm*/io.h mkdir -p %{buildroot}/usr/share/license cp -vf COPYING %{buildroot}/usr/share/license/linux-kernel -mkdir -p %{buildroot}/var/tmp/kernel/kernel-%{MODEL} -mkdir -p %{buildroot}/var/tmp/kernel/license-%{MODEL} +mkdir -p %{buildroot}/boot/kernel/devel +mkdir -p %{buildroot}/boot/kernel/kernel-%{MODEL} +mkdir -p %{buildroot}/boot/kernel/license-%{MODEL} + +mv %_builddir/mod_%{MODEL} %{buildroot}/boot/kernel/mod_%{MODEL} -mv %_builddir/mod_%{MODEL} %{buildroot}/var/tmp/kernel/mod_%{MODEL} +mv %_builddir/Image.%{MODEL} %{buildroot}/boot/kernel/kernel-%{MODEL}/Image +mv %_builddir/merged-dtb.%{MODEL} %{buildroot}/boot/kernel/kernel-%{MODEL}/merged-dtb +mv %_builddir/dzImage.%{MODEL} %{buildroot}/boot/kernel/kernel-%{MODEL}/dzImage -mv %_builddir/%{IMAGE}.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/%{IMAGE} -mv %_builddir/merged-dtb.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/merged-dtb -mv %_builddir/%{DZIMAGE}.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/%{DZIMAGE} -mv %_builddir/%{DZIMAGE}-recovery.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/%{DZIMAGE}-recovery +mv %_builddir/System.map.%{MODEL} %{buildroot}/boot/kernel/kernel-%{MODEL}/System.map +mv %_builddir/config.%{MODEL} %{buildroot}/boot/kernel/kernel-%{MODEL}/config +mv %_builddir/vmlinux.%{MODEL} %{buildroot}/boot/kernel/kernel-%{MODEL}/vmlinux +mv %_builddir/kernel-devel-%{MODEL} %{buildroot}/boot/kernel/devel/kernel-devel-%{MODEL} -mv %_builddir/System.map.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/System.map -mv %_builddir/config.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/config -mv %_builddir/vmlinux.%{MODEL} %{buildroot}/var/tmp/kernel/kernel-%{MODEL}/vmlinux +ln -s kernel-devel-%{MODEL} %{buildroot}/boot/kernel/devel/tizen-devel -find %{buildroot}/var/tmp/kernel/ -name 'System.map' > develfiles.pre # for secure storage -find %{buildroot}/var/tmp/kernel/ -name 'vmlinux' >> develfiles.pre # for TIMA -find %{buildroot}/var/tmp/kernel/ -name '*.ko' >> develfiles.pre # for TIMA -find %{buildroot}/var/tmp/kernel/ -name '*%{IMAGE}' >> develfiles.pre # for Trusted Boot +find %{buildroot}/boot/kernel/ -name "*.h" -print0 | xargs -0 chmod 644 +find %{buildroot}/boot/kernel/ -name 'System.map' > develfiles.pre # for secure storage +find %{buildroot}/boot/kernel/ -name 'vmlinux' >> develfiles.pre # for TIMA +find %{buildroot}/boot/kernel/ -name '*.ko' >> develfiles.pre # for TIMA +find %{buildroot}/boot/kernel/ -name '*Image' >> develfiles.pre # for Trusted Boot cat develfiles.pre | sed -e "s#%{buildroot}##g" | uniq | sort > develfiles %clean @@ -203,3 +172,4 @@ rm -rf %_builddir /usr/share/license/* %files -n kernel-devel-%{KERNEL_VERSION}-%{CHIPSET} -f develfiles +/boot/kernel/devel/* diff --git a/release_obs.sh b/release_obs.sh index c723418..a672216 100755 --- a/release_obs.sh +++ b/release_obs.sh @@ -7,67 +7,10 @@ ARM=arm64 BOOT_PATH="arch/${ARM}/boot" IMAGE="Image" DZIMAGE="dzImage" +DTC_PATH="scripts/dtc/" -CHIPSET=exynos7270 -RELEASE=${1} -MODEL=${2} -CARRIER=${3} -REGION=${4} -OPERATOR=${5} -SHOWCASE=${6} -VARIANT="${MODEL}" - -if [ "${CARRIER}" != "" ]; then - VARIANT="${VARIANT}_${CARRIER}" -fi -if [ "${REGION}" != "" ]; then - VARIANT="${VARIANT}_${REGION}" -fi -if [ "${OPERATOR}" != "" ]; then - VARIANT="${VARIANT}_${OPERATOR}" -fi - -if [ "${VARIANT}" == "${MODEL}" ]; then - echo "base_def : ${MODEL}_defconfig , Release : ${RELEASE}" -else - echo "base_def : ${MODEL}_defconfig , variant_def : ${VARIANT}_defconfig, Release : ${RELEASE}" -fi - -if [ "${RELEASE}" = "usr" ]; then - echo "Now disable CONFIG_TIZEN_SEC_KERNEL_ENG for ${MODEL}_defconfig" - - sed -i 's/CONFIG_TIZEN_SEC_KERNEL_ENG=y/\# CONFIG_TIZEN_SEC_KERNEL_ENG is not set/g' arch/${ARM}/configs/${MODEL}_defconfig - if [ "$?" != "0" ]; then - echo "Failed to disable CONFIG_TIZEN_SEC_KERNEL_ENG feature" - exit 1 - fi - - echo "Now disable CONFIG_DYNAMIC_DEBUG for ${MODEL}_defconfig" - - sed -i 's/CONFIG_DYNAMIC_DEBUG=y/\# CONFIG_DYNAMIC_DEBUG is not set/g' arch/${ARM}/configs/${MODEL}_defconfig - if [ "$?" != "0" ]; then - echo "Failed to disable CONFIG_DYNAMIC_DEBUG feature" - exit 1 - fi -fi - -if [ "${SHOWCASE}" = "ifa" ]; then - echo "Now enable Showcase config for ${MODEL}_defconfig" - - sed -i 's/\# CONFIG_IFA_DEMO is not set/CONFIG_IFA_DEMO=y/g' arch/${ARM}/configs/${MODEL}_defconfig - if [ "$?" != "0" ]; then - echo "Failed to enable CONFIG_IFA_DEMO feature" - exit 1 - fi -fi - - -if [ "${VARIANT}" == "${MODEL}" ]; then - make ARCH=${ARM} ${MODEL}_defconfig -else - make ARCH=${ARM} ${MODEL}_defconfig VARIANT_DEFCONFIG=${VARIANT}_defconfig -fi - +make ARCH=${ARM} tizen_solis_defconfig \ + VARIANT_DEFCONFIG=tizen_solis_lte_eur_defconfig if [ "$?" != "0" ]; then echo "Failed to make defconfig :"${ARCH} exit 1 @@ -81,8 +24,6 @@ if [ "$?" != "0" ]; then exit 1 fi -DTC_PATH="scripts/dtc/" - ./scripts/exynos_dtbtool.sh -o ${BOOT_PATH}/merged-dtb -p ${DTC_PATH} -v ${BOOT_PATH}/dts/ if [ "$?" != "0" ]; then echo "Failed to make merged-dtb"