git: b185a2b866b8 - main - sysutils/azure-agent: Update to 2.2.54.2

Li-Wen Hsu lwhsu at FreeBSD.org
Sun May 23 13:38:09 UTC 2021


The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b185a2b866b8642e2500dd691267694ac388875b

commit b185a2b866b8642e2500dd691267694ac388875b
Author:     Li-Wen Hsu <lwhsu at FreeBSD.org>
AuthorDate: 2021-05-23 13:37:40 +0000
Commit:     Li-Wen Hsu <lwhsu at FreeBSD.org>
CommitDate: 2021-05-23 13:37:40 +0000

    sysutils/azure-agent: Update to 2.2.54.2
    
    PR:             243046, 248543, 248651
    Approved by:    whu (maintainer, implicitly)
---
 sysutils/azure-agent/Makefile                      | 10 +++----
 sysutils/azure-agent/distinfo                      |  6 ++---
 ...-azurelinuxagent_daemon_resourcedisk_freebsd.py | 31 ++++++++++++++--------
 .../files/patch-config_freebsd_waagent.conf        | 14 ++++------
 4 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/sysutils/azure-agent/Makefile b/sysutils/azure-agent/Makefile
index bb5f40eb16f9..8c4b2919ca9a 100644
--- a/sysutils/azure-agent/Makefile
+++ b/sysutils/azure-agent/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	azure-agent
-PORTVERSION=	2.2.45
+PORTVERSION=	2.2.54.2
 DISTVERSIONPREFIX=	v
-PORTREVISION=	2
 CATEGORIES=	sysutils
 
 PATCH_SITES=	https://github.com/Azure/WALinuxAgent/commit/
@@ -13,13 +12,12 @@ LICENSE=	APACHE20
 
 RUN_DEPENDS=	sudo:security/sudo \
 		bash:shells/bash \
-		base64:converters/base64 \
 		dmidecode:sysutils/dmidecode \
 		${PYTHON_PKGNAMEPREFIX}pyasn1>=0:devel/py-pyasn1@${PY_FLAVOR} \
