From bd6c429e4a1b1b75c3ed39a5cb020e746d872523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=B6=85=E8=B6=85?= Date: Wed, 3 Jul 2024 02:06:07 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Qboot=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=20=E5=9C=A8=E9=BE=99=E8=9C=A5a8.8=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=AE=89=E8=A3=85=20cloud-init=20=E4=BC=9A=E6=8A=A5?= =?UTF-8?q?=EF=BC=9A=20=20=20=E5=AE=89=E8=A3=85=20=20=20=20:=20cloud-init-?= =?UTF-8?q?23.2.2-1.0.1.an8.noarch=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=2012/12=20=20=20=E8=BF=90=E8=A1=8C=E8=84=9A=E6=9C=AC:=20?= =?UTF-8?q?cloud-init-23.2.2-1.0.1.an8.noarch=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=2012/12=20grep:=20/etc/image-id:=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E9=82=A3=E4=B8=AA=E6=96=87=E4=BB=B6=E6=88=96=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=20grep:=20/etc/image-id:=20=E6=B2=A1=E6=9C=89=E9=82=A3?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E4=BB=B6=E6=88=96=E7=9B=AE=E5=BD=95=20grep:?= =?UTF-8?q?=20/etc/image-id:=20=E6=B2=A1=E6=9C=89=E9=82=A3=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=88=96=E7=9B=AE=E5=BD=95=20grep:=20/etc/im?= =?UTF-8?q?age-id:=20=E6=B2=A1=E6=9C=89=E9=82=A3=E4=B8=AA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=88=96=E7=9B=AE=E5=BD=95=20grep:=20/etc/image-id:?= =?UTF-8?q?=20=E6=B2=A1=E6=9C=89=E9=82=A3=E4=B8=AA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=88=96=E7=9B=AE=E5=BD=95=20grep:=20/etc/image-id:=20?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=82=A3=E4=B8=AA=E6=96=87=E4=BB=B6=E6=88=96?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=20grep:=20/etc/image-id:=20=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=82=A3=E4=B8=AA=E6=96=87=E4=BB=B6=E6=88=96=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 且yum仓库没有包提供/etc/image-id: [root@localhost ~]# yum provides /etc/image-id 上次元数据过期检查:0:36:25 前,执行于 2024年07月03日 星期三 09时27分24秒。 错误:没有找到匹配的软件包 添加判断条件,即使没有/etc/image-id 文件存在,安装也不会报多余信息 Signed-off-by: 白超超 --- cloud-init.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloud-init.spec b/cloud-init.spec index def5cad..25349c5 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 %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 @@ fi %{python_sitelib}/* %changelog +* Wed Jul 03 2024 Chaochao Bai - 23.2.2-1.0.2 +- Add Qboot condition check + * Tue Jan 23 2024 Xiaoping Liu - 23.2.2-1.0.1 - update to 23.2.2 -- Gitee