Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] Build a separate ZFS-enabled loader.zfs

0 views
Skip to first unread message

John Baldwin

unread,
Nov 17, 2009, 10:18:33 AM11/17/09
to cur...@freebsd.org
This patch is a workaround to enabling ZFS support by default in the boot
loader. It enables building a loader.zfs which is a ZFS-enabled loader and
changing zfsboot and gptzfsboot to use /boot/loader.zfs instead
of /boot/loader. I have only tested that things built ok, I have not
boot-tested it as I don't have ZFS setup anywhere. The patch is available at
http://www.FreeBSD.org/~jhb/loader.zfs/. You will also need to copy
the 'loader.zfs/Makefile' file from that URL into a new
sys/boot/i386/loader.zfs directory after applying the patch.

--
John Baldwin
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Thomas Backman

unread,
Nov 17, 2009, 10:27:51 AM11/17/09
to John Baldwin, cur...@freebsd.org
On Nov 17, 2009, at 4:17 PM, John Baldwin wrote:

> This patch is a workaround to enabling ZFS support by default in the boot
> loader. It enables building a loader.zfs which is a ZFS-enabled loader and
> changing zfsboot and gptzfsboot to use /boot/loader.zfs instead
> of /boot/loader. I have only tested that things built ok, I have not
> boot-tested it as I don't have ZFS setup anywhere. The patch is available at
> http://www.FreeBSD.org/~jhb/loader.zfs/. You will also need to copy
> the 'loader.zfs/Makefile' file from that URL into a new
> sys/boot/i386/loader.zfs directory after applying the patch.

If I may ask (and sorry for my ignorance, but): what problem does this workaround solve?
Isn't the whole problem with ZFS loaders the license, and because of the licence, that a ZFS-capable loader isn't built by default?
In other words: Why not use LOADER_ZFS_SUPPORT as long as you have to choose between setting an option or using a patch? Neither works out of the box, so you might as well pick the solution that already exists, no patching involved.
I can only assume I'm missing something vital. :)

(Please note: Makefiles aren't my strongest suite; I tried to figure the answer out by reading the patch, but couldn't. I wrote my first own Makefile, ~15 lines, this weekend.)

Regards,
Thomas_______________________________________________

Olivier Smedts

unread,
Nov 17, 2009, 11:02:14 AM11/17/09
to Thomas Backman, cur...@freebsd.org
2009/11/17 Thomas Backman <sere...@exscape.org>:

> On Nov 17, 2009, at 4:17 PM, John Baldwin wrote:
>
>> This patch is a workaround to enabling ZFS support by default in the boot
>> loader. �It enables building a loader.zfs which is a ZFS-enabled loader and
>> changing zfsboot and gptzfsboot to use /boot/loader.zfs instead
>> of /boot/loader. �I have only tested that things built ok, I have not
>> boot-tested it as I don't have ZFS setup anywhere. �The patch is available at
>> http://www.FreeBSD.org/~jhb/loader.zfs/. �You will also need to copy
>> the 'loader.zfs/Makefile' file from that URL into a new
>> sys/boot/i386/loader.zfs directory after applying the patch.

Great you made it so fast, I'll try it this evening (4PM here).

Why not call it "zfsloader" (vs "loader", like "zfsboot" vs "boot") ?
Sorry if I'm bikeshedding...

> If I may ask (and sorry for my ignorance, but): what problem does this workaround solve?

I think the problem is not about having something built by default
(like zfs.ko) but to have it loaded in memory. A separate loader would
solve that.

Cheers,
Olivier

> Isn't the whole problem with ZFS loaders the license, and because of the licence, that a ZFS-capable loader isn't built by default?
> In other words: Why not use LOADER_ZFS_SUPPORT as long as you have to choose between setting an option or using a patch? Neither works out of the box, so you might as well pick the solution that already exists, no patching involved.
> I can only assume I'm missing something vital. :)
>
> (Please note: Makefiles aren't my strongest suite; I tried to figure the answer out by reading the patch, but couldn't. I wrote my first own Makefile, ~15 lines, this weekend.)
>
> Regards,
> Thomas_______________________________________________
> freebsd...@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"
>

--
Olivier Smedts _
ASCII ribbon campaign ( )
e-mail: oli...@gid0.org - against HTML email & vCards X
www: http://www.gid0.org - against proprietary attachments / \

"Il y a seulement 10 sortes de gens dans le monde :
ceux qui comprennent le binaire,
et ceux qui ne le comprennent pas."

Nikolay Denev

unread,
Nov 17, 2009, 11:07:55 AM11/17/09
to Thomas Backman, cur...@freebsd.org


I think that you are missing the fact that "built by default" and "loaded by default" are two different things.

Regards,
Niki Denev

Scot Hetzel

