From nobody Sun Nov 20 03:32:52 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NFGLp3bZbz4hlJd for ; Sun, 20 Nov 2022 03:33:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NFGLp1dNRz43D3 for ; Sun, 20 Nov 2022 03:33:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id b8so1291491edf.11 for ; Sat, 19 Nov 2022 19:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XUMx4izZRjhFHxRJf6P44fDzusC+WEuQQgGD1SvWrws=; b=Oz5iKDFqfaYfsOaw51jgTZ183JKu31H1SY8NjJSoUW1taU0LeXGtVr0PNplLdU403O F49IeAl7LbqwZDOQIlTf/YSkQ9mzm0EjhbT0TEqT8FfWM6H4Tc7UP6juQKyKkM//0LN6 +1QF3dYydCexlehIq5mUJ07/TlcSel1I02tiy6mu4gSoSHTI8pK8XTwc2BdpxxkrsrFW X0B4NaGIsglB5Bc0iiByramozugQmIzClQCF3//6+AcWU071LFB5pr/X78VM840DeyLy T4iaYc4gb0RKfDW229tx5j0mG1yuJFP6tadd1TrVuqM2VbMfRrfOR4viFE8+AC4wANsI GVag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XUMx4izZRjhFHxRJf6P44fDzusC+WEuQQgGD1SvWrws=; b=5vJFP+sDf3lhDSdHyfXG9mISSJGMCvFpGYZrlzIAfQKisNPkoNx7Bcu+GzfyNu0eSF ex2NyhqIV+geb7nqkLDUlam9MapcgxvbPgJEJWbnlDhCTOQL/PM/xxcdHNwC7eaiabbh 9bMlE5AqEESjcoY7vsT6nlW8CrEc71c/f3WDdnESZzeh/Qb9C9rPqBWdKB9j30jlsZza yo/10z31IeThKb346hYyMoQoMdw3pK1AFAt8bq081ww3ThYYQNsFPwHY+as5USCAn+Pb fU9DVH3Ihwl3gNyfPcxy0BJ3+mUZawPLzZOQ3tm7/UqLuAgL/T1I3pgRyVStkclckMfF od/Q== X-Gm-Message-State: ANoB5pkWcPclO3LXBEUcfwo0oRPjPU6BPFVvnS5sijylAj63lIlkRIds kHLW27QzCro6aC2kr4oQs9iv7fbtcCsHsrgzFN+JwwKte0k= X-Google-Smtp-Source: AA0mqf6iVcyhti3bbIvS6OClNZa3Mggv2rvwthI5kleg6Aev3CqxZ95613IZsEcDlhhSxVp+jlTPit+EJr1dLwP7CFY= X-Received: by 2002:a05:6402:509:b0:466:7500:b5df with SMTP id m9-20020a056402050900b004667500b5dfmr11455534edv.48.1668915184008; Sat, 19 Nov 2022 19:33:04 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: <2E58D34B-F8C5-4291-B019-9E24F56DC3DF@chlastak.cz> <20221120055845.366367f1d371ae4d6eb8d747@dec.sakura.ne.jp> <97A75B5E-6C38-4CFB-9978-7E254595D980@chlastak.cz> <20221120100046.b44741ca341c1593a72f594b@dec.sakura.ne.jp> In-Reply-To: <20221120100046.b44741ca341c1593a72f594b@dec.sakura.ne.jp> From: Warner Losh Date: Sat, 19 Nov 2022 20:32:52 -0700 Message-ID: Subject: Re: loader.conf and rootdev option for memory disk To: Tomoaki AOKI Cc: =?UTF-8?Q?Chlast=C3=A1k_Miroslav?= , FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000b4161705edde9863" X-Rspamd-Queue-Id: 4NFGLp1dNRz43D3 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000b4161705edde9863 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 19, 2022 at 6:01 PM Tomoaki AOKI wrote: > But your previous post shows rootdev=3D there didn't work, and needed > setting vfs.root.mountfrom=3D. > > OTOH, rootdev=3D is reported to work in efi/boot/freebsd/loader.env (with > efi loader) on freebsd-users-jp ML (as it's Japanese ML, in Japanese) > this year. > > So /boot/defaults/loader.conf (/usr/src/stand/defaults/loader.conf) > should be fixed, and what should be set in loader.env should be > documented. > > *Dedicated brand-new manpage or in boot.8 (or in loader.8 describing > rootdev, or loader.conf.8 in contrast with itself). > Reading the code it's complicated. rootdev looks like it overrides the default root... unless vfs.root.mountfrom has already been set. > > On Sat, 19 Nov 2022 22:31:42 +0100 > Chlast=C3=A1k Miroslav wrote: > > > Look at the file /boot/defaults/loader.conf: > > > > =E2=80=A6 > > ### Initial memory disk settings ########################### > > #mdroot_load=3D"YES" # The "mdroot" prefix is arbitrary. > > #mdroot_type=3D"md_image" # Create md(4) disk at boot. > > #mdroot_name=3D"/boot/root.img" # Path to a file containing the image= . > > #rootdev=3D"ufs:/dev/md0" # Set the root filesystem to md(4) > device. > > =E2=80=A6 > > > > =E2=80=94 > > Mira > > > > > On 19 Nov 2022, at 21:58, Tomoaki AOKI > wrote: > > > > > > IIUC, rootdev should be set in loader.env, if needed. > > > `man 5 loader.conf` has nothing about rootdev variable. > > > > > > (It's undocumented, IIRC.) > > > > > > > > > On Sat, 19 Nov 2022 19:57:47 +0100 > > > Chlast=C3=A1k Miroslav > w= rote: > > > > > >> I have my device working for now - but the question is - Is the > documentation and example for =E2=80=9Crootdev=E2=80=9D right or not? > > >> > > >> =E2=80=94 > > >> Mira > > >> > > >>> On 18 Nov 2022, at 21:13, Warner Losh imp@bsdimp.com>> wrote: > > >>> > > >>> > > >>> > > >>> On Fri, Nov 18, 2022 at 12:57 PM Chlast=C3=A1k Miroslav mira@chlastak.cz>>> wrote: > > >>> Hi all, > > >>> > > >>> In the /boot/defaults/loader.conf are these options for memory disk > settings: > > >>> > > >>> #mdroot_load=3D"YES" # The "mdroot" prefix is arbitrar= y. > > >>> #mdroot_type=3D"md_image" # Create md(4) disk at boot. > > >>> #mdroot_name=3D"/boot/root.img" # Path to a file containing the > image. > > >>> #rootdev=3D"ufs:/dev/md0" # Set the root filesystem to md(4= ) > device. > > >>> > > >>> > > >>> But - is this example for rootdev option still right? Because > =E2=80=9Cufs:/dev/md0=E2=80=9D works fine on freebsd 12.1, but on freebsd= 12.3 this does > not work and generates error message: > > >>> > > >>> Can=E2=80=99t determine root device > > >>> > > >>> > > >>> When I use this option with value =E2=80=9C/dev/md0=E2=80=9D or =E2= =80=9Cmd0=E2=80=9D (even with > this option commented out), so the machine boots correctly without any > error. > > >>> > > >>> I think you want vfs.root.mountfrom=3D instead of rootdev=3D here. > > >>> > > >>> Warner > > >>> > > >>> =E2=80=94 > > >>> Mira > > >> > > > > > > > > > -- > > > =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E [Tomoaki AOKI] junchoon@dec.sakura.ne.jp>> > > > > > -- > =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E [Tomoaki AOKI] > > --000000000000b4161705edde9863 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Nov 19, 2022 at 6:01 PM Tomoa= ki AOKI <junchoon@dec.sakur= a.ne.jp> wrote:
But your previous post shows rootdev=3D there didn't work, and n= eeded
setting vfs.root.mountfrom=3D.

