-
Notifications
You must be signed in to change notification settings - Fork 883
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
Fix cc_keyboard in mantic #4361
Conversation
localectl set-x11-keymap is currently broken for new debian based installs. Workaround it by writing /etc/default/keyboard directly LP: #2030788
f'XKBVARIANT="{variant}"', | ||
f'XKBOPTIONS="{options}"', | ||
"", | ||
'BACKSPACE="guess"', # This is provided on default installs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a nitpick... Is it possible to allow the user to configure this, but still default to "guess" incase they do not configure this option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While a good thought, the implementation is highly debian-specific given that this implementation is writing directly to /etc/default/keyboard. Surfacing such and option is something that won't be supportable easily on any other distribution that is calling localectl
directly, because that command doesn't support setting backspace values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs fixing for 0o644. I'll push a commit to resolve this and test on stable releases.
cloudinit/distros/debian.py
Outdated
util.write_file( | ||
filename="/etc/default/keyboard", | ||
content=contents, | ||
mode=644, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mode here needs to be octal not decimal, this resulted in some very bad behavior on mantic when cloud-init wrote the file with perms 1204 :)
root@testlocale-manticdaily:~# localectl status
Could not get properties: Access Denied
root@testlocale-manticdaily:~# ls -l /etc/default/keyboard
-rw-r----T 1 root root 120 Aug 25 02:31 /etc/default/keyboard
More details in the bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed behavior on stable releases is retained and keyboard/map is set properly on Focal, Jammy and Lunar as well as mantic while writing /etc/default/keyboard directly.
Proposed Commit Message
Additional Context
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2030788
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038762
man 5 keyboard
Test Steps
I haven't been able to verify this manually, so it may be worth asking the submitter to verify first