From owner-freebsd-current@FreeBSD.ORG Fri Oct 14 15:55:06 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 770B4106564A; Fri, 14 Oct 2011 15:55:06 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5C18FC0C; Fri, 14 Oct 2011 15:55:05 +0000 (UTC) Received: by gyd8 with SMTP id 8so1617482gyd.13 for ; Fri, 14 Oct 2011 08:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=KbAsXSBKm8ebeuhcKyHCn2p8CGUj5lI3Dah2QGkKHQ4=; b=VydTM4U7EUWH6X9c2ej/Vsy8m61qVIeruw70y3HxwtHsQ6nkWnm9JTk3QhFRghKLqh AKoj27pUH0y+NbLpfyzDusM2mTCkbEGEBPkEZ3Or972GdTrBf7ztukXittPn2cCR79Qn 2AWh+QIKfXlERdS90m7iwxYQwd3dNSNWXkjIo= Received: by 10.42.108.136 with SMTP id h8mr17003170icp.43.1318607705198; Fri, 14 Oct 2011 08:55:05 -0700 (PDT) Received: from localhost.localdomain ([184.175.13.173]) by mx.google.com with ESMTPS id ge16sm9317678ibb.2.2011.10.14.08.55.03 (version=SSLv3 cipher=OTHER); Fri, 14 Oct 2011 08:55:04 -0700 (PDT) From: Arnaud Lacombe To: avg@freebsd.org Date: Fri, 14 Oct 2011 11:54:57 -0400 Message-Id: <1318607697-31950-1-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.6.153.g78432 In-Reply-To: <4E984BF9.4000700@FreeBSD.org> References: <4E984BF9.4000700@FreeBSD.org> 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:55:06 -0000 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. - 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(" 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