Merge ~vanvugt/ubuntu/+source/initramfs-tools:smaller-earlier-framebuffer into ~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel

Proposed by Daniel van Vugt
Status: Merged
Merge reported by: Benjamin Drung
Merged at revision: 8a45f5dae6de4b9c00cd872cd7d7552b7b975bb4
Proposed branch: ~vanvugt/ubuntu/+source/initramfs-tools:smaller-earlier-framebuffer
Merge into: ~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel
Diff against target: 15 lines (+2/-2)
1 file modified
hooks/framebuffer (+2/-2)
Reviewer Review Type Date Requested Status
Benjamin Drung Approve
Ubuntu Core Development Team Pending
Review via email: mp+462482@code.launchpad.net

This proposal supersedes a proposal from 2024-03-15.

Description of the change

Make framebuffer dependencies much smaller in preparation for enabling FRAMEBUFFER=y (LP: #1970069, LP: #1869655).

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Should FRAMEBUFFER=y be moved to plymouth? As in /etc/initramfs-tools/conf.d/plymouth.conf ?

Revision history for this message
Benjamin Drung (bdrung) wrote :

FRAMEBUFFER=y makes more sense in plymouth (similar to /usr/share/initramfs-tools/conf-hooks.d/cryptsetup from cryptsetup-initramfs).

Revision history for this message
Benjamin Drung (bdrung) wrote :

I wanted to test this change in a QEMU instance (virtio video), but the boot screen degraded to text only. Which bits are needed (kernel, plymouth, etc) to make it work?

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Assuming you're describing a small number of kernel error-level messages then adding loglevel=3 (after quiet) to the command line should suffice. That change is coming in noble proposed kernel 6.8.0-19.19 and is what I've been testing with. Although I haven't tried QEMU, only real machines so far.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Dropped the FRAMEBUFFER=y, it will be reintroduced later in plymouth. But please do test with FRAMEBUFFER=y.

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Actually it looks like virtio-gpu got dropped by this change. I could reintroduce it but surely one of the other simpler drivers should work in QEMU (with quiet loglevel=3)?

Revision history for this message
Benjamin Drung (bdrung) wrote :

I tested with linux 6.8.0-19.19 with following modifications:
1) loglevel=3 added to /etc/default/grub
2) "copy_modules_dir kernel/drivers/gpu/drm $MODULES_EXCLUDE" removed from /usr/share/initramfs-tools/hooks/plymouth
3) FRAMEBUFFER=y set in /etc/initramfs-tools/initramfs.conf

```
$ lsinitramfs /boot/initrd.img-6.8.0-19-generic | grep 'gpu.*ko'
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/drm_dma_helper.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/drm_mipi_dbi.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/drm_ttm_helper.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/drm_vram_helper.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/bochs.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/cirrus.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/gm12u320.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/hx8357d.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/ili9163.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/ili9225.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/ili9341.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/ili9486.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/mi0283qt.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/panel-mipi-dbi.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/repaper.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/st7586.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/tiny/st7735r.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/ttm/ttm.ko.zst
usr/lib/modules/6.8.0-19-generic/kernel/drivers/gpu/drm/vboxvideo/vboxvideo.ko.zst
```

The result in QEMU with virtio-gpu is inconsistent and confusing. The sreen is black for 2-3 seconds before plymouth appears. In most cases I only see plymouth in text mode. If I add the virtio-gpu kernel module, I see the plymouth graphical mode. On reboot sometimes the screen gets no graphic (turned off) for several seconds.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

> The sreen is black for 2-3 seconds before plymouth appears.

That's a separate plymouth bug I'll work on later. I see the same on i915. You might be able to work around it by adding 'plymouth.use-simpledrm' to the command line.

> If I add the virtio-gpu kernel module, I see the plymouth graphical mode.

If virtio support is a priority then I will add virtio-gpu to the list of modules.

> On reboot sometimes the screen gets no graphic (turned off) for several seconds.

Sounds like one or two Plymouth "features":

 * Plymouth won't display anything if it thinks the animation will be short lived.
 * Plymouth displays a black screen while waiting for a "better" DRM driver to be loaded.

I will look at those later.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Keep in mind flicker-free boot is a long term project with many fixes required. Do not expect everything to just work immediately.

https://bugs.launchpad.net/ubuntu/+bugs?field.tag=flickerfreeboot

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

I've added 'virtio-gpu' so hope we're getting close to done here.

The fact that the results are "inconsistent and confusing" is a product of Plymouth's design and that the above list of bugs still needs more work. Don't expect everything to be fixed at once.

The benchmark for flicker-free boot right now is Fedora, which last I checked also booted in text mode in a VM. Our benchmark for this merge request, I think, is that nothing looks worse than it did with the old manual_add_modules line.

Revision history for this message
Benjamin Drung (bdrung) wrote :

One last question before merging: The current initramfs in QEMU is working without any DRM drivers and therefore is smaller than with these framebuffer drivers. Why is Plymouth working without DRM drivers?

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Plymouth supports both fbdev and DRM. But it prefers (non-simple) DRM and will wait 8 seconds for DRM to start up before settling for fbdev or SimpleDRM.

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

And yes this change does increase the initrd size on some machines at first, but after FRAMEBUFFER=y is introduced in plymouth it keeps the initrd size much lower than it would otherwise be.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Thanks. Merged. I'll release this change to noble once 0.142ubuntu22 migrated.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/framebuffer b/hooks/framebuffer
2index 7820fd6..c559efd 100755
3--- a/hooks/framebuffer
4+++ b/hooks/framebuffer
5@@ -19,8 +19,8 @@ esac
6
7 . /usr/share/initramfs-tools/hook-functions
8
9-manual_add_modules "=drivers/char/agp" "=drivers/gpu" "=ubuntu/i915" \
10- fbcon vesafb vga16fb vboxvideo
11+manual_add_modules "=drivers/gpu/drm/tiny" \
12+ fbcon vesafb vga16fb vboxvideo simplefb efifb virtio-gpu
13
14 # if there is a privacy screen then its driver must be loaded before the
15 # kms driver will bind, otherwise its probe() will return -EPROBE_DEFER

Subscribers

People subscribed via source and target branches