dcde000
%if 0%{?fedora:1}
dcde000
%define cross 1
dcde000
%endif
dcde000
e9236f4
Name:           seabios
fd2837d
Version:        1.16.3
8fa4bbe
Release:        %autorelease
e9236f4
Summary:        Open-source legacy BIOS implementation
e9236f4
365f5ca
License:        LGPL-3.0-only
e9236f4
URL:            http://www.coreboot.org/SeaBIOS
eb168d7
a9b600b
Source0:        http://code.coreboot.org/p/seabios/downloads/get/%{name}-%{version}.tar.gz
6162654
6162654
Patch0001:      0001-Workaround-for-a-win8.1-32-S4-resume-bug.patch
6162654
Patch0003:      0003-vgabios-Reorder-video-modes-to-work-around-a-Windows.patch
41145fb
35e0080
Source10:       config.vga-cirrus
35e0080
Source11:       config.vga-isavga
35e0080
Source12:       config.vga-qxl
35e0080
Source13:       config.vga-stdvga
35e0080
Source14:       config.vga-vmware
3bc3117
Source15:       config.csm
3bc3117
Source16:       config.coreboot
3bc3117
Source17:       config.seabios-128k
3bc3117
Source18:       config.seabios-256k
35e0080
Source19:       config.vga-virtio
35e0080
Source20:       config.vga-ramfb
35e0080
Source21:       config.vga-bochs-display
dd5505c
Source22:       config.vga-ati
3c191c8
Source23:       config.seabios-microvm
b9ad6c5
6669047
BuildRequires: make
856cacb
BuildRequires: gcc
4074b5c
BuildRequires: python3
dcde000
%if 0%{?cross:1}
1e77d40
BuildRequires: binutils-x86_64-linux-gnu gcc-x86_64-linux-gnu
dcde000
Buildarch:     noarch
dcde000
%else
dcde000
ExclusiveArch: x86_64
dcde000
%endif
e9236f4
d6248aa
Requires: %{name}-bin = %{version}-%{release}
b9ad6c5
Requires: seavgabios-bin = %{version}-%{release}
d6248aa
d6248aa
# Seabios is noarch, but required on architectures which cannot build it.
d6248aa
# Disable debuginfo because it is of no use to us.
d6248aa
%global debug_package %{nil}
d6248aa
a1a30f0
# Similarly, tell RPM to not complain about x86 roms being shipped noarch
a1a30f0
%global _binaries_in_noarch_packages_terminate_build   0
a1a30f0
9d9aaf1
# You can build a debugging version of the BIOS by setting this to a
9d9aaf1
# value > 1.  See src/config.h for possible values, but setting it to
9d9aaf1
# a number like 99 will enable all possible debugging.  Note that
4e7a4fd
# debugging goes to a special qemu port that you have to enable.  See
9d9aaf1
# the SeaBIOS top-level README file for the magic qemu invocation to
9d9aaf1
# enable this.
9d9aaf1
%global debug_level 1
9d9aaf1
90f093c
e9236f4
%description
e9236f4
SeaBIOS is an open-source legacy BIOS implementation which can be used as
e9236f4
a coreboot payload. It implements the standard BIOS calling interfaces
e9236f4
that a typical x86 proprietary BIOS implements.
e9236f4
90f093c
d6248aa
%package bin
d6248aa
Summary: Seabios for x86
d6248aa
Buildarch: noarch
d6248aa
90f093c
d6248aa
%description bin
d6248aa
SeaBIOS is an open-source legacy BIOS implementation which can be used as
d6248aa
a coreboot payload. It implements the standard BIOS calling interfaces
d6248aa
that a typical x86 proprietary BIOS implements.
e9236f4
90f093c
b9ad6c5
%package -n seavgabios-bin
b9ad6c5
Summary: Seavgabios for x86
b9ad6c5
Buildarch: noarch
b9ad6c5
b9ad6c5
%description -n seavgabios-bin
b9ad6c5
SeaVGABIOS is an open-source VGABIOS implementation.
b9ad6c5
b9ad6c5
e9236f4
%prep
290df1c
%setup -q
44cf4a2
%autopatch -p1
e9236f4
e9236f4
%build
0738150
%define _lto_cflags %{nil}
d6248aa
export CFLAGS="$RPM_OPT_FLAGS"
b9ad6c5
mkdir binaries
b9ad6c5
a1a30f0
build_bios() {
3bc3117
    make clean distclean
3bc3117
    cp $1 .config
3bc3117
    echo "CONFIG_DEBUG_LEVEL=%{debug_level}" >> .config
a1a30f0
    make oldnoconfig V=1
a1a30f0
a1a30f0
    make V=1 \
9be9bde
        EXTRAVERSION="-%{release}" \
8b33368
        PYTHON=python3 \
dcde000
%if 0%{?cross:1}
a1a30f0
        HOSTCC=gcc \
a1a30f0
        CC=x86_64-linux-gnu-gcc \
a1a30f0
        AS=x86_64-linux-gnu-as \
a1a30f0
        LD=x86_64-linux-gnu-ld \
a1a30f0
        OBJCOPY=x86_64-linux-gnu-objcopy \
a1a30f0
        OBJDUMP=x86_64-linux-gnu-objdump \
dcde000
        STRIP=x86_64-linux-gnu-strip \
dcde000
%endif
dcde000
        $4
3bc3117
3bc3117
    cp out/$2 binaries/$3
a1a30f0
}
a1a30f0
3bc3117
# seabios
4614126
build_bios %{_sourcedir}/config.seabios-128k bios.bin bios.bin
4614126
build_bios %{_sourcedir}/config.seabios-256k bios.bin bios-256k.bin
dcde000
%if 0%{?fedora:1}
9be9bde
build_bios %{_sourcedir}/config.csm Csm16.bin bios-csm.bin
9be9bde
build_bios %{_sourcedir}/config.coreboot bios.bin.elf bios-coreboot.bin
d39c5a3
build_bios %{_sourcedir}/config.seabios-microvm bios.bin bios-microvm.bin
dcde000
%endif
b9ad6c5
b9ad6c5
# seavgabios
d39c5a3
%global vgaconfigs bochs-display cirrus isavga qxl stdvga ramfb vmware virtio ati
3e7fdf8
for config in %{vgaconfigs}; do
35e0080
    build_bios %{_sourcedir}/config.vga-${config} \
