%global debug_package %{nil} %define _binary_payload w2.xzdio %define _source_payload w2.xzdio Name: coreboot.git Version: 4.0 Release: 4602.b0.g0cc33da%{?dist} Summary: open source x86 firmware Group: Applications/Emulators License: GPLv2+ Source0: coreboot.git-g0cc33da.tar.xz #Source1: 3rdparty-vboot-gfbf631c.tar.gz Source9: descriptor-coreboot.pl Source10: config.i440fx.seabios Source11: config.i440fx.seabios.corevga Source12: config.i440fx.tianocore Source20: config.q35.seabios Source22: config.q35.tianocore BuildRequires: iasl BuildRequires: make gcc python BuildRequires: perl perl-JSON BuildRequires: pciutils-devel BuildRequires: seabios.git-coreboot #BuildRequires: edk2.git-coreboot-x64 Requires: coreboot.git-tools %description coreboot is a Free Software project aimed at replacing the proprietary BIOS (firmware) found in most computers. coreboot performs a little bit of hardware initialization and then executes additional boot logic, called a payload. %package tools Summary: coreboot tools %description tools coreboot tools %prep %setup -q -n %{name} #tar xf %{SOURCE1} %build function do_build() { local cfg="$1" local name="$2" rm -rf "build" cp "$cfg" ".config" yes "" | make oldconfig make V=1 cp .config rpm.doc/${name}.config cp build/coreboot.rom rpm.bin/${name}.rom } mkdir rpm.doc mkdir rpm.bin # use newer gcc on rhel, log used version if test -f /opt/rh/devtoolset-8/enable; then source /opt/rh/devtoolset-8/enable elif test -f /opt/rh/devtoolset-6/enable; then source /opt/rh/devtoolset-6/enable fi gcc --version do_build %{SOURCE10} coreboot-i440fx-seabios #do_build %{SOURCE11} coreboot-i440fx-seabios-corevga #do_build %{SOURCE12} coreboot-i440fx-tianocore do_build %{SOURCE20} coreboot-q35-seabios #do_build %{SOURCE22} coreboot-q35-tianocore for util in cbmem inteltool nvramtool; do make -C util/$util done %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_mandir}/man8 mkdir -p %{buildroot}/usr/share/%{name} cp rpm.bin/* %{buildroot}/usr/share/%{name} ln -s coreboot-i440fx-seabios.rom %{buildroot}/usr/share/%{name}/bios.bin ln -s coreboot-i440fx-seabios.rom %{buildroot}/usr/share/%{name}/bios-256k.bin cp build/cbfstool \ util/cbmem/cbmem \ util/nvramtool/nvramtool \ util/inteltool/inteltool \ %{buildroot}%{_bindir} cp util/inteltool/inteltool.8 \ %{buildroot}%{_mandir}/man8 mkdir -p %{buildroot}/usr/share/qemu/firmware %{SOURCE9} "/usr/share/%{name}/coreboot-i440fx-seabios.rom" \ "coreboot (git master, i440fx, seabios)" "i440fx" \ > %{buildroot}/usr/share/qemu/firmware/81-coreboot-git-i440fx-seabios.json %{SOURCE9} "/usr/share/%{name}/coreboot-q35-seabios.rom" \ "coreboot (git master, q35, seabios)" "q35" \ > %{buildroot}/usr/share/qemu/firmware/81-coreboot-git-q35-seabios.json %files %doc rpm.doc/*.config /usr/share/%{name} /usr/share/qemu/firmware/* %files tools %{_bindir}/* %{_mandir}/man8/*.8* %changelog