123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- .\" $OpenBSD: release.8,v 1.94 2018/06/23 23:19:11 rob Exp $
- .\"
- .\" Copyright (c) 2000 Marco S. Hyman
- .\" Copyright (c) 2016 Theo Buehler <tb@openbsd.org>
- .\"
- .\" Permission to copy all or part of this material for any purpose is
- .\" granted provided that the above copyright notice and this paragraph
- .\" are duplicated in all copies. THIS SOFTWARE IS PROVIDED ``AS IS''
- .\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
- .\" LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- .\" FOR A PARTICULAR PURPOSE.
- .\"
- .Dd $Mdocdate: June 23 2018 $
- .Dt RELEASE 8
- .Os
- .Sh NAME
- .Nm release
- .Nd building a LibertyBSD release
- .Sh DESCRIPTION
- There are several steps necessary to build a release:
- .Pp
- .Bl -enum -compact -offset indent
- .It
- Fetch sources.
- .It
- Build and install a new kernel.
- .It
- Build a new base system.
- .It
- Make and validate the base system release.
- .It
- Build and install Xenocara.
- .It
- Make and validate the Xenocara release.
- .It
- Make the third party packages.
- .It
- Create boot and installation disk images.
- .El
- .Pp
- This manual describes the steps for the
- .Em release
- and
- .Em stable
- branches.
- To build a
- .Em current
- release, additional steps may be required.
- .Pp
- Commands to be run as a user are preceded by a dollar sign
- .Sq $ .
- Commands that must be run as the superuser are preceded by a hash mark
- .Sq # .
- Privileges will be de-escalated to the user
- .Sy build
- whenever possible.
- .Pp
- Most of the defaults can be overridden by setting
- the appropriate variables in
- .Xr mk.conf 5 .
- .Ss 1. Fetch sources
- You can fetch sources from
- .Lk https://ftp.libertybsd.net/pub/LibertyBSD/x.y/ ,
- .Lk ftp://ftp.libertybsd.net/pub/LibertyBSD/x.y/ ,
- or from a mirror.
- .Pp
- You can find a list of mirrors at
- .Lk https://libertybsd.net/download.shtml .
- .Pp
- The files you'll need are
- .Pa src.tar.gz ,
- .Pa sys.tar.gz ,
- and
- .Pa xenocara.tar.gz .
- .Pp
- As for dealing with these tarballs:
- .Bl -compact -offset indent
- .It
- .Pa src.tar.gz
- should be extracted to
- .Pa /usr/src
- .It
- .Pa sys.tar.gz
- should be extracted to
- .Pa /usr/src/sys
- .It
- .Pa xenocara.tar.gz
- should be extracted to
- .Pa /usr/xenocara
- .El
- .Pp
- .Ss 2. Build and install a new kernel
- Always build and install a new kernel and reboot before
- building the programs that will use the kernel.
- This ensures that any new system calls, for example, will be present
- when needed.
- .Pp
- .Dl # cd /sys/arch/$(machine)/compile/GENERIC.MP
- .Pp
- Replace
- .Pa GENERIC.MP
- with a different kernel configuration if necessary.
- .Pp
- Create the build directory and configuration file,
- then compile and install the kernel:
- .Bd -literal -offset indent
- # make obj
- # make config
- # make && make install
- .Ed
- .Pp
- The current kernel is copied to
- .Pa /obsd
- and the new kernel to
- .Pa /bsd .
- Reboot.
- .Ss 3. Build a new base system
- The build process will place the object files in a tree under
- .Pa /usr/obj .
- This directory must be owned by build:wobj with mode 770.
- .Pp
- Create the tree of obj directories and begin the build:
- .Bd -literal -offset indent
- # cd /usr/src
- # make obj && make build
- .Ed
- .Pp
- After the build is completed, update
- .Pa /etc ,
- .Pa /var ,
- and
- .Pa /dev ,
- using
- .Xr sysmerge 8
- and
- .Xr MAKEDEV 8 :
- .Bd -literal -offset indent
- # sysmerge
- # cd /dev && ./MAKEDEV all
- .Ed
- .Pp
- At this point, the base system is up to date with the code
- that will be made into a release.
- .Ss 4. Make and validate the base system release
- The base system release consists of at least one generic kernel,
- some installation media, the release tarballs,
- installation instructions, and checksum files.
- .Pp
- Create a
- .Va RELEASEDIR
- directory to store the release files.
- This directory must be writable by
- .Sy build .
- .Pp
- To build a release, it is necessary to prepare a filesystem mounted with the
- .Em noperm
- .Xr mount 8
- option.
- Either standard FFS or
- .Xr mount_mfs 8
- may be used.
- The root of this filesystem must have owner
- .Sy build
- and mode 700.
- On this filesystem, create a
- .Va DESTDIR
- directory.
- This will be the root of a complete
- LibertyBSD
- installation.
- .Pp
- .Sy Warning :
- .Va DESTDIR
- and
- .Va RELEASEDIR
- must not refer to any directory with
- .Pa /mnt
- in its path, as
- .Pa /mnt
- is used in the release generation process.
- The
- .Xr vnd 4
- device vnd0
- is also used and must not be configured.
- .Pp
- Make the release and check the contents of the release tarballs:
- .Bd -literal -offset indent
- # export DESTDIR=your-destdir RELEASEDIR=your-releasedir
- # cd /usr/src/etc && make release
- # cd /usr/src/distrib/sets && sh checkflist
- # unset RELEASEDIR DESTDIR
- .Ed
- .Ss 5. Build and install Xenocara
- Xenocara is based on the X.Org modular build system.
- Its sources are supposed to be in
- .Pa /usr/xenocara .
- The
- .Pa /usr/src
- tree is also needed while building Xenocara.
- The object directory
- .Pa /usr/xobj
- should be empty and owned by build:wobj with mode 770.
- .Pp
- The following steps will build and install Xenocara.
- .Bd -literal -offset indent
- # cd /usr/xenocara
- # make bootstrap
- # make obj
- # make build
- .Ed
- .Ss 6. Make and validate the Xenocara release
- Xenocara uses
- .Va DESTDIR
- and
- .Va RELEASEDIR
- as described above.
- Use a different
- .Va DESTDIR
- for the Xenocara release than for the base release,
- as the contents of
- .Va DESTDIR
- will be removed.
- .Pp
- The steps to build and validate the Xenocara release are:
- .Bd -literal -offset indent
- # export DESTDIR=your-destdir RELEASEDIR=your-releasedir
- # make release
- # make checkdist
- # unset RELEASEDIR DESTDIR
- .Ed
- .Pp
- At this point,
- LibertyBSD
- base system and X Window System tarballs are in
- .Va RELEASEDIR .
- .Ss 7. Make the third party packages
- The ports subsystem of contributed applications is capable of producing
- packages for installation, either individually or in bulk.
- This is described in
- .Xr ports 7 .
- .Ss 8. Create boot and installation disk images
- The disk images
- .No install${ Ns Va VERSION Ns }.fs
- and
- .No install${ Ns Va VERSION Ns }.iso
- are suitable for installs without network connectivity.
- They contain the tarballs and ports built in the previous steps.
- .Bd -literal -offset indent
- # export RELDIR=your-releasedir RELXDIR=your-xenocara-releasedir
- # cd /usr/src/distrib/$(machine)/iso && make
- # make install
- .Ed
- .Pp
- The two installer images are now stored in the local release
- directory.
- .Sh SEE ALSO
- .Xr cvs 1 ,
- .Xr pkg_add 1 ,
- .Xr mk.conf 5 ,
- .Xr ports 7 ,
- .Xr sysmerge 8
- .Sh HISTORY
- This document first appeared in
- .Ox 2.8 .
|