From 8a820c2b4bcea248db3aff42cb48c85f15baf416 Mon Sep 17 00:00:00 2001 From: duyiwei Date: Fri, 10 May 2024 15:52:00 +0800 Subject: [PATCH] Block unsupported functions and modify the coreos to nestos Signed-off-by: duyiwei --- src/cmdline/install.rs | 6 +++--- src/cmdline/mod.rs | 8 ++++---- src/main.rs | 16 ++++++++-------- src/s390x/zipl.rs | 2 +- src/source.rs | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/cmdline/install.rs b/src/cmdline/install.rs index 459c7c5..e9132f9 100644 --- a/src/cmdline/install.rs +++ b/src/cmdline/install.rs @@ -78,12 +78,12 @@ pub struct InstallConfig { /// /// The name of the NestOS release stream to install, /// temporarily closed before NestOS Stream is ready. - #[arg(short, long, value_name = "name")] + #[arg(short, long, hide = true, value_name = "name")] #[arg(conflicts_with_all = ["image_file", "image_url"])] pub stream: Option, /// Manually specify the image URL /// - /// coreos-installer appends ".sig" to find the GPG signature for the + /// nestos-installer appends ".sig" to find the GPG signature for the /// image, which must exist and be valid. A missing signature can be /// ignored with --insecure. #[serde_as(as = "Option")] @@ -92,7 +92,7 @@ pub struct InstallConfig { pub image_url: Option, /// Manually specify a local image file /// - /// coreos-installer appends ".sig" to find the GPG signature for the + /// nestos-installer appends ".sig" to find the GPG signature for the /// image, which must exist and be valid. A missing signature can be /// ignored with --insecure. #[arg(short = 'f', long, value_name = "path")] diff --git a/src/cmdline/mod.rs b/src/cmdline/mod.rs index b78b54b..88efdc8 100644 --- a/src/cmdline/mod.rs +++ b/src/cmdline/mod.rs @@ -45,10 +45,10 @@ pub use self::types::*; pub enum Cmd { /// Install NestOS Install(InstallConfig), - /// Download a NestOS image - Download(DownloadConfig), - /// List available images in a NestOS release stream - ListStream(ListStreamConfig), + // Download a NestOS image + //Download(DownloadConfig), + // List available images in a NestOS release stream + //ListStream(ListStreamConfig), /// Commands to manage a NestOS live ISO image #[command(subcommand)] Iso(IsoCmd), diff --git a/src/main.rs b/src/main.rs index 32e1040..9c1d5bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,16 +22,16 @@ use cmdline::*; fn main() -> Result<()> { match Cmd::parse() { //Temporarily closed Download and ListStream before NestOS Stream is ready. - Cmd::Download(_) => { + //Cmd::Download(_) => { // download::download(c); - println!("Download is temporarily closed before NestOS Stream is ready."); - Ok(()) - }, - Cmd::ListStream(_) => { + //println!("Download is temporarily closed before NestOS Stream is ready."); + //Ok(()) + //}, + //Cmd::ListStream(_) => { // source::list_stream(c); - println!("ListStream is temporarily closed before NestOS Stream is ready."); - Ok(()) - }, + // println!("ListStream is temporarily closed before NestOS Stream is ready."); + // Ok(()) + //}, Cmd::Install(c) => install::install(c), Cmd::Iso(c) => match c { IsoCmd::Customize(c) => live::iso_customize(c), diff --git a/src/s390x/zipl.rs b/src/s390x/zipl.rs index 5fc2026..963c8ee 100644 --- a/src/s390x/zipl.rs +++ b/src/s390x/zipl.rs @@ -403,7 +403,7 @@ pub fn zipl>( /// Returns the first-boot kargs embedded in the contents `s` of a firstboot file. /// /// Note this isn't intended to be a general purpose GRUB config language parser. Only the exact -/// format used by coreos-installer is recognized. Any other format triggers an error. +/// format used by nestos-installer is recognized. Any other format triggers an error. fn extract_firstboot_kargs(s: &str) -> Result> { let s = s.trim(); if s.is_empty() { diff --git a/src/source.rs b/src/source.rs index f293d29..fb65929 100644 --- a/src/source.rs +++ b/src/source.rs @@ -30,7 +30,7 @@ use crate::util::set_die_on_sigpipe; /// Completion timeout for HTTP requests (4 hours). const HTTP_COMPLETION_TIMEOUT: Duration = Duration::from_secs(4 * 60 * 60); -/// Default base URL to Fedora CoreOS streams metadata. +/// Default base URL to NestOS streams metadata. const DEFAULT_STREAM_BASE_URL: &str = "https://nestos.org.cn/NestOS-release/streams/"; /// Directory in which we look for osmet files. @@ -70,7 +70,7 @@ pub struct UrlLocation { retries: FetchRetries, } -// Remote image source specified by Fedora CoreOS stream metadata +// Remote image source specified by NestOS stream metadata #[derive(Debug)] pub struct StreamLocation { stream_base_url: Option, -- 2.33.0