From c312e54e3ebdb02c1273b54a598959093d693f8e Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Wed, 9 Feb 2022 10:26:18 +0000 Subject: [PATCH 1/3] app-emulation/wa-linux-agent: update to v2.6.0.2 v2.6.0.2 is the latest released version and contains the upstreamed Flatcar support. Signed-off-by: Jeremi Piotrowski --- .../app-emulation/wa-linux-agent/Manifest | 2 +- .../files/0001-Support-flatcar.patch | 71 ------------------- ...1.ebuild => wa-linux-agent-2.6.0.2.ebuild} | 4 -- ....1.ebuild => oem-azure-pro-2.6.0.2.ebuild} | 0 ....3.1.1.ebuild => oem-azure-2.6.0.2.ebuild} | 0 5 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-Support-flatcar.patch rename sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/{wa-linux-agent-2.3.1.1-r1.ebuild => wa-linux-agent-2.6.0.2.ebuild} (94%) rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/{oem-azure-pro-2.3.1.1.ebuild => oem-azure-pro-2.6.0.2.ebuild} (100%) rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/{oem-azure-2.3.1.1.ebuild => oem-azure-2.6.0.2.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/Manifest b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/Manifest index c5a6422e89..448200fa2a 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/Manifest @@ -1 +1 @@ -DIST wa-linux-agent-2.3.1.1.tar.gz 1197026 BLAKE2B 2751e43eb563705506d0f698eb69ee029de536f78ec03943861d98ac702d79dba265d72734ef1ad9ffd3b49eb0a2e55fd3536a50248db37c3d0f78b751fa6e27 SHA512 d68a622f0280d442e02b34ddac668f466252a7ed4581af63eb88df544ddb0808db04a3f35e24c1202c974ad6b7aa1e30ed1d4a3c14a3ba0a12de02fa3a5c4406 +DIST wa-linux-agent-2.6.0.2.tar.gz 1530936 BLAKE2B f47a4293a939da03859dafac2f422c4066dc2e92d6d4417a7e61e64abf22f1e096fcc7fc4ddfbe3166427ca44df75d967dbd1379d06c1b409fc3edc6340a17f2 SHA512 8826482ceb9e47a9b7f7271c5db19bf46ccabcefd327119e44f2760b147206a1fd3905a0cc8178527fe3326d4179f84bab8f7c673ede3c6de8dcacde0008e405 diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-Support-flatcar.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-Support-flatcar.patch deleted file mode 100644 index 0a6006a0a9..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-Support-flatcar.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 4d914f0bf587c755b63cc4859911e39b5455b5b1 Mon Sep 17 00:00:00 2001 -From: Krzesimir Nowak -Date: Tue, 31 Aug 2021 14:46:26 +0200 -Subject: [PATCH] Support flatcar - ---- - azurelinuxagent/common/osutil/factory.py | 3 ++- - azurelinuxagent/pa/deprovision/factory.py | 2 +- - tests/common/osutil/test_factory.py | 6 ++++++ - tests/tools.py | 1 + - 4 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/azurelinuxagent/common/osutil/factory.py b/azurelinuxagent/common/osutil/factory.py -index b212c382..4bf0a36d 100644 ---- a/azurelinuxagent/common/osutil/factory.py -+++ b/azurelinuxagent/common/osutil/factory.py -@@ -81,7 +81,8 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name) - if distro_name == "kali": - return DebianOSBaseUtil() - -- if distro_name == "coreos" or distro_code_name == "coreos": -+ if distro_name == "flatcar" or distro_code_name == "flatcar" \ -+ or distro_name == "coreos" or distro_code_name == "coreos": - return CoreOSUtil() - - if distro_name in ("suse", "sle_hpc", "sles", "opensuse"): -diff --git a/azurelinuxagent/pa/deprovision/factory.py b/azurelinuxagent/pa/deprovision/factory.py -index 6197fc6a..e7ce1c83 100644 ---- a/azurelinuxagent/pa/deprovision/factory.py -+++ b/azurelinuxagent/pa/deprovision/factory.py -@@ -35,7 +35,7 @@ def get_deprovision_handler(distro_name=DISTRO_NAME, - return Ubuntu1804DeprovisionHandler() - else: - return UbuntuDeprovisionHandler() -- if distro_name == "coreos": -+ if distro_name == "flatcar" or distro_name == "coreos": - return CoreOSDeprovisionHandler() - if "Clear Linux" in distro_full_name: - return ClearLinuxDeprovisionHandler() # pylint: disable=E1120 -diff --git a/tests/common/osutil/test_factory.py b/tests/common/osutil/test_factory.py -index f7d46b21..6d6dd46c 100644 ---- a/tests/common/osutil/test_factory.py -+++ b/tests/common/osutil/test_factory.py -@@ -142,6 +142,12 @@ class TestOsUtilFactory(AgentTestCase): - distro_full_name="") - self.assertTrue(isinstance(ret, CoreOSUtil)) - self.assertEqual(ret.get_service_name(), "waagent") -+ ret = _get_osutil(distro_name="flatcar", -+ distro_code_name="", -+ distro_version="", -+ distro_full_name="") -+ self.assertTrue(isinstance(ret, CoreOSUtil)) -+ self.assertEqual(ret.get_service_name(), "waagent") - - def test_get_osutil_it_should_return_suse(self): - ret = _get_osutil(distro_name="suse", -diff --git a/tests/tools.py b/tests/tools.py -index 64f1862d..cd16c089 100644 ---- a/tests/tools.py -+++ b/tests/tools.py -@@ -452,6 +452,7 @@ supported_distro = [ - ["ubuntu", "15.10", "Snappy Ubuntu Core"], - - ["coreos", "", ""], -+ ["flatcar", "", ""], - - ["suse", "12", "SUSE Linux Enterprise Server"], - ["suse", "13.2", "openSUSE"], --- -2.31.1 - diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.3.1.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.6.0.2.ebuild similarity index 94% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.3.1.1-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.6.0.2.ebuild index 5a8781e1bf..048c7911b0 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.3.1.1-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.6.0.2.ebuild @@ -22,10 +22,6 @@ dev-lang/python-oem:${DEP_PYVER} dev-python/distro-oem " -PATCHES=( - "${FILESDIR}/0001-Support-flatcar.patch" -) - S="${WORKDIR}/WALinuxAgent-${PV}" src_install() { diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.3.1.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.3.1.1.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.3.1.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.3.1.1.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild From 9ce9b93e2a761afea92bac02ef922da74fca130e Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Wed, 9 Feb 2022 11:00:35 +0000 Subject: [PATCH 2/3] coreos-base/oem-azure(-pro): inject empty eject binary into waagent PATH Waagent ejects the provisioning dvd, but this causes the /dev/sr0 drive to be in a state where util-linux probing it causes the kernel to spam "unaligned transfer" messages. This is fixed in util-linux main branch, but it will be a while until this is released. Create a symlink from 'eject' to '/bin/true' and modify the unit's PATH environment variable so that this symlink is found before the eject binary. Additionally I added the oem python directory to PATH, so that waagent can be start directly. This should be enough so that messages from waagent in the journal are prefixed with 'waagent' and not 'python'. Signed-off-by: Jeremi Piotrowski --- .../coreos-base/oem-azure-pro/files/units/waagent.service | 4 +++- .../coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild | 1 + .../coreos-base/oem-azure/files/units/waagent.service | 4 +++- .../coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/units/waagent.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/units/waagent.service index 9f7c4fd9ca..cf34281af7 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/units/waagent.service +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/files/units/waagent.service @@ -7,7 +7,9 @@ After=network-online.target sshd-keygen.service Type=simple Restart=always RestartSec=5s -ExecStart=/usr/share/oem/python/bin/python -u /usr/share/oem/bin/waagent -daemon +Environment=PATH=/usr/share/oem/python/bin:/usr/share/oem/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +Environment=PYTHONUNBUFFERED=x +ExecStart=/usr/share/oem/bin/waagent -daemon [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild index 4885a2e24f..896712e38c 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure-pro/oem-azure-pro-2.6.0.2.ebuild @@ -35,4 +35,5 @@ src_install() { doins "${T}/oem-release" doins -r "${FILESDIR}/base" doins -r "${FILESDIR}/units" + dosym "/usr/bin/true" "/usr/share/oem/bin/eject" } diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/units/waagent.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/units/waagent.service index 9f7c4fd9ca..cf34281af7 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/units/waagent.service +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/files/units/waagent.service @@ -7,7 +7,9 @@ After=network-online.target sshd-keygen.service Type=simple Restart=always RestartSec=5s -ExecStart=/usr/share/oem/python/bin/python -u /usr/share/oem/bin/waagent -daemon +Environment=PATH=/usr/share/oem/python/bin:/usr/share/oem/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +Environment=PYTHONUNBUFFERED=x +ExecStart=/usr/share/oem/bin/waagent -daemon [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild index b590cfed26..0a0f8a3705 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.6.0.2.ebuild @@ -29,4 +29,5 @@ src_install() { doins "${T}/oem-release" doins -r "${FILESDIR}/base" doins -r "${FILESDIR}/units" + dosym "/usr/bin/true" "/usr/share/oem/bin/eject" } From a76eccc6c4992c111d318c8fcc04b3145b8a5056 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Wed, 9 Feb 2022 11:15:23 +0000 Subject: [PATCH 3/3] changelog: add entry for WALinuxAgent --- .../coreos-overlay/changelog/updates/2022-02-09-walinuxagent.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/changelog/updates/2022-02-09-walinuxagent.md diff --git a/sdk_container/src/third_party/coreos-overlay/changelog/updates/2022-02-09-walinuxagent.md b/sdk_container/src/third_party/coreos-overlay/changelog/updates/2022-02-09-walinuxagent.md new file mode 100644 index 0000000000..7a894d3964 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/changelog/updates/2022-02-09-walinuxagent.md @@ -0,0 +1 @@ +- WALinuxAgent ([2.6.0.2](https://github.com/Azure/WALinuxAgent/releases/tag/v2.6.0.2))