From nobody Mon Dec 16 15:14:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YBk4t6CkQz5hYR6; Mon, 16 Dec 2024 15:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4t5S4Gz46F1; Mon, 16 Dec 2024 15:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362078; 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=zZKTfOkHeUWwVnDV/mURU9IdQecpLzERNkrAMx3dkX4=; b=iFCs/xggO/72xfF6kBZMq0riX1kIeKp/NqVwzi0QJJqswwC1801PdLCGN/rc1dxJ83mPAs 5VhhmOnPRkgd0P8hOQE5NHNPQnKXp4rHwQL5NAlMX2qbH/SULZ54rk038ZDx1+6JoDngdy iIwga9YRecdQ30cIPwWKj7Ny37oX1bW8zzgSdb2Zmj+P8EWx/oUZVuH1/BH0Vr87RwBubq CgQMHqxSBcsy3NsdyWSC8u9V7EDQYlCgrs40BX8AOQHcvIF0mhIaj6AMkBi9HWdhK0uieU c8uVKyjGP08c9Cm+0nZH2ET1IT8Kqx1qXhy2kgJRSeqx3h2RXP7AlAcREkzaIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362078; 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=zZKTfOkHeUWwVnDV/mURU9IdQecpLzERNkrAMx3dkX4=; b=Zz+JoQww+eiOwpPGgdXgk8BETo2fl1R3UFC104L2EVd3C11k73m5PoNrhYF8ZwzkQpO02P 6Sr88VnfS4jmsXcbOR2e0tTBWrYfPrZvdtNsddMpH8u1V0nY8NTS807J6IMgJhbFpneoG/ CUt835s5CXfETKlUqN88+sj/Rk4FvnpEoGoAjSpMR4OrKzbdhOKGU7y6vkGCGTQthotQNe DkhBy8xclvAAgRRaralceNEcNvO8aAgzojALtJekhWUDk635zJt/hI5w2htIyGHf2e1i2r 8qkNFVh6ZToCrWW6hRKaxeEiaAcHabNHRhKvZ0zLfqrm6T0HaTnycYvh8Nv9eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362078; a=rsa-sha256; cv=none; b=Tj3F+BvoN2JJZ1oh32ZFChjq0+jPmsWSqzkWAFWLT6IUhmL1FH9+rsffUWPDRSs7DDZ35U ORCZrNeHcdk37phZLAj2sqn/iZPbyFEzEcDczZpCQzynC+XZbZPEDz0NSkv8Iffo7zuoaR Yj9iLukYX9PnRzKQQjiASavSZOR3GBYUyb/O+Xv+h/2H3/ft9H4JEe7amov2kNtmXeY3HI iPeUERM5dFY+3uFRChg2Mo4gRLwP//FxEa+wGY6TgNxzcx8vbmtzbDBtporMk5HJkNRp/1 zlgCHRyByW+RXXRN2fMEBvm0l4viamIxb9CqT4mbMqhRh6c2bIn8SFQgnUno7A== 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 4YBk4t54N3zyjf; Mon, 16 Dec 2024 15:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEcWP011121; Mon, 16 Dec 2024 15:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEcqk011118; Mon, 16 Dec 2024 15:14:38 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:38 GMT Message-Id: <202412161514.4BGFEcqk011118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6df2857eaa53 - stable/14 - nanobsd: Avoid read-only file system warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6df2857eaa53d640d9bc729135f95179948cc9df Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6df2857eaa53d640d9bc729135f95179948cc9df commit 6df2857eaa53d640d9bc729135f95179948cc9df Author: Jose Luis Duran AuthorDate: 2024-11-08 18:13:48 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:39 +0000 nanobsd: Avoid read-only file system warnings The default setting of some loader or rc variables generate warnings because the file system is read-only: Set the following options to avoid printing these warnings: /boot/defaults/loader.conf: - hostuuid_load="NO" to disable loading /etc/hostid early at boot time - entropy_cache_load="NO" to disable loading cached entropy at boot time - kern.random.initial_seeding.disable_bypass_warnings="1" to disable logging a warning if the 'bypass_before_seeding' knob is enabled (enabled by default) and a request is submitted prior to initial seeding /etc/defaults/rc.conf: - kldxref_enable="NO" to disable building linker.hints files with kldxref(8) - entropy_boot_file="NO" to disable very early (used at early boot-time) entropy caching through reboots - entropy_dir="NO" to disable caching entropy via cron While here, move rc.conf options before sourcing vendor.conf, so they can be overridden. PR: 277601 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47502 (cherry picked from commit e5579f98c02ff64b0c305f6731c3557ba69c2d25) --- tools/tools/nanobsd/defaults.sh | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 8ce3af149356..e431f6653fec 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -570,13 +570,42 @@ setup_nanobsd_etc ( ) ( # create diskless marker file touch etc/diskless - [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf - - # Make root filesystem R/O by default - echo "root_rw_mount=NO" >> etc/defaults/rc.conf - # Disable entropy file, since / is read-only /var/db/entropy should be enough? - echo "entropy_file=NO" >> etc/defaults/rc.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 boot/defaults/loader.conf + { + echo + echo '### NanoBSD configuration ##################################' + echo 'hostuuid_load="NO"' + echo 'entropy_cache_load="NO" # Disable loading cached entropy at boot time.' + echo 'kern.random.initial_seeding.disable_bypass_warnings="1" # Do not log a warning' + echo " # if the 'bypass_before_seeding' knob is enabled" + echo " # and a request is submitted prior to initial" + echo " # seeding." + } >> boot/defaults/loader.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 boot/defaults/loader.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf + if ! ed -s etc/defaults/rc.conf <<\EOF +/^### Define source_rc_confs, the mechanism used by \/etc\/rc\.\* ##$/i +### NanoBSD options ######################################## +############################################################## + +kldxref_enable="NO" # Disable building linker.hints files with kldxref(8). +root_rw_mount="NO" # Inhibit remounting root read-write. +entropy_boot_file="NO" # Disable very early (used at early boot time) + # entropy caching through reboots. +entropy_file="NO" # Disable late (used when going multi-user) + # entropy through reboots. +entropy_dir="NO" # Disable caching entropy via cron. + +############################################################## +. +w +q +EOF + then + echo "Regular expression pattern not found" + exit 2 + fi [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf # save config file for scripts