Cloud-init add module-setup.sh azure module for dracut to run (#11397)

Co-authored-by: minghe <rmhsawyer>
This commit is contained in:
Minghe Ren 2024-12-10 22:32:19 -08:00 коммит произвёл GitHub
Родитель 0fe0c32119
Коммит 822acd0943
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 29 добавлений и 2 удалений

Просмотреть файл

@ -1,6 +1,7 @@
{
"Signatures": {
"10-azure-kvp.cfg": "79e0370c010be5cd4717960e4b414570c9ec6e6d29aede77ccecc43d2b03bb9a",
"cloud-init-23.3.tar.gz": "1a5a54369f78891b79f43061c1ff0fb31e2bd74ff9527d7150ddd6517c3e2b07"
"cloud-init-23.3.tar.gz": "1a5a54369f78891b79f43061c1ff0fb31e2bd74ff9527d7150ddd6517c3e2b07",
"module-setup.sh": "aee825f849ce35a5a178cf095c2b9c46e586d50082f681d7f8d2c5d769c2f592"
}
}

Просмотреть файл

@ -5,7 +5,7 @@ Summary: Cloud instance init scripts
Name: cloud-init
Epoch: 1
Version: %{package_version}
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv3
Vendor: Microsoft Corporation
Distribution: Mariner
@ -13,6 +13,8 @@ Group: System Environment/Base
URL: https://launchpad.net/cloud-init
Source0: https://launchpad.net/cloud-init/trunk/%{upstream_version_group}/+download/%{name}-%{version}.tar.gz
Source1: 10-azure-kvp.cfg
# This script is to prevent an intermittent issue where ephemeral disk not being formatted by cloud-init on Azure
Source2: module-setup.sh
Patch0: overrideDatasourceDetection.patch
Patch1: exec_cmd_error_handling.patch
Patch2: Add-Network-Interface-Renaming-Support-for-CAPM3-Met.patch
@ -43,6 +45,7 @@ BuildRequires: python3-xml
BuildRequires: systemd
BuildRequires: systemd-devel
Requires: dhcp-client
Requires: dracut
Requires: e2fsprogs
Requires: iproute
Requires: net-tools
@ -106,6 +109,9 @@ mkdir -p %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg.d
install -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg.d/
mkdir -p %{buildroot}%{_prefix}/lib/dracut/modules.d/99azure-cloud/
install -m 755 %{SOURCE2} %{buildroot}%{_prefix}/lib/dracut/modules.d/99azure-cloud/module-setup.sh
%check
touch vd ud
@ -150,11 +156,16 @@ make check %{?_smp_mflags}
%{_systemdgeneratordir}/cloud-init-generator
/usr/lib/udev/rules.d/66-azure-ephemeral.rules
%{_datadir}/bash-completion/completions/cloud-init
%dir %attr(0700, root, root) %{_prefix}/lib/dracut/modules.d/99azure-cloud
%{_prefix}/lib/dracut/modules.d/99azure-cloud/module-setup.sh
%files azure-kvp
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/10-azure-kvp.cfg
%changelog
* Tue Dec 10 2024 Minghe Ren <mingheren@microsoft.com> - 1:23.3-6
- Add module-setup.sh to prevent an intermittent issue where ephemeral disk not being formatted on Azure
* Fri Sep 13 2024 Minghe Ren <mingheren@microsoft.com> - 1:23.3-5
- Add patche to have PPS support for azure-proxy-agent.

Просмотреть файл

@ -0,0 +1,15 @@
#!/usr/bin/bash
# called by dracut
check() {
return 0
}
# called by dracut
depends() {
return 0
}
# called by dracut to make sure 66-azure-ephemeral.rules is installed
install() {
inst_multiple cut readlink
inst_rules 66-azure-ephemeral.rules
}