Skip to content

Commit

Permalink
Merge pull request #159 from cgwalters/remove-ignition-support
Browse files Browse the repository at this point in the history
install: Drop ignition support
  • Loading branch information
cgwalters authored Oct 24, 2023
2 parents a39cf87 + 60f454f commit 89136de
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 355 deletions.
2 changes: 0 additions & 2 deletions lib/src/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ use fn_error_context::context;

use crate::task::Task;

/// This variable is referenced by our GRUB fragment
pub(crate) const IGNITION_VARIABLE: &str = "$ignition_firstboot";
const GRUB_BOOT_UUID_FILE: &str = "bootuuid.cfg";
/// The name of the mountpoint for efi (as a subdirectory of /boot, or at the toplevel)
pub(crate) const EFI_DIR: &str = "efi";
Expand Down
321 changes: 0 additions & 321 deletions lib/src/ignition.rs

This file was deleted.

31 changes: 1 addition & 30 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,6 @@ pub(crate) struct InstallTargetOpts {

#[derive(clap::Args, Debug, Clone, Serialize, Deserialize)]
pub(crate) struct InstallConfigOpts {
/// Path to an Ignition config file
#[clap(long, value_parser)]
pub(crate) ignition_file: Option<Utf8PathBuf>,

/// Digest (type-value) of the Ignition config
///
/// Verify that the Ignition config matches the specified digest,
/// formatted as <type>-<hexvalue>. <type> can be sha256 or sha512.
#[clap(long, value_name = "digest", value_parser)]
pub(crate) ignition_hash: Option<crate::ignition::IgnitionHash>,

/// Disable SELinux in the target (installed) system.
///
/// This is currently necessary to install *from* a system with SELinux disabled
Expand Down Expand Up @@ -207,6 +196,7 @@ pub(crate) struct State {
pub(crate) skopeo_supports_containers_storage: bool,
#[allow(dead_code)]
pub(crate) setenforce_guard: Option<crate::lsm::SetEnforceGuard>,
#[allow(dead_code)]
pub(crate) config_opts: InstallConfigOpts,
pub(crate) target_opts: InstallTargetOpts,
pub(crate) install_config: config::InstallConfiguration,
Expand Down Expand Up @@ -844,15 +834,6 @@ async fn install_to_filesystem_impl(state: &State, rootfs: &mut RootSetup) -> Re
if state.override_disable_selinux {
rootfs.kargs.push("selinux=0".to_string());
}
// This is interpreted by our GRUB fragment
if state.config_opts.ignition_file.is_some() {
rootfs
.kargs
.push(crate::ignition::PLATFORM_METAL_KARG.to_string());
rootfs
.kargs
.push(crate::bootloader::IGNITION_VARIABLE.to_string());
}

// Write the aleph data that captures the system state at the time of provisioning for aid in future debugging.
{
Expand All @@ -878,16 +859,6 @@ async fn install_to_filesystem_impl(state: &State, rootfs: &mut RootSetup) -> Re
)?;
tracing::debug!("Installed bootloader");

// If Ignition is specified, enable it
if let Some(ignition_file) = state.config_opts.ignition_file.as_deref() {
let src = std::fs::File::open(ignition_file)
.with_context(|| format!("Opening {ignition_file}"))?;
let bootfs = rootfs.rootfs.join("boot");
crate::ignition::write_ignition(&bootfs, &state.config_opts.ignition_hash, &src)?;
crate::ignition::enable_firstboot(&bootfs)?;
println!("Installed Ignition config from {ignition_file}");
}

// ostree likes to have the immutable bit on the physical sysroot to ensure
// that it doesn't accumulate junk; all system state should be in deployments.
Task::new("Setting root immutable bit", "chattr")
Expand Down
2 changes: 0 additions & 2 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ mod bootloader;
#[cfg(feature = "install")]
mod containerenv;
#[cfg(feature = "install")]
pub(crate) mod ignition;
#[cfg(feature = "install")]
mod install;
mod k8sapitypes;
#[cfg(feature = "install")]
Expand Down

0 comments on commit 89136de

Please sign in to comment.