From owner-svn-src-all@freebsd.org Wed Oct 19 22:45:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7032DC194A2 for ; Wed, 19 Oct 2016 22:45:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38FC2E28 for ; Wed, 19 Oct 2016 22:45:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id m138so50371423itm.0 for ; Wed, 19 Oct 2016 15:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Md3F7Z850xxv3DPYHfxf0ZxGnUmyZhpqHdo7hAHn59s=; b=aOW4MlZgRa0QUMEVzqWfo7Bb6wFFfteP+OVXVoYCw5agANfp11Vx6Y6G3r/2dBOC1M RUvIal2P48WJVrDDRJGPnv/5JNAqdSZQoL+RPzjQw6yHcY3Ltl3kwZxtLecxWL4y23B6 Xzjrzh214QdYySmV21dvgB6tIgbgeF2+jipcWsq1ob/RwLUY3toNdD+7GX1u+w0kFiX5 hH+qZs5b65++AdQBqm3CBr9NCDiS8lqXltbQwgc/XTiheQEyErP2fEWHrv+qTAzscPnN xkLXJQS8pIgsQRivzE68RslBGFO2UkYZp9270ipOay5a1PECEl4KVpg2qbkH5C3CHfEd I2ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Md3F7Z850xxv3DPYHfxf0ZxGnUmyZhpqHdo7hAHn59s=; b=O2mp9KlmOmkTV6OHA8r7VpZB57aBljbCHK3M2wV4L3kkSoaDofI9lFa1lUEjH6Q0sp evsnUFYtbyUJm10tRh+hl3m7ZitZrIKacLomKeHNb+FMvTUVR6ysS1aK69Jj0uEax497 wMbAAgCh5Zs832rc0xGXDuWtD8YuooiCS+5JTR5LoeGbKSiap2yRBZvhVadCcmAb6qht 8xxYGCbfV/PoaljRKB+3CHyf5r+YjLwG9xUx+5qNcCJpuc+G68/5OSGa7ojNlPH2VCFf bEhAi+xMuUPXbIdhkack8x/eOgqg434S2uDmkJQOUtF2+OI6fiLR5Y9FuJvVVXyXM4u3 4b4g== X-Gm-Message-State: AA6/9RmbCCqMB2XZrVCXbUNCnplzC4qnFZiNqzsJoEt728wuUcLgSiWbCmEBjDsmbDGxeI84Qc6vQfPA9NvllA== X-Received: by 10.36.112.199 with SMTP id f190mr5971283itc.60.1476917121650; Wed, 19 Oct 2016 15:45:21 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Wed, 19 Oct 2016 15:45:21 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20161019202656.GA58917@stack.nl> References: <201610170407.u9H47D5n033011@repo.freebsd.org> <20161019202656.GA58917@stack.nl> From: Warner Losh Date: Wed, 19 Oct 2016 16:45:21 -0600 X-Google-Sender-Auth: JWxJQXXBXdCbYe6P48I7jpn64hU Message-ID: Subject: Re: svn commit: r307469 - head/etc To: Jilles Tjoelker Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 22:45:22 -0000 What missing quotes? It seemed to work find on the system I brought up... I didn't do the case statement because it would be three extra big useless syntactical boogers in the code :) I do like the idea of using checkyesno. Warner On Wed, Oct 19, 2016 at 2:26 PM, Jilles Tjoelker wrote: > On Mon, Oct 17, 2016 at 04:07:13AM +0000, Warner Losh wrote: >> Author: imp >> Date: Mon Oct 17 04:07:13 2016 >> New Revision: 307469 >> URL: https://svnweb.freebsd.org/changeset/base/307469 > >> Log: >> Allow root_rw_mount to be both lower and upper case. Before, if it was >> upper case, you'd wind up with a read-only filesystem when you should >> sometimes. > >> PR: 213549 > >> Modified: >> head/etc/rc > >> Modified: head/etc/rc >> ============================================================================== >> --- head/etc/rc Mon Oct 17 04:07:12 2016 (r307468) >> +++ head/etc/rc Mon Oct 17 04:07:13 2016 (r307469) >> @@ -135,16 +135,16 @@ 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 >> - [ ${root_rw_mount} = "yes" ] || mount -uw / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / >> chflags -R 0 ${firstboot_sentinel} >> rm -rf ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> chflags -R 0 ${firstboot_sentinel}-reboot >> rm -rf ${firstboot_sentinel}-reboot >> - [ ${root_rw_mount} = "yes" ] || mount -ur / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / >> kill -INT 1 >> fi >> - [ ${root_rw_mount} = "yes" ] || mount -ur / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / >> fi >> >> echo '' > > Although I have not tested this, it looks like this will always do the > remounts since the condition is either false or invalid due to missing > quotes. > > Perhaps we can use the checkyesno function from rc.subr or use the same > check that rc.d/root uses (case statement where [Nn][Oo] and the empty > string are no and the rest is yes). > > -- > Jilles Tjoelker