Blame dtb-riscv64.spec

Bernhard M. Wiedemann d38ef0
#
Bernhard M. Wiedemann d38ef0
# spec file for package dtb-riscv64
Bernhard M. Wiedemann d38ef0
#
Bernhard M. Wiedemann 878168
# Copyright (c) 2024 SUSE LLC
Bernhard M. Wiedemann d38ef0
#
Bernhard M. Wiedemann d38ef0
# All modifications and additions to the file contributed by third parties
Bernhard M. Wiedemann d38ef0
# remain the property of their copyright owners, unless otherwise agreed
Bernhard M. Wiedemann d38ef0
# upon. The license for this file, and modifications and additions to the
Bernhard M. Wiedemann d38ef0
# file, is the same license as for the pristine package itself (unless the
Bernhard M. Wiedemann d38ef0
# license for the pristine package is not an Open Source License, in which
Bernhard M. Wiedemann d38ef0
# case the license is the MIT License). An "Open Source License" is a
Bernhard M. Wiedemann d38ef0
# license that conforms to the Open Source Definition (Version 1.9)
Bernhard M. Wiedemann d38ef0
# published by the Open Source Initiative.
Bernhard M. Wiedemann d38ef0
57a832
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Bernhard M. Wiedemann d38ef0
#
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
7a1991
%define srcversion 6.8
b15327
%define patchversion 6.8.8
Bernhard M. Wiedemann d38ef0
%define variant %{nil}
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%include %_sourcedir/kernel-spec-macros
Bernhard M. Wiedemann d38ef0
5c34fe
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,log.sh,try-disable-staging-driver,compress-vmlinux.sh,mkspec-dtb,check-module-license,klp-symbols,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
Name:           dtb-riscv64
b15327
Version:        6.8.8
Bernhard M. Wiedemann d38ef0
%if 0%{?is_kotd}
b15327
Release:        <RELEASE>.g5cd3298
Bernhard M. Wiedemann d38ef0
%else
Bernhard M. Wiedemann d38ef0
Release:        0
Bernhard M. Wiedemann d38ef0
%endif
Bernhard M. Wiedemann d38ef0
Summary:        Device Tree files for $MACHINES
9a48dc
License:        GPL-2.0-only
Bernhard M. Wiedemann d38ef0
Group:          System/Boot
57a832
URL:            https://www.kernel.org/
7a1991
BuildRequires:  cpp
7a1991
BuildRequires:  dtc >= 1.4.3
7a1991
BuildRequires:  xz
Bernhard M. Wiedemann 878168
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
Bernhard M. Wiedemann d38ef0
ExclusiveArch:  riscv64
Bernhard M. Wiedemann 878168
%else
Bernhard M. Wiedemann 878168
ExclusiveArch:  do_not_build
Bernhard M. Wiedemann 878168
%endif
7a1991
7a1991
%define dtbdir /boot/dtb-%kernelrelease
7a1991
160bca
Source0:        https://www.kernel.org/pub/linux/kernel/v6.x/linux-%srcversion.tar.xz
Bernhard M. Wiedemann d38ef0
Source3:        kernel-source.rpmlintrc
Bernhard M. Wiedemann d38ef0
Source14:       series.conf
Bernhard M. Wiedemann d38ef0
Source16:       guards
Bernhard M. Wiedemann d38ef0
Source17:       apply-patches
6a054f
Source19:       kernel-binary-conflicts
6a054f
Source20:       obsolete-kmps
Bernhard M. Wiedemann d38ef0
Source21:       config.conf
Bernhard M. Wiedemann d38ef0
Source23:       supported.conf
Bernhard M. Wiedemann d38ef0
Source33:       check-for-config-changes
Bernhard M. Wiedemann d38ef0
Source35:       group-source-files.pl
Bernhard M. Wiedemann d38ef0
Source36:       README.PATCH-POLICY.SUSE
Bernhard M. Wiedemann d38ef0
Source37:       README.SUSE
Bernhard M. Wiedemann d38ef0
Source38:       README.KSYMS
Bernhard M. Wiedemann d38ef0
Source40:       source-timestamp
Bernhard M. Wiedemann d38ef0
Source46:       split-modules
Bernhard M. Wiedemann d38ef0
Source47:       modversions
Bernhard M. Wiedemann d38ef0
Source48:       macros.kernel-source
Bernhard M. Wiedemann d38ef0
Source49:       kernel-module-subpackage
Bernhard M. Wiedemann d38ef0
Source50:       kabi.pl
Bernhard M. Wiedemann d38ef0
Source51:       mkspec
Bernhard M. Wiedemann d38ef0
Source52:       kernel-source%variant.changes
Bernhard M. Wiedemann d38ef0
Source53:       kernel-source.spec.in
Bernhard M. Wiedemann d38ef0
Source54:       kernel-binary.spec.in
Bernhard M. Wiedemann d38ef0
Source55:       kernel-syms.spec.in
Bernhard M. Wiedemann d38ef0
Source56:       kernel-docs.spec.in
Bernhard M. Wiedemann d38ef0
Source57:       kernel-cert-subpackage
Bernhard M. Wiedemann d38ef0
Source58:       constraints.in
Bernhard M. Wiedemann d38ef0
Source60:       config.sh
Bernhard M. Wiedemann d38ef0
Source61:       compute-PATCHVERSION.sh
Bernhard M. Wiedemann d38ef0
Source62:       old-flavors
Bernhard M. Wiedemann d38ef0
Source63:       arch-symbols
Bernhard M. Wiedemann d38ef0
Source64:       package-descriptions
Bernhard M. Wiedemann d38ef0
Source65:       kernel-spec-macros
Bernhard M. Wiedemann d38ef0
Source67:       log.sh
Bernhard M. Wiedemann d38ef0
Source68:       host-memcpy-hack.h
Bernhard M. Wiedemann d38ef0
Source69:       try-disable-staging-driver
Bernhard M. Wiedemann d38ef0
Source70:       kernel-obs-build.spec.in
Bernhard M. Wiedemann d38ef0
Source71:       kernel-obs-qa.spec.in
Bernhard M. Wiedemann d38ef0
Source72:       compress-vmlinux.sh
Bernhard M. Wiedemann d38ef0
Source73:       dtb.spec.in.in
Bernhard M. Wiedemann d38ef0
Source74:       mkspec-dtb
Bernhard M. Wiedemann d38ef0
Source75:       release-projects
Bernhard M. Wiedemann d38ef0
Source76:       check-module-license
Bernhard M. Wiedemann d38ef0
Source77:       klp-symbols
Bernhard M. Wiedemann d38ef0
Source78:       modules.fips
Bernhard M. Wiedemann d38ef0
Source79:       splitflist
Bernhard M. Wiedemann d38ef0
Source80:       mergedep
Bernhard M. Wiedemann d38ef0
Source81:       moddep
Bernhard M. Wiedemann d38ef0
Source82:       modflist
Bernhard M. Wiedemann d38ef0
Source83:       kernel-subpackage-build
Bernhard M. Wiedemann d38ef0
Source84:       kernel-subpackage-spec
Bernhard M. Wiedemann d38ef0
Source85:       kernel-default-base.spec.txt
494dc1
Source86:       old_changelog.txt
Bernhard M. Wiedemann d38ef0
Source100:      config.tar.bz2
Bernhard M. Wiedemann d38ef0
Source101:      config.addon.tar.bz2
Bernhard M. Wiedemann d38ef0
Source102:      patches.arch.tar.bz2
Bernhard M. Wiedemann d38ef0
Source103:      patches.drivers.tar.bz2
Bernhard M. Wiedemann d38ef0
Source104:      patches.fixes.tar.bz2
Bernhard M. Wiedemann d38ef0
Source105:      patches.rpmify.tar.bz2
Bernhard M. Wiedemann d38ef0
Source106:      patches.suse.tar.bz2
Bernhard M. Wiedemann d38ef0
Source108:      patches.addon.tar.bz2
Bernhard M. Wiedemann d38ef0
Source109:      patches.kernel.org.tar.bz2
Bernhard M. Wiedemann d38ef0
Source110:      patches.apparmor.tar.bz2
Bernhard M. Wiedemann d38ef0
Source111:      patches.rt.tar.bz2
Bernhard M. Wiedemann d38ef0
Source113:      patches.kabi.tar.bz2
6a054f
Source114:      patches.drm.tar.bz2
Bernhard M. Wiedemann d38ef0
Source120:      kabi.tar.bz2
Bernhard M. Wiedemann d38ef0
Source121:      sysctl.tar.bz2
1d2ab9
# These files are found in the kernel-source package:
1d2ab9
NoSource:       0
1d2ab9
NoSource:       3
1d2ab9
NoSource:       14
1d2ab9
NoSource:       16
1d2ab9
NoSource:       17
6a054f
NoSource:       19
6a054f
NoSource:       20
1d2ab9
NoSource:       21
1d2ab9
NoSource:       23
1d2ab9
NoSource:       33
1d2ab9
NoSource:       35
1d2ab9
NoSource:       36
1d2ab9
NoSource:       37
1d2ab9
NoSource:       38
1d2ab9
NoSource:       40
1d2ab9
NoSource:       46
1d2ab9
NoSource:       47
1d2ab9
NoSource:       48
1d2ab9
NoSource:       49
1d2ab9
NoSource:       50
1d2ab9
NoSource:       51
1d2ab9
NoSource:       52
1d2ab9
NoSource:       53
1d2ab9
NoSource:       54
1d2ab9
NoSource:       55
1d2ab9
NoSource:       56
1d2ab9
NoSource:       57
1d2ab9
NoSource:       58
1d2ab9
NoSource:       60
1d2ab9
NoSource:       61
1d2ab9
NoSource:       62
1d2ab9
NoSource:       63
1d2ab9
NoSource:       64
1d2ab9
NoSource:       65
1d2ab9
NoSource:       67
1d2ab9
NoSource:       68
1d2ab9
NoSource:       69
1d2ab9
NoSource:       70
1d2ab9
NoSource:       71
1d2ab9
NoSource:       72
1d2ab9
NoSource:       73
1d2ab9
NoSource:       74
1d2ab9
NoSource:       75
1d2ab9
NoSource:       76
1d2ab9
NoSource:       77
1d2ab9
NoSource:       78
1d2ab9
NoSource:       79
1d2ab9
NoSource:       80
1d2ab9
NoSource:       81
1d2ab9
NoSource:       82
1d2ab9
NoSource:       83
1d2ab9
NoSource:       84
1d2ab9
NoSource:       85
494dc1
NoSource:       86
1d2ab9
NoSource:       100
1d2ab9
NoSource:       101
1d2ab9
NoSource:       102
1d2ab9
NoSource:       103
1d2ab9
NoSource:       104
1d2ab9
NoSource:       105
1d2ab9
NoSource:       106
1d2ab9
NoSource:       108
1d2ab9
NoSource:       109
1d2ab9
NoSource:       110
1d2ab9
NoSource:       111
1d2ab9
NoSource:       113
6a054f
NoSource:       114
1d2ab9
NoSource:       120
1d2ab9
NoSource:       121
7a1991
Requires:       kernel = %version
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%description
Bernhard M. Wiedemann d38ef0
Device Tree files for $MACHINES.
Bernhard M. Wiedemann d38ef0
80b7d8
%package -n dtb-allwinner
80b7d8
Summary:        Allwinner based riscv64 systems
80b7d8
Group:          System/Boot
80b7d8
Provides:       multiversion(dtb)
80b7d8
Requires(post): coreutils
80b7d8
80b7d8
%description -n dtb-allwinner
80b7d8
Device Tree files for Allwinner based riscv64 systems.
80b7d8
7a1991
%post -n dtb-allwinner
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-allwinner -f dtb-allwinner.list
7a1991
%else
7a1991
%files -n dtb-allwinner
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/allwinner
7a1991
%{dtbdir}/allwinner/*.dtb
7a1991
2f5b95
%package -n dtb-microchip
2f5b95
Summary:        Microchip based riscv64 systems
2f5b95
Group:          System/Boot
2f5b95
Provides:       multiversion(dtb)
2f5b95
Requires(post): coreutils
2f5b95
2f5b95
%description -n dtb-microchip
2f5b95
Device Tree files for Microchip based riscv64 systems.
2f5b95
7a1991
%post -n dtb-microchip
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-microchip -f dtb-microchip.list
7a1991
%else
7a1991
%files -n dtb-microchip
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/microchip
7a1991
%{dtbdir}/microchip/*.dtb
7a1991
bf1504
%package -n dtb-renesas
bf1504
Summary:        Renesas based riscv64 systems
bf1504
Group:          System/Boot
bf1504
Provides:       multiversion(dtb)
bf1504
Requires(post): coreutils
bf1504
bf1504
%description -n dtb-renesas
bf1504
Device Tree files for Renesas based riscv64 systems.
bf1504
7a1991
%post -n dtb-renesas
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-renesas -f dtb-renesas.list
7a1991
%else
7a1991
%files -n dtb-renesas
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/renesas
7a1991
%{dtbdir}/renesas/*.dtb
7a1991
Bernhard M. Wiedemann d38ef0
%package -n dtb-sifive
Bernhard M. Wiedemann d38ef0
Summary:        SiFive based riscv64 systems
Bernhard M. Wiedemann d38ef0
Group:          System/Boot
Bernhard M. Wiedemann d38ef0
Provides:       multiversion(dtb)
Bernhard M. Wiedemann d38ef0
Requires(post): coreutils
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%description -n dtb-sifive
Bernhard M. Wiedemann d38ef0
Device Tree files for SiFive based riscv64 systems.
Bernhard M. Wiedemann d38ef0
7a1991
%post -n dtb-sifive
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-sifive -f dtb-sifive.list
7a1991
%else
7a1991
%files -n dtb-sifive
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/sifive
7a1991
%{dtbdir}/sifive/*.dtb
7a1991
494dc1
%package -n dtb-sophgo
494dc1
Summary:        Sophgo based riscv64 systems
494dc1
Group:          System/Boot
494dc1
Provides:       multiversion(dtb)
494dc1
Requires(post): coreutils
494dc1
494dc1
%description -n dtb-sophgo
494dc1
Device Tree files for Sophgo based riscv64 systems.
494dc1
7a1991
%post -n dtb-sophgo
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-sophgo -f dtb-sophgo.list
7a1991
%else
7a1991
%files -n dtb-sophgo
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/sophgo
7a1991
%{dtbdir}/sophgo/*.dtb
7a1991
2f5b95
%package -n dtb-starfive
2f5b95
Summary:        StarFive based riscv64 systems
1d6426
Group:          System/Boot
1d6426
Provides:       multiversion(dtb)
1d6426
Requires(post): coreutils
1d6426
2f5b95
%description -n dtb-starfive
2f5b95
Device Tree files for StarFive based riscv64 systems.
1d6426
7a1991
%post -n dtb-starfive
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-starfive -f dtb-starfive.list
7a1991
%else
7a1991
%files -n dtb-starfive
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/starfive
7a1991
%{dtbdir}/starfive/*.dtb
7a1991
80b7d8
%package -n dtb-thead
80b7d8
Summary:        T-HEAD based riscv64 systems
80b7d8
Group:          System/Boot
80b7d8
Provides:       multiversion(dtb)
80b7d8
Requires(post): coreutils
80b7d8
80b7d8
%description -n dtb-thead
80b7d8
Device Tree files for T-HEAD based riscv64 systems.
80b7d8
7a1991
%post -n dtb-thead
7a1991
cd /boot
7a1991
# If /boot/dtb is a symlink, remove it, so that we can replace it.
7a1991
[ -d dtb ] && [ -L dtb ] && rm -f dtb
7a1991
# Unless /boot/dtb exists as real directory, create a symlink.
7a1991
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
7a1991
7a1991
%ifarch %arm aarch64 riscv64
7a1991
%files -n dtb-thead -f dtb-thead.list
7a1991
%else
7a1991
%files -n dtb-thead
7a1991
%endif
7a1991
%defattr(-,root,root)
7a1991
%ghost /boot/dtb
7a1991
%dir %{dtbdir}
7a1991
%dir %{dtbdir}/thead
7a1991
%{dtbdir}/thead/*.dtb
7a1991
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%prep
Bernhard M. Wiedemann d38ef0
# Unpack all sources and patches
6a054f
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 108 -a 109 -a 110 -a 111 -a 113 -a 114 -a 120 -a 121
Bernhard M. Wiedemann d38ef0
cd linux-%srcversion
Bernhard M. Wiedemann d38ef0
%_sourcedir/apply-patches %_sourcedir/series.conf ..
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%build
Bernhard M. Wiedemann d38ef0
source=linux-%srcversion
Bernhard M. Wiedemann d38ef0
cp $source/COPYING .
5c34fe
SRCDIR=$PWD/$source
Bernhard M. Wiedemann d38ef0
mkdir pp
5c34fe
PPDIR=$PWD/pp
Bernhard M. Wiedemann d38ef0
export DTC_FLAGS="-R 4 -p 0x1000"
Bernhard M. Wiedemann d38ef0
DTC_FLAGS="$DTC_FLAGS -@"
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
cd $source/arch/riscv/boot/dts
494dc1
for dts in allwinner/*.dts microchip/*.dts renesas/*.dts sifive/*.dts sophgo/*.dts starfive/*.dts thead/*.dts ; do
Bernhard M. Wiedemann d38ef0
    target=${dts%*.dts}
Bernhard M. Wiedemann d38ef0
    mkdir -p $PPDIR/$(dirname $target)
Bernhard M. Wiedemann d38ef0
    cpp -x assembler-with-cpp -undef -D__DTS__ -nostdinc -I. -I$SRCDIR/include/ -I$SRCDIR/scripts/dtc/include-prefixes/ -P $target.dts -o $PPDIR/$target.dts
Bernhard M. Wiedemann d38ef0
    dtc $DTC_FLAGS -I dts -O dtb -i ./$(dirname $target) -o $PPDIR/$target.dtb $PPDIR/$target.dts
Bernhard M. Wiedemann d38ef0
done
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%install
Bernhard M. Wiedemann d38ef0
cd pp
494dc1
for dts in allwinner/*.dts microchip/*.dts renesas/*.dts sifive/*.dts sophgo/*.dts starfive/*.dts thead/*.dts ; do
Bernhard M. Wiedemann d38ef0
    target=${dts%*.dts}
Bernhard M. Wiedemann d38ef0
    install -m 755 -d %{buildroot}%{dtbdir}/$(dirname $target)
Bernhard M. Wiedemann d38ef0
    # install -m 644 COPYING %{buildroot}%{dtbdir}/$(dirname $target)
Bernhard M. Wiedemann d38ef0
    install -m 644 $target.dtb %{buildroot}%{dtbdir}/$(dirname $target)
8297e1
%ifarch %arm aarch64 riscv64
Bernhard M. Wiedemann d38ef0
    # HACK: work around U-Boot ignoring vendor dir
Bernhard M. Wiedemann d38ef0
    baselink=%{dtbdir}/$(basename $target).dtb
Bernhard M. Wiedemann d38ef0
    ln -s $target.dtb %{buildroot}$baselink
8297e1
%ifarch %arm
8297e1
    case $dts in
8297e1
    esac
8297e1
    echo $baselink >> ../$pkgname.list
8297e1
%else
8297e1
    vendordir=$(basename $(dirname $target))
Bernhard M. Wiedemann d38ef0
    echo $baselink >> ../dtb-$vendordir.list
Bernhard M. Wiedemann d38ef0
%endif
8297e1
%endif
Bernhard M. Wiedemann d38ef0
done
Bernhard M. Wiedemann d38ef0
cd -
Bernhard M. Wiedemann d38ef0
Bernhard M. Wiedemann d38ef0
%changelog