Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2016 20:23:51 +0100 (CET)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        Andrey Fesenko <f0andrey@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: EFI zfs loader and beadm?
Message-ID:  <alpine.BSF.2.20.1603102014210.1014@mail.fig.ol.no>
In-Reply-To: <CA%2BK5SrNKtqcc79ipgx7hsRvM7n5Z-WUNDAzzeugizimTTMT_=Q@mail.gmail.com>
References:  <CA%2BK5SrPZ-esGHU=rggSgOFiyy4NqOWhP31rfO4S=P9=m10pEbw@mail.gmail.com> <56E045C8.1040000@vangyzen.net> <CA%2BK5SrPhwH4%2BtSHs9d=xg1mzBbojtWwXhMqFeL0MdKmAJywKTg@mail.gmail.com> <CALfReydcsb-MhaTYAwMeEkJm0QGgUsgSweUC%2BObOFKSv-G4QYw@mail.gmail.com> <CA%2BK5SrOuah4j_U_qPpnfqPo5nhSF7DKwYR63wiW85Qj0bbOiHA@mail.gmail.com> <CALfReyceEMiN7czQ9wU8oBTC706jdL9JnoED6r3g%2BhaH30J%2BQw@mail.gmail.com> <CA%2BK5SrPAhtt3cao1-i54z6dDpdFh7UXLqD7WPBs2jhYxb6EAKA@mail.gmail.com> <CALfReyfoxgzTk%2Be9EMdheE=0TCP0g_eVDr_wajyrz1AiGoPWNQ@mail.gmail.com> <CA%2BK5SrNKtqcc79ipgx7hsRvM7n5Z-WUNDAzzeugizimTTMT_=Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Mar 2016 18:38+0300, Andrey Fesenko wrote:

> On Thu, Mar 10, 2016 at 6:11 PM, krad <kraduk@gmail.com> wrote:
> > As Eric said you cant have /boot on a separate dataset as the whole loader
> > bootstrap isnt designed too look for it on the dataset defined by bootfs.
> > Remember no other datasets are mounted at that stage of the bootstrap.
> >
> > You could maybe bodge something by manually playing around with the bootfs
> > property, symlinks and rootfs variables in the loader.conf.  But why would
> > you want to do this? It's more work and non standard, and will break a lot?
> >
> >
> >
> > On 10 March 2016 at 12:11, Andrey Fesenko <f0andrey@gmail.com> wrote:
> >>
> >> On Thu, Mar 10, 2016 at 2:55 PM, krad <kraduk@gmail.com> wrote:
> >> > presumably it boots now?
> >> >
> >> > On 10 March 2016 at 11:01, Andrey Fesenko <f0andrey@gmail.com> wrote:
> >> >>
> >> >> On Thu, Mar 10, 2016 at 1:49 PM, krad <kraduk@gmail.com> wrote:
> >> >> > Make sure you are running the latest snapshot of current or 10.3 as
> >> >> > well, as
> >> >> > the MFC commits were in early February for 10-stable
> >> >> >
> >> >> >>
> >> >> >> If remove efiwpool/ROOT/init/boot and copy his content on
> >> >> >> efiwpool/ROOT/init my scheme work fine too.
> >> >> >> /usr /var /home and other included in BE for consistent boot system
> >> >> >> (CURRENT world may not boot with kernel other rev),  and old home
> >> >> >> snapshot sometimes useful for backup/restore
> >> >> >> _______________________________________________
> >> >>
> >> >> % uname -a
> >> >> FreeBSD x220.efi.local 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r296548:
> >> >> Wed Mar  9 01:16:17 MSK 2016
> >> >> root@des.local:/usr/obj/usr/src/sys/X220  amd64
> >> >
> >> >
> >>
> >> My current working config
> >> % mount
> >> ....
> >>
> >> This work fine, booted, beadm create new env, activate them, see boot
> >> menu and select BE.
> >>
> >> % beadm list
> >> BE    Active Mountpoint  Space Created
> >> init  -      -          420.7M 2016-03-09 02:57
> >> init0 NR     /           35.9G 2016-03-10 05:00
> >>
> >> If i'm add separate dataset for /boot (efiwpool/ROOT/init0/boot)
> >> system not booted, efi loader (first stage) see only my pool, not
> >> found /boot/loader.efi
> >
> >
> 
> It probably does not matter, as bootfs have snapshots (BE), just
> wanted to make it more clear (having taken significant mountpoint
> /boot, /usr, /var... in zfs dataset) and was surprised why the system
> does not boot
> 
> It is clear that as long as the functionality is experimental and
> under development, but would like to see where the full instructions
> on its implementation / restrictions, at least as early as has been
> described https://wiki.freebsd.org/RootOnZFS