unread,
Nov 17, 2009, 2:25:17 PM11/17/09
to Thomas Backman, cur...@freebsd.org
On Tue, Nov 17, 2009 at 9:26 AM, Thomas Backman <sere...@exscape.org> wrote:
> On Nov 17, 2009, at 4:17 PM, John Baldwin wrote:
>
>> This patch is a workaround to enabling ZFS support by default in the boot
>> loader. �It enables building a loader.zfs which is a ZFS-enabled loader and
>> changing zfsboot and gptzfsboot to use /boot/loader.zfs instead
>> of /boot/loader. �I have only tested that things built ok, I have not
>> boot-tested it as I don't have ZFS setup anywhere. �The patch is available at
>> http://www.FreeBSD.org/~jhb/loader.zfs/. �You will also need to copy
>> the 'loader.zfs/Makefile' file from that URL into a new
>> sys/boot/i386/loader.zfs directory after applying the patch.
> If I may ask (and sorry for my ignorance, but): what problem does this workaround solve?

This solution fixes boot issues on systems that are using ZFS to boot
FreeBSD. Currently, if such a system uses the freebsd-update service
to update the system, it receives a /boot/loader that doesn't support
booting from a ZFS root and breaks the boot process.

It also makes it easier to setup a Root On ZFS system, as you will no
longer need to add LOADER_ZFS_SUPPORT to /etc/src.conf and rebuilding
the /boot/loader.

Scot

Robert Noland

unread,
Nov 22, 2009, 1:28:38 PM11/22/09
to John Baldwin, cur...@freebsd.org
On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
> This patch is a workaround to enabling ZFS support by default in the boot
> loader. It enables building a loader.zfs which is a ZFS-enabled loader and
> changing zfsboot and gptzfsboot to use /boot/loader.zfs instead
> of /boot/loader. I have only tested that things built ok, I have not
> boot-tested it as I don't have ZFS setup anywhere. The patch is available at
> http://www.FreeBSD.org/~jhb/loader.zfs/. You will also need to copy
> the 'loader.zfs/Makefile' file from that URL into a new
> sys/boot/i386/loader.zfs directory after applying the patch.

Ok, I made a few changes, but this is tested and working for zfs. I
opted to change the loader name to zfsloader, since we tend to prefix
rather than suffix boot/loader bits and I thought that loader.zfs.old
looked ugly. The following should be a complete patch against -CURRENT.
Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
this to boot the correct loader.

http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch

robert.

--
Robert Noland <rno...@FreeBSD.org>
FreeBSD

John Baldwin

unread,
Nov 23, 2009, 10:03:53 AM11/23/09
to Robert Noland, cur...@freebsd.org
On Sunday 22 November 2009 1:27:32 pm Robert Noland wrote:
> On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
> > This patch is a workaround to enabling ZFS support by default in the boot
> > loader. It enables building a loader.zfs which is a ZFS-enabled loader
and
> > changing zfsboot and gptzfsboot to use /boot/loader.zfs instead
> > of /boot/loader. I have only tested that things built ok, I have not
> > boot-tested it as I don't have ZFS setup anywhere. The patch is available
at
> > http://www.FreeBSD.org/~jhb/loader.zfs/. You will also need to copy
> > the 'loader.zfs/Makefile' file from that URL into a new
> > sys/boot/i386/loader.zfs directory after applying the patch.
>
> Ok, I made a few changes, but this is tested and working for zfs. I
> opted to change the loader name to zfsloader, since we tend to prefix
> rather than suffix boot/loader bits and I thought that loader.zfs.old
> looked ugly. The following should be a complete patch against -CURRENT.
> Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
> this to boot the correct loader.
>
>
http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch
>
> robert.

Looks ok to me, commit!

--
John Baldwin

Edho P Arief

unread,
Nov 27, 2009, 9:30:53 PM11/27/09
to John Baldwin, cur...@freebsd.org, Robert Noland
On Mon, Nov 23, 2009 at 8:42 PM, John Baldwin <j...@freebsd.org> wrote:
> On Sunday 22 November 2009 1:27:32 pm Robert Noland wrote:
>> On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
>>
>> Ok, I made a few changes, but this is tested and working for zfs.  I
>> opted to change the loader name to zfsloader, since we tend to prefix
>> rather than suffix boot/loader bits and I thought that loader.zfs.old
>> looked ugly.  The following should be a complete patch against -CURRENT.
>> Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
>> this to boot the correct loader.
>>
>>
> http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch
>>
>> robert.
>
> Looks ok to me, commit!
>

will this merged back to 8.0-stable?


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Scot Hetzel

unread,
Nov 28, 2009, 1:38:22 AM11/28/09
to Edho P Arief, Robert Noland, cur...@freebsd.org
On 11/27/09, Edho P Arief <edho...@gmail.com> wrote:
> On Mon, Nov 23, 2009 at 8:42 PM, John Baldwin <j...@freebsd.org> wrote:
> > On Sunday 22 November 2009 1:27:32 pm Robert Noland wrote:
> >> On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
> >>
>
> >> Ok, I made a few changes, but this is tested and working for zfs. I
> >> opted to change the loader name to zfsloader, since we tend to prefix
> >> rather than suffix boot/loader bits and I thought that loader.zfs.old
> >> looked ugly. The following should be a complete patch against -CURRENT.
> >> Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
> >> this to boot the correct loader.
> >>
> >>
> > http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch
> >>
> >> robert.
> >
> > Looks ok to me, commit!
> >
>
>
> will this merged back to 8.0-stable?
>

