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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ serde_json = "^1.0"
serde_with = ">= 1.9.4, < 2"
serde_yaml = ">= 0.8, < 0.10"
tempfile = ">= 3.1, < 4"
textwrap = { version = ">= 0.15.0, < 0.16.0", default-features = false }
thiserror = "1.0"
url = ">= 2.1, < 3.0"
uuid = { version = ">= 0.8, < 2.0", features = ["v4"] }
Expand Down
2 changes: 2 additions & 0 deletions data/example-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ignition-hash: digest
architecture: name
# Override the Ignition platform ID
platform: name
# Kernel and bootloader console
console: [spec, spec]
# Append default kernel arguments
append-karg: [arg, arg]
# Delete default kernel arguments
Expand Down
6 changes: 6 additions & 0 deletions docs/cmd/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ OPTIONS:
Install a system that will run on the specified cloud or virtualization platform,
such as "vmware".

--console <spec>
Kernel and bootloader console

Set the kernel and bootloader console, using the same syntax as the parameter to
the "console=" kernel argument.

--append-karg <arg>
Append default kernel arg

Expand Down
7 changes: 7 additions & 0 deletions docs/cmd/iso.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ OPTIONS:
Automatically run installer, installing to the specified destination device. The
resulting boot media will overwrite the destination device without confirmation.

--dest-console <spec>
Kernel and bootloader console for dest

Automatically run installer, configuring the specified kernel and bootloader
console for the destination system. The argument uses the same syntax as the
parameter to the "console=" kernel argument.

--dest-karg-append <arg>
Destination kernel argument to append

Expand Down
7 changes: 7 additions & 0 deletions docs/cmd/pxe.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ OPTIONS:
Automatically run installer, installing to the specified destination device. The
resulting boot media will overwrite the destination device without confirmation.

--dest-console <spec>
Kernel and bootloader console for dest

Automatically run installer, configuring the specified kernel and bootloader
console for the destination system. The argument uses the same syntax as the
parameter to the "console=" kernel argument.

--dest-karg-append <arg>
Destination kernel argument to append

Expand Down
14 changes: 14 additions & 0 deletions docs/customizing-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ Available customizations include:
for Ignition to fetch remote resources.
- Specifying HTTPS certificate authorities to be trusted by Ignition, in
both the installed system and the live environment (`--ignition-ca`).
- Specifying consoles to be used by the installed system (`--dest-console`),
using the syntax of the `console`
[kernel argument](https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html).
Consoles are configured for both the bootloader (GRUB) and the booted OS
(kernel). Consoles are subject to the Linux kernel rules: the first
specified console of each type is used, and the last specified console
is the primary console.
Supported graphical consoles are `tty0`, `hvc0`, and `ttysclp0`.
Supported serial consoles are `ttyS<n>` and `ttyAMA<n>`, with optional
baud rate, parity, and number of data bits.
Examples: `--console tty0`, `--console ttyAMA0,115200`,
`--console ttyS1,115200n8`.
- Modifying kernel arguments of the installed system (`--dest-karg-append`,
`--dest-karg-delete`) or the live ISO environment (`--live-karg-append`,
`--live-karg-replace`, `--live-karg-delete`). These options are useful if
Expand Down Expand Up @@ -130,6 +142,8 @@ ignition-hash: digest
architecture: name
# Override the Ignition platform ID
platform: name
# Kernel and bootloader console
console: [spec, spec]
# Append default kernel arguments
append-karg: [arg, arg]
# Delete default kernel arguments
Expand Down
6 changes: 5 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ nav_order: 8

Major changes:

- install: Add `--console` for configuring kernel and bootloader console
- customize: Add `--dest-console` for configuring kernel and bootloader console
- Support reading initrd images compressed with zstd
- Add Fedora 38 signing key; drop Fedora 35 signing key

Expand All @@ -18,6 +20,7 @@ Minor changes:
- Fix unlikely decompression error reading initrd
- Add release notes to documentation
- iso: Detect incomplete ISO files
- Warn if console kargs could have used `--console`/`--dest-console` instead

Internal changes:

Expand All @@ -28,7 +31,8 @@ Internal changes:
Packaging changes:

- Require Rust ≥ 1.58.0
- Add dependency on `zstd` crate and `libzstd` shared library
- Add dependencies on `textwrap` and `zstd` crates
- Add dependency on `libzstd` shared library
- Support `serde_yaml` 0.9
- Remove non-Linux dependencies from vendor archive
- Install example installer config file in `/usr/share/coreos-installer`
Expand Down
2 changes: 2 additions & 0 deletions fixtures/customize/dest.bu
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ systemd:
ConditionKernelCommandLine=dest-karg
ConditionKernelCommandLine=!ignition.platform.id=metal
ConditionKernelCommandLine=ignition.platform.id=qemu
ConditionKernelCommandLine=console=ttyS0,115200n8

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/grep -qz 'serial --unit=0 --speed=115200 --word=8 --parity=no.terminal_input serial.terminal_output serial.#' /boot/grub2/grub.cfg
ExecStart=/bin/echo @applied-dest-ign@
StandardOutput=tty

