diff --git a/0001-creat-link.patch b/0001-creat-link.patch new file mode 100644 index 0000000000000000000000000000000000000000..d94db8b5607a8fbfddecc0a5d1f76e43e92ab609 --- /dev/null +++ b/0001-creat-link.patch @@ -0,0 +1,34 @@ +From 2e4fbbc1421d1047f4ff059a13fcdb6233d50704 Mon Sep 17 00:00:00 2001 +From: shixuantong +Date: Tue, 26 Mar 2024 18:32:31 +0800 +Subject: [PATCH 1/2] creat link + +--- + systemd/cloud-init-generator.tmpl | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl +index 8bd49cc..d1d61aa 100755 +--- a/systemd/cloud-init-generator.tmpl ++++ b/systemd/cloud-init-generator.tmpl +@@ -106,6 +106,8 @@ check_for_datasource() { + } + + main() { ++ ln -s /etc/cloud/cloud.cfg /run/cloud-init-test-start ++ debug 1 "==== 1===begin====" + local normal_d="$1" early_d="$2" late_d="$3" + local target_name="multi-user.target" gen_d="$early_d" + local link_path="$gen_d/${target_name}.wants/${CLOUD_TARGET_NAME}" +@@ -172,6 +174,8 @@ main() { + debug 0 "unexpected result '$result' 'ds=$ds'" + ret=3 + fi ++ ln -s /etc/cloud/cloud.cfg /run/cloud-init-test-end ++ debug 1 "==== 1===end====" + return $ret + } + +-- +2.27.0 + diff --git a/0002-add-trap.patch b/0002-add-trap.patch new file mode 100644 index 0000000000000000000000000000000000000000..02c3e4de83ff39a993571357d4d24bf56af0b8cd --- /dev/null +++ b/0002-add-trap.patch @@ -0,0 +1,36 @@ +From 401cc49b89c4bdaa1f2a39e4fd8628445bce6ec6 Mon Sep 17 00:00:00 2001 +From: shixuantong +Date: Tue, 26 Mar 2024 18:41:34 +0800 +Subject: [PATCH 2/2] add trap + +--- + systemd/cloud-init-generator.tmpl | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl +index d1d61aa..83a5773 100755 +--- a/systemd/cloud-init-generator.tmpl ++++ b/systemd/cloud-init-generator.tmpl +@@ -81,6 +81,11 @@ default() { + _RET="$ENABLE" + } + ++handle_sigalrm() { ++ debug 1 "capture signal SIGALRM" ++ exit 0 ++} ++ + check_for_datasource() { + local ds_rc="" + {% if variant in ["redhat", "fedora", "centos", "openeuler"] %} +@@ -92,6 +97,7 @@ check_for_datasource() { + debug 1 "no ds-identify in $dsidentify. _RET=$FOUND" + return 0 + fi ++ trap "handle_sigalrm" SIGALRM + $dsidentify + ds_rc=$? + debug 1 "ds-identify rc=$ds_rc" +-- +2.27.0 + diff --git a/cloud-init.spec b/cloud-init.spec index e2da5c5d19812bbbeb24439153810169172d3b15..c16c349efeea02ee607d525612aa4cb3ab693d31 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 19.4 -Release: 12 +Release: 13 Summary: the defacto multi-distribution package that handles early initialization of a cloud instance. License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -27,6 +27,8 @@ Patch16: backport-fix-Don-t-loosen-the-permissions-of-the-log-file.patch Patch17: backport-add-get_permissions-get_owner-get_group-get_user_gro.patch Patch9000: Fix-the-error-level-logs-displayed-for-the-cloud-init-local-service.patch +Patch9001: 0001-creat-link.patch +Patch9002: 0002-add-trap.patch BuildRequires: pkgconfig(systemd) python3-devel python3-setuptools systemd BuildRequires: iproute python3-configobj python3-httpretty >= 0.8.14-2