From nobody Mon Dec 16 15:15:21 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 4YBk5j3S3yz5hYRK; Mon, 16 Dec 2024 15:15: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 4YBk5j1Lrbz48N3; Mon, 16 Dec 2024 15:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362121; 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=WjR0sniwCdaEBo4jeLyce2uKLOS5es1g2RtBgb9hH54=; b=m0We14R7pAUioYkc7Dgs3jIOGcQBR7zR6L8yGubS3rns4dusZS+3LYxG5Fn9D7trujV5Tg 40jo7mf+QXx5i6g4JjKBmXcZ8H08TnPHn6seDo/mZ07kbkqM67QzMHnJMMfDYZz/sCRplE tMGic56bmPpipIhSvhVcpPQBBdsNANXZrBrCZt/uHPR9EobBFf+xOSskr65zXPxKB2b6wL pvSwcpA8WJOH4haODv5dYPxRzVZ5xL0LG+Df3dMa6nK8gG8yFPBchBpUrdOAbZioUk+Ui0 5IPiqWdXuylvlnDMiKpVbFlpi7uIKFS7h5ywFru9a21YRDlggWeSbrbDIkAhEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362121; 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=WjR0sniwCdaEBo4jeLyce2uKLOS5es1g2RtBgb9hH54=; b=g0AB9Md5v77Lu6h8m5xelUCVzS9kz/9nCgwmRM1RdskCRc/nTcY4yF16kKF1VD5KjqFtoy YUEFZ1u2t59QXVNVt4TBhMRwVqfG/UlmubuYkeHF+MZyEsDGI2m8GX3g8pKjgZAX0TRBum eHevffb9dyoWyMHhT0kUlfj3Iqs8VA/15Ef20QNsp9FfRP6EasFHbEcSRTz0Y1vk9sEQEZ rpavKWqBdJxeuq0cek6feaCVtwXR7ljDp0hfR4ba+y6TbRCICV1fY+8rBfVY05pIoHjcdb XMH8FTMhXOAUO7MPAW8qEGwvYnAQn3SYSAPMXIyLRA2DdWsvQNXhnzB2aFP3sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362121; a=rsa-sha256; cv=none; b=lVt3sjPQVDVFxGFYITqaOnOYn11VdQ53gqjogmX4JALyy5gZeATTuvGYdnf9yIoUtYRTOD kyVayuFARrm2oTyqSxC60jb1Q0PQaZYnsppGOGzoMCyyBCteTW0rsTEkoeVEYsqDgGoVd2 O5koOSDrhtx8IqS8o9mGdHoOHs2c/pdcWXIVkEDC0sUQi6zIUBK4MA9EAf7mg960lZaeKd ElxOGy6u8howydBSymAX8I8YUn1OOzdTeWsubDS4DHRCePRxOGyjRu2IGE0pUgAG56YjHD spDK6MZr96E7Pi6bR+aGhp7obYhY0B5nanbrYFaa4ueYZhTqefrw2namP+VpDQ== 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 4YBk5j0yXmzyJf; Mon, 16 Dec 2024 15:15: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 4BGFFL2c011910; Mon, 16 Dec 2024 15:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFLr9011907; Mon, 16 Dec 2024 15:15:21 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:21 GMT Message-Id: <202412161515.4BGFFLr9011907@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: a641dd41fcaf - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: a641dd41fcafade204d6b8dabcf235c32eacc70b Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a641dd41fcafade204d6b8dabcf235c32eacc70b commit a641dd41fcafade204d6b8dabcf235c32eacc70b Author: Jose Luis Duran AuthorDate: 2024-11-08 18:13:48 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:19 +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 d5d357d9ad19..bb1e96b911e5 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