I've added the work-around to the ubuntu-images repo which should fix
things for now, but actually the root-cause here is something more
fundamental, and I've now confirmed this also affects the resolute
images: it's because our "fixrtc" option on the kernel command line
doesn't do anything since moving to dracut.
Previously, after discovering the rootfs, the initramfs-tools init
script would check the last-mount time (or creation time) of the rootfs.
This was, due to the way image building works, *always* later than the
mtimes of files in that file-system (the image build writes stuff to a
chroot, then measures the size of the result, adds some slack, makes the
fs and syncs everything into it, so the fs creation time is always
later). We've still got "fixrtc" in the kernel command line but it's
been redundant since the move to dracut (I'm not going to remove it
though, as people may still opt to use initramfs-tools instead, so it
still serves a purpose).
Ideally, we'd add this functionality to dracut...
** Description changed:
On the current daily images for Ubuntu Stonking (26.10) Server for
Raspberry Pi, the keyboard layout specified by cloud-init is *sometimes*
not applied. If the layout is not applied, it also becomes impossible to
set the keyboard layout at runtime.
The root cause is relatively complex and down to caching (surprise
surprise) and the timing of time-sync during first boot:
1. The console-setup package (responsible for setting keyboard layouts)
creates /etc/console-setup/cached_UTF-8_del.keymap at image build time.
Currently this has a timestamp of Oct 7 (the image build time), and the
cached layout it contains is the US layout.
2. During first boot, systemd attempts to set the time. *If* a network
interface is configured and comes up quickly enough, and chrony runs
quickly, the system is correct and everything else works fine. If not
(and this seems to happen more commonly on the faster board), systemd
sets the time to its fallback epoch (the package's changelog date) which
is currently Oct 2 (earlier than the cache mtime above).
3. During first boot, cloud-init's cc_keyboard writes
/etc/default/keyboard which gets the system clock (Oct 2) then calls
setupcon which checks the cached timestamp against the config timestamp,
decides the cache is newer and does nothing.
At runtime, unless the /etc/default/keyboard is touched further attempts
to set the keyboard layout just get ignored (because setupcon keeps
checking the timestamps and ignoring things).
Potential fixes:
1. Delete the keymap cache in the image build (crude, slows down boot)
2. At the end of the image build, touch /var/lib/systemd/timesync/clock
which gives systemd a more accurate fallback clock (after all files
written in the image build)
3. Get cloud-init's cc_keyboard module to destroy the cache before
attempt to call setupcon
4. Tweak the cloud-init seed to include a touch /etc/default/keyboard
command
+ 5. Add "fixrtc" to dracut (see comment below)
+
Currently looking at 2 as this is the least invasive and probably most
"correct" fix. If the fallback clock is too old there are potentially
other "stale" files in the image (from the point of view of the runtime
system).
** Also affects: dracut (Ubuntu)
Importance: Undecided
Status: New
** Also affects: dracut (Ubuntu Resolute)
Importance: Undecided
Status: New
** Changed in: dracut (Ubuntu)
Assignee: (unassigned) => Dave Jones (waveform)
** Changed in: dracut (Ubuntu Resolute)
Assignee: (unassigned) => Dave Jones (waveform)
** Changed in: dracut (Ubuntu Resolute)
Milestone: None => ubuntu-26.04.2
** Changed in: dracut (Ubuntu Resolute)
Status: New => Triaged
** Changed in: dracut (Ubuntu Resolute)
Importance: Undecided => Medium
** Changed in: dracut (Ubuntu)
Status: New => Triaged
** Changed in: dracut (Ubuntu)
Importance: Undecided => Low
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2170178
Title:
Keyboard layout not working on Ubuntu Server for Raspberry Pi
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-images/+bug/2170178/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs