From nobody Tue Sep 16 20:50:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cRDZM52mKz683Jx; Tue, 16 Sep 2025 20:50:51 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cRDZM3CTpz3VXM; Tue, 16 Sep 2025 20:50:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758055851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o5On6EG8twFjQvGWGUu37bP9jq87Mkg4ke0EZcEOy1k=; b=ErV6zxgTFC55XJCG8WyhYnNdwkC22tY0PB1BKOpw8SK0yawXGZKCd61D9179VTCLKTZOAf HHE8wDO60UbCkQR4ZXc+swgnaN5/5gPfqGWOCoCLjNl//RO8c94PCCBxnF8MLHHP0L3yAP /2g0iKWVwJ0p0CZEKgFQABFNnok71ZPCT6f/9lNnToLkXA/0/KRNY/2dlwvuiJGDE/9bBo OKRYIgCZW1ipHN+SoxYREXqeoQkw0c/8hDj2+Up/Z6JDiHZbzJGWkBRz8vW7wIspNI6h/0 x7wooFYedFuuK5scVuzhk9ixuMPN63sRh0Go5+nrGyKntP/E3/NEu6DiHymb+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758055851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o5On6EG8twFjQvGWGUu37bP9jq87Mkg4ke0EZcEOy1k=; b=LG2i6w+EmjkVgOSIHN2ABlkF6nIIPJHmjw7Eql9cVs79rxSGxPjOo1WCAeb6qPZuBApxUh NeHxPre6cmqz3bfBeeolPZiF3P+ChrFB87iMbFN0MrSVkwS/QcpJ4ROAZSMaZ4oBXb06Gk NsnEk6c/CcON53Z9pmiIme3oPWQrkEJ+V6iEDaisWEFxRyXwozRvqr+5LIzmZssj3RAhF/ oncaqVHDZOKkwdmYS6v5vU3TUQ2NyzSefiASP2kKiI9GLW1piLmNhtyLGxKIds3NFgfLBZ 7FEX++HS4V5HakvCJ3E+HoG4BBQW6r/iqsAtszZ7eEF3E7cknDIwYny+BnVRBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758055851; a=rsa-sha256; cv=none; b=EUKp/t8TlYmxXhHEL3mpif384pxPgDfMG16zZUuLs522SS6JtFSIPnLXHViX/oyYibOv4W YBFvTjPIA+XigJDQjVUwq5gK01ulb6YSTGKr5G2FGmeDFV3yDx+YaM92Ze4lgxJUYXXv5B V0088+S6G/KOY79nIee1UAzW+5622pnKZYtbcE1SPVGGk7CFsT9rhG1oTIHbK9DgoSke1l zmSamZXhQP4YlX9Ei6j7R2e9h0+G9/k3tucMqSFeTJiapQ1hckdlYq/jKmciX6MJW1FFK5 XRr/ZZy9CnLMl4CaZ6viaDYkob3hHX660VMLTVJZhB8/4dQi7tzlkcP28HRDDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cRDZM2VjdzwWf; Tue, 16 Sep 2025 20:50:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58GKopdc046272; Tue, 16 Sep 2025 20:50:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58GKopOR046269; Tue, 16 Sep 2025 20:50:51 GMT (envelope-from git) Date: Tue, 16 Sep 2025 20:50:51 GMT Message-Id: <202509162050.58GKopOR046269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bab6b01bcfea - main - release: Make azure cloudware images buildable as non-root List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bab6b01bcfead662b8b10dc52a18beeb42794505 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bab6b01bcfead662b8b10dc52a18beeb42794505 commit bab6b01bcfead662b8b10dc52a18beeb42794505 Author: Mark Johnston AuthorDate: 2025-09-16 16:53:13 +0000 Commit: Mark Johnston CommitDate: 2025-09-16 20:50:33 +0000 release: Make azure cloudware images buildable as non-root - Don't chroot to uninstall pkg since we don't install pkg in the first place. - Use pw -R instead of chrooting. - Add metalog entries. Reviewed by: cperciva, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52451 --- release/tools/azure.conf | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/release/tools/azure.conf b/release/tools/azure.conf index e13b63067fee..7975e1db0822 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -19,20 +19,25 @@ export NOSWAP=YES export VM_BOOTPARTSOFFSET=1M vm_extra_pre_umount() { - mount -t devfs devfs ${DESTDIR}/dev - - # The firstboot_pkgs rc.d script will download the repository - # catalogue and install or update pkg when the instance first - # launches, so these files would just be replaced anyway; removing - # them from the image allows it to boot faster. - chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg delete -f -y pkg - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods - - chroot ${DESTDIR} ${EMULATOR} pw usermod root -h - - - umount ${DESTDIR}/dev + # Remove the pkg package and repo databases as they will likely + # be out of date by the time the image is used. In unprivileged + # builds this is unnecessary as pkg will not be installed to + # begin with. + if [ -z "${NO_ROOT}" ]; then + mount -t devfs devfs ${DESTDIR}/dev + + # The firstboot_pkgs rc.d script will download the repository + # catalogue and install or update pkg when the instance first + # launches, so these files would just be replaced anyway; removing + # them from the image allows it to boot faster. + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg delete -f -y pkg + umount ${DESTDIR}/dev + rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports + rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods + fi + + pw -R ${DESTDIR} usermod root -h - cat << EOF >> ${DESTDIR}/etc/rc.conf ifconfig_hn0="SYNCDHCP" @@ -51,6 +56,7 @@ boot_serial="YES" mlx4en_load="YES" mlx5en_load="YES" EOF + metalog_add_data ./boot/loader.conf return 0 }