From 6072c11612c65cbf1615ddc92f1d13c6a8b3b00d Mon Sep 17 00:00:00 2001 From: duyiwei Date: Fri, 10 May 2024 16:03:58 +0800 Subject: [PATCH] Block unsupported functions and modify the coreos to nestos --- ...ions-and-modify-the-coreos-to-nestos.patch | 128 ++++++++++++++++++ nestos-installer.spec | 6 +- 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 0001-Block-unsupported-functions-and-modify-the-coreos-to-nestos.patch diff --git a/0001-Block-unsupported-functions-and-modify-the-coreos-to-nestos.patch b/0001-Block-unsupported-functions-and-modify-the-coreos-to-nestos.patch new file mode 100644 index 0000000..348a66a --- /dev/null +++ b/0001-Block-unsupported-functions-and-modify-the-coreos-to-nestos.patch @@ -0,0 +1,128 @@ +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 + diff --git a/nestos-installer.spec b/nestos-installer.spec index 079fb92..30e708b 100644 --- a/nestos-installer.spec +++ b/nestos-installer.spec @@ -9,13 +9,14 @@ Name: rust-nestos-installer Version: 0.20.0 -Release: 1 +Release: 2 Summary: Installer for NestOS License: Apache-2.0 URL: https://gitee.com/openeuler/nestos-installer Source0: https://gitee.com/openeuler/nestos-installer/repository/archive/v%{version}.tar.gz Source1: %{crate}-%{version}-vendor.tar.gz +Patch01: 0001-Block-unsupported-functions-and-modify-the-coreos-to-nestos.patch BuildRequires: rust-packaging openssl-devel libzstd-devel BuildRequires: systemd gnupg2 @@ -106,6 +107,9 @@ This subpackage contains boot-time infrastructure for NestOS. It is not needed %changelog +* Fri May 10 2024 duyiwei - 0.20.0-2 +- Block unsupported functions and modify the coreos to nestos + * Thu Jan 25 2024 duyiwei - 0.20.0-1 - upgrade version to 0.20.0