From nobody Thu Feb 10 19:44:02 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E8F119A9655; Thu, 10 Feb 2022 19:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JvnHl0Mh6z3HBx; Thu, 10 Feb 2022 19:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644522243; 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=kL/HVl5TtOHXR83XOIcE6+Za8JbVpPHxTp6CLuSSCP0=; b=wK5AbzQXPhZmV+48U7s3rb/ThriFJNnuwkaJ+PCTZ1nGHWBzI3Nto/BFaGtYjwqOCfZp/P K81m3F8yJcsP/a/Vf9j0QgaQQFtlP7glt/LT/mTf1sOYkmqibFjE+JIdUi2dCgoSZ6UIg/ 1KuHg8xN38dXQMNmn5lr85fFQvRLPzeE24f28al7dkYpoOi51WUWRC/uA7lZ6Gd1uyrWjw 0AdQVtdqFwvMQjuY3912JRcFQlmqATuKXBzHfApGbtSei8PNBsgmE1OSStlnJpkgUiswUY 3i/m15drJt60zOYIqQrnbb3N1pnc4fumchFZQM5FolJOGSvaxJ6cL8bBAFGqXg== 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 9F7B6264B8; Thu, 10 Feb 2022 19:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21AJi2QY035611; Thu, 10 Feb 2022 19:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21AJi2h8035610; Thu, 10 Feb 2022 19:44:02 GMT (envelope-from git) Date: Thu, 10 Feb 2022 19:44:02 GMT Message-Id: <202202101944.21AJi2h8035610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cb51e2bc3db7 - main - rc: Allow the removal of firstboot_sentinel on read-only file systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb51e2bc3db7e266c26d8165243605f0be771e56 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644522243; 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=kL/HVl5TtOHXR83XOIcE6+Za8JbVpPHxTp6CLuSSCP0=; b=FRGx0EJqy+ZF7WeOIt8I2rScPu6ZVlrFBTDWfO2/r7fSD0Wh3mLD1ItREU/sQC44qvY8DS +kEKxkA6Eqd7652DnAl/quHuWwBazwNfcXlqMaDxnjX0yVEKVGoTnH15+w+zoyej60Zesm cXdTvnxjSvtRsV+lJcSLfgwuhQSod9Azxvcr2vMmMhzFTVn2lARYiCgy/QZWevHd2RU4y7 LDEdFCxU4uZOMY4mzW1Bk4nQccNCWxYOLIO37pfNgbsT7HtVs1XVAa4sewAqTqmvdCsrTB WrwokggtjglKQ+D5gfC36WFBcNqlOEx9S2+yc2mxQ2CQvQLjIvgPDJhTmi4Bqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644522243; a=rsa-sha256; cv=none; b=ZRxd6i/spuSP/2Bzmyq7NclbVKS677a8NjqCcTyq+htlXMBORB8VD/HtUo2nbbKhThI8Cw bCCBbXz66SH/rlA/y16cZeIZMtVxf6+D/YlqtyWEZsEzr04gBNbR9g83Ii2s+4rZ99nPXc mBaYBcHe4fwF0zuMA9tFZMt0XeU2uUGIcFqoEjNId1dkR7rYxjmaHiUsL+RIxRGHmWgola jt22L9dlgMDbAERmpBO8VZeUGj/AqAMQA7Oaqzdz3Bj7uJ+mR8pMxD+QIxFDjiSYkfFJLx cjMsSon+PoUhuwD6KdRx04MxQfcf++a/eTqOeMg9KrSY0qYSyXWx2gk0LPjENA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cb51e2bc3db7e266c26d8165243605f0be771e56 commit cb51e2bc3db7e266c26d8165243605f0be771e56 Author: Jose Luis Duran AuthorDate: 2022-02-10 19:42:36 +0000 Commit: Warner Losh CommitDate: 2022-02-10 19:43:19 +0000 rc: Allow the removal of firstboot_sentinel on read-only file systems NanoBSD or, more generally, systems with root_rw_mount="NO" are not able to remove the firstboot_sentinel file, typically /firstboot, because the logic in /etc/rc is currently inverted. When checkyesno root_rw_mount tests on a read-only file system, the return is 1, hence avoiding the option to mount the system read-write. Restore the ability to remove the firstboot_sentinel file on read-only mounted file systems. This change was introduced in 40adda8665bb, and partially fixed in 1ce07411fae8. Differential Revision: https://reviews.freebsd.org/D34166 --- libexec/rc/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index f117125d2d82..f021251bbd81 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -137,7 +137,7 @@ done # Note: this assumes firstboot_sentinel is on / when we have # a read-only /, or that it is on media that's writable. if [ -e ${firstboot_sentinel} ]; then - checkyesno root_rw_mount && mount -uw / + checkyesno root_rw_mount || mount -uw / chflags -R 0 ${firstboot_sentinel} rm -rf ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then