Compare commits
No commits in common. "5387a938724d7f6ea3b8642b0090606ad07c368b" and "c917f446bf2c32688a6dedce669989526ff76e49" have entirely different histories.
5387a93872
...
c917f446bf
@ -1,174 +0,0 @@
|
|||||||
From 0209dce6484c29d2ac8408192c14d5490074809c Mon Sep 17 00:00:00 2001
|
|
||||||
From: duyiwei <duyiwei@kylinos.cn>
|
|
||||||
Date: Fri, 24 May 2024 10:40:49 +0800
|
|
||||||
Subject: [PATCH] Block unsupported functions and modify the coreos to nestos
|
|
||||||
|
|
||||||
Signed-off-by: duyiwei <duyiwei@kylinos.cn>
|
|
||||||
---
|
|
||||||
src/cmdline/install.rs | 8 ++++----
|
|
||||||
src/cmdline/mod.rs | 8 ++++----
|
|
||||||
src/install.rs | 11 +++++++++--
|
|
||||||
src/main.rs | 16 ++++++++--------
|
|
||||||
src/s390x/zipl.rs | 2 +-
|
|
||||||
src/source.rs | 4 ++--
|
|
||||||
6 files changed, 28 insertions(+), 21 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/cmdline/install.rs b/src/cmdline/install.rs
|
|
||||||
index 459c7c5..1945590 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<String>,
|
|
||||||
/// 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<DisplayFromStr>")]
|
|
||||||
@@ -92,7 +92,7 @@ pub struct InstallConfig {
|
|
||||||
pub image_url: Option<Url>,
|
|
||||||
/// 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")]
|
|
||||||
@@ -234,7 +234,7 @@ pub struct InstallConfig {
|
|
||||||
///
|
|
||||||
/// Temporarily closed before NestOS Stream is ready.
|
|
||||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
|
||||||
- #[arg(long, value_name = "URL", help_heading = ADVANCED)]
|
|
||||||
+ #[arg(long, hide = true, value_name = "URL", help_heading = ADVANCED)]
|
|
||||||
pub stream_base_url: Option<Url>,
|
|
||||||
/// Don't clear partition table on error
|
|
||||||
///
|
|
||||||
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/install.rs b/src/install.rs
|
|
||||||
index 2182117..904ddd8 100644
|
|
||||||
--- a/src/install.rs
|
|
||||||
+++ b/src/install.rs
|
|
||||||
@@ -36,6 +36,13 @@ use crate::source::*;
|
|
||||||
const GRUB_CFG_CONSOLE_SETTINGS_RE: &str = r"(?P<prefix>\n# CONSOLE-SETTINGS-START\n)(?P<commands>([^\n]*\n)*)(?P<suffix># CONSOLE-SETTINGS-END\n)";
|
|
||||||
|
|
||||||
pub fn install(config: InstallConfig) -> Result<()> {
|
|
||||||
+ if config.stream.is_some() {
|
|
||||||
+ bail!("The --stream is not currently supported until NestOS release stream is ready.");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if config.stream_base_url.is_some() {
|
|
||||||
+ bail!("The --stream-base-url is not currently supported until NestOS release stream is ready.");
|
|
||||||
+ }
|
|
||||||
// evaluate config files
|
|
||||||
let config = config.expand_config_files()?;
|
|
||||||
|
|
||||||
@@ -149,8 +156,6 @@ pub fn install(config: InstallConfig) -> Result<()> {
|
|
||||||
None => bail!("cannot perform offline install; metadata missing"),
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
- //Temporarily closed before NestOS Stream is ready.
|
|
||||||
- bail!("The --stream is not currently supported until NestOS release stream is ready.");
|
|
||||||
// For now, using --stream automatically will cause a download. In the future, we could
|
|
||||||
// opportunistically use osmet if the version and stream match an osmet file/the live ISO.
|
|
||||||
|
|
||||||
@@ -162,6 +167,8 @@ pub fn install(config: InstallConfig) -> Result<()> {
|
|
||||||
if let Some(osmet) = maybe_osmet {
|
|
||||||
Box::new(osmet)
|
|
||||||
} else {
|
|
||||||
+ //Temporarily unsupported before NestOS Stream is ready.
|
|
||||||
+ bail!("Stream fetching of images is not supported. Ensure you are in a NestOS live environment or provide a valid image source.");
|
|
||||||
let format = match sector_size {
|
|
||||||
4096 => "4k.raw.xz",
|
|
||||||
512 => "raw.xz",
|
|
||||||
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<P: AsRef<Path>>(
|
|
||||||
/// 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<Option<String>> {
|
|
||||||
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<Url>,
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
Binary file not shown.
@ -8,15 +8,14 @@
|
|||||||
%global crate nestos-installer
|
%global crate nestos-installer
|
||||||
|
|
||||||
Name: rust-nestos-installer
|
Name: rust-nestos-installer
|
||||||
Version: 0.20.0
|
Version: 0.17.0
|
||||||
Release: 4
|
Release: 1
|
||||||
Summary: Installer for NestOS
|
Summary: Installer for NestOS
|
||||||
|
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://gitee.com/openeuler/nestos-installer
|
URL: https://gitee.com/openeuler/nestos-installer
|
||||||
Source0: https://gitee.com/openeuler/nestos-installer/repository/archive/v%{version}.tar.gz
|
Source0: https://gitee.com/openeuler/nestos-installer/repository/archive/v%{version}.tar.gz
|
||||||
Source1: %{crate}-%{version}-vendor.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: rust-packaging openssl-devel libzstd-devel
|
||||||
BuildRequires: systemd gnupg2
|
BuildRequires: systemd gnupg2
|
||||||
@ -30,7 +29,7 @@ NestOS is a Variant in openEuler from Fedora CoreOS.
|
|||||||
|
|
||||||
%description %{_description}
|
%description %{_description}
|
||||||
|
|
||||||
%package -n %{crate}
|
%package -n nestos-installer
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
License: ASL 2.0 and MIT and zlib
|
License: ASL 2.0 and MIT and zlib
|
||||||
|
|
||||||
@ -47,31 +46,12 @@ Requires: util-linux
|
|||||||
# Obsolete dracut modules as they are not provided in this package.
|
# Obsolete dracut modules as they are not provided in this package.
|
||||||
Obsoletes: nestos-installer-dracut < 0.0.1
|
Obsoletes: nestos-installer-dracut < 0.0.1
|
||||||
|
|
||||||
%description -n %{crate} %{_description}
|
%description -n nestos-installer %{_description}
|
||||||
|
|
||||||
%files -n %{crate}
|
%files -n nestos-installer
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.*
|
%doc README.*
|
||||||
%{_bindir}/nestos-installer
|
%{_bindir}/nestos-installer
|
||||||
%dir %{_datadir}/nestos-installer
|
|
||||||
%{_datadir}/nestos-installer/example-config.yaml
|
|
||||||
|
|
||||||
%package -n %{crate}-bootinfra
|
|
||||||
Summary: %{crate} boot-time infrastructure for use on Fedora/RHEL CoreOS
|
|
||||||
Requires: %{crate}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
||||||
License: ASL 2.0 and MIT and zlib
|
|
||||||
|
|
||||||
Provides: %{crate}-systemd = %{version}-%{release}
|
|
||||||
Obsoletes: %{crate}-systemd <= 0.3.0-3
|
|
||||||
|
|
||||||
%description -n %{crate}-bootinfra
|
|
||||||
This subpackage contains boot-time infrastructure for NestOS. It is not needed on other platforms.
|
|
||||||
|
|
||||||
%files -n %{crate}-bootinfra
|
|
||||||
%{dracutlibdir}/modules.d/50rdcore/
|
|
||||||
%{_libexecdir}/nestos-installer-*
|
|
||||||
%{_unitdir}/nestos-installer*.{service,target}
|
|
||||||
%{_systemdgeneratordir}/nestos-installer-generator
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{crate}-v%{version} -p1
|
%autosetup -n %{crate}-v%{version} -p1
|
||||||
@ -102,29 +82,30 @@ install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer-noreboot.
|
|||||||
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer-pre.target
|
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer-pre.target
|
||||||
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer.target
|
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer.target
|
||||||
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer-post.target
|
install -D -m 0644 -t %{buildroot}%{_unitdir} systemd/nestos-installer-post.target
|
||||||
install -D -m 0644 -t %{buildroot}%{_datadir}/%{crate} data/example-config.yaml
|
|
||||||
install -D -m 0755 -t %{buildroot}%{_systemdgeneratordir} systemd/nestos-installer-generator
|
install -D -m 0755 -t %{buildroot}%{_systemdgeneratordir} systemd/nestos-installer-generator
|
||||||
|
|
||||||
cp -r $RPM_BUILD_DIR/%{crate}-v%{version}/.cargo/bin %{buildroot}/usr
|
cp -r $RPM_BUILD_DIR/%{crate}-v%{version}/.cargo/bin %{buildroot}/usr
|
||||||
mv %{buildroot}%{_bindir}/rdcore %{buildroot}%{dracutlibdir}/modules.d/50rdcore/
|
mv %{buildroot}%{_bindir}/rdcore %{buildroot}%{dracutlibdir}/modules.d/50rdcore/
|
||||||
|
|
||||||
|
%package -n nestos-installer-bootinfra
|
||||||
|
Summary: %{crate} boot-time infrastructure for use on Fedora/RHEL CoreOS
|
||||||
|
Requires: %{crate}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
|
License: ASL 2.0 and MIT and zlib
|
||||||
|
|
||||||
|
Provides: %{crate}-systemd = %{version}-%{release}
|
||||||
|
Obsoletes: %{crate}-systemd <= 0.3.0-3
|
||||||
|
|
||||||
|
%description -n %{crate}-bootinfra
|
||||||
|
This subpackage contains boot-time infrastructure for NestOS. It is not needed on other platforms.
|
||||||
|
|
||||||
|
%files -n %{crate}-bootinfra
|
||||||
|
%{dracutlibdir}/modules.d/*
|
||||||
|
%{_libexecdir}/*
|
||||||
|
%{_unitdir}/*
|
||||||
|
%{_systemdgeneratordir}/*
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Aug 15 2024 duyiwei <duyiwei@kylinos.cn> - 0.20.0-4
|
|
||||||
- add file example-config.yaml
|
|
||||||
|
|
||||||
* Fri May 24 2024 duyiwei <duyiwei@kylinos.cn> - 0.20.0-3
|
|
||||||
- update patch 0001 to unsupport NestOS stream
|
|
||||||
|
|
||||||
* Fri May 10 2024 duyiwei <duyiwei@kylinos.cn> - 0.20.0-2
|
|
||||||
- Block unsupported functions and modify the coreos to nestos
|
|
||||||
|
|
||||||
* Thu Jan 25 2024 duyiwei <duyiwei@kylinos.cn> - 0.20.0-1
|
|
||||||
- upgrade version to 0.20.0
|
|
||||||
|
|
||||||
* Wed Jan 24 2024 duyiwei <duyiwei@kylinos.cn> - 0.18.0-1
|
|
||||||
- upgrade version to 0.18.0
|
|
||||||
|
|
||||||
* Tue Jan 23 2024 duyiwei <duyiwei@kylinos.cn> - 0.17.0-1
|
* Tue Jan 23 2024 duyiwei <duyiwei@kylinos.cn> - 0.17.0-1
|
||||||
- upgrade version to 0.17.0
|
- upgrade version to 0.17.0
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user