From b270505ad3083dfde3f23c7b636fbed657248949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=B6=85=E8=B6=85?= Date: Tue, 20 Aug 2024 17:03:01 +0800 Subject: [PATCH] Add Qboot condition check --- cloud-init.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloud-init.spec b/cloud-init.spec index 0b87043..495dfbb 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.2 +%define anolis_release .0.3 %define commitid 80cf5dc %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -165,6 +165,8 @@ then /bin/systemctl enable cloud-init.service >/dev/null 2>&1 || : /bin/systemctl enable cloud-init-local.service >/dev/null 2>&1 || : fi +if [ -f /etc/image-id ]; +then grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "/Before=sshd.service/d" /usr/lib/systemd/system/cloud-init.service grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "/Before=sshd-keygen.service/d" /usr/lib/systemd/system/cloud-init.service grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "s/Before=network-online.target/After=network-online.target/g" /usr/lib/systemd/system/cloud-init.service @@ -172,6 +174,7 @@ grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "/Wants=network-pre.target/ grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "/Before=NetworkManager.service/d" /usr/lib/systemd/system/cloud-init-local.service grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "s/Before=network-pre.target/Requires=network-online.target/g" /usr/lib/systemd/system/cloud-init-local.service grep -Eiq 'qboot|quick boot' /etc/image-id && sed -i "s/After=systemd-remount-fs.service/After=systemd-remount-fs.service network-online.target/g" /usr/lib/systemd/system/cloud-init-local.service +fi %else /sbin/chkconfig --add %{_initrddir}/cloud-init-local /sbin/chkconfig --add %{_initrddir}/cloud-init @@ -252,6 +255,9 @@ unlink /etc/cloud/cloud.cfg.d/aliyun_cloud.cfg %{python_sitelib}/* %changelog +* Tue Aug 20 2024 Chaochao Bai - 23.2.2-1.0.3 +- Add Qboot condition check + * Tue Jul 23 2024 Xiaoping Liu - 23.2.2-1.0.2 - unlink aliyun_cloud.cfg after uninstalling -- Gitee