Skip to content

Commit

Permalink
chore!: disable generation of ctrl.toml
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `rugpi-ctrl` recipe used to generate the
configuration file `ctrl.toml` with the `system_size` taken from its
parameters. Users must now install this file themselves with their
own recipe. To prevent surprises for users, the build will fail with an
“unknown parameter” error message.
  • Loading branch information
koehlma committed Nov 26, 2023
1 parent dd8df0e commit 6e069f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 10 additions & 0 deletions crates/rugpi-bakery/src/tasks/customize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ fn recipe_schedule(config: &BakeryConfig) -> Anyhow<Vec<RecipeJob>> {
.map(|name| {
let recipe = library.get(name).unwrap().clone();
let recipe_params = config.parameters.get(name);
if let Some(params) = recipe_params {
for param_name in params.keys() {
if !recipe.info.parameters.contains_key(param_name) {
bail!(
"unknown parameter `{param_name}` of recipe `{}`",
recipe.name
);
}
}
}
let mut parameters = HashMap::new();
for (name, def) in &recipe.info.parameters {
if let Some(params) = recipe_params {
Expand Down
1 change: 0 additions & 1 deletion recipes/rugpi-ctrl/recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ priority = 700_000 # Execute very early.
default = true

[parameters]
system_size = { default = "4G" }
rugpi_admin = { default = false }
4 changes: 0 additions & 4 deletions recipes/rugpi-ctrl/steps/02-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ ldd /usr/bin/rugpi-ctrl >&2 || true

mkdir -p /etc/rugpi || true

cat >/etc/rugpi/ctrl.toml <<EOF
system_size = "${RECIPE_PARAM_SYSTEM_SIZE}"
EOF

install -D -m 644 "${RECIPE_DIR}/files/rugpi-admin.service" -t /usr/lib/systemd/system/

if [ "${RECIPE_PARAM_RUGPI_ADMIN}" = "true" ]; then
Expand Down

0 comments on commit 6e069f1

Please sign in to comment.