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

Add install --console and ... customize --dest-console to configure GRUB and kernel console #977

Merged
merged 8 commits into from
Sep 12, 2022

Commits on Sep 8, 2022

  1. install: absorb bls_entry_options_write_platform into caller

    It was originally factored out for unit testing, but these days we just
    use KargsEditor which has its own tests.  Simplify by using KargsEditor
    directly, with a separate initial probe to ensure we can find the
    ignition.platform.id.
    bgilbert committed Sep 8, 2022
    Configuration menu
    Copy the full SHA
    99b43be View commit details
    Browse the repository at this point in the history
  2. install: split console configuration into separate function

    This has us rewriting the BLS config twice if `--platform` is specified,
    but that option is non-performance-critical and also an edge case, so
    let's aim for legibility.
    
    Preparatory for next commit.
    bgilbert committed Sep 8, 2022
    Configuration menu
    Copy the full SHA
    4c57a1f View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2022

  1. install: add --console to configure GRUB and kernel console

    Once CoreOS stops enabling the serial console by default, users will
    need a way to enable it themselves.  This really only affects bare
    metal, since other platforms have a consistent console configuration,
    so coreos-installer is a good place to handle it.  Users can already
    pass console= kargs, but we need a way to specify GRUB commands,
    ideally without having to actually use GRUB syntax.
    
    Add a --console option that accepts kernel console= syntax, since
    that's already familiar.  Parse the option and convert it to both a
    console karg and GRUB commands, using the existing mechanism for GRUB
    command substitution.  If --platform is also specified, have --console
    override that platform's default console settings.  If --console is
    specified more than once, aggregate the console settings, following the
    multiple-console semantics for GRUB (use both consoles) and the kernel
    (use all consoles, with the last console primary).
    
    There are serial console features only supported by GRUB (stop bits) or
    by the kernel (RTS/CTS flow control).  Support the common subset and
    reject the rest.  Also, round-trip console kargs to a less-compact but
    semantically equivalent format, since explicit is good and it saves
    some code complexity.
    
    Document this as "bootloader console" rather than "GRUB console" to
    allow for future bootloaders other than GRUB.
    bgilbert committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    dced43b View commit details
    Browse the repository at this point in the history
  2. live: support missing feature flags

    If a flag was absent from features.json, we were failing to parse rather
    than defaulting the flag to false.  This didn't matter in practice because
    both flags were introduced into production at the same time as the file
    in FCOS 35.20211215.2.0.
    bgilbert committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    c32d8d2 View commit details
    Browse the repository at this point in the history
  3. live: add --dest-console to pass through --console to installer

    Use the installer-config-directives features.json object introduced by
    coreos/coreos-assembler#3083 to check whether
    the image's coreos-installer is new enough to support --console.
    bgilbert committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    cad56c5 View commit details
    Browse the repository at this point in the history
  4. tests: automatically run individual tests on all fixtures they support

    Rather than manually adding new fixtures to every test individually, have
    each test declare its minimum supported fixture, and then automatically
    run the test on any newer fixtures.
    
    Fixes failure to invoke some tests on 2022-02 fixture.
    bgilbert committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    4e5c72b View commit details
    Browse the repository at this point in the history
  5. fixtures/iso: add fixture with installer-config-directives from 0.16.0

    In particular, it includes the "console" directive.
    bgilbert committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    4aaf6fe View commit details
    Browse the repository at this point in the history
  6. Warn on console= karg if --console could have been used instead

    If one or more console= kargs are specified to the install or iso/pxe
    customize subcommands, and Console can successfully parse all of those
    kargs, warn the user that they might benefit from specifying them using
    the console mechanism instead.
    
    For legibility, wrap the message at 80 characters, but avoid wrapping in
    the middle of the example argument lists.  Use the textwrap crate to do
    this.  textwrap is already a clap dependency without default features, and
    we also avoid non-default features here, so this doesn't increase the
    binary weight.
    bgilbert committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    c8a24ea View commit details
    Browse the repository at this point in the history