Skip to content

Update firmware packages from bookworm-backports on Debian 12 #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 9, 2025

Conversation

marmarek
Copy link
Member

Firmware packages in standard Debian repo are too old for recent
kernels, and recent hardware in general. This affects all kernel-latest
versions, but also soon-to-be-default kernel-6.12. This is at least
necessary to support wifi network in NovaCustom laptops, but other
modern systems need that too.
Fresh template builds have firmware from bookworm-backports already
selected, but do that for older versions too.

Thanks @aronowski for the hint on apt properties.
Fixes QubesOS/qubes-issues#9815

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.03%. Comparing base (a415729) to head (edffda1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #184   +/-   ##
=======================================
  Coverage   73.03%   73.03%           
=======================================
  Files          10       10           
  Lines        1157     1157           
=======================================
  Hits          845      845           
  Misses        312      312           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mblanqui
Copy link

@marmarek, firmware-iwlwifi from testing is a far better fit, imo. firmware-iwlwifi from bookworm-backports is five months older and anecdotally I couldn't get it to work with my BE200 card (which NovaCustom also sells). Judging by the forum others have had problems with it too. https://forum.qubes-os.org/t/intel-wi-fi-7-be200-working/24017

@marmarek
Copy link
Member Author

AFAIK the "proper" Debian way of bringing packages from testing to stable is via backports, otherwise it isn't really safe to mix packages from testing and stable. While in this particular case it may work today, there isn't really guarantee it wouldn't break some other day (for example package in testing pulling some other dependencies from testing, that would break stable).
Anyway the last post in the thread you linked says the package from backports actually was new enough. If one day that wouldn't be the case anymore, the proper way is to request update via backports.

@qubesos-bot
Copy link

qubesos-bot commented Feb 28, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025030800-4.3&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025021804-4.3&flavor=update

Failed tests

25 failures
  • system_tests_whonix

    • whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-gateway-17 failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-workstation-17 failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_suspend

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_qrexec

    • TC_00_Qrexec_whonix-workstation-17: test_065_qrexec_exit_code_vm (failure)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^... AssertionError: b'125\n' != b'0\n'
  • system_tests_devices

    • TC_00_List_whonix-gateway-17: test_001_list_loop_mounted (failure)
      AssertionError: Device test-inst-vm:loop0::0 (/tmp/test.img) should...
  • system_tests_audio@hw1

  • system_tests_whonix@hw7

    • whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-gateway-17 failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-workstation-17 failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_suspend@hw1

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_kde_gui_interactive

    • gui_filecopy: unnamed test (unknown)
    • gui_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'files-work' matched...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/129058#dependencies

9 fixed
  • system_tests_whonix

  • system_tests_qrexec

  • system_tests_audio

  • system_tests_basic_vm_qrexec_gui_btrfs

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (error)
      subprocess.CalledProcessError: Command '['sha1sum', '/var/lib/qubes...
  • system_tests_whonix@hw7

  • system_tests_kde_gui_interactive

    • clipboard_and_web: unnamed test (unknown)
    • clipboard_and_web: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-paste-notif...

Unstable tests

Performance Tests

Performance degradation:

32 performance degradations
  • debian-12-xfce_exec-data-simplex: 66.55 :small_red_triangle_up: ( previous job: 48.93, degradation: 136.01%)
  • debian-12-xfce_exec-data-duplex: 70.59 :small_red_triangle_up: ( previous job: 50.76, degradation: 139.06%)
  • debian-12-xfce_exec-data-duplex-root: 84.38 :small_red_triangle_up: ( previous job: 64.91, degradation: 130.01%)
  • debian-12-xfce_socket-data-duplex: 161.85 :small_red_triangle_up: ( previous job: 81.49, degradation: 198.62%)
  • fedora-41-xfce_exec-data-simplex: 66.95 :small_red_triangle_up: ( previous job: 49.65, degradation: 134.85%)
  • fedora-41-xfce_exec-data-duplex: 65.33 :small_red_triangle_up: ( previous job: 49.08, degradation: 133.10%)
  • fedora-41-xfce_exec-data-duplex-root: 95.70 :small_red_triangle_up: ( previous job: 81.65, degradation: 117.21%)
  • fedora-41-xfce_socket-data-duplex: 155.32 :small_red_triangle_up: ( previous job: 78.62, degradation: 197.55%)
  • whonix-gateway-17_socket: 8.46 :small_red_triangle_up: ( previous job: 7.54, degradation: 112.18%)
  • whonix-gateway-17_exec-data-simplex: 77.38 :small_red_triangle_up: ( previous job: 48.76, degradation: 158.67%)
  • whonix-gateway-17_exec-data-duplex: 74.40 :small_red_triangle_up: ( previous job: 48.55, degradation: 153.22%)
  • whonix-gateway-17_exec-data-duplex-root: 93.71 :small_red_triangle_up: ( previous job: 70.13, degradation: 133.62%)
  • whonix-gateway-17_socket-data-duplex: 165.57 :small_red_triangle_up: ( previous job: 82.74, degradation: 200.11%)
  • whonix-workstation-17_exec-data-simplex: 70.78 :small_red_triangle_up: ( previous job: 47.01, degradation: 150.55%)
  • whonix-workstation-17_exec-data-duplex: 75.62 :small_red_triangle_up: ( previous job: 49.48, degradation: 152.84%)
  • whonix-workstation-17_exec-data-duplex-root: 107.08 :small_red_triangle_up: ( previous job: 79.93, degradation: 133.97%)
  • whonix-workstation-17_socket-data-duplex: 161.75 :small_red_triangle_up: ( previous job: 81.71, degradation: 197.95%)
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 431868.00 :small_red_triangle_up: ( previous job: 486352.00, degradation: 88.80%)
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 114612.00 :small_red_triangle_up: ( previous job: 276742.00, degradation: 41.41%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 209757.00 :small_red_triangle_up: ( previous job: 423495.00, degradation: 49.53%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 75040.00 :small_red_triangle_up: ( previous job: 185030.00, degradation: 40.56%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8727.00 :small_red_triangle_up: ( previous job: 10163.00, degradation: 85.87%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 145030.00 :small_red_triangle_up: ( previous job: 164133.00, degradation: 88.36%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 7701.00 :small_red_triangle_up: ( previous job: 8767.00, degradation: 87.84%)
  • fedora-41-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 287833.00 :small_red_triangle_up: ( previous job: 343795.00, degradation: 83.72%)
  • fedora-41-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 2621.00 :small_red_triangle_up: ( previous job: 3785.00, degradation: 69.25%)
  • fedora-41-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 872.00 :small_red_triangle_up: ( previous job: 1126.00, degradation: 77.44%)
  • fedora-41-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 1090.00 :small_red_triangle_up: ( previous job: 1613.00, degradation: 67.58%)
  • fedora-41-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 347210.00 :small_red_triangle_up: ( previous job: 392725.00, degradation: 88.41%)
  • fedora-41-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 109191.00 :small_red_triangle_up: ( previous job: 139933.00, degradation: 78.03%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 2343.00 :small_red_triangle_up: ( previous job: 3959.00, degradation: 59.18%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 1835.00 :small_red_triangle_up: ( previous job: 2693.00, degradation: 68.14%)

Remaining performance tests:

40 tests
  • debian-12-xfce_exec: 7.13 🟢 ( previous job: 7.15, improvement: 99.62%)
  • debian-12-xfce_exec-root: 29.01 :small_red_triangle_up: ( previous job: 27.97, degradation: 103.72%)
  • debian-12-xfce_socket: 7.97 🟢 ( previous job: 8.33, improvement: 95.73%)
  • debian-12-xfce_socket-root: 8.84 :small_red_triangle_up: ( previous job: 8.20, degradation: 107.80%)
  • fedora-41-xfce_exec: 9.27 :small_red_triangle_up: ( previous job: 9.13, degradation: 101.45%)
  • fedora-41-xfce_exec-root: 63.98 :small_red_triangle_up: ( previous job: 61.17, degradation: 104.59%)
  • fedora-41-xfce_socket: 8.85 :small_red_triangle_up: ( previous job: 8.66, degradation: 102.15%)
  • fedora-41-xfce_socket-root: 8.46 🟢 ( previous job: 8.61, improvement: 98.31%)
  • whonix-gateway-17_exec: 6.89 🟢 ( previous job: 7.87, improvement: 87.64%)
  • whonix-gateway-17_exec-root: 41.09 :small_red_triangle_up: ( previous job: 38.36, degradation: 107.09%)
  • whonix-gateway-17_socket-root: 7.59 🟢 ( previous job: 8.27, improvement: 91.75%)
  • whonix-workstation-17_exec: 7.68 🟢 ( previous job: 8.23, improvement: 93.26%)
  • whonix-workstation-17_exec-root: 57.58 :small_red_triangle_up: ( previous job: 52.56, degradation: 109.55%)
  • whonix-workstation-17_socket: 8.81 :small_red_triangle_up: ( previous job: 8.21, degradation: 107.35%)
  • whonix-workstation-17_socket-root: 7.69 🟢 ( previous job: 8.20, improvement: 93.81%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 100714.00 :green_circle: ( previous job: 100699.00, improvement: 100.01%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 5794.00 :green_circle: ( previous job: 3277.00, improvement: 176.81%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 2640.00 :green_circle: ( previous job: 282.00, improvement: 936.17%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 500991.00 :green_circle: ( previous job: 475329.00, improvement: 105.40%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 233068.00 :green_circle: ( previous job: 95209.00, improvement: 244.80%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 404543.00 :small_red_triangle_up: ( previous job: 433474.00, degradation: 93.33%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 95544.00 :small_red_triangle_up: ( previous job: 99808.00, degradation: 95.73%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 8027.00 :green_circle: ( previous job: 7053.00, improvement: 113.81%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 3806.00 :small_red_triangle_up: ( previous job: 3868.00, degradation: 98.40%)
  • fedora-41-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 386928.00 :small_red_triangle_up: ( previous job: 396586.00, degradation: 97.56%)
  • fedora-41-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 256312.00 :green_circle: ( previous job: 99783.00, improvement: 256.87%)
  • fedora-41-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 97776.00 :green_circle: ( previous job: 44770.00, improvement: 218.40%)
  • fedora-41-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 82730.00 :small_red_triangle_up: ( previous job: 86742.00, degradation: 95.37%)
  • fedora-41-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8427.00 :small_red_triangle_up: ( previous job: 8623.00, degradation: 97.73%)
  • fedora-41-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 416266.00 :green_circle: ( previous job: 401907.00, improvement: 103.57%)
  • fedora-41-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 112158.00 :small_red_triangle_up: ( previous job: 116848.00, degradation: 95.99%)
  • fedora-41-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 323135.00 :small_red_triangle_up: ( previous job: 357875.00, degradation: 90.29%)
  • fedora-41-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 40341.00 :small_red_triangle_up: ( previous job: 41375.00, degradation: 97.50%)
  • fedora-41-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 83103.00 :small_red_triangle_up: ( previous job: 87999.00, degradation: 94.44%)
  • fedora-41-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 4117.00 :green_circle: ( previous job: 3885.00, improvement: 105.97%)
  • fedora-41-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 8013.00 :small_red_triangle_up: ( previous job: 8744.00, degradation: 91.64%)
  • fedora-41-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 304199.00 :green_circle: ( previous job: 294875.00, improvement: 103.16%)
  • fedora-41-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 83237.00 :green_circle: ( previous job: 78093.00, improvement: 106.59%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 81375.00 :green_circle: ( previous job: 71108.00, improvement: 114.44%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 8273.00 :small_red_triangle_up: ( previous job: 8408.00, degradation: 98.39%)

# first, add bookworm-backports if not already there:
with open(sources_list) as sources:
current_sources = sources.read()
if "bookworm-backports" not in current_sources:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whonix enables backports in /etc/apt/sources.list.d/debian.list.

It is best to check if it is enabled in any sources list, be it:

  • sources.list
  • sources.list.d/*.list
  • sources.list.d/*.sources

Does not lead to an error, but a huge warning wall.

Quite difficult to validate this considering there are mirrors, protocols can vary (https, http, tor+https, tor+http, http://HTTPS) and URLs can also very, considering debian.org, .onion variant and mirrors.

A stricter validation would allow to not fail on false positives of external repositories having the suite bookworm-backports.

Copy link
Member Author

@marmarek marmarek Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look for other deb.debian.org line and copy it? If not found, do nothing. The main target for this change is a template that may be used for sys-net. Without updating firmware from backports, QubesOS/qubes-issues#9794 breaks wifi in most cases (for those using Debian for sys-net). It doesn't need to work in Whonix or other cases like that

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand Whonix is not the focus, Kicksecure for example is becoming a template and there, as the base of Whonix, which could also become a sys-net template, has https://github.com/Kicksecure/anon-apt-sources-list/blob/master/etc/apt/sources.list.d/debian.list

Therefore I suggest testing against both of these URLs

  • deb.debian.org/debian
  • 2s4yqjx5ul6okpp3f2gaunr2syex5jgbfpfvhxxbbjwnrsvbk5v3qbid.onion/debian

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that an official onion repo? I don't see it listed at https://www.debian.org/mirror/list

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source: https://onion.debian.org/

Bottom of the page.

with open(sources_list) as sources:
current_sources = sources.read()
if "bookworm-backports" not in current_sources:
with open(sources_list, "a") as sources:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is better to use a file in sources.list.d so it is easier to remove that configuration if necessary one day.


APT_CONF = "/etc/apt/apt.conf.d/01qubes-update"
sources_list = "/etc/apt/sources.list"
backports_line = "deb https://deb.debian.org/debian bookworm-backports main contrib non-free-firmware"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using https as protocol for default is sane but may break user setups. Every apt-cacher-ng user, Whonix Workstation app qubes that have configured their gateway to disable transparent proxy.

Can also differ from what the user has configured especially on Whonix, such as https, tor+https, tor+http, tor with onion.

There should be a qube a hook to allow package maintainers to set the correct URL.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using new file in sources.list.d is a good idea. I can simply make it to not do anything if the file already exists (lets say, backports.list). apt-cacher-ng users can either adjust this file post-change, or proactively create it earlier with desired content.

backports_line = "deb https://deb.debian.org/debian bookworm-backports main contrib non-free-firmware"
prefs_path = "/etc/apt/preferences.d/firmware_backports"
prefs_data = """\
Package: src:firmware-nonfree

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marmarek marmarek force-pushed the bookworm-firmware branch 4 times, most recently from 306db22 to 5291a73 Compare March 3, 2025 19:26
)
if b"bpo" in output:
# version from backports already installed
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that pipewire was added, the check should not return as soon as firmware from backports is found.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see why pipewire should be in a separate plugin, to avoid returning early, the plugin name is firmware_backports and the function has the same name.

Maybe switch the file name to backports, place backports related code in one function and separate the check for pipewire and firmware-linux-non-free?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also change this line to not return early.

Copy link

@ben-grande ben-grande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much more stricter now and apt-get --print-uris seems to be the best.

)
if b"bpo" in output:
# version from backports already installed
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I see why pipewire should be in a separate plugin, to avoid returning early, the plugin name is firmware_backports and the function has the same name.

Maybe switch the file name to backports, place backports related code in one function and separate the check for pipewire and firmware-linux-non-free?

@adrelanos
Copy link
Member

I must caution against use of /etc/apt/preferences.d/ / APT preferences / APT pinning. Please consider the following.

Quote https://www.kicksecure.com/wiki/Dev/APT_Pinning

Debian developers would literally hate this.

Question: Can a package pull a another package from another repository to be added?

Answers:

(And don't forget all the hate you will get from me and other [email protected] inhabitants because your users end up reporting bugs about APT)

I rarely got such as direct request

@marmarek
Copy link
Member Author

marmarek commented Mar 4, 2025

So, back to the original question: how to mark a package to be installed from backports, similar to apt-get -t bookworm-backports install firmware-linux-nonfree does, without installing the package yet? IIUC that apt-get call does mark the package somehow, so next updates continue to follow versions from backports, right? But I can't find how it's done, I tried diffing /var/lib/{apt,dpkg} before and after and don't see anything relevant...

@ArrayBolt3
Copy link

The issues discussed in the threads @adrelanos linked to are mainly with dynamically adding new sources.list and pin entries during package installation or upgrade. Using pinning and the like is not inherently bad, it's just something that you should not be doing on already installed, running systems. People can and will customize their templates in all sorts of different ways, and adding a sources.list entry to their setup could cause major headaches if they have a non-standard setup.

The ideal way to do this is the way you're already doing - make sure the repos are right from the get-go on freshly built systems. But you need older systems to be updated as well so that users get fixes and don't suffer problems during a kernel upgrade.

I don't think there's any good solution here sadly - Debian dislikes the solution being proposed here, but I think it might be the best that can be done. Some solutions that I've thought of looking at this:

  • Ideal but probably not practical solution: distribute the firmware-nonfree package from bookworm-backports in Qubes OS's repo. This means that no matter what setup a user has to use in order to get the packages from Qubes OS's repo, that setup will "just work" to pull the right package. Whether this is legal or not is another question, I am not a lawyer, nor do I know if Debian has special permissions here.
  • Non-ideal solution requiring manual intervention: do something like what Kicksecure does and offer a script that, when run, adds the sources.list.d file. That way the user has to explicitly request its creation, and if things go south, they can fix whatever issues result.
  • Almost practical solution: introduce the new sources.list file and pinning automatically, but use a debconf prompt to alert the user so they know what happened if something goes wrong. The problem with this is that most users are probably updating using Qubes Update, which means that they won't see this message.
  • Overcomplicated and probably overly alarming solution: when the upgrade happens, have the upgraded Debian VMs send a qrexec request to dom0 that causes it to pop up a window with a message indicating that the backports repo is being enabled and this might cause apt breakage. dom0 would only ever show this prompt once to avoid flooding the user. This of course would be a huge pain to implement, and most users (all users who aren't messing with their apt config) aren't going to know what this means or what to do about it, thus support requests will come.
  • Good enough solution: just carry on with this, if things break for some users, too bad for them. This is arguably a bad idea, but there are lots of packages out in the wild that do this sort of thing and... they work. Maybe for some fraction of users their systems break, but it's a rarity from what I know. This is even more true in Qubes OS - Debian has to support a myriad of different configurations and use cases, way more than Qubes OS has to support for its Debian-based VMs. What would be nice is if there was some way for users who do experience breakage to know that they should be reaching out to Qubes, not Debian, but thankfully for us Debian is hard enough to report a bug to and the Qubes OS forums are easily accessible enough that people will probably go to the forums first rather than fighting with reportbug.

marmarek added 2 commits March 5, 2025 00:01
Firmware packages in standard Debian repo are too old for recent
kernels, and recent hardware in general. This affects all kernel-latest
versions, but also soon-to-be-default kernel-6.12. This is at least
necessary to support wifi network in NovaCustom laptops, but other
modern systems need that too.
Fresh template builds have firmware from bookworm-backports already
selected, but do that for older versions too.

Build the URL based on `apt-get --print-uris update` output to match
protocol used for the main Debian repo (tor, apt-cacher-ng etc).

Thanks @aronowski for the hint on apt properties.
Fixes QubesOS/qubes-issues#9815
@marmarek marmarek force-pushed the bookworm-firmware branch from edffda1 to 9c3ba48 Compare March 4, 2025 23:01
@adrelanos
Copy link
Member

I would discourage any user interactive solution.

The solution that I recommend would be:

  • not using APT pinning.
  • Qubes developers (scripted, automated) download the needed packages from backports and upload to Qubes repository.

That way, Qubes developers stay in full control, such updates remain fully tested by Qubes automated tests, and the package manager won't break due to the risks of using APT pinning.

Building the package from source code might be overkill.

This might have an impact on reprodubile builds, rebuilders. The package matching Debian's package is something that rebuilders should verify.

  • Ideal but probably not practical solution: distribute the firmware-nonfree package from bookworm-backports in Qubes OS's repo. This means that no matter what setup a user has to use in order to get the packages from Qubes OS's repo, that setup will "just work" to pull the right package. Whether this is legal or not is another question, I am not a lawyer, nor do I know if Debian has special permissions here.

I highly doubt Debian has (or even wants) special permissions. The Debian developer only made a strong request but nobody made a legal argument.

@marmarek
Copy link
Member Author

marmarek commented Mar 5, 2025

Qubes developers (scripted, automated) download the needed packages from backports and upload to Qubes repository.

I don't like this, because that requires us to do that with all the future updates to the package too. Rules for backports are specifically crafted to not conflict with stable. This is the difference compared to plain "testing", which might cause problems, and that is likely also why you got such negative response about depending on package from "testing" in the posts you linked.

@marmarek marmarek merged commit 9c3ba48 into QubesOS:main Mar 9, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AX201 firmware not deployed per dom0 kernel-latest 6.12.16-1.qubes.fc37.x86_64 for sys-net based on debain-12
7 participants