Skip to content
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

initramfs: setup keymapping and video for prompts #9723

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

rlaager
Copy link
Member

@rlaager rlaager commented Dec 15, 2019

Motivation and Context

From Steve Langasek steve.langasek@canonical.com:

The poorly-named 'FRAMEBUFFER' option in initramfs-tools controls
whether the console_setup and plymouth scripts are included and used
in the initramfs. These are required for any initramfs which will be
prompting for user input: console_setup because without it the user's
configured keymap will not be set up, and plymouth because you are
not guaranteed to have working video output in the initramfs without
it (e.g. some nvidia+UEFI configurations with the default GRUB
behavior).

The zfs initramfs script may need to prompt the user for passphrases
for encrypted zfs datasets, and we don't know definitively whether
this is the case or not at the time the initramfs is constructed (and
it's difficult to dynamically populate initramfs config variables
anyway), therefore the zfs-initramfs package should just set
FRAMEBUFFER=yes in a conf snippet the same way that the
cryptsetup-initramfs package does
(/usr/share/initramfs-tools/conf-hooks.d/cryptsetup).

https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1856408

Description

This sets the KEYMAP and FRAMEBUFFER variables to y in the initramfs script, just like cryptsetup does.

How Has This Been Tested?

I tested this on an Ubuntu 18.04 system with an encrypted root.

I ran update-initramfs -c -k all. It complained that I did not have console-setup installed, saying, setupcon is missing. Please install the 'console-setup' package.

I tested with and without console-setup installed. This did not break anything. I was not experiencing any problem to start with, though, so I cannot confirm it fixes the issue. However, the analysis above seems correct to me, and in any case, we are just matching cryptsetup.

I also added "quiet splash" back to the kernel command line and tested that. That also worked.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

From Steve Langasek <steve.langasek@canonical.com>:
> The poorly-named 'FRAMEBUFFER' option in initramfs-tools controls
> whether the console_setup and plymouth scripts are included and used
> in the initramfs. These are required for any initramfs which will be
> prompting for user input: console_setup because without it the user's
> configured keymap will not be set up, and plymouth because you are
> not guaranteed to have working video output in the initramfs without
> it (e.g. some nvidia+UEFI configurations with the default GRUB
> behavior).

> The zfs initramfs script may need to prompt the user for passphrases
> for encrypted zfs datasets, and we don't know definitively whether
> this is the case or not at the time the initramfs is constructed (and
> it's difficult to dynamically populate initramfs config variables
> anyway), therefore the zfs-initramfs package should just set
> FRAMEBUFFER=yes in a conf snippet the same way that the
> cryptsetup-initramfs package does
> (/usr/share/initramfs-tools/conf-hooks.d/cryptsetup).

https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1856408

Signed-off-by: Richard Laager <rlaager@wiktel.com>
Copy link
Contributor

@PrivatePuffin PrivatePuffin left a comment

Choose a reason for hiding this comment

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

Setting keymap and framebuffer shouldn't cause any issues, even if unused. afaik.

@codecov
Copy link

codecov bot commented Dec 15, 2019

Codecov Report

Merging #9723 into master will decrease coverage by <1%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #9723    +/-   ##
========================================
- Coverage      79%      79%   -<1%     
========================================
  Files         420      420            
  Lines      123654   123654            
========================================
- Hits        98069    98017    -52     
- Misses      25585    25637    +52
Flag Coverage Δ
#kernel 80% <ø> (ø) ⬆️
#user 67% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddb4e69...c590be6. Read the comment docs.

@rlaager
Copy link
Member Author

rlaager commented Dec 16, 2019

I need to follow up on whether KEYMAP is still used in Debian. Ubuntu says it is not.

@behlendorf
Copy link
Contributor

According to the Debian wiki KEYMAP appears to still be used. It seems prudent to set it.

https://wiki.debian.org/Keyboard#How_to_set_keyboard_layout_in_initramfs

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Dec 16, 2019
@rlaager
Copy link
Member Author

rlaager commented Dec 16, 2019

That sounds good to me.

@ghfields
Copy link
Contributor

ghfields commented Dec 17, 2019

FYI: These are set in `/usr/share/initramfs-tools/conf-hooks.d/cryptsetup' under Ubuntu when cryptsetup is installed.

EDIT (accidentally submitted comment early): These two entries are enough to allow plymouth ask-for-password to function on Ubuntu, instead of dropping to TTY.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 17, 2019
@behlendorf behlendorf merged commit ad97643 into openzfs:master Dec 17, 2019
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 26, 2019
From Steve Langasek <steve.langasek@canonical.com>:
> The poorly-named 'FRAMEBUFFER' option in initramfs-tools controls
> whether the console_setup and plymouth scripts are included and used
> in the initramfs. These are required for any initramfs which will be
> prompting for user input: console_setup because without it the user's
> configured keymap will not be set up, and plymouth because you are
> not guaranteed to have working video output in the initramfs without
> it (e.g. some nvidia+UEFI configurations with the default GRUB
> behavior).

> The zfs initramfs script may need to prompt the user for passphrases
> for encrypted zfs datasets, and we don't know definitively whether
> this is the case or not at the time the initramfs is constructed (and
> it's difficult to dynamically populate initramfs config variables
> anyway), therefore the zfs-initramfs package should just set
> FRAMEBUFFER=yes in a conf snippet the same way that the
> cryptsetup-initramfs package does
> (/usr/share/initramfs-tools/conf-hooks.d/cryptsetup).

https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1856408

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes openzfs#9723
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Dec 27, 2019
From Steve Langasek <steve.langasek@canonical.com>:
> The poorly-named 'FRAMEBUFFER' option in initramfs-tools controls
> whether the console_setup and plymouth scripts are included and used
> in the initramfs. These are required for any initramfs which will be
> prompting for user input: console_setup because without it the user's
> configured keymap will not be set up, and plymouth because you are
> not guaranteed to have working video output in the initramfs without
> it (e.g. some nvidia+UEFI configurations with the default GRUB
> behavior).

> The zfs initramfs script may need to prompt the user for passphrases
> for encrypted zfs datasets, and we don't know definitively whether
> this is the case or not at the time the initramfs is constructed (and
> it's difficult to dynamically populate initramfs config variables
> anyway), therefore the zfs-initramfs package should just set
> FRAMEBUFFER=yes in a conf snippet the same way that the
> cryptsetup-initramfs package does
> (/usr/share/initramfs-tools/conf-hooks.d/cryptsetup).

https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1856408

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes openzfs#9723
tonyhutter pushed a commit that referenced this pull request Jan 23, 2020
From Steve Langasek <steve.langasek@canonical.com>:
> The poorly-named 'FRAMEBUFFER' option in initramfs-tools controls
> whether the console_setup and plymouth scripts are included and used
> in the initramfs. These are required for any initramfs which will be
> prompting for user input: console_setup because without it the user's
> configured keymap will not be set up, and plymouth because you are
> not guaranteed to have working video output in the initramfs without
> it (e.g. some nvidia+UEFI configurations with the default GRUB
> behavior).

> The zfs initramfs script may need to prompt the user for passphrases
> for encrypted zfs datasets, and we don't know definitively whether
> this is the case or not at the time the initramfs is constructed (and
> it's difficult to dynamically populate initramfs config variables
> anyway), therefore the zfs-initramfs package should just set
> FRAMEBUFFER=yes in a conf snippet the same way that the
> cryptsetup-initramfs package does
> (/usr/share/initramfs-tools/conf-hooks.d/cryptsetup).

https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1856408

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes #9723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants