All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ZFS root in 10_kfreebsd.in
@ 2010-08-01  0:29 Robert Millan
  2010-08-01 14:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Millan @ 2010-08-01  0:29 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

This adds support for ZFS root in 10_kfreebsd.in.  It works with
current trunk if my grub-mkrelpath patch has been applied, and if
ZFS from grub-extras has been built into GRUB.

[-- Attachment #2: mkconfig.diff --]
[-- Type: text/x-diff, Size: 1583 bytes --]

2010-07-31  Robert Millan  <rmh@gnu.org>

	* util/grub.d/10_kfreebsd.in: Initialize ${kfreebsd_device} as the
	kFreeBSD device name, except on ZFS where the filesystem label is
	used.
	(kfreebsd_entry): On ZFS root, load `opensolaris.ko', `zfs.ko' and
	`/boot/zfs/zpool.cache'.
	Set mountfrom kernel variable using ${kfreebsd_device}.

=== modified file 'util/grub.d/10_kfreebsd.in'
--- util/grub.d/10_kfreebsd.in	2010-08-01 00:14:07 +0000
+++ util/grub.d/10_kfreebsd.in	2010-08-01 00:21:41 +0000
@@ -74,8 +74,27 @@ EOF
 EOF
   fi
 
+  case "${kfreebsd_fs}" in
+    zfs)
+      test -e "${module_dir}/opensolaris.ko"
+      test -e "${module_dir}/zfs.ko"
+
+      printf '%s\n' "${prepare_module_dir_cache}"
+      cat << EOF
+	kfreebsd_module_elf	${module_dir_rel}/opensolaris.ko
+	kfreebsd_module_elf	${module_dir_rel}/zfs.ko
+EOF
+
+      printf '%s\n' "${prepare_boot_cache}"
+  cat << EOF
+	kfreebsd_module		${rel_dirname}/zfs/zpool.cache type=/boot/zfs/zpool.cache
+EOF
+    ;;
+  esac
+
+
   cat << EOF
-	set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE}
+	set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${kfreebsd_device}
 	set kFreeBSD.vfs.root.mountfrom.options=rw
 }
 EOF
@@ -105,6 +124,11 @@ while [ "x$list" != "x" ] ; do
     *)                  kfreebsd_fs=${GRUB_FS} ;;
   esac
 
+  case ${GRUB_FS} in
+    zfs)		kfreebsd_device=$(grub-probe -t label --device ${GRUB_DEVICE}) ;;
+    *)			kfreebsd_device=${GRUB_DEVICE} ;;
+  esac
+
   version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"`
   alt_version=`echo $version | sed -e "s,\.old$,,g"`
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ZFS root in 10_kfreebsd.in
  2010-08-01  0:29 [PATCH] ZFS root in 10_kfreebsd.in Robert Millan
@ 2010-08-01 14:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-08-01 14:16 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

On 08/01/2010 02:29 AM, Robert Millan wrote:
> This adds support for ZFS root in 10_kfreebsd.in.  It works with
> current trunk if my grub-mkrelpath patch has been applied, and if
> ZFS from grub-extras has been built into GRUB.
>   
>   
Go ahead.

P.S. Please adjust your mailer not to use HTML unless necessary
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-01 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-01  0:29 [PATCH] ZFS root in 10_kfreebsd.in Robert Millan
2010-08-01 14:16 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.