-		${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
+		ca_root_nss>0:security/ca_root_nss
 
 NO_BUILD=	yes
-USES=		python:3.5+ shebangfix
+USES=		python shebangfix
 
 SHEBANG_FILES=	bin/waagent bin/waagent2.0
 
@@ -38,7 +36,7 @@ post-patch:
 			 -e "s,/usr/sbin/waagent,${PREFIX}/sbin/waagent,g" \
 		${WRKSRC}/bin/waagent2.0
 	${REINPLACE_CMD} -e "s,:/usr/local/bin,:/usr/local/bin:/usr/local/sbin,g" \
-			 -e "s,python,${PYTHON_VERSION},g" \
+			 -e "s,python,${PYTHON_CMD},g" \
 		${WRKSRC}/init/freebsd/waagent
 	${REINPLACE_CMD} -e "s,/usr/sbin,${PREFIX}/sbin,g" \
 		${WRKSRC}/init/waagent
diff --git a/sysutils/azure-agent/distinfo b/sysutils/azure-agent/distinfo
index ace22c2cc6de..686bcb239916 100644
--- a/sysutils/azure-agent/distinfo
+++ b/sysutils/azure-agent/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1590110519
-SHA256 (Azure-WALinuxAgent-v2.2.45_GH0.tar.gz) = ded5ecf2ce17b3e375147a386ba13554b52098475dc06974e9780cc04ca893ee
-SIZE (Azure-WALinuxAgent-v2.2.45_GH0.tar.gz) = 937466
+TIMESTAMP = 1621586743
+SHA256 (Azure-WALinuxAgent-v2.2.54.2_GH0.tar.gz) = 2c047d262ca55718268a0921c7bd04b6c1ab1032bd885e3e0949107f493e7b7c
+SIZE (Azure-WALinuxAgent-v2.2.54.2_GH0.tar.gz) = 1814212
diff --git a/sysutils/azure-agent/files/patch-azurelinuxagent_daemon_resourcedisk_freebsd.py b/sysutils/azure-agent/files/patch-azurelinuxagent_daemon_resourcedisk_freebsd.py
index 9d8853e89142..347ba8ab5641 100644
--- a/sysutils/azure-agent/files/patch-azurelinuxagent_daemon_resourcedisk_freebsd.py
+++ b/sysutils/azure-agent/files/patch-azurelinuxagent_daemon_resourcedisk_freebsd.py
@@ -1,10 +1,10 @@
---- azurelinuxagent/daemon/resourcedisk/freebsd.py.orig	2020-05-22 12:55:32 UTC
+--- azurelinuxagent/daemon/resourcedisk/freebsd.py.orig	2021-05-18 18:30:52 UTC
 +++ azurelinuxagent/daemon/resourcedisk/freebsd.py
 @@ -1,6 +1,7 @@
  # Microsoft Azure Linux Agent
  #
  # Copyright 2018 Microsoft Corporation
-+# Copyright 2020 The FreeBSD Foundation
++# Copyright 2020-2021 The FreeBSD Foundation
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
 -    2. GPT: The resource disk partition is /dev/da1p2, /dev/da1p1 is for reserved usage.
      """
  
-     def __init__(self):
+     def __init__(self):  # pylint: disable=W0235
          super(FreeBSDResourceDiskHandler, self).__init__()
  
      @staticmethod
@@ -76,7 +76,7 @@
  
          device = self.osutil.device_for_ide_port(1)
          if device is None or device not in disks:
-@@ -90,94 +101,186 @@ class FreeBSDResourceDiskHandler(ResourceDiskHandler):
+@@ -90,94 +101,195 @@ class FreeBSDResourceDiskHandler(ResourceDiskHandler):
              raise ResourceDiskError("Unable to detect resource disk device.")
          logger.info('Resource disk device {0} found.', device)
  
@@ -97,16 +97,21 @@
 +            raise ResourceDiskError("Cannot get resource disk size.")
 +        disk_info = output.split()
 +        block_size = int(disk_info[1])
-+        disk_size = int(disk_info[2])
  
++        err, output = shellutil.run_get_output("gpart show {0} | grep '=>'".format(device))
++        if err:
++            raise ResourceDiskError("Cannot get resource disk partition information.")
++        disk_info = output.split()
++        partition_size = int(disk_info[2]) * block_size
++
 +        swap_size = 0
 +        if conf.get_resourcedisk_enable_swap():
 +            swap_size_mb = conf.get_resourcedisk_swap_size_mb()
 +            swap_size = swap_size_mb * 1024 * 1024
-+        resource_size = disk_size - swap_size
++        resource_size = partition_size - swap_size
 +        if resource_size < MINIMAL_RESOURCE_PARTITION_SIZE:
 +            resource_size = MINIMAL_RESOURCE_PARTITION_SIZE
-+            swap_size = disk_size - resource_size
++            swap_size = partition_size - resource_size
 +
 +        # get size of the current swap partition
 +        current_swap_size = 0
@@ -283,7 +288,7 @@
  
 -        if os.path.isfile(swapfile) and os.path.getsize(swapfile) != size:
 -            logger.info("Remove old swap file")
--            shellutil.run("swapoff -a", chk_err=False)
+-            shellutil.run("swapoff {0}".format(swapfile), chk_err=False)
 -            os.remove(swapfile)
 +        # get swap partition (geom provider)
 +        err, output = shellutil.run_get_output('mount')
@@ -308,8 +313,11 @@
 -        mddevice = shellutil.run_get_output(
 -            "mdconfig -a -t vnode -f {0}".format(swapfile))[1].rstrip()
 -        shellutil.run("chmod 0600 /dev/{0}".format(mddevice))
-+        if shellutil.run("swapon {0}".format(swap_provider_name)):
-+            raise ResourceDiskError(swap_provider_name)
++        err, output = shellutil.run_get_output(
++			"swapctl -l | grep {0}".format(swap_provider_name))
++        if not output:
++            if shellutil.run("swapon {0}".format(swap_provider_name)):
++                raise ResourceDiskError(swap_provider_name)
  
 -        if conf.get_resourcedisk_enable_swap_encryption():
 -            shellutil.run("kldload aesni")
@@ -327,6 +335,7 @@
 -                raise ResourceDiskError("/dev/{0}".format(mddevice))
 -            logger.info(
 -                "Enabled {0}KB of swap at /dev/{1} ({2})".format(size_kb, mddevice, swapfile))
-+        size_mb = shellutil.run_get_output("swapctl -lm")[1].split()[1]
++        size_mb = shellutil.run_get_output(
++            "swapctl -lm | grep {0}".format(swap_provider_name))[1].split()[1]
 +        logger.info(
 +            "Enabled {0}MB of swap at {1}".format(size_mb, swap_provider_name))
diff --git a/sysutils/azure-agent/files/patch-config_freebsd_waagent.conf b/sysutils/azure-agent/files/patch-config_freebsd_waagent.conf
index 95dd7a1d0379..9dd22728d4b4 100644
--- a/sysutils/azure-agent/files/patch-config_freebsd_waagent.conf
+++ b/sysutils/azure-agent/files/patch-config_freebsd_waagent.conf
@@ -1,15 +1,11 @@
---- config/freebsd/waagent.conf.orig	2020-05-22 16:31:32 UTC
+--- config/freebsd/waagent.conf.orig	2021-05-21 08:58:28 UTC
 +++ config/freebsd/waagent.conf
-@@ -48,10 +48,10 @@ ResourceDisk.Filesystem=ufs
- ResourceDisk.MountPoint=/mnt/resource
- 
- # Create and use swapfile on resource disk.
--ResourceDisk.EnableSwap=n
-+ResourceDisk.EnableSwap=y
+@@ -49,7 +49,7 @@ ResourceDisk.MountPoint=/mnt/resource
+ ResourceDisk.EnableSwap=y
  
  # Size of the swapfile.
--ResourceDisk.SwapSizeMB=0
+-ResourceDisk.SwapSizeMB=16384
 +ResourceDisk.SwapSizeMB=2048
  
- # Comma-seperated list of mount options. See man(8) for valid options.
+ # Comma-separated list of mount options. See mount(8) for valid options.
  ResourceDisk.MountOptions=None


More information about the dev-commits-ports-all mailing list