3e7fdf8
               vgabios.bin vgabios-${config}.bin out/vgabios.bin
b9ad6c5
done
b9ad6c5
e9236f4
e9236f4
%install
e9236f4
mkdir -p $RPM_BUILD_ROOT%{_datadir}/seabios
b9ad6c5
mkdir -p $RPM_BUILD_ROOT%{_datadir}/seavgabios
3bc3117
install -m 0644 binaries/bios.bin $RPM_BUILD_ROOT%{_datadir}/seabios/bios.bin
3bc3117
install -m 0644 binaries/bios-256k.bin $RPM_BUILD_ROOT%{_datadir}/seabios/bios-256k.bin
dcde000
%if 0%{?fedora:1}
184d7f2
install -m 0644 binaries/bios-csm.bin $RPM_BUILD_ROOT%{_datadir}/seabios/bios-csm.bin
184d7f2
install -m 0644 binaries/bios-coreboot.bin $RPM_BUILD_ROOT%{_datadir}/seabios/bios-coreboot.bin
d39c5a3
install -m 0644 binaries/bios-microvm.bin $RPM_BUILD_ROOT%{_datadir}/seabios/bios-microvm.bin
dcde000
%endif
b9ad6c5
install -m 0644 binaries/vgabios*.bin $RPM_BUILD_ROOT%{_datadir}/seavgabios
e9236f4
e9236f4
e9236f4
%files
ec71069
%doc COPYING COPYING.LESSER README
e9236f4
90f093c
d6248aa
%files bin
d6248aa
%dir %{_datadir}/seabios/
184d7f2
%{_datadir}/seabios/bios*.bin
e9236f4
b9ad6c5
%files -n seavgabios-bin
b9ad6c5
%dir %{_datadir}/seavgabios/
b9ad6c5
%{_datadir}/seavgabios/vgabios*.bin
b9ad6c5
e9236f4
e9236f4
%changelog
8fa4bbe
%autochangelog