forked from amzn/amzn-drivers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README-rpm.txt
65 lines (45 loc) · 2.28 KB
/
README-rpm.txt
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
This directory includes a Makefile and scripts necessary to create a
source rpm (src.rpm) kmod package for installing the Amazon Elastic
Adapter kernel driver on a Red Hat Enterprise Linux (RHEL) compatible
distribution. Currently this script supports building source rpms
which build and install on RHEL version 6.x and 7.x.
PRE-REQUISITES
In order for this script to work correctly, you need to have the
following pre-requisites installed on your RHEL build environment:
1. kernel-devel and kernel-headers packages which match the kernel you
intend to run this kmod on. If the kernel version matches the
currently running kernel version (or you are building the kmod for
the currently running kernel) then you can install the required
dependencies by using the following command line:
bash$ sudo yum -y install kernel-{devel,headers}-$(uname -r)
2. A minimally working build environment. At a minimum, you will need
the rpm-build, make and gcc packages installed:
bash$ sudo yum -y install gcc make rpm-build
BUILDING A SOURCE RPM
Once the pre-requisites have been installed, you can simply issue a
"make" in this directory to build the kmod src.rpm package:
bash$ make
cd .. && git archive --format=tar --prefix=ena-2.5.0/ -o rpm/ena-2.5.0.tar ena_linux_2.5.0
rpmbuild -bs \
--define '_topdir %(pwd)' --define '_ntopdir %(pwd)' \
--define '_builddir %{_ntopdir}' \
--define '_sourcedir %{_ntopdir}' \
--define '_specdir %{_ntopdir}' \
--define '_rpmdir %{_ntopdir}' \
--define '_srcrpmdir %{_ntopdir}' \
ena.spec
Wrote: /home/ec2-user/amzn-drivers/rpm/ena-2.5.0-1.el7.3.src.rpm
bash$ _
COMPILING AND INSTALLING
Once the src.rpm has been created, you can build binary packages for
the installed kernel-devel and kernel-headers environments:
bash$ rpmbuild --rebuild ena-2.5.0-1.el7.3.src.rpm
[....]
Wrote: /home/ec2-user/rpmbuild/RPMS/x86_64/kmod-ena-2.5.0-1.el7.3.x86_64.rpm
Wrote: /home/ec2-user/rpmbuild/RPMS/x86_64/ena-debuginfo-2.5.0-1.el7.3.x86_64.rpm
[...]
bash$ _
Now you should be able to install/deploy the resulting binary rpm
packages using your preferred rpm install too. For example, using yum:
bash$ sudo yum -y localinstall
/home/ec2-user/rpmbuild/RPMS/x86_64/kmod-ena-2.5.0-1.el7.3.x86_64.rpm