Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for minimal ISO packing/unpacking #559

Merged
merged 4 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .cci.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ cosaPod(buildroot: true, runAsUser: 0) {
stage("Build metal+live") {
shwrap("cd /srv/fcos && cosa buildextend-metal")
shwrap("cd /srv/fcos && cosa buildextend-metal4k")
shwrap("cd /srv/fcos && cosa buildextend-live --fast")
// Enable --miniso until it's the default
shwrap("cd /srv/fcos && cosa buildextend-live --fast --miniso")
// Test metal with an uncompressed image and metal4k with a
// compressed one
shwrap("cd /srv/fcos && cosa compress --fast --artifact=metal4k")
Expand All @@ -31,7 +32,7 @@ cosaPod(buildroot: true, runAsUser: 0) {
// No need to run the iso-live-login/iso-as-disk scenarios
fcosKolaTestIso(
cosaDir: "/srv/fcos",
scenarios: "pxe-install,pxe-offline-install,iso-install,iso-offline-install",
scenarios: "pxe-install,pxe-offline-install,iso-install,iso-offline-install,miniso-install",
jlebon marked this conversation as resolved.
Show resolved Hide resolved
scenarios4k: "iso-install,iso-offline-install",
skipUEFI: true
)
Expand Down
36 changes: 36 additions & 0 deletions src/cmdline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ pub enum IsoKargsCmd {
pub enum IsoExtractCmd {
/// Extract PXE files from an ISO image
Pxe(IsoExtractPxeConfig),
/// Extract a minimal ISO from a CoreOS live ISO image
MinimalIso(IsoExtractMinimalIsoConfig),
// This doesn't really make sense under `extract`, but it's hidden and conceptually feels
// cleaner being alongside `coreos-installer iso extract minimal-iso`.
/// Pack a minimal ISO into a CoreOS live ISO image
#[structopt(setting(AppSettings::Hidden))]
PackMinimalIso(IsoExtractPackMinimalIsoConfig),
}

#[derive(Debug, StructOpt)]
Expand Down Expand Up @@ -409,6 +416,35 @@ pub struct IsoExtractPxeConfig {
pub output_dir: String,
}

#[derive(Debug, StructOpt)]
pub struct IsoExtractMinimalIsoConfig {
/// ISO image
#[structopt(value_name = "ISO")]
pub input: String,
/// Extract rootfs image as well
#[structopt(long, value_name = "PATH")]
pub output_rootfs: Option<String>,
/// Minimal ISO output file
#[structopt(value_name = "OUTPUT_ISO", default_value = "-")]
pub output: String,
/// Inject rootfs URL karg into minimal ISO
#[structopt(long, value_name = "URL")]
pub rootfs_url: Option<String>,
}

#[derive(Debug, StructOpt)]
pub struct IsoExtractPackMinimalIsoConfig {
/// ISO image
#[structopt(value_name = "FULL_ISO")]
pub full: String,
/// Minimal ISO image
#[structopt(value_name = "MINIMAL_ISO")]
pub minimal: String,
/// Delete minimal ISO after packing
#[structopt(long)]
pub consume: bool,
}

#[derive(Debug, StructOpt)]
pub struct OsmetPackConfig {
/// Path to osmet file to write
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod install;
pub mod io;
pub mod iso9660;
pub mod live;
pub mod miniso;
pub mod osmet;
#[cfg(target_arch = "s390x")]
pub mod s390x;
Expand Down
Loading