If you keep /boot as a separate dataset/filesystem, with 
efiwpool/ROOT/init0/boot as the given bootfs, then boot1.efi will not 
see a /boot directory inside that dataset. The files and directories 
from /boot will be presented as living in /, the local root directory 
of that dataset.

You could create a /boot/boot symlink pointing to . (dot), but it's 
better to let /boot be part of the regular boot environment, pretty 
similar to what you would find on a UFS system using a separate root 
filesystem.

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+
From owner-freebsd-hackers@freebsd.org  Thu Mar 10 20:18:22 2016
Return-Path: <owner-freebsd-hackers@freebsd.org>
Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D604EACB7DA
 for <freebsd-hackers@mailman.ysv.freebsd.org>;
 Thu, 10 Mar 2016 20:18:22 +0000 (UTC) (envelope-from jilles@stack.nl)
Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client CN "mailhost.stack.nl",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id A39FE3BC
 for <freebsd-hackers@freebsd.org>; Thu, 10 Mar 2016 20:18:22 +0000 (UTC)
 (envelope-from jilles@stack.nl)
Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161])
 by mx1.stack.nl (Postfix) with ESMTP id 9A8B23592FB;
 Thu, 10 Mar 2016 21:18:19 +0100 (CET)
Received: by toad2.stack.nl (Postfix, from userid 1677)
 id 70F99892D0; Thu, 10 Mar 2016 21:18:19 +0100 (CET)
Date: Thu, 10 Mar 2016 21:18:19 +0100
From: Jilles Tjoelker <jilles@stack.nl>
To: C =?iso-8859-1?Q?Bergstr=F6m?= <cbergstrom@pathscale.com>
Cc: Jason Hellenthal <jhellenthal@dataix.net>,
 "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>,
 Brendan Sechter <sgeos@hotmail.com>
Subject: Re: FreeBSD sh on Linux?
Message-ID: <20160310201819.GA5821@stack.nl>
References: <BAY182-W443C0171FBBA73A3A2B2FAA2B30@phx.gbl>
 <8EC0DC6F-FA0D-4B8D-AECE-F1F797EE4D56@dataix.net>
 <CAOnawYoEpMc=Ad1L5QSdJQR3sT-=RfFwD28gBx0PfSp0zmJxxg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAOnawYoEpMc=Ad1L5QSdJQR3sT-=RfFwD28gBx0PfSp0zmJxxg@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
 <freebsd-hackers.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-hackers>, 
 <mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers/>;
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
 <mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 10 Mar 2016 20:18:22 -0000

On Wed, Mar 09, 2016 at 08:27:05PM +0700, C Bergström wrote:
> On Wed, Mar 9, 2016 at 8:13 PM, Jason Hellenthal
> <jhellenthal@dataix.net> wrote:

> > On Mar 9, 2016, at 02:06, Brendan Sechter <sgeos@hotmail.com> wrote:

> > > Is there any reason why FreeBSD sh can't be used on Linux?  dash
> > > is not a suitable login shell and bash is GNU.

You'd need to do some work to make it compile. There is a package called
libbsd which should be helpful.

The filename completion in FreeBSD sh also uses a FreeBSD-local patch to
libedit. This will be problematic if you want to maintain a package in a
distribution.

> > It's just the ash(1) shell with a few modifications that's a little
> > more standard than most. Shouldn't be any reason why it can't

There are quite a few bugfixes, features and performance improvements
that are in FreeBSD sh and not in most other ash variants, such as UTF-8
support, $'...' to embed control characters and Unicode more easily,
simple command substitutions without fork() and vfork() use. Therefore,
I think the original question is reasonable, if the request is for a
scripting shell (including for system() and make).

> /* not meaning to be a troll */

> If you're going down this route - there's also ksh93 from solaris,
> which may be easy to extract (or maybe has done so already.. not sure)
> in my experience it's that nice balance between bare minimum sh and
> bash.

ksh93 is in ports.

I think it is more rather than less featureful than bash, though. It has
programming features such as lexically-scoped variables and user-defined
data types. Interactive features are a bit more limited. It is quite
fast as well.

Downsides are that it can be buggy, development has slowed down,
commonly available versions are quite incompatible with other shells and
the programming features are still not nearly as good as more modern
non-shell programming languages such as Python.

> There's also fish and zsh if you want tons of features..

I think those are better choices for interactive use.

There is also mksh which is in between FreeBSD sh and bash in features.
I don't like it for interactive use because it does not support editing
a very long logical line such as a for loop on multiple physical lines,
but you may not mind that.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1603102014210.1014>