Expand Down
2 changes: 1 addition & 1 deletion fixtures/customize/dest.ign
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=Dest Ignition Applied\nBefore=multi-user.target\nConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth2.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth2.nmconnection\nConditionKernelCommandLine=install-config-karg-1\nConditionKernelCommandLine=install-config-karg-2\nConditionKernelCommandLine=dest-karg\nConditionKernelCommandLine=!ignition.platform.id=metal\nConditionKernelCommandLine=ignition.platform.id=qemu\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/bin/echo @applied-dest-ign@\nStandardOutput=tty\n\n[Install]\nRequiredBy=multi-user.target\n",
"contents": "[Unit]\nDescription=Dest Ignition Applied\nBefore=multi-user.target\nConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth2.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth2.nmconnection\nConditionKernelCommandLine=install-config-karg-1\nConditionKernelCommandLine=install-config-karg-2\nConditionKernelCommandLine=dest-karg\nConditionKernelCommandLine=!ignition.platform.id=metal\nConditionKernelCommandLine=ignition.platform.id=qemu\nConditionKernelCommandLine=console=ttyS0,115200n8\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/bin/grep -qz 'serial --unit=0 --speed=115200 --word=8 --parity=no.terminal_input serial.terminal_output serial.#' /boot/grub2/grub.cfg\nExecStart=/bin/echo @applied-dest-ign@\nStandardOutput=tty\n\n[Install]\nRequiredBy=multi-user.target\n",
"enabled": true,
"name": "dest-ignition-applied.service"
}
Expand Down
7 changes: 7 additions & 0 deletions fixtures/iso/INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ embed-areas-2022-02.iso.xz
kargs.json pointing to kargs areas and embedding defaults
miniso.dat version 1
features.json: installer-config, live-initrd-network

embed-areas-2022-09.iso.xz
kargs.json pointing to kargs areas and embedding defaults
miniso.dat version 1
features.json: installer-config, installer-config-directives,
live-initrd-network
installer-config-directives from 0.16.0
Binary file added fixtures/iso/embed-areas-2022-09.iso.xz
Binary file not shown.
7 changes: 6 additions & 1 deletion man/coreos-installer-install.8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
coreos\-installer\-install \- Install Fedora CoreOS or RHEL CoreOS
.SH SYNOPSIS
\fBcoreos\-installer\-install\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-c\fR|\fB\-\-config\-file\fR] [\fB\-s\fR|\fB\-\-stream\fR] [\fB\-u\fR|\fB\-\-image\-url\fR] [\fB\-f\fR|\fB\-\-image\-file\fR] [\fB\-i\fR|\fB\-\-ignition\-file\fR] [\fB\-I\fR|\fB\-\-ignition\-url\fR] [\fB\-\-ignition\-hash\fR] [\fB\-a\fR|\fB\-\-architecture\fR] [\fB\-p\fR|\fB\-\-platform\fR] [\fB\-\-append\-karg\fR] [\fB\-\-delete\-karg\fR] [\fB\-n\fR|\fB\-\-copy\-network\fR] [\fB\-\-network\-dir\fR] [\fB\-\-save\-partlabel\fR] [\fB\-\-save\-partindex\fR] [\fB\-\-offline\fR] [\fB\-\-insecure\fR] [\fB\-\-insecure\-ignition\fR] [\fB\-\-stream\-base\-url\fR] [\fB\-\-preserve\-on\-error\fR] [\fB\-\-fetch\-retries\fR] [\fIDEST_DEVICE\fR]
\fBcoreos\-installer\-install\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-c\fR|\fB\-\-config\-file\fR] [\fB\-s\fR|\fB\-\-stream\fR] [\fB\-u\fR|\fB\-\-image\-url\fR] [\fB\-f\fR|\fB\-\-image\-file\fR] [\fB\-i\fR|\fB\-\-ignition\-file\fR] [\fB\-I\fR|\fB\-\-ignition\-url\fR] [\fB\-\-ignition\-hash\fR] [\fB\-a\fR|\fB\-\-architecture\fR] [\fB\-p\fR|\fB\-\-platform\fR] [\fB\-\-console\fR] [\fB\-\-append\-karg\fR] [\fB\-\-delete\-karg\fR] [\fB\-n\fR|\fB\-\-copy\-network\fR] [\fB\-\-network\-dir\fR] [\fB\-\-save\-partlabel\fR] [\fB\-\-save\-partindex\fR] [\fB\-\-offline\fR] [\fB\-\-insecure\fR] [\fB\-\-insecure\-ignition\fR] [\fB\-\-stream\-base\-url\fR] [\fB\-\-preserve\-on\-error\fR] [\fB\-\-fetch\-retries\fR] [\fIDEST_DEVICE\fR]
.SH DESCRIPTION
Install Fedora CoreOS or RHEL CoreOS
.SH OPTIONS
Expand Down Expand Up @@ -56,6 +56,11 @@ Override the Ignition platform ID

Install a system that will run on the specified cloud or virtualization platform, such as "vmware".
.TP
\fB\-\-console\fR=\fIspec\fR
Kernel and bootloader console

