From f9a1e23a9226a92cdc62437f810b705c5d744174 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Fri, 5 Apr 2024 09:50:00 +0000 Subject: [PATCH] app-emulation/wa-linux-agent: Update Flatcar patch When CoreosCommonUtil was factored out, we missed updating the class name in a call to super(). This results in an error when executing `/usr/sbin/waagent -force -deprovision+user`. Fix the class name. Create a compatibility symlink at the old config file location (/usr/share/oem/waagent.conf) to handle the case of enabling auto-updates on the agent. The upstream version of the agent does not have our downstream patch so doesn't know about the updated config file location. We should upstream our changes. Signed-off-by: Jeremi Piotrowski --- .../wa-linux-agent/files/0001-flatcar-changes.patch | 5 +++-- ...nt-2.9.1.1-r1.ebuild => wa-linux-agent-2.9.1.1-r2.ebuild} | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/{wa-linux-agent-2.9.1.1-r1.ebuild => wa-linux-agent-2.9.1.1-r2.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch index 9eeb4d1246..04cccd5034 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch @@ -115,7 +115,7 @@ index 00000000..66eae16e + # User 'core' is not a sysuser. + if username == 'core': + return False -+ return super(CoreOSUtil, self).is_sys_user(username) ++ return super(CoreosCommonUtil, self).is_sys_user(username) + + def is_dhcp_enabled(self): + return True @@ -404,7 +404,7 @@ new file mode 100644 index 00000000..d0d6f7c8 --- /dev/null +++ b/init/flatcar/waagent.service -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +[Unit] +Description=Microsoft Azure Linux Agent +Wants=network-online.target sshd.service sshd-keygen.service @@ -419,6 +419,7 @@ index 00000000..d0d6f7c8 +# /usr/share/flatcar/etc. +# +ExecStartPre=/bin/bash -c 'if [[ ! -e /etc/waagent.conf ]]; then ln -sf ../usr/share/waagent/waagent.conf /etc/waagent.conf; fi' ++ExecStartPre=/bin/bash -c 'if [[ ! -e /oem/waagent.conf ]]; then ln -sf /etc/waagent.conf /oem/waagent.conf; fi' + +# This could be done also with: +# diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.9.1.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.9.1.1-r2.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.9.1.1-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/wa-linux-agent-2.9.1.1-r2.ebuild