From owner-freebsd-current@FreeBSD.ORG Fri Oct 19 09:03:16 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16A3BB93; Fri, 19 Oct 2012 09:03:16 +0000 (UTC) (envelope-from yerenkow@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id BCD138FC0C; Fri, 19 Oct 2012 09:03:15 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id k10so411633iea.13 for ; Fri, 19 Oct 2012 02:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IYf4kUUnTtTFhprZsv2vwAx3AHvM10X80eEO64q43MA=; b=bHHl8Be3fxYdG0pugsgM8+YvNXPaLe27w+o5mrLXflnZUIqTy7FepQrPzCc90EPWOH wBqPueDS8oj1nRRixjBubyr+VBtbQTxbL0O/lxnTfVBqlldwcy1zobNtcaEGq8dk5sVV AA2/6Gyh3FtkTprupXgKeDa5RLi0CRbxYe13uCep3iRx+p25Kn4S1vaXP04UpgfEnj8K erJArKD6rXgtNgo7o+fVKeQ0+jYkpdU4ejabbhP3kyghEIVZxrv0r/DkF9DuzbJGV/iV eaFHbGV45oaF6GXLBIbcGPzW18EsdY3YVvV2zBTLaUUmq4qxllKvx38Tlkw6ULlCXASa JM9A== MIME-Version: 1.0 Received: by 10.42.52.5 with SMTP id h5mr393341icg.50.1350637394844; Fri, 19 Oct 2012 02:03:14 -0700 (PDT) Received: by 10.64.32.10 with HTTP; Fri, 19 Oct 2012 02:03:14 -0700 (PDT) In-Reply-To: <508041F9.9050906@FreeBSD.org> References: <507FB6C7.50402@FreeBSD.org> <507FEC7F.4030306@FreeBSD.org> <50801E32.80309@FreeBSD.org> <50802138.8020604@FreeBSD.org> <508041F9.9050906@FreeBSD.org> Date: Fri, 19 Oct 2012 12:03:14 +0300 Message-ID: Subject: Re: A little question about safe mode From: Alexander Yerenkow To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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, 19 Oct 2012 09:03:16 -0000 2012/10/18 Andriy Gapon : > on 18/10/2012 18:33 Andriy Gapon said the following: >> on 18/10/2012 18:20 Andriy Gapon said the following: >>> My guess is that the easiest way to avoid this ambiguity and the confusion that it >>> causes (like the problem you described above) is to prepend "/dev/", if it's >>> missing, right in vfs_mountroot.c before calling kernel_mount(). >> >> A patch (not tested): >> >> --- a/sys/kern/vfs_mountroot.c >> +++ b/sys/kern/vfs_mountroot.c >> @@ -676,6 +676,7 @@ static int >> parse_mount(char **conf) >> { >> char errmsg[255]; >> + char devbuf[MNAMELEN]; >> struct mntarg *ma; >> char *dev, *fs, *opts, *tok; >> int delay, error, timeout; >> @@ -693,6 +694,11 @@ parse_mount(char **conf) >> parse_advance(&tok); >> dev = tok; >> >> + if (dev[0] != '\0' && strncmp(dev, "/dev/", 5) != 0) { >> + snprintf(devbuf, sizeof(devbuf), "/dev/%s", dev); >> + dev = devbuf; >> + } >> + >> if (root_mount_mddev != -1) { >> /* Handle substitution for the md unit number. */ >> tok = strstr(dev, "md#"); >> >> > > Oops, the patch incorrectly assumes that all "device names" are device names, > which is incorrect e.g. for ZFS. Maybe some other filesystems too. > So don't try it :-) I think correct patch should fix path and prepend "/dev/" only for ufs:, for now. Or at least help should mention this moment. > > -- > Andriy Gapon -- Regards, Alexander Yerenkow