release.8 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. .\" $OpenBSD: release.8,v 1.86 2017/01/24 14:08:53 tb Exp $
  2. .\"
  3. .\" Copyright (c) 2000 Marco S. Hyman
  4. .\" Copyright (c) 2016 Theo Buehler <tb@openbsd.org>
  5. .\"
  6. .\" Permission to copy all or part of this material for any purpose is
  7. .\" granted provided that the above copyright notice and this paragraph
  8. .\" are duplicated in all copies. THIS SOFTWARE IS PROVIDED ``AS IS''
  9. .\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
  10. .\" LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  11. .\" FOR A PARTICULAR PURPOSE.
  12. .\"
  13. .Dd $Mdocdate: January 24 2017 $
  14. .Dt RELEASE 8
  15. .Os
  16. .Sh NAME
  17. .Nm release
  18. .Nd building a LibertyBSD release
  19. .Sh DESCRIPTION
  20. There are several steps necessary to build a release:
  21. .Pp
  22. .Bl -enum -compact -offset indent
  23. .It
  24. Fetch sources.
  25. .It
  26. Build and install a new kernel.
  27. .It
  28. Build a new base system.
  29. .It
  30. Make and validate the base system release.
  31. .It
  32. Build and install Xenocara.
  33. .It
  34. Make and validate the Xenocara release.
  35. .It
  36. Make the third party packages.
  37. .It
  38. Create boot and installation disk images.
  39. .El
  40. .Pp
  41. This manual describes the steps for the
  42. .Em release
  43. and
  44. .Em stable
  45. branches.
  46. To build a
  47. .Em current
  48. release, additional steps may be required.
  49. See
  50. .Lk https://www.openbsd.org/faq/current.html
  51. for any needed workarounds.
  52. .Pp
  53. Commands to be run as a user are preceded by a dollar sign
  54. .Sq $ .
  55. Commands that must be run as the superuser are preceded by a hash mark
  56. .Sq # .
  57. Privileges will be de-escalated to the user
  58. .Sy build
  59. whenever possible.
  60. .Pp
  61. Most of the defaults can be overridden by setting
  62. the appropriate variables in
  63. .Xr mk.conf 5 .
  64. .Ss 1. Fetch sources
  65. A
  66. .Nm
  67. should use sources that were checked out using the same
  68. .Xr cvs 1
  69. tag.
  70. There are two families of tags:
  71. .Bl -tag -width LIBERTYBSD_x_y_BASE
  72. .It LIBERTYBSD_x_y_BASE
  73. The sources for the
  74. LibertyBSD x.y
  75. release.
  76. .It LIBERTYBSD_x_y
  77. The sources for the
  78. LibertyBSD x.y
  79. stable branch.
  80. It contains the patches described in
  81. .Lk https://libertybsd.net/errata.html .
  82. .El
  83. .Pp
  84. See
  85. .Lk https://libertybsd.net/anoncvs.html
  86. for instructions on fetching the sources for the first time.
  87. .Pp
  88. To update existing sources to the versions identified by one of the above
  89. tags, use the commands:
  90. .Bd -literal -offset indent
  91. $ cd /usr/src && cvs up -r TAG -Pd
  92. $ cd /usr/xenocara && cvs up -r TAG -Pd
  93. $ cd /usr/ports && cvs up -r TAG -Pd
  94. .Ed
  95. .Pp
  96. .Sy Warning :
  97. .Xr cvs 1
  98. tags are
  99. .Sq sticky .
  100. See
  101. .Xr cvs 1
  102. for more information.
  103. .Ss 2. Build and install a new kernel
  104. Always build and install a new kernel and reboot before
  105. building the programs that will use the kernel.
  106. This ensures that any new system calls, for example, will be present
  107. when needed.
  108. .Pp
  109. .Dl # cd /sys/arch/$(machine)/compile/GENERIC.MP
  110. .Pp
  111. Replace
  112. .Pa GENERIC.MP
  113. with a different kernel configuration if necessary.
  114. .Pp
  115. Create the build directory and configuration file,
  116. then compile and install the kernel:
  117. .Bd -literal -offset indent
  118. # make obj
  119. # make config
  120. # make && make install
  121. .Ed
  122. .Pp
  123. The current kernel is copied to
  124. .Pa /obsd
  125. and the new kernel to
  126. .Pa /bsd .
  127. Reboot.
  128. .Ss 3. Build a new base system
  129. The build process will place the object files in a tree under
  130. .Pa /usr/obj .
  131. This directory should be empty and owned by build:wobj with mode 770.
  132. .Pp
  133. Create the tree of obj directories and begin the build:
  134. .Bd -literal -offset indent
  135. # cd /usr/src
  136. # make obj && make build
  137. .Ed
  138. .Pp
  139. After the build is completed, update
  140. .Pa /etc ,
  141. .Pa /var ,
  142. and
  143. .Pa /dev ,
  144. using
  145. .Xr sysmerge 8
  146. and
  147. .Xr MAKEDEV 8 .
  148. .Pp
  149. At this point, the base system is up to date and running the code
  150. that will be made into a release.
  151. .Ss 4. Make and validate the base system release
  152. The base system release consists of at least one generic kernel,
  153. some installation media, the release tarballs,
  154. installation instructions, and checksum files.
  155. .Pp
  156. Create a
  157. .Va RELEASEDIR
  158. directory to store the release files.
  159. This directory must be writable by
  160. .Sy build .
  161. .Pp
  162. To build a release, it is necessary to prepare a filesystem mounted with the
  163. .Em noperm
  164. .Xr mount 8
  165. option.
  166. The root of this filesystem must have owner
  167. .Sy build
  168. and mode 700.
  169. On this filesystem, create a
  170. .Va DESTDIR
  171. directory.
  172. This will be the root of a complete
  173. LibertyBSD
  174. installation.
  175. .Pp
  176. .Sy Warning :
  177. .Va DESTDIR
  178. and
  179. .Va RELEASEDIR
  180. must not refer to any directory with
  181. .Pa /mnt
  182. in its path, as
  183. .Pa /mnt
  184. is used in the release generation process.
  185. The
  186. .Xr vnd 4
  187. device vnd0
  188. is also used and must not be configured.
  189. .Pp
  190. Make the release and check the contents of the release tarballs:
  191. .Bd -literal -offset indent
  192. # export DESTDIR=your-destdir; export RELEASEDIR=your-releasedir
  193. # cd /usr/src/etc && make release
  194. # cd /usr/src/distrib/sets && sh checkflist
  195. # unset RELEASEDIR DESTDIR
  196. .Ed
  197. .Ss 5. Build and install Xenocara
  198. Xenocara is based on the X.Org modular build system.
  199. Its sources are supposed to be in
  200. .Pa /usr/xenocara .
  201. The
  202. .Pa /usr/src
  203. tree is also needed while building Xenocara.
  204. The object directory
  205. .Pa /usr/xobj
  206. should be empty and owned by build:wobj with mode 770.
  207. .Pp
  208. The following steps will build and install Xenocara.
  209. .Bd -literal -offset indent
  210. # cd /usr/xenocara
  211. # make bootstrap
  212. # make obj
  213. # make build
  214. .Ed
  215. .Ss 6. Make and validate the Xenocara release
  216. Xenocara uses
  217. .Va DESTDIR
  218. and
  219. .Va RELEASEDIR
  220. as described above.
  221. Use a different
  222. .Va DESTDIR
  223. for the Xenocara release than for the base release,
  224. as the contents of
  225. .Va DESTDIR
  226. will be removed.
  227. .Pp
  228. The steps to build and validate the Xenocara release are:
  229. .Bd -literal -offset indent
  230. # export DESTDIR=your-destdir; export RELEASEDIR=your-releasedir
  231. # make release
  232. # make checkdist
  233. # unset RELEASEDIR DESTDIR
  234. .Ed
  235. .Pp
  236. At this point,
  237. the LibertyBSD
  238. base system and X Window System tarballs are in
  239. .Va RELEASEDIR .
  240. .Ss 7. Make the third party packages
  241. The ports subsystem of contributed applications is capable of producing
  242. packages for installation, either individually or in bulk.
  243. This is described in
  244. .Xr ports 7 .
  245. .Ss 8. Create boot and installation disk images
  246. The disk images
  247. .No install${ Ns Va VERSION Ns }.fs
  248. and
  249. .No install${ Ns Va VERSION Ns }.iso
  250. are suitable for installs without network connectivity.
  251. They contain the tarballs and ports built in the previous steps.
  252. .Bd -literal -offset indent
  253. # export RELDIR=your-releasedir
  254. # export RELXDIR=your-xenocara-releasedir
  255. # cd /usr/src/distrib/$(machine)/iso && make
  256. # make install
  257. .Ed
  258. .Pp
  259. The two installer images are now stored in the local release
  260. directory.
  261. .Sh SEE ALSO
  262. .Xr cvs 1 ,
  263. .Xr pkg_add 1 ,
  264. .Xr mk.conf 5 ,
  265. .Xr ports 7 ,
  266. .Xr sysmerge 8
  267. .Sh HISTORY
  268. This document first appeared in
  269. .Ox 2.8 .