All of lore.kernel.org
 help / color / mirror / Atom feed
* grub2 boot root-on-zfs errors
@ 2013-08-30  7:23 Raif S. Berent
  2013-09-05  7:31 ` Beeblebrox
  2013-09-23  9:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 60+ messages in thread
From: Raif S. Berent @ 2013-08-30  7:23 UTC (permalink / raw)
  To: grub-devel

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

My system is FreeBSD_9.2-stable_amd64_HDD-layout=GPT
grub version=grub2-2.00_1, and grub is on its own partition (/boot/grub)
zpool version: 5000, with root on the zpool
FreeBSD's bootloader is able to boot this pool, while various grub2
attempts have failed. I think the reason is that grub2 has problems with
recognizing FreeBSD's zpools. As an example of why I think this:

# grub-probe /dev/ada0p2 (partition where zpool resides)
grub-probe: error: cannot find a device for /dev/ada0p2 (is /dev mounted?).

# ls /dev/ada0*
/dev/ada0   /dev/ada0p1  /dev/ada0p2  /dev/ada0p3

Regards.

[-- Attachment #2: Type: text/html, Size: 715 bytes --]

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

* Re: grub2 boot root-on-zfs errors
  2013-08-30  7:23 grub2 boot root-on-zfs errors Raif S. Berent
@ 2013-09-05  7:31 ` Beeblebrox
  2013-09-23  9:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 60+ messages in thread
From: Beeblebrox @ 2013-09-05  7:31 UTC (permalink / raw)
  To: The development of GNU GRUB

Where would be the correct place (forum, list, etc) to get help on this issue?
(getting grub2 to recognize and boot from FreeBSD ZFS zpools)
Regards.

On Fri, Aug 30, 2013 at 10:23 AM, Raif S. Berent <rsb@berentweb.com> wrote:
> My system is FreeBSD_9.2-stable_amd64_HDD-layout=GPT
> grub version=grub2-2.00_1, and grub is on its own partition (/boot/grub)
> zpool version: 5000, with root on the zpool
> FreeBSD's bootloader is able to boot this pool, while various grub2 attempts
> have failed. I think the reason is that grub2 has problems with recognizing
> FreeBSD's zpools. As an example of why I think this:
>
> # grub-probe /dev/ada0p2 (partition where zpool resides)
> grub-probe: error: cannot find a device for /dev/ada0p2 (is /dev mounted?).
>
> # ls /dev/ada0*
> /dev/ada0   /dev/ada0p1  /dev/ada0p2  /dev/ada0p3
>
> Regards.


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

* Re: grub2 boot root-on-zfs errors
  2013-08-30  7:23 grub2 boot root-on-zfs errors Raif S. Berent
  2013-09-05  7:31 ` Beeblebrox
@ 2013-09-23  9:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-23  9:09 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 30.08.2013 09:23, Raif S. Berent wrote:
> My system is FreeBSD_9.2-stable_amd64_HDD-layout=GPT
> grub version=grub2-2.00_1, and grub is on its own partition (/boot/grub)
> zpool version: 5000, with root on the zpool
> FreeBSD's bootloader is able to boot this pool, while various grub2
> attempts have failed. I think the reason is that grub2 has problems with
> recognizing FreeBSD's zpools. As an example of why I think this:
> 
> # grub-probe /dev/ada0p2 (partition where zpool resides)
> grub-probe: error: cannot find a device for /dev/ada0p2 (is /dev mounted?).
> 
This doesn't demonstrate anything else than that you didn't use tools
correctly. It's either
grub-probe -d /dev/ada0p2
or
grub-probe /
Other than this this report doesn't contain any description of symptoms.
> # ls /dev/ada0*
> /dev/ada0   /dev/ada0p1  /dev/ada0p2  /dev/ada0p3
> 
> Regards.
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-25 11:08   ` Beeblebrox
  2013-11-25 11:14     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-25 17:29     ` Andrey Borzenkov
@ 2013-11-25 22:12     ` Vladimir 'phcoder' Serbinenko
  2 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2013-11-25 22:12 UTC (permalink / raw)
  To: The development of GNU GRUB

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

paste your grub.cfg to give context
On Nov 25, 2013 12:09 PM, "Beeblebrox" <zaphod@berentweb.com> wrote:

