1*05942a68Stb$OpenBSD: README,v 1.4 2019/08/14 20:30:19 tb Exp $ 269a007a7Sajacoutot 369a007a7SajacoutotNotes about the syspatch(8) build process 469a007a7Sajacoutot========================================= 569a007a7Sajacoutot 669a007a7SajacoutotThe syspatch(8) build system will eventually be properly documented in its own 769a007a7Sajacoutotman(1) page but until things settle and the framework is robust, this file will 869a007a7Sajacoutotbe used as a quick reminder. 969a007a7Sajacoutot 1069a007a7SajacoutotRequirements for the build machine 1169a007a7Sajacoutot---------------------------------- 1269a007a7Sajacoutot 1369a007a7Sajacoutot- ${FAKEROOT} must be a local mount point with the no perm mount option set and 1469a007a7Sajacoutot be owned by ${BUILDUSER} with a mode of 0700. It should be big enough to 1569a007a7Sajacoutot contain one full release per syspatch (~30G). 1669a007a7Sajacoutot 1769a007a7Sajacoutot- ${SRCDIR} and ${XSRCDIR} must be checked out using the OPENBSD_X_X_BASE 1869a007a7Sajacoutot release tag. 1969a007a7Sajacoutot 2069a007a7Sajacoutot- Timezone must be set to "Canada/Mountain". 2169a007a7Sajacoutot 2269a007a7SajacoutotRequirements for the fakeroot 2369a007a7Sajacoutot----------------------------- 2469a007a7Sajacoutot 2569a007a7SajacoutotBefore building the first syspatch, the same release used on the build machine 2669a007a7Sajacoutotmust be extracted under a subdirectory of ${FAKEROOT} to allow clean comparison 2769a007a7Sajacoutotand find differing files between patched releases. 2869a007a7Sajacoutot 2969a007a7Sajacoutote.g. 3069a007a7SajacoutotFAKEROOT=/fakeroot 31*05942a68StbFAKE=${FAKEROOT}/syspatch/64-000_release 3269a007a7SajacoutotRELEASEDIR=/path/to/sets 3369a007a7Sajacoutotmkdir -p ${FAKE} 3469a007a7Sajacoutotinstall -m 0700 ${RELEASEDIR}/bsd{,.mp} ${FAKE} 3569a007a7Sajacoutotfor set in base comp game man xbase xshare xfont xserv; do 3669a007a7Sajacoutot tar xzphf ${RELEASEDIR}/${set}$(uname -r | tr -d '.').tgz -C ${FAKE} 3769a007a7Sajacoutotdone 388fb1a259Srpemkdir -m 700 -p ${FAKE}/usr/share/relink/kernel/GENERIC{,.MP} 398fb1a259Srpetar -C ${FAKE}/usr/share/relink/kernel -xzf ${FAKE}/usr/share/relink/kernel.tgz 408fb1a259Srperm ${FAKE}/usr/share/relink/kernel.tgz 4169a007a7Sajacoutot 42*05942a68StbContinuing syspatch builds 43*05942a68Stb-------------------------- 44*05942a68Stb 45*05942a68StbIf syspatches were already built for this release on a different machine, the 46*05942a68Stbfollowing additional steps are required. Prepare a ${SYSPATCHES} directory 47*05942a68Stbcontaining all the syspatches of the release. Make a copy of the ${FAKE} 48*05942a68Stbdirectory and extract all the syspatches in it. 49*05942a68Stb 50*05942a68Stbe.g. 51*05942a68StbSYSPATCHES=/path/to/syspatches 52*05942a68StbPATCHED=${FAKEROOT}/syspatch/64-018_mds 53*05942a68Stbcp -Rp ${FAKE} ${PATCHED} 54*05942a68Stbfor _s in ${SYSPATCHES}/*.tgz; do tar -C ${PATCHED} -xzphf ${_s}; done 55*05942a68Stb 56*05942a68StbThen apply all the errata patches to the source trees. 57*05942a68Stb 5869a007a7SajacoutotBuilding a syspatch 5969a007a7Sajacoutot------------------- 6069a007a7Sajacoutot 6169a007a7SajacoutotWhen building a xenocara syspatch, make sure to set XSRCDIR to the directory 6269a007a7Sajacoutotwhere the xenocara checkout was made. 6369a007a7Sajacoutot # export XSRCDIR=/usr/xenocara 6469a007a7Sajacoutot 6569a007a7SajacoutotEverything is done as root under ${BSDSRCDIR}/distrib/syspatch/. 6669a007a7Sajacoutot 6769a007a7SajacoutotBefore building the first syspatch, the obj directory must be created. 6869a007a7Sajacoutot # FAKEROOT=/fakeroot make -f Makefile.000 obj 6969a007a7Sajacoutot 7069a007a7SajacoutotEach syspatch requires its own Makefile numbered after the patch level. 7169a007a7Sajacoutot # cp Makefile.000 Makefile.001 7269a007a7Sajacoutot # ${EDITOR} Makefile.001 7369a007a7Sajacoutot -> set the ERRATA name and BUILD type 7469a007a7Sajacoutot 7569a007a7SajacoutotThe patched release can now be built. 7669a007a7Sajacoutot # FAKEROOT=/fakeroot make -f Makefile.001 001_dummy/.plist 7769a007a7Sajacoutot # ${EDITOR} obj/001_dummy/.plist 7869a007a7Sajacoutot -> edit the plist to make sure it only contains files we want to end up in 7969a007a7Sajacoutot the syspatch(8) tarball 8069a007a7Sajacoutot 8169a007a7SajacoutotAt last, a syspatch(8) can be created. 8269a007a7Sajacoutot # FAKEROOT=/fakeroot make -f Makefile.001 syspatch 834234f61eSajacoutot 844234f61eSajacoutotPatches are incremental and must be built in order. In case an errata does not 854234f61eSajacoutotapply to the current architecture and to prevent a gap in the numbering, the 864234f61eSajacoutot"previous" fakeroot must be created manually by copying the previous one. 874234f61eSajacoutote.g. 884234f61eSajacoutot # cp -Rp /fakeroot/syspatch/61-010_perl /fakeroot/syspatch/61-011_sti 89