OTOH, rootdev=3D is reported to work in efi/boot/freebsd/loader.env (with efi loader) on freebsd-users-jp ML (as it's Japanese ML, in Japanese) this year.

So /boot/defaults/loader.conf (/usr/src/stand/defaults/loader.conf)
should be fixed, and what should be set in loader.env should be
documented.

=C2=A0*Dedicated brand-new manpage or in boot.8 (or in loader.8 describing<= br> =C2=A0 rootdev, or loader.conf.8 in contrast with itself).
=

Reading the code it's complicated.

rootdev looks like it overrides the default root... unless vfs.roo= t.mountfrom
has already been set.
=C2=A0

On Sat, 19 Nov 2022 22:31:42 +0100
Chlast=C3=A1k Miroslav <mira@chlastak.cz> wrote:

> Look at the file /boot/defaults/loader.conf:
>
> =E2=80=A6
> ###=C2=A0 Initial memory disk settings=C2=A0 #########################= ##
> #mdroot_load=3D"YES"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 # The "mdroot" prefix is arbitrary.
> #mdroot_type=3D"md_image"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#= Create md(4) disk at boot.
> #mdroot_name=3D"/boot/root.img"=C2=A0 =C2=A0# Path to a file= containing the image.
> #rootdev=3D"ufs:/dev/md0"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#= Set the root filesystem to md(4) device.
> =E2=80=A6
>
> =E2=80=94
> Mira
>
> > On 19 Nov 2022, at 21:58, Tomoaki AOKI <junchoon@dec.sakura.ne.jp> = wrote:
> >
> > IIUC, rootdev should be set in loader.env, if needed.
> > `man 5 loader.conf` has nothing about rootdev variable.
> >
> > (It's undocumented, IIRC.)
> >
> >
> > On Sat, 19 Nov 2022 19:57:47 +0100
> > Chlast=C3=A1k Miroslav <mira@chlastak.cz <mailto:mira@chlastak.cz>> wrote:
> >
> >> I have my device working for now - but the question is - Is t= he documentation and example for =E2=80=9Crootdev=E2=80=9D right or not? > >>
> >> =E2=80=94
> >> Mira
> >>
> >>> On 18 Nov 2022, at 21:13, Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>> wro= te:
> >>>
> >>>
> >>>
> >>> On Fri, Nov 18, 2022 at 12:57 PM Chlast=C3=A1k Miroslav &= lt;mira@chlastak.cz <mailto:mira@ch= lastak.cz> <mailto:mira@chlastak.cz <mailto:mira@chlastak.cz>>> wrote:
> >>> Hi all,
> >>>
> >>> In the /boot/defaults/loader.conf are these options for m= emory disk settings:
> >>>
> >>> #mdroot_load=3D"YES"=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 # The "mdroot" prefix is arbitrary.
> >>> #mdroot_type=3D"md_image"=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0# Create md(4) disk at boot.
> >>> #mdroot_name=3D"/boot/root.img"=C2=A0 =C2=A0# P= ath to a file containing the image.
> >>> #rootdev=3D"ufs:/dev/md0"=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0# Set the root filesystem to md(4) device.
> >>>
> >>>
> >>> But - is this example for rootdev option still right? Bec= ause =E2=80=9Cufs:/dev/md0=E2=80=9D works fine on freebsd 12.1, but on free= bsd 12.3 this does not work and generates error message:
> >>>
> >>> Can=E2=80=99t determine root device
> >>>
> >>>
> >>> When I use this option with value =E2=80=9C/dev/md0=E2=80= =9D or =E2=80=9Cmd0=E2=80=9D (even with this option commented out), so the = machine boots correctly without any error.
> >>>
> >>> I think you want vfs.root.mountfrom=3D instead of rootdev= =3D here.
> >>>
> >>> Warner
> >>>
> >>> =E2=80=94
> >>> Mira
> >>
> >
> >
> > --
> > =E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E=C2=A0 [Tomoaki AOKI]=C2=A0 = =C2=A0 <j= unchoon@dec.sakura.ne.jp <mailto:junchoon@dec.sakura.ne.jp>>
>


--
=E9=9D=92=E6=9C=A8 =E7=9F=A5=E6=98=8E=C2=A0 [Tomoaki AOKI]=C2=A0 =C2=A0 <= ;junchoon@de= c.sakura.ne.jp>

--000000000000b4161705edde9863--