From owner-dev-commits-ports-all@freebsd.org Sun May 23 13:38:09 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3CF364834D; Sun, 23 May 2021 13:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fp1cw6b8pz4hcM; Sun, 23 May 2021 13:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA4CD181E1; Sun, 23 May 2021 13:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14NDc8NN039593; Sun, 23 May 2021 13:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14NDc86N039592; Sun, 23 May 2021 13:38:08 GMT (envelope-from git) Date: Sun, 23 May 2021 13:38:08 GMT Message-Id: <202105231338.14NDc86N039592@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Li-Wen Hsu Subject: git: b185a2b866b8 - main - sysutils/azure-agent: Update to 2.2.54.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b185a2b866b8642e2500dd691267694ac388875b Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 13:38:09 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/ports/commit/?id=b185a2b866b8642e2500dd691267694ac388875b commit b185a2b866b8642e2500dd691267694ac388875b Author: Li-Wen Hsu AuthorDate: 2021-05-23 13:37:40 +0000 Commit: Li-Wen Hsu 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