Set the kernel and bootloader console, using the same syntax as the parameter to the "console=" kernel argument.
bgilbert marked this conversation as resolved.
Show resolved Hide resolved
.TP
\fB\-\-append\-karg\fR=\fIarg\fR
Append default kernel arg

Expand Down
7 changes: 6 additions & 1 deletion man/coreos-installer-iso-customize.8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
coreos\-installer\-iso\-customize \- Customize a CoreOS live ISO image
.SH SYNOPSIS
\fBcoreos\-installer\-iso\-customize\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-\-dest\-ignition\fR] [\fB\-\-dest\-device\fR] [\fB\-\-dest\-karg\-append\fR] [\fB\-\-dest\-karg\-delete\fR] [\fB\-\-network\-keyfile\fR] [\fB\-\-network\-nmstate\fR] [\fB\-\-ignition\-ca\fR] [\fB\-\-pre\-install\fR] [\fB\-\-post\-install\fR] [\fB\-\-installer\-config\fR] [\fB\-\-live\-ignition\fR] [\fB\-\-live\-karg\-append\fR] [\fB\-\-live\-karg\-delete\fR] [\fB\-\-live\-karg\-replace\fR] [\fB\-f\fR|\fB\-\-force\fR] [\fB\-o\fR|\fB\-\-output\fR] <\fIISO\fR>
\fBcoreos\-installer\-iso\-customize\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-\-dest\-ignition\fR] [\fB\-\-dest\-device\fR] [\fB\-\-dest\-console\fR] [\fB\-\-dest\-karg\-append\fR] [\fB\-\-dest\-karg\-delete\fR] [\fB\-\-network\-keyfile\fR] [\fB\-\-network\-nmstate\fR] [\fB\-\-ignition\-ca\fR] [\fB\-\-pre\-install\fR] [\fB\-\-post\-install\fR] [\fB\-\-installer\-config\fR] [\fB\-\-live\-ignition\fR] [\fB\-\-live\-karg\-append\fR] [\fB\-\-live\-karg\-delete\fR] [\fB\-\-live\-karg\-replace\fR] [\fB\-f\fR|\fB\-\-force\fR] [\fB\-o\fR|\fB\-\-output\fR] <\fIISO\fR>
.SH DESCRIPTION
Customize a CoreOS live ISO image
.SH OPTIONS
Expand All @@ -25,6 +25,11 @@ Install destination device

Automatically run installer, installing to the specified destination device. The resulting boot media will overwrite the destination device without confirmation.
.TP
\fB\-\-dest\-console\fR=\fIspec\fR
Kernel and bootloader console for dest

Automatically run installer, configuring the specified kernel and bootloader console for the destination system. The argument uses the same syntax as the parameter to the "console=" kernel argument.
.TP
\fB\-\-dest\-karg\-append\fR=\fIarg\fR
Destination kernel argument to append

Expand Down
7 changes: 6 additions & 1 deletion man/coreos-installer-pxe-customize.8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
coreos\-installer\-pxe\-customize \- Create a custom live PXE boot config
.SH SYNOPSIS
\fBcoreos\-installer\-pxe\-customize\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-\-dest\-ignition\fR] [\fB\-\-dest\-device\fR] [\fB\-\-dest\-karg\-append\fR] [\fB\-\-dest\-karg\-delete\fR] [\fB\-\-network\-keyfile\fR] [\fB\-\-network\-nmstate\fR] [\fB\-\-ignition\-ca\fR] [\fB\-\-pre\-install\fR] [\fB\-\-post\-install\fR] [\fB\-\-installer\-config\fR] [\fB\-\-live\-ignition\fR] <\fB\-o\fR|\fB\-\-output\fR> <\fIpath\fR>
\fBcoreos\-installer\-pxe\-customize\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-\-dest\-ignition\fR] [\fB\-\-dest\-device\fR] [\fB\-\-dest\-console\fR] [\fB\-\-dest\-karg\-append\fR] [\fB\-\-dest\-karg\-delete\fR] [\fB\-\-network\-keyfile\fR] [\fB\-\-network\-nmstate\fR] [\fB\-\-ignition\-ca\fR] [\fB\-\-pre\-install\fR] [\fB\-\-post\-install\fR] [\fB\-\-installer\-config\fR] [\fB\-\-live\-ignition\fR] <\fB\-o\fR|\fB\-\-output\fR> <\fIpath\fR>
.SH DESCRIPTION
Create a custom live PXE boot config
.SH OPTIONS
Expand All @@ -25,6 +25,11 @@ Install destination device

Automatically run installer, installing to the specified destination device. The resulting boot media will overwrite the destination device without confirmation.
.TP
\fB\-\-dest\-console\fR=\fIspec\fR
Kernel and bootloader console for dest

Automatically run installer, configuring the specified kernel and bootloader console for the destination system. The argument uses the same syntax as the parameter to the "console=" kernel argument.
.TP
\fB\-\-dest\-karg\-append\fR=\fIarg\fR
Destination kernel argument to append

Expand Down
Loading