From nobody Thu Sep 11 13:06:55 2025 X-Original-To: dev-commits-src-main@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 4cMyWM3Sxcz66fC1; Thu, 11 Sep 2025 13:06:55 +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 4cMyWM1L2Rz3d2b; Thu, 11 Sep 2025 13:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757596015; 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=vjm+xntkvz9tLRlhrP7KOAabmeztnprf6VJVdh8V6XA=; b=S+3OsQXgUg+BsFwO7V4/wACEzEDb9gFdOVXN2uHjPW3GuwgsTSx0FwaTdLtWqW20k6BqVY Rc146af7wUbUt+yLZ7lRVvOhmd98fxY5uFoHY43kd8aGCSPE871q+MXVWk+UGJldoXVh5z u/ZO9S7l7Aa25cc83hgC60E7CbASn+Uu82rLJnkDWatEYsGP05QTrufRBuIOz7SRJJLZ0i +zNU5ahkmIDYcHMel38GA6QKv8JZu1m/yxUVbwBa/KkG6jE0W3YQXWC8l8KmLIJSKED8UH ya2eKcKwlncfQatySIQlIGirxCwAlTsO2hVe/qpEmXqhtOUhehjmON7k669L1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757596015; 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=vjm+xntkvz9tLRlhrP7KOAabmeztnprf6VJVdh8V6XA=; b=Qpxc2u5O3X9VVnSmQqM9mqEZD6J1PONBrHyJPOSghN77O9XhS6GNJS72QDHk7Nh9Vr5Aab iSPfI3Qx8QLpeB3AUSRHYNq0ezEnDS2hXCC+2Rfgl4+Njl7t7nqWALeuPZZOWC45EWyahW gXJ5OyMnum/06JHQg0fmzfJ0Iek5uM1YPyjGPmKBSEm9wCG7mt2HLSSNLDSZ0ZnXw+iskQ 2aLFBGcsqnfcuzH4FVXWjL1bDPbe1Yt9HZx3bgUUwCp2EoiHExAejlfMrMQWyBXDd19w9y 6mzFnITomJ2+uguuRU0ESfV5OFvijoRnMmd32Xrg8ZLCyh4C2wPwttO2ZPrBBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757596015; a=rsa-sha256; cv=none; b=doUSHuzoACS85708V3QhdykahAEfQfPJYMXjIH13HnQh0bWuKu15DfmjO7YZvB/+P/kNMd 5ciBpuzCTX2zZZgDA5NPU8qsN104aS+akNNpRdeKrqIA0NsgjY/GNcd0dgQEYLufyTlrTo Rcz3X0ILNzTx8nIxZUJiddYLlMeNgGkOOc13WPdr4T1uQru1tf1wBdeie+MIDRCMxiWfpY mp5GV6REVSHz1UBrwqiO9tDejb3v7mcbTJ3bmHT1ijJOKCp10s1GK5KxLWB032PEdcyWq3 Wq3wJi165EbnJISYWz1FHVOlODwkTnHl95zbrktjNtzw5yfUVqysSWbOOCVhuQ== 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 4cMyWM0tVSz17r0; Thu, 11 Sep 2025 13:06:55 +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 58BD6tau044192; Thu, 11 Sep 2025 13:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58BD6t0m044189; Thu, 11 Sep 2025 13:06:55 GMT (envelope-from git) Date: Thu, 11 Sep 2025 13:06:55 GMT Message-Id: <202509111306.58BD6t0m044189@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: 1d6b6ea2d0e6 - main - release: Create /firstboot in common VM image creation code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 1d6b6ea2d0e617d29681da3cf121abec309d272f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d6b6ea2d0e617d29681da3cf121abec309d272f commit 1d6b6ea2d0e617d29681da3cf121abec309d272f Author: Mark Johnston AuthorDate: 2025-09-11 13:05:31 +0000 Commit: Mark Johnston CommitDate: 2025-09-11 13:05:31 +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 --- 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 a633e6e508d4..e13b63067fee 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -52,7 +52,5 @@ mlx4en_load="YES" mlx5en_load="YES" EOF - 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 31f40962b19d..704a8f3f0073 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -128,9 +128,6 @@ echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws.com:/" EOF chmod 755 ${DESTDIR}/etc/autofs/special_efs - # 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 382a839786f3..dc56be30c7ca 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -119,8 +119,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 72c8dd9ded78..688820be9cbe 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -87,7 +87,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 32eec6f220e7..41f889a1e665 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -157,7 +157,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 @@ -351,6 +350,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 @@ -375,8 +379,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 }