From nobody Sat Nov 16 07:23:45 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 4Xr53P6wvLz5cygx; Sat, 16 Nov 2024 07:23:45 +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 4Xr53P4S7Yz4fkZ; Sat, 16 Nov 2024 07:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731741825; 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=iyiPKLFxoarBeRLD/cAuRqZM3csDsVqPYasM2v8Ii1I=; b=Xmc5+O53SbFzhYM2J2IZoK0VmuTVKT2i9YL8y9icKdZEoJFUspgRYcOOgMzCWOPkF8U/OS WDmHAQfi2rDLmDYNU21pjll6ekunyFHfcv5rgRyom3EoUNQtt38e1iCyZ5B95N7ozh15o3 QG8ZvGnQ3tMY8M7u6HyVGY0PPMo/P/oIlD3A3nPMznjAaun/kDKUdlAEG1/UnRveLSEqLw c5+RNkd3qAsApcA0u1li6rwrAv2vBFeyz7cIrEIqMy3ciwIlsNQWuqCQTp53AR4i4z8F3F OEiHPY7+bXJmpqZGg7XVpqZB3CepTk1PsZ/gVcIKFn+b1PX60+cSpIQ+PuY6jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731741825; 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=iyiPKLFxoarBeRLD/cAuRqZM3csDsVqPYasM2v8Ii1I=; b=ZDGcpY2eAw9THDvj85mmPt9itjKWTwfhA6//+fP41dqPm3/SPv0xtyi61GRzJA7qdnqPeI jtKI9RUBG3HdCl0Cs8NQu8TO6V7A6LajH32O0j3L1mu39HCEa1TwLtu/1gVSkynur3TwFs dfO2PcbwHhoQ4XtM57Qbr23yPaEkcwOCetmuqgttIU5Mq24ZRRASbZkfyxSHyBaIzdNXdb 3lELNcm5V3T6EaxjFIqBZ0oLyZ6PzmgYpLbqxg+oWjNCMCH1aF2HabEQ82xWk6Xnu19AtC lvZbjo/Qn9qQIt4i61f7QYBi3K6F7tfjTNR689oWk4wADe/4xdnfsdXja+N01w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731741825; a=rsa-sha256; cv=none; b=Qec2CzPUObivqZiSA3W0DqRbzvEr9fPB5lqf0ncbTSxYvgNURogdWNni3sdZHpuKIVsK8p 7JTf01I3n8o6pw7xHG8r7QG9KD2wy+bBkatzSI1Guvp5SdlKkZD4jXaeA5MuSkMrBt3nL7 jinSK1Zyc/jRqZFgsKy5rqxfofH0Xirp4yobN7nss2Fo7dOgFRWb+dKLMdtcD2JHJZa0HM dJy/uOxOCiPZfWiZh0PNDwr6Fa0jmaPWi/kKUz+AsG6EkBVGjjmKW7KgqNSJ8hn7rfTzTF F9KUHrMqd1QU6f0dB+rh/28K8qG1uLGyNmAqehUem1l5Seus+qOKkGk3Z8cxvQ== 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 4Xr53P42DJzxbX; Sat, 16 Nov 2024 07:23:45 +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 4AG7NjLs018391; Sat, 16 Nov 2024 07:23:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AG7NjWF018388; Sat, 16 Nov 2024 07:23:45 GMT (envelope-from git) Date: Sat, 16 Nov 2024 07:23:45 GMT Message-Id: <202411160723.4AG7NjWF018388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: e5579f98c02f - main - 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/main X-Git-Reftype: branch X-Git-Commit: e5579f98c02ff64b0c305f6731c3557ba69c2d25 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=e5579f98c02ff64b0c305f6731c3557ba69c2d25 commit e5579f98c02ff64b0c305f6731c3557ba69c2d25 Author: Jose Luis Duran AuthorDate: 2024-11-08 18:13:48 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-16 06:55:57 +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 --- 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 910ec69865df..0161a8ab8fd3 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