From 4f236ff7a7a4384d91abf55c37821c39ebfd2e2f Mon Sep 17 00:00:00 2001 From: fu-shanqing Date: Thu, 1 Sep 2022 22:31:13 +0800 Subject: [PATCH] modify fedora-coreos.stream to nestos.stream --- modify-as-nestos-stream.patch | 87 +++++++++++++++++++++++++++++++++++ rust-zincati.spec | 6 ++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 modify-as-nestos-stream.patch diff --git a/modify-as-nestos-stream.patch b/modify-as-nestos-stream.patch new file mode 100644 index 0000000..eb5ac5e --- /dev/null +++ b/modify-as-nestos-stream.patch @@ -0,0 +1,87 @@ +diff -uprN zincati-0.0.24/docs/development/os-metadata.md zincati-0.0.24-new/docs/development/os-metadata.md +--- zincati-0.0.24/docs/development/os-metadata.md 1973-11-30 05:33:09.000000000 +0800 ++++ zincati-0.0.24-new/docs/development/os-metadata.md 2022-09-01 22:14:16.419124499 +0800 +@@ -31,7 +31,7 @@ Booted deployment must provide several m + * `version`: OS version + * under `base-commit-meta`: + * `coreos-assembler.basearch`: base architecture +- * `fedora-coreos.stream`: update stream ++ * `nestos.stream`: update stream + + All those metadata entries must exist with a non-empty string value. + +diff -uprN zincati-0.0.24/src/rpm_ostree/cli_status.rs zincati-0.0.24-new/src/rpm_ostree/cli_status.rs +--- zincati-0.0.24/src/rpm_ostree/cli_status.rs 1973-11-30 05:33:09.000000000 +0800 ++++ zincati-0.0.24-new/src/rpm_ostree/cli_status.rs 2022-09-01 22:13:30.381509120 +0800 +@@ -63,7 +63,7 @@ pub struct DeploymentJson { + struct BaseCommitMetaJson { + #[serde(rename = "coreos-assembler.basearch")] + basearch: String, +- #[serde(rename = "fedora-coreos.stream")] ++ #[serde(rename = "nestos.stream")] + stream: String, + } + +diff -uprN zincati-0.0.24/tests/fixtures/rpm-ostree-staged.json zincati-0.0.24-new/tests/fixtures/rpm-ostree-staged.json +--- zincati-0.0.24/tests/fixtures/rpm-ostree-staged.json 1973-11-30 05:33:09.000000000 +0800 ++++ zincati-0.0.24-new/tests/fixtures/rpm-ostree-staged.json 2022-09-01 22:16:06.002212519 +0800 +@@ -9,7 +9,7 @@ + "coreos-assembler.config-dirty" : "false", + "rpmostree.inputhash" : "77dbde3d9502f2f87757d2b68b93b52efa2c65fb7b1fc317e0ffc50b483a3a52", + "coreos-assembler.basearch" : "x86_64", +- "fedora-coreos.stream" : "stable", ++ "nestos.stream" : "stable", + "version" : "31.20200517.3.0", + "rpmostree.initramfs-args" : [ + "--add=ignition", +@@ -79,7 +79,7 @@ + "coreos-assembler.config-dirty" : "false", + "rpmostree.inputhash" : "3efbafd926cbd112d0049aaebf5c025812229ab23fc84bd6800d959ac919b03a", + "coreos-assembler.basearch" : "x86_64", +- "fedora-coreos.stream" : "stable", ++ "nestos.stream" : "stable", + "version" : "31.20200505.3.0", + "rpmostree.initramfs-args" : [ + "--add=ignition", +diff -uprN zincati-0.0.24/tests/fixtures/rpm-ostree-status.json zincati-0.0.24-new/tests/fixtures/rpm-ostree-status.json +--- zincati-0.0.24/tests/fixtures/rpm-ostree-status.json 1973-11-30 05:33:09.000000000 +0800 ++++ zincati-0.0.24-new/tests/fixtures/rpm-ostree-status.json 2022-09-01 22:14:39.301431354 +0800 +@@ -8,7 +8,7 @@ + "coreos-assembler.config-dirty" : "true", + "coreos-assembler.config-gitrev" : "e5ffda727170e124c7f7d8782e256b0462bf9869", + "coreos-assembler.basearch" : "x86_64", +- "fedora-coreos.stream" : "testing-devel", ++ "nestos.stream" : "testing-devel", + "rpmostree.inputhash" : "0e2ba98bac847c8a8cc5ffd42822a41d53ef6719ccaf6a0094559768aa24da33", + "version" : "30.1", + "rpmostree.rpmmd-repos" : [ +diff -uprN zincati-0.0.24/tests/kola/server/test-stream.sh zincati-0.0.24-new/tests/kola/server/test-stream.sh +--- zincati-0.0.24/tests/kola/server/test-stream.sh 1973-11-30 05:33:09.000000000 +0800 ++++ zincati-0.0.24-new/tests/kola/server/test-stream.sh 2022-09-01 22:15:44.394996808 +0800 +@@ -66,7 +66,7 @@ EOF + ostree --repo=/var/www pull-local /ostree/repo "$cur_payload" + # Create a new branch `test-branch` by creating a dummy commit. + ostree --repo=/var/www commit --branch='test-branch' --tree ref="$cur_payload" \ +- --add-metadata-string version='dummy' --keep-metadata='fedora-coreos.stream' \ ++ --add-metadata-string version='dummy' --keep-metadata='nestos.stream' \ + --keep-metadata='coreos-assembler.basearch' --parent="$cur_payload" + # Add the OSTree repo at /var/www as a new `local` remote. + ostree remote add --no-gpg-verify local http://localhost test-branch +@@ -75,7 +75,7 @@ EOF + # Create a new commit on `test-branch` that has an unknown stream. + bad_version="$cur_version".bad-update + bad_payload="$(ostree --repo=/var/www commit --branch=test-branch --tree ref="$cur_payload" \ +- --add-metadata-string version="$bad_version" --add-metadata-string fedora-coreos.stream='unknown-stream' \ ++ --add-metadata-string version="$bad_version" --add-metadata-string nestos.stream='unknown-stream' \ + --keep-metadata='coreos-assembler.basearch' --parent="$cur_payload")" + + jq \ +@@ -101,7 +101,7 @@ EOF + # Create a new commit on `test-branch` that's on the correct stream. + good_version="$cur_version".good-update + good_payload="$(ostree --repo=/var/www commit --branch=test-branch --tree ref="$cur_payload" \ +- --add-metadata-string version="$good_version" --keep-metadata='fedora-coreos.stream' \ ++ --add-metadata-string version="$good_version" --keep-metadata='nestos.stream' \ + --keep-metadata='coreos-assembler.basearch' --parent="$cur_payload")" + + jq \ diff --git a/rust-zincati.spec b/rust-zincati.spec index 2df20a9..6882c4c 100644 --- a/rust-zincati.spec +++ b/rust-zincati.spec @@ -6,13 +6,14 @@ Name: rust-%{crate} Version: 0.0.24 -Release: 2 +Release: 3 Summary: Update agent for NestOS License: ASL 2.0 URL: https://crates.io/crates/%{crate} Source0: %{crate}-%{version}.crate Source1: https://github.com/coreos/%{crate}/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz Patch1: base-cincinnati-url-for-nestos.patch +Patch2: modify-as-nestos-stream.patch BuildRequires: rust-packaging BuildRequires: systemd openssl-devel @@ -128,6 +129,9 @@ ln -snf /run/%{crate}/public/metrics.promsock %{buildroot}/run/%{crate}/private/ %endif %changelog +* Thu Sep 01 2022 fushanqing - 0.0.24-3 +- modify fedora-coreos.stream to nestos.stream + * Thu Sep 01 2022 fushanqing - 0.0.24-2 - add %pre script -- Gitee