File dtb-aarch64.spec of Package dtb-source

#
# spec file for package dtb-aarch64
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           dtb-aarch64
BuildRequires:  kernel-source
%define kernel_version %(rpm -q --qf "%{VERSION}" kernel-source | grep -v "is not")
Version:        %kernel_version
Release:        0
Summary:        Device Tree files for $MACHINES
License:        GPL-2.0
Group:          System/Boot
Url:            http://www.kernel.org/
%if "dtb-aarch64" == "dtb-source"
Source99:       pre_checkin.pl
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       kernel = %kernel_version
BuildRequires:  cpp
BuildRequires:  dtc >= 1.4.0
BuildRequires:  xz
ExclusiveArch:  aarch64

%description
Device Tree files for $MACHINES.

%package -n dtb-apm-mustang
Summary:        APM X-Gene Mustang board
Group:          System/Boot

%description -n dtb-apm-mustang
Device Tree Files for APM X-Gene Mustang board.

%package -n dtb-thunder-88xx
Summary:        Cavium ThunderX CN88XX
Group:          System/Boot

%description -n dtb-thunder-88xx
Device Tree Files for Cavium ThunderX CN88XX.

%package -n dtb-foundation-v8
Summary:        Foundation-V8A (compatible with Vexpress64)
Group:          System/Boot

%description -n dtb-foundation-v8
Device Tree Files for Foundation-V8A (compatible with Vexpress64).

%package -n dtb-rtsm_ve-aemv8a
Summary:        RTSM VE AEMv8A board (compatible with Vexpress64)
Group:          System/Boot

%description -n dtb-rtsm_ve-aemv8a
Device Tree Files for RTSM VE AEMv8A board (compatible with Vexpress64).



%prep

%build
cp /usr/src/linux/COPYING .
cp -r /usr/src/linux/ .
chmod -R ug+rw linux

%install
%if "dtb-aarch64" != "dtb-source"
export DTC_FLAGS="-R 4 -p 0x1000"
mkdir -p %{buildroot}/boot/dtb

cd linux/arch/arm64/boot/dts
for dts in apm/apm-mustang.dts cavium/thunder-88xx.dts arm/foundation-v8.dts arm/rtsm_ve-aemv8a.dts ; do
	target=${dts%*.dts}
	cpp -x assembler-with-cpp -undef -D__DTS__ -nostdinc -I. -I./include/ -P $target.dts -o $target.dts.tmp
	install -m 700 -d %{buildroot}/boot/dtb/$(dirname $target)
	dtc $DTC_FLAGS -I dts -O dtb -o %{buildroot}/boot/dtb/$target.dtb $target.dts.tmp
done
cd -

%files -n dtb-apm-mustang
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
%dir /boot/dtb/apm
/boot/dtb/apm/apm-mustang.dtb

%files -n dtb-thunder-88xx
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
%dir /boot/dtb/cavium
/boot/dtb/cavium/thunder-88xx.dtb

%files -n dtb-foundation-v8
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
%dir /boot/dtb/arm
/boot/dtb/arm/foundation-v8.dtb

%files -n dtb-rtsm_ve-aemv8a
%defattr(-,root,root)
%doc COPYING
%dir /boot/dtb/
%dir /boot/dtb/arm
/boot/dtb/arm/rtsm_ve-aemv8a.dtb

%endif

%changelog
openSUSE Build Service is sponsored by