Building Stable Qubes ISO

Hello,

I would like to build stable version of Qubes OS 4.1 from source purely for the purpose of enabling PCI hotplug so that I can get the FN keys and keyboard backlight working on an Asus Zenbook.

My issue is that I have tried following the documentation on both the website and various QubesOS git repositories and no matter what I seem to do the build fails either during make get-sources (because of a macbook12-spi driver syntax error in both linux-kernel and linux-kernel latest repos), or if i comment the failing checksum code out. I get more failures during the make qubes part.

I noticed that most repos are having commits to main regularly which the builder.conf references even when selecting 4.1, or older.

Is there a way to build an ISO using ‘known working commits’?

Any assistance to get me going in the right direction would be hugely appreciated. :slight_smile:

I think the issue with macbook12-spi is a failure to verify the shaXXXsum for some reason (an error in a Makefile?).

I’ve tried to get Qubes-builder working a few times - and stalled because I don’t have the skills to figure out why make is unable to verify the downloads for some packages/files If I run:

sha256sum ${b}.UNTRUSTED | cut -f 1 -d ' ')
cat ${b}.sha256

then the sha256sum seems correct (same goes for sha512sum for other packages) - so I think it’s an error in a/some Makefile(s).

I did another run yesterday following these instructions step by step this time documenting the errors.

Error #1 - make get-sources

Error #1 “fix” (not really a fix at all just got me past the error)
Remove this from qubes-src/linux-kernel/Makefile and qubes-src/linux-kernel-latest/Makefile

Error #2 - make get-sources

Error #2 “fix” (not really a fix at all just got me past the error)
Change this in qubes-src/windows-tools-cross/Makefile

These two fixes let me get past the make get-sources phase.

Error #3 - make qubes

At this point I had 0% confidence in the QubesOS build process I am using and thought there is no way this can be right.

Does anyone know what I am doing wrong here?

I cant currently access pastebin, so I’m working in the dark.

If you did select 4.1, then you should see that repos are a mix of
master, 4.1, and main. not all main. Check this.
I regularly use builder for iso and new templates.
If you can summarise what the issue is, I may be able to help.

In the mean time I’m do a 4.1 run overnight and check back in the morning

The pastebin links are my outputs to the first three errors I was getting when attempting to build.

  • get-sources macbook12-spi driver syntax error in the Makefile
  • get-sources wintools timeout to an https://web.archive.org URL to grab dotNetFx40_Full_x86_x64.exe
  • make qubes u2mfn kernel module not found in an archive

I was/am indeed seeing a mix of master, 4.1, and main as you mention.

The pastes were from doing a copy of example-configs/qubes-os-r4.1.conf to builder.conf. I also gave ./setup a go but with no better success.

Thanks for taking the time to do an overnight run of your own. :slight_smile:

Did you have any luck with your overnight build @unman ?

I have tried another build this morning with the same issues. Is there anyone able to successfully build a Qubes ISO from source?

I did multiples time.
Time to time I have difficulties with builderv1.
Builderv2 seems to work more reliably from what I tested.

Hmm, I’m giving qubes-builderv2 a try now but it doesn’t seem to have 4.1 in the example-configs only 4.2 (which i don’t think is officially released yet?).

Currently stuck on getting this permission denied on a docker executor build attempt following the instructions in the git readme. SELinux is disabled btw.

[user@qubes-builderv2 qubes-builderv2]$ uname -a
Linux qubes-builderv2 6.1.11-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb  9 20:36:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[user@qubes-builderv2 qubes-builderv2]$ ./qb package fetch prep build
Running stage: fetch
Error: [Errno 13] Permission denied: 'qrexec-client-vm'
Traceback (most recent call last):
  File "/home/user/qubes-builderv2/qubesbuilder/cli/cli_base.py", line 65, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    rv.append(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/home/user/qubes-builderv2/qubesbuilder/cli/cli_package.py", line 58, in fetch
    _component_stage(
  File "/home/user/qubes-builderv2/qubesbuilder/cli/cli_package.py", line 39, in _component_stage
    p.run(stage=stage_name)
  File "/home/user/qubes-builderv2/qubesbuilder/plugins/fetch/__init__.py", line 149, in run
    executor.run(cmd, copy_in, copy_out, environment=self.environment)
  File "/home/user/qubes-builderv2/qubesbuilder/executors/qubes.py", line 131, in run
    result = subprocess.run(
  File "/usr/lib64/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib64/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'qrexec-client-vm'