release.8 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. .\" $OpenBSD: release.8,v 1.94 2018/06/23 23:19:11 rob 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: June 23 2018 $
  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. .Pp
  50. Commands to be run as a user are preceded by a dollar sign
  51. .Sq $ .
  52. Commands that must be run as the superuser are preceded by a hash mark
  53. .Sq # .
  54. Privileges will be de-escalated to the user
  55. .Sy build
  56. whenever possible.
  57. .Pp
  58. Most of the defaults can be overridden by setting
  59. the appropriate variables in
  60. .Xr mk.conf 5 .
  61. .Ss 1. Fetch sources
  62. You can fetch sources from
  63. .Lk https://ftp.libertybsd.net/pub/LibertyBSD/x.y/ ,
  64. .Lk ftp://ftp.libertybsd.net/pub/LibertyBSD/x.y/ ,
  65. or from a mirror.
  66. .Pp
  67. You can find a list of mirrors at
  68. .Lk https://libertybsd.net/download.shtml .
  69. .Pp
  70. The files you'll need are
  71. .Pa src.tar.gz ,
  72. .Pa sys.tar.gz ,
  73. and
  74. .Pa xenocara.tar.gz .
  75. .Pp
  76. As for dealing with these tarballs:
  77. .Bl -compact -offset indent
  78. .It
  79. .Pa src.tar.gz
  80. should be extracted to
  81. .Pa /usr/src
  82. .It
  83. .Pa sys.tar.gz
  84. should be extracted to
  85. .Pa /usr/src/sys
  86. .It
  87. .Pa xenocara.tar.gz
  88. should be extracted to
  89. .Pa /usr/xenocara
  90. .El
  91. .Pp
  92. .Ss 2. Build and install a new kernel
  93. Always build and install a new kernel and reboot before
  94. building the programs that will use the kernel.
  95. This ensures that any new system calls, for example, will be present
  96. when needed.
  97. .Pp
  98. .Dl # cd /sys/arch/$(machine)/compile/GENERIC.MP
  99. .Pp
  100. Replace
  101. .Pa GENERIC.MP
  102. with a different kernel configuration if necessary.
  103. .Pp
  104. Create the build directory and configuration file,
  105. then compile and install the kernel:
  106. .Bd -literal -offset indent
  107. # make obj
  108. # make config
  109. # make && make install
  110. .Ed
  111. .Pp
  112. The current kernel is copied to
  113. .Pa /obsd
  114. and the new kernel to
  115. .Pa /bsd .
  116. Reboot.
  117. .Ss 3. Build a new base system
  118. The build process will place the object files in a tree under
  119. .Pa /usr/obj .
  120. This directory must be owned by build:wobj with mode 770.
  121. .Pp
  122. Create the tree of obj directories and begin the build:
  123. .Bd -literal -offset indent
  124. # cd /usr/src
  125. # make obj && make build
  126. .Ed
  127. .Pp
  128. After the build is completed, update
  129. .Pa /etc ,
  130. .Pa /var ,
  131. and
  132. .Pa /dev ,
  133. using
  134. .Xr sysmerge 8
  135. and
  136. .Xr MAKEDEV 8 :
  137. .Bd -literal -offset indent
  138. # sysmerge
  139. # cd /dev && ./MAKEDEV all
  140. .Ed
  141. .Pp
  142. At this point, the base system is up to date with the code
  143. that will be made into a release.
  144. .Ss 4. Make and validate the base system release
  145. The base system release consists of at least one generic kernel,
  146. some installation media, the release tarballs,
  147. installation instructions, and checksum files.
  148. .Pp
  149. Create a
  150. .Va RELEASEDIR
  151. directory to store the release files.
  152. This directory must be writable by
  153. .Sy build .
  154. .Pp
  155. To build a release, it is necessary to prepare a filesystem mounted with the
  156. .Em noperm
  157. .Xr mount 8
  158. option.
  159. Either standard FFS or
  160. .Xr mount_mfs 8
  161. may be used.
  162. The root of this filesystem must have owner
  163. .Sy build
  164. and mode 700.
  165. On this filesystem, create a
  166. .Va DESTDIR
  167. directory.
  168. This will be the root of a complete
  169. LibertyBSD
  170. installation.
  171. .Pp
  172. .Sy Warning :
  173. .Va DESTDIR
  174. and
  175. .Va RELEASEDIR
  176. must not refer to any directory with
  177. .Pa /mnt
  178. in its path, as
  179. .Pa /mnt
  180. is used in the release generation process.
  181. The
  182. .Xr vnd 4
  183. device vnd0
  184. is also used and must not be configured.
  185. .Pp
  186. Make the release and check the contents of the release tarballs:
  187. .Bd -literal -offset indent
  188. # export DESTDIR=your-destdir RELEASEDIR=your-releasedir
  189. # cd /usr/src/etc && make release
  190. # cd /usr/src/distrib/sets && sh checkflist
  191. # unset RELEASEDIR DESTDIR
  192. .Ed
  193. .Ss 5. Build and install Xenocara
  194. Xenocara is based on the X.Org modular build system.
  195. Its sources are supposed to be in
  196. .Pa /usr/xenocara .
  197. The
  198. .Pa /usr/src
  199. tree is also needed while building Xenocara.
  200. The object directory
  201. .Pa /usr/xobj
  202. should be empty and owned by build:wobj with mode 770.
  203. .Pp
  204. The following steps will build and install Xenocara.
  205. .Bd -literal -offset indent
  206. # cd /usr/xenocara
  207. # make bootstrap
  208. # make obj
  209. # make build
  210. .Ed
  211. .Ss 6. Make and validate the Xenocara release
  212. Xenocara uses
  213. .Va DESTDIR
  214. and
  215. .Va RELEASEDIR
  216. as described above.
  217. Use a different
  218. .Va DESTDIR
  219. for the Xenocara release than for the base release,
  220. as the contents of
  221. .Va DESTDIR
  222. will be removed.
  223. .Pp
  224. The steps to build and validate the Xenocara release are:
  225. .Bd -literal -offset indent
  226. # export DESTDIR=your-destdir RELEASEDIR=your-releasedir
  227. # make release
  228. # make checkdist
  229. # unset RELEASEDIR DESTDIR
  230. .Ed
  231. .Pp
  232. At this point,
  233. LibertyBSD
  234. base system and X Window System tarballs are in
  235. .Va RELEASEDIR .
  236. .Ss 7. Make the third party packages
  237. The ports subsystem of contributed applications is capable of producing
  238. packages for installation, either individually or in bulk.
  239. This is described in
  240. .Xr ports 7 .
  241. .Ss 8. Create boot and installation disk images
  242. The disk images
  243. .No install${ Ns Va VERSION Ns }.fs
  244. and
  245. .No install${ Ns Va VERSION Ns }.iso
  246. are suitable for installs without network connectivity.
  247. They contain the tarballs and ports built in the previous steps.
  248. .Bd -literal -offset indent
  249. # export RELDIR=your-releasedir RELXDIR=your-xenocara-releasedir
  250. # cd /usr/src/distrib/$(machine)/iso && make
  251. # make install
  252. .Ed
  253. .Pp
  254. The two installer images are now stored in the local release
  255. directory.
  256. .Sh SEE ALSO
  257. .Xr cvs 1 ,
  258. .Xr pkg_add 1 ,
  259. .Xr mk.conf 5 ,
  260. .Xr ports 7 ,
  261. .Xr sysmerge 8
  262. .Sh HISTORY
  263. This document first appeared in
  264. .Ox 2.8 .