From nobody Tue Sep 30 15:23:32 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 4cbhfF0kmYz69Dwy; Tue, 30 Sep 2025 15:23:33 +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 4cbhfD5xGdz3LCt; Tue, 30 Sep 2025 15:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245812; 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=lwFuAXnIMrfAdtI5TVBG5bq9/miTRPDQ85a2M+F0Ay4=; b=J4LPC+78M3n9BN5o7JhuQsQUTMXAnEyyQR0bXR282juLIfra2mgAHEC6cDMr8UcE8k/KRb uGnFvcuwmoDQJHv5OpKYv9e8OYyg8iOGunKoIYBL612+avIEFI6CtK6Lcl9FfEIgrbn0H4 TmlIRnbMu6eq2ns4ifJ+DWmc+9/0kYY8EymTbOQpYEcdkv/3uSmV+lQS9PiMa/Rki7t4+y pqZoLOkw+zWr6JjecVfl9XJ+KgnaqmrGX49AOl1bnJ6qiEf2tm01aWmrzbR+9qAZsmqSId bYnMN4KaMQnOxBuju2uBeKjBjp8/99wCFrbb/zLF5KW/cmo9q5r4D4suECg0KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245812; 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=lwFuAXnIMrfAdtI5TVBG5bq9/miTRPDQ85a2M+F0Ay4=; b=gf1CtLOXL61VJBbireunpqWgN+8KDckY3wbkbxzR+isWhEo8Mq0thEcUDE17h234gY6FpF ZlNm8XU3IBRYW7oyM4HvhCGZkRn9K6iaN+0twXQ6mxPY4jvfMDbuHgBZd3in7J2TqvHOgS hgCmJbIE3K+lKyy1xhP+B/N18aYnP7CAPtxc8uad62sVgO03shh0QR7hnZ1DcLSRqbS+VO fyYpurnz3hkV858zOVPWlmsCxCFA4KBgLzUJ3Uxl3hknqDautRylLx+lcn0bH2WEKmXLaM P+0TiZw6gSrcvZLgYdcUAt4u285VtWb7t8mLiTffRdv8+tyAK/FO8SfNn8ZQPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245812; a=rsa-sha256; cv=none; b=NehSiHnzARJyhG0ytMJW8mjBTCwGwFH9Tr3Ad/X0g7EFa28zkKNFLLmMQ7eXOY00zeth2f YKRABucYBYjuAPvIuiXY5zFizR/F6aTtnJqNF4nHkpNMqI8JtrV+UjNtzt7sB2RL35ZO17 wbH+3OQYvrMLFqHl7xnXtqPZQ7v+emRSSpZHS83jzp1A/LDI5sAuJLdJ3zZa0Wj9dVHwuk ht7aJrEcJ/Z4Z+Xaf/GRtBzq16BznT01HNujo6q3rfKLiGAfSoznaLsbfmsaHRA3Am0xCS jU1U9ihM7hosnLA+8/fx16EXw+cPpBQz2JSJpUfZgs6y2NVR1ciWd/akfg9ZJA== 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 4cbhfD55J7zhmd; Tue, 30 Sep 2025 15:23:32 +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 58UFNWto045509; Tue, 30 Sep 2025 15:23:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNWre045506; Tue, 30 Sep 2025 15:23:32 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:32 GMT Message-Id: <202509301523.58UFNWre045506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 59a0361e5f79 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 59a0361e5f791c2eb6ea882f9c218e5f49c63861 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=59a0361e5f791c2eb6ea882f9c218e5f49c63861 commit 59a0361e5f791c2eb6ea882f9c218e5f49c63861 Author: Mark Johnston AuthorDate: 2025-09-16 16:53:13 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +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 (cherry picked from commit bab6b01bcfead662b8b10dc52a18beeb42794505) --- release/tools/azure.conf | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/release/tools/azure.conf b/release/tools/azure.conf index a633e6e508d4..dfb90f1cd4f6 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 + # 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 - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods + # 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 - chroot ${DESTDIR} ${EMULATOR} pw usermod root -h - - - umount ${DESTDIR}/dev + 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 touch ${DESTDIR}/firstboot