From 4b837f8a1328b0215d8ebd758532537fbe78ee67 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 14 Oct 2023 17:51:42 -0400 Subject: [PATCH] install: Drop default config Let's require the OS/distro to inject the defaults they want. Signed-off-by: Colin Walters --- Makefile | 2 +- docs/install.md | 4 ++-- lib/src/install.rs | 9 +++++++-- lib/src/install/00-defaults.toml | 3 --- tests/kolainst/install | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 lib/src/install/00-defaults.toml diff --git a/Makefile b/Makefile index c77f2d5cb..d307f4a3e 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ all-test: install: install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc - install -D -m 0644 -t $(DESTDIR)$(prefix)/lib/bootc/install lib/src/install/*.toml + install -d $(DESTDIR)$(prefix)/lib/bootc/install if test -d man; then install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 man/*.8; fi bin-archive: all diff --git a/docs/install.md b/docs/install.md index c168e4776..95d20d521 100644 --- a/docs/install.md +++ b/docs/install.md @@ -43,7 +43,7 @@ other options. Here's an example: ``` -$ podman run --privileged --pid=host --net=none --security-opt label=type:unconfined_t ghcr.io/cgwalters/c9s-oscore bootc install --target-no-signature-verification /path/to/disk +$ podman run --privileged --pid=host --net=none --security-opt label=type:unconfined_t bootc install --target-no-signature-verification /path/to/disk ``` Note that while `--privileged` is used, this command will not @@ -110,7 +110,7 @@ The `AuthorizedKeysFile` invocation below then configures sshd to look for keys in this location. ``` -FROM ghcr.io/cgwalters/c9s-oscore +FROM RUN mkdir -p /usr/etc-system/ && \ echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf && \ echo 'ssh-ed25519 AAAAC3Nza... root@example.com' > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/keys && \ diff --git a/lib/src/install.rs b/lib/src/install.rs index 9b2044f57..b9ed5d328 100644 --- a/lib/src/install.rs +++ b/lib/src/install.rs @@ -410,8 +410,13 @@ pub(crate) mod config { /// Verify that we can parse our default config file fn test_parse_config() { use super::baseline::Filesystem; - let buf = include_str!("install/00-defaults.toml"); - let c: InstallConfigurationToplevel = toml::from_str(buf).unwrap(); + + let c: InstallConfigurationToplevel = toml::from_str( + r##"[install] +root-fs-type = "xfs" +"##, + ) + .unwrap(); let mut install = c.install.unwrap(); assert_eq!(install.root_fs_type.unwrap(), Filesystem::Xfs); let other = InstallConfigurationToplevel { diff --git a/lib/src/install/00-defaults.toml b/lib/src/install/00-defaults.toml deleted file mode 100644 index 900df0e1e..000000000 --- a/lib/src/install/00-defaults.toml +++ /dev/null @@ -1,3 +0,0 @@ -# The default configuration for installations. -[install] -root-fs-type = "xfs" diff --git a/tests/kolainst/install b/tests/kolainst/install index 55a7a6b13..352640621 100755 --- a/tests/kolainst/install +++ b/tests/kolainst/install @@ -11,7 +11,7 @@ set -xeuo pipefail # See https://github.com/cgwalters/bootc-base-images -IMAGE=ghcr.io/cgwalters/fedora-oscore:latest +IMAGE=registry.gitlab.com/centos/cloud/sagano/fedora-boot-tier-0:38 # TODO: better detect this, e.g. look for an empty device DEV=/dev/vda