* [PATCH] grub + FreeBSD's loader(8) + ZFS root
@ 2010-02-22 23:40 Navdeep Parhar
2010-02-23 3:06 ` Warning messages Seth Goldberg
2010-04-07 10:28 ` [PATCH] grub + FreeBSD's loader(8) + ZFS root Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 2 replies; 8+ messages in thread
From: Navdeep Parhar @ 2010-02-22 23:40 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]
Hello grub-devel,
Right now it's not possible to boot using FreeBSD's loader(8) from a ZFS
root filesystem. Grub doesn't indicate to the loader that there is a
ZFS root involved and consequently the loader fails to find the kernel.
The attached patch fixes this. It does not affect those that boot the
kernel directly. This is only for users that want to boot using
FreeBSD's loader.
Why would you want to? IMHO it is much simpler to boot indirectly using
the loader because in that case grub does not have to deal with
device.hints, kernel modules, kFreeBSD.xxx style variables,
/boot/zfs/zpool.cache, etc. As a FreeBSD user, I'm used to putting this
information in the "normal" config files (/boot/loader.conf, device.hints,
etc.) and not in a grub.cfg file. Grub only needs to know where the loader
is, nothing else:
menuentry "FreeBSD 8" {
search -s -l fbsd8
kfreebsd -D /@/boot/zfsloader
}
(fbsd8 is the name of the ZFS root pool)
Let me know if you have any questions. Once again, if you load the
kernel directly and want to load modules and set kFreeBSD.foo.bar=...
yourself, all that will continue to work.
Regards,
Navdeep
[-- Attachment #2: grub+zfsloader.diff --]
[-- Type: application/octet-stream, Size: 1560 bytes --]
diff -r 59814c4fed40 -r 21692a51cebb loader/i386/bsd.c
--- a/loader/i386/bsd.c Thu Feb 18 13:44:25 2010 -0800
+++ b/loader/i386/bsd.c Sun Feb 21 16:34:39 2010 -0800
@@ -54,6 +54,7 @@
static grub_dl_t my_mod;
static grub_addr_t entry, entry_hi, kern_start, kern_end;
static grub_uint32_t bootflags;
+static grub_uint64_t zpool_guid = 0;
static char *mod_buf;
static grub_uint32_t mod_buf_len, mod_buf_max, kern_end_mdofs;
static int is_elf_kernel, is_64bit;
@@ -559,7 +560,7 @@
}
else
grub_unix_real_boot (entry, bootflags | FREEBSD_RB_BOOTINFO, bootdev,
- 0, 0, 0, &bi, bi.tags, kern_end);
+ zpool_guid ? 4 : 0, zpool_guid, &bi, bi.tags, kern_end);
/* Not reached. */
return GRUB_ERR_NONE;
@@ -742,6 +743,7 @@
grub_free (netbsd_root);
netbsd_root = NULL;
+ zpool_guid = 0;
return GRUB_ERR_NONE;
}
@@ -954,6 +956,30 @@
return result;
}
+static void
+grub_fetch_zpool_guid(void)
+{
+ grub_device_t dev;
+ grub_fs_t fs;
+ char *uuid = NULL;
+
+ dev = grub_device_open (NULL);
+ if (! dev)
+ return;
+
+ fs = grub_fs_probe (dev);
+ if (! fs)
+ return;
+
+ if (grub_strcmp(fs->name, "zfs") != 0 ||
+ ! fs->uuid || fs->uuid (dev, &uuid) || !uuid)
+ return;
+
+ zpool_guid = grub_strtoull(uuid, NULL, 16);
+
+ grub_free (uuid);
+}
+
static grub_err_t
grub_cmd_freebsd (grub_extcmd_t cmd, int argc, char *argv[])
{
@@ -1012,6 +1038,7 @@
return err;
}
grub_loader_set (grub_freebsd_boot, grub_bsd_unload, 1);
+ grub_fetch_zpool_guid();
}
return grub_errno;
^ permalink raw reply [flat|nested] 8+ messages in thread* Warning messages
2010-02-22 23:40 [PATCH] grub + FreeBSD's loader(8) + ZFS root Navdeep Parhar
@ 2010-02-23 3:06 ` Seth Goldberg
2010-02-23 8:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 10:28 ` [PATCH] grub + FreeBSD's loader(8) + ZFS root Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 1 reply; 8+ messages in thread
From: Seth Goldberg @ 2010-02-23 3:06 UTC (permalink / raw)
To: The development of GNU GRUB
Hi,
Are these no-prototype warnings normal/expected?
gcc-4.3.2 -Itests/lib -I../tests/lib -nostdinc -isystem /usr/lib/gcc/i386-pc-solaris2.11/4.3.2/include -I../include -I. -I./include -Wall -W -Os -DGRUB_MACHINE_PCBIOS=1 -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-common -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -fno-builtin -mrtd -mregparm=3-m32 -MD -c -o functional_test_mod-tests_lib_functional_test.o ../tests/lib/functional_test.c
../lib/libgcrypt-grub/cipher/camellia.c:447: warning: no previous prototype for 'camellia_setup128'
../lib/libgcrypt-grub/cipher/camellia.c:658: warning: no previous prototype for 'camellia_setup256'
gcc-4.3.2 -Itests/lib -I../tests/lib -nostdinc -isystem /usr/lib/gcc/i386-pc-solaris2.11/4.3.2/include -I../include -I. -I./include -Wall -W -Os -DGRUB_MACHINE_PCBIOS=1 -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-common -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -fno-builtin -mrtd -mregparm=3 -m32 -MD -c -o functional_test_mod-tests_lib_test.o ../tests/lib/test.c
../lib/libgcrypt-grub/cipher/camellia.c:944: warning: no previous prototype for 'camellia_setup192'
../lib/libgcrypt-grub/cipher/camellia.c: In function 'camellia_setup192':
../lib/libgcrypt-grub/cipher/camellia.c:949: warning: implicit declaration of function 'memcpy'
../lib/libgcrypt-grub/cipher/camellia.c: At top level:
../lib/libgcrypt-grub/cipher/camellia.c:966: warning: no previous prototype for 'camellia_encrypt128'
../lib/libgcrypt-grub/cipher/camellia.c:1056: warning: no previous prototype for 'camellia_decrypt128'
../lib/libgcrypt-grub/cipher/camellia.c:1149: warning: no previous prototype for 'camellia_encrypt256'
../lib/libgcrypt-grub/cipher/camellia.c:1263: warning: no previous prototype for 'camellia_decrypt256'
--S
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Warning messages
2010-02-23 3:06 ` Warning messages Seth Goldberg
@ 2010-02-23 8:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 8+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-02-23 8:05 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 2666 bytes --]
Seth Goldberg wrote:
> Hi,
>
> Are these no-prototype warnings normal/expected?
>
GRUB team doesn't manage files under lib/libgcrypt(-grub), they are
imported unmodified from libgcrypt. If you want them fixed, feel free to
contact libgcrypt team and the change will propagate on next resync
>
> gcc-4.3.2 -Itests/lib -I../tests/lib -nostdinc -isystem
> /usr/lib/gcc/i386-pc-solaris2.11/4.3.2/include -I../include -I.
> -I./include -Wall -W -Os -DGRUB_MACHINE_PCBIOS=1 -Wall -W -Wshadow
> -Wpointer-arith -Wmissing-prototypes -Wundef
> -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1
> -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-common
> -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -fno-builtin
> -mrtd -mregparm=3-m32 -MD -c -o
> functional_test_mod-tests_lib_functional_test.o
> ../tests/lib/functional_test.c
> ../lib/libgcrypt-grub/cipher/camellia.c:447: warning: no previous
> prototype for 'camellia_setup128'
> ../lib/libgcrypt-grub/cipher/camellia.c:658: warning: no previous
> prototype for 'camellia_setup256'
> gcc-4.3.2 -Itests/lib -I../tests/lib -nostdinc -isystem
> /usr/lib/gcc/i386-pc-solaris2.11/4.3.2/include -I../include -I.
> -I./include -Wall -W -Os -DGRUB_MACHINE_PCBIOS=1 -Wall -W -Wshadow
> -Wpointer-arith -Wmissing-prototypes -Wundef
> -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1
> -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-common
> -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -fno-builtin
> -mrtd -mregparm=3 -m32 -MD -c -o functional_test_mod-tests_lib_test.o
> ../tests/lib/test.c
> ../lib/libgcrypt-grub/cipher/camellia.c:944: warning: no previous
> prototype for 'camellia_setup192'
> ../lib/libgcrypt-grub/cipher/camellia.c: In function 'camellia_setup192':
> ../lib/libgcrypt-grub/cipher/camellia.c:949: warning: implicit
> declaration of function 'memcpy'
> ../lib/libgcrypt-grub/cipher/camellia.c: At top level:
> ../lib/libgcrypt-grub/cipher/camellia.c:966: warning: no previous
> prototype for 'camellia_encrypt128'
> ../lib/libgcrypt-grub/cipher/camellia.c:1056: warning: no previous
> prototype for 'camellia_decrypt128'
> ../lib/libgcrypt-grub/cipher/camellia.c:1149: warning: no previous
> prototype for 'camellia_encrypt256'
> ../lib/libgcrypt-grub/cipher/camellia.c:1263: warning: no previous
> prototype for 'camellia_decrypt256'
>
>
> --S
>
>
> _______________________________________________
> 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: 293 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] grub + FreeBSD's loader(8) + ZFS root
2010-02-22 23:40 [PATCH] grub + FreeBSD's loader(8) + ZFS root Navdeep Parhar
2010-02-23 3:06 ` Warning messages Seth Goldberg
@ 2010-04-07 10:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 20:21 ` Navdeep Parhar
1 sibling, 1 reply; 8+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-04-07 10:28 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]
Navdeep Parhar wrote:
> Hello grub-devel,
>
> Right now it's not possible to boot using FreeBSD's loader(8) from a ZFS
> root filesystem. Grub doesn't indicate to the loader that there is a
> ZFS root involved and consequently the loader fails to find the kernel.
> The attached patch fixes this. It does not affect those that boot the
> kernel directly. This is only for users that want to boot using
> FreeBSD's loader.
>
> Why would you want to? IMHO it is much simpler to boot indirectly using
> the loader because in that case grub does not have to deal with
> device.hints, kernel modules, kFreeBSD.xxx style variables,
> /boot/zfs/zpool.cache, etc. As a FreeBSD user, I'm used to putting this
> information in the "normal" config files (/boot/loader.conf, device.hints,
> etc.) and not in a grub.cfg file. Grub only needs to know where the loader
> is, nothing else:
>
> menuentry "FreeBSD 8" {
> search -s -l fbsd8
> kfreebsd -D /@/boot/zfsloader
> }
> (fbsd8 is the name of the ZFS root pool)
>
>
Eternal chainloading isn't the way to go. It limits grub usefullness and
scope and is to be used only when no alternative exists. In this case
the right direction would be to make a small C module to parse boot(8)
config or a shell script for 30_osprober.in to do the same job
> Let me know if you have any questions. Once again, if you load the
> kernel directly and want to load modules and set kFreeBSD.foo.bar=...
> yourself, all that will continue to work.
>
> Regards,
> Navdeep
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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: 293 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] grub + FreeBSD's loader(8) + ZFS root
2010-04-07 10:28 ` [PATCH] grub + FreeBSD's loader(8) + ZFS root Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-04-07 20:21 ` Navdeep Parhar
2012-02-27 0:58 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 8+ messages in thread
From: Navdeep Parhar @ 2010-04-07 20:21 UTC (permalink / raw)
To: The development of GNU GRUB
2010/4/7 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> Navdeep Parhar wrote:
>> Hello grub-devel,
>>
>> Right now it's not possible to boot using FreeBSD's loader(8) from a ZFS
>> root filesystem. Grub doesn't indicate to the loader that there is a
>> ZFS root involved and consequently the loader fails to find the kernel.
>> The attached patch fixes this. It does not affect those that boot the
>> kernel directly. This is only for users that want to boot using
>> FreeBSD's loader.
>>
>> Why would you want to? IMHO it is much simpler to boot indirectly using
>> the loader because in that case grub does not have to deal with
>> device.hints, kernel modules, kFreeBSD.xxx style variables,
>> /boot/zfs/zpool.cache, etc. As a FreeBSD user, I'm used to putting this
>> information in the "normal" config files (/boot/loader.conf, device.hints,
>> etc.) and not in a grub.cfg file. Grub only needs to know where the loader
>> is, nothing else:
>>
>> menuentry "FreeBSD 8" {
>> search -s -l fbsd8
>> kfreebsd -D /@/boot/zfsloader
>> }
>> (fbsd8 is the name of the ZFS root pool)
>>
>>
> Eternal chainloading isn't the way to go. It limits grub usefullness and
> scope and is to be used only when no alternative exists. In this case
> the right direction would be to make a small C module to parse boot(8)
> config or a shell script for 30_osprober.in to do the same job
Sure, chainloading doesn't have to be the preferred way of booting an
OS, but it shouldn't fail without a good reason either. Right now
FreeBSD can be chainloaded from a UFS root but not from ZFS root.
That's all that I'm trying to fix here. This patch doesn't imply that
chainloading is *the* way to load FreeBSD - just that it is a usable
alternate to direct loading, even from a ZFS root.
Regards,
Navdeep
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] grub + FreeBSD's loader(8) + ZFS root
2010-04-07 20:21 ` Navdeep Parhar
@ 2012-02-27 0:58 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 8+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-27 0:58 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: Navdeep Parhar
On 07.04.2010 22:21, Navdeep Parhar wrote:
> 2010/4/7 Vladimir 'φ-coder/phcoder' Serbinenko<phcoder@gmail.com>:
>> Navdeep Parhar wrote:
>>> Hello grub-devel,
>>>
>>> Right now it's not possible to boot using FreeBSD's loader(8) from a ZFS
>>> root filesystem. Grub doesn't indicate to the loader that there is a
>>> ZFS root involved and consequently the loader fails to find the kernel.
>>> The attached patch fixes this. It does not affect those that boot the
>>> kernel directly. This is only for users that want to boot using
>>> FreeBSD's loader.
>>>
>>> Why would you want to? IMHO it is much simpler to boot indirectly using
>>> the loader because in that case grub does not have to deal with
>>> device.hints, kernel modules, kFreeBSD.xxx style variables,
>>> /boot/zfs/zpool.cache, etc. As a FreeBSD user, I'm used to putting this
>>> information in the "normal" config files (/boot/loader.conf, device.hints,
>>> etc.) and not in a grub.cfg file. Grub only needs to know where the loader
>>> is, nothing else:
>>>
>>> menuentry "FreeBSD 8" {
>>> search -s -l fbsd8
>>> kfreebsd -D /@/boot/zfsloader
>>> }
>>> (fbsd8 is the name of the ZFS root pool)
>>>
>>>
>> Eternal chainloading isn't the way to go. It limits grub usefullness and
>> scope and is to be used only when no alternative exists. In this case
>> the right direction would be to make a small C module to parse boot(8)
>> config or a shell script for 30_osprober.in to do the same job
> Sure, chainloading doesn't have to be the preferred way of booting an
> OS, but it shouldn't fail without a good reason either. Right now
> FreeBSD can be chainloaded from a UFS root but not from ZFS root.
> That's all that I'm trying to fix here. This patch doesn't imply that
> chainloading is *the* way to load FreeBSD - just that it is a usable
> alternate to direct loading, even from a ZFS root.
I've added this patch but only because since we support aout
/boot/loader it makes little sense not to support zfsloader but it's not
a recommended way to boot in either case.
> Regards,
> Navdeep
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Warning messages
@ 2004-05-01 21:55
2004-05-03 9:33 ` Jörn Engel
0 siblings, 1 reply; 8+ messages in thread
From: @ 2004-05-01 21:55 UTC (permalink / raw)
To: linux-kernel
Hello all,
Everytime I compile the 2.6.5 Linux kernel I get these warning messages:
AS arch/i386/boot/setup.o
/usr/src/linux-2.6.5/arch/i386/boot/setup.S: Assembler messages:
/usr/src/linux-2.6.5/arch/i386/boot/setup.S:159: Warning: value 0x37ffffff truncated to 0x37ffffff
What does it mean?
Thanks in advance.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Warning messages
2004-05-01 21:55 Warning messages
@ 2004-05-03 9:33 ` Jörn Engel
0 siblings, 0 replies; 8+ messages in thread
From: Jörn Engel @ 2004-05-03 9:33 UTC (permalink / raw)
To: João Paulo Just Peixoto; +Cc: linux-kernel, Linus Torvalds
On Sat, 1 May 2004 22:55:59 +0100, linux-kernel-owner+joern=40wohnheim.fh-wedel.de-S262920AbUEBBnc@vger.kernel.org wrote:
>
> Everytime I compile the 2.6.5 Linux kernel I get these warning messages:
>
> AS arch/i386/boot/setup.o
> /usr/src/linux-2.6.5/arch/i386/boot/setup.S: Assembler messages:
> /usr/src/linux-2.6.5/arch/i386/boot/setup.S:159: Warning: value 0x37ffffff truncated to 0x37ffffff
>
> What does it mean?
That the kernel depends on a funny side effect of the assembler. It's
harmless, but if you don't like it, apply the patch below. Linus,
would you consider it as well?
Jörn
--
When in doubt, use brute force.
-- Ken Thompson
The warning is correct, the calculated value for ramdisk_max would be
0xb7ffffff instead of 0x37ffffff. Truncating 0xb7ffffff to 0x37ffffff
is desired behaviour, so we should do it explicitly.
setup.S | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
--- linux-2.6.1/arch/i386/boot/setup.S~initrd_warning 2004-03-09 11:37:29.000000000 +0100
+++ linux-2.6.1/arch/i386/boot/setup.S 2004-03-09 11:38:59.000000000 +0100
@@ -162,7 +162,8 @@
# can be located anywhere in
# low memory 0x10000 or higher.
-ramdisk_max: .long MAXMEM-1 # (Header version 0x0203 or later)
+ramdisk_max: .long (MAXMEM-1) & 0x7fffffff
+ # (Header version 0x0203 or later)
# The highest safe address for
# the contents of an initrd
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-02-27 1:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 23:40 [PATCH] grub + FreeBSD's loader(8) + ZFS root Navdeep Parhar
2010-02-23 3:06 ` Warning messages Seth Goldberg
2010-02-23 8:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 10:28 ` [PATCH] grub + FreeBSD's loader(8) + ZFS root Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 20:21 ` Navdeep Parhar
2012-02-27 0:58 ` Vladimir 'φ-coder/phcoder' Serbinenko
-- strict thread matches above, loose matches on Subject: below --
2004-05-01 21:55 Warning messages
2004-05-03 9:33 ` Jörn Engel
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.