forked from sshimko/CLIP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Help-Build-System.txt
116 lines (84 loc) · 4.42 KB
/
Help-Build-System.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
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
110
111
112
113
114
115
116
===========================================================================
What is this thing?
This build system allows developers and administrators to create RPMs and LiveCDs
in a controlled environment.
Specific features include:
* Generation of RPMs using mock.
* Generation of installation media (ISOs).
* Generation of LiveCD ISOs (currently broken for RHEL 6 due to dracut
issues).
Unique feature:
* Versioned build-time and run-time package dependencies. Normally
a packager will point mock at a package repository full of RPMs at
different version levels. This makes it difficult to ensure
reproducability across builds. This build system allows one to version
build-time and run-time dependencies, eg create an RPM for application "foo"
with a build dependency bar-4.3-1, thus facilitating reproducability of
generated packages.
===========================================================================
So how do I use this thing?
This build system has a few constructs that must be addressed by the
user.
0. Available build targets.
1. Managing yum repos.
2. Adding custom packages.
3. ISO configuration files, ie kickstart files.
===========================================================================
#0 - Available build targets.
To view the list of available build targets run "make help".
===========================================================================
#1 - Managing yum repos.
Several repositories must be present for the build system to work:
- RHEL/CentOS
- EPEL
- RHEL Optional
- Fedora Build Groups (for RHEL 5)
The locations of these repos is defined in the CONFIG_REPOS file:
- rhel = /mnt/repos/rhel
- epel = /mnt/repos/epel
- opt = /mnt/repos/opt
- buildgroups = /mnt/repos/buildgroups
Remember that repositories are often architecture specific so you might have
to update these variables to build for a different architecture.
===========================================================================
#2 - Custom packages.
The most common task is adding you own packages to be included in a rolled
ISO.
1. First, a directory is created in packages/<PACKAGE NAME>. The contents of
this directory will vary depending on the type of package. Now choose one of
the three options below, 2a, 2b, or 2c.
2a. If you want to include a package and you have a src.rpm that needs *no*
modifications refer to packages/examples/srcrpm as a reference. You will copy
the src rpm, Makefile.tmpl and the gen-makefile-from-src-rpm.sh to the newly
create (#1) package directory. Now enter that directory and run
"$ ./gen-makefile-from-src-rpm.sh <package>.src.rpm". This will generate a
Makefile based on the src RPM. Skip to step #3.
or
2b. If the intent is to contain custom source code, eg an internally developed
application or library, then packages/<PACKAGE NAME> will still contain a
Makefile and spec file, and packages/<PACKAGE NAME>/<PACKAGE NAME> will
contain the sources and application-specific build system (eg the one that
typically has a "make all" and "make install" target). For more information
on this type of package refer to packages/examples/sources.
3. Once the package has been added to the packages/ directory you must update
the PACKAGES variable in the top-level CONFIG_BUILD file to ensure the package is
generated as part of any build. Once a package is generated it will appear
in repos/clip-repo. To add the package to an ISO image update the
appropriate kickstart file and add the package name to the kickstart's package
list.
===========================================================================
#3 - ISO configuration files, ie kickstart files.
The kickstart/ directory contains the files needed to configure an ISO. The
Makefiles in this directory call out to tools in the support/ directory and
pass in a kickstart. This kickstart is used to generate an ISO.
To add a new ISO, first add an appropriate kickstart to the
kickstart/<productname> directory. Since this build system generates and
manages yum repos we must "muck around" with the kickstart so ensure it has
the "#REPO-REPLACEMENT-PLACEHOLDER" line somewhere near the top.
NOTE: the string #REPO-REPLACEDMENT-PLACEHOLDER *must* appear in the
kickstart for this to work appropriately.
If you choose to use a hostable kickstart script rather than rebuilding an
iso, you can run the following from ./kickstart/clip-minimal:
# make setup-ks
A hostable kickstart is then located in
./tmp/clip-iso-build/1/x86_64/os/clip-minimal.ks