Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Nov 2018 04:23:45 -0600
From:      Bill Sorenson <instructionset@gmail.com>
To:        pkubaj@anongoth.pl, freebsd-current@freebsd.org,  FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, freebsd-stable@freebsd.org,  freebsd-fs@freebsd.org
Subject:   Re: FreeBSD/powerpc64 (POWER9) with ZFS on /
Message-ID:  <CACcTwYk4saKBU%2BzB2OtgXK3HxF%2BeveaSg54sR0B8bp5RMJZDDA@mail.gmail.com>
In-Reply-To: <20181105094517.GA42797@smtp.iq.pl>
References:  <20181105094517.GA42797@smtp.iq.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 5, 2018, 3:45 AM Piotr Kubaj via freebsd-ppc
<freebsd-ppc@freebsd.org wrote:
>
> ZFS is by default not available for partitioning in bsdinstall. We can, h=
owever, use manual partitioning in shell to make ZFS partitions.
>
> But what if we want to do ZFS on /? This is currently not supported out-o=
f-the-box. The reason is that Petitboot, used on POWER9 to boot kernel, doe=
sn't support loading modules (at least when booting FreeBSD). ZFS is by def=
ault distributed only as a module, to overcome licensing issues.
>
> There are two ways to boot ZFS on root with Petitboot:
> 1. We can use initramfs, which will load necessary modules. It's said to =
be supported on FreeBSD/powerpc64, but no one knows how to create one for F=
reeBSD :)
> 2. We can actually compile a custom kernel with ZFS in it (not as a modul=
e). This the approach that I use. Unfortunately, I can't redistribute this =
kernel, because of ZFS's license. I created a custom installation iso, whic=
h uses my kernel with ZFS included.
>
> Here are the steps to do it (on an installed powerpc64 system, but should=
 be possible on other architectures after redefining TARGET and TARGET_ARCH=
):
> 1. cd /usr/src/sys/powerpc/conf
> 2. cat << EOF > ZFS
> include GENERIC64
> options ZFS
> EOF
> 3. cd ../../../
> 3. make buildworld buildkernel KERNCONF=3DZFS
> 4. cd release
> 5. make release
>
> When it's done, there will be iso files in /usr/obj/usr/src/powerpc.power=
pc64/release.
>
> You can use it to install ZFS on root.
>
> Note that you need a FAT32 partition to mount on /boot.
> This partition needs to have /boot/etc/kboot.conf file, with a line like:
> FreeBSD=3D'/kernel/kernel kernelname=3D/boot/kernel/kernel vfs.root.mount=
from=3Dzfs:zroot/ROOT/default'
>
> You also need the appriopriate /etc/fstab:
> /dev/nda0p1     /boot           msdosfs rw      2       2
>
> Other than that, howto at https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot#C=
reate_Partitions (from point 2., omit 1.) is totally ok to follow.
>
> Thanks to mmacy for informing me about this little trick with including Z=
FS to kernel.
>
> --
>  _________________________________________
> / It has been said that man is a rational \
> | animal. All my life I have been         |
> | searching for evidence which could      |
> | support this.                           |
> |                                         |
> \ -- Bertrand Russell                     /
>  -----------------------------------------
>         \   ^__^
>          \  (oo)\_______
>             (__)\       )\/\
>                 ||----w |
>                 ||     ||

I don't think there are any license issues distributing a FreeBSD
kernel with ZFS statically linked like there are with Linux. For a
long time it wasn't supported and ZFS will probably never be in
GENERIC but a custom kernel with ZFS built in should be freely
redistributable. I don't claim to be an expert on the license issues
so if someone else has better information feel free correct me.

-Bill Sorenson



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