From nobody Fri Oct 3 16:53:38 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 4cdZVp6WRqz6BBZr; Fri, 03 Oct 2025 16:53:38 +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 4cdZVp3nXtz3HB7; Fri, 03 Oct 2025 16:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510418; 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=IRcUv0fwI43CtWFALXQrztIkW8VBsye7F5jSZsPeScM=; b=L+BFmj2XnOnFEget3jGQ1rHJg/RT3Xx0LOHvVkPygNNKHt57HpheSUMRzXInlOzxAt4BzE +QyMJNlZYSlY/IseFYChkggVvXBHxa6V1JLCjNr/0QjByI+M/tYgPHOBabK2k0SpxD9kHE XKZxGEcopMiLXx9X8m99DzG+QSf6jq078FjLlLQI3SfalxWZdIDNMrjtLgSPFLuDR3VAYW 2Khnc8fZ+VeE2Y4T5q7at8HBjtxph4Nn2xBWmE6zdmRovZJAfArkgmzwf8Shmxf+0jbzmW ImJoGj6mDwq+84b4Pd6P9MeZFLfRBdF88IXrith4imKsbhx28FGbXj+imeJzTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510418; 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=IRcUv0fwI43CtWFALXQrztIkW8VBsye7F5jSZsPeScM=; b=ptSRFCdoSpaxkmV1smYBuVDFLRu7XR0+rkJofpbcoQO21VRW7HD9BN2U/SHqbuzbtzeH/+ S68GR1ybATsC/tAUXtEcuScyVJX91bMCLHgbja+9CqCQHa1DuzML4T8VJIIbhDtPQkNJyL wXBHnZjCYShRHQRuHq5nTYH9IDGqIw/wN0nJzn31PaFvZ92p7I0g/Ga2tXWuYUV0+9aaYq W7nC+mm+g1Bxgt/1eaYz4h8TO+bL8mGM7RgvVRLEtcfyKxjKjSrf3nqdPmbYbVrCSnIfVa 0Y20RDY0K07kgFLVQXNlfpxWpNu8cDx8ZuBVugLCriclzhrFOaStTx5RXjYvhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510418; a=rsa-sha256; cv=none; b=CfPk21eeBxiBZG08OUOY2NBSQdpeM5K9ayQLrcHQKTskVoun3J4fJBzZOPSDuPa3y7r9C8 nEn5NcElbC2ovZJUSk7ufrCEN9SJmxG7JpGXJICZAXjqOfPy5DN4Lgac/FesLIdgGlp3Uc d4ujxD2V67KzfCzcxv28LFwkEiaCnA9PPkdP2X3JtcB4fO3hbTVe5GlushKzPtDIC+lpzT p1duSRPouTEgzu6Uz9KtWtwkWmRLPtFt+36B4sA5r7gsnH3mc/KhgVwH200UdfOyAY61fc LoufXQpqZqDi2zgz60EZlKaROpEm0JgNLNZVTBt1HhSLHlEVV3vFPNi2bCUgmw== 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 4cdZVp3Lqgz13Nv; Fri, 03 Oct 2025 16:53:38 +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 593Grc9P064053; Fri, 3 Oct 2025 16:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Grcnn064051; Fri, 3 Oct 2025 16:53:38 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:38 GMT Message-Id: <202510031653.593Grcnn064051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: b9a0e12f6ea3 - stable/15 - release: Create /firstboot in common VM image creation code 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b9a0e12f6ea365d38d1813fa4643cd84293453f7 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b9a0e12f6ea365d38d1813fa4643cd84293453f7 commit b9a0e12f6ea365d38d1813fa4643cd84293453f7 Author: Mark Johnston AuthorDate: 2025-09-11 13:05:31 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:42:21 +0000 release: Create /firstboot in common VM image creation code Some services, such as growfs, only run upon the first boot of an image. The first boot is indicated by the presence of the file /firstboot, which is unlinked after boot. Individual cloudware types shouldn't be responsible for creating it. Do so in a centralized place. Aside from simplifying things, this ensures that we create a metalog entry for the firstboot file. Reviewed by: cperciva, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52450 (cherry picked from commit 1d6b6ea2d0e617d29681da3cf121abec309d272f) --- release/tools/azure.conf | 2 -- release/tools/basic-ci.conf | 2 -- release/tools/basic-cloudinit.conf | 2 -- release/tools/ec2.conf | 3 --- release/tools/gce.conf | 2 -- release/tools/openstack.conf | 1 - release/tools/oracle.conf | 2 -- release/tools/vmimage.subr | 11 +++++------ tests/ci/tools/ci.conf | 1 - 9 files changed, 5 insertions(+), 21 deletions(-) diff --git a/release/tools/azure.conf b/release/tools/azure.conf index dfb90f1cd4f6..7975e1db0822 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -58,7 +58,5 @@ mlx5en_load="YES" EOF metalog_add_data ./boot/loader.conf - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/basic-ci.conf b/release/tools/basic-ci.conf index 4bcb87aec791..e235c03d39fe 100644 --- a/release/tools/basic-ci.conf +++ b/release/tools/basic-ci.conf @@ -30,7 +30,5 @@ PermitEmptyPasswords yes UsePAM no EOF - touch_firstboot - return 0 } diff --git a/release/tools/basic-cloudinit.conf b/release/tools/basic-cloudinit.conf index 7088c0a5f72a..f8554c42f49c 100644 --- a/release/tools/basic-cloudinit.conf +++ b/release/tools/basic-cloudinit.conf @@ -34,7 +34,5 @@ PasswordAuthentication yes UsePAM no EOF - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index aecaabfcd277..335db6cca93a 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -136,9 +136,6 @@ EOF chmod 755 ${DESTDIR}/etc/autofs/special_efs metalog_add_data ./etc/autofs/special_efs 0755 - # The first time the AMI boots, run "first boot" scripts. - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/gce.conf b/release/tools/gce.conf index e1c208e69fe5..a7ccfc27a75c 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -113,8 +113,6 @@ EOF ## of the image prior to packaging for upload to GCE. #sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/openstack.conf b/release/tools/openstack.conf index 05d2d13bbb39..b73734a4fd04 100644 --- a/release/tools/openstack.conf +++ b/release/tools/openstack.conf @@ -47,6 +47,5 @@ vm_extra_pre_umount() { echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf - touch ${DESTDIR}/firstboot return 0 } diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index debc5c1352dd..ebda3b3d6e61 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -89,7 +89,5 @@ EOF sed -i '' -E -e 's/^pool.*iburst/server 169.254.169.254 iburst/' \ ${DESTDIR}/etc/ntp.conf - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index dbec38485fec..577abaac73cf 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -185,7 +185,6 @@ vm_extra_enable_services() { ${DESTDIR}/etc/rc.conf # Expand the filesystem to fill the disk. echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf - touch ${DESTDIR}/firstboot fi return 0 @@ -396,6 +395,11 @@ vm_create_disk() { >> ${DESTDIR}/etc/fstab fi + # Add a marker file which indicates that this image has never + # been booted. Some services run only upon the first boot. + touch ${DESTDIR}/firstboot + metalog_add_data ./firstboot + echo "Building filesystem... Please wait." buildfs @@ -420,8 +424,3 @@ vm_extra_create_disk() { return 0 } - -touch_firstboot() { - touch ${DESTDIR}/firstboot - metalog_add_data ./firstboot -} diff --git a/tests/ci/tools/ci.conf b/tests/ci/tools/ci.conf index 1d2921ab75f3..2302fc479a47 100644 --- a/tests/ci/tools/ci.conf +++ b/tests/ci/tools/ci.conf @@ -119,7 +119,6 @@ fdesc /dev/fd fdescfs rw 0 0 EOF mkdir -p ${DESTDIR}/usr/local/etc/rc.d cp -p ${scriptdir}/../../tests/ci/tools/freebsdci ${DESTDIR}/usr/local/etc/rc.d/ - touch ${DESTDIR}/firstboot return 0 }