Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Oct 2011 11:58:47 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        avg@freebsd.org
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, Arnaud Lacombe <lacombar@gmail.com>
Subject:   Re: possible mountroot regression
Message-ID:  <CACqU3MVgDH9URcuPaGOYLVV9xw5TgRsWLaa%2BS7OwpL4B3pwJTw@mail.gmail.com>
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>

index | next in thread | previous in thread | raw e-mail

Hi,

On Fri, Oct 14, 2011 at 11:54 AM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Andry Gapon wrote:
>> Simple: revert to the previous behavior.  If a user enters incorrect device name
>>(i.e. root mounting fails), then return back to the prompt instead of panicing.
> That should do the job.
>
Actually, my primary interest in that patch was to be able to hit
<enter> 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

>  - Arnaud
>
> ---
>  sys/kern/vfs_mountroot.c |   45 +++++++++++++++++++++++----------------------
>  1 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)
>        printf("\n");
>        printf("  ?               List valid disk boot devices\n");
>        printf("  .               Yield 1 second (for background tasks)\n");
> -       printf("  <empty line>    Abort manual input\n");
> +       printf("  x               Abort manual input)\n");
> +
> +       do {
> +               error = EINVAL;
> +               printf("\nmountroot> ");
> +               gets(name, sizeof(name), GETS_ECHO);
> +               if (name[0] == '?') {
> +                       printf("\nList of GEOM managed disk devices:\n  ");
> +                       g_dev_print();
> +                       continue;
> +               }
> +               if (name[0] == '.') {
> +                       pause("rmask", hz);
> +                       continue;
> +               }
> +               if (name[0] == 'x' && name[1] == '\0')
> +                       break;
> +               mnt = name;
> +               error = parse_mount(&mnt);
> +               if (error < 0)
> +                       printf("Invalid specification.\n");
> +       } while (error != 0);
>
> - again:
> -       printf("\nmountroot> ");
> -       gets(name, sizeof(name), GETS_ECHO);
> -       if (name[0] == '\0')
> -               return (0);
> -       if (name[0] == '?') {
> -               printf("\nList of GEOM managed disk devices:\n  ");
> -               g_dev_print();
> -               goto again;
> -       }
> -       if (name[0] == '.') {
> -               pause("rmask", hz);
> -               goto again;
> -       }
> -       mnt = name;
> -       error = parse_mount(&mnt);
> -       if (error == -1) {
> -               printf("Invalid specification.\n");
> -               goto again;
> -       }
>        return (error);
>  }
>
> --
> 1.7.6.153.g78432
>
>


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MVgDH9URcuPaGOYLVV9xw5TgRsWLaa%2BS7OwpL4B3pwJTw>