From nobody Mon Jun 23 07:40:57 2025 X-Original-To: dev-commits-src-branches@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 4bQg4B18Hvz5yw2Z; Mon, 23 Jun 2025 07:40:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg4B0D59z47kM; Mon, 23 Jun 2025 07:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664458; 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=cYUIP8riDWbQLIHaDYXnILtU18UUniNC8MweyB/1kpo=; b=i4HWZjT2dEEwJPj83XttqySHw2eIKq5g7HdpQDhbUEG19KwK+WhjfLmtp4sHxAvX632+fP +eFPw1SySceirxURBNvmbJXPW53V77y2LvXYeQ4fai20Djdpr4oJtN9KMtG7mqeVfJLkil fP2NJOTC0r3ztZNp9YObKQq4tfGII2OxHIY17CMMqyD8iQfvyafzsbk1op/QMJ+DCEfR0U 9XFYX26m3ZR8tZSRSDK76HGELnO6eMYjZ9J8GbR349beRA3xvDYGvBiGPJQCFIo8D0X3yt amSgt6nwcf2O0IeDvExdIEqCjKBUZtz/TKL7YzxZayU8Yap415fubXYp7wGk/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664458; 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=cYUIP8riDWbQLIHaDYXnILtU18UUniNC8MweyB/1kpo=; b=wOCw25KmeEogE2Mv03gIXr+52WQMoZXN9qbTwPCvFSu740qEjam/RfB6xSkveoniWx2ucE zRKPXtO+qwsfQUPaW+2Cs7jtWZYBUlnQ3CQ/xEWzkKq+HggcBsX9zKSkArQMimE/0m0uJc FEqFdhR4m7Z0ZqINYMtjcE34nuo8MX//kcN+ykKOR6XiCr1txxw4Jxm3kb36dsMwGuV9q7 cil8uolBpueCtMzn8ZoLN4xx87dRLQisFiKYzAec+g0WT+8iqTiS2YlxtnuBDEm4eky0EN TeNuDzzA9cdZWkpx637t6TsTPrY4Q5y4N502Ts5ixZgj0BHbHcv31bZibJXZOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664458; a=rsa-sha256; cv=none; b=T+ty8x2UmR6+2BOiDrbKMQ2kzqdy+vBGW9OtNXjdGAHW7jJB+e4+srEM8yeE9HWVqQsVe5 a+kgujFmWFJG50gzVl14lpOwJB95FtGk4/1tJiogTz315wctzdRLJyWgXRTyW4FGgbbw+C HZop0gPBYsM/3wRABL3BQF6PrLwqZTnBZC/2oI0xQF6gllKntYaY6NqA7Rj9tm5TcV8PrR LeA0Fki5PAm1PWVzGa1euglrXBKYpJRgT0He1LsyEYnXvLzzUhfDB1K+kq5Gy943YqhCBz BWb/iwQzK4ouo3Kc0tCoH9PkB/B3w6vDsR3E2x1SmKHIQ9PjfD0K7waG1GLvNQ== 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 4bQg496qsLztVl; Mon, 23 Jun 2025 07:40:57 +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 55N7evhW064868; Mon, 23 Jun 2025 07:40:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7evkY064865; Mon, 23 Jun 2025 07:40:57 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:40:57 GMT Message-Id: <202506230740.55N7evkY064865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 884ca28b97e7 - stable/14 - libusb: use eventfd List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 884ca28b97e73f297b512aaf04deb6f951854c02 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=884ca28b97e73f297b512aaf04deb6f951854c02 commit 884ca28b97e73f297b512aaf04deb6f951854c02 Author: Baptiste Daroussin AuthorDate: 2025-05-15 13:21:50 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:40:33 +0000 libusb: use eventfd Simplify libusb code by replacing pipe(2) inter thread event mecanism with eventfd(2). MFC After: 3 weeks Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50360 (cherry picked from commit ae28929b7c78267815e994e0ad12e3cc7db361bc) --- lib/libusb/libusb10.c | 20 +++++++------------- lib/libusb/libusb10.h | 2 +- lib/libusb/libusb10_io.c | 5 ++--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 6d9c11910ea0..5564bfd8b499 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -118,15 +119,13 @@ libusb_set_nonblocking(int f) void libusb_interrupt_event_handler(libusb_context *ctx) { - uint8_t dummy; int err; if (ctx == NULL) return; - dummy = 0; - err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < (int)sizeof(dummy)) { + err = eventfd_write(ctx->event, 1); + if (err < 0) { /* ignore error, if any */ DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "Waking up event loop failed!"); } @@ -145,7 +144,6 @@ libusb_init_context(libusb_context **context, struct libusb_context *ctx; pthread_condattr_t attr; char *debug, *ep; - int ret; if (num_options < 0) return (LIBUSB_ERROR_INVALID_PARAM); @@ -233,19 +231,16 @@ libusb_init_context(libusb_context **context, ctx->ctx_handler = NO_THREAD; ctx->hotplug_handler = NO_THREAD; - ret = pipe(ctx->ctrl_pipe); - if (ret < 0) { + ctx->event = eventfd(0, EFD_NONBLOCK); + if (ctx->event < 0) { pthread_mutex_destroy(&ctx->ctx_lock); pthread_mutex_destroy(&ctx->hotplug_lock); pthread_cond_destroy(&ctx->ctx_cond); free(ctx); return (LIBUSB_ERROR_OTHER); } - /* set non-blocking mode on the control pipe to avoid deadlock */ - libusb_set_nonblocking(ctx->ctrl_pipe[0]); - libusb_set_nonblocking(ctx->ctrl_pipe[1]); - libusb10_add_pollfd(ctx, &ctx->ctx_poll, NULL, ctx->ctrl_pipe[0], POLLIN); + libusb10_add_pollfd(ctx, &ctx->ctx_poll, NULL, ctx->event, POLLIN); pthread_mutex_lock(&default_context_lock); if (usbi_default_context == NULL) { @@ -288,8 +283,7 @@ libusb_exit(libusb_context *ctx) /* XXX cleanup devices */ libusb10_remove_pollfd(ctx, &ctx->ctx_poll); - close(ctx->ctrl_pipe[0]); - close(ctx->ctrl_pipe[1]); + close(ctx->event); pthread_mutex_destroy(&ctx->ctx_lock); pthread_mutex_destroy(&ctx->hotplug_lock); pthread_cond_destroy(&ctx->ctx_cond); diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index 544364386061..47d918959f63 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -93,7 +93,7 @@ TAILQ_HEAD(libusb_device_head, libusb_device); struct libusb_context { int debug; int debug_fixed; - int ctrl_pipe[2]; + int event; int tr_done_ref; int tr_done_gen; diff --git a/lib/libusb/libusb10_io.c b/lib/libusb/libusb10_io.c index 2790142486ba..f1e31c2a7416 100644 --- a/lib/libusb/libusb10_io.c +++ b/lib/libusb/libusb10_io.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #endif @@ -187,10 +188,8 @@ libusb10_handle_events_sub(struct libusb_context *ctx, struct timeval *tv) CTX_LOCK(ctx); } else { - uint8_t dummy; + eventfd_read(fds[i].fd, &(eventfd_t){0}); - while (read(fds[i].fd, &dummy, 1) == 1) - ; } } From nobody Mon Jun 23 07:42:32 2025 X-Original-To: dev-commits-src-branches@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 4bQg603j1Bz5ywf8; Mon, 23 Jun 2025 07:42:32 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg601qM8z49d2; Mon, 23 Jun 2025 07:42:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664552; 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=DTpcUlSYPm75Oi5JxUMtxTjMPIqFSlJ8xKrxfqj1Buk=; b=jxNZ7jlypl/o0Hgj6iwJNH3zcgUYmp1UN3hxeEjyeHX+uNm9u3RVVcmUE/ISTNc0y+w+VL 3grz+TOTobX2RvsVjOGwAX176SBPhSritpovD7n1ZOooAkMm3k5LFm9l3k7Oh1/W3oTLBH R2+BxQu+qGQRLuufzCSZnWeqZsAe3LrugYG4qyyzGZ2t5tq6kze9HH69Il6bgvbWIhmzhu PiUP4lWGt7B7Om5vjtz5SCUCDsVuPdMVIi+qiAvzaxBJNjZO9CYw+OEn4RNLWNfimISE9A 5nxYZUCaRULYQDNMZnqstXjMeLahQabkurzYuMbHndSzKlVlHsxm2UBOcSPKBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664552; 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=DTpcUlSYPm75Oi5JxUMtxTjMPIqFSlJ8xKrxfqj1Buk=; b=UsVdSjmxa5bSpwuw1RelXQ7uYq/WMZLDc2262hDGLclBpwEvpm2Bgj4UaHrEmjqj5uq2T6 WHn8RhCRzESuyUKvKHEA2z3Gnt3W17MdthUzb0Mmc68tF3vpXzRQNAWFadwq8nory0c8ii /DO1S64m/c/vgdRR3CqQUyVHM/sl/0DRAMNJ/NpTEVtwmCoQmFbniW7wN/lw6qZMMlxHoc 6eFlVUjs1db+6dIU2MhjxhlkLI8177t1ri9lrvpoBcIs5d+ZchlBsRC6NJK79HH86TZSpp hqff2D3/SiDC6e6ZI/GmcsT3yAv5F61Zgghv5zPFhrSuwmgQsiqzJlfsiNtPsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664552; a=rsa-sha256; cv=none; b=ttLlBELOeeeFvshyZ87wQDMxnCE9j+yxencmREtIPPklkzIEDErG+/5OEpzrtvss9h++9d sZXG/Bt8wK0DmMfUcjCDCRNt74iHio2tS3kXQtg4AIlgV5upwkgNzEpaSSQtFHqlpE/yGn ZvCCkPcL4EN7vJCmA/9BejYuSDQbtoajEL3/+b17ArrukeMiNbk+Kvv86cR6QrjhSX7uC6 rKN6KLCVfzq7Xb9x2uMpcPDu7afRE60IcyFBJ/OJ7I7qKQJf4AcrQJ9uBt2sXDiCXzD+2L amS3Vmqy/1EeU1ntLM4Y+dZo7tN//qNO8PWg/okASQcoC6eWEsyYRXc8S6imEA== 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 4bQg601CTvztYn; Mon, 23 Jun 2025 07:42: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 55N7gWpj066404; Mon, 23 Jun 2025 07:42:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7gW7V066401; Mon, 23 Jun 2025 07:42:32 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:42:32 GMT Message-Id: <202506230742.55N7gW7V066401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: eb9f57c2458b - stable/14 - pkg.conf: add valid configurations for kmods for all branches List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eb9f57c2458bbae5be4ab52590bae9b2ac65026c Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=eb9f57c2458bbae5be4ab52590bae9b2ac65026c commit eb9f57c2458bbae5be4ab52590bae9b2ac65026c Author: Baptiste Daroussin AuthorDate: 2025-06-03 14:20:20 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:42:26 +0000 pkg.conf: add valid configurations for kmods for all branches MFC After: 1 week Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D50668 (cherry picked from commit db6f6cc583bde6c21618ab4a4ab926f9d57b1641) --- usr.sbin/pkg/FreeBSD.conf.latest | 2 +- usr.sbin/pkg/FreeBSD.conf.quarterly | 2 +- usr.sbin/pkg/FreeBSD.conf.quarterly-release | 23 +++++++++++++++++++++++ usr.sbin/pkg/Makefile | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pkg/FreeBSD.conf.latest b/usr.sbin/pkg/FreeBSD.conf.latest index 2175a3387437..8c68118c4938 100644 --- a/usr.sbin/pkg/FreeBSD.conf.latest +++ b/usr.sbin/pkg/FreeBSD.conf.latest @@ -15,7 +15,7 @@ FreeBSD: { enabled: yes } FreeBSD-kmods: { - url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}", + url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/usr.sbin/pkg/FreeBSD.conf.quarterly b/usr.sbin/pkg/FreeBSD.conf.quarterly index bd0ee13b9b43..884226fc02d1 100644 --- a/usr.sbin/pkg/FreeBSD.conf.quarterly +++ b/usr.sbin/pkg/FreeBSD.conf.quarterly @@ -15,7 +15,7 @@ FreeBSD: { enabled: yes } FreeBSD-kmods: { - url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}", + url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/usr.sbin/pkg/FreeBSD.conf.quarterly-release b/usr.sbin/pkg/FreeBSD.conf.quarterly-release new file mode 100644 index 000000000000..bd0ee13b9b43 --- /dev/null +++ b/usr.sbin/pkg/FreeBSD.conf.quarterly-release @@ -0,0 +1,23 @@ +# +# To disable a repository, instead of modifying or removing this file, +# create a /usr/local/etc/pkg/repos/FreeBSD.conf file, e.g.: +# +# mkdir -p /usr/local/etc/pkg/repos +# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf +# echo "FreeBSD-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf +# + +FreeBSD: { + url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} +FreeBSD-kmods: { + url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} diff --git a/usr.sbin/pkg/Makefile b/usr.sbin/pkg/Makefile index b44905ee4976..27f77d3dbb23 100644 --- a/usr.sbin/pkg/Makefile +++ b/usr.sbin/pkg/Makefile @@ -7,7 +7,7 @@ BRANCH?= ${_BRANCH} PKGCONFBRANCH?= latest .else . if ${BRANCH:MBETA*} || ${BRANCH:MRC*} || ${BRANCH:MRELEASE*} -PKGCONFBRANCH?= quarterly +PKGCONFBRANCH?= quarterly-release . else . if ${MACHINE} != "amd64" && ${MACHINE} != "i386" && ${MACHINE} != "arm64" PKGCONFBRANCH?= quarterly From nobody Mon Jun 23 07:44:06 2025 X-Original-To: dev-commits-src-branches@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 4bQg7p5nRRz5yw2s; Mon, 23 Jun 2025 07:44:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7p4D5lz4CMR; Mon, 23 Jun 2025 07:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664646; 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=A9gPC7DU/GUfb/LRKOKhOCJpZaOoHgQqKj8DmYkdOOs=; b=J4Btfl68wL9DX1poHiN+Ej8e81c4ZpVrpBT8vzprZSK+Euf7UYHA7kTWSAZb9aGUNHDcA2 jM8ZLUS4qTL7JgQYiShRlkTwGAjFKHQumIVd3ZWwkuYw/jUtGZnpiy2ZFzbaLzHHAoJrii nzHsWPgyDXT+qJc7W6JuV9fYVmHqNxNcpjrQzKly1jgfS+dCRMY3CULVrwHzDFluNYmS3M bJlq9Mhxzb+3AEHAtCD0/xFF6A3J5RDZkicrbo3/1eyHXTHXFHKxxSYe0uzTNRsGMng/yF jgDP+SKvIELBKTakV9nTBcdcTbandUWdGbnd4SNkWLHWvqS+/tOB7wcuxwyeEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664646; 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=A9gPC7DU/GUfb/LRKOKhOCJpZaOoHgQqKj8DmYkdOOs=; b=iZa1Yhx8qf9Ll245I537CfkDuRtLY9kT0MAJwGtoUEZeH1T8Yo7hzP5LV3gTfRGGbYJBaI Msy1ieTTUbzjKHhzP62vjeDjifpRwMKS6iX0koyf0/1wQe0CD2sqoxQCVTPbKiEcNsUJO3 k1y5O7Hp/0V5Na3st7zwg0y6KlOouCwZJVez35qmczqMoKKf3pt9RWJijwun1PtBuH/A+3 2OnjNJQoOyL3IWMtj+DsbDIfCNSYlmYG2iZH7vraoqHfFX9XgEJmnZeHET6ZQKnG/xVvqk pwSQu2Yrj/z0AS3IHeATYjtHcbFkqy0RjFhuo9gtU6vqQY9aJ04MvCXcgIzWaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664646; a=rsa-sha256; cv=none; b=wEZ9CQB8zqtqBIxmy7b/Dt07zPadrNUN57W7DDdbcL/IDcqJOwU86FQDCsiydbYMfeClcM /LWw4ucdYy2eo0vZhWdlRLyI8/VtWtIvBOQ+HWY34jT/EiZe0stEPh9Jwy2t+kE658ebmB oh08hk/CbIfUQRkkpDqIGHSVoGKenSWr8fVVOEnyKCJA+g+598Uh+SIgncMzH1efHPUMTm ohiYWURFGL9AFtRuk5qhqCc0KuuiebSz+eyNVI6CzMotDdx95yf5S1GwCS0LqOWIyZ/KIo Lqi0wMjz/5yZmDoKP309L4Kd4xNUTrXcxMHuIRegw2tLupacE9oj1sXojjH0zg== 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 4bQg7p3pm1ztxD; Mon, 23 Jun 2025 07:44:06 +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 55N7i649067084; Mon, 23 Jun 2025 07:44:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7i602067081; Mon, 23 Jun 2025 07:44:06 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:06 GMT Message-Id: <202506230744.55N7i602067081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 548d4b2af90b - stable/14 - nuageinit: log nuageinit execution List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 548d4b2af90b5cf95eab24ffc4d0dfa5a1f348eb Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=548d4b2af90b5cf95eab24ffc4d0dfa5a1f348eb commit 548d4b2af90b5cf95eab24ffc4d0dfa5a1f348eb Author: Baptiste Daroussin AuthorDate: 2025-06-06 11:06:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:11 +0000 nuageinit: log nuageinit execution Sponsored by: OVHCloud (cherry picked from commit 9a62e1d98dc79c69f0d20439bd34a16149106046) --- libexec/rc/rc.d/nuageinit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit index 54e5b1fbec07..c901971488bd 100755 --- a/libexec/rc/rc.d/nuageinit +++ b/libexec/rc/rc.d/nuageinit @@ -75,13 +75,13 @@ nuageinit_start() for d in openstack ec2; do dir=/media/nuageinit/$d/latest if [ -d $dir ]; then - /usr/libexec/nuageinit $dir $citype + /usr/libexec/nuageinit $dir $citype 2>&1 | tee -a /var/log/nuageinit.log break fi done ;; nocloud) - /usr/libexec/nuageinit /media/nuageinit $citype + /usr/libexec/nuageinit /media/nuageinit $citype 2>&1 | tee -a /var/log/nuageinit.log ;; esac if [ -n "$drive" ]; then From nobody Mon Jun 23 07:44:10 2025 X-Original-To: dev-commits-src-branches@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 4bQg7v1km1z5yw2t; Mon, 23 Jun 2025 07:44:11 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7v0wq1z4CMf; Mon, 23 Jun 2025 07:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664651; 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=J6qw0fMbeeVDRAmHAxtcbPwjGNDSzNI3L2Jb24fHv/s=; b=Orrjp+EQobaj1SplwzNiYmbTTk7PGzyHpPseEJU2Rf+o0sGi9OeEGveuJupuiuGhDjF8FQ bBfDAnY87LBV/f08arJuoMAIoXslg0NDX6syW/QP0/ymzk2xUZ8AL/DbpIp2Elzpu0km4m yW6J2b0jKrtdYAU3ohLpc0BQ8gG9xLZo1VvlpJ8ayx+91WzDBkP7MEvV0ckjtMtfojHY2q /AH/LWt2GQbzro01EL+JWgg1l6qThMYnSvvhV5S7WPDzrYmGxhJiwTQ7X0H06Lrg70Hmvq 0l32RM7RnL2a3QhgPtRW68on3usPfHXAca8qWGUnCGH7JkrHR/1aq07XQXLa2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664651; 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=J6qw0fMbeeVDRAmHAxtcbPwjGNDSzNI3L2Jb24fHv/s=; b=nqVbZGepEaP1LUZ+D8SU4+NHkzB1JAx0RM18DJsL/e+b2g+ZjZy39LFEApiD3Ivv9Npxae 3u6SdYNrptiyDjJE8+7VX5q7fgCOxR5Y3+b7RMCquOYHRoRRPQqOH5cbs9xlPnf7TQVeNJ PevF0675Ah+Im/mgpcKOrYIb+OuTiq87S5lStS0nZDVp6bYfmjg8ExGY6Jj9wcQa10msZy OnJq4Olsn0gYpplkVuXzHqxLxJMIeuTts0FelyJPRy0egF4BEJvhtlJqZiKeH0bumIi9Kh Lz9GDmyNjRc1YwHUvGfXJE+k+jzROH7wQxixB85SD0vjJv3agYO1EY1desNknA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664651; a=rsa-sha256; cv=none; b=mIK62iby9BsHQjeyp7Of6d8BbaGuNezC9EhDIJ6XElgH966Nf5mt5LQw3+N3uYdFS4q4PV 0/cRPq7YsS/qybRXG/jZlNB2O/vbbdeLXam8cOEV71jIBjaFbNc2wM92cNahh4Kw0z9Xfu CzyLD6TosRsXDV5pSmznS7xrLX9049fMs2mT5bMUJGeTL7GvjsG9975FzSDaEFS/ySqef4 KyzboMTyi2eJQWNKCU6R6hGXA1n/xnEbKECVHROph2G/7aQ0gz3jLi2o5BMvADqzftllaP I0i8dOF4ghfZ5+2zlQMC9siPjbA53ZbC4JO/txou1nmDnek2MWCG59uA7XYZbQ== 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 4bQg7v06V8ztlB; Mon, 23 Jun 2025 07:44:11 +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 55N7iAkL067222; Mon, 23 Jun 2025 07:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iA9U067219; Mon, 23 Jun 2025 07:44:10 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:10 GMT Message-Id: <202506230744.55N7iA9U067219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 27522eaa4c0c - stable/14 - nuageinit: implement packages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 27522eaa4c0cb4bc1348fd212ee79449e5da79bd Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=27522eaa4c0cb4bc1348fd212ee79449e5da79bd commit 27522eaa4c0cb4bc1348fd212ee79449e5da79bd Author: Sebastien Baylocq AuthorDate: 2025-06-06 09:49:56 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: implement packages Installs a list of packages Sponsored by: OVHCloud (cherry picked from commit 076fec1b88de8e14f370127cc4aeaa737eda92a8) --- libexec/nuageinit/nuage.lua | 22 +++++++++++++++++- libexec/nuageinit/nuageinit | 19 ++++++++++++++++ libexec/nuageinit/tests/nuageinit.sh | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index addab5419193..0fe7400c2bbc 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -362,6 +362,9 @@ local function chpasswd(obj) end local function pkg_bootstrap() + if os.getenv("NUAGE_RUN_TESTS") then + return true + end if os.execute("pkg -N 2>/dev/null") then return true end @@ -369,6 +372,22 @@ local function pkg_bootstrap() return os.execute("env ASSUME_ALWAYS_YES=YES pkg bootstrap") end +local function install_package(package) + if package == nil then + return true + end + local install_cmd = "pkg install -y " .. package + local test_cmd = "pkg info -q " .. package + if os.getenv("NUAGE_RUN_TESTS") then + print(install_cmd) + print(test_cmd) + return true + end + if os.execute(test_cmd) then + return true + end + return os.execute(install_cmd) +end local n = { warn = warnmsg, @@ -381,7 +400,8 @@ local n = { addsshkey = addsshkey, update_sshd_config = update_sshd_config, chpasswd = chpasswd, - pkg_bootstrap = pkg_bootstrap + pkg_bootstrap = pkg_bootstrap, + install_package = install_package } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index ef215af00924..ef5726960978 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -69,6 +69,22 @@ local function get_ifaces() return myifaces end +local function install_packages(packages) + if not nuage.pkg_bootstrap() then + nuage.warn("Failed to bootstrap pkg, skip installing packages") + return + end + for n, p in pairs(packages) do + if type(p) == "string" then + if not nuage.install_package(p) then + nuage.warn("Failed to install : " .. p) + end + else + nuage.warn("Invalid type : " .. type(p) .. " for packages entry number " .. n) + end + end +end + local function config2_network(p) local parser = ucl.parser() local f = io.open(p .. "/network_data.json") @@ -370,6 +386,9 @@ if line == "#cloud-config" then end end end + if obj.packages then + install_packages(obj.packages) + end else local res, err = os.execute(path .. "/" .. ud) if not res then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 06f4a12d7503..e8742be3ba51 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -24,6 +24,7 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_test_case config2_userdata_runcmd +atf_test_case config2_userdata_packages setup_test_adduser() { @@ -736,6 +737,48 @@ EOF atf_check -s exit:0 -o inline:"FreeBSD\n" cat "${PWD}"/media/nuageinit/runcmd_uname } +config2_userdata_packages_head() +{ + atf_set "require.user" root +} +config2_userdata_packages_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + export NUAGE_RUN_TESTS=1 + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: + - yeah/plop +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -o inline:"pkg install -y yeah/plop\npkg info -q yeah/plop\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: + - curl +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +packages: + - curl + - meh: bla +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 +} + atf_init_test_cases() { atf_add_test_case args @@ -756,4 +799,5 @@ atf_init_test_cases() atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_add_test_case config2_userdata_runcmd + atf_add_test_case config2_userdata_packages } From nobody Mon Jun 23 07:44:09 2025 X-Original-To: dev-commits-src-branches@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 4bQg7t11SQz5ywgv; Mon, 23 Jun 2025 07:44:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7s74PTz4C91; Mon, 23 Jun 2025 07:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664650; 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=LVHD2p2Z5bLUBMN47ZkNlPOfEGaDhjCb9OHc9BE4MiM=; b=uIIMq1S84dVxs6a8eu2BBnspKfn7th6Hx9aPglZWLgB6WpHyhdajiHQoF5fIL5kNZizUi7 4p9XR2rD4+7bALYImN5BArh05Lx1AMmNtK1TrGI+4R0jo4HLT/QwRUw2Vn3lHkAslh7HPR 8BPfpJuGYOHf6WRXk4z+XAR0pvjJQAjByRndjJAvRRXQM3nOgmTueqYbUcaxr2R0x3bxzC N9se9BQUne7v7R0wyf7gWflgVBBfoPXlCgr9RTuP9FC9PMkSbCh6iISm1BpPiNB2rISsbl ay5kAViTqLx/8nI3haDaxHfmutP9OpFwxAq94a5lrQPUsF8OxO4kPT1GQsOqDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664650; 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=LVHD2p2Z5bLUBMN47ZkNlPOfEGaDhjCb9OHc9BE4MiM=; b=V8TJSBzLyxjSeMIp6ryn7nyezYTDLc/EDq5PGkDYAX2NFuadHZtB8lb5seS3AmIwT7mZHM ZwlAtDKOiMHDpDJ7/yGw5N7z4Sf9mNSds5eNhD6A9w40CL3hODHgPE+m/7XOujVL1mDu/n OjhNwZFPvUwuOTK1k/nIwoPLC7mmIVDlq1gPmZNemV/0yL1s2POiUeN6YWWcalBKfCmq64 ZYAuZRoebPsKt+uFPS3EIk08QZR1F5jpohFGROHbwoauPsqAOC3D/BrvmMPhjZNUXDNyF8 VC8gxD0sA4bGelrF502DZCP5ZcKIfiRweKg/4xw9kaEtJNa1mMZ3BehK/aDmNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664650; a=rsa-sha256; cv=none; b=JBUUCaKw4XDUj+QdObQJdZtZPy6Wj/y7Wo/bE0xp0b/PG5hrTYmAbSH9zw+ZXWNmbqdi4e gmU58A7CQLGJYQu44QNbGVoSqYtQd7tE61AXk3JJOXZEu9Qf5+/b7jC4iCD99AL4ur33in Ow92zpLDEFbhMVqULys1qTuMfByhvLoK5rXJOQNvbMz7mTz6cWzDjy52ud2itaov+k97aY LUL/EkeoLssI5Hqu/qYB+DvODaY80wTPvOMmbRNNfuWmnExC4jtsJlQgVLEkNyYG5GNigG JeIuB5DqghJgpKGNdHvElgy/46ZYKgl18UPDKKcBplGGOCy431sfEP4SgpVCww== 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 4bQg7s6gYmztGr; Mon, 23 Jun 2025 07:44:09 +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 55N7i9GV067187; Mon, 23 Jun 2025 07:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7i9TZ067184; Mon, 23 Jun 2025 07:44:09 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:09 GMT Message-Id: <202506230744.55N7i9TZ067184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: f08ebb3a6656 - stable/14 - nuageinit: add a function to bootstrap pkg if needed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f08ebb3a66563a6e5397f2994fdcffae2aace58d Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f08ebb3a66563a6e5397f2994fdcffae2aace58d commit f08ebb3a66563a6e5397f2994fdcffae2aace58d Author: Sebastien Baylocq AuthorDate: 2025-06-06 10:20:46 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: add a function to bootstrap pkg if needed Sponsored by: OVHCloud (cherry picked from commit 43b82d69b252ddd50ac82e54481f2184b8212869) --- libexec/nuageinit/nuage.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 15af5afbd9f0..addab5419193 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -361,6 +361,15 @@ local function chpasswd(obj) end end +local function pkg_bootstrap() + if os.execute("pkg -N 2>/dev/null") then + return true + end + print("Bootstrapping pkg") + return os.execute("env ASSUME_ALWAYS_YES=YES pkg bootstrap") +end + + local n = { warn = warnmsg, err = errmsg, @@ -371,7 +380,8 @@ local n = { addgroup = addgroup, addsshkey = addsshkey, update_sshd_config = update_sshd_config, - chpasswd = chpasswd + chpasswd = chpasswd, + pkg_bootstrap = pkg_bootstrap } return n From nobody Mon Jun 23 07:44:07 2025 X-Original-To: dev-commits-src-branches@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 4bQg7r19DSz5ywk3; Mon, 23 Jun 2025 07:44: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7q5PJCz4CMT; Mon, 23 Jun 2025 07:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664647; 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=IfC3DYSXlwd2j8ZV5DCjX8hFv2c668mM9MiZ7KxTJ0Y=; b=QtJJjUFLIqllqxzmuJn+cgwlYbcjCAZEdGNLSSUelpcTTnIPTgh251wgeuHU9/q+QOnbH+ 51nls9CsR52Kp+E3Zx80VGqLFOOeeqj6mCGrITZ8nVh3wsrS7GTNiScxzZdNtUIHrvISIA nWwkqrjLUSzyxYUHCdabQnryJIhh0lBclwXFB2AR5wvuEEIWjyfh3Ixc+SKnl/WhlIpNRc jNuIxKIsDuUhHzfOegzQhmrMueYZY5+mLfxAg+1g6eixnTd5F2EDOoANVQ3wdlL2TU88R1 7gHH89TDL46VXV3Q7gmE4112T2rW4WW2hfElhtiqOHO5KdN0/vhHR2L/I5dw/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664647; 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=IfC3DYSXlwd2j8ZV5DCjX8hFv2c668mM9MiZ7KxTJ0Y=; b=CmpRRBXipvaZsUR8MzKwe6rv7rKxXrxAlwe9PHuZSCLqIRyA3X/BGW0SUDYirPY0eGe9/r bq6nVt89a+PjTF/ReL4Bhx4T+luUEgBy+q1a9bNZtklLQ7W/CNHIBnv0qjVLMHLwyO8cfS qoVbxVdPZe8/aOtsomD4oarEH5ISg9WLedtiKrZzlfw1/STPFJ6emtPv3ZDh5HpQTweo1D 7VCfk4YavH0lTjS2ygTFixc/vwPrE+ymaQza3eKFPs+KA9CJvli6Xf0d3vqNl5oZ2lShvG DPul9/6jkpxxy83cnfUCi7IRLtBXhehToz3qGWnzsJpbl5llTfslv+c+Z2brsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664647; a=rsa-sha256; cv=none; b=xWtJXzNiVDfB+sE2RCppgfEjcx2IxDtp69lhHAyN/W7OyNyaHHT2y2fIQ8wHPnlEexzwCv ktWG5x0d7elkm7X1AXJ62m62ainiX6PVp3TJZxy+VPTGIbUzK5p0hZobBuJNqAzbYUYOKm J9bONL+un3IoBX3CDJ1w8y2Xn8N/D7/eLfnHLzJjJw5ifEihR3AI2e8jBw0OAN3Cl2d0qc tyIXFqBcMymj69O5yh1UQXL+nxknIKx2/E0HguEUhBbIx2gAoRfQARpmNKX0kPhcVwjFvT e9qtQgq0sB6b1c76W0sEp7H4X3ZpG95fHFnWkZAbFEPPiWnr1QKeUTSrEyT4QQ== 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 4bQg7q4mfgztl9; Mon, 23 Jun 2025 07:44:07 +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 55N7i78n067118; Mon, 23 Jun 2025 07:44:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7i7jg067115; Mon, 23 Jun 2025 07:44:07 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:07 GMT Message-Id: <202506230744.55N7i7jg067115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: de9af2811564 - stable/14 - nuageinit: helper function to setup adduser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: de9af281156426f8608299f761c3fb525c7b990c Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=de9af281156426f8608299f761c3fb525c7b990c commit de9af281156426f8608299f761c3fb525c7b990c Author: Sebastien Baylocq AuthorDate: 2025-06-05 20:52:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: helper function to setup adduser To carry out the userdata unit tests, you need to set up the environment in order to skip adding the default user (nuage.adduser(default_user) Sponsored by: OVHCloud (cherry picked from commit e38f521f53d70423064a987be08c3bd5debe3a2e) --- libexec/nuageinit/tests/nuageinit.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 1b67468971a6..811eb9c0c73b 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -24,6 +24,22 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list +setup_test_adduser() +{ + here=$(pwd) + export NUAGE_FAKE_ROOTDIR=$(pwd) + mkdir -p etc/ssh + cat > etc/master.passwd << EOF +root:*:0:0::0:0:Charlie &:/root:/bin/csh +sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +EOF + pwd_mkdb -d etc ${here}/etc/master.passwd + cat > etc/group << EOF +wheel:*:0:root +users:*:1: +EOF +} + args_body() { atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit ( | )\n" /usr/libexec/nuageinit From nobody Mon Jun 23 07:44:08 2025 X-Original-To: dev-commits-src-branches@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 4bQg7s0SCyz5ywT6; Mon, 23 Jun 2025 07:44:09 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7r67sbz4Brh; Mon, 23 Jun 2025 07:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664648; 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=eI82HhXoDZVx2RkoABeuVjtfDWjMkaaTNScyxbxMehw=; b=b69RSuycZn+3FmKJCDyhOH2FbkVC3Ew+cy3OHbExVF4BDI9DlioWPBRlbiJFixCJGZFEN3 RGSAPDhcXfQz23Rq9oLeqq95xfBq9meWq+3YR4J3Qm+BqiIqB1jL/kcILcC2QuO5MK0Pp6 /Vaic+j7ACw0upHjgbJlx6xGBoCZRVUNXken6Nwd5OoKBfYzzCrLLIO8LwPgPC4TiQyFaT SC2PvXqo5ildp6ub0BeymjA0V6DvNqT/7l4sRazFdzEIOrhy9u3QQYVR9nT5uGN3rj494K 9NdJ6TJRsvvSzDrweqqa+EtzTnlh54Mvyx8NHgVxIRHEgk7JSHo5FlWAbZ+qUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664648; 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=eI82HhXoDZVx2RkoABeuVjtfDWjMkaaTNScyxbxMehw=; b=i+oo3KKZcr6aWfELFRcWEemZakiMoNq4eBnIBnsBGxe6rwkeLcFJF5QcWsRMjuWfFtVS1p 2ZOgbniXVVPuF+MGR3tVjBuvHDS7IK1EhQtisGKi82q4T0b8rvdzWzvGQGmoTxUHAgvsGo btPYPcFsrb0mGx/5q/Sx11JpIOrRvNMk9gjqbI5ZehWgy370qXL8ciOxgrqb2UR7e+glT7 6vVDgGxaoRuUC5BPjJwJMYRDtZnb9AFjfqcULSoavdSYfJZIEUhvBdqbVqAMhrvyc/N0fv HJRucpsnkJKmov/K+OTsuX2zS1n4Cvdxu4uNt+MZse2YgADs8NyM0KTbmNRDdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664648; a=rsa-sha256; cv=none; b=h94tH5FlzQe7z3l7+mdLAO4M6xQ2l0Gubq91ohB5A4O4SmhoLLZydl2onfBBcTK06ehyeo a2Fu4C+XDejGJYtsr2VqhXvsVZw0fIZK/sHp5tZdjbPjQERW/JbPR2PbpsLIHhcnTIbBUM 50MdoHmHP/UN/QQkyR3Bd9oz8Y+9ba2xl4+EXIOuXmSvY+xQtybT3ueMfrFcoc4OJFSpXU GFD0+LWFq6lCuOCYKUeAaaN8ZHZToaHXpfxTVLMG3JWJe4HSfnwIaZtCi9bWQ6uIS17fBN utdQztJS6T/zaqUnJoflo0m15V+XPYyMAZjAYJny2BTpGM+j1OJgWKBXYxYoEQ== 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 4bQg7r5k0WztYr; Mon, 23 Jun 2025 07:44:08 +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 55N7i8Ug067151; Mon, 23 Jun 2025 07:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7i8FL067148; Mon, 23 Jun 2025 07:44:08 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:08 GMT Message-Id: <202506230744.55N7i8FL067148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 5444803b745e - stable/14 - nuageinit: implement runcmd List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5444803b745efe61f5cbb5cb56e41369b16e7228 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5444803b745efe61f5cbb5cb56e41369b16e7228 commit 5444803b745efe61f5cbb5cb56e41369b16e7228 Author: Sebastien Baylocq AuthorDate: 2025-06-05 21:11:33 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: implement runcmd runcmd contains a list of string, each item will be executed in order. Sponsored by: OVHCloud (cherry picked from commit 2f35a5218323b3da7fb71933778c03bbb1c2bb7f) --- libexec/nuageinit/nuageinit | 9 ++++++++- libexec/nuageinit/tests/nuageinit.sh | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 74a75c88098a..ef215af00924 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -362,7 +362,14 @@ if line == "#cloud-config" then if obj.chpasswd ~= nil then nuage.chpasswd(obj.chpasswd) end - + if obj.runcmd then + for _, c in ipairs(obj.runcmd) do + if not os.execute(c) then + nuage.warn("Failed to execute '" .. c .. "'") + -- execute the next command anyway -- + end + end + end else local res, err = os.execute(path .. "/" .. ud) if not res then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 811eb9c0c73b..06f4a12d7503 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -23,6 +23,7 @@ atf_test_case nocloud_userdata_cloudconfig_ssh_pwauth atf_test_case nocloud_userdata_cloudconfig_chpasswd atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list +atf_test_case config2_userdata_runcmd setup_test_adduser() { @@ -700,6 +701,41 @@ EOF atf_check -o match:'root:\$.*:0:0::0:0:Charlie &:/root:/bin/sh$' pw -R $(pwd) usershow root } +config2_userdata_runcmd_head() +{ + atf_set "require.user" root +} +config2_userdata_runcmd_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +runcmd: +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +runcmd: + - plop +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -e inline:"sh: plop: not found\nnuageinit: Failed to execute 'plop'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +runcmd: + - echo "yeah!" > "${PWD}"/media/nuageinit/runcmd_echo + - uname -s > "${PWD}"/media/nuageinit/runcmd_uname +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -s exit:0 -o inline:"yeah!\n" cat "${PWD}"/media/nuageinit/runcmd_echo + atf_check -s exit:0 -o inline:"FreeBSD\n" cat "${PWD}"/media/nuageinit/runcmd_uname +} + atf_init_test_cases() { atf_add_test_case args @@ -719,4 +755,5 @@ atf_init_test_cases() atf_add_test_case nocloud_userdata_cloudconfig_chpasswd atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_list + atf_add_test_case config2_userdata_runcmd } From nobody Mon Jun 23 07:44:13 2025 X-Original-To: dev-commits-src-branches@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 4bQg7x3vBTz5ywk4; Mon, 23 Jun 2025 07:44:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7x2PKgz4C96; Mon, 23 Jun 2025 07:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664653; 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=x9mGwy8r4N9TBs/OQcGpvZGtv7V6EIq1dXjL9oHjd/Q=; b=CWiuFRi90i+2HdRghIbvFydyDZ9t8FYxMHxVgzt8EvdohmlJ7pwYDRWUVSQiVhFlfyOAtb H95JY33XZLcap56vrUcxgX3R2iQju+jLaW/hu3bwbZ4WR71v0+Ez7K9SNGCYIbNFTpUiY+ xtDz288chRbjcHvDWD4p0zCZkns/uih2TfBN8BB4vmFhuW6zrUYVhYfNotmORh5NO1dplp aryoFuP9oWMxR4kkatD58VAuCXFLdoQjd6nfXNO9AqEtuVhsR+7zKtRrapFNo3kUt+rRFB TdF+GqzAzGWBJueYd24663LZBJu9UoNozq49fXB10OgbmteXXgeV7MXh9Z8ltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664653; 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=x9mGwy8r4N9TBs/OQcGpvZGtv7V6EIq1dXjL9oHjd/Q=; b=YFSzfcV61jV4GGBCsWO6hTRbClNwZullBCQrYkRM6GzqbHuIYvYNiyh1Vsm2AeVh+shynC CVb9/FSKojbzhmTwelbLGv9RmYR8y6G9a4QEuY/jMh0NIIAaWfPFosB9owxC5SfXXO30Ik r02rvlwuV3CnONT9VMOxKjI92OIUiA7usJ++f3rzeJtnGfpARR8eFBmsctFYK2RGrgwYYx 7arzbBz49v56F4PuPL48w6odxKvHMunJAv4WYT64ySOUZq7aE2Hndvhyx6HMhrHWiXXEDD lkfoYsy6C9JdihB34b/N400AE+xkixhpYSaQqtxxxKgFeyjKrxNlZiBHLD2cEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664653; a=rsa-sha256; cv=none; b=sTr4cWasVX27w9mUEZWwlLSy9zNtEW26/hmBvRmFz9J3M+oMMOQv92U2rO93Or0wlrBFKy PQeI4kdpd7qb5Yb9oLAxyxDPiLoX+3eQOGjm/f+uTXWJyCtzDitKgtAM0zdx5sYU4QfjZK nl7R/pZtsYk5mFx4OM/oLYlrLhANbOOgLsD47vQpk05I2vo9SKEb4FKOPJQulaV/ZHlUv1 5hOoFqPyrVmfGF0VqBwjTEgN2WC9f2kfqPey+2yNbKuOp5My7YGavyS4ZnX/p3ZSY9qLAb RuKA7o8QXfKso5vVxVt55Ri2CeMPNlrdmUXft5RfhBfFRNBC8cjG8VEXaZt0dQ== 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 4bQg7x20KyztDH; Mon, 23 Jun 2025 07:44:13 +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 55N7iDiZ067286; Mon, 23 Jun 2025 07:44:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iDWf067283; Mon, 23 Jun 2025 07:44:13 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:13 GMT Message-Id: <202506230744.55N7iDWf067283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: b5bf10d30b40 - stable/14 - nuageinit: fix using user_data as a script List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b5bf10d30b40c44797bcbf9a213357f480e40f36 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b5bf10d30b40c44797bcbf9a213357f480e40f36 commit b5bf10d30b40c44797bcbf9a213357f480e40f36 Author: Baptiste Daroussin AuthorDate: 2025-06-10 07:09:47 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: fix using user_data as a script In official cloudinit, when a user_data file starts with '#!' it should be execute late in the boot process. To respect this nuageinit now copy the user_data script into a /var/cache/nuageinit/user_data if found and a new "firsboot" rcscript anchored to the 'local' rc script is responsible to execute it if found. Note by doing this, we fix another issue we had with nuageinit, if the cloudinit provider provides the user_data scriptout with the executable permission, previous implementation was not working, like apparently what Digital Ocean is doing. PR: 287183 Reported by: olgeni@ (cherry picked from commit 09545628f0cd58406a47f302fb8584a5292d4b1a) --- libexec/nuageinit/nuageinit | 15 ++++++++++----- libexec/nuageinit/tests/nuageinit.sh | 30 ++++++++++++++++++++++++++++-- libexec/rc/rc.d/Makefile | 3 ++- libexec/rc/rc.d/nuageinit_user_data_script | 25 +++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index dda3ae482859..f2f15f0d36f0 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -396,9 +396,14 @@ if line == "#cloud-config" then if obj.package_upgrade then nuage.upgrade_packages() end -else - local res, err = os.execute(path .. "/" .. ud) - if not res then - nuage.err("error executing user-data script: " .. err) - end +elseif line:sub(1, 2) == "#!" then + -- delay for execution at rc.local time -- + f = io.open(path .. "/" .. ud) + local content = f:read("*a") + f:close() + nuage.mkdir_p(root .. "/var/cache/nuageinit") + f = assert(io.open(root .. "/var/cache/nuageinit/user_data", "w")) + f:write(content) + f:close() + sys_stat.chmod(root .. "/var/cache/nuageinit/user_data", 493) end diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 5fc811f1dcb5..be8b186d933b 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -27,6 +27,7 @@ atf_test_case config2_userdata_runcmd atf_test_case config2_userdata_packages atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages +atf_test_case config2_userdata_shebang setup_test_adduser() { @@ -73,7 +74,8 @@ nocloud_userdata_script_body() printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user-data chmod 755 "${PWD}"/media/nuageinit/user-data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o inline:"#!/bin/sh\necho yeah\n" cat var/cache/nuageinit/user_data } nocloud_user_data_script_body() @@ -82,7 +84,8 @@ nocloud_user_data_script_body() printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user_data chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o inline:"#!/bin/sh\necho yeah\n" cat var/cache/nuageinit/user_data } nocloud_userdata_cloudconfig_users_head() @@ -810,6 +813,28 @@ EOF atf_check -o inline:"pkg upgrade -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 } +config2_userdata_shebang_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < media/nuageinit/user_data <&1 | tee -a /var/log/nuageinit.log +} + +# Share the same config as nuageinit +load_rc_config nuageinit +run_rc_command "$1" From nobody Mon Jun 23 07:44:12 2025 X-Original-To: dev-commits-src-branches@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 4bQg7w2wjsz5ywfW; Mon, 23 Jun 2025 07:44:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7w1kJqz4CMg; Mon, 23 Jun 2025 07:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664652; 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=PJ2NqyzdMVrang7usYvshYjVxGLsNQ7nfctipIa3XII=; b=Xml65usomE0wDIQdBUmb5Oy9OgubrM58RR6PGMqcUsXTTIVyVMB1WuuuqcNYsHShb6f7wS /AdAXkNGPlNWmhCxO2/jJpm78AQxbijM/RAHAne2i2SOS4341pAZUsQPlZfRyxX7PMIYYg DvuJfy4838z1ZFFBV5Rw0o4HpoI/kvPovRoOIooRjFAzX6DIvCXs8EBbdKn30K3yahMh28 28yR6mP0Gkkeh7Or2OS2y42sljCpadSJt7OTVJWptkn2bNrARQbbCRWNocJtpaObEPUN47 GVf88YRXklVveN2W2jzoHIknI94t0vFTIKiIsub74BndBTAEE6d/YiAPYpvsFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664652; 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=PJ2NqyzdMVrang7usYvshYjVxGLsNQ7nfctipIa3XII=; b=CdR+nG4/ZQIFy5VlA3WFbpCjz/7tVz3OX+we2ZM62uythhdmpCjfIXM6uiSdL+e1C2l6sY BsxwNLV6vohTtyNsualc13OXxd8BPxJWgWsNf/AP+Ipp6Xfvkpmf77VrP6fSI9NvTTC5zG 7d7YJqgGiQMu7B08tOh21k/GeM7HQhc07/yUIQoS7YMmXG/pmxqD2bb2TR6n57WLOVeLEv Gqu61gnWNBxqGhLzamWJXuve140o9gK03azQnq+hmfc8uO/C3GTHGhvD0KvCfI+bd7suPS eFAGqQ3A4WhpB4bqSA9C7DPZbIBGeSWAxQp8WNEKy1cSVugfnfXZFrCBLnqKOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664652; a=rsa-sha256; cv=none; b=lOZXqPpATnUh7UYAKHsQKfCakBfmquA87RaiSdKph0TqOs6P+AKlAMvUZi/aBApP8hbIiy HuQaFmCs3TQ9dVLAMF8Jz0QjvBHK+f4H73yvOIu7hT76Abz/ScU1xiC0l25M9w7AfPFkTZ FSpl5kBism8VBXC8uy6tH3OVp2h8wBMBuQDmqRZ808SPxIAezxNAmu/yVSNdyUQNxmMnng Py6lMamU5BV6oF4p+ePDKCLRawhSM4DYlAgyzKe5/UM9+bZiIweuk/A3fGXpO6T1evnQp7 VDlBDB1Jg5Z8rKCNRk/HBcmK5lK+X5wXiEyZjaCIoG8gO/nWy5kKi+6inbY3Tg== 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 4bQg7w13PzztWD; Mon, 23 Jun 2025 07:44:12 +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 55N7iCTK067254; Mon, 23 Jun 2025 07:44:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iCHb067251; Mon, 23 Jun 2025 07:44:12 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:12 GMT Message-Id: <202506230744.55N7iCHb067251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 09e960f1aa85 - stable/14 - nuageinit: more package related functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 09e960f1aa85cc0aa6c64f50c25f50862ba6ce7e Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=09e960f1aa85cc0aa6c64f50c25f50862ba6ce7e commit 09e960f1aa85cc0aa6c64f50c25f50862ba6ce7e Author: Sebastien Baylocq AuthorDate: 2025-06-06 16:24:48 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: more package related functions Implement package_update and package_upgrade, which allows to launch an update of the metadata and an upgrade of the packages. Sponsored by: OVHCloud (cherry picked from commit 682af9601aebb71357d05bb9ffbc137958a437cf) --- libexec/nuageinit/nuage.lua | 20 +++++++++++++++++++- libexec/nuageinit/nuageinit | 7 +++++++ libexec/nuageinit/tests/nuageinit.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 0fe7400c2bbc..76f2d24ac178 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -389,6 +389,22 @@ local function install_package(package) return os.execute(install_cmd) end +local function run_pkg_cmd(subcmd) + local cmd = "pkg " .. subcmd .. " -y" + if os.getenv("NUAGE_RUN_TESTS") then + print(cmd) + return true + end + return os.execute(cmd) +end +local function update_packages() + return run_pkg_cmd("update") +end + +local function upgrade_packages() + return run_pkg_cmd("upgrade") +end + local n = { warn = warnmsg, err = errmsg, @@ -401,7 +417,9 @@ local n = { update_sshd_config = update_sshd_config, chpasswd = chpasswd, pkg_bootstrap = pkg_bootstrap, - install_package = install_package + install_package = install_package, + update_packages = update_packages, + upgrade_packages = upgrade_packages } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index ef5726960978..dda3ae482859 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -389,6 +389,13 @@ if line == "#cloud-config" then if obj.packages then install_packages(obj.packages) end + + if obj.package_update then + nuage.update_packages() + end + if obj.package_upgrade then + nuage.upgrade_packages() + end else local res, err = os.execute(path .. "/" .. ud) if not res then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index e8742be3ba51..5fc811f1dcb5 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -25,6 +25,8 @@ atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_string atf_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_test_case config2_userdata_runcmd atf_test_case config2_userdata_packages +atf_test_case config2_userdata_update_packages +atf_test_case config2_userdata_upgrade_packages setup_test_adduser() { @@ -741,6 +743,7 @@ config2_userdata_packages_head() { atf_set "require.user" root } + config2_userdata_packages_body() { mkdir -p media/nuageinit @@ -779,6 +782,34 @@ EOF atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 } +config2_userdata_update_packages_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + export NUAGE_RUN_TESTS=1 + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +package_update: true +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg update -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 +} + +config2_userdata_upgrade_packages_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + export NUAGE_RUN_TESTS=1 + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data << 'EOF' +#cloud-config +package_upgrade: true +EOF + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -o inline:"pkg upgrade -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 +} + atf_init_test_cases() { atf_add_test_case args @@ -800,4 +831,6 @@ atf_init_test_cases() atf_add_test_case nocloud_userdata_cloudconfig_chpasswd_list_list atf_add_test_case config2_userdata_runcmd atf_add_test_case config2_userdata_packages + atf_add_test_case config2_userdata_update_packages + atf_add_test_case config2_userdata_upgrade_packages } From nobody Mon Jun 23 07:44:19 2025 X-Original-To: dev-commits-src-branches@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 4bQg841fgyz5ywk7; Mon, 23 Jun 2025 07:44:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg840pHlz4C9J; Mon, 23 Jun 2025 07:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664660; 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=isCPQOkRBSEfkfIjDaKWyauMYAB+CmS1xHpOA343kak=; b=LiEgSwLTWGzgBc6TsEpgFA20SyVAkziww0yZC0/jhDn8qcwL8pvJ5mWkDPXvEq0+aUesil 2MYsHJalX4zm4U3yipGBhaOIomAYrET2hrsiX2D4wBGyW/AoToK2bnay0uBUXBEKedLmA0 XNGRqDULN/uvT9WMayQSuwF+eWNy7i+H+yxBA9+vw3EN/EYN2eScrt7kV9r2m8sD61bb2C FY1nZw8p7KAzB9MBGkmub4mHOenUYGBEKz25VPmUCELkzlEQSTOBSBr968aAs+whE2po5r y3psg/v637X8bpxjaAooLQLyvaw2MdBNxucUyOlNK13LH2fnH7kfo8iK8N8cIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664660; 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=isCPQOkRBSEfkfIjDaKWyauMYAB+CmS1xHpOA343kak=; b=MjciQ0HeaQik/eGz+ZZY8eBxOWEULSVmaFu1NM34Mzz8YowbVc3j+Ss7PMuDu/XU7EpXrW Lobu04zag2BZDa1rWs80JC8sp2PBl1+BcifL9wpuATs0nA9ldn0nUQE9//0BQSPp0vpybE My3X0Ykib41ZlusqRPIjRpvVP2cXotcfY2A+pYmjAEUyMpE20g1lnGgnTQ46QuWs7fT1VQ glLQDzqlg7+gxmZo8pZ+lvtgrQiZJlywsOctrg3UcJ9H5YY6pcYca08z/0yOhQCbkNcDIb K3mItQ5VIr/Zuljues8dm7tUvpl2lIlCwJwpWQ9APiWs82UUEbqOqMPvOPjJkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664660; a=rsa-sha256; cv=none; b=gCjdE2EdJBOoZ/EfLge+UbLAECJISxtW8Pr+f6aHBmczrUxXvJCHz/+2f11akcDUprhONj AtIvW3vF0at5iz5FgplLmS7I+3ngxj4tm3p0XZGdUbISuG/6Ojld/2BGM2HoPzyY+KA8Ic NBgAImCESBgJBceVmDZwpJaXfXpCLZtZgCuixrMlv5zruP45z5qbXMwy13TTP/71fJVatL Z/s0M8vsQ8rPsgXdU/BQm36zSgcRTlEkfopcpJB4GfhkBA207oglBj8vocl6FRcvHs3uCD O+yjlUtvWgTxlj4SrOiSYPfdYyWUK05J+VsOoPX7ioZLYP3UXpgiJA5MwE1wqQ== 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 4bQg840KQdztjy; Mon, 23 Jun 2025 07:44:20 +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 55N7iJ3T067487; Mon, 23 Jun 2025 07:44:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iJ2g067484; Mon, 23 Jun 2025 07:44:19 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:19 GMT Message-Id: <202506230744.55N7iJ2g067484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: bb3bc92f4df6 - stable/14 - nuageinit: add a post network script List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb3bc92f4df63bf4b071816de04605d3033e390a Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=bb3bc92f4df63bf4b071816de04605d3033e390a commit bb3bc92f4df63bf4b071816de04605d3033e390a Author: Baptiste Daroussin AuthorDate: 2025-06-16 08:23:27 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:13 +0000 nuageinit: add a post network script refactor nuageinit to allow a 3rd execution point during boot: 1. nuageinit is invoked before NETWORKING with a minimalistic network setup for openstrack and potentially other network config setup. it tries to configure everything which is not requiring any network. 2. nuageinit is invoked again post NETWORKING but pre SERVERS, in the phase it does all that requires network, like dealing with packages. Note that creating users have been moved to this phase to allow the installation of shells like bash or zsh prior the creation of the users, before that the user creation was failing if a non installed shell was requested. 3. nuageinit will execute at the rc.local time all the specified scripts and commands. MFC After: 1 week (cherry picked from commit 2a05d577ab30dcefcf51def4c65a64af30610c85) --- libexec/nuageinit/nuageinit | 399 ++++++++++++++++++++--------------- libexec/nuageinit/tests/nuageinit.sh | 34 +-- libexec/rc/rc.d/Makefile | 1 + libexec/rc/rc.d/nuageinit_post_net | 25 +++ 4 files changed, 275 insertions(+), 184 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index d8aa734cb122..ecad3feb7ad4 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -69,6 +69,109 @@ local function get_ifaces() return myifaces end +local function sethostname(obj) + -- always prefer fqdn is specified over hostname + if obj.fqdn then + nuage.sethostname(obj.fqdn) + elseif obj.hostname then + nuage.sethostname(obj.hostname) + end +end + +local function groups(obj) + if obj.groups == nil then return end + + for n, g in pairs(obj.groups) do + if (type(g) == "string") then + local r = nuage.addgroup({name = g}) + if not r then + nuage.warn("failed to add group: " .. g) + end + elseif type(g) == "table" then + for k, v in pairs(g) do + nuage.addgroup({name = k, members = v}) + end + else + nuage.warn("invalid type: " .. type(g) .. " for users entry number " .. n) + end + end +end + +local function create_default_user(obj) + if not obj.users then + -- default user if none are defined + nuage.adduser(default_user) + end +end + +local function users(obj) + if obj.users == nil then return end + + for n, u in pairs(obj.users) do + if type(u) == "string" then + if u == "default" then + nuage.adduser(default_user) + else + nuage.adduser({name = u}) + end + elseif type(u) == "table" then + -- ignore users without a username + if u.name == nil then + goto unext + end + local homedir = nuage.adduser(u) + if u.ssh_authorized_keys then + for _, v in ipairs(u.ssh_authorized_keys) do + nuage.addsshkey(homedir, v) + end + end + if u.sudo then + nuage.addsudo(u) + end + else + nuage.warn("invalid type : " .. type(u) .. " for users entry number " .. n) + end + ::unext:: + end +end + +local function ssh_keys(obj) + if obj.ssh_keys == nil then return end + if type(obj.ssh_keys) ~= "table" then + nuage.warn("Invalid type for ssh_keys") + return + end + + for key, val in pairs(obj.ssh_keys) do + for keyname, keytype in key:gmatch("(%w+)_(%w+)") do + local sshkn = nil + if keytype == "public" then + sshkn = "ssh_host_" .. keyname .. "_key.pub" + elseif keytype == "private" then + sshkn = "ssh_host_" .. keyname .. "_key" + end + if sshkn then + local sshkey, path = open_ssh_key(sshkn) + if sshkey then + sshkey:write(val .. "\n") + sshkey:close() + end + if keytype == "private" then + sys_stat.chmod(path, 384) + end + end + end + end +end + +local function ssh_authorized_keys(obj) + if obj.ssh_authorized_keys == nil then return end + local homedir = nuage.adduser(default_user) + for _, k in ipairs(obj.ssh_authorized_keys) do + nuage.addsshkey(homedir, k) + end +end + local function install_packages(packages) if not nuage.pkg_bootstrap() then nuage.warn("Failed to bootstrap pkg, skip installing packages") @@ -80,11 +183,106 @@ local function install_packages(packages) nuage.warn("Failed to install : " .. p) end else - nuage.warn("Invalid type : " .. type(p) .. " for packages entry number " .. n) + nuage.warn("Invalid type: " .. type(p) .. " for packages entry number " .. n) end end end +-- Set network configuration from user_data +local function network_config(obj) + if obj.network == nil then return end + + local ifaces = get_ifaces() + local network = open_config("network") + local routing = open_config("routing") + local ipv6 = {} + for _, v in pairs(obj.network.ethernets) do + if not v.match then + goto next + end + if not v.match.macaddress then + goto next + end + if not ifaces[v.match.macaddress] then + nuage.warn("not interface matching: " .. v.match.macaddress) + goto next + end + local interface = ifaces[v.match.macaddress] + if v.dhcp4 then + network:write("ifconfig_" .. interface .. '="DHCP"\n') + elseif v.addresses then + for _, a in pairs(v.addresses) do + if a:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)") then + network:write("ifconfig_" .. interface .. '="inet ' .. a .. '"\n') + else + network:write("ifconfig_" .. interface .. '_ipv6="inet6 ' .. a .. '"\n') + ipv6[#ipv6 + 1] = interface + end + end + end + if v.gateway4 then + routing:write('defaultrouter="' .. v.gateway4 .. '"\n') + end + if v.gateway6 then + routing:write('ipv6_defaultrouter="' .. v.gateway6 .. '"\n') + routing:write("ipv6_route_" .. interface .. '="' .. v.gateway6) + routing:write(" -prefixlen 128 -interface " .. interface .. '"\n') + end + ::next:: + end + if #ipv6 > 0 then + network:write('ipv6_network_interfaces="') + network:write(table.concat(ipv6, " ") .. '"\n') + network:write('ipv6_default_interface="' .. ipv6[1] .. '"\n') + end + network:close() + routing:close() +end + +local function ssh_pwauth(obj) + if obj.ssh_pwauth == nil then return end + + local value = "no" + if obj.ssh_pwauth then + value = "yes" + end + nuage.update_sshd_config("PasswordAuthentication", value) +end + +local function runcmd(obj) + if obj.runcmd == nil then return end + local f = nil + for _, c in ipairs(obj.runcmd) do + if f == nil then + nuage.mkdir_p(root .. "/var/cache/nuageinit") + f = assert(io.open(root .. "/var/cache/nuageinit/runcmds", "w")) + f:write("#!/bin/sh\n") + end + f:write(c .. "\n") + end + if f ~= nil then + f:close() + sys_stat.chmod(root .. "/var/cache/nuageinit/runcmds", 493) + end +end + +local function packages(obj) + if obj.package_update then + nuage.update_packages() + end + if obj.package_upgrade then + nuage.upgrade_packages() + end + if obj.packages then + install_packages(obj.packages) + end +end + +local function chpasswd(obj) + if obj.chpasswd == nil then return end + nuage.chpasswd(obj.chpasswd) +end + local function config2_network(p) local parser = ucl.parser() local f = io.open(p .. "/network_data.json") @@ -222,7 +420,7 @@ elseif citype == "nocloud" then if hostname then nuage.sethostname(hostname) end -else +elseif citype ~= "postnet" then nuage.err("Unknown cloud init type: " .. citype) end @@ -241,185 +439,48 @@ if not f then os.exit(0) end local line = f:read("*l") +if citype ~= "postnet" then + local content = f:read("*a") + nuage.mkdir_p(root .. "/var/cache/nuageinit") + local tof = assert(io.open(root .. "/var/cache/nuageinit/user_data", "w")) + tof:write(line .. "\n" .. content) + tof:close() +end f:close() if line == "#cloud-config" then + local pre_network_calls = { + sethostname, + groups, + create_default_user, + ssh_keys, + ssh_authorized_keys, + network_config, + ssh_pwauth, + runcmd + } + + local post_network_calls = { + packages, + users, + chpasswd + } + f = io.open(ni_path .. "/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then nuage.err("error parsing cloud-config file: " .. ud) end - -- always prefer fqdn is specified over hostname - if obj.fqdn then - nuage.sethostname(obj.fqdn) - elseif obj.hostname then - nuage.sethostname(obj.hostname) - end - if obj.groups then - for n, g in pairs(obj.groups) do - if (type(g) == "string") then - local r = nuage.addgroup({name = g}) - if not r then - nuage.warn("failed to add group: " .. g) - end - elseif type(g) == "table" then - for k, v in pairs(g) do - nuage.addgroup({name = k, members = v}) - end - else - nuage.warn("invalid type: " .. type(g) .. " for users entry number " .. n) - end - end - end - if obj.users then - for n, u in pairs(obj.users) do - if type(u) == "string" then - if u == "default" then - nuage.adduser(default_user) - else - nuage.adduser({name = u}) - end - elseif type(u) == "table" then - -- ignore users without a username - if u.name == nil then - goto unext - end - local homedir = nuage.adduser(u) - if u.ssh_authorized_keys then - for _, v in ipairs(u.ssh_authorized_keys) do - nuage.addsshkey(homedir, v) - end - end - if u.sudo then - nuage.addsudo(u) - end - else - nuage.warn("invalid type : " .. type(u) .. " for users entry number " .. n) - end - ::unext:: - end - else - -- default user if none are defined - nuage.adduser(default_user) - end - if obj.ssh_keys and type(obj.ssh_keys) == "table" then - for key, val in pairs(obj.ssh_keys) do - for keyname, keytype in key:gmatch("(%w+)_(%w+)") do - local sshkn = nil - if keytype == "public" then - sshkn = "ssh_host_" .. keyname .. "_key.pub" - elseif keytype == "private" then - sshkn = "ssh_host_" .. keyname .. "_key" - end - if sshkn then - local sshkey, path = open_ssh_key(sshkn) - if sshkey then - sshkey:write(val .. "\n") - sshkey:close() - end - if keytype == "private" then - sys_stat.chmod(path, 384) - end - end - end - end - end - if obj.ssh_authorized_keys then - local homedir = nuage.adduser(default_user) - for _, k in ipairs(obj.ssh_authorized_keys) do - nuage.addsshkey(homedir, k) - end - end - if obj.network then - local ifaces = get_ifaces() - local network = open_config("network") - local routing = open_config("routing") - local ipv6 = {} - for _, v in pairs(obj.network.ethernets) do - if not v.match then - goto next - end - if not v.match.macaddress then - goto next - end - if not ifaces[v.match.macaddress] then - nuage.warn("not interface matching: " .. v.match.macaddress) - goto next - end - local interface = ifaces[v.match.macaddress] - if v.dhcp4 then - network:write("ifconfig_" .. interface .. '="DHCP"\n') - elseif v.addresses then - for _, a in pairs(v.addresses) do - if a:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)") then - network:write("ifconfig_" .. interface .. '="inet ' .. a .. '"\n') - else - network:write("ifconfig_" .. interface .. '_ipv6="inet6 ' .. a .. '"\n') - ipv6[#ipv6 + 1] = interface - end - end - end - if v.gateway4 then - routing:write('defaultrouter="' .. v.gateway4 .. '"\n') - end - if v.gateway6 then - routing:write('ipv6_defaultrouter="' .. v.gateway6 .. '"\n') - routing:write("ipv6_route_" .. interface .. '="' .. v.gateway6) - routing:write(" -prefixlen 128 -interface " .. interface .. '"\n') - end - ::next:: - end - if #ipv6 > 0 then - network:write('ipv6_network_interfaces="') - network:write(table.concat(ipv6, " ") .. '"\n') - network:write('ipv6_default_interface="' .. ipv6[1] .. '"\n') - end - network:close() - routing:close() - end - if obj.ssh_pwauth ~= nil then - local value = "no" - if obj.ssh_pwauth then - value = "yes" - end - nuage.update_sshd_config("PasswordAuthentication", value) - end - if obj.chpasswd ~= nil then - nuage.chpasswd(obj.chpasswd) - end - if obj.runcmd then - f = nil - for _, c in ipairs(obj.runcmd) do - if f == nil then - nuage.mkdir_p(root .. "/var/cache/nuageinit") - f = assert(io.open(root .. "/var/cache/nuageinit/runcmds", "w")) - f:write("#!/bin/sh\n") - end - f:write(c .. "\n") - end - if f ~= nil then - f:close() - sys_stat.chmod(root .. "/var/cache/nuageinit/runcmds", 493) - end - end - if obj.packages then - install_packages(obj.packages) - end - if obj.package_update then - nuage.update_packages() + local calls_table = pre_network_calls + if citype == "postnet" then + calls_table = post_network_calls end - if obj.package_upgrade then - nuage.upgrade_packages() + + for i = 1, #calls_table do + calls_table[i](obj) end elseif line:sub(1, 2) == "#!" then -- delay for execution at rc.local time -- - f = io.open(ni_path .. "/" .. ud) - local content = f:read("*a") - f:close() - nuage.mkdir_p(root .. "/var/cache/nuageinit") - f = assert(io.open(root .. "/var/cache/nuageinit/user_data", "w")) - f:write(content) - f:close() sys_stat.chmod(root .. "/var/cache/nuageinit/user_data", 493) end diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index fe799a2227f3..0e6335a382d2 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -122,6 +122,7 @@ users: passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ EOF atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet cat > expectedgroup << EOF wheel:*:0:root,freebsd users:*:1:foobar @@ -568,7 +569,8 @@ chpasswd: - { user: "sys", password: RANDOM } EOF - atf_check -o empty -e inline:"nuageinit: Invalid entry for chpasswd.users: missing 'name'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e inline:"nuageinit: Invalid entry for chpasswd.users: missing 'name'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet # nothing modified atf_check -o inline:"sys:*:1:0::0:0:Sys:/home/sys:/bin/sh\n" pw -R $(pwd) usershow sys @@ -579,7 +581,7 @@ chpasswd: users: - { name: "sys", pwd: RANDOM } EOF - atf_check -o empty -e inline:"nuageinit: Invalid entry for chpasswd.users: missing 'password'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e inline:"nuageinit: Invalid entry for chpasswd.users: missing 'password'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet # nothing modified atf_check -o inline:"sys:*:1:0::0:0:Sys:/home/sys:/bin/sh\n" pw -R $(pwd) usershow sys @@ -591,7 +593,7 @@ chpasswd: - { name: "sys", password: RANDOM } EOF # not empty because the password is printed to stdout - atf_check -o empty -e empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o match:'sys:\$.*:1:0::0:0:Sys:/home/sys:/bin/sh$' pw -R $(pwd) usershow sys cat > media/nuageinit/user-data << 'EOF' @@ -602,7 +604,7 @@ chpasswd: - { name: "sys", password: RANDOM } EOF # not empty because the password is printed to stdout - atf_check -o empty -e empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o match:'sys:\$.*:1:0::1:0:Sys:/home/sys:/bin/sh$' pw -R $(pwd) usershow sys cat > media/nuageinit/user-data << 'EOF' @@ -613,7 +615,7 @@ chpasswd: - { name: "user", password: "$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/" } EOF # not empty because the password is printed to stdout - atf_check -o empty -e empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o inline:'user:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1:0::1:0:Sys:/home/sys:/bin/sh\n' pw -R $(pwd) usershow user } @@ -645,7 +647,8 @@ chpasswd: sys:RANDOM EOF - atf_check -o empty -e inline:"nuageinit: chpasswd.list is deprecated consider using chpasswd.users\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e inline:"nuageinit: chpasswd.list is deprecated consider using chpasswd.users\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o match:'sys:\$.*:1:0::1:0:Sys:/home/sys:/bin/sh$' pw -R $(pwd) usershow sys cat > media/nuageinit/user-data << 'EOF' @@ -658,7 +661,7 @@ chpasswd: root:R EOF - atf_check -o empty -e ignore /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e ignore /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o match:'sys:\$.*:1:0::0:0:Sys:/home/sys:/bin/sh$' pw -R $(pwd) usershow sys atf_check -o inline:'user:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1:0::0:0:Sys:/home/sys:/bin/sh\n' pw -R $(pwd) usershow user atf_check -o match:'root:\$.*:0:0::0:0:Charlie &:/root:/bin/sh$' pw -R $(pwd) usershow root @@ -691,7 +694,8 @@ chpasswd: - sys:RANDOM EOF - atf_check -o empty -e inline:"nuageinit: chpasswd.list is deprecated consider using chpasswd.users\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e inline:"nuageinit: chpasswd.list is deprecated consider using chpasswd.users\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o match:'sys:\$.*:1:0::1:0:Sys:/home/sys:/bin/sh$' pw -R $(pwd) usershow sys cat > media/nuageinit/user-data << 'EOF' @@ -704,7 +708,7 @@ chpasswd: - root:R EOF - atf_check -o empty -e ignore /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o empty -e ignore /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet atf_check -o match:'sys:\$.*:1:0::0:0:Sys:/home/sys:/bin/sh$' pw -R $(pwd) usershow sys atf_check -o inline:'user:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1:0::0:0:Sys:/home/sys:/bin/sh\n' pw -R $(pwd) usershow user atf_check -o match:'root:\$.*:0:0::0:0:Charlie &:/root:/bin/sh$' pw -R $(pwd) usershow root @@ -763,14 +767,14 @@ config2_userdata_packages_body() packages: EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -s exit:1 -e match:"attempt to index a nil value" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet cat > media/nuageinit/user_data << 'EOF' #cloud-config packages: - yeah/plop EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:0 -o inline:"pkg install -y yeah/plop\npkg info -q yeah/plop\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -s exit:0 -o inline:"pkg install -y yeah/plop\npkg info -q yeah/plop\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet cat > media/nuageinit/user_data << 'EOF' #cloud-config @@ -778,7 +782,7 @@ packages: - curl EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet cat > media/nuageinit/user_data << 'EOF' #cloud-config @@ -787,7 +791,7 @@ packages: - meh: bla EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet } config2_userdata_update_packages_body() @@ -801,7 +805,7 @@ config2_userdata_update_packages_body() package_update: true EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -o inline:"pkg update -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -o inline:"pkg update -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet } config2_userdata_upgrade_packages_body() @@ -815,7 +819,7 @@ config2_userdata_upgrade_packages_body() package_upgrade: true EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -o inline:"pkg upgrade -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -o inline:"pkg upgrade -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet } config2_userdata_shebang_body() diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 23a3426e5d0a..ef2e7b43f9ed 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -317,6 +317,7 @@ SMRCDPACKAGE= sendmail .if ${MK_NUAGEINIT} != "no" CONFGROUPS+= NIUAGEINIT NIUAGEINIT= nuageinit \ + nuageinit_post_net \ nuageinit_user_data_script NIUAGEINITPACKAGE= nuageinit .endif diff --git a/libexec/rc/rc.d/nuageinit_post_net b/libexec/rc/rc.d/nuageinit_post_net new file mode 100755 index 000000000000..bea4c5e37c5f --- /dev/null +++ b/libexec/rc/rc.d/nuageinit_post_net @@ -0,0 +1,25 @@ +#!/bin/sh +# + +# PROVIDE: nuageinit_post_net +# REQUIRE: NETWORKING devfs +# BEFORE: SERVERS +# KEYWORD: firstboot + +. /etc/rc.subr + +name="nuageinit_post_net" +desc="Post Network Cloud Init configuration" +start_cmd="execute_post_net" +stop_cmd=":" +rcvar="nuageinit_enable" + +execute_post_net() +{ + test -f /var/cache/nuageinit/post_network_config || return + /usr/libexec/nuageinit /var/cache/nuageinit/post_network_config | tee -a /var/log/nuageinit.log +} + +# Share the same config as nuageinit +load_rc_config nuageinit +run_rc_command "$1" From nobody Mon Jun 23 07:44:15 2025 X-Original-To: dev-commits-src-branches@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 4bQg7z6PD9z5ywKP; Mon, 23 Jun 2025 07:44:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7z4qMQz4CMy; Mon, 23 Jun 2025 07:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664655; 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=CqMyDFAK+EZFONgkDTqSvKp92BOBwjNaBBfeMbWChUI=; b=siLgbE7lhxxto+calBC71ORGNYEAZ3bZySgkRIHTXaw3ZYVDENWmOcSpK/EMUrLYQIC+R5 JrZ7W3pj64Nt4mOO+Rs3JWlyT8K7uOl57ea5M+1lr0ZnBKarpuJBcWPDo9UB+EnnNI2x7r vI993p67gz1mS6f++yjqXCXmHOHQjwZbZQKWBTahXacCQeF/WAtdmAGOMUOeQ98BSahjUW O4E3fjKCQN48vA3pbPz1covM+zf29egtM3FVFB9pNWZqWk1VfwTEMxMgzDTjxDlYcPcD+L lqzgkrBRwxEnFeTweedad0WfJu05S9iiyZRaP0r2xEQVOgYMyiiHh1wN9FiRDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664655; 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=CqMyDFAK+EZFONgkDTqSvKp92BOBwjNaBBfeMbWChUI=; b=XwFyIImZEjvePjwU/XTxOe7p9SRu3WI8wkkzvaDkkHcRe4TKtLk5ninReQPm1InawWrgMV szqxUNcCzwN4O8dr3CubWSAF0Z3BRyytUbfF3jQAf2CG2Qfbe1W22S7m7ZrikD4/TLAoV2 JM8Ihr5xsBX1tuCO8VoZM8PT2LShxbsuZl2ytvNyaUfqspl+IXNLpdVxmWe4jOVF9fCSr1 NdI8SS+skpWyRleiOdWzs5XO0ZzCiW54bmIJhKJHscwJoUysNQMnt1qrgEoduamQXCrkth ylfXNI/wDAwsxLx53Fz4FVc/CxgDnO1pqAMl4JtSagRzkwypE7PePxFb+GLbKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664655; a=rsa-sha256; cv=none; b=CC8nnQh6cazlWUMEDOL380lVrugq3Hs1URzMp1XFekEL+ha5s/Akoi/SSMe2gpOOqFHlsl mrVRgEstI94KI33FZx8J4wctZ243zBZkrO8GT6uGZxhanwScK+qsbz4EBM+TNA8yW+/xqn 4C8eLpMzTaigMt3dgfHVoUCGZPOVpyw3YBLgkBa5S9YRYttjDW9RfiydVt9F/V+hZJPX2U i4gjskATw5X14Bpw8AxZi5z04FPdmy8rbSmHa/0Qwpn2123wBebGEWazZU7744jLWfn1dZ mus4yoOEP2x4qBimtfZFwZO1AfhsE4p1FimHKnqdgi5N7qtwXtRDksWqSEd6jg== 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 4bQg7z3x64ztYs; Mon, 23 Jun 2025 07:44:15 +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 55N7iF3O067351; Mon, 23 Jun 2025 07:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iFFW067347; Mon, 23 Jun 2025 07:44:15 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:15 GMT Message-Id: <202506230744.55N7iFFW067347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 279f98470572 - stable/14 - nuageinit: pet luacheck List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 279f98470572f39c6ead7ecce973c4eefbceeecf Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=279f98470572f39c6ead7ecce973c4eefbceeecf commit 279f98470572f39c6ead7ecce973c4eefbceeecf Author: Baptiste Daroussin AuthorDate: 2025-06-10 09:32:06 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: pet luacheck Rename path into ni_path (ni stands for nuageinit) which is more understandable and avoid a shadowing warning because we also use a variable named path later. Add a missing local (cherry picked from commit f678c47590276aa8acdacdecfb78cc6c44bbf449) --- libexec/nuageinit/nuageinit | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index cd5912c54975..c874f40b38a8 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -12,7 +12,7 @@ local sys_stat = require("posix.sys.stat") if #arg ~= 2 then nuage.err("Usage: " .. arg[0] .. " ( | )", false) end -local path = arg[1] +local ni_path = arg[1] local citype = arg[2] local default_user = { @@ -189,7 +189,7 @@ end if citype == "config-2" then local parser = ucl.parser() - local res, err = parser:parse_file(path .. "/meta_data.json") + local res, err = parser:parse_file(ni_path .. "/meta_data.json") if not res then nuage.err("error parsing config-2 meta_data.json: " .. err) @@ -204,9 +204,9 @@ if citype == "config-2" then nuage.sethostname(obj["hostname"]) -- network - config2_network(path) + config2_network(ni_path) elseif citype == "nocloud" then - local f, err = io.open(path .. "/meta-data") + local f, err = io.open(ni_path .. "/meta-data") if err then nuage.err("error parsing nocloud meta-data: " .. err) end @@ -229,9 +229,9 @@ end -- deal with user-data local ud = nil local f = nil -userdatas = {"user-data", "user_data"} +local userdatas = {"user-data", "user_data"} for _, v in pairs(userdatas) do - f = io.open(path .. "/" .. v, "r") + f = io.open(ni_path .. "/" .. v, "r") if f then ud = v break @@ -243,7 +243,7 @@ end local line = f:read("*l") f:close() if line == "#cloud-config" then - f = io.open(path .. "/" .. ud) + f = io.open(ni_path .. "/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then @@ -405,7 +405,7 @@ if line == "#cloud-config" then end elseif line:sub(1, 2) == "#!" then -- delay for execution at rc.local time -- - f = io.open(path .. "/" .. ud) + f = io.open(ni_path .. "/" .. ud) local content = f:read("*a") f:close() nuage.mkdir_p(root .. "/var/cache/nuageinit") From nobody Mon Jun 23 07:44:18 2025 X-Original-To: dev-commits-src-branches@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 4bQg830sHxz5ywh0; Mon, 23 Jun 2025 07:44:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg8300vhz4Bt3; Mon, 23 Jun 2025 07:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664659; 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=CFSbF44mk6/OVH0ziYydfJ5xxvDcTefa3FWuloVVd0s=; b=kjKRZdAkPr6RvV4UPeuub/UNcQ0sOgONFJ/i0S/PuGd8SmqFXi2MbENIHlpYl37LJ1Rp6y SiN3KwNy6xcgmoM6Y+cY+GKONJk9IC8UJ+eOhpM5GQS18wGjU0szHYr8ff7DaI+TV971GL MmpH3DVf0ZF4n9SlfCJ47YAmDht876G1N2sxrK6AOlyXfBWd1do+OnkHuMezzT2BPlrdSu gvqqizrrJ/H9JLAG2VvfP3zuuNCZUBz+KjmWYhszDeNGOqLFcBrpDUW3OKAr3OSQ+YPux3 5i2haUkQ1lv6YhBqo4ZcDE3JL04YjpYN/h/HWzI04c4XvyXWaScqGypnWLz7pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664659; 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=CFSbF44mk6/OVH0ziYydfJ5xxvDcTefa3FWuloVVd0s=; b=DVwGINWK4LP4HemruHfQdgwD/If0vzMWXsKEzyTfpKJJMYUlPYYR2MdKZx3Wbc0gXkeGtV wRGggCO+phAN4GAWotvB6FrWGrt9RCskL5CsLKHZeMXef8FII5+KdXzR0VSgoy1teBPvAv QBD6idAHn0AKdhmjDV9wfB9KkoPCnOjMSUpfoJ8FASsW7mPg/+UmbXH9mX4EfH3sSIdW7t mXbfPFI9ws+KBKr7SO3nRoJ6ohYg6f+CfBs1fR1gJDGO1HT/GtrpvevrEIu98hBJ8Ju488 jHHTH9dAB/HU0j6wpDfsyWw6sABJ+1vKXR7UPmLxna4gdNY1VWrgJseM94RLoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664659; a=rsa-sha256; cv=none; b=t48hZECia4okrfcD3PMUo1qX5OCq81NAtGvnD5X5KCh4peGLceTZNSfLZutFmq95d/dGIB DWLg5uZwGCeSK3qtKMzRLiKrE6YJTWMCIVVfmhtAhOkntEHGhStZD/nayIXFFX7P9EfuCZ 5fWkk0CMnlA5Jveqh90zDNY5hBN9UgKrDZcxR0H4N4I7e3V33LFVZhDJ4Mx0cdSQVnSL8s Hx4tPurx3JMJtyyK32e2ZpEohJe60grgEZp46GHeblFL7LS0MzVbq6xuA2TmylENZ8ucTH lZXNPTeL/40hWo9TApVhoCrDv17m7NamDRKYaPol/VaROYNe9uSN3BBr1v6c3g== 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 4bQg826kMvztYt; Mon, 23 Jun 2025 07:44:18 +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 55N7iIHF067454; Mon, 23 Jun 2025 07:44:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iIES067451; Mon, 23 Jun 2025 07:44:18 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:18 GMT Message-Id: <202506230744.55N7iIES067451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 5540b9eb9e2a - stable/14 - nuageinit: add support for sudo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5540b9eb9e2a560ba89e0a94ad665eaa8bf245cc Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5540b9eb9e2a560ba89e0a94ad665eaa8bf245cc commit 5540b9eb9e2a560ba89e0a94ad665eaa8bf245cc Author: Baptiste Daroussin AuthorDate: 2025-06-15 15:18:32 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:13 +0000 nuageinit: add support for sudo (cherry picked from commit 6a54f886bede6e6193ebc82ec5fca85679b7dc41) --- libexec/nuageinit/nuage.lua | 39 +++++++++++++++++++++++++++++++++++- libexec/nuageinit/nuageinit | 3 +++ libexec/nuageinit/tests/nuageinit.sh | 2 ++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 76f2d24ac178..deb441ee25ba 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -228,6 +228,42 @@ local function addsshkey(homedir, key) end end +local function addsudo(pwd) + local chmodsudoersd = false + local chmodsudoers = false + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + local sudoers_dir = "/usr/local/etc/sudoers.d" + if root then + sudoers_dir= root .. sudoers_dir + end + local sudoers = sudoers_dir .. "/90-nuageinit-users" + local sudoers_attr = lfs.attributes(sudoers) + if sudoers_attr == nil then + chmodsudoers = true + local dirattrs = lfs.attributes(sudoers_dir) + if dirattrs == nil then + local r, err = mkdir_p(sudoers_dir) + if not r then + return nil, err .. " (creating " .. sudoers_dir .. ")" + end + chmodsudoersd = true + end + end + local f = io.open(sudoers, "a") + if not f then + warnmsg("impossible to open " .. sudoers) + return + end + f:write(pwd.name .. " " .. pwd.sudo .. "\n") + f:close() + if chmodsudoers then + sys_stat.chmod(sudoers, 416) + end + if chmodsudoersd then + sys_stat.chmod(sudoers, 480) + end +end + local function update_sshd_config(key, value) local sshd_config = "/etc/ssh/sshd_config" local root = os.getenv("NUAGE_FAKE_ROOTDIR") @@ -419,7 +455,8 @@ local n = { pkg_bootstrap = pkg_bootstrap, install_package = install_package, update_packages = update_packages, - upgrade_packages = upgrade_packages + upgrade_packages = upgrade_packages, + addsudo = addsudo } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index c1026aa2afee..d8aa734cb122 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -290,6 +290,9 @@ if line == "#cloud-config" then nuage.addsshkey(homedir, v) end end + if u.sudo then + nuage.addsudo(u) + end else nuage.warn("invalid type : " .. type(u) .. " for users entry number " .. n) end diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index edcc80346b5d..fe799a2227f3 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -117,6 +117,7 @@ users: - name: foobar gecos: Foo B. Bar primary_group: foobar + sudo: ALL=(ALL) NOPASSWD:ALL groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ EOF @@ -138,6 +139,7 @@ EOF sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd atf_check -o file:expectedgroup cat "${PWD}"/etc/group + atf_check -o inline:"foobar ALL=(ALL) NOPASSWD:ALL\n" cat ${PWD}/usr/local/etc/sudoers.d/90-nuageinit-users } nocloud_network_head() From nobody Mon Jun 23 07:44:17 2025 X-Original-To: dev-commits-src-branches@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 4bQg816rZrz5ywk6; Mon, 23 Jun 2025 07:44:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg815nS7z4CN6; Mon, 23 Jun 2025 07:44:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664657; 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=jdNFJSV7w1zpOMUmlR3xUKmOwAZ+32BF+ZMprH5KRUM=; b=eJIIuyEWVLgyiz6zddSvNrmBk+bmZjdkyPk1O3kiDH0Pu1XWq0NnRyRSRN+ltxEP3bOcsT 1T3DeuGG7r+oI0hGO84njfHj04w9LxJ/0mCF7qJq4pcFwXjMrNKRh5hu3a9MQyrqZl03MS 2QOMT/BtsBkih1nO5dKPxpV2XAX9fWeK4Hu/i3XCRmTbwtYvbnzYNZfNAtZcjflML5T8aL 43vPIVh/kz8ayRksc6PmbLGL6sQA3xpd7B5+ALCGzVFdPW9jJwY0sBEyt3oA++Wr598tfW YNT2VGZSSy5pvo4Psw3PaznrimD5ZqkvWU34Zy+0xpsLW/76C1w9nDUgpaWH9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664657; 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=jdNFJSV7w1zpOMUmlR3xUKmOwAZ+32BF+ZMprH5KRUM=; b=hOKKgR2ju8dF4QNCbnlkJg3qX7i0IJmcABXC6wNpH5vm+4Yh3hpcWh3ZKktsznSUdtBgrf SgePQcizR7jaVSRqicwg6E92k6dtI6Ogx29PYZOA2AA+X7qOvni6mjzUNPQXfBiYKYZiGy wwG3DzrdCYgwyT3NGiGjm2we3VmHJj8FDn3hkvkCufK0Or3QSBbZyUVjQtLWVL4035oipU sne7jIERlbHDP30v8MYEtz329iTHIqNS2BOzzHTqgGUqbuMPap5VQpPhFKsAMYu0HbiO61 GyEmCp85ynGQCgCcNRzseZmIVWy1cnS0vrIMTQAEryZFSDbFDiU7jDtcrWv1DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664657; a=rsa-sha256; cv=none; b=ShlqlyW38ek6fe8fTqDZIGYNLjSulWkchswfcReyncsEeYFIAuWLHhiE8iPsokBmYvVv3C SAlHDGfCnIome+Fdg27CA+RW/10YosgB7YuHTmuU+qQxMXzCBjpzjFpxFVsH1RGQl2+jLl osPwlVse6CZf3MkR2GXYqGBFMhiRiuxQf5jucUiBwq48OyHTTEdRiTaj7w9yH4wnb5nVw9 emf1GQFV6ZYlsiqjReTuq4zAURTjHAviEgL9SfpaNQbqznCE1kF0QHYZYmsO+kzrxQ8ZQR Lmhg3i2iEPJsenNzH2cKeWg0z64go48cRVOYJfvEfw1nZxvMSBcON5rJv2x9jw== 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 4bQg815NmwztGs; Mon, 23 Jun 2025 07:44:17 +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 55N7iHXM067422; Mon, 23 Jun 2025 07:44:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iHj3067419; Mon, 23 Jun 2025 07:44:17 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:17 GMT Message-Id: <202506230744.55N7iHj3067419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 3406fba999d1 - stable/14 - nuageinit: support "fqdn" and "hostname" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3406fba999d1e86d8b3f1580fcb4748d733ffb7a Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3406fba999d1e86d8b3f1580fcb4748d733ffb7a commit 3406fba999d1e86d8b3f1580fcb4748d733ffb7a Author: Baptiste Daroussin AuthorDate: 2025-06-14 18:49:44 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:13 +0000 nuageinit: support "fqdn" and "hostname" (cherry picked from commit f1dd507b2c44f16c94395e67f82125c491ebddf2) --- libexec/nuageinit/nuageinit | 6 ++++++ libexec/nuageinit/tests/nuageinit.sh | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index c874f40b38a8..c1026aa2afee 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -249,6 +249,12 @@ if line == "#cloud-config" then if not obj then nuage.err("error parsing cloud-config file: " .. ud) end + -- always prefer fqdn is specified over hostname + if obj.fqdn then + nuage.sethostname(obj.fqdn) + elseif obj.hostname then + nuage.sethostname(obj.hostname) + end if obj.groups then for n, g in pairs(obj.groups) do if (type(g) == "string") then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 3d0033a648de..edcc80346b5d 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -28,6 +28,7 @@ atf_test_case config2_userdata_packages atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages atf_test_case config2_userdata_shebang +atf_test_case config2_userdata_fqdn_and_hostname setup_test_adduser() { @@ -837,6 +838,26 @@ EOF fi } +config2_userdata_fqdn_and_hostname_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < media/nuageinit/user_data < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 7ee737e8de26 - stable/14 - nuageinit: fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7ee737e8de267ed85a3abef37ac90c5bee8bfbde Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7ee737e8de267ed85a3abef37ac90c5bee8bfbde commit 7ee737e8de267ed85a3abef37ac90c5bee8bfbde Author: Baptiste Daroussin AuthorDate: 2025-06-13 15:33:14 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: fix typo PR: 287503 Reported by: crest@rlwinm.de (cherry picked from commit cae3d6c8d40a417f32be165aa9a9b4be86bb7f49) --- libexec/rc/rc.d/nuageinit_user_data_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/nuageinit_user_data_script b/libexec/rc/rc.d/nuageinit_user_data_script index 97ccc45f8658..cea7fb5c6aa0 100755 --- a/libexec/rc/rc.d/nuageinit_user_data_script +++ b/libexec/rc/rc.d/nuageinit_user_data_script @@ -16,7 +16,7 @@ rcvar="nuageinit_enable" execute_user_data_script() { if [ -x /var/cache/nuageinit/runcmds ]; then - echo "Executing 'runcmd'" | tee -e /var/log/nuageinit.log + echo "Executing 'runcmd'" | tee -a /var/log/nuageinit.log /var/cache/nuageinit/runcmds 2>&1 | tee -a /var/log/nuageinit.log fi test -x /var/cache/nuageinit/user_data || return From nobody Mon Jun 23 07:44:14 2025 X-Original-To: dev-commits-src-branches@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 4bQg7y4LZKz5ywk5; Mon, 23 Jun 2025 07:44:14 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg7y3d37z4CMq; Mon, 23 Jun 2025 07:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664654; 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=k7Q9+3Uzhd+WensnP3TBGd5wYEXYsN3Krl/1Uo4Jjq0=; b=iBTqoSfuw1ZJIqd3cU42Fdk3M/BBk7Vh4pgiSd/5N/NUUFvhmuomkv0Z1z7cyDok7RHcvO aBEDF39kCE5XeqtKNN02VfVK9mv+fNfbem4pbbAyrUX+F/8OA/MPYxUd/ZAHOo5jJL4Vzb sId569Kale2G5JofVv88ykn47nv2FdkxT6vEcpEgBPRq39UkMaDO+eHrRyhlD1OgulCVTc BWB4kHFPAC8Fgt7/x3pqkWLqdirXP88HhWYVj8ztUJofGMJTE+get2WxKHNxtFgwBUJ4e4 AkbFTOjFfnzO+EEA5t56slc+I2yaFszuCxRI9jxOzw+DTV6ughmLVWsuY9m6xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664654; 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=k7Q9+3Uzhd+WensnP3TBGd5wYEXYsN3Krl/1Uo4Jjq0=; b=t/5/diIO+/+xysF9td7IEj5rgf8fD6z0NoQjnkaAdpoyMaEvzRKv/slJp+S339KurUNg3n bcTaHUPHa5+5b/qj7uRXl+kJ5RsIyGZxVX6TyhbW8cdXCDkNQxx5wT9zyAlRvD3T4/CfFa JfnMAzKp+FqMKmAXavzDsXkUtRd1KayNtbU/M9NJgLsfrRuZIv0UO2gNlXF56Tq+6ETbDa FUeBhBj7176NmiZW5FDGtJwuyq41qIdK06bKJwREcX88fZEWokg/iJ+mhh8viV5TcFsmQF LNibft95X4Bcns8aR4oWViW1efFf/8crTxX65gUyS+MnA0dnWX2Z7FDyp4loOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664654; a=rsa-sha256; cv=none; b=MuFY9BusKAI/2gHYIE26EllTdxh3LqIyUVxQse+Y4xXrcNX5843PWdgo/TRnJNl1W8yES6 +3KIPx3Mg8OK4EgONIIlManzgaSWhGIz3Hr4gotCOoqXLNPvbiVDf3AI2CU04gnsXXFvUf c9Xnm4fdFJgIVMX0OvcDdK+kGTeijxN4Dx0X/sVEpO+EXwuHHPBbxKoLpBPqIlA0goUUwF +QT3w3MYX93Q7krzvlpZBO48ZCl23QXT42O7E310fcFusNjhYtUlUbbwSVqUo8xoMg3+kQ 0jvaNylAY0GAUH3AGjF5RW/DPqXD/Qs7vHNSPR4QO150J3C/pwUXsj33pSHFfQ== 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 4bQg7y2yvmzt38; Mon, 23 Jun 2025 07:44:14 +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 55N7iEBU067318; Mon, 23 Jun 2025 07:44:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7iE58067315; Mon, 23 Jun 2025 07:44:14 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:14 GMT Message-Id: <202506230744.55N7iE58067315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: f27b5d04f4df - stable/14 - nuageinit: runcmd should also be executed late List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f27b5d04f4df8556908e9af8db28460ac4536a9f Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f27b5d04f4df8556908e9af8db28460ac4536a9f commit f27b5d04f4df8556908e9af8db28460ac4536a9f Author: Baptiste Daroussin AuthorDate: 2025-06-10 09:28:49 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:43:12 +0000 nuageinit: runcmd should also be executed late Execute the runcmd specified in cloudinit at the same moment as the user_data script aka late in the boot process, to respect cloudinit specifications (cherry picked from commit 8feca60d6ee983ef3c81903675b4d9c3218c7e7a) --- libexec/nuageinit/nuageinit | 13 ++++++++++--- libexec/nuageinit/tests/nuageinit.sh | 12 +++++++----- libexec/rc/rc.d/nuageinit_user_data_script | 4 ++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index f2f15f0d36f0..cd5912c54975 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -379,11 +379,18 @@ if line == "#cloud-config" then nuage.chpasswd(obj.chpasswd) end if obj.runcmd then + f = nil for _, c in ipairs(obj.runcmd) do - if not os.execute(c) then - nuage.warn("Failed to execute '" .. c .. "'") - -- execute the next command anyway -- + if f == nil then + nuage.mkdir_p(root .. "/var/cache/nuageinit") + f = assert(io.open(root .. "/var/cache/nuageinit/runcmds", "w")) + f:write("#!/bin/sh\n") end + f:write(c .. "\n") + end + if f ~= nil then + f:close() + sys_stat.chmod(root .. "/var/cache/nuageinit/runcmds", 493) end end if obj.packages then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index be8b186d933b..3d0033a648de 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -728,18 +728,20 @@ runcmd: - plop EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:0 -e inline:"sh: plop: not found\nnuageinit: Failed to execute 'plop'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + test -f var/cache/nuageinit/runcmds || atf_fail "File not created" + test -x var/cache/nuageinit/runcmds || atf_fail "Missing execution permission" + atf_check -o inline:"#!/bin/sh\nplop\n" cat var/cache/nuageinit/runcmds cat > media/nuageinit/user_data << 'EOF' #cloud-config runcmd: - - echo "yeah!" > "${PWD}"/media/nuageinit/runcmd_echo - - uname -s > "${PWD}"/media/nuageinit/runcmd_uname + - echo "yeah!" + - uname -s EOF chmod 755 "${PWD}"/media/nuageinit/user_data atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 - atf_check -s exit:0 -o inline:"yeah!\n" cat "${PWD}"/media/nuageinit/runcmd_echo - atf_check -s exit:0 -o inline:"FreeBSD\n" cat "${PWD}"/media/nuageinit/runcmd_uname + atf_check -o inline:"#!/bin/sh\necho \"yeah!\"\nuname -s\n" cat var/cache/nuageinit/runcmds } config2_userdata_packages_head() diff --git a/libexec/rc/rc.d/nuageinit_user_data_script b/libexec/rc/rc.d/nuageinit_user_data_script index 94d5d008a7fc..97ccc45f8658 100755 --- a/libexec/rc/rc.d/nuageinit_user_data_script +++ b/libexec/rc/rc.d/nuageinit_user_data_script @@ -15,6 +15,10 @@ rcvar="nuageinit_enable" execute_user_data_script() { + if [ -x /var/cache/nuageinit/runcmds ]; then + echo "Executing 'runcmd'" | tee -e /var/log/nuageinit.log + /var/cache/nuageinit/runcmds 2>&1 | tee -a /var/log/nuageinit.log + fi test -x /var/cache/nuageinit/user_data || return echo "Executing user_data script" | tee -a /var/log/nuageinnit.log /var/cache/nuageinit/user_data 2>&1 | tee -a /var/log/nuageinit.log From nobody Mon Jun 23 07:44:48 2025 X-Original-To: dev-commits-src-branches@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 4bQg8d1XjKz5ywMf; Mon, 23 Jun 2025 07:44:49 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg8c4gN5z4CWt; Mon, 23 Jun 2025 07:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664688; 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=cCWnImAVU+fL2QPyoY6YpzTidQEWBDdlp1TXdAfhzVY=; b=tPC3ALu547KDibhH9WQU2SLy4XvEhZv3g23YMQkjQdsn9y9+Mkvrz5pLiZNy1U0OQWMKpA q0PiGrz1Kyx46RWyuf1F/6hQ+w0V/tqEQ+sx8o3ydEEm0GhW9Q5rEtNLIAs0oez/vlRSed 0ebacreyqUJaOKdtKe5yuBIZWdKFYk1Qb4HhM9sUc5LOw1o7N/q3bMnkdUE+LSW8TppTmj dyDyb8f4rzKocNspfeD+z2LezKUAypqFKDH/5UHL79n/CMD+NkCbC7Dq51a98VhwGm6z7Q MJNPNhUnGaCCal/AP7Jht2btzNiL05nHn4Uugi7AGZtfD+CECEv8o9XEZqL37Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664688; 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=cCWnImAVU+fL2QPyoY6YpzTidQEWBDdlp1TXdAfhzVY=; b=TSsoX2NnrKfweIfhZ6EpaDoRrgD5sQ0QFyBu09xMJg4RhagLVpOMtbSVnQ7TfXvJQryV1B T6vsBhK3tKVrDCbSx7Yy9Y28oFdtsvuvN3c1J3dprwi2yMebJYe5ektpyVZ2A93mQMm5lG RAPVay4rIgcMERfWqJekpCiO3wuwkNvRJFBtup9A/3bNEl1SgaJtytLJnwcF3zI0iBI7o7 oK6DB+yGPBeUFk/T7/2ns4nFYwUJ+mzRk1m86r4Ip/tZ7YVC05+a+v6lqYB77RDc13XfQ6 hIcyttBrAelPCxEW3PV0Ab6YoDF/3msABlFD4glDClPyIw28GXRJD6/ckhg7uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664688; a=rsa-sha256; cv=none; b=UThCptNWj2lK8ho0ixI5qaC40w8OwhLNuwDDmAkHBOjF2ksqAesTv+KUp1NKRzvDP6Umcd voOKtubXQeJti7npZfKubBVzyS6rs8wof//e5thNdBzl05SjGuGdpmmYUwWY5bBNFd0sYU 1PtGIdyfCLgzggnsD7oh10Hm0g7AeftzwM0JjSDyJG6kAjX/XEQdZgNyZApkFcwmS/0sBv 4vfdDaE9VNbbKIylzEvVxu7Gs0ZXYkq+ysSyZdOwswZR2zPudDpgaP9n+3UB3iiYF24ml0 KMA4Pbjbodvf/EFbLESNFgKz/esR9Jl/M2d9viRXwBREG0b8ZRHM/0f8d3qvbQ== 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 4bQg8c2lC9ztDK; Mon, 23 Jun 2025 07:44:48 +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 55N7im6l067825; Mon, 23 Jun 2025 07:44:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7im6I067822; Mon, 23 Jun 2025 07:44:48 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:48 GMT Message-Id: <202506230744.55N7im6I067822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 56d0667e3f42 - stable/14 - nuageinit: fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 56d0667e3f42f85029827c91e69f08c5e96c77c5 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=56d0667e3f42f85029827c91e69f08c5e96c77c5 commit 56d0667e3f42f85029827c91e69f08c5e96c77c5 Author: Baptiste Daroussin AuthorDate: 2025-06-16 13:52:37 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:44:43 +0000 nuageinit: fix typo (cherry picked from commit dba559e8066457fbb5105dcc09616ba6eb766345) --- libexec/nuageinit/nuageinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index ecad3feb7ad4..1550440940df 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -70,7 +70,7 @@ local function get_ifaces() end local function sethostname(obj) - -- always prefer fqdn is specified over hostname + -- always prefer fqdn if specified over hostname if obj.fqdn then nuage.sethostname(obj.fqdn) elseif obj.hostname then From nobody Mon Jun 23 07:44:49 2025 X-Original-To: dev-commits-src-branches@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 4bQg8f0sSxz5ywsv; Mon, 23 Jun 2025 07:44:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQg8d4DMrz4D4s; Mon, 23 Jun 2025 07:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664689; 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=jU313JpTnmFamiGO7mBHVhVbcP+KynvnVo1/cj/0x38=; b=rCl6OHSmSjXPTYP0I/606eiYHpiPQK+KtV2w6pXWIWLyu5P3KLfOYCzNSztbtM8JIal6UI yG45Qlu6rZNPOx2XVur63p1hx7SnBJVUIwQqurIJLXDFumdeCKiKtm9bqvi6LMhOFXval1 4Kng/teDrkV+u6k92Qi7S/T5DwwD4xcufPMUpRqaWDRok3PybzprTcr3Y/tdjEBbggZZ7h dl7g3249DWYbrLU33eUu9yrixKOc7vcfCtATS5tOiIVX6SvIHBEc6AEp9ftFHWzXSbM9Nv 2V+sFTaiREFj7zjBpEHm7y1bCX9OlEbL0Lm9voHc/vT5pMJr4hT1Bqk9v1GD0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664689; 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=jU313JpTnmFamiGO7mBHVhVbcP+KynvnVo1/cj/0x38=; b=spjQLzFZMBAeLK9iEIe1RjT8u6UE4rZ/vhY7w7yNsJdQCUUg9Y5iPIXkGc0u3GBLCEaZXX F0qZ5fcllmpc6mQl2Ha0uPT1V8GSrjXR9peoNuvkCO4vv6HVKUdssFZsEK55mVX8r97v/Z jZr3WJnC+YqStcHGtpDrz0HFl68Q/YmE507rpSrSKILUuJeRV8ZO7n/W/hXhBAum0mek+W oU1xlcyZcH4enZy2wGEMjLJpogTERotyVwmsHXve0HR35nc41yNdnY1UzpRCvUDLG0kzid T/aVilAQ0AS5FRqC/oaq+lQYjh1oaL+oN55bv9WuaFsHPabTdPbwSpDsPjePNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664689; a=rsa-sha256; cv=none; b=RfX3Jyg4bc3WM1FMKcmBkZUyfk4v9EXZzgtsSUqC/wjCf9K/MsASDLHVDUTrQP5SWfP+Is Wtr6FBM88FOHTCQ18bBPyQW7l2yDamhXDYTqx0mqlmO9u61oOJRZJHONgMWJjONq/9aO+s hkW1ieYUirqH3of3j2fgrrDw6B6CXACtkT+exTskyecO5Hiai3VKxo6wLpCEfM2a8QE7uF 9L8apChJD/dNzUT6IcepJefIzz8hrLc4G4Oj3jHQETCOqBVx/KzrwWD9J9af8wsF4s0JQ8 v6eciGcOKxRN5P6QJSKplzbK9SUbx0OyPmsc5DFxef8uhzYvTAsGf+tmcOSIyQ== 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 4bQg8d3jvRztDL; Mon, 23 Jun 2025 07:44:49 +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 55N7inXD067858; Mon, 23 Jun 2025 07:44:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7inkl067855; Mon, 23 Jun 2025 07:44:49 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:44:49 GMT Message-Id: <202506230744.55N7inkl067855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 808038a38f05 - stable/14 - nuageinit: write a documentation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 808038a38f05c8d5f52b3d58d7acede7b26f1e78 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=808038a38f05c8d5f52b3d58d7acede7b26f1e78 commit 808038a38f05c8d5f52b3d58d7acede7b26f1e78 Author: Baptiste Daroussin AuthorDate: 2025-06-16 15:44:57 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:44:44 +0000 nuageinit: write a documentation Reviewed by: imp, ziaee (both a previous version) Differential Revision: https://reviews.freebsd.org/D50878 (cherry picked from commit 5ec727ea1a1e65f3a784d70f7392d0a75d38d0a6) --- libexec/nuageinit/Makefile | 1 + libexec/nuageinit/nuageinit.7 | 288 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 289 insertions(+) diff --git a/libexec/nuageinit/Makefile b/libexec/nuageinit/Makefile index 64c5ec316f3d..a4d8e0de5777 100644 --- a/libexec/nuageinit/Makefile +++ b/libexec/nuageinit/Makefile @@ -2,6 +2,7 @@ PACKAGE= nuageinit SCRIPTS= nuageinit FILES= nuage.lua yaml.lua FILESDIR= ${SHAREDIR}/flua +MAN= nuageinit.7 .include diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 new file mode 100644 index 000000000000..7e44ce208a9b --- /dev/null +++ b/libexec/nuageinit/nuageinit.7 @@ -0,0 +1,288 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Baptiste Daroussin +.\" +.Dd June 16, 2025 +.Dt NUAGEINIT 7 +.Os +.Sh NAME +.Nm nuageinit +.Nd initialize a cloud-init environment +.Sh DESCRIPTION +The +.Nm +program is used to initialize instances in a cloud environment. +.Nm +runs at the first boot after the system installation. +It is composed of 3 +.Xr rc 8 +scripts: +.Bl -tag -width "nuageinit" +.It Cm nuageinit +This script will detect the configuration disk kind of cloud environement the +system runs on and gather accordingly the configuration data. +The following cloud environements are supported right now: +.Bl -tag -width "OpenStack" +.It ondisk +A cloud agnostic environment where the disk is provided to the system +with the configuration data on it. +The disk should be formatted in one of the following formats: +.Xr cd9660 4 , +or +.Xr msdosfs 4 +and be labelled (via filesystem label) either +.Ar config-2 +or +.Ar cidata . +.It OpenStack +The system is running in an +.Lk https://www.openstack.org/ OpenStack environment . +It is detected via the +.Ar smbios.system.product +.Xr smbios 4 +description available in +.Xr kenv 2 . +.El +.Pp +Depending on the cloud environement above +.Nm +will attempt to configure the instance. +See +.Sx CONFIGURATION . +This script executes early, +after all the local filesystem are mounted but before +the network is configured. +.It Cm nuageinit_post_net +This script is reponsible processing the configurations that are network +dependant: +.Bl -bullet +.It +dealing with packages +.It +dealing with users (which can depend on shell provided by packages) +.El +.It Cm nuageinit_user_data_script +This script is responsible for executing everything which would have +been passed via the configuration to be executed, via the configuration +or because the user_data provided is a script. +.El +.Pp +The default user for nuageinit is a user named: +.Va freebsd +with a password set to +.Va freebsd +and a shell set to +.Va /bin/sh . +.Sh CONFIGURATION +The configuration of +.Nm +is typically done via metadata provided by the cloud provider. +The metadata is presented to nuageinit in different form depending on +the provider: +provider: +.Bl -tag -width "config-2" +.It nocloud +If the data is provided via a disk labelled +.Va cidata , +then the metadata is provided in the form of a file named +.Pa meta-data +in YAML format. +.Nm +Will configure the hostname of the instance according the value of the +following variables +.Va local-hostname +or +.Va hostname . +.It config-2 +If the data is provided via a disk labelled +.Va config-2 , +or if fetched from OpenStack, +the metadata is expected in two json files: +.Pp +The +.Pa meta_data.json +file supportes the following keys: +.Bl -tag -width "public_keys" +.It Ic hostname +Set the hostname of the instance. +.It Ic public_keys +Append each entry of the array to +.Nm +default user which will be created. +.El +.Pp +The +.Pa network_data.json +file supports the following keys: +.Bl -tag -width "public_keys" +.It Ic links +Array of network interfaces to be configured. +.It Ic networks +Array of network configurations to be set. +.El +.El +.Pp +Along with the metadata, a user data file is provided, either named +.Pa user_data +or +.Pa user-data +If this file starts with a +.Qq #! , +it will be executed at the end of the boot via +.Cm nuageinit_user_data_script . +If this files starts with +.Qq #!cloud-config , +it will be parsed as a YAML configuration file. +All other cases will be ignored. +.Pp +The +.Qq #!cloud-config +configuration entries supported by +.Nm : +.Bl -tag -width "config-2" +.It Ic fqdn +Specify a fully qualified domain name for the instance. +.It Ic hostname +Specify the hostname of the instance if +.Qq Ic fqdn +is not set. +.It Ic groups +An array of strings or objects to be created: +.Bl -bullet +.It +If the entry is a string, +a group using this string as a name will be created. +.It +if the entry is a an object, the +.Qq Ar key +will be used as the name of the group, the +.Qq Ar value +will is expected to be a list of members (array), specified by name. +.El +.It Ic ssh_keys +An object of multiple key/values, +.Qq Cm keys +being in the form: +.Ar algo_private +or +.Ar algo_public , +.Qq Cm values +being the actual content of the files in +.Pa /etc/ssh . +.It Ic ssh_authorized_keys +Append each entry of the array to +.Nm +default user which will be created. +.It Ic ssh_pwauth +boolean which determines the value of the +.Qq Ic PasswordAuthentication +configuration in +.Pa /etc/ssh/sshd_config +.It Ic network +.It Ic runcmd +An array of commands to be run at the end of the boot process +.It Ic packages +List of packages to be installed. +.It Ic package_update +Update the remote package metadata. +.It Ic package_upgrade +Upgrade the packages installed to their latest version. +.It Ic users +Specify a list of users to be created: +.Bl -tag -width "plain_text_passwd" +.It Ic name +Name of the user. +.It Ic gecos +GECOS for the user. +.It Ic homedir +The path of the home directory for the user. +.It Ic primary_group +The main group the user should belong to. +.It Ic groups +The list of other groups the user should belong to. +.It Ic no_create_home +A boolean which determines if the home directory should be created or not. +.It Ic shell +The shell that should be used for the user. +.It Ic passwd +The encrypted password for the user. +.It Ic plain_text_passwd +The password in plain text for the user. +Ignored if an encrypted password is already provided. +.It Ic groups +The list of other groups the user should belong to. +.It Ic locked +Boolean to determine if the user accound should be locked. +.It Ic sudo +An entry which should be appended to +.Pa /usr/local/etc/sudoers.d/90-nuageinit-users +.El +.Pp +A special case exist: if the entry is a simple string with the following value +.Qq default +The the default user is created. +.It Ic chpasswd +Change the passwords for users, it accepts the following keys: +.Bl -tag -width "expire" +.It Ic expire +Boolean to force the user to changes their password during the first login +.It Ic users +An array of objects: +.Bl -tag -width "password" +.It Ic user +Specify the user who's password will be changed. +.It Ic password +Specify a text line with the new password, or +Specify the user who's password will be changed. +.Qq Cm RANDOM +to assign the password randomly. +If the textline starts with +.Qq Cm $x$ +Where x is a number, then the password is considered encrypted, +otherwise the password is considered plaintext. +.El +.El +.El +.Sh EXAMPLES +Here is an example of a YAML configuration for +.Nm : +.Bd -literal +#cloud-config +fqdn: myhost.mynetwork.tld +users: + - default + - name: user + gecos: Foo B. Bar + sudo: ALL=(ALL) NOPASSWD:ALL + ssh-authorized-keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAr... +packages: + - neovim + - git-lite +package_update: true +package_upgrade: true +runcmd: + - logger -t nuageinit "boot finished" +ssh_keys: + ed25519_private: | + -----BEGIN OPENSSH PRIVATE KEY----- + blabla + ... + -----END OPENSSH PRIVATE KEY----- + ed25519_public: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+MH4E8KO32N5CXRvXVqvyZVl0+6ue4DobdhU0FqFd+ +.Ed +.Sh SEE ALSO +.Xr kenv 2 , +.Xr cd9660 4 , +.Xr msdosfs 4 , +.Xr smbios 4 , +.Xr rc 8 +.Sh STANDARDS +.Nm +is believed to conform to the +.Lk https://cloud-init.io/ Cloud Init +specification. +.Sh HISTORY +.Nm +appeared in +.Fx 14.1 From nobody Mon Jun 23 07:46:06 2025 X-Original-To: dev-commits-src-branches@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 4bQgB63NQ1z5ywjf; Mon, 23 Jun 2025 07:46:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQgB61Xbgz4GQD; Mon, 23 Jun 2025 07:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664766; 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=gPxmXXFZ6w3khQVDfIeidpO+oF6kn8E0Z7aOiH+plT4=; b=HTHrvI4cEPJZBMywsP0lgW/mq47cl3K+T3IkVVCc5/3gNXROrBwCo/Q6VTNGPo9GUCyAc9 klZd3A0DFEYnvT1RFLcC6tkqy3/PiILQHH4I61DZjNuSokhP6wOJSc4YzCKOMcouOmtPNy TQ0il6vkn5PbC/PMqe7fcj4zYxC/YPhAdosyrG1tz0xFGsl91bLNJ/C4MznyWW3QcjLhSv q/HgBLLoxCCTqd4aDd5aCqtRSdt5iZDIfnMvgDGjmsq+/091iPQ7SsS0BAsYTuXnOjxHEu 5SCJT0+QCk3jEti/MByxpsmP6fYjKIsWsgbod0eKVFZrbgXyRzw8txwoHNoRJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664766; 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=gPxmXXFZ6w3khQVDfIeidpO+oF6kn8E0Z7aOiH+plT4=; b=kgFw3to6JCoF2BBWPlEhpfj2uM7rdPzD2cj+ouyIiz5ywdREmI5wa8sesVgCdiTY06YE5+ 3/chK7ib97/uJPC/3fdRpUxg8NmUkklUvDXj7roOtlOeDsTxJnMWKyc1Kh8sBezfgzp0l/ GnQZ8sGz8CHYV9F8JOAfCk33nksx1nPYudgHUWxQtMbIUrt6/eGiZOfCtVVuRO0PfMoPn7 2AKFT70QvAuOXwZnbC/srRO8BS/2ZxLd4Chubgyh8z9ehdf5M79hRyOQbLm3ptmzMcDhz4 J0ghT5FKRNUB19oXyMsq8KLxeupk17vHRTOEV6HLuwzMYSYCjowcotJdppaPEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664766; a=rsa-sha256; cv=none; b=Okt7hCgak7XVeNth6Z9JenkM/1drs4SPykXoe3AhxoA3DhrhCc3EepG9ennOuiRyp3sgEi BrV+HNEJ5fY/+7wxt3vjvSN9XO4QoXB+3FFs9SAtACV9IDiRpIgL40fullwOyhxjbCrAar Dg2TheLwjLMjwMQcK5kV5jFeiQERN/fLPE5Nm9vHhOlJc9gFd216mlW5NhuqQ8VhiAwPeB B+TUQ943QCD+UwSNOjmFhvQU2Epd5Uase50MfwXcV7sHhYbRZ8vhh4xvBZnO4eFKDVHVnk O9NjSWC6lrTaglx9PxXHdk23j299/7Rx3sQF7BvfKbeAaLBYhSQFXJfiPM3eaA== 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 4bQgB60nPwztxJ; Mon, 23 Jun 2025 07:46:06 +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 55N7k6i2068390; Mon, 23 Jun 2025 07:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7k6kQ068387; Mon, 23 Jun 2025 07:46:06 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:46:06 GMT Message-Id: <202506230746.55N7k6kQ068387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 1970a6c27364 - stable/14 - nuageinit(7) tests: Fix extra space in test output expectation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1970a6c273649e9e6c6a307c0c0b541d322badc2 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=1970a6c273649e9e6c6a307c0c0b541d322badc2 commit 1970a6c273649e9e6c6a307c0c0b541d322badc2 Author: Siva Mahadevan AuthorDate: 2025-06-20 16:36:30 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:45:44 +0000 nuageinit(7) tests: Fix extra space in test output expectation This fixes the test case libexec.nuageinit.nuageinit.config2_userdata_packages Signed-off-by: Siva Mahadevan Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1734 (cherry picked from commit 7067bab893e60c60d56f52322a686bc7e7cd4955) --- libexec/nuageinit/tests/nuageinit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 0e6335a382d2..f344e7f6c710 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -791,7 +791,7 @@ packages: - meh: bla EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type : table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet + atf_check -o inline:"pkg install -y curl\npkg info -q curl\n" -e inline:"nuageinit: Invalid type: table for packages entry number 2\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet } config2_userdata_update_packages_body() From nobody Mon Jun 23 07:47:18 2025 X-Original-To: dev-commits-src-branches@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 4bQgCW03nBz5ywyl; Mon, 23 Jun 2025 07:47:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQgCV5fp2z4JCR; Mon, 23 Jun 2025 07:47:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664838; 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=8EXBphEqvSMeKIegyJyS7Szu3vb9MtlJUlsrV8mrr2g=; b=NYg6ZZ1z6376wzk0ucyrmay3Lq+2Grt2smw9Rj2mKqyaAu7u3AUy+UTHWqX3rDVLj4VMA1 lE4E0zDyxZtlC6tZKp+NyjR0nAJHu8cPRfV5+HJgR/8yatqx3AXmaTOpC2uNokIBEGamjR YdBTAD4Jlaz4CI5QwQeWcREnHPc+0My6lqlF3Dm4SAgpobZbicn/ZMCMcYxX/0qbKwyct9 Fpo5167fnW8AjNcYo+yU6PK8cXqkMBRlUtBMtEqcrOX/3kevkFMt0fY5pvi2rOfPzJJpKT /vgwIvFGt32x0a71R/hx4dsFaCmSdn9DYCtVPqfzMFycPePOtgxBm2YsETXwAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664838; 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=8EXBphEqvSMeKIegyJyS7Szu3vb9MtlJUlsrV8mrr2g=; b=emyPuTiv5FI5JZo1sOcrFpjhJUjdjt40yWvzG1o1tEU2HA5KwnibcsMBvAxp6VJnc6YSNi saHwHJh6iiD7nMTsCKdafZo52dExd+sxzLqQgpaeigKXw+VDiFmXq5IeHH5QoP/Ngp5ZEX ks9Wjy+/8yLr5f96/ckWbw0IVWZKLgBjzb2HJiVPFTJ9h5NhS+RSx8/acqfvTTpR82BAXg k8KzEN9EK93jANZ8WNzPPZ43pqdrgeqRFtM6WTAzl4Tx5jdy6LYmfiI1OKiaoipdSH1CUp VpT1KkT4Y0A4WIuNICbFiBwqMHauB4+YvlQCMQU7V4QuVCChzyMRMVfGCkbGqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664838; a=rsa-sha256; cv=none; b=fyJhOiB2R3yNiY+hgsNCvh8xP2WZ9xoLPtuMV4KANUsKTTJeTAYhIylbHUWV/2sIrLfZs4 8wZjAQuyc9Y1zp+Z7GUtW43B4ybehl6rPIKX/E4eoUc7fSub7i+e78ePNYp6hZVQcbJGaW n2SOGZncy1MHcukww23E3PGIfPU5bF+dFlCeBydmozqq8IRq5wN/ea9PBmTIrP5+jwI2Mb 3Hjxuf4MomiYIvy9XjRu6IGsPbuuk4mCfZb2zlEE+c7YjHjRj0a4/W6zpxE1pdZY091kVC ERrNBAt7SJ4vtj8+fJcHIenYaXbHOOrC8OjRS3SfSioAeExfQGgezx2uVdZv4A== 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 4bQgCV50kYztxK; Mon, 23 Jun 2025 07:47:18 +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 55N7lIqi068862; Mon, 23 Jun 2025 07:47:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7lIiu068859; Mon, 23 Jun 2025 07:47:18 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:47:18 GMT Message-Id: <202506230747.55N7lIiu068859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 14237ecfd28c - stable/14 - nuageinit.7: language and grammar fixes mostly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14237ecfd28cd664fcb0f1645deb632cd059d579 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=14237ecfd28cd664fcb0f1645deb632cd059d579 commit 14237ecfd28cd664fcb0f1645deb632cd059d579 Author: Maxim Konovalov AuthorDate: 2025-06-17 07:59:57 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:46:48 +0000 nuageinit.7: language and grammar fixes mostly (cherry picked from commit 1049c079c013e17b72d64f6b558e9f7e777714f1) --- libexec/nuageinit/nuageinit.7 | 54 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index 7e44ce208a9b..dd6c7b5d0a64 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -19,15 +19,15 @@ It is composed of 3 scripts: .Bl -tag -width "nuageinit" .It Cm nuageinit -This script will detect the configuration disk kind of cloud environement the +This script will detect the configuration disk kind of cloud environment the system runs on and gather accordingly the configuration data. -The following cloud environements are supported right now: +The following cloud environments are supported right now: .Bl -tag -width "OpenStack" .It ondisk A cloud agnostic environment where the disk is provided to the system with the configuration data on it. The disk should be formatted in one of the following formats: -.Xr cd9660 4 , +.Xr cd9660 4 or .Xr msdosfs 4 and be labelled (via filesystem label) either @@ -44,17 +44,15 @@ description available in .Xr kenv 2 . .El .Pp -Depending on the cloud environement above +Depending on the cloud environment above, .Nm will attempt to configure the instance. -See -.Sx CONFIGURATION . -This script executes early, +This script executes early after all the local filesystem are mounted but before the network is configured. .It Cm nuageinit_post_net -This script is reponsible processing the configurations that are network -dependant: +This script is responsible for processing the configurations that are network +dependent: .Bl -bullet .It dealing with packages @@ -67,7 +65,7 @@ been passed via the configuration to be executed, via the configuration or because the user_data provided is a script. .El .Pp -The default user for nuageinit is a user named: +The default user for nuageinit is a user named .Va freebsd with a password set to .Va freebsd @@ -77,9 +75,8 @@ and a shell set to The configuration of .Nm is typically done via metadata provided by the cloud provider. -The metadata is presented to nuageinit in different form depending on +The metadata is presented to nuageinit in different forms depending on the provider: -provider: .Bl -tag -width "config-2" .It nocloud If the data is provided via a disk labelled @@ -88,20 +85,20 @@ then the metadata is provided in the form of a file named .Pa meta-data in YAML format. .Nm -Will configure the hostname of the instance according the value of the +will configure the hostname of the instance according the value of the following variables .Va local-hostname or .Va hostname . .It config-2 If the data is provided via a disk labelled -.Va config-2 , -or if fetched from OpenStack, +.Va config-2 +or if it is fetched from OpenStack, the metadata is expected in two json files: .Pp The .Pa meta_data.json -file supportes the following keys: +file supports the following keys: .Bl -tag -width "public_keys" .It Ic hostname Set the hostname of the instance. @@ -125,7 +122,7 @@ Array of network configurations to be set. Along with the metadata, a user data file is provided, either named .Pa user_data or -.Pa user-data +.Pa user-data . If this file starts with a .Qq #! , it will be executed at the end of the boot via @@ -153,16 +150,16 @@ An array of strings or objects to be created: If the entry is a string, a group using this string as a name will be created. .It -if the entry is a an object, the +if the entry is an object, the .Qq Ar key will be used as the name of the group, the .Qq Ar value -will is expected to be a list of members (array), specified by name. +is expected to be a list of members (array), specified by name. .El .It Ic ssh_keys An object of multiple key/values, .Qq Cm keys -being in the form: +being in the form .Ar algo_private or .Ar algo_public , @@ -212,15 +209,15 @@ Ignored if an encrypted password is already provided. .It Ic groups The list of other groups the user should belong to. .It Ic locked -Boolean to determine if the user accound should be locked. +Boolean to determine if the user account should be locked. .It Ic sudo An entry which should be appended to .Pa /usr/local/etc/sudoers.d/90-nuageinit-users .El .Pp -A special case exist: if the entry is a simple string with the following value -.Qq default -The the default user is created. +A special case exist: if the entry is a simple string with the value +.Qq default , +than the default user is created. .It Ic chpasswd Change the passwords for users, it accepts the following keys: .Bl -tag -width "expire" @@ -230,15 +227,15 @@ Boolean to force the user to changes their password during the first login An array of objects: .Bl -tag -width "password" .It Ic user -Specify the user who's password will be changed. +Specify the user whose password will be changed. .It Ic password -Specify a text line with the new password, or -Specify the user who's password will be changed. +Specify a text line with the new password or +specify the user whose password will be changed. .Qq Cm RANDOM to assign the password randomly. If the textline starts with .Qq Cm $x$ -Where x is a number, then the password is considered encrypted, +where x is a number, then the password is considered encrypted, otherwise the password is considered plaintext. .El .El @@ -276,6 +273,7 @@ ssh_keys: .Xr cd9660 4 , .Xr msdosfs 4 , .Xr smbios 4 , +.Xr ssh_config 5 , .Xr rc 8 .Sh STANDARDS .Nm From nobody Mon Jun 23 07:47:19 2025 X-Original-To: dev-commits-src-branches@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 4bQgCX0ZwXz5ywNR; Mon, 23 Jun 2025 07:47:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQgCW6WVFz4Ht9; Mon, 23 Jun 2025 07:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664839; 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=E9cdlfnrRsQPlBwv3BcK2LGG0Oe1wJI6LNii99UwRmc=; b=h4/AzJvnhbTGC9OoWklXymuyyQYjP/YCCT83f9k3CI6vNNFN9TU7r4ymHfP4YNpmQMqF6O 4boG0Amo1VU6Xfod+O7fblb3R/fJa12DWV9vjVBZ2nJ/6wQ+TvJBmuibvve4ZENzRtZjwP Q0zUhI9QkF/7Qghmpbe0dy1M4Ep8MLbrBqm8P0qJwfYaxEXrMomb34MPrwGQbOZxUX1PxB FyPbF+4jBrGuiBnQnBtXAHZtLr2wEZrU8bYg+e+zSQSpxt58kGJit5pGopvRuv7bCeuOh2 1srWdVH/cPOjiT6QZw4/fh8V4cRrv2TjkMM95BSWs1rJ296zRw29bFgNSLlD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750664839; 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=E9cdlfnrRsQPlBwv3BcK2LGG0Oe1wJI6LNii99UwRmc=; b=G95hYdwEYLqF71jpS3J6OVhvmPBRaV97XMTe/V7EdR3FaKYkCtdW3iA9uHjRae7EzI0IWb 242i64PsbBTgRDTIV+SZNK3hCqE1YYEguyORI13Jxj5l+r86NxvrXWCGtghDm2IHRIemsQ TM/P/1nIwOjYnB1igYkQwN0tO7MAKAV8piDr6yJzsdckF9nSs0hVOd0nOV/Ug7dO8lc/m2 Sjc9ka/W7Xjm6GAzy21NZlvjnPGxUYUI3my2wcNvPun3rKIucB3nX6P9g9vnexK3AVpOE4 jwM3iTE5ovL+mhisRTwQg9VeIPuLMjio5MIv0AXqBBr+f+Eg5oL9oW4lp8D1Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750664839; a=rsa-sha256; cv=none; b=F3RwdsJK1/KF2pYJJeyveHTlu4Uy7SzjdfCzdO6+1T8hqdqWDe8JqKdTcB5t5uHUuHQ6AY S30aJ9NRg7YB3ktVOa9aMV75niOsEv6UqEbLK6w5KGG073q337ZU9YJpA7a0SvH+qN3b6y aiX4scAQX/5XlQQuSltM+4LBok0GSA/AysmSW0VdFukB0h+uqexqoQFO4H8o6HHxZSmLtd WRktN0R39SPeCG5jAVJBf63IAC8vTS/4dGBG216MMQ9txy1kaVUdrSzBGAg7KWhxY2SSvD Dry3EU22i6SslE6baM6L6QftHqFYEo/LtjdCNMj615ZOryZ0P9thTPMDjjzdLQ== 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 4bQgCW5hRRztGt; Mon, 23 Jun 2025 07:47:19 +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 55N7lJiK068905; Mon, 23 Jun 2025 07:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N7lJ0R068902; Mon, 23 Jun 2025 07:47:19 GMT (envelope-from git) Date: Mon, 23 Jun 2025 07:47:19 GMT Message-Id: <202506230747.55N7lJ0R068902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 953119c5f5ce - stable/14 - nuageinit.7: language and grammar improvements List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 953119c5f5ce79865f21d642fcdd582285cd5c89 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=953119c5f5ce79865f21d642fcdd582285cd5c89 commit 953119c5f5ce79865f21d642fcdd582285cd5c89 Author: Maxim Konovalov AuthorDate: 2025-06-19 13:14:33 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-23 07:47:02 +0000 nuageinit.7: language and grammar improvements Reviewed by: bapt (cherry picked from commit b78b7fa01fc775c9bb95ac7d68fbf3994a5ab5c5) --- libexec/nuageinit/nuageinit.7 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libexec/nuageinit/nuageinit.7 b/libexec/nuageinit/nuageinit.7 index dd6c7b5d0a64..1d2f83fe62e0 100644 --- a/libexec/nuageinit/nuageinit.7 +++ b/libexec/nuageinit/nuageinit.7 @@ -14,19 +14,19 @@ The program is used to initialize instances in a cloud environment. .Nm runs at the first boot after the system installation. -It is composed of 3 +It is composed of three .Xr rc 8 scripts: .Bl -tag -width "nuageinit" .It Cm nuageinit -This script will detect the configuration disk kind of cloud environment the -system runs on and gather accordingly the configuration data. +This script detects the type of cloud environment and gathers +the configuration data accordingly. The following cloud environments are supported right now: .Bl -tag -width "OpenStack" .It ondisk A cloud agnostic environment where the disk is provided to the system with the configuration data on it. -The disk should be formatted in one of the following formats: +The disk must be formatted using one of the following filesystems: .Xr cd9660 4 or .Xr msdosfs 4 @@ -69,12 +69,12 @@ The default user for nuageinit is a user named .Va freebsd with a password set to .Va freebsd -and a shell set to +and a login shell set to .Va /bin/sh . .Sh CONFIGURATION The configuration of .Nm -is typically done via metadata provided by the cloud provider. +is typically provided as metadata by the cloud provider. The metadata is presented to nuageinit in different forms depending on the provider: .Bl -tag -width "config-2" @@ -85,7 +85,7 @@ then the metadata is provided in the form of a file named .Pa meta-data in YAML format. .Nm -will configure the hostname of the instance according the value of the +will configure the hostname of the instance according to the value of the following variables .Va local-hostname or @@ -127,7 +127,7 @@ If this file starts with a .Qq #! , it will be executed at the end of the boot via .Cm nuageinit_user_data_script . -If this files starts with +If this file starts with .Qq #!cloud-config , it will be parsed as a YAML configuration file. All other cases will be ignored. @@ -217,12 +217,12 @@ An entry which should be appended to .Pp A special case exist: if the entry is a simple string with the value .Qq default , -than the default user is created. +then the default user is created. .It Ic chpasswd Change the passwords for users, it accepts the following keys: .Bl -tag -width "expire" .It Ic expire -Boolean to force the user to changes their password during the first login +Boolean to force the user to change their password on first login. .It Ic users An array of objects: .Bl -tag -width "password" From nobody Mon Jun 23 09:10:33 2025 X-Original-To: dev-commits-src-branches@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 4bQj3Y6n8Qz605df; Mon, 23 Jun 2025 09:10: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bQj3Y5yN4z3ZFx; Mon, 23 Jun 2025 09:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750669833; 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=irbnl0wrVJWa03j0+1im0QJ0PP0eipXisbBZOqFDRLA=; b=WiMCn/vRrOWUljvp6c0dnv+M/KIBGEPxMfpK2az3CGj5SkZ1OFy7ofok8Bju13PHwHoflb mzTGYrQcPtiSVuoMKEMDLGmIZ8YlWydQ6JtpCar6j1j0vmGFeolZ7AgsX52F0Yr0YTjxeS 85xbVv5LO6V2AwGycbf3rO+0kWo3lt1KDJpmABA4iHW2WrLu7G8C3z9gaCdcis0+KfrTL7 ESTO7HB4OQVaptNqbzsUmANVcaTDBk8OtXH4R0DdwDL+wSMMdDiD/HI/tTLlsj0gX3AZhl Co8+6Y8LgxmBDiMKw6PH5TIaWU2YLy2lS7gjXWLI1xKrQbaOzXSLv1UGuE27MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750669833; 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=irbnl0wrVJWa03j0+1im0QJ0PP0eipXisbBZOqFDRLA=; b=MJbNjSbx3o/SiqPBBPlVepRBtH8AC3btbyuI378Ehr36cwyl9TSXicLUyvNjvZ9j73HKKu 5oMkL5C70eRxawwvh6aJ05DVDaE/u3sLNa1t0sRvh5Dbr6xl/8Yo5IVxpULxE62MrrzS4H GDT8G5OwpI74k2N/Dq9UMMrd3wldkRf/uhc/OE0upyjKQJmOfS7wFR3c4QLkaPUIMemAko VCdIOCvECzR92aoGyC4fDXkS4KvpyCNRB+qjOWI10Fr1TYUBVrNTOq0Ooypb4q5SwHP6wA XLVIVAf8o64Do0VE2U71IiYycZ8ZCynIyC/2P5J3OWR7rWoLcvCSZlEKJ3DNMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750669833; a=rsa-sha256; cv=none; b=IdSiEgKnHfOap/Kzf4lpi4cpYHjOB2o1J3VG0kQvXAoK5JsyKUd/DcXwtrODqexmuELjm2 thWLuQn8Etjcw+HtCQupalVChbvr/f/xpOLZhI1+SoIRqOyImlaOFX3WO4iQ9i2fBAurNb lnVDuQb9JzqlGKqrulqSskg6GeqaHXMlEj3NLSsHM8eNNAw0wma7/x4yYEm2OV4YFtJSKd m9umlfQtRPyZmZuSin1Htukkgb9XFGIDW4M8VTgZBLkeZavvtp/rsHdsr4O2tjMp10a4Ia kpowQQTpL/Y/jQ6CRkirbjrJNV1Ggs9ENCa7nvKr0XIluiBNWTMnTcw/XkPlkw== 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 4bQj3Y5W3Czwv5; Mon, 23 Jun 2025 09:10:33 +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 55N9AXrq030951; Mon, 23 Jun 2025 09:10:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55N9AXL3030948; Mon, 23 Jun 2025 09:10:33 GMT (envelope-from git) Date: Mon, 23 Jun 2025 09:10:33 GMT Message-Id: <202506230910.55N9AXL3030948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 6ff6a0b58981 - stable/14 - Don't rely on sys/_types.h including sys/cdefs.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ff6a0b589810f41cea06fbcdf21c5b0dd72e602 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=6ff6a0b589810f41cea06fbcdf21c5b0dd72e602 commit 6ff6a0b589810f41cea06fbcdf21c5b0dd72e602 Author: Brooks Davis AuthorDate: 2025-06-11 16:39:01 +0000 Commit: Brooks Davis CommitDate: 2025-06-23 08:55:36 +0000 Don't rely on sys/_types.h including sys/cdefs.h These headers relied in __BEGIN_DECS/__END_DECLS being defined when sys/_types.h was included, but there's not a requirement that this be the case. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 (cherry picked from commit b01e971fd39d10273a387788019457792873e81c) (cherry picked from commit 4f4c465b45d42ed8d2b65c8b4c909246987ac877) (cherry picked from commit 12913e4ddf710e517f3ae00b7b420b783cca9b37) --- contrib/libexecinfo/execinfo.h | 2 ++ include/dlfcn.h | 1 + lib/msun/aarch64/fenv.h | 1 + lib/msun/arm/fenv.h | 1 + lib/msun/riscv/fenv.h | 1 + lib/msun/src/math.h | 1 + sys/arm/include/sysarch.h | 2 ++ sys/arm64/include/sysarch.h | 2 ++ sys/sys/procdesc.h | 1 + 9 files changed, 12 insertions(+) diff --git a/contrib/libexecinfo/execinfo.h b/contrib/libexecinfo/execinfo.h index 22460967e83c..8a3c36b2da21 100644 --- a/contrib/libexecinfo/execinfo.h +++ b/contrib/libexecinfo/execinfo.h @@ -32,6 +32,8 @@ #ifndef _EXECINFO_H_ #define _EXECINFO_H_ +#include + #include __BEGIN_DECLS diff --git a/include/dlfcn.h b/include/dlfcn.h index 89ec43b332e9..9a4ac0faf786 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -32,6 +32,7 @@ #ifndef _DLFCN_H_ #define _DLFCN_H_ +#include #include /* diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h index 2148a68b053b..a435a9de5223 100644 --- a/lib/msun/aarch64/fenv.h +++ b/lib/msun/aarch64/fenv.h @@ -31,6 +31,7 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include #ifndef __fenv_static diff --git a/lib/msun/arm/fenv.h b/lib/msun/arm/fenv.h index 5dded5d744fd..e8a30fcf496f 100644 --- a/lib/msun/arm/fenv.h +++ b/lib/msun/arm/fenv.h @@ -29,6 +29,7 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include #ifndef __fenv_static diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index 36abb7b00b7d..62bdf65b70d1 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -36,6 +36,7 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include #ifndef __fenv_static diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index 405434752336..8e72beb757f8 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -16,6 +16,7 @@ #ifndef _MATH_H_ #define _MATH_H_ +#include #include #include diff --git a/sys/arm/include/sysarch.h b/sys/arm/include/sysarch.h index 907a84f39e58..e0a8e0039b99 100644 --- a/sys/arm/include/sysarch.h +++ b/sys/arm/include/sysarch.h @@ -38,6 +38,8 @@ #ifndef _ARM_SYSARCH_H_ #define _ARM_SYSARCH_H_ +#include + #include #ifndef LOCORE diff --git a/sys/arm64/include/sysarch.h b/sys/arm64/include/sysarch.h index f72d3427602e..d5d58000309e 100644 --- a/sys/arm64/include/sysarch.h +++ b/sys/arm64/include/sysarch.h @@ -39,6 +39,8 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ +#include + #define ARM64_GET_SVE_VL 0x200 /* Reserved ARM64_SET_SVE_VL 0x201 */ diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h index 4e8b06fb7377..81102dffa6ff 100644 --- a/sys/sys/procdesc.h +++ b/sys/sys/procdesc.h @@ -108,6 +108,7 @@ int procdesc_falloc(struct thread *, struct file **, int *, int, #else /* !_KERNEL */ +#include #include #ifndef _PID_T_DECLARED From nobody Tue Jun 24 01:01:04 2025 X-Original-To: dev-commits-src-branches@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 4bR68J5YtHz6038G; Tue, 24 Jun 2025 01:01:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bR68J4zRVz3GfH; Tue, 24 Jun 2025 01:01:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750726864; 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=vx8jR4UiV0wqaR7fAay8EPoEu6NkASPIg9dL+Uf55Ck=; b=uaBhQPqLoe1AQU8EZvSjW5R4WOHSs+TR1fvCgv+sDKIPPNcbOqRG9c0V9KCRJzeJQawozx hKWNdXOLwou/K+7c+LF47z4KWYIuKP67iOjFQYTSANI2YZIscGX0H6rGhEqOYFtjq7blCt Ilb5H2XXkti1Elu1tE1D7Ce7xn62QVX5Dfr9YMuoSZp83txG7meLDjuE9reDtLGV4sNDFA oZ6f8I4K/7jPCGZnpUviF7OohksgPTrXrOKglGG1xhvwvgwNQ5AnpOt755A1F7mpmh57Jj QW+fwg6SEyZOSlU+hsydyU8e1GaaKCw7vDFHRupK2KmLY0MJ+aHliVts+mupEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750726864; 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=vx8jR4UiV0wqaR7fAay8EPoEu6NkASPIg9dL+Uf55Ck=; b=KiuB0ULfWuhrmN6UkKrXfkHROl8gxFI6eV9zNzTXVcTrmwPWSr3jKjd1+N2yDvpxffHHMV ljY9uveCsNzi92gSWjfK1Sm+oTsDJ3bpqfdgVP1hNxwBc4KbzJGRpBo/QTQZdEPpDqk/3N HCi6w1BVHEZu5Upwt0gb1zQlj4zKKV4X1I1qaB5N6WrR46wAo2WWaP40qHzhU5Hz6Onv0T y+Jye/b8Q2TLZiXMBCHNGcZMOJVrrJVbt37Iq0c1Ps38IPnC9xnO81KM2QXRzNANP/+HdQ ytaB2eCmLdiH0cHDjC+zUaqfZ1e4u4FSs6OtHDArNjIzYXstai8K6orj9GAgXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750726864; a=rsa-sha256; cv=none; b=J2HvkXzKm0WeuKsdf6PPXD8GYkX5XRJQdM9C3k/x7CkWK6ikK5yRWSByS5zDJljEgpWx1Y VT5BhMtklFVipnlBOxx/JQ03wa9lsOcSucWomC1gMaE+yPFizKGP/z5Q2ZtbvfAIFiCQgG 0ug3+81+rhjLLUEMKmZfO1urW24h/HnSGe3ryDkh8dSGCTNRVjs3tC9kUCgdLGFxPa20+o u67Kp6vYTWEiPDwMqDD0agYSdc/S1PFTfEk0SgHWS8pTF0OTsTGQUaFhQf6os323t/doza fQrmOSQI3fZUkNrUpCcN4JHcanrT0FTfGcPiMjUVq09rVO+xpCOQ4GaXxqC81A== 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 4bR68J4Yt3z94b; Tue, 24 Jun 2025 01:01:04 +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 55O1146u023715; Tue, 24 Jun 2025 01:01:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O114Y3023712; Tue, 24 Jun 2025 01:01:04 GMT (envelope-from git) Date: Tue, 24 Jun 2025 01:01:04 GMT Message-Id: <202506240101.55O114Y3023712@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: 1b09c94e950c - stable/14 - Obsoletefiles.inc: Correct paths for some man pages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 1b09c94e950cf1444e29c07a1e25c33324f271df Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1b09c94e950cf1444e29c07a1e25c33324f271df commit 1b09c94e950cf1444e29c07a1e25c33324f271df Author: Mark Johnston AuthorDate: 2025-06-16 00:51:26 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 00:40:22 +0000 Obsoletefiles.inc: Correct paths for some man pages Reported by: dougm MFC after: 1 week Fixes: 87b646630c48 ("vm_page: Consolidate page busy sleep mechanisms") (cherry picked from commit 18117f3f1269c3b70c04ed741cc1ca3f3ecd8be9) --- ObsoleteFiles.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 0b8a3b9d4651..d8a177732c77 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -3673,9 +3673,9 @@ OLD_FILES+=usr/share/man/man4/twa.4.gz OLD_FILES+=usr/share/man/man9/kernel_vmount.9.gz # 20211115: vm_page busy functions removed -OLD_FILES+=share/man/man9/vm_page_sbusy.9.gz -OLD_FILES+=share/man/man9/vm_page_xbusy.9.gz -OLD_FILES+=share/man/man9/vm_page_sleep_if_busy.9.gz +OLD_FILES+=usr/share/man/man9/vm_page_sbusy.9.gz +OLD_FILES+=usr/share/man/man9/vm_page_xbusy.9.gz +OLD_FILES+=usr/share/man/man9/vm_page_sleep_if_busy.9.gz # 20211113: new clang import which bumps version from 12.0.1 to 13.0.0 OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/algorithm From nobody Tue Jun 24 01:01:05 2025 X-Original-To: dev-commits-src-branches@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 4bR68L1GWlz602rZ; Tue, 24 Jun 2025 01:01:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bR68K5bz5z3GWp; Tue, 24 Jun 2025 01:01:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750726865; 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=B8VE59jBRAMKEO3X1wrKBJcwFkrs1TmkAlveinrIItY=; b=tDfeWGSypP8I4JtwD14b49VjOVKeCd0G3heBoRu6vXjFaIyy4WSsECZR78JeCPHwzDyw+O rOA7BXF6NTNa6rCMtBvqU8A7jtOFiwmqVqtxlHvXCEbi6j6MO8iOMX7+rg9iELJe3Dm451 /ULb7ZWDvqw4lvrQPhqsl2usw3iUMd3vrPqPHPZDenLuXszYbc7QgUxuykOrC1JgmiwxuC aMuJF4WIWWnX5xTCFewIFkAhyRejwYsln9p30niyWMLUvTD0z6ifAb63TTLGoBOMsTo9FM dvdJxXlTTg7QuQH3gHhC44+u76MH+4qftvNtI4tICGICDfJsQVNN1aaHjihm3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750726865; 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=B8VE59jBRAMKEO3X1wrKBJcwFkrs1TmkAlveinrIItY=; b=YzpJmLkD24MLsZZD/QeB5orMHeaYy3kdfXkhoAwUYUlI9/KF5gOz04hyom3ptekUAhek23 WpvT84hJsw0ZgJDdDkgNOKvR1J0jGUPPdVamj5CzGwb7wZBKHjHNvfrtFeh2fRl8dB5Ipp kbGEWv2z1Pn/axrnFxVxkbGN/e1fGPKGLzbNs5h8FYKSAKVj0blxA83CS6UQAK3yFZA+8D lcfiQnOHUywKcumApUnB42FBTvwQsusWB/LC6H1smbbMOLNHSILYCKxEWhbWwOSS7xXV04 VCCMEJqqYUVDyVVl/cr8XT914ydMHw8Ql+9HAVgLpDoEo7AR3qDg9rJQveV7Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750726865; a=rsa-sha256; cv=none; b=Z5VzSCcfCpQwqCSbA02ZHOjmTfFKe6feFr8PlEsd07rKOO+8uCmiFiFbL4WZS9k2r1G8ex /gmcK2rapuAMzEdhat63EA0c5aAtCw7Nvdez5ftN48y5CaGYsilN9YkcTCjNua/Sf9GOxu 8aklc3GGOHyjcjAAm8OZISXcoRHi5IobzXCEx/aP49TTIEtpHiY3gz+9HIO2HQLmnnxII8 9BxO5uAGZGP82Jn6y/GhgkD19vWvUwxLWhqKM3+szCExnbdm8zm3U5ZDpWSG3gycvL269Z 8yAR2afkLhRIMZzwpZ04qPu3JtN16tjuRw240jIdtRi5pEPBfUIRdPDNDjSZhA== 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 4bR68K570Xz9tp; Tue, 24 Jun 2025 01:01:05 +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 55O115GM023917; Tue, 24 Jun 2025 01:01:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O115sl023903; Tue, 24 Jun 2025 01:01:05 GMT (envelope-from git) Date: Tue, 24 Jun 2025 01:01:05 GMT Message-Id: <202506240101.55O115sl023903@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: 97e2915ab98e - stable/14 - makefs: Implement the collision differentiator for micro ZAPs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 97e2915ab98e786f7310d8477aa48d71a5485e44 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97e2915ab98e786f7310d8477aa48d71a5485e44 commit 97e2915ab98e786f7310d8477aa48d71a5485e44 Author: Mark Johnston AuthorDate: 2025-06-16 20:33:14 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 00:40:22 +0000 makefs: Implement the collision differentiator for micro ZAPs In the unlikely event of a hash collision, the collision differentiator is used to create a unique lookup key for ZAP entries. While the fat ZAP implementation in makefs implemented this, the micro ZAP implementation did not, so it's possible to end up with collisions in directory entries. These are caught deterministically by OpenZFS, but the result is a panic. Implement a simple differentiator by simply assigning a unique value to each ZAP entry. This scheme works since the 16-bit space of differentiators is larger than the maximum number of entries in a micro ZAP. (While the on-disk encoding provides 32 bits of space for the differentiator, the in-memory representation of micro ZAP entries is smaller.) PR: 287482 MFC after: 1 week (cherry picked from commit 64e0b2e8f75286f9f4d85a86fbb6815b435c7096) --- usr.sbin/makefs/zfs/zap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/zfs/zap.c b/usr.sbin/makefs/zfs/zap.c index d01f7527adf9..decf5fc6a473 100644 --- a/usr.sbin/makefs/zfs/zap.c +++ b/usr.sbin/makefs/zfs/zap.c @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -201,6 +202,10 @@ zap_micro_write(zfs_opt_t *zfs, zfs_zap_t *zap) mzap_phys_t *mzap; mzap_ent_phys_t *ment; off_t bytes, loc; + uint16_t cd; + + _Static_assert(MZAP_ENT_MAX <= UINT16_MAX, + "micro ZAP collision differentiator must fit in 16 bits"); memset(zfs->filebuf, 0, sizeof(zfs->filebuf)); mzap = (mzap_phys_t *)&zfs->filebuf[0]; @@ -211,10 +216,11 @@ zap_micro_write(zfs_opt_t *zfs, zfs_zap_t *zap) bytes = sizeof(*mzap) + (zap->kvpcnt - 1) * sizeof(*ment); assert(bytes <= (off_t)MZAP_MAX_BLKSZ); + cd = 0; ment = &mzap->mz_chunk[0]; STAILQ_FOREACH(ent, &zap->kvps, next) { memcpy(&ment->mze_value, ent->valp, ent->intsz * ent->intcnt); - ment->mze_cd = 0; /* XXX-MJ */ + ment->mze_cd = cd++; strlcpy(ment->mze_name, ent->name, sizeof(ment->mze_name)); ment++; } From nobody Tue Jun 24 01:01:06 2025 X-Original-To: dev-commits-src-branches@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 4bR68M3VhKz602Xh; Tue, 24 Jun 2025 01:01:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bR68L70nHz3GRZ; Tue, 24 Jun 2025 01:01:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750726867; 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=Mhwkr2RqYUWVqpHH7Cm5OTH3k75vm56IX85jjfOfOw8=; b=NDjjdMFAbXpAfXeiXI4SanrPFKi2XAb0k3HrLShe3zl/kABKwyqEMgk+mVo6VWtTDnp/Qd DRnoPHwITgXUhK2YRdFpnlJYqUl3XiPtv0BFwF+jiwqNpsRQu5C7shpbkw3NMD02oVH2TY OJdD87dvKOlkiAGM4vPAXdiAL2FjQfBD7qZrBLPY/mAEtalOamJFdvO83vREip3Uo67JtR QIqAX+wgBG3kKOow3kWM0JiKyNgzgh838qD0CA50MJhlfnfmE673yYoMOB7n26aUgxrLvR YmAmaDp53OrUbOhTJmr/QEstybXw+m/AJKvOIVgW61zdFjz6BBW7wip+fwUweA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750726867; 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=Mhwkr2RqYUWVqpHH7Cm5OTH3k75vm56IX85jjfOfOw8=; b=Gg2X+LdoKoqPg5xJEAksr2y6tH1ec51wBHpoRuLYFgVzwRuNDzkVoWR6cniLt+1hmen8HA TC/6/6nZ2dBdkVc1rq3JeOEOQC9Wug+mXZ+lTkPTqSVldXHrFdC9I1GImOp/P5vTR1L/Gw qkExrMBEPyMlwDWchPMgCF6jUGG+aVKJTVNurWlZ3Bw2byrBtCYDPqPdcas1jJFzhIGhGU vf67wBFvEbhkD1s0ozWmXPMNZ1SB3Vz7so6wh3R07nUoaGDn48cL6CCudHkKHkByLteRzt 2q5deW5hSEU7yfI2yRqsZQRTBZcPr8p7+poapjlT1Uw/X2awmqqlyvrbFs5knQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750726867; a=rsa-sha256; cv=none; b=Nen44Etawnc/UIRVwZyNbW9SfBXwUuH5983skeVc/QyttAMfnBreEg8Z2X4pYZIB9RjlE3 Pu/KJnpUvCaWKvgbKY6iomGnKtrG2QGuWGL2gZtuoeugk/pFpOzzapq98ZprPo+yeQLof4 CJYJypv1PswLTK0+JXM+cju21cHj+zvfxwlRb/mvr8Bo3GhQ5tYW2Riwy1p5c03CMeWbkj FCwAxpb/7GWtXrOkxOZBAbTvjjMXuVWBW++aKtxsuc7aXkkqWv6E20MYzGH3EpGgDzRouE kVPfDN05s3CaZjsVt26pTTl2V3WJDfwH7v02ZxWAR0FjhfSwNCuDMGdPzT0DoA== 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 4bR68L5Nzjz9kj; Tue, 24 Jun 2025 01:01:06 +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 55O116Kk024728; Tue, 24 Jun 2025 01:01:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55O116bL024725; Tue, 24 Jun 2025 01:01:06 GMT (envelope-from git) Date: Tue, 24 Jun 2025 01:01:06 GMT Message-Id: <202506240101.55O116bL024725@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: 478f97786263 - stable/14 - libclang_rt: Descend into libclang_rt to clean List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 478f977862637cc48e97ad71885ce3ebb16280c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=478f977862637cc48e97ad71885ce3ebb16280c0 commit 478f977862637cc48e97ad71885ce3ebb16280c0 Author: Mark Johnston AuthorDate: 2025-06-10 14:09:12 +0000 Commit: Mark Johnston CommitDate: 2025-06-24 00:40:22 +0000 libclang_rt: Descend into libclang_rt to clean Otherwise, during a clean buildworld we don't descend into libclang_rt to remove object files. Reviewed by: brooks, dim, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50766 (cherry picked from commit 20c636620c6955795f97619d22c7eca9f8599ad7) --- lib/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 6c5edfdc8f76..54e5d0795392 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -180,7 +180,8 @@ SUBDIR.${MK_LDNS}+= libldns SUBDIR.${MK_STATS}+= libstats # The libraries under libclang_rt can only be built by clang. -.if ${COMPILER_TYPE} == "clang" && ${MK_CLANG} != "no" +.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \ + ${MK_CLANG} != "no" _libclang_rt= libclang_rt .elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all) .error Requested build with sanitizers but cannot build runtime libraries! From nobody Wed Jun 25 00:41:16 2025 X-Original-To: dev-commits-src-branches@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 4bRjg073JSz60Tbn; Wed, 25 Jun 2025 00:41:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRjg05hC4z3JvY; Wed, 25 Jun 2025 00:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750812076; 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=/VVHchO1e/AE8tf3mt10OcG0LIq4pL82gqTnUw0F5Z4=; b=DXE80iUMipoYD2rkBYsEMCzH1m0zQc6CDc+Hko6Auc1pb/2gm1sDPXfEvwvRr9pPkkpKAh FnLAjlagGPO87MZ+Ckn2thgopUPobr4+4PjH/GDtdgCBjoebmmwSf/maT8psJ8tGu/HMwU ExYXH36s4xCZlf/cY2C/CJw+bRtmkxWq/vP2kTZPptrsJL26Mp/OnbQO3RghET+LsY1sAH PLRiLnDmdkC8U4Tc/t+tFoiPJDcXRoPAFfslkU3R1F/UzJz/AOCGAujgwGchYt/8LlaiqM hg//mf96mJU7dP5PmtRpJC1u6AwE7B7DjaEYMzNRM0LDxKQTqPJjy5fiviUr6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750812076; 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=/VVHchO1e/AE8tf3mt10OcG0LIq4pL82gqTnUw0F5Z4=; b=QWJ5AGC7/ln4vU27dcWwpGuosS+BO6f4AxGCTNabCO0O09V13UqKkMeX5//LmWUHgYuIrl tV2I8nWZNiT1rHV7lLikHZ1HefH4YbwGQbWDnDZPCY99Ma8hkHkcifWnVXIAhQckBpzOdI pJYg9EjS8/GAwCiyQQTDfiy/koynYvok7qG7BuqPbvlb+YUQQqzevyLB9snmcRulh9BPV7 Z+YkgwUCgRNIsdCxls9LTNPEI0KWfh8DZPsKrh4/SZC4/oL7+0Wm7Pd6SGzlF/kzLbSKoL mEB8MFf0hpTNARZ0yt1hOxLp3pm40Fy6fQNNjlKXl3+DW16gXgd/SbWbbZdBQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750812076; a=rsa-sha256; cv=none; b=MQgeCnhaIt704SIPfWKGEPpJyqpGUj+HLvtphMFfLHzz31PCFKx8E4w/UPU4KHN/ZKt7tj P1X6tpTMfwUzaWKcC2VqSH/km3gAO7PB5WzqdxNUy6No9MyuDxJUJG/0vXZZ9nuqurcesu t+/8wB2pchKh5fpkiDLEF1kPdg2DtyVsZoQCVUJWqCfLFt9c7o9vkOjxQOnHm4hK/oaEk/ eJq+ij8OFflWHDt7Y4TGfgJPFbDT4/eLs4PeFIRVry8BNBtb5TWtnkqcQYV2xUKna6uhza DZdqIoIfVbq5WkuNGlDrwTteabdSrj+2VuchFA9fdICIzCIm2SuYo1G7WtRWXg== 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 4bRjg05CRQz191H; Wed, 25 Jun 2025 00:41:16 +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 55P0fGn0095922; Wed, 25 Jun 2025 00:41:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P0fGj0095919; Wed, 25 Jun 2025 00:41:16 GMT (envelope-from git) Date: Wed, 25 Jun 2025 00:41:16 GMT Message-Id: <202506250041.55P0fGj0095919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 533f1a4d6b6e - stable/14 - audit: move the wait from the queue length from the commit to alloc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 533f1a4d6b6ef0ba575d99b16a45b96fb5e91e59 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=533f1a4d6b6ef0ba575d99b16a45b96fb5e91e59 commit 533f1a4d6b6ef0ba575d99b16a45b96fb5e91e59 Author: Konstantin Belousov AuthorDate: 2025-06-16 16:01:12 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-24 01:15:06 +0000 audit: move the wait from the queue length from the commit to alloc PR: 287566 (cherry picked from commit 0452f5f7b37af81dba3953c7127385fe6f307790) --- sys/security/audit/audit.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c index 6f935ede5371..21d950ede416 100644 --- a/sys/security/audit/audit.c +++ b/sys/security/audit/audit.c @@ -412,15 +412,22 @@ currecord(void) return (curthread->td_ar); } -/* - * XXXAUDIT: Shouldn't there be logic here to sleep waiting on available - * pre_q space, suspending the system call until there is room? - */ struct kaudit_record * audit_new(int event, struct thread *td) { struct kaudit_record *ar; + mtx_lock(&audit_mtx); + audit_pre_q_len++; + + /* + * Constrain the number of committed audit records based on + * the configurable parameter. + */ + while (audit_q_len >= audit_qctrl.aq_hiwater) + cv_wait(&audit_watermark_cv, &audit_mtx); + mtx_unlock(&audit_mtx); + /* * Note: the number of outstanding uncommitted audit records is * limited to the number of concurrent threads servicing system calls @@ -428,11 +435,6 @@ audit_new(int event, struct thread *td) */ ar = uma_zalloc_arg(audit_record_zone, td, M_WAITOK); ar->k_ar.ar_event = event; - - mtx_lock(&audit_mtx); - audit_pre_q_len++; - mtx_unlock(&audit_mtx); - return (ar); } @@ -566,13 +568,6 @@ audit_commit(struct kaudit_record *ar, int error, int retval) return; } - /* - * Constrain the number of committed audit records based on the - * configurable parameter. - */ - while (audit_q_len >= audit_qctrl.aq_hiwater) - cv_wait(&audit_watermark_cv, &audit_mtx); - TAILQ_INSERT_TAIL(&audit_q, ar, k_q); audit_q_len++; audit_pre_q_len--; From nobody Wed Jun 25 09:06:05 2025 X-Original-To: dev-commits-src-branches@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 4bRwsT6KFKz5ym2K; Wed, 25 Jun 2025 09:06:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bRwsT5PC8z3HZq; Wed, 25 Jun 2025 09:06:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750842365; 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=g2uQYsGawKI4XUi0XG+c0QNDSJncly4sU2o657AuPS8=; b=X0VoEFq5jZKyHadCerWntMDCL8jOJMRXtRNYo1FT/ECnNnTt+s5I4oNatR/aG06wPOmnt/ CG7O4CV2jrgT7Ndi6QLqHcEirOwH3JzxMbm6JZ3MJTu5eff4qMKWkdkfyiuc3kKjZ7Ge3d UUnjWombBc5kP5r5Viga6g+tewWqSL/R0XnmcpLMEZO+nGqfvKX+iBexmkACIYCPbXtIKx QEb8AbWWQN85WM6LXoEkZM37OuN/xdzoJr9gvDzpemCNoLgNXuUDlFFAiqRF7Oloewol5m 2LVkSfyICfBgb/E+VWfmkq/rf8gPwhndbdPNbvT6CgblHU8/7x2fPmVPjxDW8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750842365; 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=g2uQYsGawKI4XUi0XG+c0QNDSJncly4sU2o657AuPS8=; b=sEzt2l+yfZR9ETh9Hzc2bNyocRtqHyuLmwKr6ARKnnZvlYuxuKVQdvWUrKA1Qzu5EejM5a p2Kjfsm6+xF/1Rc5N70hhPri8KTRxmALGQCI5LG5vpBGmvDBi9l0eijxYV2UXhvifMA3L2 dxXMxHgd1STlvzlWwH2dVvv2PEPwO1Lsn6uRc/6hgy5CWDjdiQyXH6jWynXdqSWn+mVtqn RsXjmgRVmMuS1eLfb49KHdRSZ9b5ikH4jnOH/PtpmNLAqdU6MnrxcloZMnp3/Dm2+kPAO6 UYVY5DMaYNgdtg/ZAYFWSJzj/MKuWiusBNX9IXCg1Aej5hOaXcqB2DwTT2aCVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750842365; a=rsa-sha256; cv=none; b=iVtqtNmrDAlR7aSI85/95VyDNEI/yh92g4ElZwOF6Mzq/ttnuLtB6ZNEgVGJEYvDjw/klE STP6YgU81b4zHd2cSHVy3OGORJIk1UKx9VEd9mMfb+bJIEAHp90D7spl0akwpqoALUJLys q1O4Zp98rqG5hnok3aymUsCebRFa64pgp1nWGrj2EYgoIupVskvLN8sfqBSf5sN3D8p+Qq Ew4v6tPEgNjRNvTeatn9ND86oE0dHjaXCY3u2ZZq4fzRnOH5qOM+6j7RbRiGcRgEG1/6bB qTnVkJo+TOGW71KXWJEbGn4JZly1z4N+J32wrrfo5SDn7gtjPJL34lRE0Mcf3w== 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 4bRwsT4sJzz1Q7D; Wed, 25 Jun 2025 09:06:05 +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 55P965xV040009; Wed, 25 Jun 2025 09:06:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55P965as040006; Wed, 25 Jun 2025 09:06:05 GMT (envelope-from git) Date: Wed, 25 Jun 2025 09:06:05 GMT Message-Id: <202506250906.55P965as040006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= Subject: git: fad4064226b2 - stable/14 - x86/xen: fix accounted interrupt time List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fad4064226b2aa3de6a6c83adb7e0e0108e69bd3 Auto-Submitted: auto-generated The branch stable/14 has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=fad4064226b2aa3de6a6c83adb7e0e0108e69bd3 commit fad4064226b2aa3de6a6c83adb7e0e0108e69bd3 Author: Roger Pau Monné AuthorDate: 2024-03-05 13:15:03 +0000 Commit: Roger Pau Monné CommitDate: 2025-06-25 08:31:14 +0000 x86/xen: fix accounted interrupt time The current addition to the interrupt nesting level in xen_arch_intr_handle_upcall() needs to be compensated in xen_intr_handle_upcall(), otherwise interrupts dispatched by the upcall handler end up seeing a td_intr_nesting_level of 2 or more, which makes them assume there's been an interrupt nesting. Such extra interrupt nesting count lead to statclock() reporting idle time as interrupt, as the call from interrupt context will always be seen as a nested one (td->td_intr_nesting_level >= 2) due to the nesting count increase done by both xen_arch_intr_handle_upcall() and intr_execute_handlers(). Fix this by adjusting the nested interrupt count before dispatching interrupts from xen_intr_handle_upcall(). PR: 277231 Reported by: Matthew Grooms Fixes: af610cabf1f4 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter') Sponsored by: Cloud Software Group Reviewed by: Elliott Mitchell (cherry picked from commit f750dce972efaea614aa6d03ecdb24aa962a38a4) --- sys/dev/xen/bus/xen_intr.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sys/dev/xen/bus/xen_intr.c b/sys/dev/xen/bus/xen_intr.c index db166a625610..62b921d06aea 100644 --- a/sys/dev/xen/bus/xen_intr.c +++ b/sys/dev/xen/bus/xen_intr.c @@ -341,7 +341,7 @@ xen_intr_active_ports(const struct xen_intr_pcpu_data *const pcpu, /** * Interrupt handler for processing all Xen event channel events. * - * \param trap_frame The trap frame context for the current interrupt. + * \param unused */ int xen_intr_handle_upcall(void *unused __unused) @@ -354,6 +354,15 @@ xen_intr_handle_upcall(void *unused __unused) struct xen_intr_pcpu_data *pc; u_long l1, l2; + /* + * The upcall handler is an interrupt handler itself (that calls other + * interrupt handlers), hence the caller has the responsibility to + * increase td_intr_nesting_level ahead of dispatching the upcall + * handler. + */ + KASSERT(curthread->td_intr_nesting_level > 0, + ("Unexpected thread context")); + /* We must remain on the same vCPU during this function */ CRITICAL_ASSERT(curthread); @@ -417,7 +426,17 @@ xen_intr_handle_upcall(void *unused __unused) ("Received unexpected event on vCPU#%u, event bound to vCPU#%u", PCPU_GET(cpuid), isrc->xi_cpu)); + /* + * Reduce interrupt nesting level ahead of calling the + * per-arch interrupt dispatch helper. This is + * required because the per-arch dispatcher will also + * increase td_intr_nesting_level, and then handlers + * would wrongly see td_intr_nesting_level = 2 when + * there's no nesting at all. + */ + curthread->td_intr_nesting_level--; xen_arch_intr_execute_handlers(isrc, trap_frame); + curthread->td_intr_nesting_level++; /* * If this is the final port processed, From nobody Thu Jun 26 02:43:56 2025 X-Original-To: dev-commits-src-branches@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 4bSNL43w37z5yvJT; Thu, 26 Jun 2025 02:43:56 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bSNL42ykcz47qm; Thu, 26 Jun 2025 02:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750905836; 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=hPZz1URHSgS1KRuoVT+sMrI1cNgiqY3W6HEmHMxcQM8=; b=NbMHaHAu3fpDRGRS0aFLpl3SiStbpEgN7O2arfWrbG/EclYLj+6MhNowh57LoRC6RqvCec 34DY+t72lForPJvAk7fbhVqqK2ROqdONrjysWUt4hKEKm6PW3Sn4NkFn4TouEP0cu5e+ow LHtcdiVuYrEUGHFV9G8+J7z4rBDTt9b7jeTYtPgDNjS9nJQzXhnqMjlPG5cyF7ge9w/NqC 4ML+UHqFFJ9OPDoIp1OeOENoY1iNPs1CL0ds4T17N+UavwJ1gjrMF9UAd4a7ok4zSbu+gk MzIw3/y68CFKc1gypFff1Bq0g+0Hc7uNSZQRNIIS9dTqKUyOEso2RC6T07khDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750905836; 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=hPZz1URHSgS1KRuoVT+sMrI1cNgiqY3W6HEmHMxcQM8=; b=uyWuj4qZaxtAiIlQ63aUldHEudyfMT9BfsJC2ruG9ik102VIkAjJfVuErB3NkTOUsOKwz2 eBCOicsBoVZ/aho/9OH4tz/nPOATLS15/ks3EJ0WX2GH+e5Qt30DAGHvYfSUhyKU6iI5Yb S7JhK7l3bvNxjTHHb9aQjfr5KbCvQoNl6Mn2ZkdUm2Xiodp6BLoWcArszXHrzqw07dfRFS lxb/3J/bwnb17upiwJTYTVpyjqjI8K07s8ZKjZB5HnOAPsm427kw87Le0mvVuImDNZ5EeV UP+9X+59/oY8PcPZZVZ2FWlFLZwHOy3Wa8TnBa93XW5Sq0+aZLwNkTDErSMQvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750905836; a=rsa-sha256; cv=none; b=Vl769KKmTUy2i0i+MqILzQ7lqN1D87cE8jmyb0I5ahLLFZ/3OY8RvPKXTK6CjDOnzyyxuK auazx+8tb2sbjP6/Q49Dr7ITp0PTQHPDjeUWIaWg++z5Tlu19AKH9hc6yMHdgoEfp3cmEK J+ryADboDN06e+tUIo4+nTR6AvLds1K40OZXE/oft7ooWmBc88xd1otdRLJi1bnIkYB5wV naWzlgByD/J4YkhJ4ZW4dF+QZ+zkjFO5ajy0mnZ5SSxisbrU9QTg4kbL71x4gieYMCytFB dkhd7pNIBXHLZ0SNmhQ+tGpJcAQrKVwmKMGc9+nHFbKhuC8B6N8CqBUrZ0HGww== 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 4bSNL41YGczlBf; Thu, 26 Jun 2025 02:43:56 +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 55Q2huJY033123; Thu, 26 Jun 2025 02:43:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55Q2huhO033120; Thu, 26 Jun 2025 02:43:56 GMT (envelope-from git) Date: Thu, 26 Jun 2025 02:43:56 GMT Message-Id: <202506260243.55Q2huhO033120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bf73594fe0bd - stable/14 - pmap_growkernel(): do not panic immediately, optionally return the error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bf73594fe0bd3d56b1035478cbbbdf58c05fe80e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bf73594fe0bd3d56b1035478cbbbdf58c05fe80e commit bf73594fe0bd3d56b1035478cbbbdf58c05fe80e Author: Konstantin Belousov AuthorDate: 2024-12-05 20:54:35 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-26 02:39:40 +0000 pmap_growkernel(): do not panic immediately, optionally return the error (cherry picked from commit ef9017aa174db96ee741b936b984f2b5d61dff9f) --- sys/amd64/amd64/pmap.c | 40 +++++++++++++++++++++++++++++-------- sys/arm/arm/pmap-v6.c | 23 ++++++++++++++++++--- sys/arm64/arm64/pmap.c | 26 +++++++++++++++++++----- sys/i386/i386/pmap.c | 6 ++++-- sys/i386/i386/pmap_base.c | 14 +++++++++++-- sys/i386/include/pmap_base.h | 2 +- sys/powerpc/aim/mmu_radix.c | 13 ++++++------ sys/powerpc/include/mmuvar.h | 4 ++-- sys/powerpc/powerpc/pmap_dispatch.c | 19 +++++++++++++++++- sys/riscv/riscv/pmap.c | 26 ++++++++++++++++++++---- sys/vm/pmap.h | 2 +- sys/vm/vm_map.c | 9 +++++++-- 12 files changed, 147 insertions(+), 37 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 1456cee62aeb..8e2c2109e7ad 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -581,6 +581,11 @@ static pml4_entry_t *pti_pml4; static vm_pindex_t pti_pg_idx; static bool pti_finalized; +static int pmap_growkernel_panic = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, growkernel_panic, CTLFLAG_RDTUN, + &pmap_growkernel_panic, 0, + "panic on failure to allocate kernel page table page"); + struct pmap_pkru_range { struct rs_el pkru_rs_el; u_int pkru_keyidx; @@ -5120,17 +5125,19 @@ pmap_page_array_startup(long pages) /* * grow the number of kernel page table entries, if needed */ -void -pmap_growkernel(vm_offset_t addr) +static int +pmap_growkernel_nopanic(vm_offset_t addr) { vm_paddr_t paddr; vm_page_t nkpg; pd_entry_t *pde, newpdir; pdp_entry_t *pdpe; vm_offset_t end; + int rv; TSENTER(); mtx_assert(&kernel_map->system_mtx, MA_OWNED); + rv = KERN_SUCCESS; /* * The kernel map covers two distinct regions of KVA: that used @@ -5158,7 +5165,7 @@ pmap_growkernel(vm_offset_t addr) end = KERNBASE + nkpt * NBPDR; if (end == 0) { TSEXIT(); - return; + return (rv); } } else { end = kernel_vm_end; @@ -5173,7 +5180,7 @@ pmap_growkernel(vm_offset_t addr) * nothing to do. */ TSEXIT(); - return; + return (rv); } kasan_shadow_map(end, addr - end); @@ -5184,8 +5191,10 @@ pmap_growkernel(vm_offset_t addr) nkpg = pmap_alloc_pt_page(kernel_pmap, pmap_pdpe_pindex(end), VM_ALLOC_WIRED | VM_ALLOC_INTERRUPT | VM_ALLOC_ZERO); - if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + if (nkpg == NULL) { + rv = KERN_RESOURCE_SHORTAGE; + break; + } paddr = VM_PAGE_TO_PHYS(nkpg); *pdpe = (pdp_entry_t)(paddr | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M); @@ -5203,8 +5212,11 @@ pmap_growkernel(vm_offset_t addr) nkpg = pmap_alloc_pt_page(kernel_pmap, pmap_pde_pindex(end), VM_ALLOC_WIRED | VM_ALLOC_INTERRUPT | VM_ALLOC_ZERO); - if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + if (nkpg == NULL) { + rv = KERN_RESOURCE_SHORTAGE; + break; + } + paddr = VM_PAGE_TO_PHYS(nkpg); newpdir = paddr | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; pde_store(pde, newpdir); @@ -5221,6 +5233,18 @@ pmap_growkernel(vm_offset_t addr) else nkpt = howmany(end - KERNBASE, NBPDR); TSEXIT(); + return (rv); +} + +int +pmap_growkernel(vm_offset_t addr) +{ + int rv; + + rv = pmap_growkernel_nopanic(addr); + if (rv != KERN_SUCCESS && pmap_growkernel_panic) + panic("pmap_growkernel: no memory to grow kernel"); + return (rv); } /*************************************************** diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 5cccb44a48f2..95aeba201e4a 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -1561,6 +1561,11 @@ static int sp_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0, "Are large page mappings enabled?"); +static int pmap_growkernel_panic = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, growkernel_panic, CTLFLAG_RDTUN, + &pmap_growkernel_panic, 0, + "panic on failure to allocate kernel page table page"); + bool pmap_ps_enabled(pmap_t pmap __unused) { @@ -2017,8 +2022,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) /* * Grow the number of kernel L2 page table entries, if needed. */ -void -pmap_growkernel(vm_offset_t addr) +static int +pmap_growkernel_nopanic(vm_offset_t addr) { vm_page_t m; vm_paddr_t pt2pg_pa, pt2_pa; @@ -2071,7 +2076,7 @@ pmap_growkernel(vm_offset_t addr) m = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (m == NULL) - panic("%s: no memory to grow kernel", __func__); + return (KERN_RESOURCE_SHORTAGE); m->pindex = pte1_index(kernel_vm_end) & ~PT2PG_MASK; /* @@ -2096,6 +2101,18 @@ pmap_growkernel(vm_offset_t addr) break; } } + return (KERN_SUCCESS); +} + +int +pmap_growkernel(vm_offset_t addr) +{ + int rv; + + rv = pmap_growkernel_nopanic(addr); + if (rv != KERN_SUCCESS && pmap_growkernel_panic) + panic("pmap_growkernel: no memory to grow kernel"); + return (rv); } static int diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a5d037d7b71c..ef33a7339b9e 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -347,6 +347,11 @@ static u_int physmap_idx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "VM/pmap parameters"); +static int pmap_growkernel_panic = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, growkernel_panic, CTLFLAG_RDTUN, + &pmap_growkernel_panic, 0, + "panic on failure to allocate kernel page table page"); + #if PAGE_SIZE == PAGE_SIZE_4K #define L1_BLOCKS_SUPPORTED 1 #else @@ -2700,8 +2705,8 @@ SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, /* * grow the number of kernel page table entries, if needed */ -void -pmap_growkernel(vm_offset_t addr) +static int +pmap_growkernel_nopanic(vm_offset_t addr) { vm_paddr_t paddr; vm_page_t nkpg; @@ -2724,8 +2729,7 @@ pmap_growkernel(vm_offset_t addr) /* We need a new PDP entry */ nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); - if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = kernel_vm_end >> L1_SHIFT; /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); @@ -2746,7 +2750,7 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = kernel_vm_end >> L2_SHIFT; /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); @@ -2759,6 +2763,18 @@ pmap_growkernel(vm_offset_t addr) break; } } + return (KERN_SUCCESS); +} + +int +pmap_growkernel(vm_offset_t addr) +{ + int rv; + + rv = pmap_growkernel_nopanic(addr); + if (rv != KERN_SUCCESS && pmap_growkernel_panic) + panic("pmap_growkernel: no memory to grow kernel"); + return (rv); } /*************************************************** diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 828e39b58cac..90ea6e3459cf 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -2233,7 +2233,7 @@ __CONCAT(PMTYPE, release)(pmap_t pmap) /* * grow the number of kernel page table entries, if needed */ -static void +static int __CONCAT(PMTYPE, growkernel)(vm_offset_t addr) { vm_paddr_t ptppaddr; @@ -2257,7 +2257,7 @@ __CONCAT(PMTYPE, growkernel)(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = kernel_vm_end >> PDRSHIFT; nkpt++; @@ -2272,6 +2272,8 @@ __CONCAT(PMTYPE, growkernel)(vm_offset_t addr) break; } } + + return (KERN_SUCCESS); } /*************************************************** diff --git a/sys/i386/i386/pmap_base.c b/sys/i386/i386/pmap_base.c index 50229ee40caa..c3aa0f381763 100644 --- a/sys/i386/i386/pmap_base.c +++ b/sys/i386/i386/pmap_base.c @@ -111,6 +111,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, #include #include #include +#include #include #include @@ -254,6 +255,11 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, "Current number of spare pv entries"); #endif +static int pmap_growkernel_panic = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, growkernel_panic, CTLFLAG_RDTUN, + &pmap_growkernel_panic, 0, + "panic on failure to allocate kernel page table page"); + struct pmap kernel_pmap_store; static struct pmap_methods *pmap_methods_ptr; @@ -895,11 +901,15 @@ pmap_init_pat(void) pmap_methods_ptr->pm_init_pat(); } -void +int pmap_growkernel(vm_offset_t addr) { + int rv; - pmap_methods_ptr->pm_growkernel(addr); + rv = pmap_methods_ptr->pm_growkernel(addr); + if (rv != KERN_SUCCESS && pmap_growkernel_panic) + panic("pmap_growkernel: no memory to grow kernel"); + return (rv); } void diff --git a/sys/i386/include/pmap_base.h b/sys/i386/include/pmap_base.h index f346e3bb9532..f10aae64f90b 100644 --- a/sys/i386/include/pmap_base.h +++ b/sys/i386/include/pmap_base.h @@ -107,7 +107,7 @@ struct pmap_methods { void (*pm_remove_all)(vm_page_t); void (*pm_init)(void); void (*pm_init_pat)(void); - void (*pm_growkernel)(vm_offset_t); + int (*pm_growkernel)(vm_offset_t); void (*pm_invalidate_page)(pmap_t, vm_offset_t); void (*pm_invalidate_range)(pmap_t, vm_offset_t, vm_offset_t); void (*pm_invalidate_all)(pmap_t); diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 038be6fa828d..a15f686d88fe 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -480,7 +480,7 @@ static void mmu_radix_bootstrap(vm_offset_t, vm_offset_t); static void mmu_radix_copy_page(vm_page_t, vm_page_t); static void mmu_radix_copy_pages(vm_page_t *ma, vm_offset_t a_offset, vm_page_t *mb, vm_offset_t b_offset, int xfersize); -static void mmu_radix_growkernel(vm_offset_t); +static int mmu_radix_growkernel(vm_offset_t); static void mmu_radix_init(void); static int mmu_radix_mincore(pmap_t, vm_offset_t, vm_paddr_t *); static vm_offset_t mmu_radix_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int); @@ -501,7 +501,7 @@ static struct pmap_funcs mmu_radix_methods = { .copy_page = mmu_radix_copy_page, .copy_pages = mmu_radix_copy_pages, .cpu_bootstrap = mmu_radix_cpu_bootstrap, - .growkernel = mmu_radix_growkernel, + .growkernel_nopanic = mmu_radix_growkernel, .init = mmu_radix_init, .map = mmu_radix_map, .mincore = mmu_radix_mincore, @@ -3512,7 +3512,7 @@ mmu_radix_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) return (m); } -static void +static int mmu_radix_growkernel(vm_offset_t addr) { vm_paddr_t paddr; @@ -3523,7 +3523,7 @@ mmu_radix_growkernel(vm_offset_t addr) CTR2(KTR_PMAP, "%s(%#x)", __func__, addr); if (VM_MIN_KERNEL_ADDRESS < addr && addr < (VM_MIN_KERNEL_ADDRESS + nkpt * L3_PAGE_SIZE)) - return; + return (KERN_SUCCESS); addr = roundup2(addr, L3_PAGE_SIZE); if (addr - 1 >= vm_map_max(kernel_map)) @@ -3535,7 +3535,7 @@ mmu_radix_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = kernel_vm_end >> L2_PAGE_SIZE_SHIFT; paddr = VM_PAGE_TO_PHYS(nkpg); pde_store(l2e, paddr); @@ -3554,7 +3554,7 @@ mmu_radix_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = pmap_l3e_pindex(kernel_vm_end); paddr = VM_PAGE_TO_PHYS(nkpg); pde_store(l3e, paddr); @@ -3566,6 +3566,7 @@ mmu_radix_growkernel(vm_offset_t addr) } } ptesync(); + return (KERN_SUCCESS); } static MALLOC_DEFINE(M_RADIX_PGD, "radix_pgd", "radix page table root directory"); diff --git a/sys/powerpc/include/mmuvar.h b/sys/powerpc/include/mmuvar.h index 4355aa7159fc..f39c7699fd37 100644 --- a/sys/powerpc/include/mmuvar.h +++ b/sys/powerpc/include/mmuvar.h @@ -60,7 +60,7 @@ typedef void (*pmap_enter_object_t)(pmap_t, vm_offset_t, vm_offset_t, typedef void (*pmap_enter_quick_t)(pmap_t, vm_offset_t, vm_page_t, vm_prot_t); typedef vm_paddr_t (*pmap_extract_t)(pmap_t, vm_offset_t); typedef vm_page_t (*pmap_extract_and_hold_t)(pmap_t, vm_offset_t, vm_prot_t); -typedef void (*pmap_growkernel_t)(vm_offset_t); +typedef int (*pmap_growkernel_nopanic_t)(vm_offset_t); typedef void (*pmap_init_t)(void); typedef boolean_t (*pmap_is_modified_t)(vm_page_t); typedef boolean_t (*pmap_is_prefaultable_t)(pmap_t, vm_offset_t); @@ -130,7 +130,7 @@ struct pmap_funcs { pmap_enter_quick_t enter_quick; pmap_extract_t extract; pmap_extract_and_hold_t extract_and_hold; - pmap_growkernel_t growkernel; + pmap_growkernel_nopanic_t growkernel_nopanic; pmap_init_t init; pmap_is_modified_t is_modified; pmap_is_prefaultable_t is_prefaultable; diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c index 3f1ac937433f..59a12ead8a37 100644 --- a/sys/powerpc/powerpc/pmap_dispatch.c +++ b/sys/powerpc/powerpc/pmap_dispatch.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -85,6 +86,11 @@ int superpages_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, CTLFLAG_RDTUN, &superpages_enabled, 0, "Enable support for transparent superpages"); +static int pmap_growkernel_panic = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, growkernel_panic, CTLFLAG_RDTUN, + &pmap_growkernel_panic, 0, + "panic on failure to allocate kernel page table page"); + #ifdef AIM int pvo_vaddr_compare(struct pvo_entry *a, struct pvo_entry *b) @@ -161,7 +167,7 @@ DEFINE_PMAP_IFUNC(void, copy_page, (vm_page_t, vm_page_t)); DEFINE_PMAP_IFUNC(void, copy_pages, (vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize)); -DEFINE_PMAP_IFUNC(void, growkernel, (vm_offset_t)); +DEFINE_PMAP_IFUNC(int, growkernel_nopanic, (vm_offset_t)); DEFINE_PMAP_IFUNC(void, init, (void)); DEFINE_PMAP_IFUNC(vm_offset_t, map, (vm_offset_t *, vm_paddr_t, vm_paddr_t, int)); DEFINE_PMAP_IFUNC(int, pinit, (pmap_t)); @@ -259,3 +265,14 @@ pmap_active_cpus(pmap_t pmap, cpuset_t *res) { *res = pmap->pm_active; } + +int +pmap_growkernel(vm_offset_t addr) +{ + int rv; + + rv = pmap_growkernel_nopanic(addr); + if (rv != KERN_SUCCESS && pmap_growkernel_panic) + panic("pmap_growkernel: no memory to grow kernel"); + return (rv); +} diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index d936cab09dbb..4812f3274e69 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -240,6 +240,11 @@ vm_paddr_t dmap_phys_base; /* The start of the dmap region */ vm_paddr_t dmap_phys_max; /* The limit of the dmap region */ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ +static int pmap_growkernel_panic = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, growkernel_panic, CTLFLAG_RDTUN, + &pmap_growkernel_panic, 0, + "panic on failure to allocate kernel page table page"); + /* This code assumes all L1 DMAP entries will be used */ CTASSERT((DMAP_MIN_ADDRESS & ~L1_OFFSET) == DMAP_MIN_ADDRESS); CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS); @@ -1657,8 +1662,8 @@ SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_MPSAFE, /* * grow the number of kernel page table entries, if needed */ -void -pmap_growkernel(vm_offset_t addr) +static int +pmap_growkernel_nopanic(vm_offset_t addr) { vm_paddr_t paddr; vm_page_t nkpg; @@ -1678,7 +1683,7 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = kernel_vm_end >> L1_SHIFT; paddr = VM_PAGE_TO_PHYS(nkpg); @@ -1704,7 +1709,7 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); + return (KERN_RESOURCE_SHORTAGE); nkpg->pindex = kernel_vm_end >> L2_SHIFT; paddr = VM_PAGE_TO_PHYS(nkpg); @@ -1721,6 +1726,19 @@ pmap_growkernel(vm_offset_t addr) break; } } + + return (KERN_SUCCESS); +} + +int +pmap_growkernel(vm_offset_t addr) +{ + int rv; + + rv = pmap_growkernel_nopanic(addr); + if (rv != KERN_SUCCESS && pmap_growkernel_panic) + panic("pmap_growkernel: no memory to grow kernel"); + return (rv); } /*************************************************** diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index 65e909df9b8f..4f25a386d63a 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -138,7 +138,7 @@ void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va); vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot); -void pmap_growkernel(vm_offset_t); +int pmap_growkernel(vm_offset_t); void pmap_init(void); boolean_t pmap_is_modified(vm_page_t m); boolean_t pmap_is_prefaultable(pmap_t pmap, vm_offset_t va); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 28cf309f86c3..cf028c0c47ef 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1719,8 +1719,13 @@ vm_map_insert1(vm_map_t map, vm_object_t object, vm_ooffset_t offset, charged: /* Expand the kernel pmap, if necessary. */ - if (map == kernel_map && end > kernel_vm_end) - pmap_growkernel(end); + if (map == kernel_map && end > kernel_vm_end) { + int rv; + + rv = pmap_growkernel(end); + if (rv != KERN_SUCCESS) + return (rv); + } if (object != NULL) { /* * OBJ_ONEMAPPING must be cleared unless this mapping From nobody Fri Jun 27 07:38:16 2025 X-Original-To: dev-commits-src-branches@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 4bT6qF1Cthz60Qkt; Fri, 27 Jun 2025 07:38:17 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6qF0GnGz3wbb; Fri, 27 Jun 2025 07:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009897; 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=AWvdYrFNC5+mxKBu2bZlqC4qU+khqoky0fOQDhNlo3U=; b=xgqkhIhz3j+gJXMUUUI53ajTMM8FAPz/t4PM8y7dq4AgsQnEUaZ65Zr6LS7vNkpae3j2yv CTDSKypfELLgk/t5UbFdxmqjOL0VGU3KWuIDKB2+t4pPq+h2JmmPflMMISN9b9BuRh2XGx A374o4bs9YbZYQuFxj/tz3sa8AEN9XawkfQtBZPE2Cbe4vXIEPQSDG2urVg8SXom4JpbU2 YDmkdzDvbHDzwETekFUNn8jeYVCvCxHq+wueRfpRoaOBuBL/sj/2tFxcGWz22fQdOMhc5e Uqntjat879IhTZNxUgryAYSR7xZGMTxtMhsSqf2ensYx33YS3RmGTrnfEOPN0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009897; 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=AWvdYrFNC5+mxKBu2bZlqC4qU+khqoky0fOQDhNlo3U=; b=TJQ6O0U7EanUxWKYMvyyljjylnsjcscxYZkNQEjEwY8uQnO871UMI7wtwmNVXSmMYU4lOS nixxj8gLCm0jCK4ZMtAVyqJShN/o4bdQSew/DmSeDMfQPMsdTAqvKmra6njbR4jRYl6C8w K7y1q2SlOZVc5YKbdvlAya77xw1vCU0W1diyGlAS1eDH0oNc6WI8ldrcsBBzlIr12D9PDG oWw0W3bwaOsRdWOT/2VQiVMeaHRlLbGmLkzY84DE7XzTM0W5+Zr3D0MSAAqTz07cM7lzSn iM23hgjMZbHiWjmubj7xurafZPT5MHyU8LGtV+2gIpN8poiZCQhjnoUy3/WTAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751009897; a=rsa-sha256; cv=none; b=kdaq+A3d3B5sVEEe2tAnFF0p8mL+P8gFvykKWgYAGrJAbLpZIRIrr9k+W7dyy6Ylrj6io2 mIpPPQ7aaVP+zlGcUeeSRXnbn69081yJffF/qUKxcmEx/rU4W7XGIAgxm3bac+LbgA4nD5 gjLUfVaSdrrCbcPA6LN+OQ9N2fdJrS3dRBUz8KVrQJX492i3KFKhvglcDL/1lF2rN9qWKr PSSz7XCKAQEThM3KwC5wKZ9ZQ7xC8lUHM3I0rQpchpQszq/3rJD2kN31hXWOAOZhRhSL96 kJ7xSqnuvN/XYV3yVnS4Wb721QqYYis6fmII8EuTavGFVvwIfddhR78LxGqTjw== 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 4bT6qD6hp5zg7N; Fri, 27 Jun 2025 07:38:16 +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 55R7cGTS089451; Fri, 27 Jun 2025 07:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7cGIK089448; Fri, 27 Jun 2025 07:38:16 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:38:16 GMT Message-Id: <202506270738.55R7cGIK089448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 17ee60307cc9 - stable/14 - OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 17ee60307cc91375192820e9a1b835508aef13ba Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=17ee60307cc91375192820e9a1b835508aef13ba commit 17ee60307cc91375192820e9a1b835508aef13ba Author: Andriy Gapon AuthorDate: 2025-05-19 09:23:29 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:37:55 +0000 OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM Just like powerd daemon does not depend on ACPI/APM, its rc script does not either. Fixes: 20eb6bd8c598f (cherry picked from commit 28d74f18f1c222022ee4e9a2cdc63b1c21037392) --- tools/build/mk/OptionalObsoleteFiles.inc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 3b8c0c1dff55..3e78ca88d75e 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -55,10 +55,6 @@ OLD_FILES+=usr/share/man/man8/acpidump.8.gz OLD_FILES+=usr/share/man/man8/iasl.8.gz .endif -.if ${MK_ACPI} == no && ${MK_APM} == no -OLD_FILES+=etc/rc.d/powerd -.endif - .if ${MK_APM} == no OLD_FILES+=etc/rc.d/apm OLD_FILES+=etc/rc.d/apmd From nobody Fri Jun 27 07:38:17 2025 X-Original-To: dev-commits-src-branches@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 4bT6qG3gq0z60QjS; Fri, 27 Jun 2025 07:38:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6qG05rlz3wgR; Fri, 27 Jun 2025 07:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009898; 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=5cm2ZZ864M2fxu+dbtamQitDsxuhcXcB+yjzQeQhZvs=; b=i0HVT4j6sfEiK36Omx1w80bJvXUK3Gd5Yn/i2cxv5zlnewV+vwNdP3/Ifmk+P3hhIqsqN0 jy5EPCjv9MjsMapJkXaFwz/I9/Sw9toJ7O9g5CtMTaaIO7W2Ogae2uV1+dP1WhrKDF6ZtQ eA6rQY8UIc7LaSZZJPV2ieBc7N7SXZLl6UslAEKPMK9Pv2pFOjm6npvj268vFrqIvjEkfi 28w0M7CGbk9DqIzZRdzNB9aB6i3kr+1l7w3PxL6mnLxyJsAhkNbf5EOW+WoTRzGLGDbxrH 1bmN1RpSnFXxjvWbs95wxt/YUq/sOdZ1W2H7wB1gujzq+XT1nHwkixu9QWEH0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009898; 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=5cm2ZZ864M2fxu+dbtamQitDsxuhcXcB+yjzQeQhZvs=; b=v9ze2uX2sB8qMxfchVTgyXsaG8B3ldb5GcTan1NkxsxYc/CTGYtwom3uBc3fWEb2PbcG07 yZNwCzqs7Jb8BKu7TQrRKDdxKPxwzilQH1Jo9yd7mWNAUpkVYgH+SOK5sqI9m7RXeRUBat uV/r1NSToo3nxX3PQo/W4+i5hCOP3M8WSKdkVrlQLLeRtWtJdWryKyAxJyMTJRWUZaszXn AC/llDCOD4nc8Nh/dIkxKv9xQ3q+k95cFn1GFQWG8Ur+bV5sk9ZJTs6Th9a9W3QZkC9d/R F+6fVLdjPdDKkklwMoto5uySFcOPNAMPE+O4nXnh7V1wms9THPBtSxriLaDMGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751009898; a=rsa-sha256; cv=none; b=wANyKiaaMpSGWtj2AL7jyxHgn3bugwN0J8x1r5IhqzeZG1P+A7Yd3UpvfQNMZo44GRdVUA pttdxtAIiFK2kG0bI2d8mnoSoxpHMx8Q6sZD9HHNdKfUQLjtAxUjnKTldn2ZSlJYZz4RiZ EgAR31wonFvRXoTWk/aLmpBKy58z8QiRIk9kVzQw6Va3FqgnsB+Qe5B2m8JfEKHI98uHuC 5Lz6oEBuwG6JljqU0VTx3gair+F+3KD5RAjBDP3kndEOwi0hUu40bozorZJRkbHsDF4vlS Pd5Ey6hEgBwH4C2apUDJLTSi6hlL8Bknil0AjO/zPB2G7RoWlr9NPkW7YxYHxA== 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 4bT6qF6gWDzg7P; Fri, 27 Jun 2025 07:38:17 +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 55R7cHoS089483; Fri, 27 Jun 2025 07:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7cH2i089480; Fri, 27 Jun 2025 07:38:17 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:38:17 GMT Message-Id: <202506270738.55R7cH2i089480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 19fdd9fd613d - stable/14 - dwc_otg_fdt: do not create and leak extra usbus child List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 19fdd9fd613d2a0b7bfb19ad3d3b96a54c04a4b7 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=19fdd9fd613d2a0b7bfb19ad3d3b96a54c04a4b7 commit 19fdd9fd613d2a0b7bfb19ad3d3b96a54c04a4b7 Author: Andriy Gapon AuthorDate: 2025-05-19 09:06:55 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:37:55 +0000 dwc_otg_fdt: do not create and leak extra usbus child dwc_otg_init() already takes care of creating the bus and setting up sc to point to it. Fixes: 518da7ace813e (cherry picked from commit 97c799661a76b78963fd9f92a7e6bb452ebba999) --- sys/dev/usb/controller/dwc_otg_fdt.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/usb/controller/dwc_otg_fdt.c b/sys/dev/usb/controller/dwc_otg_fdt.c index 1ef36ab830ed..ce76f088a981 100644 --- a/sys/dev/usb/controller/dwc_otg_fdt.c +++ b/sys/dev/usb/controller/dwc_otg_fdt.c @@ -141,10 +141,6 @@ dwc_otg_attach(device_t dev) if (sc->sc_otg.sc_irq_res == NULL) goto error; - sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (sc->sc_otg.sc_bus.bdev == NULL) - goto error; - err = dwc_otg_init(&sc->sc_otg); if (err == 0) { err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev); From nobody Fri Jun 27 07:38:18 2025 X-Original-To: dev-commits-src-branches@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 4bT6qH4DxBz60Qqp; Fri, 27 Jun 2025 07:38:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6qH1NwPz3wd1; Fri, 27 Jun 2025 07:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009899; 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=H316SUTnbNkU/8EcOoV2TQNOWLSduMfe6VIvKL2YRuY=; b=Gr5zu6GLXESzJf3Eoj+FJo/jjaXNGHYOC+/pS0tUTo+dHqNQY5j9OL5g9lxIeKgBdrgu+M dCj8F4U/JsvtHwvaf5dofUJiLr1GxAo8DrP1DAb8/9Ocmlq4FEYKfEyDshzO/rwfQ0dld4 rDqyPjdpn8AskbqllF0VRNXEN+brdfL1Rt3bB7XQoWXdgwH3wLs63fQeiLw6MeULE3VyrL V2uJNmxVaM/sNBSrafypp+oQTDYMG/Hl9sSmjUrNYEA8lEDArIX/fIX4O9QxUHJDSOI3/P gU0xOnm3Y+vEOZf8TQy2uGpHU0XleClzEy13unMnxzgQXY6vKeHM91vpwVy+vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009899; 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=H316SUTnbNkU/8EcOoV2TQNOWLSduMfe6VIvKL2YRuY=; b=OJqXlcLBvJe1+35QeUX4tgbHSDkEFlFvDW8Xgut5AxuaZTdjwuh1miQh6YcnLfwMWeIvIH 3VbrcPfskF6DmOmPUL690+ekDr9L0JKeyxgm3/Pkti2lQOX0moRvam/Be+9Z0zeMsrTPAY KElcsrrFPe8OkS7r6v0v0Jjt7bvUaRUvRH0CAInV/dd1qMFIgN+YzTn7A0iZ7JUZ47JfRP jWaI3b4upRIR5nOcFseTnwzRAcVecTNNc96XKxJjdpDYvF/yYdqm27MeTptF6rdq7GOFbr KcM2LXr4Fi0nXuHvFQ1uU1BzLxv+TAzWpHN03t33lZoNANi25AJFpYEl4KCkrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751009899; a=rsa-sha256; cv=none; b=ZisWkiV9n1FzE1At+i4kR3qVXL2azW4ztRo3UsIsB71Q1OK9/i4r9KNXgTMaCSKdSj0Y0U A5n/gtTm8vELJ+SiyFrontmvWNvIVhRGwWQIuySF4LS/tKQhfVN4iSIRYBC5XFZqcAHcAF M2L4YbnYZFt4OKxb6evtU0m3H1GHMFcKF7+rload93mtXULkFTpQW1VZN7Nxll6fzv+gLi cimVjB/C2LlzYOW0GLZCd/jX7ZFH8AhFHbRewmqHJWebXIcFxOTzlbDlDDtD54aTKwssY0 Rozu+mIct9dVJqcuU23SGhp91KZ7LRY72Pgzn5xf7DnK7B1Ru2qeyOXg2voqiQ== 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 4bT6qH03HNzg7Q; Fri, 27 Jun 2025 07:38:19 +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 55R7cIxr089521; Fri, 27 Jun 2025 07:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7cIl5089518; Fri, 27 Jun 2025 07:38:18 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:38:18 GMT Message-Id: <202506270738.55R7cIl5089518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: b4e40a47d379 - stable/14 - ads111x: initialize the lock earlier, before it's used List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b4e40a47d37939713196a2530b4759a7a8e11148 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=b4e40a47d37939713196a2530b4759a7a8e11148 commit b4e40a47d37939713196a2530b4759a7a8e11148 Author: Andriy Gapon AuthorDate: 2025-03-30 19:47:50 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:37:55 +0000 ads111x: initialize the lock earlier, before it's used The first use can be in ads111x_add_channels. (cherry picked from commit eda3a7ac755c5e02f92ff971db63d0a702963d66) --- sys/dev/iicbus/adc/ads111x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/iicbus/adc/ads111x.c b/sys/dev/iicbus/adc/ads111x.c index dd223f69bb5f..21924627cc68 100644 --- a/sys/dev/iicbus/adc/ads111x.c +++ b/sys/dev/iicbus/adc/ads111x.c @@ -559,6 +559,8 @@ ads111x_attach(device_t dev) return (err); } + sx_init(&sc->lock, "ads111x"); + /* Add the sysctl handler to set the chip configuration register. */ ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); @@ -575,8 +577,6 @@ ads111x_attach(device_t dev) /* Set up channels based on metadata or default config. */ ads111x_add_channels(sc); - sx_init(&sc->lock, "ads111x"); - return (0); } From nobody Fri Jun 27 07:38:20 2025 X-Original-To: dev-commits-src-branches@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 4bT6qJ5xPhz60Qky; Fri, 27 Jun 2025 07:38:20 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6qJ1rqqz3wlp; Fri, 27 Jun 2025 07:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009900; 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=JDwoYWhOAUypXCt18TCyJWjaudbDaRUFgcv+efVWPCU=; b=W7s1SXLb1wvBFcZ1IU9pF8k76jjtZmIPhfUdKkRM7vCTtF/YtoCVpabhlJE5SN0GTugm4E cxIvILG1EAkV4WiiN2RaXL9VB90elEynkW5qkxulbSS/jnQ3raSy/6S16xRjRAozW9ijJo ZJgdCFpm0IV7H5WFmsQLpe3YQccqiTgp9tfUmznYiMHSvcOF9bHzqzaYxY7ue/x2TVISjg s7xKcr0iipZ5STR/DsxztFRHz6c34M8QoykS3N+rqseCoJMW0/TUmi3HRJ8ftjWixvgSuN vhYu6sAIgH5gBZQD/nouef2S5Q1CPW95CXKT1TMjDVVfMGzkkeD/Mr98ZXsDOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009900; 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=JDwoYWhOAUypXCt18TCyJWjaudbDaRUFgcv+efVWPCU=; b=jRNGcN/k1d3aR2gzoaG/drjYIy6Pgc/t/FlOT7b8kOx4S0N4e0lvBJo7VbdQK/nvAbfXsh HZDytOlHQK8Uh2B3jdJqOJFpRoeewxUqti7+7qnhoda7T4Z0D15yawHlMVfQG09es+ievi 1HcJ1ChuUMTpvTyJutZIUedFLWbmjLbsmG3QqdELtjXIp81rt32t8SEK0LaC9ye5VIGv9W uQsvfRIi4PDKvjma+TUB9Ivru3GYG7XWA8NB6m1qIg6u8z7ivRnniZCcxOYDKHt35Kk8GJ Oap0vRdn9QqdSGRyIX7SgzLfq7/N7ZpfK6ltKF3OPzVyf6P80qpJy2R5TTLFzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751009900; a=rsa-sha256; cv=none; b=x/jLnngEUJNjIm+X5E5uCm/r8lbWF+bpaQwA+OfqfNuuUT+gzT/JlmEpq8pZpuQrZRAUQC 0t7A1ICDI+8xjEdRJ385dujXFmpoXuFNYF3ewgzVHb4CGw/rN2uPQZquRHVtykprVltYnm n4hWRvTEUcJMky+UulWn8fOoB1cDKFkvFFHyXHoYPk/A83YO/dBa35ClUB+V4urdaqriAk g3ZDSBQynf4H/BaWdc3MLbDIGxvW2og9KM65ka6F7Sgtc64NO7/rKys0QbFXGMjwB+k2Ay RxP4Lnh9GIyHtvWZAn1ubiWOyEMWSJwSgalAlyMaqTLiGDFwy9rk5n33sogsDg== 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 4bT6qJ10Nwzg7R; Fri, 27 Jun 2025 07:38:20 +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 55R7cKLw089554; Fri, 27 Jun 2025 07:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7cK1V089551; Fri, 27 Jun 2025 07:38:20 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:38:20 GMT Message-Id: <202506270738.55R7cK1V089551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: ce773fbaec9b - stable/14 - rk_i2s: correct some bit-field definitions, add more bits List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce773fbaec9b4fd790803ce253232405bee89f91 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ce773fbaec9b4fd790803ce253232405bee89f91 commit ce773fbaec9b4fd790803ce253232405bee89f91 Author: Andriy Gapon AuthorDate: 2021-09-24 17:05:22 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:37:55 +0000 rk_i2s: correct some bit-field definitions, add more bits (cherry picked from commit 3fc4ddb0151d1a4fec5ba6c878f4b8afc6aa83b8) --- sys/arm64/rockchip/rk_i2s.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/arm64/rockchip/rk_i2s.c b/sys/arm64/rockchip/rk_i2s.c index 2ec7d21ad7e8..e7fe8eb46a07 100644 --- a/sys/arm64/rockchip/rk_i2s.c +++ b/sys/arm64/rockchip/rk_i2s.c @@ -92,16 +92,20 @@ #define TXFIFO0LR_MASK 0x3f #define I2S_DMACR 0x0010 #define I2S_DMACR_RDE_ENABLE (1 << 24) -#define I2S_DMACR_RDL(n) ((n) << 16) +#define I2S_DMACR_RDL(n) (((n) - 1) << 16) #define I2S_DMACR_TDE_ENABLE (1 << 8) #define I2S_DMACR_TDL(n) ((n) << 0) #define I2S_INTCR 0x0014 #define I2S_INTCR_RFT(n) (((n) - 1) << 20) -#define I2S_INTCR_TFT(n) (((n) - 1) << 4) +#define I2S_INTCR_TFT(n) ((n) << 4) +#define I2S_INTCR_RXOIC (1 << 18) +#define I2S_INTCR_RXOIE (1 << 17) #define I2S_INTCR_RXFIE (1 << 16) #define I2S_INTCR_TXUIC (1 << 2) +#define I2S_INTCR_TXUIE (1 << 1) #define I2S_INTCR_TXEIE (1 << 0) #define I2S_INTSR 0x0018 +#define I2S_INTSR_RXOI (1 << 17) #define I2S_INTSR_RXFI (1 << 16) #define I2S_INTSR_TXUI (1 << 1) #define I2S_INTSR_TXEI (1 << 0) From nobody Fri Jun 27 07:38:21 2025 X-Original-To: dev-commits-src-branches@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 4bT6qK6DkDz60Qqr; Fri, 27 Jun 2025 07:38:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6qK3225z3wm5; Fri, 27 Jun 2025 07:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009901; 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=6NHBaDPfwPAm8xvIyoUDC09y9+7HlErdrqSXjXkTOso=; b=vpIM6wrcYZOdiRRTz+9eBaSSJokPkg8Z24BnjQtz7dkhJcX+5GN2LxnQqLf1c/i7Vx0qcb nPBw87EXL1P0djNa6HY6OlGe4lBeqSb95LPMlPVjG+sVk2WpUlFbTuNkt/rtHb40whIwxc 0pnk/WZQDzjoXNHDXX4ERpUyjRPwFSzadp2vMs7CKA3p9ni79jT/IM826EWwRuKbF36//C u/VxzcOz0Mbn9KH1Y7Zz8CgLJRyUpQobQmmwsBLzfeEU4cCjcUg3hAr/RNwHD6ZWyohDFe 2dp8CR23UEbDvyra8EDxJLP5GZoN/iDHhI2FlXSTeDHAon6DTl6j+GC7vWngIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751009901; 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=6NHBaDPfwPAm8xvIyoUDC09y9+7HlErdrqSXjXkTOso=; b=kSXWxYdNJif3kFBrJFjqVSPlk5HcXzukV32obTi4kmsSfwM+i9EW92inF1b4ViCFwxiTnI I5NKheeJG2LR9IPRvzJB3Ie5gldu+dfukwZd0u306ryZaQbl/fg5NvCNZtkcG+bYscfhZ8 3eJh12KNUy4tVHNfB63PKuDfkhNmRblRH49RuJplws3pbYpI7pHESi77jvJAPufDHbs/Dd XTwetDHiT2XBfs4fIh+alCIth7DiHcYs5yEXDgguObBlcf7JIhfuMjh9D3vSlucM67mS6i CGWLgJAc5GL+WPHJM3Rv86PAbSaQmIYebnXBxUViEbOsT+xJ7WCA5z5eeh2ogw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751009901; a=rsa-sha256; cv=none; b=sQQo2ahTlXIV4I2huOPU3aAOLCmofb1asv4tki97DaUor8oBHOaYc5Fgu6eRmhOKIj33+C T/4eWqMesJDJwpuMPAmA4CGRII4dJDZoNc3AUkKHWNwzCdXnMoQBYvo0vKhIWG8JE+jMsT iOThMEd8kfBxI9ENHlH9GJ7NnG4LSTPZ6101SbE7pAp+wmBXfubLD+/GTkeiyS1gCnmTe0 fZ9Cm5OVXyZYEuZ1O3LSlyWc8xl8yv9R5M7Gsms+WOE5d7x7V02TxsGiGaRbTeS/qec7Pa TwAamVFmWdjVaHBX+DSi1ZHHQrMtLa8ucN+gr7oj9deKk/uXdA2SxcUXbJs8Yg== 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 4bT6qK1z1lzfcd; Fri, 27 Jun 2025 07:38:21 +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 55R7cLCV089587; Fri, 27 Jun 2025 07:38:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7cLF6089584; Fri, 27 Jun 2025 07:38:21 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:38:21 GMT Message-Id: <202506270738.55R7cLF6089584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: ec88c4841385 - stable/14 - ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec88c48413850768692a92736229e85b5d262935 Auto-Submitted: auto-generated The branch stable/14 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=ec88c48413850768692a92736229e85b5d262935 commit ec88c48413850768692a92736229e85b5d262935 Author: Andriy Gapon AuthorDate: 2024-11-10 11:15:30 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:37:55 +0000 ns8250: use LSR_THRE instead of LSR_TEMT for checking tx flush LSR_TEMT bit is set if both transmit hold and shift registers are empty, but the flush command flushes only the hold register. While here, update the diagnostic message to report which registers could not be flushed. (cherry picked from commit 0d2fd5b99c95329085d0700a4dd38507a054a50d) --- sys/dev/uart/uart_dev_ns8250.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index ced3b44b5749..b73838b7d2b2 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -230,12 +230,12 @@ ns8250_flush(struct uart_bas *bas, int what) * https://github.com/rust-vmm/vm-superio/issues/83 */ lsr = uart_getreg(bas, REG_LSR); - if (((lsr & LSR_TEMT) == 0) && (what & UART_FLUSH_TRANSMITTER)) + if (((lsr & LSR_THRE) == 0) && (what & UART_FLUSH_TRANSMITTER)) drain |= UART_DRAIN_TRANSMITTER; if ((lsr & LSR_RXRDY) && (what & UART_FLUSH_RECEIVER)) drain |= UART_DRAIN_RECEIVER; if (drain != 0) { - printf("ns8250: UART FCR is broken\n"); + printf("ns8250: UART FCR is broken (%#x)\n", drain); ns8250_drain(bas, drain); } } From nobody Fri Jun 27 07:42:57 2025 X-Original-To: dev-commits-src-branches@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 4bT6wd2JQWz60RF4; Fri, 27 Jun 2025 07:42:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6wd1RnRz418N; Fri, 27 Jun 2025 07:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751010177; 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=iPTmf8jzr6izB5ox78pZwCNl1gnPcAKMvB5gPntN5AI=; b=BcGnqSOSvH51+WmXuqwMAZMPWwDPucrhivCPNbmed0jryEHf5oMQ5XVopGxygGcgUgyfZS WOON/eQxvLTGP4UCoyII5vPcaygIGU4AlQUva1NjE6Zm7uTorUvWFTtqxR2JvrhXjLOj6n KVpNiH7JcjXbodRh0ky6V9tuxRs5tktA3+TAwV9MHrSWW+LmGlsXxwwWXr9ZuhLjfKpiMg X+mDllvHErOSWd7xYpcdjYQSd8cfADs7tNY2iQDKH6RWBRC0K5zi4bBNSKsotC6PGKNz4v nz2GFpyJr1O7vNvqfrwoJmds0/UhmepQ1PyC5Qza2wt5+8dLTYlfZRC+EPb8gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751010177; 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=iPTmf8jzr6izB5ox78pZwCNl1gnPcAKMvB5gPntN5AI=; b=bIxOBdQy2B6SbjT/JTGWNjS7fM0wU68hEmEOJ6q01JIgAk5TxziPkpkR4Pw9H8Ar2ilvRl QoTPa6+aEbvqz3ztUvOZvyCbkwxKPQSblQHSOBwlBH6biSgzPg2/CNvsf6CVHByGiLARwA C4FkmfMPJPnsBJdGQDHMEgZcvMIBU5wM0Bn7T68pUxjzgT2/Jx1T0vkyExhuK77nUaMfAA +4bawWbQYuXZZmaQfSPadTLtPu9rnIMP9mWIGG43BHwTUrybIHHP7cp/IxXhqzKCAO0JYv bUKD+nWBoNMa8z9HG9FK71SkQ/m6ICSw1ATT0axWriS+hWorFi3UT1wVWpFbPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751010177; a=rsa-sha256; cv=none; b=Ut0fu1h9iM4PTVInR3n/4Y8loKP1mKSNjVXrCgXE9D6tTldARIQf5vEwA/BDEcZppcJZLF Psy0vUdfV3kkQaL9KzplmqA8ipc/0Podh4zjseD7r8NR6Naqs2Iab0YKjiCIzhvcZhD0E7 A3HC5p8vfKUHAmT8kEcyQxJNaysmUcVRsEIfGsZPu9OpRlqIExjGvFx4UDt39dm2a+Et36 KMx/ErMnaVWnsTqCRPpdQoh/iXT/QOnFcV747rWnOQEi2j3S6nDDAzp02mXOKoiBCGPmQB GDfJhMOMONw4OLBe4vJ/XwdWrDBtu9eAyPWpAvCykMnhkUtWWJ/ohOt5vgc+9w== 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 4bT6wd0xsHzg9w; Fri, 27 Jun 2025 07:42:57 +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 55R7gvQU006795; Fri, 27 Jun 2025 07:42:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7gvRg006792; Fri, 27 Jun 2025 07:42:57 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:42:57 GMT Message-Id: <202506270742.55R7gvRg006792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 0bcd8425f055 - stable/13 - OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0bcd8425f055584630ffaa6b932ac22440e61986 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=0bcd8425f055584630ffaa6b932ac22440e61986 commit 0bcd8425f055584630ffaa6b932ac22440e61986 Author: Andriy Gapon AuthorDate: 2025-05-19 09:23:29 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:38:38 +0000 OptionalObsoleteFiles: etc/rc.d/powerd is used/useful without ACPI/APM Just like powerd daemon does not depend on ACPI/APM, its rc script does not either. Fixes: 20eb6bd8c598f (cherry picked from commit 28d74f18f1c222022ee4e9a2cdc63b1c21037392) --- tools/build/mk/OptionalObsoleteFiles.inc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5675d92197df..256fbc4e56f1 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -53,10 +53,6 @@ OLD_FILES+=usr/share/man/man8/acpidump.8.gz OLD_FILES+=usr/share/man/man8/iasl.8.gz .endif -.if ${MK_ACPI} == no && ${MK_APM} == no -OLD_FILES+=etc/rc.d/powerd -.endif - .if ${MK_APM} == no OLD_FILES+=etc/rc.d/apm OLD_FILES+=etc/rc.d/apmd From nobody Fri Jun 27 07:42:58 2025 X-Original-To: dev-commits-src-branches@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 4bT6wf5bgZz60RGt; Fri, 27 Jun 2025 07:42:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6wf2Dbkz418V; Fri, 27 Jun 2025 07:42:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751010178; 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=ubXgyYn4bl912n0Hi0hNpL0VpeyDXnpBu5cPfXsPo3Y=; b=rfNc9Pz2q7R5LxMp+JeSFRe9rIPgqy8a1/XJVrCya+mcAS98iZDbnoCX7kF0tszQPFWIyj kuHsNVvnjnb/DRCp/aXKiQ4FRXJXdWh5DYAk8Ci0LaTqqv6HhowqftiRG0eugsH3OVyeBh RW+niQCs/tc0USwrAltcsRJ1GhmGwrUnD0h1O/ldFyOdorXwSbiAFhTbvNpTrfLSeaasE2 SaYwKUVk2E5g4d4MDoIWBSQ5qza/GCTzbE4lJBenFr2W8+NAKfLCmfAO2kgwnIPTxoCtZ3 ydq8GQ61DXzyJAhyKU7qvFqhTId4VdaxhOKFK2wDtN0rHC6KDFnM3QGUPTcUkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751010178; 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=ubXgyYn4bl912n0Hi0hNpL0VpeyDXnpBu5cPfXsPo3Y=; b=nROrzoFFdTTHpzo5HzpFUzjgwCbU3UwtVmhqtWEOxquhXNuUztweSDqsDkf30Ly8dntYr/ FOb9xShI0CVarYaO1Ix4sWJrDjroP+qEAvPK/H2d9VvxDcuMhFxSH/d/gnULnm+Q6Qlu0q M5YpQCf1IqflrBaK4Dyam0c0R9ppAKVXof5n4SI3jUW9ELlxTFo9DNMa+VzoF5X0Lb5lXE f+r3/5cepm9aaROMEbiN7Adg6pigEC32HPLjfZSafWU1sh1YOHewfWXqa72xsQM40TaN+I bh2cHrg0Jvopz9vwlFnPkylS8c0FO8uvF2xRgMgWjxGs43is3BdPpF9up178ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751010178; a=rsa-sha256; cv=none; b=ZuJyIEzR6hXpj6BsWc5/rnK0BTkxa9g5ZlFXbhEZHdDmn3C6z/fZlFc+QokLHEvE+zq085 hot6cHHBQTBe4wss0kCMywlk7LstYjvoe7pnsr5Og5qUIk59w5FK1hn9rMElJpJf958f8A /aARALhbh5eDiMo6mZlDNNE5GrG7aKdcIeKhiS2ksRCR7spBAwOn5XvZbUH9a8lwkUztyR M2yY5cFzm8hkP4AjmTUmWH6+E07qH5VqeLBKiy9NLq/txLk/PHrXQejo1ZOMkLHCcjeWW4 kkUerRbtovhBfLy1ZKlVSpfipw0smtm5br7E2336hm2thmz3OHsV1tnW7+cjbw== 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 4bT6wf1r8czgSc; Fri, 27 Jun 2025 07:42:58 +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 55R7gwUt006829; Fri, 27 Jun 2025 07:42:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7gwIS006826; Fri, 27 Jun 2025 07:42:58 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:42:58 GMT Message-Id: <202506270742.55R7gwIS006826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 4d1ff6d22ba7 - stable/13 - dwc_otg_fdt: do not create and leak extra usbus child List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4d1ff6d22ba7eb33ebcae15a8c645cae8eea7f56 Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=4d1ff6d22ba7eb33ebcae15a8c645cae8eea7f56 commit 4d1ff6d22ba7eb33ebcae15a8c645cae8eea7f56 Author: Andriy Gapon AuthorDate: 2025-05-19 09:06:55 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:39:55 +0000 dwc_otg_fdt: do not create and leak extra usbus child dwc_otg_init() already takes care of creating the bus and setting up sc to point to it. Fixes: 518da7ace813e (cherry picked from commit 97c799661a76b78963fd9f92a7e6bb452ebba999) --- sys/dev/usb/controller/dwc_otg_fdt.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/usb/controller/dwc_otg_fdt.c b/sys/dev/usb/controller/dwc_otg_fdt.c index d698ace8e040..e256b60c902b 100644 --- a/sys/dev/usb/controller/dwc_otg_fdt.c +++ b/sys/dev/usb/controller/dwc_otg_fdt.c @@ -141,10 +141,6 @@ dwc_otg_attach(device_t dev) if (sc->sc_otg.sc_irq_res == NULL) goto error; - sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (sc->sc_otg.sc_bus.bdev == NULL) - goto error; - err = dwc_otg_init(&sc->sc_otg); if (err == 0) { err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev); From nobody Fri Jun 27 07:42:59 2025 X-Original-To: dev-commits-src-branches@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 4bT6wg69hDz60RKK; Fri, 27 Jun 2025 07:42:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bT6wg2nGSz40nl; Fri, 27 Jun 2025 07:42:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751010179; 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=B9Mx/sn7y8dhqKEBEGw2broDzPjV9kl8X+oNk9URowo=; b=lY8Z5OoHshn6lrUBsxmzDQ74N/fh272fBxplHRiGuJPN4NLm0A2kUvk9lVmwXFTWGvM1GE 5bXchLCvY9f72ioP/L8DeA3QsF6eyfg4hIexZXt1KHIZYX6ugeMz3LirkTMKzgIZJVh6cv ZgbmHysdpOZscAKnU6H4XPtrf39gBopGqoMK41WY+dUNsxt+AJt88oy1PFwIsuuO6YgvkF oExth7xUkTk1fCw3FLWFETwhiPfosSbn3YZiqmuKhVGj5b+26zTI9X0bRg3DfVSSpW4PMw k2KMRM0qONf9O+o1ajxZyOsSDhJxU7dNX7eqxMgKDynQD8mlZkfMKc4pXBc8tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751010179; 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=B9Mx/sn7y8dhqKEBEGw2broDzPjV9kl8X+oNk9URowo=; b=HTM/zQj2WxyCDsgsPxBG0Gyq+eefEznD4wBpHkghtHyOsdY/oXZGZCOfiqTU8avuZ3pEX0 fcFVYAwy9cc/7XSJL5u7qH+JZWZDufV95kgUcQqFgxwILYQIH+q/96zqus4x3xIrndkfUv W+1wx9myg8vx2UVwg42HqruTwUy8FKCo475/U/U11ARe/PkcMOIbTh7dGDJcQmfQ297lvW 969J5JChofMfD5x4voFDo91DbiGWpkATy6SV+/Of8LyI2sTOZFi15iLpK3kJD88UlbudxP QNPj0usrLKu7e8SXB/9f8r+MWZQhRNvCr0bnoOa7+EZrUXzo9hp5wabdd8RCFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751010179; a=rsa-sha256; cv=none; b=snsWU78MZHVyj7/gSUpGloncZCDxw02ZK8PhO9Ui+n/XIv5r30IWPwndFbkoHs7I+luU9X aScvJ13fzyZVarrJoL1nsGrYzoIcKZZKTenOOCm/qUhQT7MWO7mbQ/U1ohpKU31+ZzR0cw lwWcroZlGQZxOCvxGU7s+Qv+5GKfCB1oM7+BOYammjtP83jeCQS7cMh8/EK0TqpuneabGQ OIbUDyz7Q1Qf8vHDVm931PDoCANGRYd0Y5TBuFsrgxNpNvjiqIMvwy1bjusK0be776DSTK BY5W+3DmfLS+sGH6oeudKzHSkszTYYUo9XZZaR+nxOPzmUlIwO8E6H6oq1IA+A== 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 4bT6wg2NZ2zgPq; Fri, 27 Jun 2025 07:42:59 +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 55R7gxNk006866; Fri, 27 Jun 2025 07:42:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55R7gxfU006862; Fri, 27 Jun 2025 07:42:59 GMT (envelope-from git) Date: Fri, 27 Jun 2025 07:42:59 GMT Message-Id: <202506270742.55R7gxfU006862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 264aeb32e9ee - stable/13 - ads111x: initialize the lock earlier, before it's used List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 264aeb32e9ee72614d6132660c8cc993fc24ef0d Auto-Submitted: auto-generated The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=264aeb32e9ee72614d6132660c8cc993fc24ef0d commit 264aeb32e9ee72614d6132660c8cc993fc24ef0d Author: Andriy Gapon AuthorDate: 2025-03-30 19:47:50 +0000 Commit: Andriy Gapon CommitDate: 2025-06-27 07:40:02 +0000 ads111x: initialize the lock earlier, before it's used The first use can be in ads111x_add_channels. (cherry picked from commit eda3a7ac755c5e02f92ff971db63d0a702963d66) --- sys/dev/iicbus/ads111x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/iicbus/ads111x.c b/sys/dev/iicbus/ads111x.c index 2c2bbd822c26..f7cb581f533f 100644 --- a/sys/dev/iicbus/ads111x.c +++ b/sys/dev/iicbus/ads111x.c @@ -559,6 +559,8 @@ ads111x_attach(device_t dev) return (err); } + sx_init(&sc->lock, "ads111x"); + /* Add the sysctl handler to set the chip configuration register. */ ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); @@ -575,8 +577,6 @@ ads111x_attach(device_t dev) /* Set up channels based on metadata or default config. */ ads111x_add_channels(sc); - sx_init(&sc->lock, "ads111x"); - return (0); } From nobody Fri Jun 27 20:08:22 2025 X-Original-To: dev-commits-src-branches@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 4bTRSk38ZSz60C2w; Fri, 27 Jun 2025 20:08:22 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bTRSk2QYRz4B7C; Fri, 27 Jun 2025 20:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751054902; 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=9Uap/h8AwovpyQrLRk0iedGRdM2H/onGBI0oX+OegxE=; b=ARVwUsZiGlyCF5Coiujif/imVTiVm2DW2McGHmCz5GtwfliGueJMUOeILkGX7nQYG/q2iF R6PZoNw5A9oa/P2qPQ4kC1u9cbZzYY6TXNDpRvMQGVhr+Whi54unX+kP4ZCO3FYPDakZxX Jw3h7wVNL1Yy/WTISHPhw2rUbkKqC0kZX3BaV09MTKq3WMx56UeUMDEX2WwTqqsrch6PsL r9zCXh+d/7C003qb+MbHXPcNraL2ffOktQtpJPuX0Sheqb65jeTHWAbWridS6cpGH2CLEj +eYq5ngdFrTaAuP7eV/QIrGO/XDM5PajzRRC52JxdWs2/jnIl4vtp/xZ/6E8VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751054902; 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=9Uap/h8AwovpyQrLRk0iedGRdM2H/onGBI0oX+OegxE=; b=n46GNJh0HtBaDWWXDX3ERKtGRw7zKUwPIAGrwa/yJKBBh3hNUcFHvlA/+SZiHA3df06+15 octez2TIkhK4buuDZQCfcaOuIsa4u62Hq/sJvCnHemVuZFqtBMm40ZCGZFBf8EOH20nL16 AIvQOV4A/R+S8+QAxWajb5h5eMY3VUE0Pkri2dTJcIXmNsdSVLsFsnAhHUWXDeJmlZGe3f YFEuHRExm0XQzL4nkBNBSVUgrf0i7GyIpDl+cbIXW7PsKOXnqpn3DCGapYsHbBpZHmGgy2 7yOjrIDsdguqrkkPA04e9Ql8DOFXhwKX5HQ/N8ssLf22oJG8HIkGKrNkCDyenQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751054902; a=rsa-sha256; cv=none; b=C0MTwTsgqs20ej95jU5ej4BeSY2bfTKdx50wMIisA0SdZW7/bzhkobAYJa/IFDG/FWNRxn touxR7kIcbWVnCGdkE1rMOoU7CSSRCCkH5GX4mu6mWRiwt0j/D53uujDC1of7zNr9Jw6DY w8xg1mr53iczcYzFsDFbiSbtF7dBl0hrLuijza1s/DZ1PoGNpqwfhBlH+HcXehvNadNVd/ HVz2Ovs5AI2+oEFI+CQmdsqoBUSdycXWr01y2Ll4iLTvaBCxD3OVmtyeCWOLv1qCEfHC6A hThARt7hYYeQOwf4A0A5Q76zpLEzAu06E5SnKic7T05JjgUwBZrFqbzwmhE01g== 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 4bTRSk1LfZz1273; Fri, 27 Jun 2025 20:08:22 +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 55RK8MlL094777; Fri, 27 Jun 2025 20:08:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55RK8MK3094774; Fri, 27 Jun 2025 20:08:22 GMT (envelope-from git) Date: Fri, 27 Jun 2025 20:08:22 GMT Message-Id: <202506272008.55RK8MK3094774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: eae830109571 - stable/13 - Fix 2 bugs in non-raw send with encryption List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eae830109571fcf069545b6a2fabf68c5d8e67c0 Auto-Submitted: auto-generated The branch stable/13 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=eae830109571fcf069545b6a2fabf68c5d8e67c0 commit eae830109571fcf069545b6a2fabf68c5d8e67c0 Author: George Amanakis AuthorDate: 2025-05-19 16:55:00 +0000 Commit: Allan Jude CommitDate: 2025-06-27 20:07:48 +0000 Fix 2 bugs in non-raw send with encryption Bisecting identified the redacted send/receive as the source of the bug for issue #12014. Specifically the call to dsl_dataset_hold_obj(&fromds) has been replaced by dsl_dataset_hold_obj_flags() which passes a DECRYPT flag and creates a key mapping. A subsequent dsl_dataset_rele_flag(&fromds) is missing and the key mapping is not cleared. This may be inadvertedly used, which results in arc_untransform failing with ECKSUM in: arc_untransform+0x96/0xb0 [zfs] dbuf_read_verify_dnode_crypt+0x196/0x350 [zfs] dbuf_read+0x56/0x770 [zfs] dmu_buf_hold_by_dnode+0x4a/0x80 [zfs] zap_lockdir+0x87/0xf0 [zfs] zap_lookup_norm+0x5c/0xd0 [zfs] zap_lookup+0x16/0x20 [zfs] zfs_get_zplprop+0x8d/0x1d0 [zfs] setup_featureflags+0x267/0x2e0 [zfs] dmu_send_impl+0xe7/0xcb0 [zfs] dmu_send_obj+0x265/0x360 [zfs] zfs_ioc_send+0x10c/0x280 [zfs] Fix this by restoring the call to dsl_dataset_hold_obj(). The same applies for to_ds: here replace dsl_dataset_rele(&to_ds) with dsl_dataset_rele_flags(). Both leaked key mappings will cause a panic when exporting the sending pool or unloading the zfs module after a non-raw send from an encrypted filesystem. Contributions-by: Hank Barta Contributions-by: Paul Dagnelie Reviewed-by: Alexander Motin Reviewed-by: Richard Yao Reviewed-by: Rob Norris Reviewed-by: Brian Behlendorf Signed-off-by: George Amanakis Closes #12014 Closes #17340 (cherry picked from commit ea74cdedda8b9575d7e94198d38f12943ac41343) --- sys/contrib/openzfs/module/zfs/dmu_send.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/dmu_send.c b/sys/contrib/openzfs/module/zfs/dmu_send.c index 0dd1ec210a1d..e4891e2fe4aa 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_send.c +++ b/sys/contrib/openzfs/module/zfs/dmu_send.c @@ -2676,8 +2676,8 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, } if (fromsnap != 0) { - err = dsl_dataset_hold_obj_flags(dspp.dp, fromsnap, dsflags, - FTAG, &fromds); + err = dsl_dataset_hold_obj(dspp.dp, fromsnap, FTAG, &fromds); + if (err != 0) { dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); dsl_pool_rele(dspp.dp, FTAG); @@ -2729,7 +2729,7 @@ dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, kmem_free(dspp.fromredactsnaps, dspp.numfromredactsnaps * sizeof (uint64_t)); - dsl_dataset_rele(dspp.to_ds, FTAG); + dsl_dataset_rele_flags(dspp.to_ds, dsflags, FTAG); return (err); } From nobody Sun Jun 29 00:30:03 2025 X-Original-To: dev-commits-src-branches@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 4bV9DD0JK7z60fWm; Sun, 29 Jun 2025 00:30:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bV9DC4hq1z3bs7; Sun, 29 Jun 2025 00:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751157003; 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=+17TdrU0+uU/cotXVPfrAl5wxrrBrp6BTomahtjbzkY=; b=dbNlcJHn2c1rn5dm72Z9VGou3D5FVfihrxLBEE/R8F9NWMBsaL6xJv+LYr1EsuDIWlNtlF R9VUQjhskmkl82RFYiroICwwFQt9nMRnqoHRyb9KO7sw/GVI082t73BBNpmeL3JiOmL5XX dajUnIDqqAU5uuIOEvh1zhOXR35uYW3VF0GslTKR92MbPVTYc3QlBdPcnyw1dmciUBTaNx 2VVEvQmAcGW3MokborAxCXZqgNpzHhRzsnn5WAGhnzCKChnsr3n5+y2EEiLKQ2L5qppvDx vTSCZh4sra2T6bpIS6gKmBC5uES+JbbMITkP+VqJTlrA2nNaSk1tqBaOKuCtmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751157003; 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=+17TdrU0+uU/cotXVPfrAl5wxrrBrp6BTomahtjbzkY=; b=BrsqcJD9PvZltWYzGSwVjLR0bNz+vP/eflPgjZm2bTEFBABtcjVShZrtmEzkx+V/QpSceO Z8VO+5BzZDGu52sYlyNd7pGpCNoFrPCC+VwfvqJgMsBldmxNcDrEIzfypXFs3CUwwK6H3b Aeh3mFmES3oIevIDJHdUWnyV5VBuctnae7uBJ4Lt+RarZKuxEbvVUERywTLKq3mBeYHtgZ XXeV5MUbsJOIJjphrEHzSVkadD/Spm1+QKt+tNyTqJ61z8+7qSRXO84igLb1udf/BJ4QbP wpxWcGEfCd7DVtnTEEEMl9uAX36aaSAXTlgHaQIrG+gLJua2QXSxIpp3Bh4LAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751157003; a=rsa-sha256; cv=none; b=a106FkRY2Sb44wOS8c/pgh5sqtgiJ83eiuLu36UohxiA4U0Aazge/8SUcvPJHw09Qt0q93 7W22EfnVd06pK0hNpGPF+r2QAI7FQJ8QHe/iEVISFnQUggT7QWyWHV4jciQSQQsEJqq2XG 0S/JfLkMqLLv57EzUpDlrOR7pCFyfGiq8ym4or+TA7h1itHp+qJPr9cD8wNKx03FLp83P7 T//x07n3krqT8Vna42AUUtvsmv1HKJNLlIgU7uhOobSUg2uTPCQrb7jeluvjqdeF7XOJW7 /nxCAz+eQ+ejrszLaqsPXXBBp7SS8yiFqfjDl4AtxZ1eqXln/HPxuHWond2x5Q== 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 4bV9DC4Bd8zwlF; Sun, 29 Jun 2025 00:30:03 +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 55T0U3xc086925; Sun, 29 Jun 2025 00:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55T0U3fk086921; Sun, 29 Jun 2025 00:30:03 GMT (envelope-from git) Date: Sun, 29 Jun 2025 00:30:03 GMT Message-Id: <202506290030.55T0U3fk086921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4b8788dd08f1 - stable/14 - amd64 locore: fix typo in comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4b8788dd08f1c5ecacb0fe16b2bb39e5082243d1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4b8788dd08f1c5ecacb0fe16b2bb39e5082243d1 commit 4b8788dd08f1c5ecacb0fe16b2bb39e5082243d1 Author: Konstantin Belousov AuthorDate: 2025-06-25 03:25:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-29 00:29:13 +0000 amd64 locore: fix typo in comment (cherry picked from commit 39c0792b15505436235a0bfd24abee59d6d535d2) --- sys/amd64/amd64/locore.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index d39503adadf0..4d10879d9f30 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -112,7 +112,7 @@ ENTRY(btext) * - reset IDT back to long mode. */ ENTRY(la57_trampoline) - movq %rsp,lst(%rip) /* save registers into memeory */ + movq %rsp,lst(%rip) /* save registers into memory */ movq %rbx,lst+8(%rip) /* upper halves are not saved .. */ movq %rbp,lst+0x10(%rip) /* by 64->32->64 switch */ movq %cr4,%rax From nobody Sun Jun 29 00:30:02 2025 X-Original-To: dev-commits-src-branches@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 4bV9DC5Ftzz60fwp; Sun, 29 Jun 2025 00:30:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bV9DB4kLHz3bs3; Sun, 29 Jun 2025 00:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751157002; 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=g68bhkV3dYTjBID/3o2nLs4vhHTlO35fhxvIOT1rFrc=; b=nQWVTxJDAWZOXjbIQG/300GHgru9fiQ7QRUqd4lCRnFV0osXZbUuIhajnYetWkPFT/T0tu 36eKIFKtvI+BHnZncMrGj6Fl6av6HzFPmFurKFc1zzE1PV8seQf5b9qw7bjTzUW6CSo+ya SH7lbDF+ssWPhoQ7YwedRujKZkeA8/2a4QM6kK8erJaT0a0PN9qL5o5VDWLqUH8JdYnMAi by4ZEHpcpShXvJEefXvNGWUSjHBVjxEHZtnUIT8qMWfY78Nc81rdSObA1qYgHnMkAIvhTH L8Ch4Klj0f4KxXLnmtM59NjIo+T3kV+WAgvHg5QI3kZRCGQrEhMagSooLPekbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751157002; 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=g68bhkV3dYTjBID/3o2nLs4vhHTlO35fhxvIOT1rFrc=; b=HlJ6YPh8RIYCJ8ArOERR+mynkgxENA91QK9yde+T+lkR7Nwfj4bJs6m5c7kuRo/IkRKHIA 0qhr2PHSzRDeHpQxgwSlsBO2Mbo4F24eOiP2rYXZwX8pxOlsD091pdzBRBzY7icGdjdOjF egi7QJRRdkvft9pA3c7I/DWvAdnqBNtrRUG5nZQz8H9IklFyCAf4tDOMv69jHrygXGY3A/ /pZimLzLXGqHEtpT6BN9mcvt8csgpaFCN1FwL8cWGGCT3TfkghKmuQUx7l3bP/wcz1+gUj iw+BxfcA/avY3JOPVJFsRilqBLQZuwczHzHaGWS3t0aBKPKUJfWEaRKMAl5iyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751157002; a=rsa-sha256; cv=none; b=JVuPXj8SzfCRIl6L4BQnTnu/4jujQVawSIhu6a89RI1Tfsxa85LseX8SguQRT2MulyEmFD LREbY28683nmOjNM/5XTPu1J2+4hNxJmG8B+KjlZT++4EJ84Epw6vQvSLCzHJAScQa0bY7 9gd1dOboF/wS220OODbVZnFyGuKaV+/7rdohLUv2E/MWc0R65S20AqGLMSpKq8wy9L1Ei3 d0LcbhiGK3cYBjnbS9NG+D35K2rnJwS+soT38HIxgzOOtN0f4J5uD+0Lo+eDnDPNd7tI0a MZii5KqX14vheD12w2615mz1LnCWuL1191BnXt58Sp6ka55KnMZkjN3PUaUrig== 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 4bV9DB42xNzwZJ; Sun, 29 Jun 2025 00:30:02 +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 55T0U2pi086653; Sun, 29 Jun 2025 00:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55T0U2XK086649; Sun, 29 Jun 2025 00:30:02 GMT (envelope-from git) Date: Sun, 29 Jun 2025 00:30:02 GMT Message-Id: <202506290030.55T0U2XK086649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3131e7a41725 - stable/14 - csu: C standard requires errno on main() entry List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3131e7a41725acd53d7612da8cb9de278f81e244 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3131e7a41725acd53d7612da8cb9de278f81e244 commit 3131e7a41725acd53d7612da8cb9de278f81e244 Author: Konstantin Belousov AuthorDate: 2025-06-23 23:46:43 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-29 00:29:12 +0000 csu: C standard requires errno on main() entry (cherry picked from commit 64584008139f73b07fa7c7979c41780be458b8cc) --- lib/libc/csu/libc_start1.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index f0e708e405ce..a1887a2c28c0 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "libc_private.h" @@ -154,6 +155,13 @@ __libc_start1(int argc, char *argv[], char *env[], void (*cleanup)(void), } handle_static_init(argc, argv, env); + + /* + * C17 4.3 paragraph 3: + * The value of errno in the initial thread is zero at program + * startup. + */ + errno = 0; exit(mainX(argc, argv, env)); } @@ -182,5 +190,6 @@ __libc_start1_gcrt(int argc, char *argv[], char *env[], monstartup(eprolp, etextp); handle_static_init(argc, argv, env); + errno = 0; exit(mainX(argc, argv, env)); } From nobody Sun Jun 29 01:14:43 2025 X-Original-To: dev-commits-src-branches@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 4bVBCm673Cz60hjS; Sun, 29 Jun 2025 01:14:44 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVBCl6Czgz3FCS; Sun, 29 Jun 2025 01:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751159683; 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=67SDc35zPtC9LF2h2uMzLO0SYJVKGP2zTa2v8QJYkfQ=; b=Golal9lrG0NkvQg7QKPRCe4HasmN2usItxIpmW376OlHiygnBd3M7V7+LT/UYB5Bvw6PT+ OB9al5Rw/IK3C+YDZNweVP/03ggKJdPp8CXfAXaaNCB+c1hO/4LHZTvqcjxCVCB7ROKjOB sNEDfkB61X6PofPi/JpWaVSo0ZcR2zc4a4tn7iZGUcrIUrPjQn9n1U71pCZkiGI04aKV+3 Hon+Q4yFaLSWY8ySzh1XWQfTmgFuqVwFcNC+Jw+IzSgKOPPRym2W7rV+dUX3hpeunYIlOb TSmMPhGnYanutyv3xvY4VnzpsPWqORbHOZ5VuI+UuXisqQHDT4F66yF4vjg9SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751159683; 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=67SDc35zPtC9LF2h2uMzLO0SYJVKGP2zTa2v8QJYkfQ=; b=sBAfj7fz9YJmxetUGDhj4LdOSGulX2CpXpM2Z0SmY+iPZY+TZzlahGv2I9A/dRHg7L16M5 fUYsi104G8S4Sn7D/9ITbzslp5ipqmlboyoviz1mRrpybVx2QzyaQeb30bf/OiuBEnZtsF UHWUuW2eEgfuJAzSWsz9mQe2ZqlHFw/IxwPMPmxbX4Ay39TBoYl09UT2Zrjcy1hrUxBxiC 8TuoQLYurUsiMq1ZRtS0neRJcUY0+WM0XWK3e4D/FD8PXqn0GnR9gdPvXtarz5trW/LA9m e2chXuUT2ieLGoht/wOlXCiXwuFfHostGKZbU5FYsN3ybkM0Y7BvsQFNT99sag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751159683; a=rsa-sha256; cv=none; b=DI9Ez66g9lEGYkWZSSSdsVEEUjPmksqX3lUfKrj3nvts3Bm9MeCMq3VAjZ+VyiRnyqkxKh 7LvDQRoDNB0xtDhXQOwThHr+n5LfWfljBTq3YTQ/M0UhYu27hbuzA4pBMRwT3c84EvY8b4 rkYR08Bv7CgXpyqnr6iJySD63DkZn5/PfSaxY50D/HzowFv0FFf2cnjRwW/N2cOsGwDvcz 6i0Nf8JYHzgSiyYCL2qdpyqb60GcJDolhykAh+jr+zryXLdhB3dSkKq0q/35NAGQPDimih yXfia3eim29frhibSIeyzTj/JkVh6jYeBhugsowHooGJh35hqPvXp5mga9Zz2Q== 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 4bVBCl5nSTzy0c; Sun, 29 Jun 2025 01:14:43 +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 55T1Ehjb076706; Sun, 29 Jun 2025 01:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55T1EheI076703; Sun, 29 Jun 2025 01:14:43 GMT (envelope-from git) Date: Sun, 29 Jun 2025 01:14:43 GMT Message-Id: <202506290114.55T1EheI076703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e0c9d85cab83 - stable/14 - libc: expose __getosreldate in private version List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0c9d85cab833493b893ee023cc09e15d37c641e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e0c9d85cab833493b893ee023cc09e15d37c641e commit e0c9d85cab833493b893ee023cc09e15d37c641e Author: Konstantin Belousov AuthorDate: 2025-06-29 01:13:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-29 01:14:24 +0000 libc: expose __getosreldate in private version This put stable/14 on par with HEAD where __getosreldate is exported from libsys, and can be used by libthr. This is direct commit to stable/14. Sponsored by: The FreeBSD Foundation --- lib/libc/gen/Symbol.map | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 2542da299cb1..93cd5fb410b5 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -469,6 +469,7 @@ FBSD_1.8 { FBSDprivate_1.0 { /* needed by thread libraries */ __thr_jtable; + __getosreldate; _dl_iterate_phdr_locked; _pthread_atfork; From nobody Sun Jun 29 21:00:02 2025 X-Original-To: dev-commits-src-branches@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 4bVhWR0qVhz60gV8; Sun, 29 Jun 2025 21:00:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVhWQ5mV6z3XC7; Sun, 29 Jun 2025 21:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230802; 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=AeBjaGJ5SYl4rq/Jon4LBcOSLH8nSVbH08VyPfBoNs4=; b=R7cC1Aek8DFrk/DCcNjVjxZZxdMfi4rzfx45UhsisdLAS8/WSgZrJYEjKhNFMurChGFhxc UtLMosezelb5p+BKGrsZQ2CcBbuboFdK3N7a4rsnrwdCVs4CkIhpX6wNzPixslo8GpNrKf 2OiMbvrXLmkSr1p7+wNpo6giLD2/DQ2Fj2EJq1Y3tR5d4KCWvWF6bpF0HeZ5J5dKcGfrN7 gFSpj7mqbXORvAZeChYeo3xhFffk9B/8uB5HyyOb5xlyl6enpWbxu6PO3nZKdEunTbPbPU kFo18g1JkiarNwngVfOnUccsoc8au/gnMEuJOngUJBCV4NvkG2E8hF/wqXOWdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230802; 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=AeBjaGJ5SYl4rq/Jon4LBcOSLH8nSVbH08VyPfBoNs4=; b=jJ3MhQCvTpCalKQ0Ymuz+s3eYUOWQJHPOvi4vLnU4dwpY8R+lvld02vo0WJV20r++q98Ls XnWGyJttHloifgVWGqXusG0/luVtWgyugiEuruMMDl2b0zYId44RzUTEWykMV/r/1clQ7t pek3octAGxzXMbgqtfCdQb8+nQW+wI/YS0ZnTS4zA/igj9TpRS5jA7U3NnGFgOM/DpeCd+ QPlPE9MRdP1XtXdJnknyQtw+sGThNO3K4kRJialnbQYkG25m22mh1Y4/zzIPQ0ugbAc4p5 mlHIB+iNaaztYTfiyjZ/abILjN7+JZkzMSJO8iE4+qVrMV3WiI4Q2HCrvnMAMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751230802; a=rsa-sha256; cv=none; b=nA/9soxsKFP7JDtROkqiflDTsBozSo2A6gMXAEDihzVuHV0OC3JtIohp/9b2AL0IAciZ4e BU4G+PKpGWLkHoJLPeAyqQFRfPbEKH4raI2Ku3uspDbZJzaPX5flPvVz+YW+HIkNnbrtFG go6oDT30kD7bXoTJrZn719WmqLV3iPznExOXhtE1kfN9fE1jR24yoQvYu6CMoLTP9wXi+c HmgNr4MewG0fcVIEH1QlEfGvpVt+Bp+Od6a3tifNM5+o/x9X8iFL5lOtRv3Tfdiqriofu7 j7+mDsafjA6bnzTEq7GdxCDixikWJxay0hkNF4FTwOjVDNXi4/I2iuTFOmgwVA== 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 4bVhWQ4gtTzbyR; Sun, 29 Jun 2025 21:00:02 +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 55TL02L1003491; Sun, 29 Jun 2025 21:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TL024G003474; Sun, 29 Jun 2025 21:00:02 GMT (envelope-from git) Date: Sun, 29 Jun 2025 21:00:02 GMT Message-Id: <202506292100.55TL024G003474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: a443333f9bb4 - stable/14 - contrib/llvm-project: fix clang crash compiling modules List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a443333f9bb4c342d7dcf07332aba8e785b0bc47 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=a443333f9bb4c342d7dcf07332aba8e785b0bc47 commit a443333f9bb4c342d7dcf07332aba8e785b0bc47 Author: Lexi Winter AuthorDate: 2025-06-25 17:12:02 +0000 Commit: Lexi Winter CommitDate: 2025-06-29 20:59:50 +0000 contrib/llvm-project: fix clang crash compiling modules clang++ may crash when compiling certain C++20 modules. Backport the fix from LLVM upstream. This fixes LLVM bug 102684: https://github.com/llvm/llvm-project/issues/102684. PR: 287803 MFC after: 3 days Obtained from: https://github.com/llvm/llvm-project/pull/102855 Reviewed by: kevans, dim Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D51041 (cherry picked from commit 55dfaeae8e9aa95f0b724d90ad2423ca1b623142) --- .../include/clang/Frontend/MultiplexConsumer.h | 1 + .../Serialization/ASTDeserializationListener.h | 2 + .../clang/include/clang/Serialization/ASTReader.h | 3 + .../clang/include/clang/Serialization/ASTWriter.h | 1 + .../clang/lib/Frontend/MultiplexConsumer.cpp | 5 ++ .../clang/lib/Serialization/ASTReader.cpp | 91 +++++++++++++++++----- .../clang/lib/Serialization/ASTWriter.cpp | 6 ++ 7 files changed, 91 insertions(+), 18 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h b/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h index e49e3392d1f3..3a7670d7a51a 100644 --- a/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h +++ b/contrib/llvm-project/clang/include/clang/Frontend/MultiplexConsumer.h @@ -36,6 +36,7 @@ public: void MacroRead(serialization::MacroID ID, MacroInfo *MI) override; void TypeRead(serialization::TypeIdx Idx, QualType T) override; void DeclRead(GlobalDeclID ID, const Decl *D) override; + void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) override; void SelectorRead(serialization::SelectorID iD, Selector Sel) override; void MacroDefinitionRead(serialization::PreprocessedEntityID, MacroDefinitionRecord *MD) override; diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h index 1d81a9ae3fe2..ea96faa07c19 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTDeserializationListener.h @@ -45,6 +45,8 @@ public: virtual void TypeRead(serialization::TypeIdx Idx, QualType T) { } /// A decl was deserialized from the AST file. virtual void DeclRead(GlobalDeclID ID, const Decl *D) {} + /// A predefined decl was built during the serialization. + virtual void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) {} /// A selector was read from the AST file. virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) {} /// A macro definition was read from the AST file. diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h index 671520a3602b..82f32e843d63 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h @@ -1541,6 +1541,9 @@ private: std::pair translateTypeIDToIndex(serialization::TypeID ID) const; + /// Get a predefined Decl from ASTContext. + Decl *getPredefinedDecl(PredefinedDeclIDs ID); + public: /// Load the AST file and validate its contents against the given /// Preprocessor. diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h index 700f0ad00111..10a50b711043 100644 --- a/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h +++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTWriter.h @@ -869,6 +869,7 @@ private: void IdentifierRead(serialization::IdentifierID ID, IdentifierInfo *II) override; void MacroRead(serialization::MacroID ID, MacroInfo *MI) override; void TypeRead(serialization::TypeIdx Idx, QualType T) override; + void PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) override; void SelectorRead(serialization::SelectorID ID, Selector Sel) override; void MacroDefinitionRead(serialization::PreprocessedEntityID ID, MacroDefinitionRecord *MD) override; diff --git a/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp b/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp index 651c55aeed54..2158d176d189 100644 --- a/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/contrib/llvm-project/clang/lib/Frontend/MultiplexConsumer.cpp @@ -58,6 +58,11 @@ void MultiplexASTDeserializationListener::DeclRead(GlobalDeclID ID, Listeners[i]->DeclRead(ID, D); } +void MultiplexASTDeserializationListener::PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) { + for (size_t i = 0, e = Listeners.size(); i != e; ++i) + Listeners[i]->PredefinedDeclBuilt(ID, D); +} + void MultiplexASTDeserializationListener::SelectorRead( serialization::SelectorID ID, Selector Sel) { for (size_t i = 0, e = Listeners.size(); i != e; ++i) diff --git a/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp b/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp index 29aec144aec1..2d8f5a801f0e 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp +++ b/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp @@ -7741,7 +7741,10 @@ SourceLocation ASTReader::getSourceLocationForDeclID(GlobalDeclID ID) { return Loc; } -static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) { +Decl *ASTReader::getPredefinedDecl(PredefinedDeclIDs ID) { + assert(ContextObj && "reading predefined decl without AST context"); + ASTContext &Context = *ContextObj; + Decl *NewLoaded = nullptr; switch (ID) { case PREDEF_DECL_NULL_ID: return nullptr; @@ -7750,54 +7753,106 @@ static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) { return Context.getTranslationUnitDecl(); case PREDEF_DECL_OBJC_ID_ID: - return Context.getObjCIdDecl(); + if (Context.ObjCIdDecl) + return Context.ObjCIdDecl; + NewLoaded = Context.getObjCIdDecl(); + break; case PREDEF_DECL_OBJC_SEL_ID: - return Context.getObjCSelDecl(); + if (Context.ObjCSelDecl) + return Context.ObjCSelDecl; + NewLoaded = Context.getObjCSelDecl(); + break; case PREDEF_DECL_OBJC_CLASS_ID: - return Context.getObjCClassDecl(); + if (Context.ObjCClassDecl) + return Context.ObjCClassDecl; + NewLoaded = Context.getObjCClassDecl(); + break; case PREDEF_DECL_OBJC_PROTOCOL_ID: - return Context.getObjCProtocolDecl(); + if (Context.ObjCProtocolClassDecl) + return Context.ObjCProtocolClassDecl; + NewLoaded = Context.getObjCProtocolDecl(); + break; case PREDEF_DECL_INT_128_ID: - return Context.getInt128Decl(); + if (Context.Int128Decl) + return Context.Int128Decl; + NewLoaded = Context.getInt128Decl(); + break; case PREDEF_DECL_UNSIGNED_INT_128_ID: - return Context.getUInt128Decl(); + if (Context.UInt128Decl) + return Context.UInt128Decl; + NewLoaded = Context.getUInt128Decl(); + break; case PREDEF_DECL_OBJC_INSTANCETYPE_ID: - return Context.getObjCInstanceTypeDecl(); + if (Context.ObjCInstanceTypeDecl) + return Context.ObjCInstanceTypeDecl; + NewLoaded = Context.getObjCInstanceTypeDecl(); + break; case PREDEF_DECL_BUILTIN_VA_LIST_ID: - return Context.getBuiltinVaListDecl(); + if (Context.BuiltinVaListDecl) + return Context.BuiltinVaListDecl; + NewLoaded = Context.getBuiltinVaListDecl(); + break; case PREDEF_DECL_VA_LIST_TAG: - return Context.getVaListTagDecl(); + if (Context.VaListTagDecl) + return Context.VaListTagDecl; + NewLoaded = Context.getVaListTagDecl(); + break; case PREDEF_DECL_BUILTIN_MS_VA_LIST_ID: - return Context.getBuiltinMSVaListDecl(); + if (Context.BuiltinMSVaListDecl) + return Context.BuiltinMSVaListDecl; + NewLoaded = Context.getBuiltinMSVaListDecl(); + break; case PREDEF_DECL_BUILTIN_MS_GUID_ID: + // ASTContext::getMSGuidTagDecl won't create MSGuidTagDecl conditionally. return Context.getMSGuidTagDecl(); case PREDEF_DECL_EXTERN_C_CONTEXT_ID: - return Context.getExternCContextDecl(); + if (Context.ExternCContext) + return Context.ExternCContext; + NewLoaded = Context.getExternCContextDecl(); + break; case PREDEF_DECL_MAKE_INTEGER_SEQ_ID: - return Context.getMakeIntegerSeqDecl(); + if (Context.MakeIntegerSeqDecl) + return Context.MakeIntegerSeqDecl; + NewLoaded = Context.getMakeIntegerSeqDecl(); + break; case PREDEF_DECL_CF_CONSTANT_STRING_ID: - return Context.getCFConstantStringDecl(); + if (Context.CFConstantStringTypeDecl) + return Context.CFConstantStringTypeDecl; + NewLoaded = Context.getCFConstantStringDecl(); + break; case PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID: - return Context.getCFConstantStringTagDecl(); + if (Context.CFConstantStringTagDecl) + return Context.CFConstantStringTagDecl; + NewLoaded = Context.getCFConstantStringTagDecl(); + break; case PREDEF_DECL_TYPE_PACK_ELEMENT_ID: - return Context.getTypePackElementDecl(); + if (Context.TypePackElementDecl) + return Context.TypePackElementDecl; + NewLoaded = Context.getTypePackElementDecl(); + break; } - llvm_unreachable("PredefinedDeclIDs unknown enum value"); + + assert(NewLoaded && "Failed to load predefined decl?"); + + if (DeserializationListener) + DeserializationListener->PredefinedDeclBuilt(ID, NewLoaded); + + return NewLoaded; } unsigned ASTReader::translateGlobalDeclIDToIndex(GlobalDeclID GlobalID) const { @@ -7814,7 +7869,7 @@ Decl *ASTReader::GetExistingDecl(GlobalDeclID ID) { assert(ContextObj && "reading decl with no AST context"); if (ID < NUM_PREDEF_DECL_IDS) { - Decl *D = getPredefinedDecl(*ContextObj, (PredefinedDeclIDs)ID); + Decl *D = getPredefinedDecl((PredefinedDeclIDs)ID); if (D) { // Track that we have merged the declaration with ID \p ID into the // pre-existing predefined declaration \p D. diff --git a/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp b/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp index cb63dec92e33..e907ddb88949 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp +++ b/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp @@ -6757,6 +6757,12 @@ void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { StoredIdx = Idx; } +void ASTWriter::PredefinedDeclBuilt(PredefinedDeclIDs ID, const Decl *D) { + assert(D->isCanonicalDecl() && "predefined decl is not canonical"); + DeclIDs[D] = LocalDeclID(ID); + PredefinedDecls.insert(D); +} + void ASTWriter::SelectorRead(SelectorID ID, Selector S) { // Always keep the highest ID. See \p TypeRead() for more information. SelectorID &StoredID = SelectorIDs[S]; From nobody Sun Jun 29 21:00:03 2025 X-Original-To: dev-commits-src-branches@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 4bVhWS3MVmz60gP2; Sun, 29 Jun 2025 21:00:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVhWR68JTz3X3k; Sun, 29 Jun 2025 21:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230803; 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=CgJWcaBMlfDV/GS0OFmt0AQWM5Cd6oY/kAp+UWCGnXQ=; b=r/9+GBqKjrZV0uaOOyu3OXQAcETBfvodE/u7T5yRAM8t0KDWVQV0OIlaWwyETz90HFy6F+ AgTUlB+jQI7z3WjgdQapLA4r5AJ3nvPc3zMVRRHFjitpJ5oCq9YeF85KskM5NoKJOUwrp5 xB4B7ZSfryiLfixbwsZQHki/7DIYQU2flIQrUaayMoJ5ZFtBGtu+RBcjj8+xaBNn6UNn7G 9e+TyageMWTWbtsIFU/i96Q6N5LEoxOYGswd4YAX4dosO2Jl77sOSn54FsZ+y+mFHHovHt wXNmkipPR9DO/f3UOVJmECxDOPH6RQdReIYBf3TBE9KYUbXaXxOhpZM+lClxcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230803; 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=CgJWcaBMlfDV/GS0OFmt0AQWM5Cd6oY/kAp+UWCGnXQ=; b=C6TV87huevUi6G9w9tXu9C7CwSotffxOpXhzLMFVO2NUQrCgY4AeUueueb6gP+xJ/MrrHE AWtRgrHxx0vM9C/hfAeTrIZ3SrSB8L2J7I0siZ7YvolTnwoOaSDLokjmklfxoJueQNO+Bm 0RK+ydTHX62blJM3LyOVY+Z9S0aaWEiUC1P4md/jlZbiizhb1MFC5Y8U2iF/y0U7fmiFzY TXhAN6tqF8vDJ3tN/HoQf0/+MwxrSEHL+/duTQNzzhw+4j5QjrjFeGBA6UE8wOm+jeFIX8 gd+kSMAqn4reS6CQLPk9AUFWqCadJ72hnKAO+jfu5kRCMkN26pCJMXDIK9WgeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751230803; a=rsa-sha256; cv=none; b=O16NwPUbW68TI/MJofo5l+ZRDbwo9jKQY+SaEasZhJIt7/FQH23mGUw/3LiRCMb94Y5221 nvqYpgzhvHajnzoSQKJZinFDEXK3T35C4bWqY4oUudqSpe3RREmtOBStSfMcmohcHrs+t1 IaZJJon/41kFXLh4bP8XDGBnfbzAlzecl5AgGpZ3AMMX0tjoopsnok1VVTDUWHzk60xRqC e+MOIxswRkyFvBsLEJLxTH2JAAlw6i2YOdWCmT1q2KDSffwDJt+weD/je+q/D3ePBXn0X/ UDyzk6L4KucuZFl93Tf0nDS96O6FFNPzSBFwxbnMIrQvq4gag0AjWuyXH8gUcA== 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 4bVhWR5B4Fzbf9; Sun, 29 Jun 2025 21:00:03 +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 55TL03Mw004028; Sun, 29 Jun 2025 21:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TL03Qr004023; Sun, 29 Jun 2025 21:00:03 GMT (envelope-from git) Date: Sun, 29 Jun 2025 21:00:03 GMT Message-Id: <202506292100.55TL03Qr004023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 6506b22772fb - stable/14 - if_vlan_var.h: fix value of DOT1Q_VID_MAX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6506b22772fbcc2b3f2d05bf12a23f877a26fa86 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=6506b22772fbcc2b3f2d05bf12a23f877a26fa86 commit 6506b22772fbcc2b3f2d05bf12a23f877a26fa86 Author: Lexi Winter AuthorDate: 2025-06-04 05:33:05 +0000 Commit: Lexi Winter CommitDate: 2025-06-29 20:59:50 +0000 if_vlan_var.h: fix value of DOT1Q_VID_MAX This should be 4094 (0xFFE), not 4095 (0xFFF), since 0xFFF is not a valid VID. Fixes: c59492025073 ("sys/net: add DOT1Q_VID_{MIN,MAX}") MFC after: 3 days Reviewed by: kevans, kp, adrian Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50576 (cherry picked from commit d9b6b10e5ebbb517a079e89ac0de99be3b815c8d) --- sys/net/if_vlan_var.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index e7171974289b..3a8e45dfab03 100644 --- a/sys/net/if_vlan_var.h +++ b/sys/net/if_vlan_var.h @@ -131,7 +131,7 @@ struct vlanreq { #define DOT1Q_VID_DEF_SR_PVID 0x2 #define DOT1Q_VID_RSVD_IMPL 0xfff #define DOT1Q_VID_MIN 1 /* minimum valid vlan id */ -#define DOT1Q_VID_MAX 4095 /* maximum valid vlan id */ +#define DOT1Q_VID_MAX 4094 /* maximum valid vlan id */ /* * 802.1q full tag. Proto and vid are stored in host byte order. From nobody Sun Jun 29 21:00:04 2025 X-Original-To: dev-commits-src-branches@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 4bVhWT5KZPz60gCh; Sun, 29 Jun 2025 21:00:05 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVhWS6cRlz3X3p; Sun, 29 Jun 2025 21:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230804; 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=N67InKDVIN+a5CBuL/lvfbn49acgXkh1wGGwcxpC4mI=; b=efw6OM571+8Qq+NhVkjE++0GdTlQ+Q/oGma+zNaOqFmEni/DaHBDBtW4tXGrjMjYzh1O5V 9PI4HF8EPzr5eBLc9vppBwiCbXSwTpv43c4b6CjMxSD66zQcSmm0YyyvWLcV42BD2cfJjT wgfSdDhcLlstN7ebhnXAWqyiH4ymACH9R1YohiECzn+8/j85jrgB+DdATcAVI1vPsrHaXE nRPlbqvoecm9yJSwgttnCoc8g+tixGpZnnkaxRNrxaFRfK/FJ0m+UOuMmSy2koyYmmSRri AutQIIOYjpGxCO9rYrjwIZr12Q+G0jqRXrQlVo/Xae62PE+9YJaykoftxZdpug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751230804; 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=N67InKDVIN+a5CBuL/lvfbn49acgXkh1wGGwcxpC4mI=; b=XTKLy/Xqvrq7gHgJpdT+Z1j7XdLfNHCvVldQ+OasDKVwmBRBFT1ys7x8H9BDVv2LntDGlG D5JJnmtJKHphUURhN1HIrfY4JRoP+Qsqf+OER6+hmhBZs9gETZvSNeuu/Wk+pHXLq8ijX3 G0e6vnmZ7wt5Izj1y8WlkXiRHiFn2glLo65UzWahLhlcnflrWvUIQVPKNSMbJgiAdoM8lB J1tlEX8Ff28/csGJ4/M5UCPIe/QL6d+U/hyVe1HZyEJ49M1D9AgA6XklvLQXwcOZQkIMTU 81Qiiq3wrH1Er/jGh3Chdp4Vw5axELInfFHWmZCdoVhBUaf8u+Jj+HsQWOC33Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751230804; a=rsa-sha256; cv=none; b=GecFDjXnEZ2u1XOkEtKNeoGLUiLxfm33nI8Qbyw0xmkDL4oomuBFGdTWMwZStP9Rxye/2X LTSXiU3egtpJ+cNbiP1EWNvthO/MeymGbkoBgHJbSC/5GYILRdk+P5CHhppCwBgw1zOqfd 1qAMDy9EjgwdS3eQtBhbs5sqkyUwQL0xk6UiKYfZ2V6aJMPHc4BJu+tsADwuwF4YIJRDGH NgqNksZd8/vvX41UHZ0G1LkMmUSGMMwUwdHoAeYbYsMCkiA1Pm8F4l8LspLZd4MIPhMRzy CfnhVTc2JyUZ/Sc4R0Dg+xsznHOFXeFq3uM2z0g3kNx3MNyUM6MOrAqOYa6ZMQ== 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 4bVhWS61cGzbwR; Sun, 29 Jun 2025 21:00:04 +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 55TL04FB004302; Sun, 29 Jun 2025 21:00:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55TL042S004299; Sun, 29 Jun 2025 21:00:04 GMT (envelope-from git) Date: Sun, 29 Jun 2025 21:00:04 GMT Message-Id: <202506292100.55TL042S004299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: bc6ec9642b5a - stable/14 - kyua: increase cleanup_timeout to 300s List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc6ec9642b5a045fd0932fbbc9f73bd9564c1af3 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=bc6ec9642b5a045fd0932fbbc9f73bd9564c1af3 commit bc6ec9642b5a045fd0932fbbc9f73bd9564c1af3 Author: Lexi Winter AuthorDate: 2025-06-04 05:35:51 +0000 Commit: Lexi Winter CommitDate: 2025-06-29 20:59:50 +0000 kyua: increase cleanup_timeout to 300s Test cleanup times out after 60 seconds, causing the test to fail if the cleanup hasn't finished in time. This timeout should be configurable, but it currently is not. Several tests (e.g. bridge, pf) are now reaching this limit; as a workaround, increase the timeout to 300 seconds. Reviewed by: igoro, kevans, des Approved by: des (mentor), kevans (mentor) Differential Revision: https://reviews.freebsd.org/D50499 (cherry picked from commit 0e33211f911c906b47cd0c457a86372c4b5daf87) --- contrib/kyua/engine/scheduler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/kyua/engine/scheduler.cpp b/contrib/kyua/engine/scheduler.cpp index d4507a247323..bea9ed7601a6 100644 --- a/contrib/kyua/engine/scheduler.cpp +++ b/contrib/kyua/engine/scheduler.cpp @@ -86,11 +86,11 @@ using utils::optional; /// /// TODO(jmmv): This is here only for testing purposes. Maybe we should expose /// this setting as part of the user_config. -datetime::delta scheduler::cleanup_timeout(60, 0); +datetime::delta scheduler::cleanup_timeout(300, 0); /// Timeout for the test case execenv cleanup operation. -datetime::delta scheduler::execenv_cleanup_timeout(60, 0); +datetime::delta scheduler::execenv_cleanup_timeout(300, 0); /// Timeout for the test case listing operation.