> Hello.
> I have built and installed Grub from trunk (lbeit without docs and
> efiemu, which I don't need). I have also installed the boot code and
> have booted from grub. Here are my results:
> * grub-probe correctly identifies partitions as ZFS.
> * grub-mkconfig correctly generates a config file and has the correct
> path, insmod code for zfs-booting.
> * grub-mkconfig does not detect an ubuntu linux (btrfs) install on
> separate HDD.
> * At boot time, grub menu comes up, and starts to boot normally into
> the ZFS pool. However boot stops at mounting root because "no such
> file system", and BTX (the FreeBSD loader) is very unresponsive. This
> is probably because I have newcons installed as patch in
> FreeBSD-current (11).
> * Modified grub.cfg to include menu item having "kfreebsd
> //@/boot/loader" for chain-loading into BTX. Chain-load method
> successfully boots into zfs-based root and mounts all FS. Difference
> between direct-boot and chainload seems to be access to zpool.cache,
> which is actually different and maybe even a little buggy at this date
> in 11 (I had some problems with automatically bringing up non-root
> zpools and had to make some modifications in order to get it working)
>
> Advise if any other info is required.
> Thanks and Regards.
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #2: Type: text/html, Size: 2006 bytes --]

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

* Re: grub2 boot root-on-zfs errors
  2013-11-25 11:08   ` Beeblebrox
  2013-11-25 11:14     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-25 17:29     ` Andrey Borzenkov
  2013-11-25 22:12     ` Vladimir 'phcoder' Serbinenko
  2 siblings, 0 replies; 60+ messages in thread
From: Andrey Borzenkov @ 2013-11-25 17:29 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Mon, 25 Nov 2013 13:08:45 +0200
Beeblebrox <zaphod@berentweb.com> пишет:

> * grub-mkconfig does not detect an ubuntu linux (btrfs) install on separate HDD.

Detection of other systems is implemented outside of grub2; it is done
by os-prober. grub-mkconfig will launch os-prober if it is found and
interpret its output, that's all. It is done as part of /etc/grub.d framework, so any custom code is possible instead of os-prober.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-22 13:30     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-25 16:54       ` Colin Watson
  0 siblings, 0 replies; 60+ messages in thread
From: Colin Watson @ 2013-11-25 16:54 UTC (permalink / raw)
  To: grub-devel

On Fri, Nov 22, 2013 at 02:30:28PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 22.11.2013 14:16, Colin Watson wrote:
> > This will not be sufficient to build on GNU/Hurd (get_ofpathname isn't
> > directly relevant to that platform, but that function will be compiled
> > there anyway).  We need to avoid the use of PATH_MAX entirely, per:
> > 
> >   https://www.gnu.org/software/hurd/hurd/porting/guidelines.html
> 
> Sth like
> diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c

Yes, that looks better to me.  Thanks.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


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

* Re: grub2 boot root-on-zfs errors
  2013-11-25 11:08   ` Beeblebrox
@ 2013-11-25 11:14     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-25 17:29     ` Andrey Borzenkov
  2013-11-25 22:12     ` Vladimir 'phcoder' Serbinenko
  2 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-25 11:14 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 25.11.2013 12:08, Beeblebrox wrote:
> * At boot time, grub menu comes up, and starts to boot normally into
> the ZFS pool. However boot stops at mounting root because "no such
> file system", and BTX (the FreeBSD loader) is very unresponsive.
What do you mean by BTX? The standard GRUB entries for FReeBSD
circumvent BTX altogether.


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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-24 15:08 ` Andrey Borzenkov
@ 2013-11-25 11:08   ` Beeblebrox
  2013-11-25 11:14     ` Vladimir 'φ-coder/phcoder' Serbinenko
                       ` (2 more replies)
  0 siblings, 3 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-25 11:08 UTC (permalink / raw)
  To: The development of GNU GRUB

Hello.
I have built and installed Grub from trunk (lbeit without docs and
efiemu, which I don't need). I have also installed the boot code and
have booted from grub. Here are my results:
* grub-probe correctly identifies partitions as ZFS.
* grub-mkconfig correctly generates a config file and has the correct
path, insmod code for zfs-booting.
* grub-mkconfig does not detect an ubuntu linux (btrfs) install on separate HDD.
* At boot time, grub menu comes up, and starts to boot normally into
the ZFS pool. However boot stops at mounting root because "no such
file system", and BTX (the FreeBSD loader) is very unresponsive. This
is probably because I have newcons installed as patch in
FreeBSD-current (11).
* Modified grub.cfg to include menu item having "kfreebsd
//@/boot/loader" for chain-loading into BTX. Chain-load method
successfully boots into zfs-based root and mounts all FS. Difference
between direct-boot and chainload seems to be access to zpool.cache,
which is actually different and maybe even a little buggy at this date
in 11 (I had some problems with automatically bringing up non-root
zpools and had to make some modifications in order to get it working)

Advise if any other info is required.
Thanks and Regards.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-24  9:14 Beeblebrox
@ 2013-11-24 15:08 ` Andrey Borzenkov
  2013-11-25 11:08   ` Beeblebrox
  0 siblings, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-11-24 15:08 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Sun, 24 Nov 2013 11:14:11 +0200
Beeblebrox <zaphod@berentweb.com> пишет:

> * Is there a way to compile without docs? This does not work:
> ./configure --disable-werror --disable-nls --disable-docs
> 
> * I disabled the docs section manually in grub/Makefile. gmake
> completed but still with warning:
> /usr/bin/ld: unrecognised emulation mode: elf_x86_64
> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> gmake[3]: [efiemu64.o] Error 1 (ignored)
> gmake[3]: Leaving directory `/asp/git/grub/grub-core'
> 
> * I proceeded with "gmake install" and previous error now causes a problem:
>  /usr/bin/install -c -m 644 all_video.mod gdb.mod testspeed.mod tr.mod
> progress.mod gcry_arcfour.mod gcry_blowfish.mod gcry_camellia.mod
> gcry_cast5.mod gcry_crc.mod gcry_des.mod gcry_dsa.mod gcry_idea.mod
> gcry_md4.mod gcry_md5.mod gcry_rfc2268.mod gcry_rijndael.mod
> gcry_rmd160.mod gcry_rsa.mod gcry_seed.mod gcry_serpent.mod
> gcry_sha1.mod gcry_sha256.mod gcry_sha512.mod gcry_tiger.mod
> gcry_twofish.mod gcry_whirlpool.mod modinfo.sh efiemu32.o ./efiemu64.o
> '/usr/local/lib/grub/i386-pc'
> install: ./efiemu64.o: No such file or directory

As a workaround build with --disable-efiemu. You probably do not need
it anyway unless booting OS X.

> gmake[4]: *** [install-platformDATA] Error 71
> gmake[4]: Leaving directory `/asp/git/grub/grub-core'
> gmake[3]: *** [install-am] Error 2
> gmake[3]: Leaving directory `/asp/git/grub/grub-core'
> gmake[2]: *** [install] Error 2
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



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

* Re: grub2 boot root-on-zfs errors
@ 2013-11-24  9:14 Beeblebrox
  2013-11-24 15:08 ` Andrey Borzenkov
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-11-24  9:14 UTC (permalink / raw)
  To: The development of GNU GRUB

* Is there a way to compile without docs? This does not work:
./configure --disable-werror --disable-nls --disable-docs

* I disabled the docs section manually in grub/Makefile. gmake
completed but still with warning:
/usr/bin/ld: unrecognised emulation mode: elf_x86_64
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: [efiemu64.o] Error 1 (ignored)
gmake[3]: Leaving directory `/asp/git/grub/grub-core'

* I proceeded with "gmake install" and previous error now causes a problem:
 /usr/bin/install -c -m 644 all_video.mod gdb.mod testspeed.mod tr.mod
progress.mod gcry_arcfour.mod gcry_blowfish.mod gcry_camellia.mod
gcry_cast5.mod gcry_crc.mod gcry_des.mod gcry_dsa.mod gcry_idea.mod
gcry_md4.mod gcry_md5.mod gcry_rfc2268.mod gcry_rijndael.mod
gcry_rmd160.mod gcry_rsa.mod gcry_seed.mod gcry_serpent.mod
gcry_sha1.mod gcry_sha256.mod gcry_sha512.mod gcry_tiger.mod
gcry_twofish.mod gcry_whirlpool.mod modinfo.sh efiemu32.o ./efiemu64.o
'/usr/local/lib/grub/i386-pc'
install: ./efiemu64.o: No such file or directory
gmake[4]: *** [install-platformDATA] Error 71
gmake[4]: Leaving directory `/asp/git/grub/grub-core'
gmake[3]: *** [install-am] Error 2
gmake[3]: Leaving directory `/asp/git/grub/grub-core'
gmake[2]: *** [install] Error 2


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

* Re: grub2 boot root-on-zfs errors
  2013-11-23 13:50         ` Beeblebrox
@ 2013-11-23 17:58           ` Beeblebrox
  0 siblings, 0 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-23 17:58 UTC (permalink / raw)
  To: The development of GNU GRUB

It seems I made a mistake in my previous post. I should have included
a previous warning code as well (just in case.)Correction as to where
compile breaks:

  cc -DHAVE_CONFIG_H  -I../grub-core/efiemu/runtime
-DGRUB_FILE=\"efiemu/runtime/efiemu.S\" -I. -I. -I.. -I.. -I../include
-I../include -I../grub-core/lib/libgcrypt-grub/include
-I../grub-core/lib/libgcrypt-grub/src/ -m64 -Wall -Werror -nostdlib
-O2 -mcmodel=large -mno-red-zone -c -o efiemu64_s.o
efiemu/runtime/efiemu.S || exit 1; \
fi
rm -f efiemu64.o; \
if test "x0" = x1; then \
  rm -f efiemu64.o.bin; \
  cc -m64 -Wl,-r -nostdlib -o efiemu64.o.bin efiemu64_c.o efiemu64_s.o
|| exit 1; \
   -felf64 -nu -nd efiemu64.o.bin efiemu64.o || exit 1; \
  rm -f efiemu64.o.bin; \
else \
  cc -m64 -Wl,-melf_x86_64 -nostdlib -Wl,-r -o efiemu64.o efiemu64_c.o
efiemu64_s.o || exit 1; \
  if test ! -z ""; then  efiemu64.o || (rm -f efiemu64.o; exit 1); fi; \
fi
/usr/bin/ld: unrecognised emulation mode: elf_x86_64
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: [efiemu64.o] Error 1 (ignored)
gmake[3]: Leaving directory `/asp/git/grub/grub-core'
gmake[2]: Leaving directory `/asp/git/grub/grub-core'
Making all in po
gmake[2]: Entering directory `/asp/git/grub/po'
gmake[2]: Leaving directory `/asp/git/grub/po'
Making all in docs
gmake[2]: Entering directory `/asp/git/grub/docs'
Updating ./version.texi
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (/usr/local/bin/makeinfo --version) >/dev/null 2>&1; then \
  for f in grub.info grub.info-[0-9] grub.info-[0-9][0-9] grub.i[0-9]
grub.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if /usr/local/bin/makeinfo   -I . \
 -o grub.info grub.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd . && \
  $restore $backupdir/* `echo "./grub.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
Bus error (core dumped)
Bus error (core dumped)
gmake[2]: *** [grub.info] Error 138
gmake[2]: Leaving directory `/asp/git/grub/docs'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/asp/git/grub'
gmake: *** [all] Error 2


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

* Re: grub2 boot root-on-zfs errors
  2013-11-23 12:54       ` Beeblebrox
  2013-11-23 13:10         ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-23 13:50         ` Beeblebrox
  2013-11-23 17:58           ` Beeblebrox
  1 sibling, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-11-23 13:50 UTC (permalink / raw)
  To: The development of GNU GRUB

More progress, but other problem. Compile passed through previous
error but breaks when building docs (which I really don't need).
Breaks at:

Making all in docs
gmake[2]: Entering directory `/asp/git/grub/docs'
Updating ./version.texi
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (/usr/local/bin/makeinfo --version) >/dev/null 2>&1; then \
  for f in grub.info grub.info-[0-9] grub.info-[0-9][0-9] grub.i[0-9]
grub.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if /usr/local/bin/makeinfo   -I . \
 -o grub.info grub.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd . && \
  $restore $backupdir/* `echo "./grub.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
Bus error (core dumped)
Bus error (core dumped)
gmake[2]: *** [grub.info] Error 138
gmake[2]: Leaving directory `/asp/git/grub/docs'
gmake[1]: *** [all-recursive] Error 1


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

* Re: grub2 boot root-on-zfs errors
  2013-11-23 12:54       ` Beeblebrox
@ 2013-11-23 13:10         ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-23 13:50         ` Beeblebrox
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-23 13:10 UTC (permalink / raw)
  To: grub-devel

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

On 23.11.2013 13:54, Beeblebrox wrote:
> Applied the diff but got error elsewhere. Git repo on
> 1bba40f57813c2ccf790e6aca8b96292634b04ca
Advance to e67566ce0a925342d0a988ec196710e204a1d900 or later
> Date:   Sat Nov 23 12:39:21 2013 +0100
> FreeBSD 11.0-CURRENT_amd64
> 
> config.status: creating grub-shell
> chmod a+x grub-shell
> (for x in tests/util/grub-shell-tester.in ; do cat ./"$x"; done) |
> ./config.status --file=grub-shell-tester:-
> config.status: creating grub-shell-tester
> chmod a+x grub-shell-tester
> cc -o garbage-gen  -DGRUB_FILE=\"util/garbage-gen.c\" -I. -I. -I. -I.
> -I./include -I./include -I./grub-core/lib/libgcrypt-grub/include
> -I./grub-core/lib/libgcrypt-grub/src/  util/garbage-gen.c
> util/garbage-gen.c:35:18: error: variable has incomplete type 'struct timeval'
>   struct timeval tv;
>                  ^
> util/garbage-gen.c:35:10: note: forward declaration of 'struct timeval'
>   struct timeval tv;
>          ^
> util/garbage-gen.c:36:3: warning: implicit declaration of function
> 'gettimeofday' is invalid
>       in C99 [-Wimplicit-function-declaration]
>   gettimeofday (&tv, NULL);
>   ^
> 1 warning and 1 error generated.
> gmake[2]: *** [garbage-gen] Error 1
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-22 17:01     ` Beeblebrox
  2013-11-23  1:09       ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-23 12:54       ` Beeblebrox
  2013-11-23 13:10         ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-23 13:50         ` Beeblebrox
  1 sibling, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-23 12:54 UTC (permalink / raw)
  To: The development of GNU GRUB

Applied the diff but got error elsewhere. Git repo on
1bba40f57813c2ccf790e6aca8b96292634b04ca
Date:   Sat Nov 23 12:39:21 2013 +0100
FreeBSD 11.0-CURRENT_amd64

config.status: creating grub-shell
chmod a+x grub-shell
(for x in tests/util/grub-shell-tester.in ; do cat ./"$x"; done) |
./config.status --file=grub-shell-tester:-
config.status: creating grub-shell-tester
chmod a+x grub-shell-tester
cc -o garbage-gen  -DGRUB_FILE=\"util/garbage-gen.c\" -I. -I. -I. -I.
-I./include -I./include -I./grub-core/lib/libgcrypt-grub/include
-I./grub-core/lib/libgcrypt-grub/src/  util/garbage-gen.c
util/garbage-gen.c:35:18: error: variable has incomplete type 'struct timeval'
  struct timeval tv;
                 ^
util/garbage-gen.c:35:10: note: forward declaration of 'struct timeval'
  struct timeval tv;
         ^
util/garbage-gen.c:36:3: warning: implicit declaration of function
'gettimeofday' is invalid
      in C99 [-Wimplicit-function-declaration]
  gettimeofday (&tv, NULL);
  ^
1 warning and 1 error generated.
gmake[2]: *** [garbage-gen] Error 1


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

* Re: grub2 boot root-on-zfs errors
  2013-11-22 17:01     ` Beeblebrox
@ 2013-11-23  1:09       ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-23 12:54       ` Beeblebrox
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-23  1:09 UTC (permalink / raw)
  To: grub-devel

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


> 40   pid = grub_util_exec_pipe ((const char * []){ "ofpathname", dev,
> NULL }, &fd);
> 41   if (!pid)
> 42
Why did you remove the whole chunk of code here?
Please use ptach command to apply patches, not some manual way.
> 43   FILE *fp = fdopen (fd, "r");
> 44   get_ofpathname (const char *dev)
> 45   if (!fp)
> 46     goto fail;
> 47
> 48   while (!feof (fp))
> 49     {
> 50       size_t r;
> 51    if (alloced == offset)
> 52       {
> 53         alloced *= 2;
> 54         ret = xrealloc (ret, alloced);
> 55       }
> 56      r = fread (ret + offset, 1, alloced - offset, fp);
> 57      offset += r;
> 58    }
> 59
> 60   fclose (fp);
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-22 15:22   ` Beeblebrox
@ 2013-11-22 17:01     ` Beeblebrox
  2013-11-23  1:09       ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-23 12:54       ` Beeblebrox
  0 siblings, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-22 17:01 UTC (permalink / raw)
  To: The development of GNU GRUB

The patched file is giving me an error. I tried patching several
times, but keep getting same error. Most likely some stupid error on
my part:
grub-core/osdep/unix/platform.c:43:4: error: expected expression
   FILE *fp = fdopen (fd, "r");
   ^
grub-core/osdep/unix/platform.c:44:20: error: expected expression
   get_ofpathname (const char *dev)
                   ^
grub-core/osdep/unix/platform.c:48:18: error: use of undeclared identifier
      'fp'
   while (!feof (fp))
                 ^
/usr/include/stdio.h:489:43: note: expanded from macro 'feof'
#define feof(p)         (!__isthreaded ? __sfeof(p) : (feof)(p))
                                                 ^
/usr/include/stdio.h:483:23: note: expanded from macro '__sfeof'
#define __sfeof(p)      (((p)->_flags & __SEOF) != 0)
                           ^
In file included from grub-core/osdep/platform_unix.c:2:
grub-core/osdep/unix/platform.c:48:18: error: use of undeclared identifier
      'fp'
/usr/include/stdio.h:489:55: note: expanded from macro 'feof'
#define feof(p)         (!__isthreaded ? __sfeof(p) : (feof)(p))
                                                             ^
In file included from grub-core/osdep/platform_unix.c:2:
grub-core/osdep/unix/platform.c:56:53: error: use of undeclared identifier
      'fp'
      r = fread (ret + offset, 1, alloced - offset, fp);
                                                    ^
grub-core/osdep/unix/platform.c:60:12: error: use of undeclared identifier
      'fp'
   fclose (fp);


Patched section currently looks like:
31   static char *
32   get_ofpathname (const char *dev)
33   {
34    size_t alloced = 4096;
35   char *ret = xmalloc (alloced);
36   size_t offset = 0;
37    int fd;
38   pid_t pid;
39
40   pid = grub_util_exec_pipe ((const char * []){ "ofpathname", dev,
NULL }, &fd);
41   if (!pid)
42
43   FILE *fp = fdopen (fd, "r");
44   get_ofpathname (const char *dev)
45   if (!fp)
46     goto fail;
47
48   while (!feof (fp))
49     {
50       size_t r;
51    if (alloced == offset)
52       {
53         alloced *= 2;
54         ret = xrealloc (ret, alloced);
55       }
56      r = fread (ret + offset, 1, alloced - offset, fp);
57      offset += r;
58    }
59
60   fclose (fp);


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

* Re: grub2 boot root-on-zfs errors
       [not found] ` <CAPSTskuZ2nHt6iKHfgFfWeBxpRyuqPmyXHd3AYCr1muaua+H7w@mail.gmail.com>
@ 2013-11-22 15:22   ` Beeblebrox
  2013-11-22 17:01     ` Beeblebrox
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-11-22 15:22 UTC (permalink / raw)
  To: The development of GNU GRUB

config.log re-sent as link, as requested by mail list admin (file too large)

https://drive.google.com/file/d/0Bxs_eepbMt6qejJBZVQyZngtdTA/edit?usp=sharing

Regards.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-22 13:16   ` Colin Watson
@ 2013-11-22 13:30     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-25 16:54       ` Colin Watson
  0 siblings, 1 reply; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-22 13:30 UTC (permalink / raw)
  To: grub-devel

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

On 22.11.2013 14:16, Colin Watson wrote:
> On Fri, Nov 22, 2013 at 08:30:14AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>> On 22.11.2013 08:09, Beeblebrox wrote:
>>> grub-core/osdep/unix/platform.c:34:28: error: use of undeclared
>>> identifier 'PATH_MAX'
>>>   char *ret = xmalloc (2 * PATH_MAX);
>> Please try
>> diff --git a/grub-core/osdep/unix/platform.c
>> b/grub-core/osdep/unix/platform.c
>> index 65c93f1..a527a1c 100644
>> --- a/grub-core/osdep/unix/platform.c
>> +++ b/grub-core/osdep/unix/platform.c
>> @@ -27,6 +27,7 @@
>>  #include <dirent.h>
>>  #include <string.h>
>>  #include <errno.h>
>> +#include <limits.h>
>>
>>  static char *
>>  get_ofpathname (const char *dev)
>>
> 
> This will not be sufficient to build on GNU/Hurd (get_ofpathname isn't
> directly relevant to that platform, but that function will be compiled
> there anyway).  We need to avoid the use of PATH_MAX entirely, per:
> 
>   https://www.gnu.org/software/hurd/hurd/porting/guidelines.html
> 
Sth like
diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c
index 65c93f1..684c325 100644
--- a/grub-core/osdep/unix/platform.c
+++ b/grub-core/osdep/unix/platform.c
@@ -31,11 +31,11 @@
 static char *
 get_ofpathname (const char *dev)
 {
-  char *ret = xmalloc (2 * PATH_MAX);
-  char *end = ret + 2 * PATH_MAX - 1;
+  size_t alloced = 4096;
+  char *ret = xmalloc (alloced);
+  size_t offset = 0;
   int fd;
   pid_t pid;
-  char *ptr = ret;
 
   pid = grub_util_exec_pipe ((const char * []){ "ofpathname", dev, NULL }, &fd);
   if (!pid)
@@ -45,11 +45,16 @@ get_ofpathname (const char *dev)
   if (!fp)
     goto fail;
 
-  while (!feof (fp) && ptr < end)
+  while (!feof (fp))
     {
       size_t r;
-      r = fread (ptr, 1, end - ptr, fp);
-      ptr += r;
+      if (alloced == offset)
+       {
+         alloced *= 2;
+         ret = xrealloc (ret, alloced);
+       }
+      r = fread (ret + offset, 1, alloced - offset, fp);
+      offset += r;
     }
 
   fclose (fp);



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-22  7:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-22 13:16   ` Colin Watson
  2013-11-22 13:30     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 60+ messages in thread
From: Colin Watson @ 2013-11-22 13:16 UTC (permalink / raw)
  To: grub-devel

On Fri, Nov 22, 2013 at 08:30:14AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 22.11.2013 08:09, Beeblebrox wrote:
> > grub-core/osdep/unix/platform.c:34:28: error: use of undeclared
> > identifier 'PATH_MAX'
> >   char *ret = xmalloc (2 * PATH_MAX);
> Please try
> diff --git a/grub-core/osdep/unix/platform.c
> b/grub-core/osdep/unix/platform.c
> index 65c93f1..a527a1c 100644
> --- a/grub-core/osdep/unix/platform.c
> +++ b/grub-core/osdep/unix/platform.c
> @@ -27,6 +27,7 @@
>  #include <dirent.h>
>  #include <string.h>
>  #include <errno.h>
> +#include <limits.h>
> 
>  static char *
>  get_ofpathname (const char *dev)
> 

This will not be sufficient to build on GNU/Hurd (get_ofpathname isn't
directly relevant to that platform, but that function will be compiled
there anyway).  We need to avoid the use of PATH_MAX entirely, per:

  https://www.gnu.org/software/hurd/hurd/porting/guidelines.html

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


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

* Re: grub2 boot root-on-zfs errors
  2013-11-22  7:09 Beeblebrox
  2013-11-22  7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-22  7:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-22 13:16   ` Colin Watson
  1 sibling, 1 reply; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-22  7:30 UTC (permalink / raw)
  To: grub-devel

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

On 22.11.2013 08:09, Beeblebrox wrote:
> grub-core/osdep/unix/platform.c:34:28: error: use of undeclared
> identifier 'PATH_MAX'
>   char *ret = xmalloc (2 * PATH_MAX);
Please try
diff --git a/grub-core/osdep/unix/platform.c
b/grub-core/osdep/unix/platform.c
index 65c93f1..a527a1c 100644
--- a/grub-core/osdep/unix/platform.c
+++ b/grub-core/osdep/unix/platform.c
@@ -27,6 +27,7 @@
 #include <dirent.h>
 #include <string.h>
 #include <errno.h>
+#include <limits.h>

 static char *
 get_ofpathname (const char *dev)


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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-22  7:09 Beeblebrox
@ 2013-11-22  7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-22  7:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-22  7:25 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 22.11.2013 08:09, Beeblebrox wrote:
> @ Vladimir:
>>> Please attach your config.log
> Enclosed as requested (for latest run)
> 
No you didn't. No config.log is attached. Please send it.
> A new problem: I updated the git repo to latest and tried to re-build.
> Build was started with:
> ./autogen.sh USE_GCC=any --disable-werror
> ./configure USE_GCC=any --disable-werror
> gmake USE_GCC=any
> However, compile fails as below. I cannot seem to get the compiler to
> use gcc46 which is on my system - it insists on using clang.
> 
GRUB can be compiled with clang 3.2 or later like INSTALL mentions.
> cc -DHAVE_CONFIG_H -I.  -Wall -W -I./include -DGRUB_UTIL=1
> -DGRUB_FILE=\"grub-core/osdep/platform_unix.c\" -I. -I. -I. -I.
> -I./include -I./include -I./grub-core/lib/libgcrypt-grub/include
> -I./grub-core/lib/libgcrypt-grub/src/ -I./grub-core/gnulib
> -I./grub-core/gnulib  -I/usr/local/include -Wall -W -Wshadow
> -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes
> -Wchar-subscripts -Wcomment -Wdeprecated-declarations
> -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal
> -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
> -Wimplicit-function-declaration -Wimplicit-int -Winit-self
> -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces
> -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar
> -Wnonnull -Woverflow -Wparentheses -Wpointer-arith
> -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
> -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef
> -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
> -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros
> -Wvolatile-register-var -Wwrite-strings -Wnested-externs
> -Wstrict-prototypes -Wpointer-sign -Wcast-align -Wno-undef
> -Wno-sign-compare -Wno-unused -Wno-unused-parameter
> -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
> -Wno-old-style-definition   -MT
> grub-core/osdep/grub_mkrescue-platform_unix.o -MD -MP -MF
> grub-core/osdep/.deps-util/grub_mkrescue-platform_unix.Tpo -c -o
> grub-core/osdep/grub_mkrescue-platform_unix.o `test -f
> 'grub-core/osdep/platform_unix.c' || echo
> './'`grub-core/osdep/platform_unix.c
> In file included from grub-core/osdep/platform_unix.c:2:
> grub-core/osdep/unix/platform.c:34:28: error: use of undeclared
> identifier 'PATH_MAX'
>   char *ret = xmalloc (2 * PATH_MAX);
>                            ^
> grub-core/osdep/unix/platform.c:35:25: error: use of undeclared
> identifier 'PATH_MAX'
>   char *end = ret + 2 * PATH_MAX - 1;
>                         ^
> 2 errors generated.
grep PATH_MAX /usr/include/*
> gmake[2]: *** [grub-core/osdep/grub_mkrescue-platform_unix.o] Error 1
> gmake[2]: Leaving directory `/asp/git/grub'
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
@ 2013-11-22  7:09 Beeblebrox
  2013-11-22  7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-22  7:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-22  7:09 UTC (permalink / raw)
  To: The development of GNU GRUB

@ Vladimir:
>> Please attach your config.log
Enclosed as requested (for latest run)

A new problem: I updated the git repo to latest and tried to re-build.
Build was started with:
./autogen.sh USE_GCC=any --disable-werror
./configure USE_GCC=any --disable-werror
gmake USE_GCC=any
However, compile fails as below. I cannot seem to get the compiler to
use gcc46 which is on my system - it insists on using clang.

cc -DHAVE_CONFIG_H -I.  -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_FILE=\"grub-core/osdep/platform_unix.c\" -I. -I. -I. -I.
-I./include -I./include -I./grub-core/lib/libgcrypt-grub/include
-I./grub-core/lib/libgcrypt-grub/src/ -I./grub-core/gnulib
-I./grub-core/gnulib  -I/usr/local/include -Wall -W -Wshadow
-Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes
-Wchar-subscripts -Wcomment -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal
-Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces
-Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar
-Wnonnull -Woverflow -Wparentheses -Wpointer-arith
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
-Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef
-Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
-Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros
-Wvolatile-register-var -Wwrite-strings -Wnested-externs
-Wstrict-prototypes -Wpointer-sign -Wcast-align -Wno-undef
-Wno-sign-compare -Wno-unused -Wno-unused-parameter
-Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
-Wno-old-style-definition   -MT
grub-core/osdep/grub_mkrescue-platform_unix.o -MD -MP -MF
grub-core/osdep/.deps-util/grub_mkrescue-platform_unix.Tpo -c -o
grub-core/osdep/grub_mkrescue-platform_unix.o `test -f
'grub-core/osdep/platform_unix.c' || echo
'./'`grub-core/osdep/platform_unix.c
In file included from grub-core/osdep/platform_unix.c:2:
grub-core/osdep/unix/platform.c:34:28: error: use of undeclared
identifier 'PATH_MAX'
  char *ret = xmalloc (2 * PATH_MAX);
                           ^
grub-core/osdep/unix/platform.c:35:25: error: use of undeclared
identifier 'PATH_MAX'
  char *end = ret + 2 * PATH_MAX - 1;
                        ^
2 errors generated.
gmake[2]: *** [grub-core/osdep/grub_mkrescue-platform_unix.o] Error 1
gmake[2]: Leaving directory `/asp/git/grub'


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

* Re: grub2 boot root-on-zfs errors
  2013-11-10 17:50 Beeblebrox
@ 2013-11-10 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
       [not found] ` <CAPSTskuZ2nHt6iKHfgFfWeBxpRyuqPmyXHd3AYCr1muaua+H7w@mail.gmail.com>
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-10 19:06 UTC (permalink / raw)
  To: grub-devel

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

On 10.11.2013 18:50, Beeblebrox wrote:
> @ Vladimir:
>>> This is not quite what I asked. Please attach your config.log
> Apologies, I did not see that request.
> 
I meant the value of host_os in config.log.
> Anyway, I ran per your suggestion:
> $ ./autogen.sh --disable-werror --target i386-freebsd
autogen has no arguments.
> $ ./configure --disable-werror --target i386-freebsd
> $ gmake
> 
> Compile completed cleanly, and no install errors. I forgot to set
> USE_GCC=4.6 in the gmake line, and grub was compiled with clang, as
> far as I could tell - thought you might find that interesting.
> 
Shouldn't be a problem. I have successfully compiled GRUB with clang
(even though its size was significantly bigger).
Probably your problem was just missing autogen after update.
If you  recreate the problem please report back and tell if my patch
makes any difference.
> I am at commit 9612ebc00ef5f186e9084b60ceeb1606d34f1d23
> Date:   Sat Nov 9 21:29:11 2013 +0100
> 
> Will advise results of testing.
> 
> Thanks and Regards.
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
@ 2013-11-10 17:50 Beeblebrox
  2013-11-10 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
       [not found] ` <CAPSTskuZ2nHt6iKHfgFfWeBxpRyuqPmyXHd3AYCr1muaua+H7w@mail.gmail.com>
  0 siblings, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-10 17:50 UTC (permalink / raw)
  To: The development of GNU GRUB

@ Vladimir:
>> This is not quite what I asked. Please attach your config.log
Apologies, I did not see that request.

Anyway, I ran per your suggestion:
$ ./autogen.sh --disable-werror --target i386-freebsd
$ ./configure --disable-werror --target i386-freebsd
$ gmake

Compile completed cleanly, and no install errors. I forgot to set
USE_GCC=4.6 in the gmake line, and grub was compiled with clang, as
far as I could tell - thought you might find that interesting.

I am at commit 9612ebc00ef5f186e9084b60ceeb1606d34f1d23
Date:   Sat Nov 9 21:29:11 2013 +0100

Will advise results of testing.

Thanks and Regards.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-10 10:41         ` Andrey Borzenkov
@ 2013-11-10 14:47           ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-10 14:47 UTC (permalink / raw)
  To: The development of GNU GRUB


[-- Attachment #1.1: Type: text/plain, Size: 1222 bytes --]

On 10.11.2013 11:41, Andrey Borzenkov wrote:
> В Sun, 10 Nov 2013 12:28:50 +0200
> Beeblebrox <zaphod@berentweb.com> пишет:
> 
>>>> Did you rerun ./autogen.sh?
>> I ran gmake clean and cleaned all conig**** folders, then re-started
>> from scratch.
>>
> 
> It would be more clean to start in new directory. If you build inside
> source tree, use "git clean -d -x -f" to remove everything not in GIT
> repo and start anew with autogen.sh.
> 
>>>> What is the value of your target_os ?
>> Build, host & target are all the same. I tried setting all 3 as
>> i386-freebsd for one of my runs, but that did not work.
>> Otherwise, I did not set it in the configure command, as I expect the
>> build should be able to identify the target on its own. Is this
>> incorrect?
>>
> 
> Try explicit --target i386-freebsd. It is always possible that
> autoconfiguration fails.
It shows that we can't rely on target_os for available linking formats.
Probably we should try different formats until we find one that works
like in attached patch
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 


[-- Attachment #1.2: link.diff --]
[-- Type: application/x-patch, Size: 5761 bytes --]

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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-10 10:28       ` Beeblebrox
  2013-11-10 10:41         ` Andrey Borzenkov
@ 2013-11-10 12:08         ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-10 12:08 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 10.11.2013 11:28, Beeblebrox wrote:
>>> Did you rerun ./autogen.sh?
> I ran gmake clean and cleaned all conig**** folders, then re-started
> from scratch.
> 
>>> What is the value of your target_os ?
> Build, host & target are all the same. I tried setting all 3 as
> i386-freebsd for one of my runs, but that did not work.
> Otherwise, I did not set it in the configure command, as I expect the
> build should be able to identify the target on its own. Is this
> incorrect?

This i not quite what I asked. Please attach your config.log
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-10 10:28       ` Beeblebrox
@ 2013-11-10 10:41         ` Andrey Borzenkov
  2013-11-10 14:47           ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-10 12:08         ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-11-10 10:41 UTC (permalink / raw)
  To: grub-devel

В Sun, 10 Nov 2013 12:28:50 +0200
Beeblebrox <zaphod@berentweb.com> пишет:

> >>Did you rerun ./autogen.sh?
> I ran gmake clean and cleaned all conig**** folders, then re-started
> from scratch.
> 

It would be more clean to start in new directory. If you build inside
source tree, use "git clean -d -x -f" to remove everything not in GIT
repo and start anew with autogen.sh.

> >>What is the value of your target_os ?
> Build, host & target are all the same. I tried setting all 3 as
> i386-freebsd for one of my runs, but that did not work.
> Otherwise, I did not set it in the configure command, as I expect the
> build should be able to identify the target on its own. Is this
> incorrect?
> 

Try explicit --target i386-freebsd. It is always possible that
autoconfiguration fails.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-09 15:31     ` Beeblebrox
  2013-11-09 15:37       ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-10 10:28       ` Beeblebrox
  2013-11-10 10:41         ` Andrey Borzenkov
  2013-11-10 12:08         ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-10 10:28 UTC (permalink / raw)
  To: The development of GNU GRUB

>>Did you rerun ./autogen.sh?
I ran gmake clean and cleaned all conig**** folders, then re-started
from scratch.

>>What is the value of your target_os ?
Build, host & target are all the same. I tried setting all 3 as
i386-freebsd for one of my runs, but that did not work.
Otherwise, I did not set it in the configure command, as I expect the
build should be able to identify the target on its own. Is this
incorrect?


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

* Re: grub2 boot root-on-zfs errors
  2013-11-09 15:31     ` Beeblebrox
@ 2013-11-09 15:37       ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-10 10:28       ` Beeblebrox
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-09 15:37 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 09.11.2013 16:31, Beeblebrox wrote:
> As of today, Nov/9/13, I have updated the git repo to latest version.
> The error persists:
> 
> /usr/bin/ld: unrecognised emulation mode: elf_i386
> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> gmake[3]: *** [disk.module] Error 1
> gmake[3]: Leaving directory `/asp/git/grub/grub-core'
> 
> 
What is the value of your target_os ?
Did you rerun ./autogen.sh?
> On 11/5/13, Beeblebrox <zaphod@berentweb.com> wrote:
>>>> Unrelated. float and double poisoning is OS-independent.
>>
>> Thank you - I really appreciate that information.
>> Is there anything you would like me to do re
>> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
>> Or will you be pushing a code revision into trunk?
>> Regards.
>>
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-05  9:43   ` Beeblebrox
@ 2013-11-09 15:31     ` Beeblebrox
  2013-11-09 15:37       ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-10 10:28       ` Beeblebrox
  0 siblings, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-09 15:31 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

As of today, Nov/9/13, I have updated the git repo to latest version.
The error persists:

/usr/bin/ld: unrecognised emulation mode: elf_i386
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [disk.module] Error 1
gmake[3]: Leaving directory `/asp/git/grub/grub-core'


On 11/5/13, Beeblebrox <zaphod@berentweb.com> wrote:
>>> Unrelated. float and double poisoning is OS-independent.
>
> Thank you - I really appreciate that information.
> Is there anything you would like me to do re
> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
> Or will you be pushing a code revision into trunk?
> Regards.
>


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

* Re: grub2 boot root-on-zfs errors
  2013-11-05  7:35 ` Beeblebrox
  2013-11-05  8:49   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-05  9:43   ` Beeblebrox
@ 2013-11-08 14:12   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-08 14:12 UTC (permalink / raw)
  To: grub-devel

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

On 05.11.2013 08:35, Beeblebrox wrote:
> Another slight problem. Updated the GIT repo to latest,
> $ gmake clean &&  /autogen.sh --disable-werror && ./configure --disable-werror
> $ gmake  =>
> /usr/bin/ld: unrecognised emulation mode: elf_i386
> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
> gmake[3]: *** [disk.module] Error 1
> gmake[3]: Leaving directory `/asp/git/grub/grub-core'
> 
Should be fixed now, please retest.
> The ./configure file should have detected xkfreebsd, but seems it did
> not. What is the command-line syntax I can run for "x$host_kernel" to
> make sure that correct platform is detected? $ ./configure only shows:
> "GRUB2 will be compiled with following components:
> Platform: i386-pc"
> Whereas, it might be useful if it also displayed result of O/S check.
> If the wrong OS is being detected by config, it might also explain why
> I ran into "float/double standalone headers" error previously.
> 
> Regards.
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-05  7:35 ` Beeblebrox
  2013-11-05  8:49   ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-11-05  9:43   ` Beeblebrox
  2013-11-09 15:31     ` Beeblebrox
  2013-11-08 14:12   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-11-05  9:43 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

>> Unrelated. float and double poisoning is OS-independent.

Thank you - I really appreciate that information.
Is there anything you would like me to do re
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
Or will you be pushing a code revision into trunk?
Regards.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-05  7:35 ` Beeblebrox
@ 2013-11-05  8:49   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-11-05  9:43   ` Beeblebrox
  2013-11-08 14:12   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-05  8:49 UTC (permalink / raw)
  To: grub-devel

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

On 05.11.2013 08:35, Beeblebrox wrote:
> Another slight problem. Updated the GIT repo to latest,
> $ gmake clean &&  /autogen.sh --disable-werror && ./configure --disable-werror
> $ gmake  =>
> /usr/bin/ld: unrecognised emulation mode: elf_i386
> Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
> gmake[3]: *** [disk.module] Error 1
> gmake[3]: Leaving directory `/asp/git/grub/grub-core'
> 
> The ./configure file should have detected xkfreebsd, but seems it did
> not. What is the command-line syntax I can run for "x$host_kernel" to
> make sure that correct platform is detected? $ ./configure only shows:
> "GRUB2 will be compiled with following components:
> Platform: i386-pc"
> Whereas, it might be useful if it also displayed result of O/S check.
> If the wrong OS is being detected by config, it might also explain why
> I ran into "float/double standalone headers" error previously.
> 
Unrelated. float and double poisoning is OS-independent.
> Regards.
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-11-04  6:13 Beeblebrox
@ 2013-11-05  7:35 ` Beeblebrox
  2013-11-05  8:49   ` Vladimir 'φ-coder/phcoder' Serbinenko
                     ` (2 more replies)
  0 siblings, 3 replies; 60+ messages in thread
From: Beeblebrox @ 2013-11-05  7:35 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Another slight problem. Updated the GIT repo to latest,
$ gmake clean &&  /autogen.sh --disable-werror && ./configure --disable-werror
$ gmake  =>
/usr/bin/ld: unrecognised emulation mode: elf_i386
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
gmake[3]: *** [disk.module] Error 1
gmake[3]: Leaving directory `/asp/git/grub/grub-core'

The ./configure file should have detected xkfreebsd, but seems it did
not. What is the command-line syntax I can run for "x$host_kernel" to
make sure that correct platform is detected? $ ./configure only shows:
"GRUB2 will be compiled with following components:
Platform: i386-pc"
Whereas, it might be useful if it also displayed result of O/S check.
If the wrong OS is being detected by config, it might also explain why
I ran into "float/double standalone headers" error previously.

Regards.


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

* Re: grub2 boot root-on-zfs errors
@ 2013-11-04  6:13 Beeblebrox
  2013-11-05  7:35 ` Beeblebrox
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-11-04  6:13 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

>> /usr/include/machine/_types.h:65: error: expected '=', ',', ';', 'asm'
>> or '__attribute__' before '__double_t'
>> /usr/include/machine/_types.h:66: error: expected '=', ',', ';', 'asm'
>> or '__attribute__' before '__float_t'
>You system headers do something stupid: they use float/double in
>standalone headers we use option -Dfloat=__grub_poison and
>-Ddouble=__grub_poison to check that we don't use any float/double.
>Unfortunately such stupidity is more widespread that it should be. I'll
>remove poisonin of float/double in trunk.

Hi thanks for the answer. I know nothing at all about "headers", so
may I ask what theprobable cause for this problem on my system might
be? I mean is it Hardware or Software related? From what I read, it
has to do with compiler (gcc46 or clang) behavior. I would like to
correct this if such a thing is possible.

Thanks again.


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

* Re: grub2 boot root-on-zfs errors
  2013-11-02  7:58     ` Beeblebrox
@ 2013-11-02 14:55       ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-11-02 14:55 UTC (permalink / raw)
  To: grub-devel

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

On 02.11.2013 08:58, Beeblebrox wrote:
> /usr/include/machine/_types.h:65: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__double_t'
> /usr/include/machine/_types.h:66: error: expected '=', ',', ';', 'asm'
> or '__attribute__' before '__float_t'
You system headers do something stupid: they use float/double in
standalone headers we use option -Dfloat=__grub_poison and
-Ddouble=__grub_poison to check that we don't use any float/double.
Unfortunately such stupidity is more widespread that it should be. I'll
remove poisonin of float/double in trunk.


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

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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 18:04   ` Beeblebrox
@ 2013-11-02  7:58     ` Beeblebrox
  2013-11-02 14:55       ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-11-02  7:58 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Per your suggestion, I ran:
$ ./autogen.sh --disable-werror
$ ./configure --disable-werror
$ gmake  => breaks with below. (also tried with $ gmake -Wno-error).
Where to go from here?

gmake  all-am
gmake[3]: Entering directory `/asp/git/grub/grub-core'
gcc -DHAVE_CONFIG_H -I. -I..   -Wall -W -I../include -I../include
-DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC
-DGRUB_TARGET_CPU_I386=1 -m32 -nostdinc -isystem /usr/include
-DGRUB_FILE=\"gnulib/regex.c\" -I. -I. -I.. -I.. -I../include
-I../include -I../grub-core/lib/libgcrypt-grub/include
-I../grub-core/lib/libgcrypt-grub/src/  -I../grub-core/lib/posix_wrap
-I../grub-core/gnulib -I../grub-core/gnulib
-I/usr/local/include  -Os -Wall -W -Wshadow -Wold-style-definition
-Wpointer-arith -Wundef -Wextra -Wattributes -Wcast-align
-Wchar-subscripts -Wcomment -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal
-Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces
-Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar
-Wnonnull -Woverflow -Wparentheses -Wpointer-arith
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
-Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef
-Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
-Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros
-Wvolatile-register-var -Wwrite-strings -Wnested-externs
-Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls
-Wmissing-prototypes -Wmissing-declarations -falign-jumps=1
-falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2
-mno-3dnow -m32 -fno-stack-protector -mno-stack-arg-probe
-Wtrampolines  -mrtd -mregparm=3 -freg-struct-return
-Dfloat=__grub_poison -Ddouble=__grub_poison -fno-builtin -fno-builtin
-Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter
-Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
-Wno-old-style-definition -Wno-unsafe-loop-optimizations
  -MT gnulib/libgnulib_a-regex.o -MD -MP -MF
gnulib/.deps-core/libgnulib_a-regex.Tpo -c -o
gnulib/libgnulib_a-regex.o `test -f 'gnulib/regex.c' || echo
'./'`gnulib/regex.c
In file included from /usr/include/sys/_types.h:33,
                 from /usr/include/stdarg.h:35,
                 from ../include/grub/misc.h:23,
                 from ../grub-core/lib/posix_wrap/sys/types.h:22,
                 from ../grub-core/gnulib/regex.h:24,
                 from gnulib/regex.c:67:
/usr/include/machine/_types.h:65: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '__double_t'
/usr/include/machine/_types.h:66: error: expected '=', ',', ';', 'asm'
or '__attribute__' before '__float_t'
gmake[3]: *** [gnulib/libgnulib_a-regex.o] Error 1
gmake[3]: Leaving directory `/asp/git/grub/grub-core'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/asp/git/grub/grub-core'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/asp/git/grub'
gmake: *** [all] Error 2


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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 10:37 Beeblebrox
                   ` (2 preceding siblings ...)
  2013-10-31 17:32 ` Andrey Borzenkov
@ 2013-10-31 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
  3 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-10-31 19:06 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 31.10.2013 11:37, Beeblebrox wrote:
> cc1: warnings being treated as errors
> grub_script.yy.c: In function 'yy_scan_bytes':
> grub_script.yy.c:2298: warning: comparison between signed and unsigned
> gmake[2]: *** [libgrubmods_a-grub_script.yy.o] Error 1
Buggy flex needs --disable-werror.


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

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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 17:32 ` Andrey Borzenkov
@ 2013-10-31 18:04   ` Beeblebrox
  2013-11-02  7:58     ` Beeblebrox
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-10-31 18:04 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

>> cc1: warnings being treated as errors
>> grub_script.yy.c: In function 'yy_scan_bytes':
>> grub_script.yy.c:2298: warning: comparison between signed and unsigned
>
> It is a flex bug which is hidden on platforms where sizeof(size_t) >
> sizeof(int).

Nothing I can do about flex, so then I just wait for the fix? Then
grub-on-zfs-amd64 also waits for upstream. Whatever you suggest...


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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 10:37 Beeblebrox
  2013-10-31 11:40 ` Beeblebrox
  2013-10-31 16:24 ` Andrey Borzenkov
@ 2013-10-31 17:32 ` Andrey Borzenkov
  2013-10-31 18:04   ` Beeblebrox
  2013-10-31 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
  3 siblings, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-10-31 17:32 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Thu, 31 Oct 2013 12:37:41 +0200
Beeblebrox <zaphod@berentweb.com> пишет:

> I did not have time to play around with trunk/grub for a while so was
> not able to follow-up on the discussion. Continuing from last month's
> topic:
> 
> > Flex version 2.5.4 is less than 2.3.35.
> 2.5 is > 2.3

Yes, my apologies.

> cc1: warnings being treated as errors
> grub_script.yy.c: In function 'yy_scan_bytes':
> grub_script.yy.c:2298: warning: comparison between signed and unsigned


It is a flex bug which is hidden on platforms where sizeof(size_t) >
sizeof(int).

http://sourceforge.net/p/flex/bugs/140/


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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 16:24 ` Andrey Borzenkov
@ 2013-10-31 16:36   ` Beeblebrox
  0 siblings, 0 replies; 60+ messages in thread
From: Beeblebrox @ 2013-10-31 16:36 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

> What are sizes of size_t and int on your platform?

My system is amd4 running FreeBSD-9.2
If you require more information please instruct code to run from CLI for that.


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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 10:37 Beeblebrox
  2013-10-31 11:40 ` Beeblebrox
@ 2013-10-31 16:24 ` Andrey Borzenkov
  2013-10-31 16:36   ` Beeblebrox
  2013-10-31 17:32 ` Andrey Borzenkov
  2013-10-31 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
  3 siblings, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-10-31 16:24 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Thu, 31 Oct 2013 12:37:41 +0200
Beeblebrox <zaphod@berentweb.com> пишет:

> I did not have time to play around with trunk/grub for a while so was
> not able to follow-up on the discussion. Continuing from last month's
> topic:
> 
> > Flex version 2.5.4 is less than 2.3.35.
> 2.5 is > 2.3
> The problem was answered by the port maintainer for me:
> "FreeBSD includes an older version of Flex in the base system. You
> will need that the compilation should use the version installed in
> /usr/local/bin instead. Either by putting this directory in your $PATH
> earlier than /usr/bin or by specifying the location on the command
> line."
> Was solved by editing $PATH to look in /usr/local/bin first.
> 
> The new problem is that after autogen and configure complete without
> errors, gmake fails (gcc version is 4.6):
> gcc -DHAVE_CONFIG_H -I.   -Wall -W -I./include -DGRUB_UTIL=1
> -DGRUB_LIBDIR=\"/usr/local/lib/grub\"
> -DLOCALEDIR=\"/usr/local/share/locale\"
> -DGRUB_FILE=\"grub_script.yy.c\" -I. -I. -I. -I. -I./include
> -I./include -I./grub-core/lib/libgcrypt-grub/include
> -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/lib/minilzo
> -I./grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H
> -I/usr/local/include  -Wall -W -Wshadow -Wold-style-definition
> -Wpointer-arith -Wundef -Wextra -Wattributes -Wcast-align
> -Wchar-subscripts -Wcomment -Wdeprecated-declarations
> -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal
> -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
> -Wimplicit-function-declaration -Wimplicit-int -Winit-self
> -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces
> -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar
> -Wnonnull -Woverflow -Wparentheses -Wpointer-arith
> -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
> -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef
> -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
> -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros
> -Wvolatile-register-var -Wwrite-strings -Wnested-externs
> -Wstrict-prototypes -Wpointer-sign -Werror  -fno-builtin -Wno-undef
>              -MT libgrubmods_a-grub_script.yy.o -MD -MP -MF
> .deps-util/libgrubmods_a-grub_script.yy.Tpo -c -o
> libgrubmods_a-grub_script.yy.o `test -f 'grub_script.yy.c' || echo
> './'`grub_script.yy.c
> cc1: warnings being treated as errors
> grub_script.yy.c: In function 'yy_scan_bytes':
> grub_script.yy.c:2298: warning: comparison between signed and unsigned

What are sizes of size_t and int on your platform?

> gmake[2]: *** [libgrubmods_a-grub_script.yy.o] Error 1
> gmake[2]: Leaving directory `/asp/git/grub'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/asp/git/grub'
> gmake: *** [all] Error 2
> 
> Any ideas how to move forward? I assume I'm on the right branch:
> bzr info -v .
> Standalone tree (format: 2a)
> Related branches:   parent branch:
> http://bzr.savannah.gnu.org/r/grub/trunk/grub/
> Branch history:       5210 revisions       1946 days old
>    first revision: Wed 2008-07-02 19:22:35 +0000
>   latest revision: Sat 2013-09-28 03:06:04 +0200
> Repository:        7726 revisions
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



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

* Re: grub2 boot root-on-zfs errors
  2013-10-31 10:37 Beeblebrox
@ 2013-10-31 11:40 ` Beeblebrox
  2013-10-31 16:24 ` Andrey Borzenkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 60+ messages in thread
From: Beeblebrox @ 2013-10-31 11:40 UTC (permalink / raw)
  To: The development of GNU GRUB

switched local repo to git (git://git.savannah.gnu.org/grub.git)

Compile error persists as advised in previous mail


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

* grub2 boot root-on-zfs errors
@ 2013-10-31 10:37 Beeblebrox
  2013-10-31 11:40 ` Beeblebrox
                   ` (3 more replies)
  0 siblings, 4 replies; 60+ messages in thread
From: Beeblebrox @ 2013-10-31 10:37 UTC (permalink / raw)
  To: The development of GNU GRUB

I did not have time to play around with trunk/grub for a while so was
not able to follow-up on the discussion. Continuing from last month's
topic:

> Flex version 2.5.4 is less than 2.3.35.
2.5 is > 2.3
The problem was answered by the port maintainer for me:
"FreeBSD includes an older version of Flex in the base system. You
will need that the compilation should use the version installed in
/usr/local/bin instead. Either by putting this directory in your $PATH
earlier than /usr/bin or by specifying the location on the command
line."
Was solved by editing $PATH to look in /usr/local/bin first.

The new problem is that after autogen and configure complete without
errors, gmake fails (gcc version is 4.6):
gcc -DHAVE_CONFIG_H -I.   -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/local/lib/grub\"
-DLOCALEDIR=\"/usr/local/share/locale\"
-DGRUB_FILE=\"grub_script.yy.c\" -I. -I. -I. -I. -I./include
-I./include -I./grub-core/lib/libgcrypt-grub/include
-I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/lib/minilzo
-I./grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H
-I/usr/local/include  -Wall -W -Wshadow -Wold-style-definition
-Wpointer-arith -Wundef -Wextra -Wattributes -Wcast-align
-Wchar-subscripts -Wcomment -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal
-Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces
-Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar
-Wnonnull -Woverflow -Wparentheses -Wpointer-arith
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
-Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef
-Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
-Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros
-Wvolatile-register-var -Wwrite-strings -Wnested-externs
-Wstrict-prototypes -Wpointer-sign -Werror  -fno-builtin -Wno-undef
             -MT libgrubmods_a-grub_script.yy.o -MD -MP -MF
.deps-util/libgrubmods_a-grub_script.yy.Tpo -c -o
libgrubmods_a-grub_script.yy.o `test -f 'grub_script.yy.c' || echo
'./'`grub_script.yy.c
cc1: warnings being treated as errors
grub_script.yy.c: In function 'yy_scan_bytes':
grub_script.yy.c:2298: warning: comparison between signed and unsigned
gmake[2]: *** [libgrubmods_a-grub_script.yy.o] Error 1
gmake[2]: Leaving directory `/asp/git/grub'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/asp/git/grub'
gmake: *** [all] Error 2

Any ideas how to move forward? I assume I'm on the right branch:
bzr info -v .
Standalone tree (format: 2a)
Related branches:   parent branch:
http://bzr.savannah.gnu.org/r/grub/trunk/grub/
Branch history:       5210 revisions       1946 days old
   first revision: Wed 2008-07-02 19:22:35 +0000
  latest revision: Sat 2013-09-28 03:06:04 +0200
Repository:        7726 revisions


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

* Re: grub2 boot root-on-zfs errors
  2013-09-28 11:56 Beeblebrox
@ 2013-09-28 14:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-28 14:42 UTC (permalink / raw)
  To: grub-devel

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

On 28.09.2013 13:56, Beeblebrox wrote:
>>> I dare to guess - install zfs library.
> 
> My system is FreeBSD - separate zfs library is a linuxism, since in
> FreeBSD zfs is part of base source (/usr/src) and vannot be installed
> as a separate package unlike in linux.
Look at config.log. We check that -lzfs provides libzfs_init and
-lnvpair provides nvlist_print.
> 
> If you mean here that grub has separate zfslib source code, I have not found it.
> 
>>> it is used only to build user level utilites
> What are those utilities, like zfsinfo in grub command-line?
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* grub2 boot root-on-zfs errors
@ 2013-09-28 11:56 Beeblebrox
  2013-09-28 14:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-09-28 11:56 UTC (permalink / raw)
  To: The development of GNU GRUB

>> I dare to guess - install zfs library.

My system is FreeBSD - separate zfs library is a linuxism, since in
FreeBSD zfs is part of base source (/usr/src) and vannot be installed
as a separate package unlike in linux.

If you mean here that grub has separate zfslib source code, I have not found it.

>> it is used only to build user level utilites
What are those utilities, like zfsinfo in grub command-line?


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

* Re: grub2 boot root-on-zfs errors
  2013-09-28  8:48 Beeblebrox
@ 2013-09-28 11:06 ` Andrey Borzenkov
  0 siblings, 0 replies; 60+ messages in thread
From: Andrey Borzenkov @ 2013-09-28 11:06 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Sat, 28 Sep 2013 11:48:54 +0300
Beeblebrox <zaphod@berentweb.com> пишет:

> I had tried to build from source several months back, and had a
> discussion on the FreeBSD mail list about the issue. The problem was
> that the config is set as no_libzfs_support. What is the way to
> correct this (need zfs library)?)

I dare to guess - install zfs library.

But note that it is used only to build user level utilites; bootloader
runtime code should not depend on it (except for grub emu).

> GRUB2 will be compiled with following components:
> Platform: i386-pc
> With devmapper support: No (need libdevmapper header)
> With memory debugging: No
> With disk cache statistics: No
> With boot time statistics: No
> efiemu runtime: No (cannot compile with -m64 -mcmodel=large
> -mno-red-zone -nostdlib)
> grub-mkfont: Yes
> grub-mount: No (need FUSE library)
> starfield theme: No (No DejaVu found)
> With libzfs support: No (need zfs library)
> Build-time grub-mkfont: No (no fonts)
> Without unifont (no build-time grub-mkfont)
> With liblzma from -llzma (support for XZ-compressed mips images)
> ------------------------------------------------
> 
> Other notes as information for any future reader:
> *  I had to instal devel/bzr (the main bazaar port) since *BSD does
> not have any git->bzr translator. The only tool at the date of this
> message is bzr->git, which requires the base bzr port to be installed
> anyway.
> * devel/autogen needs to be installed
> * I had to disable line 6014 in config, because it gives incorrect error:
> # as_fn_error $? "flex is too old. GRUB requires 2.5.35 or above" "$LINENO" 5
> flex --version  =>  flex version 2.5.4,  PORTVERSION=    2.5.37

And what is incorrect here? Flex version 2.5.4 is less than 2.3.35.

> FreeBSD-9.2-stable_amd64
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



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

* grub2 boot root-on-zfs errors
@ 2013-09-28  8:48 Beeblebrox
  2013-09-28 11:06 ` Andrey Borzenkov
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-09-28  8:48 UTC (permalink / raw)
  To: The development of GNU GRUB

I had tried to build from source several months back, and had a
discussion on the FreeBSD mail list about the issue. The problem was
that the config is set as no_libzfs_support. What is the way to
correct this (need zfs library)?)
GRUB2 will be compiled with following components:
Platform: i386-pc
With devmapper support: No (need libdevmapper header)
With memory debugging: No
With disk cache statistics: No
With boot time statistics: No
efiemu runtime: No (cannot compile with -m64 -mcmodel=large
-mno-red-zone -nostdlib)
grub-mkfont: Yes
grub-mount: No (need FUSE library)
starfield theme: No (No DejaVu found)
With libzfs support: No (need zfs library)
Build-time grub-mkfont: No (no fonts)
Without unifont (no build-time grub-mkfont)
With liblzma from -llzma (support for XZ-compressed mips images)
------------------------------------------------

Other notes as information for any future reader:
*  I had to instal devel/bzr (the main bazaar port) since *BSD does
not have any git->bzr translator. The only tool at the date of this
message is bzr->git, which requires the base bzr port to be installed
anyway.
* devel/autogen needs to be installed
* I had to disable line 6014 in config, because it gives incorrect error:
# as_fn_error $? "flex is too old. GRUB requires 2.5.35 or above" "$LINENO" 5
flex --version  =>  flex version 2.5.4,  PORTVERSION=    2.5.37
FreeBSD-9.2-stable_amd64


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

* Re: grub2 boot root-on-zfs errors
  2013-09-25  8:06 ` Andrey Borzenkov
@ 2013-09-25 10:33   ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-25 10:33 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 25.09.2013 10:06, Andrey Borzenkov wrote:
>> Andrey has written, entry should be:
>> > (hd0,gpt2)/root@/boot/kernel/kernel ?
> I'm not sure now. Could you try
> 
> (hd0,gpt2)tank0/root@/boot/kernel/kernel
It's (hd0,gpt2)/root@/boot/kernel/kernel


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

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

* Re: grub2 boot root-on-zfs errors
  2013-09-25  6:58 Beeblebrox
@ 2013-09-25  8:06 ` Andrey Borzenkov
  2013-09-25 10:33   ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-09-25  8:06 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Wed, 25 Sep 2013 09:58:47 +0300
Beeblebrox <zaphod@berentweb.com> пишет:

> @Andrey:
> >> Should not it be (hd0,gpt2)/bsds@/boot/kernel/kernel
> Tried that also, same error
> 
> @Vladimir:
> >> Please reread what Andrey said. poolname is not part of the path.
> Somehow, I missed Andrey's answer...
> I don't understand however, how "poolname is not part of path". If we
> have tank0 as pool and root as dataset, (tank0/root) then from what
> Andrey has written, entry should be:
> (hd0,gpt2)/root@/boot/kernel/kernel ?

I'm not sure now. Could you try

(hd0,gpt2)tank0/root@/boot/kernel/kernel

? I will update documentation then.

> or is it (hd0,gpt2)/@root/boot/kernel/kernel ?
> whereas if there is no separate root dataset and root resides directly
> on tank0 dataset, entry becomes:
> (hd0,gpt2)/@/boot/kernel/kernel ?
> 

Actually I start to suspect that the correct name would be

(hd0,gpt2)tank0@/boot/kernel/kernel

Looking at code it does not strip initial slash and it is not part
of dataset name ...

> >> grub 2.00 is not enough for version 5000. You need current trunk
> In order to correctly install a binary in FreeBSD, I must first create
> a custom port and a Makefile for it. To do so, I need the source code
> to be in tar.bz format. Is there a tar format available, or should I
> checkout http://bzr.savannah.gnu.org/r/grub/trunk/grub and tar the
> result?
> 

I usually do

./autogen.sh
./configure
make dist-bz

configure options do not matter as make dist is supposed to produce
exactly the same result on every platform. If you find some missing
files, please report.

> Thanks again for your patience.
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



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

* grub2 boot root-on-zfs errors
@ 2013-09-25  6:58 Beeblebrox
  2013-09-25  8:06 ` Andrey Borzenkov
  0 siblings, 1 reply; 60+ messages in thread
From: Beeblebrox @ 2013-09-25  6:58 UTC (permalink / raw)
  To: The development of GNU GRUB

@Andrey:
>> Should not it be (hd0,gpt2)/bsds@/boot/kernel/kernel
Tried that also, same error

@Vladimir:
>> Please reread what Andrey said. poolname is not part of the path.
Somehow, I missed Andrey's answer...
I don't understand however, how "poolname is not part of path". If we
have tank0 as pool and root as dataset, (tank0/root) then from what
Andrey has written, entry should be:
(hd0,gpt2)/root@/boot/kernel/kernel ?
or is it (hd0,gpt2)/@root/boot/kernel/kernel ?
whereas if there is no separate root dataset and root resides directly
on tank0 dataset, entry becomes:
(hd0,gpt2)/@/boot/kernel/kernel ?

>> grub 2.00 is not enough for version 5000. You need current trunk
In order to correctly install a binary in FreeBSD, I must first create
a custom port and a Makefile for it. To do so, I need the source code
to be in tar.bz format. Is there a tar format available, or should I
checkout http://bzr.savannah.gnu.org/r/grub/trunk/grub and tar the
result?

Thanks again for your patience.


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

* Re: grub2 boot root-on-zfs errors
  2013-09-24 15:49 ` Beeblebrox
  2013-09-24 16:01   ` Andrey Borzenkov
@ 2013-09-24 16:11   ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-24 16:11 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 24.09.2013 17:49, Beeblebrox wrote:
> Neither of the above entries work.
Neither of them is correct. Please reread what Andrey said. poolname is
not part of the path.
Also grub 2.00 is not enough for version 5000. You need current trunk


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

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

* Re: grub2 boot root-on-zfs errors
  2013-09-24 15:49 ` Beeblebrox
@ 2013-09-24 16:01   ` Andrey Borzenkov
  2013-09-24 16:11   ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 60+ messages in thread
From: Andrey Borzenkov @ 2013-09-24 16:01 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: zaphod

В Tue, 24 Sep 2013 18:49:33 +0300
Beeblebrox <zaphod@berentweb.com> пишет:

> Massimo:
> >> should be written as (hd0,gpt2)/mydataset/@/myfolder/myfile.
> Yes, of course - I made the mistake because I was in a hurry writing
> the mail. My current & corrected menu choices are:
> 
> menuentry "Test1-BSD-ZFS Direct-Boot" {
>     insmod zfs
>     search -s -l bsds
>     set root='hd0,gpt2'
>     kfreebsd (hd0,gpt2)/bsds/@/boot/kernel/kernel

Should not it be (hd0,gpt2)/bsds@/boot/kernel/kernel (notice lack of
slash between "bsds" and "@")?

>     kfreebsd_module_elf (hd0,gpt2)/bsds/@/boot/kernel/opensolaris.ko
>     kfreebsd_module_elf (hd0,gpt2)/bsds/@/boot/kernel/zfs.ko
>     kfreebsd_module (hd0,gpt2)/bsds/@/boot/zfs/zpool.cache
> type=/boot/zfs/zpool.cache
>     kfreebsd_loadenv (hd0,gpt2)/bsds/@/boot/device.hints
>     set kFreeBSD.vfs.root.mountfrom=zfs:bsds
> }
> menuentry 'Test2-BSD-ZFS ChainloadBTX' {
>     insmod zfs
>     set root='hd0,gpt2'
>     kfreebsd (hd0,gpt2)/bsds/@/boot/loader
> }
> 
> Neither of the above entries work. My root zpool is named "bsds" and
> the zfs is the same as the root pool. In other words, zfs list =>
> bsds   /
> bsds/usr   /usr
> bsds/var   /var
> etc...
> I have also tried (unsuccessfully) the above with
>     set root='hd0,gpt2'
>     kfreebsd /@/boot/loader  OR
>     kfreebsd (hd0,gpt2)/@/boot/loader  OR
>     kfreebsd (hd0,gpt2)//@/boot/loader
> All give "unknown filesystem" message. When I drop to grub
> command-propmt, and try:
> zfsinfo (hd0,gpt2)  => error: couldn't find a valid label
> I did not try the other 2 zfs-related commands because I do not know
> how to use them.
> 
> Finally, The grub version on the HDD is from Ubuntu-Raring (2.0). I
> should and want to re-code grub from the FreeBSD side, but I am
> hesitant since I don't want to fail and work to re-install the
> bootloader. FreeBSD's grub is also 2.0. The grub-mkconfig command
> however, generates a completely different grub.cfg. The currently
> installed (ubuntu) grub does not recognize the "t" command and neither
> the root ID c2955d0d7dd8618b (no such device)
> menuentry 'FreeBSD' --class freebsd --class bsd --class os
> $menuentry_id_option 'kfreebsd-simple-c2955d0d7dd8618b' {
> tinsmod part_gpt
> tinsmod zfs
> tif [ x$feature_platform_search_hint = xy ]; then
> t  search --no-floppy --fs-uuid --set=root  c2955d0d7dd8618b
> telse
> t  search --no-floppy --fs-uuid --set=root c2955d0d7dd8618b
> tfi
>     echo            'Loading kernel of FreeBSD kernel ...'
>     kfreebsd        //@/boot/kernel/kernel
>     kfreebsd_loadenv    //@/boot/device.hints
> tinsmod part_gpt
> tinsmod zfs
> tif [ x$feature_platform_search_hint = xy ]; then
> t  search --no-floppy --fs-uuid --set=root  c2955d0d7dd8618b
> telse
> t  search --no-floppy --fs-uuid --set=root c2955d0d7dd8618b
> tfi
>     kfreebsd_module_elf    //@/boot/kernel/opensolaris.ko
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



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

* grub2 boot root-on-zfs errors
  2013-09-23 18:59 Beeblebrox
  2013-09-23 19:24 ` Massimo Maggi
  2013-09-23 19:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-09-24 15:49 ` Beeblebrox
  2013-09-24 16:01   ` Andrey Borzenkov
  2013-09-24 16:11   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 2 replies; 60+ messages in thread
From: Beeblebrox @ 2013-09-24 15:49 UTC (permalink / raw)
  To: The development of GNU GRUB

Massimo:
>> should be written as (hd0,gpt2)/mydataset/@/myfolder/myfile.
Yes, of course - I made the mistake because I was in a hurry writing
the mail. My current & corrected menu choices are:

menuentry "Test1-BSD-ZFS Direct-Boot" {
    insmod zfs
    search -s -l bsds
    set root='hd0,gpt2'
    kfreebsd (hd0,gpt2)/bsds/@/boot/kernel/kernel
    kfreebsd_module_elf (hd0,gpt2)/bsds/@/boot/kernel/opensolaris.ko
    kfreebsd_module_elf (hd0,gpt2)/bsds/@/boot/kernel/zfs.ko
    kfreebsd_module (hd0,gpt2)/bsds/@/boot/zfs/zpool.cache
type=/boot/zfs/zpool.cache
    kfreebsd_loadenv (hd0,gpt2)/bsds/@/boot/device.hints
    set kFreeBSD.vfs.root.mountfrom=zfs:bsds
}
menuentry 'Test2-BSD-ZFS ChainloadBTX' {
    insmod zfs
    set root='hd0,gpt2'
    kfreebsd (hd0,gpt2)/bsds/@/boot/loader
}

Neither of the above entries work. My root zpool is named "bsds" and
the zfs is the same as the root pool. In other words, zfs list =>
bsds   /
bsds/usr   /usr
bsds/var   /var
etc...
I have also tried (unsuccessfully) the above with
    set root='hd0,gpt2'
    kfreebsd /@/boot/loader  OR
    kfreebsd (hd0,gpt2)/@/boot/loader  OR
    kfreebsd (hd0,gpt2)//@/boot/loader
All give "unknown filesystem" message. When I drop to grub
command-propmt, and try:
zfsinfo (hd0,gpt2)  => error: couldn't find a valid label
I did not try the other 2 zfs-related commands because I do not know
how to use them.

Finally, The grub version on the HDD is from Ubuntu-Raring (2.0). I
should and want to re-code grub from the FreeBSD side, but I am
hesitant since I don't want to fail and work to re-install the
bootloader. FreeBSD's grub is also 2.0. The grub-mkconfig command
however, generates a completely different grub.cfg. The currently
installed (ubuntu) grub does not recognize the "t" command and neither
the root ID c2955d0d7dd8618b (no such device)
menuentry 'FreeBSD' --class freebsd --class bsd --class os
$menuentry_id_option 'kfreebsd-simple-c2955d0d7dd8618b' {
tinsmod part_gpt
tinsmod zfs
tif [ x$feature_platform_search_hint = xy ]; then
t  search --no-floppy --fs-uuid --set=root  c2955d0d7dd8618b
telse
t  search --no-floppy --fs-uuid --set=root c2955d0d7dd8618b
tfi
    echo            'Loading kernel of FreeBSD kernel ...'
    kfreebsd        //@/boot/kernel/kernel
    kfreebsd_loadenv    //@/boot/device.hints
tinsmod part_gpt
tinsmod zfs
tif [ x$feature_platform_search_hint = xy ]; then
t  search --no-floppy --fs-uuid --set=root  c2955d0d7dd8618b
telse
t  search --no-floppy --fs-uuid --set=root c2955d0d7dd8618b
tfi
    kfreebsd_module_elf    //@/boot/kernel/opensolaris.ko


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

* Re: grub2 boot root-on-zfs errors
  2013-09-24 11:01     ` Andrey Borzenkov
@ 2013-09-24 11:12       ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-24 11:12 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 24.09.2013 13:01, Andrey Borzenkov wrote:
> Like this?
> 
> From: Andrey Borzenkov <arvidjaar@gmail.com>
> To: grub-devel@gnu.org
> Subject: [PATCH] document ZFS filename syntax.
Go ahead


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

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

* Re: grub2 boot root-on-zfs errors
  2013-09-24  3:56   ` Andrey Borzenkov
@ 2013-09-24 11:01     ` Andrey Borzenkov
  2013-09-24 11:12       ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-09-24 11:01 UTC (permalink / raw)
  To: grub-devel

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

В Tue, 24 Sep 2013 07:56:36 +0400
Andrey Borzenkov <arvidjaar@gmail.com> пишет:

> В Mon, 23 Sep 2013 21:28:41 +0200
> Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> 
> > On 23.09.2013 20:59, Beeblebrox wrote:
> > >>>  This doesn't demonstrate anything else than that you didn't use tools
> > > correctly. It's:  grub-probe -d /dev/ada0p2
> > > 
> > > Thank you very much - I ran the command you instructed and see that
> > > the FS is identified correctly.
> > > $ grub-probe -d /dev/ada0p2
> > > zfs
> > > 
> > > I cannot, however, boot from grub directly into zfs-root. After the
> > > grub menu comes up, and I fall to command-prompt, listing the drives
> > > shows no ZFS paths and the various menu variations I have tried do not
> > > work.
> > > 
> > > Unfortunately, there is not much accurate documentation for
> > > FreeBSD+ZFS+grub, and the linux solutions to the problem do not work
> > > for FreeBSD.
> > > 
> > > The main problem form the grub loader / command line, is that I cannot
> > > get any code loaded which is located on a ZPOOL:
> > > 
> > > menuentry 'FreeBSD-ZFS' {
> > >     insmod zfs
> > >     set root='hd0,gpt2'
> > >     kfreebsd /boot/loader      }
> > > 
> > > Fails because grub cannot find bootloader and gives "no such file" error.
> > > Please let me know what ıther info I can provide to debug the problem.
> > > 
> > Syntax is:
> > (DISK)/VOLUME@[SNAPSHOT]/FILE
> > I think it's described somewhere in manual
> 
> No, it is not. There are examples using zfs with this syntax (but
> without snapshot)s).
> 
> I'm not sure where should it go ... in "File name syntax" probably?

Like this?

From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] document ZFS filename syntax.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>

---
 docs/grub.texi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docs/grub.texi b/docs/grub.texi
index 574f602..1cef528 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -2564,6 +2564,13 @@ GRUB's @dfn{root device} implicitly. So if you set the root device to,
 say, @samp{(hd1,1)} by the command @samp{set root=(hd1,1)} (@pxref{set}),
 then @code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}.
 
+On ZFS filesystem the first path component must be
+@var{volume}@samp{@@}[@var{snapshot}].
+So @samp{/rootvol@snap-129/boot/grub/grub.cfg} refers to file
+@samp{/boot/grub/grub.cfg} in snapshot of volume @samp{rootvol} with name
+@samp{snap-129}.  Trailing @samp{@@} after volume name is mandatory even if
+snapshot name is omitted.
+
 
 @node Block list syntax
 @section How to specify block lists
-- 
tg: (321e011..) u/zfs_file_names (depends on: master)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: grub2 boot root-on-zfs errors
  2013-09-23 19:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-09-24  3:56   ` Andrey Borzenkov
  2013-09-24 11:01     ` Andrey Borzenkov
  0 siblings, 1 reply; 60+ messages in thread
From: Andrey Borzenkov @ 2013-09-24  3:56 UTC (permalink / raw)
  To: grub-devel

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

В Mon, 23 Sep 2013 21:28:41 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> On 23.09.2013 20:59, Beeblebrox wrote:
> >>>  This doesn't demonstrate anything else than that you didn't use tools
> > correctly. It's:  grub-probe -d /dev/ada0p2
> > 
> > Thank you very much - I ran the command you instructed and see that
> > the FS is identified correctly.
> > $ grub-probe -d /dev/ada0p2
> > zfs
> > 
> > I cannot, however, boot from grub directly into zfs-root. After the
> > grub menu comes up, and I fall to command-prompt, listing the drives
> > shows no ZFS paths and the various menu variations I have tried do not
> > work.
> > 
> > Unfortunately, there is not much accurate documentation for
> > FreeBSD+ZFS+grub, and the linux solutions to the problem do not work
> > for FreeBSD.
> > 
> > The main problem form the grub loader / command line, is that I cannot
> > get any code loaded which is located on a ZPOOL:
> > 
> > menuentry 'FreeBSD-ZFS' {
> >     insmod zfs
> >     set root='hd0,gpt2'
> >     kfreebsd /boot/loader      }
> > 
> > Fails because grub cannot find bootloader and gives "no such file" error.
> > Please let me know what ıther info I can provide to debug the problem.
> > 
> Syntax is:
> (DISK)/VOLUME@[SNAPSHOT]/FILE
> I think it's described somewhere in manual

No, it is not. There are examples using zfs with this syntax (but
without snapshot)s).

I'm not sure where should it go ... in "File name syntax" probably?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: grub2 boot root-on-zfs errors
  2013-09-23 18:59 Beeblebrox
  2013-09-23 19:24 ` Massimo Maggi
@ 2013-09-23 19:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-09-24  3:56   ` Andrey Borzenkov
  2013-09-24 15:49 ` Beeblebrox
  2 siblings, 1 reply; 60+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-09-23 19:28 UTC (permalink / raw)
  To: The development of GNU GRUB

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

On 23.09.2013 20:59, Beeblebrox wrote:
>>>  This doesn't demonstrate anything else than that you didn't use tools
> correctly. It's:  grub-probe -d /dev/ada0p2
> 
> Thank you very much - I ran the command you instructed and see that
> the FS is identified correctly.
> $ grub-probe -d /dev/ada0p2
> zfs
> 
> I cannot, however, boot from grub directly into zfs-root. After the
> grub menu comes up, and I fall to command-prompt, listing the drives
> shows no ZFS paths and the various menu variations I have tried do not
> work.
> 
> Unfortunately, there is not much accurate documentation for
> FreeBSD+ZFS+grub, and the linux solutions to the problem do not work
> for FreeBSD.
> 
> The main problem form the grub loader / command line, is that I cannot
> get any code loaded which is located on a ZPOOL:
> 
> menuentry 'FreeBSD-ZFS' {
>     insmod zfs
>     set root='hd0,gpt2'
>     kfreebsd /boot/loader      }
> 
> Fails because grub cannot find bootloader and gives "no such file" error.
> Please let me know what ıther info I can provide to debug the problem.
> 
Syntax is:
(DISK)/VOLUME@[SNAPSHOT]/FILE
I think it's described somewhere in manual
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



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

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

* Re: grub2 boot root-on-zfs errors
  2013-09-23 18:59 Beeblebrox
@ 2013-09-23 19:24 ` Massimo Maggi
  2013-09-23 19:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-09-24 15:49 ` Beeblebrox
  2 siblings, 0 replies; 60+ messages in thread
From: Massimo Maggi @ 2013-09-23 19:24 UTC (permalink / raw)
  To: The development of GNU GRUB

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

2013/9/23 Beeblebrox <zaphod@berentweb.com>

> menuentry 'FreeBSD-ZFS' {
>     insmod zfs
>     set root='hd0,gpt2'
>     kfreebsd /boot/loader      }
>
> Fails because grub cannot find bootloader and gives "no such file" error.
>

You didn't specify the dataset (or snapshot) which has the /boot/loader
file you're interested in.
For instance:
tankpool/mydataset/myfolder/myfile
should be written as (hd0,gpt2)/mydataset/@/myfolder/myfile.
You can check the syntax by using the Grub interactive command line and
tab-completion.
Regards,
Massimo Maggi

[-- Attachment #2: Type: text/html, Size: 1008 bytes --]

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

* grub2 boot root-on-zfs errors
@ 2013-09-23 18:59 Beeblebrox
  2013-09-23 19:24 ` Massimo Maggi
                   ` (2 more replies)
  0 siblings, 3 replies; 60+ messages in thread
From: Beeblebrox @ 2013-09-23 18:59 UTC (permalink / raw)
  To: The development of GNU GRUB

>>  This doesn't demonstrate anything else than that you didn't use tools
correctly. It's:  grub-probe -d /dev/ada0p2

Thank you very much - I ran the command you instructed and see that
the FS is identified correctly.
$ grub-probe -d /dev/ada0p2
zfs

I cannot, however, boot from grub directly into zfs-root. After the
grub menu comes up, and I fall to command-prompt, listing the drives
shows no ZFS paths and the various menu variations I have tried do not
work.

Unfortunately, there is not much accurate documentation for
FreeBSD+ZFS+grub, and the linux solutions to the problem do not work
for FreeBSD.

The main problem form the grub loader / command line, is that I cannot
get any code loaded which is located on a ZPOOL:

menuentry 'FreeBSD-ZFS' {
    insmod zfs
    set root='hd0,gpt2'
    kfreebsd /boot/loader      }

Fails because grub cannot find bootloader and gives "no such file" error.
Please let me know what ıther info I can provide to debug the problem.


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

end of thread, other threads:[~2013-11-25 22:12 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30  7:23 grub2 boot root-on-zfs errors Raif S. Berent
2013-09-05  7:31 ` Beeblebrox
2013-09-23  9:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-23 18:59 Beeblebrox
2013-09-23 19:24 ` Massimo Maggi
2013-09-23 19:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-24  3:56   ` Andrey Borzenkov
2013-09-24 11:01     ` Andrey Borzenkov
2013-09-24 11:12       ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-24 15:49 ` Beeblebrox
2013-09-24 16:01   ` Andrey Borzenkov
2013-09-24 16:11   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-25  6:58 Beeblebrox
2013-09-25  8:06 ` Andrey Borzenkov
2013-09-25 10:33   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-28  8:48 Beeblebrox
2013-09-28 11:06 ` Andrey Borzenkov
2013-09-28 11:56 Beeblebrox
2013-09-28 14:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-31 10:37 Beeblebrox
2013-10-31 11:40 ` Beeblebrox
2013-10-31 16:24 ` Andrey Borzenkov
2013-10-31 16:36   ` Beeblebrox
2013-10-31 17:32 ` Andrey Borzenkov
2013-10-31 18:04   ` Beeblebrox
2013-11-02  7:58     ` Beeblebrox
2013-11-02 14:55       ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-31 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-04  6:13 Beeblebrox
2013-11-05  7:35 ` Beeblebrox
2013-11-05  8:49   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-05  9:43   ` Beeblebrox
2013-11-09 15:31     ` Beeblebrox
2013-11-09 15:37       ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-10 10:28       ` Beeblebrox
2013-11-10 10:41         ` Andrey Borzenkov
2013-11-10 14:47           ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-10 12:08         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-08 14:12   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-10 17:50 Beeblebrox
2013-11-10 19:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
     [not found] ` <CAPSTskuZ2nHt6iKHfgFfWeBxpRyuqPmyXHd3AYCr1muaua+H7w@mail.gmail.com>
2013-11-22 15:22   ` Beeblebrox
2013-11-22 17:01     ` Beeblebrox
2013-11-23  1:09       ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-23 12:54       ` Beeblebrox
2013-11-23 13:10         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-23 13:50         ` Beeblebrox
2013-11-23 17:58           ` Beeblebrox
2013-11-22  7:09 Beeblebrox
2013-11-22  7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-22  7:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-22 13:16   ` Colin Watson
2013-11-22 13:30     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-25 16:54       ` Colin Watson
2013-11-24  9:14 Beeblebrox
2013-11-24 15:08 ` Andrey Borzenkov
2013-11-25 11:08   ` Beeblebrox
2013-11-25 11:14     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-25 17:29     ` Andrey Borzenkov
2013-11-25 22:12     ` Vladimir '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.