mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-10-13 11:00:42 -04:00
Merge branch 'rst' into toki_fix_findings
This commit is contained in:
commit
cad541c3af
115 changed files with 1960 additions and 1862 deletions
|
@ -17,7 +17,7 @@ The best way to write and contribute code is to create a git repo somewhere (e.g
|
|||
|
||||
**Example:**
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ cd qubes-builder/artifacts/sources/qubes-manager
|
||||
$ git remote add abel git@GitHub.com:abeluck/qubes-manager.git
|
||||
|
@ -38,22 +38,17 @@ Prepare fresh version of kernel sources, with Qubes-specific patches applied
|
|||
|
||||
In ``qubes-builder/artifacts/sources/linux-kernel``:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make prep
|
||||
$ make prep
|
||||
|
||||
|
||||
|
||||
The resulting tree will be in kernel-<VERSION>/linux-<VERSION>:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
ls -ltrd kernel*/linux*
|
||||
|
||||
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ ls -ltrd kernel*/linux*
|
||||
drwxr-xr-x 23 user user 4096 Nov 5 09:50 kernel-3.4.18/linux-3.4.18
|
||||
drwxr-xr-x 6 user user 4096 Nov 21 20:48 kernel-3.4.18/linux-obj
|
||||
|
||||
|
@ -65,9 +60,9 @@ Go to the kernel tree and update the version
|
|||
|
||||
In ``qubes-builder/artifacts/sources/linux-kernel``:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
cd kernel-3.4.18/linux-3.4.18
|
||||
$ cd kernel-3.4.18/linux-3.4.18
|
||||
|
||||
|
||||
|
||||
|
@ -77,26 +72,26 @@ Changing the config
|
|||
|
||||
In ``kernel-3.4.18/linux-3.4.18``:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
cp ../../config .config
|
||||
make oldconfig
|
||||
$ cp ../../config .config
|
||||
$ make oldconfig
|
||||
|
||||
|
||||
|
||||
Now change the configuration. For example, in ``kernel-3.4.18/linux-3.4.18``:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make menuconfig
|
||||
$ make menuconfig
|
||||
|
||||
|
||||
|
||||
Copy the modified config back into the kernel tree:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
cp .config ../../../config
|
||||
$ cp .config ../../../config
|
||||
|
||||
|
||||
|
||||
|
@ -106,22 +101,22 @@ Patching the code
|
|||
|
||||
TODO: describe the workflow for patching the code, below are some random notes, not working well
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
ln -s ../../patches.xen
|
||||
export QUILT_PATCHES=patches.xen
|
||||
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
|
||||
export QUILT_SERIES=../../series-pvops.conf
|
||||
|
||||
quilt new patches.xen/pvops-3.4-0101-usb-xen-pvusb-driver-bugfix.patch
|
||||
quilt add drivers/usb/host/Kconfig drivers/usb/host/Makefile \
|
||||
$ ln -s ../../patches.xen
|
||||
$ export QUILT_PATCHES=patches.xen
|
||||
$ export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
|
||||
$ export QUILT_SERIES=../../series-pvops.conf
|
||||
|
||||
$ quilt new patches.xen/pvops-3.4-0101-usb-xen-pvusb-driver-bugfix.patch
|
||||
$ quilt add drivers/usb/host/Kconfig drivers/usb/host/Makefile \
|
||||
drivers/usb/host/xen-usbback/* drivers/usb/host/xen-usbfront.c \
|
||||
include/xen/interface/io/usbif.h
|
||||
|
||||
|
||||
*edit something*
|
||||
|
||||
quilt refresh
|
||||
cd ../..
|
||||
|
||||
$ quilt refresh
|
||||
$ cd ../..
|
||||
vi series.conf
|
||||
|
||||
|
||||
|
@ -136,9 +131,9 @@ You might want to take a moment here to review (git diff, git status), commit yo
|
|||
|
||||
To actually build RPMs, in qubes-builder:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
./qb -c linux-kernel package fetch prep build
|
||||
$ ./qb -c linux-kernel package fetch prep build
|
||||
|
||||
|
||||
|
||||
|
@ -177,14 +172,14 @@ TODO: edit this script to be more generic
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
|
||||
QUBES_PY_DIR=/usr/lib64/python2.6/site-packages/qubes
|
||||
QUBES_PY=$QUBES_PY_DIR/qubes.py
|
||||
QUBESUTILS_PY=$QUBES_PY_DIR/qubesutils.py
|
||||
|
||||
|
||||
qvm-run -p qubes-devel 'cd qubes-builder/qubes-src/core/dom0; tar c qmemman/qmemman*.py qvm-core/*.py qvm-tools/* misc/vm-template-hvm.conf misc/qubes-start.desktop ../misc/block-snapshot aux-tools ../qrexec' |tar xv
|
||||
cp $QUBES_PY qubes.py.bak$$
|
||||
cp $QUBESUTILS_PY qubesutils.py.bak$$
|
||||
|
@ -210,7 +205,7 @@ TODO: make it more generic
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
BAK=qvm-tools.bak$$
|
||||
mkdir -p $BAK
|
||||
cp -a /usr/bin/qvm-* /usr/bin/qubes-* $BAK/
|
||||
|
@ -231,7 +226,7 @@ Copy from dom0 to an appvm
|
|||
domain=$1
|
||||
file=$2
|
||||
fname=`basename $file`
|
||||
|
||||
|
||||
qvm-run $domain 'mkdir /home/user/incoming/dom0 -p'
|
||||
cat $file| qvm-run --pass-io $domain "cat > /home/user/incoming/dom0/$fname"
|
||||
|
||||
|
@ -250,9 +245,9 @@ Service file (save in ``/usr/local/etc/qubes-rpc/local.Git`` in target VM):
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
exec 2>/tmp/log2
|
||||
|
||||
|
||||
read service rel repo
|
||||
echo "Params: $service $rel $repo" >&2
|
||||
# Adjust regexps if needed
|
||||
|
@ -279,9 +274,9 @@ Client script (save in ``~/bin/git-qrexec`` in source VM):
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
VMNAME=$1
|
||||
|
||||
|
||||
(echo $GIT_EXT_SERVICE $2 $3; exec cat) | qrexec-client-vm $VMNAME local.Git
|
||||
|
||||
|
||||
|
@ -290,7 +285,7 @@ You will also need to setup qrexec policy in dom0 (``/etc/qubes-rpc/policy/local
|
|||
|
||||
Usage:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: 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
|
||||
|
@ -302,14 +297,14 @@ You can create ``~/bin/add-remote`` script to ease adding remotes:
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
[ -n "$1" ] || exit 1
|
||||
|
||||
|
||||
if [ "$1" = "tb" ]; then
|
||||
git remote add $1 "ext::git-qrexec testbuilder 3 `basename $PWD`"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
git remote add $1 git@GitHub.com:$1/qubes-`basename $PWD`
|
||||
|
||||
|
||||
|
@ -333,9 +328,9 @@ In source VM, grab `linux-yum <https://GitHub.com/QubesOS/qubes-linux-yum>`__ re
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
VMNAME=repo-vm
|
||||
|
||||
|
||||
set -e
|
||||
qvm-copy-to-vm $VMNAME $1
|
||||
# remove only files, leave directory structure
|
||||
|
@ -347,7 +342,7 @@ 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:: bash
|
||||
.. code:: text
|
||||
|
||||
%_gpg_name Test packages signing key
|
||||
|
||||
|
@ -358,27 +353,27 @@ Then setup ``local.UpdateYum`` qrexec service (``/usr/local/etc/qubes-rpc/local.
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if [ -z "$QREXEC_REMOTE_DOMAIN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
real_repository=/home/user/linux-yum
|
||||
incoming=/home/user/QubesIncoming/$QREXEC_REMOTE_DOMAIN
|
||||
|
||||
|
||||
find $incoming -name '*.rpm' |xargs rpm -K |grep -iv pgp |cut -f1 -d: |xargs -r setsid -w rpm --addsign 2>&1
|
||||
|
||||
|
||||
rsync -lr --remove-source-files $incoming/ $real_repository
|
||||
cd $real_repository
|
||||
export SKIP_REPO_CHECK=1
|
||||
if [ -d $incoming/r3.1 ]; then
|
||||
./update_repo-unstable.sh r3.1
|
||||
fi
|
||||
|
||||
|
||||
if [ -d $incoming/r3.0 ]; then
|
||||
./update_repo-unstable.sh r3.0
|
||||
fi
|
||||
|
||||
|
||||
if [ -d $incoming/r2 ]; then
|
||||
./update_repo-unstable.sh r2
|
||||
fi
|
||||
|
@ -401,15 +396,15 @@ Usage: setup ``builder.conf`` in source VM to use your dummy-uploader repository
|
|||
|
||||
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:: bash
|
||||
.. code:: console
|
||||
|
||||
make COMPONENTS="core-agent-linux gui-agent-linux linux-utils" qubes update-repo-unstable
|
||||
$ 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:: bash
|
||||
.. code:: ini
|
||||
|
||||
[local-test]
|
||||
name=Test
|
||||
|
@ -440,12 +435,12 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
current_release=$1
|
||||
VMNAME=repo-vm
|
||||
|
||||
|
||||
qvm-copy-to-vm $VMNAME $1
|
||||
find $current_release -type f -name '*.deb' -delete
|
||||
rm -f $current_release/vm/db/*
|
||||
|
@ -458,13 +453,13 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if [ -z "$QREXEC_REMOTE_DOMAIN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
incoming=/home/user/QubesIncoming/$QREXEC_REMOTE_DOMAIN
|
||||
|
||||
|
||||
rsync -lr --remove-source-files $incoming/ /home/user/linux-deb/
|
||||
cd /home/user/linux-deb
|
||||
export SKIP_REPO_CHECK=1
|
||||
|
@ -473,13 +468,13 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
./update-local-repo.sh r3.1/vm $dist
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
if [ -d $incoming/r3.0 ]; then
|
||||
for dist in `ls r3.0/vm/dists`; do
|
||||
./update-local-repo.sh r3.0/vm $dist
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
if [ -d $incoming/r2 ]; then
|
||||
for dist in `ls r2/vm/dists`; do
|
||||
./update-local-repo.sh r2/vm $dist
|
||||
|
@ -495,17 +490,17 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
.. code:: bash
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
# Set this to your local repository signing key
|
||||
SIGN_KEY=01ABCDEF
|
||||
|
||||
|
||||
[ -z "$1" ] && { echo "Usage: $0 <repo> <dist>"; exit 1; }
|
||||
|
||||
|
||||
REPO_DIR=$1
|
||||
DIST=$2
|
||||
|
||||
|
||||
if [ "$DIST" = "wheezy-unstable" ]; then
|
||||
DIST_TAG=deb7
|
||||
elif [ "$DIST" = "jessie-unstable" ]; then
|
||||
|
@ -513,7 +508,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
elif [ "$DIST" = "stretch-unstable" ]; then
|
||||
DIST_TAG=deb9
|
||||
fi
|
||||
|
||||
|
||||
pushd $REPO_DIR
|
||||
mkdir -p dists/$DIST/main/binary-amd64
|
||||
dpkg-scanpackages --multiversion --arch "*$DIST_TAG*" . > dists/$DIST/main/binary-amd64/Packages
|
||||
|
@ -535,7 +530,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
echo $1
|
||||
}
|
||||
calc_sha1 main/binary-amd64/Packages >> dists/$DIST/Release
|
||||
|
||||
|
||||
rm -f $DIST/Release.gpg
|
||||
rm -f $DIST/InRelease
|
||||
gpg -abs -u "$SIGN_KEY" \
|
||||
|
@ -543,7 +538,7 @@ Steps are mostly the same as in the case of yum repo. The only details that diff
|
|||
gpg -a -s --clearsign -u "$SIGN_KEY" \
|
||||
< dists/$DIST/Release > dists/$DIST/InRelease
|
||||
popd
|
||||
|
||||
|
||||
if [ `id -u` -eq 0 ]; then
|
||||
chown -R --reference=$REPO_DIR $REPO_DIR
|
||||
fi
|
||||
|
@ -552,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:: bash
|
||||
.. code:: text
|
||||
|
||||
deb http://local-test.lan/linux-deb/r3.1 jessie-unstable main
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ This is a simple setup using a docker executor. This is a good default choice; i
|
|||
|
||||
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ sudo dnf install $(cat dependencies-fedora.txt)
|
||||
$ test -f /usr/share/qubes/marker-vm && sudo dnf install qubes-gpg-split
|
||||
|
@ -43,7 +43,7 @@ This is a simple setup using a docker executor. This is a good default choice; i
|
|||
|
||||
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ sudo apt install $(cat dependencies-debian.txt)
|
||||
$ test -f /usr/share/qubes/marker-vm && sudo apt install qubes-gpg-split
|
||||
|
@ -52,15 +52,15 @@ This is a simple setup using a docker executor. This is a good default choice; i
|
|||
|
||||
3. Clone the qubes-builder v2 repository into a location of your choice:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
git clone https://github.com/QubesOS/qubes-builderv2
|
||||
cd qubes-builderv2/
|
||||
$ git clone https://github.com/QubesOS/qubes-builderv2
|
||||
$ cd qubes-builderv2/
|
||||
|
||||
|
||||
4. If you haven’t previously used docker in the current qube, you need to set up some permissions. In particular, the user has to be added to the ``docker`` group:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ sudo usermod -aG docker user
|
||||
|
||||
|
@ -68,7 +68,7 @@ This is a simple setup using a docker executor. This is a good default choice; i
|
|||
|
||||
5. Finally, you need to generate a docker image:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ tools/generate-container-image.sh docker
|
||||
|
||||
|
@ -88,28 +88,28 @@ 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:: bash
|
||||
.. code:: yaml
|
||||
|
||||
# include configuration relevant for the current release
|
||||
include:
|
||||
- example-configs/qubes-os-r4.2.yml
|
||||
|
||||
|
||||
# which repository to use to fetch sources
|
||||
use-qubes-repo:
|
||||
version: 4.2
|
||||
testing: true
|
||||
|
||||
|
||||
# each package built will have local build number appended to package release
|
||||
# number. It makes it easier to update in testing environment
|
||||
increment-devel-versions: true
|
||||
|
||||
|
||||
# reduce output
|
||||
debug: false
|
||||
|
||||
|
||||
# this can be set to true if you do not want sources to be automatically
|
||||
# fetched from git
|
||||
skip-git-fetch: false
|
||||
|
||||
|
||||
# executor configuration
|
||||
executor:
|
||||
type: docker
|
||||
|
@ -124,7 +124,7 @@ Using Builder v2
|
|||
|
||||
To fetch sources - in this example, for the ``core-admin-client`` package, you can use the following command:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ ./qb -c core-admin-client package fetch
|
||||
|
||||
|
@ -133,21 +133,21 @@ This will fetch the sources for the listed package and place them in ``artifacts
|
|||
|
||||
To build a package (from sources in the ``artifacts/sources`` directory), use:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: 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:: bash
|
||||
.. code:: 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:: bash
|
||||
.. code:: console
|
||||
|
||||
$ ./qb package fetch
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Qubes builder
|
|||
|
||||
|
||||
.. warning::
|
||||
|
||||
|
||||
**Note:** These instructions concern the older Qubes builder (v1). It supports only building Qubes 4.2 or earlier.The build process has been completely rewritten in `qubes-builder v2 <https://github.com/QubesOS/qubes-builderv2/>`__ . This can be used for building Qubes R4.2 and later, and all related components.
|
||||
|
||||
**Note: See** :doc:`ISO building instructions </developer/building/qubes-iso-building>` **for a streamlined overview on how to use the build system.**
|
||||
|
@ -53,19 +53,25 @@ In order to use it, you should use an rpm-based distro, like Fedora :), and shou
|
|||
|
||||
Usually you can install those packages by just issuing:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
sudo dnf install gnupg git createrepo rpm-build make wget rpmdevtools python3-sh dialog rpm-sign dpkg-dev debootstrap python3-pyyaml devscripts perl-Digest-MD5 perl-Digest-SHA
|
||||
$ sudo dnf install gnupg git createrepo rpm-build make wget rpmdevtools python3-sh dialog rpm-sign dpkg-dev debootstrap python3-pyyaml devscripts perl-Digest-MD5 perl-Digest-SHA
|
||||
|
||||
|
||||
The build system creates build environments in chroots and so no other packages are needed on the host. All files created by the build system are contained within the qubes-builder directory. The full build requires some 25GB of free space, so keep that in mind when deciding where to place this directory.
|
||||
|
||||
The build system is configured via builder.conf file. You can use the setup.sh script to create and modify this file. Alternatively, you can copy the provided default builder.conf, and modify it as needed, e.g.:
|
||||
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ cp example-configs/qubes-os-master.conf builder.conf
|
||||
|
||||
|
||||
Edit the builder.conf file and set the following variables:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
cp example-configs/qubes-os-master.conf builder.conf
|
||||
# edit the builder.conf file and set the following variables:
|
||||
NO_SIGN=1
|
||||
|
||||
|
||||
|
@ -73,7 +79,7 @@ One additional useful requirement is that ‘sudo root’ must work without any
|
|||
|
||||
Additionally, if building with signing enabled (NO_SIGN is not set), you must adjust ``\~/.rpmmacros`` file so that it points to the GPG key used for package signing, e.g.:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: text
|
||||
|
||||
%_signature gpg
|
||||
%_gpg_path /home/user/.gnupg
|
||||
|
@ -84,48 +90,73 @@ It is also recommended that you use an empty passphrase for the private key used
|
|||
|
||||
So, to build Qubes you would do:
|
||||
|
||||
Import the Qubes master key:
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ gpg --recv-keys 0xDDFA1A3E36879494
|
||||
|
||||
|
||||
Verify its fingerprint, set as 'trusted'. This is described :doc:`here </project-security/verifying-signatures>`.
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ wget https://keys.qubes-os.org/keys/qubes-developers-keys.asc
|
||||
$ gpg --import qubes-developers-keys.asc
|
||||
|
||||
$ git clone https://github.com/QubesOS/qubes-builder.git qubes-builder
|
||||
$ cd qubes-builder
|
||||
|
||||
|
||||
Verify its integrity:
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ git tag -v `git describe`
|
||||
|
||||
|
||||
Copy the example ``builder.conf``:
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ cp example-configs/qubes-os-master.conf builder.conf
|
||||
|
||||
|
||||
Edit the builder.conf file and set the following variables:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
# Import the Qubes master key
|
||||
gpg --recv-keys 0xDDFA1A3E36879494
|
||||
|
||||
# Verify its fingerprint, set as 'trusted'.
|
||||
# This is described here:
|
||||
# https://www.qubes-os.org/doc/VerifyingSignatures
|
||||
|
||||
wget https://keys.qubes-os.org/keys/qubes-developers-keys.asc
|
||||
gpg --import qubes-developers-keys.asc
|
||||
|
||||
git clone https://github.com/QubesOS/qubes-builder.git qubes-builder
|
||||
cd qubes-builder
|
||||
|
||||
# Verify its integrity:
|
||||
git tag -v `git describe`
|
||||
|
||||
cp example-configs/qubes-os-master.conf builder.conf
|
||||
# edit the builder.conf file and set the following variables:
|
||||
# NO_SIGN="1"
|
||||
|
||||
# Download all components:
|
||||
|
||||
make get-sources
|
||||
|
||||
# And now to build all Qubes RPMs (this will take a few hours):
|
||||
|
||||
make qubes
|
||||
|
||||
# ... and then to build the ISO
|
||||
|
||||
make iso
|
||||
|
||||
|
||||
Download all components:
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ make get-sources
|
||||
|
||||
|
||||
And now to build all Qubes RPMs (this will take a few hours):
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ make qubes
|
||||
|
||||
|
||||
... and then to build the ISO
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ make iso
|
||||
|
||||
|
||||
And this should produce a shiny new ISO.
|
||||
|
||||
You can also build selected component separately. Eg. to compile only gui virtualization agent/daemon:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make gui-daemon
|
||||
$ make gui-daemon
|
||||
|
||||
|
||||
You can get a full list from make help.
|
||||
|
@ -152,9 +183,9 @@ You can also modify sources somehow if you wish. Here are some basic steps:
|
|||
|
||||
3. Download unmodified sources
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make get-sources
|
||||
$ make get-sources
|
||||
|
||||
|
||||
4. **Make your modifications here**
|
||||
|
@ -163,16 +194,16 @@ You can also modify sources somehow if you wish. Here are some basic steps:
|
|||
|
||||
6. ``get-sources`` is already done, so continue with the next one. You can skip ``sign-all`` if you’ve disabled signing
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make vmm-xen core-admin linux-kernel gui-daemon template desktop-linux-kde installer-qubes-os manager linux-dom0-updates
|
||||
$ make vmm-xen core-admin linux-kernel gui-daemon template desktop-linux-kde installer-qubes-os manager linux-dom0-updates
|
||||
|
||||
|
||||
7. build iso installation image
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make iso
|
||||
$ make iso
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Qubes ISO building
|
|||
|
||||
|
||||
.. warning::
|
||||
|
||||
|
||||
**Note:** These instructions concern the older Qubes builder (v1). It supports only building Qubes 4.2 or earlier.The build process has been completely rewritten in `qubes-builder v2 <https://github.com/QubesOS/qubes-builderv2/>`__ . This can be used for building Qubes R4.2 and later versions, and all related components.
|
||||
|
||||
Build Environment
|
||||
|
@ -15,16 +15,16 @@ Fedora 36 (and 37) has been successfully used to build Qubes R4.1 with the below
|
|||
|
||||
**Notes:** On modern Fedora system (like Fedora 37) SeLinux is enforced by default and is blocking the build system. You would get error like “can’t create transaction lock on /…/rpm/.rpm.lock (Permission denied)”. You can set SeLinux to permissive mode with
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
sudo setenforce 0
|
||||
$ sudo setenforce 0
|
||||
|
||||
|
||||
In ``dom0``, install the Fedora 36 (or 37) template if you don’t already have it.
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
sudo qubes-dom0-update qubes-template-fedora-36
|
||||
$ sudo qubes-dom0-update qubes-template-fedora-36
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ Create a standalone AppVM from the Fedora template. Set private storage to at le
|
|||
|
||||
Once you’ve built the development AppVM, open a Terminal window to it and install the necessary dependencies (see :doc:`QubesBuilder </developer/building/qubes-builder>` for more info):
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ sudo dnf install git createrepo rpm-build rpm-sign make python3-sh rpmdevtools rpm-sign dialog perl-open python3-pyyaml perl-Digest-MD5 perl-Digest-SHA
|
||||
|
||||
|
@ -40,17 +40,23 @@ Once you’ve built the development AppVM, open a Terminal window to it and inst
|
|||
|
||||
Get the necessary keys to verify the sources (run these and other commands below as a regular user, not root):
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ wget https://keys.qubes-os.org/keys/qubes-master-signing-key.asc
|
||||
$ gpg --import qubes-master-signing-key.asc
|
||||
$ gpg --edit-key 36879494
|
||||
$ fpr
|
||||
|
||||
.. code:: output
|
||||
|
||||
wget https://keys.qubes-os.org/keys/qubes-master-signing-key.asc
|
||||
gpg --import qubes-master-signing-key.asc
|
||||
gpg --edit-key 36879494
|
||||
fpr
|
||||
# Verify fingerprint! See Note below!
|
||||
# Once verified, set trust to *ultimate*
|
||||
# (Typical sequence is trust, 5, Y, q)
|
||||
wget https://keys.qubes-os.org/keys/qubes-developers-keys.asc
|
||||
gpg --import qubes-developers-keys.asc
|
||||
|
||||
.. code:: console
|
||||
|
||||
$ wget https://keys.qubes-os.org/keys/qubes-developers-keys.asc
|
||||
$ gpg --import qubes-developers-keys.asc
|
||||
|
||||
|
||||
|
||||
|
@ -58,11 +64,11 @@ Get the necessary keys to verify the sources (run these and other commands below
|
|||
|
||||
Now let’s bootstrap the builder. Unfortunately, the builder cannot verify itself (the classic Chicken and Egg problem), so we need to verify the signature manually:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
git clone https://github.com/QubesOS/qubes-builder.git
|
||||
cd qubes-builder
|
||||
git tag -v `git describe`
|
||||
$ git clone https://github.com/QubesOS/qubes-builder.git
|
||||
$ cd qubes-builder
|
||||
$ git tag -v `git describe`
|
||||
|
||||
|
||||
|
||||
|
@ -76,10 +82,13 @@ Build using setup script
|
|||
|
||||
Let’s configure the builder first (see :ref:`procedure <developer/building/qubes-iso-building:build using manual steps>` at bottom if you would prefer to manually configure):
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ cd ~/qubes-builder
|
||||
$ ./setup
|
||||
|
||||
.. code:: output
|
||||
|
||||
cd ~/qubes-builder
|
||||
./setup
|
||||
# Select Yes to add Qubes Master Signing Key
|
||||
# Select Yes to add Qubes OS Signing Key
|
||||
# Select 4.1 for version
|
||||
|
@ -96,9 +105,12 @@ Let’s configure the builder first (see :ref:`procedure <developer/building/qub
|
|||
|
||||
Once it completes downloading, re-run ``setup`` to add the Whonix templates:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
$ ./setup
|
||||
|
||||
.. code:: output
|
||||
|
||||
./setup
|
||||
# Choose the same options as above, except at templates select:
|
||||
# fc36, bullseye, whonix-gateway-16, whonix-workstation-16
|
||||
|
||||
|
@ -106,10 +118,10 @@ Once it completes downloading, re-run ``setup`` to add the Whonix templates:
|
|||
|
||||
Continue the build process with:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make install-deps
|
||||
make get-sources
|
||||
$ make install-deps
|
||||
$ make get-sources
|
||||
|
||||
|
||||
|
||||
|
@ -119,20 +131,20 @@ You may also want to add ``COMPONENTS := $(filter-out gcc,$(COMPONENTS))`` to by
|
|||
|
||||
Finally, if you are making a test build, use:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make qubes
|
||||
make iso
|
||||
$ make qubes
|
||||
$ make iso
|
||||
|
||||
|
||||
|
||||
Or for a fully signed build (this requires setting ``SIGN_KEY`` in ``builder.conf``):
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make qubes
|
||||
make sign-all
|
||||
make iso
|
||||
$ make qubes
|
||||
$ make sign-all
|
||||
$ make iso
|
||||
|
||||
|
||||
|
||||
|
@ -146,17 +158,17 @@ Instead of using ``./setup``, you can manually configure the build. The script t
|
|||
|
||||
If you will be building Whonix templates:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
cd ~
|
||||
gpg --keyserver pgp.mit.edu --recv-keys 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA
|
||||
gpg --fingerprint 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA
|
||||
$ cd ~
|
||||
$ gpg --keyserver pgp.mit.edu --recv-keys 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA
|
||||
$ gpg --fingerprint 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA
|
||||
|
||||
|
||||
|
||||
**Note:** It’s very important to check the fingerprint displayed against multiple sources such as the `Whonix web site <https://www.whonix.org/wiki/Whonix_Signing_Key>`__, etc. It should look something like this:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: output
|
||||
|
||||
pub rsa4096 2014-01-16 [SC] [expires: 2026-01-23]
|
||||
Key fingerprint = 916B 8D99 C38E AF5E 8ADC 7A2A 8D66 066A 2EEA CCDA
|
||||
|
@ -171,22 +183,22 @@ If you will be building Whonix templates:
|
|||
|
||||
Next, prepare the Git keyring directory and copy them in:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
export GNUPGHOME=~/qubes-builder/keyrings/git
|
||||
mkdir --parents "$GNUPGHOME"
|
||||
cp ~/.gnupg/pubring.gpg "$GNUPGHOME"
|
||||
cp ~/.gnupg/trustdb.gpg "$GNUPGHOME"
|
||||
chmod --recursive 700 "$GNUPGHOME"
|
||||
$ export GNUPGHOME=~/qubes-builder/keyrings/git
|
||||
$ mkdir --parents "$GNUPGHOME"
|
||||
$ cp ~/.gnupg/pubring.gpg "$GNUPGHOME"
|
||||
$ cp ~/.gnupg/trustdb.gpg "$GNUPGHOME"
|
||||
$ chmod --recursive 700 "$GNUPGHOME"
|
||||
|
||||
|
||||
|
||||
Copy one of the example configurations:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
cd ~/qubes-builder
|
||||
cp example-configs/qubes-os-master.conf builder.conf
|
||||
$ cd ~/qubes-builder
|
||||
$ cp example-configs/qubes-os-master.conf builder.conf
|
||||
|
||||
|
||||
|
||||
|
@ -194,11 +206,11 @@ Edit ``builder.conf``, referring to ``doc/Configuration.md`` for a description o
|
|||
|
||||
Continue the build process with:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make install-deps
|
||||
make get-sources
|
||||
unset GNUPGHOME
|
||||
$ make install-deps
|
||||
$ make get-sources
|
||||
$ unset GNUPGHOME
|
||||
|
||||
|
||||
|
||||
|
@ -206,20 +218,20 @@ When building the Whonix templates, you will often need to add/update the ``WHON
|
|||
|
||||
Finally, if you are making a test build, use:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make qubes
|
||||
make iso
|
||||
$ make qubes
|
||||
$ make iso
|
||||
|
||||
|
||||
|
||||
Or for a fully signed build (this requires setting ``SIGN_KEY`` in ``builder.conf``):
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
make qubes
|
||||
make sign-all
|
||||
make iso
|
||||
$ make qubes
|
||||
$ make sign-all
|
||||
$ make iso
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue