You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rhel): render actual disk in comment and remove both ks copies on cloud
* The archived dynamic.ks carried a comment reading "# Only touch
$lfdisk." because a Python string used a shell-style variable
reference where a .format() substitution was needed. Now emits
the actual target disk (e.g. "# Only touch vda.").
* Modern Anaconda writes both /root/anaconda-ks.cfg and
/root/original-ks.cfg when a kickstart is used. The cloud
post-install script removed only the former, leaving stale copies
of the bootstrap kickstart on every cloud base image. Remove
/root/original-ks.cfg too so the cloud base is clean.
* README: correct and sharpen the "Modifying this Kickstart" and
"Tests" sections. The lfkeys, users_<lftype> and post_<lftype>
descriptions now match the actual Python data structures and
interpreter behavior, and the `ll /root` test is now explicit
about which files to expect per lftype, including the new
original-ks.cfg cleanup on cloud variants.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
*`lf-rhel.cfg`: Fix `grub2-mkconfig` being silently skipped on every target version. The `%pre` script was built via an unquoted heredoc (`cat << EOT`), which let bash eat every `"$var"` and `$(cmd)` reference embedded in the generated shell code before the Python helper was even written. As a result the grub finder always ran with empty variables and printed "Could not find a grub.cfg in /boot" — hiding the fact that `/etc/default/grub` edits had not been regenerated since the first release. The heredoc is now quoted (`cat << 'EOT'`), the finder targets `/boot/grub2/grub.cfg` directly (which is the right target on RHEL/Rocky 8/9/10 for both BIOS and UEFI — on 9+ UEFI the `/boot/efi/EFI/<vendor>/grub.cfg` is only a thin wrapper that `configfile`s `/boot/grub2/grub.cfg`), and the console-ordering change in `/etc/default/grub` is actually reflected in the generated `grub.cfg`
14
14
*`lf-rhel.cfg`: Fix post-install failure on RHEL 10 / Rocky 10 cloud installs. The previous `%post --nochroot` block copied `dynamic.ks` and `70-install-ssh-keys.ks` into `/root` of the installed system for auditing and kept breaking across Anaconda versions (first `/proc/mounts` parsing, then mount-point layout). The archival is now performed by a chrooted `%post` hook generated in `%pre` under `/usr/share/anaconda/post-scripts/`, with the content embedded via base64-decoded heredoc. The same kickstart now works on RHEL/Rocky 8, 9 and 10
15
15
*`lf-rhel.cfg`: Fix `sed: can't read /etc/systemd/logind.conf` on RHEL/Rocky 10 cloud installs. Recent systemd versions no longer ship `logind.conf` under `/etc/`; the `NAutoVTs=0` override is now applied via a drop-in at `/etc/systemd/logind.conf.d/10-lf-no-auto-vts.conf`, which works on all supported systemd versions
16
+
*`lf-rhel.cfg`: The "Only touch" comment in the archived `dynamic.ks` now renders the actual target disk path (e.g. `# Only touch vda.`) instead of a literal `$lfdisk`. The Python code was using a shell-style variable reference inside a plain string where a Python format substitution was needed
17
+
18
+
### Changed
19
+
20
+
*`lf-rhel.cfg`: On `lftype=cloud` and `lftype=cloud-cis`, the post-install script now also removes `/root/original-ks.cfg` in addition to `/root/anaconda-ks.cfg`. Both files are written by modern Anaconda and both contain the raw bootstrap kickstart — removing both keeps the base image clean for cloud deployments
21
+
* README: Correct and sharpen the "Modifying this Kickstart" and "Tests" sections. The `lfkeys`, `users_<lftype>` and `post_<lftype>` descriptions now match the actual Python data structures and interpreter behavior, and the `ll /root` test is now explicit about which files to expect per `lftype`
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,11 +112,11 @@ At the beginning of the pre-script the available Python version is determined, t
112
112
The Python script then generates the `/tmp/dynamic.ks`.
113
113
This Python script can be modified as follows:
114
114
115
-
*`lfkeys`: An array of SSH keys that will be installed for either the `root` or `linuxfabrik` user depending on`lftype` as documented above.
115
+
*`lfkeys`: An array of SSH public keys that will be authorized for the `linuxfabrik` user on `lftype=cis` and `lftype=minimal`. On`lftype=cloud` and `lftype=cloud-cis` no keys are deployed at install time, because `cloud-init` handles SSH key injection there. The `root` account never receives SSH keys regardless of `lftype`.
116
116
*`packages_<lftype>`: An array with package names for a `<lftype>` install.
117
117
*`part_<lftype>`: An array of kickstart `logvol` lines that define logical volumes for `<lftype>` as documented in Fedora Kickstart Syntax Reference: [logvol](https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/#sect-kickstart-commands-logvol)
118
-
*`users_<lftype>`: A string containing a ":" separated list in the form`name="<username>":cmd="<kickstart command used for user creation>":keys="<array of ssh-keys to add>"` (Fedora Kickstart Syntax Reference: [user](https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/#sect-kickstart-commands-user), [rootpw](https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/#sect-kickstart-commands-rootpw))
119
-
*`post_<lftype>`: A multiline string containing the postscript for `<lftype>`. Will be executed by`/bin/sh`.
118
+
*`users_<lftype>`: A Python list of dicts, one entry per user, with the keys`name` (the username), `cmd` (the kickstart command used to create the user, e.g. `user --name=linuxfabrik --groups=wheel --password=password --plaintext` or `rootpw --lock`) and `keys` (a list of SSH public keys to authorize for that user). See Fedora Kickstart Syntax Reference: [user](https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/#sect-kickstart-commands-user), [rootpw](https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/appendixes/Kickstart_Syntax_Reference/#sect-kickstart-commands-rootpw).
119
+
*`post_<lftype>`: A multiline string containing the chrooted post-install script for `<lftype>`. Anaconda executes it with`/bin/sh`, which on every supported target (RHEL/Rocky 8/9/10, Fedora 38+) is bash invoked in sh-compat mode, so bash features like globs inside `[ -f "$var" ]` loops work as expected.
120
120
121
121
122
122
### Known Limitations
@@ -147,7 +147,7 @@ What to test within the VM:
147
147
*`sudo dnf -y install nano`: Should work.
148
148
*`systemctl status cloud-init`: Not found on non-cloud, should work on cloud.
149
149
*`systemctl status firewalld`: Should be inactive on non-cloud. On cloud, firewalld is removed.
150
-
*`ll /root`: Should list at least two Anaconda files.
150
+
*`ll /root`: On `lftype=cis` and `lftype=minimal`, should list `anaconda-ks.cfg` and `original-ks.cfg` (both written by Anaconda), `dynamic.ks` (the rendered kickstart fragment Linuxfabrik applied) and `70-install-ssh-keys.ks` (the SSH key deployment fragment). On `lftype=cloud` and `lftype=cloud-cis`, should list only `dynamic.ks` — both of Anaconda's kickstart copies (`anaconda-ks.cfg` and `original-ks.cfg`) are removed by the cloud post-install script, and no SSH key fragment is generated because `cloud-init` handles keys.
0 commit comments