Skip to content

Commit

Permalink
install: Drop default config
Browse files Browse the repository at this point in the history
Let's require the OS/distro to inject the defaults they want.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Oct 22, 2023
1 parent c5ecb15 commit c41458a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <image> bootc install --target-no-signature-verification /path/to/disk
```

Note that while `--privileged` is used, this command will not
Expand Down Expand Up @@ -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 <image>
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... [email protected]' > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/keys && \
Expand Down
9 changes: 7 additions & 2 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions lib/src/install/00-defaults.toml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/kolainst/install
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c41458a

Please sign in to comment.