summaryrefslogtreecommitdiffstats
path: root/coreboot.git.spec
blob: 9af7b4aa92315b81a9a6efedb6214a4c34f1a64f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%global debug_package %{nil}

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

(cd util/msrtool; ./configure)
for util in cbmem inteltool msrtool 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/msrtool/msrtool \
   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