2013-04-29 10:31:38 -04:00
---
2015-04-10 16:17:45 -04:00
layout: doc
2015-10-13 23:31:03 -04:00
title: Building Archlinux Template
2015-10-28 18:14:40 -04:00
permalink: /doc/building-archlinux-template/
2015-10-11 03:04:59 -04:00
redirect_from:
2015-10-28 18:14:40 -04:00
- /en/doc/building-archlinux-template/
2015-10-11 03:04:59 -04:00
- /doc/BuildingArchlinuxTemplate/
- /wiki/BuildingArchlinuxTemplate/
2013-04-29 10:31:38 -04:00
---
2020-01-18 13:35:56 -05:00
Archlinux template building instructions
===========================================
2013-04-29 10:31:38 -04:00
2020-01-18 13:35:56 -05:00
**These are the instructions for Qubes 4.0. They will take you step by step through the entire process start to finish**
2013-04-29 10:31:38 -04:00
2020-01-18 13:35:56 -05:00
1: Create and configure a qube for template building
------------------------------------------------------------
* The qube should be based on a Fedora template. I named the qube
2020-01-28 16:29:06 -05:00
`build-archlinux2` , based on the minimal Fedora template.
2020-01-18 13:35:56 -05:00
![arch-template-01 ](/attachment/wiki/ArchlinuxTemplate/arch-template-01.png )
2013-04-29 10:31:38 -04:00
2020-01-18 13:35:56 -05:00
* Ensure there is at least 15GB of free space in the private storage.
2013-04-29 10:31:38 -04:00
2017-01-23 14:57:57 -05:00
![arch-template-02 ](/attachment/wiki/ArchlinuxTemplate/arch-template-02.png )
2013-04-29 10:31:38 -04:00
2015-11-24 09:51:38 -05:00
2020-01-18 13:35:56 -05:00
2: Create GitHub Account (optional)
-------------------------------------------
2017-01-23 14:57:57 -05:00
* It can be helpful. Creating only a basic account is all that is needed. This will allow you to help, going forward, with the Qubes project. You could be help edit errors in documentation. It can also be of use building other templates.
* Create user account here https://github.com
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
![arch-template-03 ](/attachment/wiki/ArchlinuxTemplate/arch-template-03.png )
2013-04-29 10:38:45 -04:00
2020-01-28 16:29:06 -05:00
3: Install necessary packages to `build-archlinux2` qube for "Qubes Automated Build System"
2020-01-18 13:35:56 -05:00
-----------------------------------------------------------------------------------------------
```shell_session
# dnf install git make
```
2013-04-29 10:31:38 -04:00
2020-01-18 13:35:56 -05:00
4: Downloading and verifying the integrity of the "Qubes Automated Build System"
---------------------------------------------------------------------------------
2017-04-28 05:37:15 -04:00
* Import the Qubes master key
2020-01-18 13:35:56 -05:00
```shell_session
$ gpg --import /usr/share/qubes/qubes-master-key.asc
```
2018-02-03 15:51:06 -05:00
* Verify its fingerprint, set as 'trusted'. [This is described here ](/doc/VerifyingSignatures ).
2020-01-28 13:01:43 -05:00
* Download the Qubes developers' keys.
```shell_session
$ wget https://keys.qubes-os.org/keys/qubes-developers-keys.asc
$ gpg --import qubes-developers-keys.asc
```
2017-04-28 05:13:12 -04:00
* Download the latest stable qubes-builder repository:
2020-01-18 13:35:56 -05:00
```shell_session
2020-02-04 09:00:56 -05:00
$ git clone https://github.com/QubesOS/qubes-builder.git /home/user/qubes-builder/
2020-01-18 13:35:56 -05:00
```
2017-04-28 05:13:12 -04:00
* Verify the integrity of the downloaded repository. The last line should read `gpg: Good signature from` ...
2020-01-18 13:35:56 -05:00
```shell_session
2020-02-04 09:00:56 -05:00
$ cd /home/user/qubes-builder/
2020-01-18 13:35:56 -05:00
$ git tag -v $(git describe)
```
* Install the remaining dependencies
```shell_session
$ make install-deps
```
2017-04-28 05:13:12 -04:00
2020-01-18 13:35:56 -05:00
5: Run the 'setup' script to build the builder.conf file
-------------------------------------------------------------
2017-04-28 05:37:15 -04:00
2020-01-18 13:35:56 -05:00
( The manual way would be to copy an example config like '**/home/user/qubes-builder/example-configs/qubes-os-r4.0.conf**' to '**/home/user/qubes-builder/builder.conf**' and edit the file )
* Run the 'setup' script located in '**/home/user/qubes-builder/**' Make sure you are in directory '**qubes-builder**'
```shell_session
$ cd /home/user/qubes-builder/
$ ./setup
```
![arch-template-04 ](/attachment/wiki/ArchlinuxTemplate/arch-template-04.png )
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
* Install the missing dependencies
2017-04-28 05:37:15 -04:00
2020-01-18 13:35:56 -05:00
![arch-template-05 ](/attachment/wiki/ArchlinuxTemplate/arch-template-05.png )
2017-04-28 05:37:15 -04:00
2020-01-18 13:35:56 -05:00
* First screen will ask you to import 'Qubes-Master-Signing-key.asc'. The 'setup' script not only downloads but confirms the key to that of the key on Qubes-OS website.
* Select '**YES**'
* Select '**OK**' Press '**Enter**'
2017-01-23 14:57:57 -05:00
![arch-template-06 ](/attachment/wiki/ArchlinuxTemplate/arch-template-06.png )
2020-01-18 13:35:56 -05:00
* Next screen will ask you to import Marek Marczykowski-Goracki (Qubes OS signing key). Again 'setup' will confirm this key to the fingerprint.
* Select '**YES**'
* Select '**OK**' Press '**Enter**'
![arch-template-07 ](/attachment/wiki/ArchlinuxTemplate/arch-template-07.png )
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
* This screen will give you the choice of which Qubes Release to build the template for.
* Select '**Qubes Release 4.0**'
* Select '**OK**' Press '**Enter**'
![arch-template-08 ](/attachment/wiki/ArchlinuxTemplate/arch-template-08.png )
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
* Screen "**Choose Repos To Use To Build Packages**"
* Select 'QubesOS/qubes- Stable - Default Repo'
* Select '**OK**' Press '**Enter**'
2017-01-23 14:57:57 -05:00
![arch-template-09 ](/attachment/wiki/ArchlinuxTemplate/arch-template-09.png )
2020-01-18 13:35:56 -05:00
* Screen "**Git Clone Faster**"
* Select '**OK**' Press '**Enter**'
2017-04-28 05:37:15 -04:00
2017-01-23 14:57:57 -05:00
![arch-template-10 ](/attachment/wiki/ArchlinuxTemplate/arch-template-10.png )
2020-01-18 13:35:56 -05:00
* Screen '**Choose Pre-Build Packages Repositories**'
* Select nothing, Press '**Enter**'
2017-01-23 14:57:57 -05:00
![arch-template-11 ](/attachment/wiki/ArchlinuxTemplate/arch-template-11.png )
2020-01-18 13:35:56 -05:00
* Screen "**Build Template Only?**"
* Select '**Yes**' Press '**Enter**'
2017-01-23 14:57:57 -05:00
![arch-template-12 ](/attachment/wiki/ArchlinuxTemplate/arch-template-12.png )
2017-04-28 05:37:15 -04:00
2020-01-18 13:35:56 -05:00
* Screen '**Template Distribution Selection**' will give choices of distributions to build
* Deselect everything
* Select '**archlinux**'
2017-01-23 14:57:57 -05:00
![arch-template-13 ](/attachment/wiki/ArchlinuxTemplate/arch-template-13.png )
2017-04-28 05:37:15 -04:00
2020-01-18 13:35:56 -05:00
* Screen '**Builder Plugin Selection**' will give choices of builder plugins to use for the build.
* Deselect everything
* Select '**builder-archlinux**'
* Select '**OK**' Press **Enter**
2017-01-23 14:57:57 -05:00
![arch-template-14 ](/attachment/wiki/ArchlinuxTemplate/arch-template-14.png )
2020-01-18 13:35:56 -05:00
* Screen '**Get sources**' wants to download additional packages needed for the choosen plugin/s.
* Select '**Yes**' Press '**Enter**'
![arch-template-15 ](/attachment/wiki/ArchlinuxTemplate/arch-template-15.png )
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
* Then wait for download to finish and press '**OK**'
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
6: Get all the require sources for the build
-----------------------------------------------
```shell_session
$ make get-sources
```
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
7: Make all the require Qubes Components
------------------------------------------------
2017-01-23 14:57:57 -05:00
* **Note:** You can run a single command to build all the Qubes components or you can run them each individually.
Both ways below:
2020-01-18 13:35:56 -05:00
* Single command to build all Qubes components together: (this command can take a long time to process depending of your pc proccessing power)
```shell_session
$ make qubes-vm
```
* These are the indivual component 'make' commands:
```shell_session
$ make vmm-xen-vm
$ make core-vchan-xen-vm
$ make core-qubesdb-vm
$ make linux-utils-vm
$ make core-agent-linux-vm
$ make gui-common-vm
$ make gui-agent-linux-vm
2020-04-12 19:59:47 -04:00
$ make app-linux-split-gpg-vm
2020-01-18 13:35:56 -05:00
$ make vmm-xen-vm
$ make core-vchan-xen-vm
$ make core-qubesdb-vm
$ make linux-utils-vm
$ make core-agent-linux-vm
$ make gui-common-vm
$ make gui-agent-linux-vm
2020-04-12 19:59:47 -04:00
$ make app-linux-split-gpg-vm
2020-01-18 13:35:56 -05:00
```
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
8: Make the actual Archlinux template
----------------------------------------
```shell_session
$ make template
```
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
9: Transfer Template into Dom0
----------------------------------
2017-04-28 05:37:15 -04:00
* You need to ensure these two files are in the '**noarch**' directory
2020-01-18 13:35:56 -05:00
```shell_session
$ cd /home/user/qubes-builder/qubes-src/linux-template-builder/rpm/
$ ls
install-templates.sh
$ cd noarch
$ ls
qubes-template-archlinux-X.X.X-XXXXXXXXXXXX.noarch.rpm
```
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
![arch-template-16 ](/attachment/wiki/ArchlinuxTemplate/arch-template-16.png )
2017-01-23 14:57:57 -05:00
* **Transfer the install-templates.sh script file into Dom0**
*Note: as there is not a typical file transfer method for Dom0, for security reasons, this less than simple transfer function has to be used*
2020-01-18 13:35:56 -05:00
* Switch to Dom0 and open a terminal window.
```shell_session
$ qvm-run --pass-io build-archlinux2 'cat /home/user/qubes-builder/qubes-src/linux-template-builder/rpm/install-templates.sh' > install-templates.sh
$ chmod +x install-templates.sh
$ ./install-templates.sh
```
2020-01-24 10:45:04 -05:00
* If everything went correct there should be a Archlinux template listed in your Qubes Manager
2017-01-23 14:57:57 -05:00
2020-01-18 13:35:56 -05:00
Debugging the build process
===============================
Archlinux use bleeding edge version of everything, so it is usually the
first template to break when new software version came out.
So an important point is to understand how to debug the template, how to fix
it, and then do a pull request :).
2020-01-24 10:45:04 -05:00
[My personal building script is here ](https://github.com/Qubes-Community/Contents/blob/master/code/OS-administration/build-archlinux.sh ).
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
The most important part about this script is where to add custom code that is not in the QubesOS repositories
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
After the command:
```shell_session
$ make get-sources
```
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
And before the command:
```shell_session
$ make qubes-vm
```
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
you can put your custom code by replacing the qubes-src/ directories.
For example:
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
```shell_session
$ rm -Rf "$directory/qubes-src/gui-agent-linux/"
$ cp -R ~/qubes-gui-agent-linux "$directory/qubes-src/gui-agent-linux"
```
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
Example
-----------------------
2014-02-11 04:37:37 -05:00
2020-01-18 13:35:56 -05:00
Launch the build
```shell_session
$ ./build_arch.sh
2017-02-03 05:58:56 -05:00
```
2020-01-18 13:35:56 -05:00
It crash
~~~~
Makefile:202: target 'builder-archlinux.get-sources' given more than once in the same rule
Makefile:204: target 'builder-archlinux.get-sources-extra' given more than once in the same rule
Makefile:225: target 'builder-archlinux-vm' given more than once in the same rule
Makefile:237: target 'builder-archlinux-dom0' given more than once in the same rule
Makefile:585: target 'builder-archlinux.grep' given more than once in the same rule
-> Building template archlinux (logfile: build-logs/template-archlinux.log)...
make: ** * [Makefile:319: template-local-archlinux+minimal] Error 1
~~~~
Let's check '**build-logs/template-archlinux.log**'
~~~~
--> Finishing installation of qubes packages...
resolving dependencies...
warning: cannot resolve "xorg-server< 1.20.7 " , a dependency of " qubes-vm-gui "
:: The following package cannot be upgraded due to unresolvable dependencies:
qubes-vm-gui
:: Do you want to skip the above package for this upgrade? [y/N] error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'xorg-server< 1.20.7 ' required by qubes-vm-gui
make[1]: ** * [Makefile:64: rootimg-build] Error 1
~~~~
The xorg-server package was probably updated to a version greater than 1.20.7.
Let's search what is the current version of xorg-server... Currently, it is
**1.20.7-1**.
2020-01-28 16:41:29 -05:00
Nor a fix nor a minor version change is likely to break things.
2020-01-18 13:35:56 -05:00
So let's find the dependency for "**xorg-server< 1.20.7 * * " and change it to
"**xorg-server< 1.21 * * " .
```shell_session
$ rg -iuu "xorg-server< 1.20.7 " . / qubes-builder / qubes-src / 2 > /dev/null
./qubes-builder/qubes-src/gui-agent-linux/archlinux/PKGBUILD
55: 'xorg-server>=1.20.4' 'xorg-server< 1.20.7 '
2017-02-03 05:58:56 -05:00
```
2020-01-18 13:35:56 -05:00
So we need to modify the file ** /archlinux/PKGBUILD** of the repository
"qubes-gui-agent-linux".
Let's clone "qubes-gui-agent-linux", be sure to checkout the correct
2020-01-28 16:29:06 -05:00
branch (example: `release4.0` instead of master ), and then edit the ** /archlinux/PKGBUILD**
2020-01-18 13:35:56 -05:00
to do the modification you want to try.
In your building script, right before the "make qubes-vm", remove the existing
"gui-agent-linux" folder, and replace it with your own.
2020-01-28 16:29:06 -05:00
Example, add this to the script
2020-01-18 13:35:56 -05:00
```shell_session
$ rm -Rf "~/qubes-builder/qubes-src/gui-agent-linux/"
$ cp -R ~/qubes-gui-agent-linux "~/qubes-builder/qubes-src/gui-agent-linux"
2017-02-03 05:58:56 -05:00
```
2020-01-18 13:35:56 -05:00
and retry to build the template.
If it build successfully and that the template work as expected, do a pull request on github to share your fix.
Debugging the qube runtime
================================================================
If you are able to launch a terminal and execute command, just use your usual
archlinux-fu to fix the issue.
If you are not able to launch a terminal, then, shutdown the qube, create a new
DisposableVM, [mount the Archlinux disk in the DisposableVM ](/doc/mount-lvm-image/ ), chroot to it, and then use
your archlinux-fu.
Below, and example of this kind of debugging [that happened on
reddit](https://old.reddit.com/r/Qubes/comments/eg50ne/built_arch_linux_template_and_installed_but_app/):
Question
------------------------------
Hello.
I just built archlinux template and moved to dom0 and installed the template.
2020-01-28 16:29:06 -05:00
Then I tried to open a terminal in archlinux TemplateVM, but it shows nothing.
2020-01-18 13:35:56 -05:00
Can you please check this logs and please tell me what is wrong. Thanks
I searched the word 'Failed" and found few.
~~~~
[0m] Failed to start..... Initialize and mount /rw and /home.... see 'systemctl status qubes-mount-dirs.service' for details
[0m] Failed unmounting.... /usr/lib/modules....
... msg='unit=qubes-mount-dirs comm="systemd" exe="/usr/lib/systemd/systemd" hostname=" addr=? terminal=? res=failed'
tsc: Fast TSC calibration failed
failed to mount moving /dev to /sysroot/dev: Invalid argument
failed to mount moving /proc to /sysroot/dev: Invalid argument
failed to mount moving /sys to /sysroot/dev: Invalid argument
failed to mount moving /run to /sysroot/dev: Invalid argument
when I tried to run terminal, in log says
audit: type=1131 audit(some number): pid=1 uid=0 auid=some number ses=some number msg='unit=systemd=tmpfiles-clean cmm="systemd" exe="/usr/lib/systemd" hostname=? addr=? terminal? res=success'
~~~~
how can I debug this qube?
Answer
---------
I tried to rebuild archlinux and got the same issue.
The issue come from a systemd unit named "qubes-mount-dirs". We want to know more about that. We can't execute command into the qube, so let's shut it down.
Then, we mount the archlinux root disk into a DisposableVM (
[mount_lvm_image.sh ](https://github.com/Qubes-Community/Contents/blob/master/code/OS-administration/mount_lvm_image.sh )
2020-12-07 20:04:29 -05:00
& [mount-lvm-image ](/doc/mount-lvm-image/ ) )
2020-01-18 13:35:56 -05:00
```shell_session
$ ./mount_lvm_image.sh /dev/qubes_dom0/vm-archlinux-minimal-root fedora-dvm
2017-02-03 05:58:56 -05:00
```
2020-01-18 13:35:56 -05:00
then in the newly created DisposableVM we mount the disk and chroot to it
```shell_session
# mount /dev/xvdi3 /mnt
# chroot /mnt
```
Then check the journal:
~~~~
[root@disp9786 /]# journalctl -u qubes-mount-dirs
-- Logs begin at Fri 2019-12-27 09:26:15 CET, end at Fri 2019-12-27 09:27:58 CET. --
Dec 27 09:26:16 archlinux systemd[1]: Starting Initialize and mount /rw and /home...
Dec 27 09:26:16 archlinux mount-dirs.sh[420]: /usr/lib/qubes/init/setup-rwdev.sh: line 16: cmp: command not found
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: Private device management: checking /dev/xvdb
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: Private device management: fsck.ext4 /dev/xvdb failed:
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: fsck.ext4: Bad magic number in super-block while trying to open /dev/xvdb
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: /dev/xvdb:
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: The superblock could not be read or does not describe a valid ext2/ext3/ext4
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: filesystem. If the device is valid and it really contains an ext2/ext3/ext4
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: filesystem (and not swap or ufs or something else), then the superblock
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: is corrupt, and you might try running e2fsck with an alternate superblock:
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: e2fsck -b 8193 < device >
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: or
Dec 27 09:26:16 archlinux mount-dirs.sh[414]: e2fsck -b 32768 < device >
Dec 27 09:26:16 archlinux mount-dirs.sh[430]: mount: /rw: wrong fs type, bad option, bad superblock on /dev/xvdb, missing codepage or helper program, or other error.
Dec 27 09:26:16 archlinux systemd[1]: qubes-mount-dirs.service: Main process exited, code=exited, status=32/n/a
Dec 27 09:26:16 archlinux systemd[1]: qubes-mount-dirs.service: Failed with result 'exit-code'.
Dec 27 09:26:16 archlinux systemd[1]: Failed to start Initialize and mount /rw and /home.
-- Reboot --
Dec 27 09:26:54 archlinux mount-dirs.sh[423]: /usr/lib/qubes/init/setup-rwdev.sh: line 16: cmp: command not found
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: Private device management: checking /dev/xvdb
Dec 27 09:26:54 archlinux systemd[1]: Starting Initialize and mount /rw and /home...
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: Private device management: fsck.ext4 /dev/xvdb failed:
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: fsck.ext4: Bad magic number in super-block while trying to open /dev/xvdb
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: /dev/xvdb:
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: The superblock could not be read or does not describe a valid ext2/ext3/ext4
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: filesystem. If the device is valid and it really contains an ext2/ext3/ext4
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: filesystem (and not swap or ufs or something else), then the superblock
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: is corrupt, and you might try running e2fsck with an alternate superblock:
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: e2fsck -b 8193 < device >
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: or
Dec 27 09:26:54 archlinux mount-dirs.sh[416]: e2fsck -b 32768 < device >
Dec 27 09:26:54 archlinux mount-dirs.sh[432]: mount: /rw: wrong fs type, bad option, bad superblock on /dev/xvdb, missing codepage or helper program, or other error.
Dec 27 09:26:54 archlinux systemd[1]: qubes-mount-dirs.service: Main process exited, code=exited, status=32/n/a
Dec 27 09:26:54 archlinux systemd[1]: qubes-mount-dirs.service: Failed with result 'exit-code'.
Dec 27 09:26:54 archlinux systemd[1]: Failed to start Initialize and mount /rw and /home.
~~~~
The most important line we saw is:
~~~~
/usr/lib/qubes/init/setup-rwdev.sh: line 16: cmp: command not found
~~~~
2020-01-28 16:29:06 -05:00
Let's check `setup-rwdev.sh` :
2020-01-18 13:35:56 -05:00
~~~~
[root@disp9786 /]# cat /usr/lib/qubes/init/setup-rwdev.sh
#!/bin/sh
set -e
dev=/dev/xvdb
max_size=1073741824 # check at most 1 GiB
if [ -e "$dev" ] ; then
# The private /dev/xvdb device is present.
# check if private.img (xvdb) is empty - all zeros
private_size=$(( $(blockdev --getsz "$dev") * 512))
if [ $private_size -gt $max_size ]; then
private_size=$max_size
fi
if cmp --bytes $private_size "$dev" /dev/zero >/dev/null & & { blkid -p "$dev" >/dev/null; [ $? -eq 2 ]; }; then
# the device is empty, create filesystem
echo "Virgin boot of the VM: creating private.img filesystem on $dev" >& 2
if ! content=$(mkfs.ext4 -m 0 -q "$dev" 2>& 1) ; then
echo "Virgin boot of the VM: creation of private.img on $dev failed:" >& 2
echo "$content" >& 2
echo "Virgin boot of the VM: aborting" >& 2
exit 1
fi
#.................
~~~~
2020-01-28 16:29:06 -05:00
That is definitely something that we want to be working. So the binary `cmp` is missing, let's find it:
2020-01-18 13:35:56 -05:00
```shell_session
# pacman -Fy cmp
2017-02-03 05:58:56 -05:00
```
2020-01-28 16:29:06 -05:00
It is in `core/diffutils` , that, for some unknown reason, is not installed.
Let's modify the archlinux template builder to add this package. Modify the files `qubes-builder/qubes-src/builder-archlinux/script/packages` to add the `diffutils` , and rebuild the template.
Why this package was not installed in the first place? I am unsure. It could be that it was a dependency of the package `xf86dgaproto` that was removed few days ago, but I don't have the PKGBUILD of this package since it was deleted, so can't confirm. It can be something else too.
2020-01-18 13:35:56 -05:00
I rebuild the template with those modification, and it is working as expected.
2020-01-28 16:41:29 -05:00
I will send a pull request. Does someone have a better idea on "Why `diffutils` was not installed in the first place?" ?
2020-01-28 16:29:06 -05:00
[The commit ](https://github.com/neowutran/qubes-builder-archlinux/commit/09a435fcc6bdcb19144d198ea20f7a27826c1d80 )
2020-01-18 13:35:56 -05:00
Creating a archlinux repository
===========================
Once the template have been build, you could use the generated archlinux packages to create your own archlinux repository for QubesOS packages.
You need to:
* Sign the packages with your GPG key
* Host the packages on your HTTP server
I will assume that you already have a working http server.
So you need to sign the packages and transmit everything to the qubes that will upload them to your http server.
2020-01-28 16:29:06 -05:00
The script `update-remote-repo.sh` of the qubes-builder-archlinux repository can do that.
2020-01-18 13:35:56 -05:00
Below, an example of code that sign the packages + template rpm file, and transmit everything to another qube.
```bash
$directory/qubes-src/builder-archlinux/update-remote-repo.sh
rpmfile=$(ls -1 $directory/qubes-src/linux-template-builder/rpm/noarch/*.rpm | head -n 1)
qubes-gpg-client-wrapper --detach-sign $rpmfile > $rpmfile.sig
qvm-copy $rpmfile
qvm-copy $rpmfile.sig
qvm-copy $directory/qubes-packages-mirror-repo/vm-archlinux/pkgs/
2017-02-03 05:58:56 -05:00
```
2013-04-29 10:38:45 -04:00
2020-01-18 13:35:56 -05:00
Upload everything to your http server, and you are good.
2020-01-28 16:29:06 -05:00
You can now modify the file `/etc/pacman.d/99-qubes-repository-4.0.conf` in your archlinux template to use your repository.
Example of content for this file (replace the server URL with your own):
2013-04-29 10:31:38 -04:00
2017-02-03 05:58:56 -05:00
```
2020-01-18 13:35:56 -05:00
[qubes]
Server = https://neowutran.ovh/qubes/vm-archlinux/pkgs
2017-02-03 05:58:56 -05:00
```
2013-04-29 10:31:38 -04:00
2020-02-16 05:22:59 -05:00
About the package `qubes-vm-keyring`
=====================================
2020-02-16 05:47:12 -05:00
The goal of this package was to add a `pacman` source for the Qubes OS packages, and to set the maintainer gpg key as trusted.
2020-02-16 05:22:59 -05:00
Currently, no one want to provide binary packages.
2017-02-03 06:00:10 -05:00
2020-02-16 05:22:59 -05:00
**So this package is currently useless.**
2020-02-16 05:47:12 -05:00
If in the future, enough people think it is better to restart providing binary packages instead of the current "Do It Yourself" way, the gpg key and fingerprint of the new maintainer should be added in the files below:
2020-02-16 05:22:59 -05:00
* https://github.com/QubesOS/qubes-core-agent-linux/blob/master/archlinux/PKGBUILD-keyring-keys
* https://github.com/QubesOS/qubes-core-agent-linux/blob/master/archlinux/archlinux/PKGBUILD-keyring-trusted