Building ravynOS

From ravynOS
Jump to navigation Jump to search

We build ravynOS using the services of Cirrus CI, but while hacking on pieces you will need to build parts or all of the system locally. First, please see the DevSetup and SystemLayout pages. ravynOS is self-hosting and needs to be built on itself, so make sure you have an installed and running system. This page is just a guide - please see the .cirrus.yml file for more details of the build commands.

Preparing to build[edit | edit source]

The output of the build goes to /usr/obj/source path/machine architecture - e.g. /usr/obj/Users/you/ravyn/amd64.amd64. If you don't want to build as root, you need to create the path ahead of time or give yourself ownership of /usr/obj with chown.

Building the kernel[edit | edit source]

Kernel source lives mainly in sys/ and can be built by doing make -jX buildkernel where X is the number of CPUs you can devote to the build. Append WITHOUT_CLEAN=1 to the buildkernel command if you want to do incremental builds. You can install your kernel and modules with make installkernel.

Building the 'world'[edit | edit source]

The 'world' is the FreeBSD user parts including C library, compiler toolchain, commands, etc as well as ravynOS additions like launchd, libxpc, libdispatch, and so on. You can build this monster by running make -jX buildworld MK_LIB32=no. Append WITHOUT_CLEAN=1 to the buildworld command to do incremental builds, which are much faster. Install it over your running system with make installworld MK_LIB32=no

Packaging the kernel and world[edit | edit source]

After building kernel and world, you can run make -C release packagesystem MK_LIB32=no COMPILER_TYPE=clang KERNCONF=RAVYN to create base.txz and kernel.txz, which are needed to build the ISO. These will end up in /usr/obj/source path/machine architecture/release/.

Building the extra packages[edit | edit source]

A big chunk of the system packages are built from the FreeBSD ports tree. See the [[1]] repository for details how to build this phase.

Building the Frameworks and Desktop[edit | edit source]

The "upper layers" of ravynOS consist of the Cocoa and Core frameworks, additional tools, Dock, Filer (file manager), menu applets, and so on. This part has not been integrated into the 'world' build yet and can be built with make -f Makefile.ravynOS and installed over the running system with make -f Makefile.ravynOS installravynos or packaged for the ISO with make -f Makefile.ravynOS airyx-package. The output will be in dist/ravynOS.txz.

Making the ISO image[edit | edit source]

The Live CD can be made by running the commands below as root:

cd ravynos/

ln -sf /usr/bin/bash /bin/bash

cp -fv version.txt ISO/overlays/ramdisk/version

export RAVYNOS=$(pwd)

export RAVYNOS_VERSION=$(head -1 ./version.txt)

cd ISO; ./ ravyn ravynOS_${RAVYNOS_VERSION}

The build uses files in /usr/local/furybsd/$(uname -m)/cache/${RAVYN_VERSION}/base and /usr/local/furybsd/$(uname -m)/cache/packages. It will download missing files from the Ravyn repository and CI servers by default. If you want to build an ISO with your local changes, overwrite the required files with the output of your local builds above, then run the ISO build commands.