xref: /openbsd-src/distrib/syspatch/README (revision 9f11ffb7133c203312a01e4b986886bc88c7d74b)
1$OpenBSD: README,v 1.3 2017/11/05 10:29:24 rpe Exp $
2
3Notes about the syspatch(8) build process
4=========================================
5
6The syspatch(8) build system will eventually be properly documented in its own
7man(1) page but until things settle and the framework is robust, this file will
8be used as a quick reminder.
9
10Requirements for the build machine
11----------------------------------
12
13- ${FAKEROOT} must be a local mount point with the no perm mount option set and
14  be owned by ${BUILDUSER} with a mode of 0700. It should be big enough to
15  contain one full release per syspatch (~30G).
16
17- ${SRCDIR} and ${XSRCDIR} must be checked out using the OPENBSD_X_X_BASE
18  release tag.
19
20- Timezone must be set to "Canada/Mountain".
21
22Requirements for the fakeroot
23-----------------------------
24
25Before building the first syspatch, the same release used on the build machine
26must be extracted under a subdirectory of ${FAKEROOT} to allow clean comparison
27and find differing files between patched releases.
28
29e.g.
30FAKEROOT=/fakeroot
31FAKE=${FAKEROOT}/syspatch/61-000_release
32RELEASEDIR=/path/to/sets
33mkdir -p ${FAKE}
34install -m 0700 ${RELEASEDIR}/bsd{,.mp} ${FAKE}
35for set in base comp game man xbase xshare xfont xserv; do
36	tar xzphf ${RELEASEDIR}/${set}$(uname -r | tr -d '.').tgz -C ${FAKE}
37done
38mkdir -m 700 -p ${FAKE}/usr/share/relink/kernel/GENERIC{,.MP}
39tar -C ${FAKE}/usr/share/relink/kernel -xzf ${FAKE}/usr/share/relink/kernel.tgz
40rm ${FAKE}/usr/share/relink/kernel.tgz
41
42Building a syspatch
43-------------------
44
45When building a xenocara syspatch, make sure to set XSRCDIR to the directory
46where the xenocara checkout was made.
47    # export XSRCDIR=/usr/xenocara
48
49Everything is done as root under ${BSDSRCDIR}/distrib/syspatch/.
50
51Before building the first syspatch, the obj directory must be created.
52    # FAKEROOT=/fakeroot make -f Makefile.000 obj
53
54Each syspatch requires its own Makefile numbered after the patch level.
55    # cp Makefile.000 Makefile.001
56    # ${EDITOR} Makefile.001
57    -> set the ERRATA name and BUILD type
58
59The patched release can now be built.
60    # FAKEROOT=/fakeroot make -f Makefile.001 001_dummy/.plist
61    # ${EDITOR} obj/001_dummy/.plist
62    -> edit the plist to make sure it only contains files we want to end up in
63       the syspatch(8) tarball
64
65At last, a syspatch(8) can be created.
66    # FAKEROOT=/fakeroot make -f Makefile.001 syspatch
67
68Patches are incremental and must be built in order. In case an errata does not
69apply to the current architecture and to prevent a gap in the numbering, the
70"previous" fakeroot must be created manually by copying the previous one.
71e.g.
72    # cp -Rp /fakeroot/syspatch/61-010_perl /fakeroot/syspatch/61-011_sti
73