According to SVN r199714 it will be merged in 2 weeks

http://svn.freebsd.org/viewvc/base?view=revision&revision=199714

Scot

Robert Noland

unread,
Nov 28, 2009, 1:06:01 PM11/28/09
to Edho P Arief, cur...@freebsd.org
On Sat, 2009-11-28 at 09:29 +0700, Edho P Arief wrote:
> On Mon, Nov 23, 2009 at 8:42 PM, John Baldwin <j...@freebsd.org> wrote:
> > On Sunday 22 November 2009 1:27:32 pm Robert Noland wrote:
> >> On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
> >>
> >> Ok, I made a few changes, but this is tested and working for zfs. I
> >> opted to change the loader name to zfsloader, since we tend to prefix
> >> rather than suffix boot/loader bits and I thought that loader.zfs.old
> >> looked ugly. The following should be a complete patch against -CURRENT.
> >> Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
> >> this to boot the correct loader.
> >>
> >>
> > http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch
> >>
> >> robert.
> >
> > Looks ok to me, commit!
> >
>
> will this merged back to 8.0-stable?

I plan on it, but the big win won't come until it makes it into a
release or at least a snapshot where you can just install everything
from CD/DVD.

robert.

>
--
Robert Noland <rno...@FreeBSD.org>
FreeBSD

_______________________________________________

Aristedes Maniatis

unread,
Nov 29, 2009, 8:00:05 PM11/29/09
to Robert Noland, Edho P Arief, cur...@freebsd.org
On 29/11/09 5:05 AM, Robert Noland wrote:
> On Sat, 2009-11-28 at 09:29 +0700, Edho P Arief wrote:
>> On Mon, Nov 23, 2009 at 8:42 PM, John Baldwin<j...@freebsd.org> wrote:
>>> On Sunday 22 November 2009 1:27:32 pm Robert Noland wrote:
>>>> On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
>>>>
>>>> Ok, I made a few changes, but this is tested and working for zfs. I
>>>> opted to change the loader name to zfsloader, since we tend to prefix
>>>> rather than suffix boot/loader bits and I thought that loader.zfs.old
>>>> looked ugly. The following should be a complete patch against -CURRENT.
>>>> Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
>>>> this to boot the correct loader.
>>>>
>>>>
>>> http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch
>>>>
>>>> robert.
>>>
>>> Looks ok to me, commit!
>>>
>>
>> will this merged back to 8.0-stable?
>
> I plan on it, but the big win won't come until it makes it into a
> release or at least a snapshot where you can just install everything
> from CD/DVD.
>
> robert.


The big win for us (and many others) will come when freebsd-update picks it up. I assume that means it would have to make it into the errata or security patches for 8.0? Otherwise we'll only see it in 8.1.

Ari


--
-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001 fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A

Robert Noland

unread,
Dec 7, 2009, 12:35:38 PM12/7/09
to Aristedes Maniatis, Edho P Arief, cur...@freebsd.org
On Mon, 2009-11-30 at 11:59 +1100, Aristedes Maniatis wrote:
> On 29/11/09 5:05 AM, Robert Noland wrote:
> > On Sat, 2009-11-28 at 09:29 +0700, Edho P Arief wrote:
> >> On Mon, Nov 23, 2009 at 8:42 PM, John Baldwin<j...@freebsd.org> wrote:
> >>> On Sunday 22 November 2009 1:27:32 pm Robert Noland wrote:
> >>>> On Tue, 2009-11-17 at 10:17 -0500, John Baldwin wrote:
> >>>>
> >>>> Ok, I made a few changes, but this is tested and working for zfs. I
> >>>> opted to change the loader name to zfsloader, since we tend to prefix
> >>>> rather than suffix boot/loader bits and I thought that loader.zfs.old
> >>>> looked ugly. The following should be a complete patch against -CURRENT.
> >>>> Note that you do need to reinstall bootcode (zfsboot/gptzfsboot) for
> >>>> this to boot the correct loader.
> >>>>
> >>>>
> >>> http://people.freebsd.org/~rnoland/0001-Create-a-seperate-zfs-enabled-loader.patch
> >>>>
> >>>> robert.
> >>>
> >>> Looks ok to me, commit!
> >>>
> >>
> >> will this merged back to 8.0-stable?
> >
> > I plan on it, but the big win won't come until it makes it into a
> > release or at least a snapshot where you can just install everything
> > from CD/DVD.
> >
> > robert.
>
>
> The big win for us (and many others) will come when freebsd-update picks it up. I assume that means it would have to make it into the errata or security patches for 8.0? Otherwise we'll only see it in 8.1.
>
> Ari

FYI, this is now merged to 7/8 STABLE.

robert.

>
>
>
--
Robert Noland <rno...@FreeBSD.org>
FreeBSD

_______________________________________________

0 new messages