From owner-freebsd-current@FreeBSD.ORG Fri Oct 14 15:58:49 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B768F106566B; Fri, 14 Oct 2011 15:58:49 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1C5878FC0A; Fri, 14 Oct 2011 15:58:48 +0000 (UTC) Received: by wyj26 with SMTP id 26so4424181wyj.13 for ; Fri, 14 Oct 2011 08:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=+eIfQRTlLjcB8OUuQPl+YMFivQGTptSwAr0lY/1vSfY=; b=jji1vMlouDO+6MXlJjiCvlNFQHDw9mSHxHqK+L2mG8MeLDhWV4FM9xaWHWP9X4BUhV v1RtcJOV1onblXC+7EIDZ4l+j0vrI6cu+9ApZKQgQlKZgqwm/sGv6B5azMhlaNVZGnrS fUQ9Gmbs/Y62GtxVm2QUE0shCb0ZLvyF/jMLk= MIME-Version: 1.0 Received: by 10.216.133.5 with SMTP id p5mr137293wei.34.1318607927784; Fri, 14 Oct 2011 08:58:47 -0700 (PDT) Received: by 10.180.103.198 with HTTP; Fri, 14 Oct 2011 08:58:47 -0700 (PDT) In-Reply-To: <1318607697-31950-1-git-send-email-lacombar@gmail.com> References: <4E984BF9.4000700@FreeBSD.org> <1318607697-31950-1-git-send-email-lacombar@gmail.com> Date: Fri, 14 Oct 2011 11:58:47 -0400 Message-ID: From: Arnaud Lacombe To: avg@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Current , Arnaud Lacombe Subject: Re: possible mountroot regression X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2011 15:58:49 -0000 Hi, On Fri, Oct 14, 2011 at 11:54 AM, Arnaud Lacombe wrote= : > Andry Gapon wrote: >> Simple: revert to the previous behavior. =A0If a user enters incorrect d= evice name >>(i.e. root mounting fails), then return back to the prompt instead of pan= icing. > That should do the job. > Actually, my primary interest in that patch was to be able to hit to be sure I had the prompt (think a serial console connecting after the message has been displayed), then enter the information. Not sure that'd suit what you expect though. - Arnaud > =A0- Arnaud > > --- > =A0sys/kern/vfs_mountroot.c | =A0 45 +++++++++++++++++++++++-------------= --------- > =A01 files changed, 23 insertions(+), 22 deletions(-) > > diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c > index ccbcb33..ae3ffa7 100644 > --- a/sys/kern/vfs_mountroot.c > +++ b/sys/kern/vfs_mountroot.c > @@ -481,28 +481,29 @@ parse_dir_ask(char **conf) > =A0 =A0 =A0 =A0printf("\n"); > =A0 =A0 =A0 =A0printf(" =A0? =A0 =A0 =A0 =A0 =A0 =A0 =A0 List valid disk = boot devices\n"); > =A0 =A0 =A0 =A0printf(" =A0. =A0 =A0 =A0 =A0 =A0 =A0 =A0 Yield 1 second (= for background tasks)\n"); > - =A0 =A0 =A0 printf(" =A0 =A0 =A0Abort manual input\n"); > + =A0 =A0 =A0 printf(" =A0x =A0 =A0 =A0 =A0 =A0 =A0 =A0 Abort manual inpu= t)\n"); > + > + =A0 =A0 =A0 do { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D EINVAL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("\nmountroot> "); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 gets(name, sizeof(name), GETS_ECHO); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (name[0] =3D=3D '?') { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("\nList of GEOM mana= ged disk devices:\n =A0"); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 g_dev_print(); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (name[0] =3D=3D '.') { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pause("rmask", hz); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (name[0] =3D=3D 'x' && name[1] =3D=3D '\= 0') > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mnt =3D name; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 error =3D parse_mount(&mnt); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (error < 0) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("Invalid specificati= on.\n"); > + =A0 =A0 =A0 } while (error !=3D 0); > > - again: > - =A0 =A0 =A0 printf("\nmountroot> "); > - =A0 =A0 =A0 gets(name, sizeof(name), GETS_ECHO); > - =A0 =A0 =A0 if (name[0] =3D=3D '\0') > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - =A0 =A0 =A0 if (name[0] =3D=3D '?') { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("\nList of GEOM managed disk devices= :\n =A0"); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 g_dev_print(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto again; > - =A0 =A0 =A0 } > - =A0 =A0 =A0 if (name[0] =3D=3D '.') { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 pause("rmask", hz); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto again; > - =A0 =A0 =A0 } > - =A0 =A0 =A0 mnt =3D name; > - =A0 =A0 =A0 error =3D parse_mount(&mnt); > - =A0 =A0 =A0 if (error =3D=3D -1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("Invalid specification.\n"); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto again; > - =A0 =A0 =A0 } > =A0 =A0 =A0 =A0return (error); > =A0} > > -- > 1.7.6.153.g78432 > >