Repository navigation
feat: Support for Windows on Arm laptops - #642
Conversation
|
(see also #227) Agathe Porte (@gagath) Christopher Obbard (@obbardc) would love some feedback on this one (keeping it draft while you review the approach)! We could branch initramfs-tools and stubble in our QLI APT overlay, however I think it would be nice to see how well vanilla Debian packages work, except a bit of a glue is missing. Known opens:
|
b2d5c0c to
03f6dfd
Compare
|
I boot tested the current image on a hamoa T14s, it mostly starts, but I get a black screen after initramfs, it seems due to: |
Agathe Porte (gagath)
left a comment
There was a problem hiding this comment.
I need to test it on a real image and do a test-boot on T14s, here are some comments in the meantime from a first quick look at the implementation.
| # out. | ||
| fatal_w() { | ||
| echo "Warning: $*. Not embedding device trees." >&2 | ||
| exit 0 |
There was a problem hiding this comment.
I do not understand why its not exit 1 if it is a fatal error. It should not be installed on platforms that do not need it in the first place? Also this kind of function has historically been called die which is well-known that it will exit the program after displaying a message.
There was a problem hiding this comment.
My 2c: I don't think installing this based on platform is a good idea as part of this PR, since currently we build generic images.
Instead it may be worthwhile bubbling the error up at runtime IF this platform needs the dtb-loader installed ?
There was a problem hiding this comment.
I do not understand why its not exit 1 if it is a fatal error. It should not be installed on platforms that do not need it in the first place? Also this kind of function has historically been called
diewhich is well-known that it will exit the program after displaying a message.
I didn't call that die() or fail() because I didn't want to exit 1.
My 2c: I don't think installing this based on platform is a good idea as part of this PR, since currently we build generic images.
Yes, I want us to build generic images; since I know laptops need a number of workarounds, and some of them belong in packages, my initial thought was to put these behind a flag so that we have a way to trace them back, and return to clean images.
Very keen to hear about better / alternate ways of approaching this!
Instead it may be worthwhile bubbling the error up at runtime IF this platform needs the dtb-loader installed ?
The reason I'm not failing unconditionally is because I wasn't sure how to deliver that without breaking other legitimate uses, for instance:
- I didn't want to break people like Agathe that have a working local UKI setup already
- I didn't want to break chroot builds
- I find it hard to recover from package postinsts failing, and these hooks are typically run from package postinsts
I'm trying to weigh the pros and cons :)
There was a problem hiding this comment.
All good for me, let's come up with a clever solution to be more generic later when we need to, not blocking now :-)!
| # With layout=auto or no layout set, recent kernel-install will set the layout | ||
| # to bls when installing kernels that use UAPI.1 Boot Loader Specification[2] | ||
| # Type #1 layout which is the only case where the post-processing done here is | ||
| # useful. |
There was a problem hiding this comment.
This is an implementation detail of kernel-install, why is it stated here instead of just saying we only support bls? (and removing the comment as well)
There was a problem hiding this comment.
When I developed this file and was reviewing it, I had to learn about the different layouts supported by the config, and then understand that not all of them would be reflected at runtime. This was my way of bringing it back in context here. Some day, there might be new layout types added.
| description: Verify device trees were embedded in the kernel image | ||
| chroot: true | ||
| command: | | ||
| set -eux |
There was a problem hiding this comment.
can we extract this in a dedicated script so we can have syntax highlighting, be able to run it locally as well as running shellcheck against it?
There was a problem hiding this comment.
you're right, that's ugly there, I'll drop that
There was a problem hiding this comment.
FWIW i am happy with this script inline in its current state
There was a problem hiding this comment.
I've dropped this section for now, and sent systemd/systemd#44017
| # provides linuxaa64.efi.stub, which is what ukify wraps the kernel in. | ||
| # systemd-boot's dependency is satisfied by systemd-boot-efi-arm64-signed, | ||
| # which ships the signed boot loader but no stub, and systemd-ukify only | ||
| # recommends this, so ask for it explicitly. |
There was a problem hiding this comment.
If systemd-ukify recommends it, and we install with recommends, why do we also ask explicitly?
There was a problem hiding this comment.
it's the kind of functionality that we require, so while the package has a recommends, we have a depends, so I thought it was proper to list the dependency
|
|
||
| # Prefer stubble's hardware ID database which is currently being released more | ||
| # frequently than systemd. | ||
| # TODO Should we load from both databases? Perhaps a patch to finddtbs.py |
There was a problem hiding this comment.
We should create an issue to follow-up on this TODO after merging.
There was a problem hiding this comment.
not relevant anymore in latest version of the stubble hook which only looks at the stubble DB
Christopher Obbard (obbardc)
left a comment
There was a problem hiding this comment.
LGTM, some minor comments.
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{- range $overlay := split "," $overlays }} |
There was a problem hiding this comment.
Just wondering if it makes sense to install these packages in the image recipe unconditionally, since we already install some bootloader packages in the image recipe?
(may have to force-disable ukify hook scripts too, when dtb-loader is not enabled)
There was a problem hiding this comment.
I'm happy either way (packages pre-installed but not used, or not installed); if it's not too confusing to have stubble installed but not used, let's add it unconditionally.
There was a problem hiding this comment.
yeah, i think i'd prefer installing it unconditionally, possibly in its own apt action or alongside other similar packages (also noticed this is a duplicate review comment from me, oops)
| # Snapdragon Windows-on-ARM laptops advertise a TPM2 in the EFI | ||
| # variables but expose no device for it ("TPM2 Support: firmware | ||
| # only, driver unavailable" in bootctl status), so the systemd units | ||
| # that wait for one timeout TODO check if this is detrimental on IoT |
There was a problem hiding this comment.
the TODO really means we may have to append this only when dtb-loader is not enabled...
There was a problem hiding this comment.
Only when it is not enabled, or only when it is enabled?!
So I briefly researched this flag, and it just stops systemd waiting for the TPM2 on boot, I guess that's only important if systemd or some userspace is going to make use of the TPM, but we're not making any use of it at the moment. Hence, I don't think it's detrimental in any way at this stage, but perhaps we would want to log somewhere that we want to remove this once a QTEE TPM driver happens for these platforms?
There was a problem hiding this comment.
Happy with this change as-is, but it may be worth removing the inline TODO here or promoting it to an issue so we don't forget about it?
There was a problem hiding this comment.
nitpick: I'd still like to have an issue about this and link it here before merging, ideally. I think your comment in this thread needs to be stored somewhere longer-term too, either in the issue or the inline comment.
There was a problem hiding this comment.
leaving unresolved as still TODO in the recipe
| systemctl enable debos-grow-rootfs | ||
|
|
||
| - action: run | ||
| description: Verify device trees were embedded in the kernel image |
There was a problem hiding this comment.
also, should this run when the dtb-loader overlay is not enabled? maybe there is a better way of doing that.
There was a problem hiding this comment.
right; I think I just want an ukify command instead
There was a problem hiding this comment.
Sent systemd/systemd#44017 so that we can just call ukify inspect (perhaps stubblify will need a catch-up)
There was a problem hiding this comment.
The parsing is done by a small FDT reader built on the struct
module, which avoids adding a dependency on libfdt or similar.
I am not sure you explained why introducing a libfdt dependency was a problem in this PR
There was a problem hiding this comment.
I erred towards not introducing dependencies and hence friction there, I'm ready to use this if that's what they prefer; their reviews are quite sophisticated, I'm sure they'll let me know :) (plus they went for their own DT parsing in C so I bet they prefer this!)
Christopher Obbard (obbardc)
left a comment
There was a problem hiding this comment.
Small thoughts, nothing blocking from my side.
| # Snapdragon Windows-on-ARM laptops advertise a TPM2 in the EFI | ||
| # variables but expose no device for it ("TPM2 Support: firmware | ||
| # only, driver unavailable" in bootctl status), so the systemd units | ||
| # that wait for one timeout TODO check if this is detrimental on IoT |
There was a problem hiding this comment.
Happy with this change as-is, but it may be worth removing the inline TODO here or promoting it to an issue so we don't forget about it?
| description: Verify device trees were embedded in the kernel image | ||
| chroot: true | ||
| command: | | ||
| set -eux |
There was a problem hiding this comment.
FWIW i am happy with this script inline in its current state
b2c144d to
0337f27
Compare
|
Christopher Obbard (@obbardc) mind taking another look? |
Christopher Obbard (obbardc)
left a comment
There was a problem hiding this comment.
just some minor nitpicks.
| # Snapdragon Windows-on-ARM laptops advertise a TPM2 in the EFI | ||
| # variables but expose no device for it ("TPM2 Support: firmware | ||
| # only, driver unavailable" in bootctl status), so the systemd units | ||
| # that wait for one timeout TODO check if this is detrimental on IoT |
There was a problem hiding this comment.
nitpick: I'd still like to have an issue about this and link it here before merging, ideally. I think your comment in this thread needs to be stored somewhere longer-term too, either in the issue or the inline comment.
| recommends: true | ||
| packages: | ||
| # provides stubblify, the hardware ID database and the finddtbs script | ||
| - stubble |
There was a problem hiding this comment.
- i'd be in favour of always installing stubble, I don't think there's anything detrimental about that?
- add stubble to
backportpackagesso we get latest in trixie :-)
There was a problem hiding this comment.
Loïc Minier (@lool) I'd like it if we could add stubble to backportpackages, it's a minor change but I think worth doing. If not, happy to do in a follow-up
There was a problem hiding this comment.
Yup that makes sense
Would be cool if this could land ubuntu/stubble#89, then adding a binary package for it, and then using it from backports
|
|
||
| # helps avoiding cpuidle.off=1 workaround on some platforms | ||
| CONFIG_QCOM_CPUCP_MBOX=y | ||
|
|
There was a problem hiding this comment.
nitpick: spurious newline
| # see https://github.com/qualcomm-linux/kernel/issues/1148 | ||
| CONFIG_DRM_SIMPLE_BRIDGE=m | ||
|
|
||
| # helps avoiding cpuidle.off=1 workaround on some platforms |
There was a problem hiding this comment.
nitpick: can we link to a tracking issue here at all?
| # patchset upstream | ||
| CONFIG_POWERCAP=y | ||
| CONFIG_QCOM_SPEL=m | ||
|
|
There was a problem hiding this comment.
nitpick: spurious newline
There was a problem hiding this comment.
fixed, thanks
|
|
||
| # Qualcomm SPEL (SoC Power and Electrical Limits) powercap driver, useful on | ||
| # Glymur/X2; the driver comes from | ||
| # https://lore.kernel.org/all/20260702-qcom_spel_driver_upstream-v3-0-434d50f0c5b0@oss.qualcomm.com/ |
There was a problem hiding this comment.
nitpick: can we link to a tracking issue here at all?
3ff23b7 to
a356356
Compare
|
Christopher Obbard (@obbardc) I added a number of config improvements, but I'm concerned I don't have a path to them being addressed somewhere, especially the cpuidle and msm workarounds I suspect are longer term and a bit invasive. Not sure how to manage this yet, perhaps laptops-kernel issues, but might be open for a long time. |
Perhaps we could have just one tracking issue for the |
Test results for commit a6b15c7qcom-next-trixie
|
| Test | glymur-crd | qcs615-ride | qcs6490-rb3gen2 | qcs8300-ride | qrb2210-rb1 |
|---|---|---|---|---|---|
| boot | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| adsp_remoteproc | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| Boot_Systemd_KPI_Loop | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| BT_ON_OFF | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ☑️ controller stays unconfigured (DOWN RAW,... |
| cdsp_remoteproc | ✅ pass | ✅ pass | ✅ pass | ✅ pass | |
| CPUFreq_Validation | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| DSP_AudioPD | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| EFI_Variable_Validation | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ☑️ expected to work on this board, does not... |
| Ethernet_Basic_Validation | |||||
| fastrpc_test | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| hotplug | ✅ pass | ✅ pass | 🚫 | ✅ pass | ✅ pass |
| Interrupts | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| irq | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| OpenCV | |||||
| Partition_PostBoot_Validation | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| WiFi_Firmware_Driver | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
Known failures (2)
| Device | Test | Status | Comment |
|---|---|---|---|
| qrb2210-rb1 | BT_ON_OFF | known failure | controller stays unconfigured (DOWN RAW, no valid BD address) and is not visible to bluetoothctl, #719 |
| qrb2210-rb1 | EFI_Variable_Validation | known failure | expected to work on this board, does not yet, #645 |
All jobs summary
| Job ID | Device | State | Health |
|---|---|---|---|
| 481168 | qrb2210-rb1 | Finished | Complete |
| 481159 | qcs8300-ride | Finished | Complete |
| 481160 | qcs6490-rb3gen2 | Finished | Complete |
| 481170 | qcs6490-rb3gen2 | Finished | Complete |
| 481158 | qcs615-ride | Finished | Complete |
| 481166 | glymur-crd | Finished | Complete |
| 481167 | qcs8300-ride | Finished | Complete |
| 481156 | glymur-crd | Finished | Complete |
| 481157 | qrb2210-rb1 | Finished | Complete |
| 481169 | qcs615-ride | Finished | Complete |
Test Results 10 files - 10 84 suites - 84 31m 57s ⏱️ - 42m 58s For more details on these failures, see this check. Results for commit a356356. ± Comparison against base commit 85acb8c. This pull request skips 1 test. |
Test Results 10 files 84 suites 32m 1s ⏱️ Results for commit a6b15c7. |
|
Loïc Minier (@lool) JFYI I have some overlapping fixes in #715 and I imported your stubble kernel hook scripts there - I'd really like to get this PR merged first, then I can rebase on top of it. Is there anything I can do to help? I will start off with a fresh review of this PR and see if there are any changes in #715 which need to be integrated here. |
On Snapdragon Windows on ARM systems, the UEFI firmware has an insufficient ACPI implementation for Linux and no device tree. Add a dtb-loader overlay for debos-recipes which installs kernel-install and kernel-postinst.d hooks to wrap the EFI kernel image installed in the ESP with systemd-stub based DTB loader, device trees for these machines, and boot firmware signatures (CHID). From: ubuntu/stubble#89 Install stubble which is a dependency of this script. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Enable dtb-loader by default in our qcom-laptops builds. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
qcom-next's prune.config disables DRM_SIMPLE_BRIDGE while the arm64 defconfig and Debian's config enable it as a module. This driver is critical for display on Lenovo T14s Gen6 (Hamoa), so bring it back as a workaround until qcom-next's prune.config is fixed. See: qualcomm-linux/kernel#1148 Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Glymur/X2 laptops can benefit from the new Qualcomm SPEL (SoC Power and Electrical Limits) powercap driver. This driver is currently on list, but it typically included in development kernel trees targeting X2 hardware. There is no defconfig patch on list yet. Enable POWERCAP and QCOM_SPEL configs to allow raising the power envelope and get some improved performance on X2s. See qualcomm-linux#718. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Glymur-based ASUS Zenbooks (A14 and A16) use a OV02C10 sensor for the front camera. Enable it as a module. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
When using a defconfig kernel, libcamera's GPU SoftISP tries to use the msm driver for offloading, but it doesn't work because defconfig sets DEBUG_KERNEL=y which implies DMABUF_DEBUG=y: the msm driver relies on some internal details that aren't provided when this is set. Disable this config for the libcamera GPU backend to work. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
CONFIG_HID_ASUS is needed to support Fn keys on ASUS laptops. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Add support for BLE and common peripherals. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Useful for key remapping, or e.g. with Steam. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Snapdragon Windows-on-ARM laptops advertise a TPM2 in the EFI variables, but expose no device for it. This is reported as "TPM2 Support: firmware only, driver unavailable" in bootctl status and causes standard systemd units to wait for a long timeout on boot. Disable waiting for TPM2 devices on boot by removing the systemd-tpm package since we don't use its functionality anyway. See qualcomm-linux#717. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
a6b15c7 to
d5e179b
Compare
|
Christopher Obbard (@obbardc) ready for another review and hopefully merging; recent changes:
|
| command: | | ||
| set -eux | ||
| if dpkg-query -W -f='${Status}' systemd-tpm 2>/dev/null | grep -q "ok installed"; then | ||
| apt-get -y purge systemd-tpm |
There was a problem hiding this comment.
for the record this is not very elegant, but I will allow it as this PR has been blocked for too long and promise to clean it up later with some kind of apt-mark hold :-)
There was a problem hiding this comment.
On a normal APT command-line we could also use something like apt install systemd systemd-tpm- to avoid that Recommends... but I'm unclear of how this could be reflected in the Debos schema.
There was a problem hiding this comment.
Problem is systemd is pulled during deboostrap; I guess we could hack systemd-tpm- in --extra-packages somehow
There was a problem hiding this comment.
I've used systemctl mask tpm2.target locally on another distro but maybe that's not an option here
There was a problem hiding this comment.
Ah that's a decent workaround too
(FYI, we're also working on actually getting a proper driver for that TPM so that it just works :))
Test results for commit d5e179bqcom-next-trixie
|
| Test | glymur-crd | qcs615-ride | qcs6490-rb3gen2 | qcs8300-ride | qrb2210-rb1 |
|---|---|---|---|---|---|
| boot | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| adsp_remoteproc | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| Boot_Systemd_KPI_Loop | 🚫 | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| BT_ON_OFF | ✅ pass | ✅ pass | 🚫 | ✅ pass | ☑️ controller stays unconfigured (DOWN RAW,... |
| cdsp_remoteproc | ✅ pass | ✅ pass | ✅ pass | ✅ pass | |
| CPUFreq_Validation | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| DSP_AudioPD | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| EFI_Variable_Validation | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ☑️ expected to work on this board, does not... |
| Ethernet_Basic_Validation | 🚫 | ||||
| fastrpc_test | ✅ pass | ✅ pass | ❌ fail | ✅ pass | ✅ pass |
| hotplug | ✅ pass | ✅ pass | 🚫 | ✅ pass | ✅ pass |
| Interrupts | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| irq | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| OpenCV | |||||
| Partition_PostBoot_Validation | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
| WiFi_Firmware_Driver | ✅ pass | ✅ pass | ✅ pass | ✅ pass | ✅ pass |
Known failures (2)
| Device | Test | Status | Comment |
|---|---|---|---|
| qrb2210-rb1 | BT_ON_OFF | known failure | controller stays unconfigured (DOWN RAW, no valid BD address) and is not visible to bluetoothctl, #719 |
| qrb2210-rb1 | EFI_Variable_Validation | known failure | expected to work on this board, does not yet, #645 |
All jobs summary
| Job ID | Device | State | Health |
|---|---|---|---|
| 502135 | glymur-crd | Finished | Complete |
| 502136 | qcs615-ride | Finished | Complete |
| 502133 | qrb2210-rb1 | Finished | Complete |
| 502131 | qcs615-ride | Finished | Complete |
| 502130 | qcs6490-rb3gen2 | Finished | Complete |
| 502132 | glymur-crd | Finished | Complete |
| 502137 | qcs6490-rb3gen2 | Finished | Complete |
| 502129 | qcs8300-ride | Finished | Complete |
| 502139 | qcs8300-ride | Finished | Complete |
| 502138 | qrb2210-rb1 | Finished | Complete |
Initial support for Windows on Arm laptops: