Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions developer/building/development-workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The best way to write and contribute code is to create a git repo somewhere (e.g

**Example:**

.. code:: console
.. code-block:: console

$ cd qubes-builder/artifacts/sources/qubes-manager
$ git remote add abel git@GitHub.com:abeluck/qubes-manager.git
Expand All @@ -38,15 +38,15 @@ Prepare fresh version of kernel sources, with Qubes-specific patches applied

In ``qubes-builder/artifacts/sources/linux-kernel``:

.. code:: console
.. code-block:: console

$ make prep



The resulting tree will be in kernel-<VERSION>/linux-<VERSION>:

.. code:: console
.. code-block:: console

$ ls -ltrd kernel*/linux*
drwxr-xr-x 23 user user 4096 Nov 5 09:50 kernel-3.4.18/linux-3.4.18
Expand All @@ -60,7 +60,7 @@ Go to the kernel tree and update the version

In ``qubes-builder/artifacts/sources/linux-kernel``:

.. code:: console
.. code-block:: console

$ cd kernel-3.4.18/linux-3.4.18

Expand All @@ -72,7 +72,7 @@ Changing the config

In ``kernel-3.4.18/linux-3.4.18``:

.. code:: console
.. code-block:: console

$ cp ../../config .config
$ make oldconfig
Expand All @@ -81,15 +81,15 @@ In ``kernel-3.4.18/linux-3.4.18``:

Now change the configuration. For example, in ``kernel-3.4.18/linux-3.4.18``:

.. code:: console
.. code-block:: console

$ make menuconfig



Copy the modified config back into the kernel tree:

.. code:: console
.. code-block:: console

$ cp .config ../../../config

Expand All @@ -101,7 +101,7 @@ Patching the code

TODO: describe the workflow for patching the code, below are some random notes, not working well

.. code:: console
.. code-block:: console

$ ln -s ../../patches.xen
$ export QUILT_PATCHES=patches.xen
Expand Down Expand Up @@ -131,7 +131,7 @@ You might want to take a moment here to review (git diff, git status), commit yo

To actually build RPMs, in qubes-builder:

.. code:: console
.. code-block:: console

$ ./qb -c linux-kernel package fetch prep build

Expand Down Expand Up @@ -169,7 +169,7 @@ Syncing dom0 files

TODO: edit this script to be more generic

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand Down Expand Up @@ -202,7 +202,7 @@ Apply qvm-tools

TODO: make it more generic

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand All @@ -217,7 +217,7 @@ Copy from dom0 to an appvm
^^^^^^^^^^^^^^^^^^^^^^^^^^


.. code:: bash
.. code-block:: bash

#/bin/sh
#
Expand All @@ -242,7 +242,7 @@ Below example assumes that you use ``builder-RX`` directory in target VM to stor

Service file (save in ``/usr/local/etc/qubes-rpc/local.Git`` in target VM):

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand Down Expand Up @@ -271,7 +271,7 @@ Service file (save in ``/usr/local/etc/qubes-rpc/local.Git`` in target VM):

Client script (save in ``~/bin/git-qrexec`` in source VM):

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand All @@ -285,7 +285,7 @@ You will also need to setup qrexec policy in dom0 (``/etc/qubes-rpc/policy/local

Usage:

.. code:: console
.. code-block:: console

[user@source core-agent-linux]$ git remote add testbuilder "ext::git-qrexec testbuilder 3 core-agent-linux"
[user@source core-agent-linux]$ git push testbuilder master
Expand All @@ -294,7 +294,7 @@ Usage:

You can create ``~/bin/add-remote`` script to ease adding remotes:

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand Down Expand Up @@ -325,7 +325,7 @@ RPM packages - yum repo

In source VM, grab `linux-yum <https://github.com/QubesOS/qubes-linux-yum>`__ repository (below is assumed you’ve made it in ``~/repo-yum-upload`` directory) and replace ``update_repo.sh`` script with:

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand All @@ -342,15 +342,15 @@ In source VM, grab `linux-yum <https://github.com/QubesOS/qubes-linux-yum>`__ re

In target VM, setup actual yum repository (also based on `linux-yum <https://github.com/QubesOS/qubes-linux-yum>`__, this time without modifications). You will also need to setup some gpg key for signing packages (it is possible to force yum to install unsigned packages, but it isn’t possible for ``qubes-dom0-update`` tool). Fill ``~/.rpmmacros`` with key description:

.. code:: text
.. code-block:: text

%_gpg_name Test packages signing key



Then setup ``local.UpdateYum`` qrexec service (``/usr/local/etc/qubes-rpc/local.UpdateYum``):

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand Down Expand Up @@ -388,23 +388,23 @@ If you want to access the repository from network, you need to setup HTTP server

Usage: setup ``builder.conf`` in source VM to use your dummy-uploader repository:

.. code:: bash
.. code-block:: bash

LINUX_REPO_BASEDIR = ../../repo-yum-upload/r3.1



Then use ``make update-repo-unstable`` to upload the packages. You can also specify selected components on command line, then build them and upload to the repository:

.. code:: console
.. code-block:: console

$ make COMPONENTS="core-agent-linux gui-agent-linux linux-utils" qubes update-repo-unstable



On the test machine, add yum repository (``/etc/yum.repos.d``) pointing at just configured HTTP server. For example:

.. code:: ini
.. code-block:: ini

[local-test]
name=Test
Expand Down Expand Up @@ -432,7 +432,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff

``update_repo.sh`` script:

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand All @@ -450,7 +450,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff

``local.UpdateApt`` service code (``/usr/local/etc/qubes-rpc/local.UpdateApt`` in repo-serving VM):

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand Down Expand Up @@ -487,7 +487,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff

``update-local-repo.sh``:

.. code:: bash
.. code-block:: bash

#!/bin/sh

Expand Down Expand Up @@ -547,7 +547,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff

Usage: add this line to ``/etc/apt/sources.list`` on test machine (adjust host and path):

.. code:: text
.. code-block:: text

deb http://local-test.lan/linux-deb/r3.1 jessie-unstable main

Expand Down
26 changes: 13 additions & 13 deletions developer/building/qubes-builder-v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is a simple setup using a docker or podman executor. This is a good default

2. Clone the qubes-builder v2 repository into a location of your choice:

.. code:: console
.. code-block:: console

$ git clone https://github.com/QubesOS/qubes-builderv2
$ cd qubes-builderv2/
Expand All @@ -31,14 +31,14 @@ This is a simple setup using a docker or podman executor. This is a good default

- for Fedora, use:

.. code:: console
.. code-block:: console

$ sudo dnf install $(cat dependencies-fedora.txt)
$ test -f /usr/share/qubes/marker-vm && sudo dnf install qubes-gpg-split

- for Debian (note: some Debian packages require Debian version 13 or later), use:

.. code:: console
.. code-block:: console

$ sudo apt install $(cat dependencies-debian.txt)
$ test -f /usr/share/qubes/marker-vm && sudo apt install qubes-gpg-split
Expand All @@ -47,7 +47,7 @@ This is a simple setup using a docker or podman executor. This is a good default

4. If you haven’t previously used docker in the current qube, you need to set up some permissions (nothing needs to be done here if you're using `podman`). In particular, the user has to be added to the ``docker`` group:

.. code:: console
.. code-block:: console

$ sudo usermod -aG docker user

Expand All @@ -57,17 +57,17 @@ This is a simple setup using a docker or podman executor. This is a good default

Depending on your choice of a container runtime, run one of:

.. code:: console
.. code-block:: console

$ tools/generate-container-image.sh docker

.. code:: console
.. code-block:: console

$ tools/generate-container-image.sh podman

If you are using ``docker`` and an app qube, as ``/var/lib/docker`` is not persistent by default, you also need to use :doc:`bind-dirs </user/advanced-topics/bind-dirs>` to avoid repeating this step after reboot, adding the following to the ``/rw/config/qubes-bind-dirs.d/docker.conf`` file in this qube:

.. code:: bash
.. code-block:: bash

binds+=( '/var/lib/docker' )

Expand All @@ -78,7 +78,7 @@ Configuration

To use Qubes OS Builder v2, you need to have a ``builder.yml`` configuration file. You can use one of the sample files from the ``example-configs/`` directory; for a more readable ``builder.yml``, you can also include one of the files from that directory in your ``builder.yml``. An example ``builder.yml`` is:

.. code:: yaml
.. code-block:: yaml

# include configuration relevant for the current release
include:
Expand Down Expand Up @@ -109,7 +109,7 @@ To use Qubes OS Builder v2, you need to have a ``builder.yml`` configuration fil
If you want use the ``podman`` executor, you have to enable socket activation, with:


.. code:: console
.. code-block:: console

# systemctl --user enable --now podman.socket

Expand All @@ -118,27 +118,27 @@ Using Builder v2

To fetch sources - in this example, for the ``core-admin-client`` package, you can use the following command:

.. code:: console
.. code-block:: console

$ ./qb -c core-admin-client package fetch

This will fetch the sources for the listed package and place them in ``artifacts/sources`` directory.

To build a package (from sources in the ``artifacts/sources`` directory), use:

.. code:: console
.. code-block:: console

$ ./qb -c core-admin-client package fetch prep build

or, if you want to build for a specific target (``host-fc37`` is a ``dom0`` using Fedora 37, ``vm-fc40`` would be a qube using Fedora 40 etc.), use:

.. code:: console
.. code-block:: console

$ ./qb -c core-admin-client -d host-fc37 package fetch prep build

If you want to fetch the entire Qubes OS source use the following:

.. code:: console
.. code-block:: console

$ ./qb package fetch

Expand Down
Loading