Re: grub2 boot root-on-zfs errors
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 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub2 boot root-on-zfs errors
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. signature.asc Description: OpenPGP digital signature ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH] Issue separate DNS queries for ipv4 and ipv6
On 17.10.2012 02:55, Gustavo Luiz Duarte wrote: > > Adding multiple questions on a single DNS query is not supportted by > most DNS servers. This patch issues two separate DNS queries > sequentially for ipv4 and then for ipv6. > > There are 4 possible config options: > DNS_OPTION_IPV4: issue only one ipv4 query > DNS_OPTION_IPV6: issue only one ipv6 query > DNS_OPTION_PREFER_IPV4: issue the ipv4 query first and fallback to ipv6 > DNS_OPTION_PREFER_IPV6: issue the ipv6 query first and fallback to ipv4 > However, there is no code yet to set such config option. The default is > DNS_OPTION_PREFER_IPV4. > > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=860829 > --- > grub-core/net/dns.c | 99 > - > include/grub/net.h | 9 + > 2 files changed, 76 insertions(+), 32 deletions(-) > > diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c > index 3381ea7..725725c 100644 > --- a/grub-core/net/dns.c > +++ b/grub-core/net/dns.c > @@ -34,6 +34,14 @@ struct dns_cache_element > #define DNS_CACHE_SIZE 1021 > #define DNS_HASH_BASE 423 > > +typedef enum grub_dns_qtype_id > + { > +GRUB_DNS_QTYPE_A = 1, > +GRUB_DNS_QTYPE_ = 28 > + } grub_dns_qtype_id_t; > + > +static grub_dns_option_t dns_type_option = DNS_OPTION_PREFER_IPV4; > + > static struct dns_cache_element dns_cache[DNS_CACHE_SIZE]; > static struct grub_net_network_level_address *dns_servers; > static grub_size_t dns_nservers, dns_servers_alloc; > @@ -410,13 +418,13 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ > ((unused)), >return GRUB_ERR_NONE; > } > > -grub_err_t > -grub_net_dns_lookup (const char *name, > +static grub_err_t > +grub_net_dns_lookup_qtype (const char *name, >const struct grub_net_network_level_address *servers, >grub_size_t n_servers, >grub_size_t *naddresses, >struct grub_net_network_level_address **addresses, > - int cache) > + int cache, grub_dns_qtype_id_t qtype) > { >grub_size_t send_servers = 0; >grub_size_t i, j; > @@ -471,8 +479,7 @@ grub_net_dns_lookup (const char *name, > + GRUB_NET_MAX_LINK_HEADER_SIZE > + GRUB_NET_UDP_HEADER_SIZE > + sizeof (struct dns_header) > -+ grub_strlen (name) + 2 + 4 > -+ 2 + 4); > ++ grub_strlen (name) + 2 + 4); >if (!nb) > { >grub_free (data.name); > @@ -482,7 +489,7 @@ grub_net_dns_lookup (const char *name, > + GRUB_NET_MAX_LINK_HEADER_SIZE > + GRUB_NET_UDP_HEADER_SIZE); >grub_netbuff_put (nb, sizeof (struct dns_header) > - + grub_strlen (name) + 2 + 4 + 2 + 4); > + + grub_strlen (name) + 2 + 4); >head = (struct dns_header *) nb->data; >optr = (grub_uint8_t *) (head + 1); >for (iptr = name; *iptr; ) > @@ -509,18 +516,7 @@ grub_net_dns_lookup (const char *name, > >/* Type: A. */ >*optr++ = 0; > - *optr++ = 1; > - > - /* Class. */ > - *optr++ = 0; > - *optr++ = 1; > - > - /* Compressed name. */ > - *optr++ = 0xc0; > - *optr++ = 0x0c; > - /* Type: . */ > - *optr++ = 0; > - *optr++ = 28; > + *optr++ = qtype; > >/* Class. */ >*optr++ = 0; > @@ -529,7 +525,7 @@ grub_net_dns_lookup (const char *name, >head->id = data.id; >head->flags = FLAGS_RD; >head->ra_z_r_code = 0; > - head->qdcount = grub_cpu_to_be16_compile_time (2); > + head->qdcount = grub_cpu_to_be16_compile_time (1); >head->ancount = grub_cpu_to_be16_compile_time (0); >head->nscount = grub_cpu_to_be16_compile_time (0); >head->arcount = grub_cpu_to_be16_compile_time (0); > @@ -587,16 +583,47 @@ grub_net_dns_lookup (const char *name, >if (*data.naddresses) > return GRUB_ERR_NONE; >if (data.dns_err) > -return grub_error (GRUB_ERR_NET_NO_DOMAIN, > -N_("no DNS record found")); > - > +{ > + grub_dprintf ("dns", "%s. QTYPE: %u QNAME: %s\n", > +N_("no DNS record found"), qtype, name); > + return GRUB_ERR_NET_NO_DOMAIN; > +} >if (err) > { >grub_errno = err; >return err; > } > - return grub_error (GRUB_ERR_TIMEOUT, > - N_("no DNS reply received")); > + grub_dprintf ("dns", "%s. QTYPE: %u QNAME: %s\n", > +N_("no DNS reply received"), qtype, name); > + return GRUB_ERR_TIMEOUT; > +} > + > +grub_err_t > +grub_net_dns_lookup (const char *name, > + const struct grub_net_network_level_address *servers, > + grub_size_t n_servers, > + grub_size_t *naddresses, > + struct grub_net_network_level_address **addresses, > + int cache) > +{ > + if (dns_type_option == DNS_OPTION_IPV6 || dns_type_option == > DNS_OP
Re: grub efi boot hangs
On 18.04.2013 17:23, Rajasekhar Pulluru wrote: > Used below commands to install grub: > > 1) > /usr/local/grub/sbin/grub-install --target=x86_64-efi > --efi-directory=/boot/efi --boot-directory=/boot/efi/EFI > > 2) As mentioned in https://wiki.archlinux.org/index.php/GRUB2 Section: > Create GRUB2 Standalone UEFI Application: > /usr/local/grub/bin/grub-mkstandalone > --directory="/usr/local/grub/lib/grub/x86_64-efi/" > --format="x86_64-efi" > --output="/boot/efi/EFI/grub/grubx64_standalone.efi" "grub.cfg" > > It would be helpful to know why netbsd partition is not readable though > its listed in ls. > Does ls -l shows its filesystem and UUID? signature.asc Description: OpenPGP digital signature ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
How important is the MBR partition offset of grub-mkrescue ?
Hi, i stumbled over a problem in the handling of grub-mkrescue images on USB stick by Linux in /dev/disk/by-label. The first MBR partition begins at 512-LBA 1 and thus is not mountable as ISO image. I understand this is intentional. ISO filesystems have a label (Volume Id) which gets used for auto-mounting and shows up in modern Linuxes as symbolic link in directory /dev/disk/by-label. But Linux (or its udev) insists in linking to /dev/sdX1 rather than to /dev/sdX, where the ISO filesystem is mountable. So this link cannot be used for mounting the ISO. I hate automounters, but /dev/disk/by-label is also a good way for a booting system to find its own filesystem from where it stems. -- Is a workaround known on Linux side ? (E.g. is it a known bug in udev configurations which can be fixed ?) How important ist the partition start at LBA 1 in comparison to this obvious drawback of grub-mkrescue images on Linux ? (Start at LBA 0 solves the problem but makes the MBR part of the first partition. I understand this is undesirable somehow.) Actually i wanted to show a system packager how to use ./by-label instead of test-mounting all files in /proc/partitions. Are there other methods which one could use in the Linux initial RAM disk to find the USB stick from where GRUB2 did boot ? Have a nice day :) Thomas ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Fwd: [grub-devel] error when compiling getroot
I'm getting the following error when compiling from latest git repo (e7b66a28de17b085a9b71d6c500b0b139e94d818) on mipsel (loongson-2f): gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_FILE=\"grub-core/osdep/getroot.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 -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 -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 grub-core/osdep/libgrubkern_a-getroot.o -MD -MP -MF grub-core/osdep/.deps-util/libgrubkern_a-getroot.Tpo -c -o grub-core/osdep/libgrubkern_a-getroot.o `test -f 'grub-core/osdep/getroot.c' || echo './'`grub-core/osdep/getroot.c In file included from grub-core/osdep/getroot.c:2:0: grub-core/osdep/linux/getroot.c: In function ?get_btrfs_fs_prefix?: grub-core/osdep/linux/getroot.c:317:10: error: cast increases required alignment of target type [-Werror=cast-align] nid = (grub_uint64_t *) (sargs.buf + 16); ^ grub-core/osdep/linux/getroot.c:319:9: error: cast increases required alignment of target type [-Werror=cast-align] br = (struct grub_btrfs_root_backref *) (sargs.buf + 32); ^ grub-core/osdep/linux/getroot.c:345:10: error: cast increases required alignment of target type [-Werror=cast-align] nid = (grub_uint64_t *) (sargs.buf + 16); ^ grub-core/osdep/linux/getroot.c:348:9: error: cast increases required alignment of target type [-Werror=cast-align] ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 32); ^ cc1: all warnings being treated as errors make[2]: *** [grub-core/osdep/libgrubkern_a-getroot.o] Error 1 make[2]: Leaving directory `/home/general/download/grub/grub-e7b66a28de17b085a9b71d6c500b0b139e94d818' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/general/download/grub/grub-e7b66a28de17b085a9b71d6c500b0b139e94d818' make: *** [all] Error 2 Any idea? -- Javier. ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: grub mishandles corrupt/missing primary GPT
On 24.10.2013 20:17, Chris Murphy wrote: > Yes it's just being silly. But the take away is that (partitioning) tools are > behaving wrongly if they understand GPT, yet ignore or can't fix problems > with either GPT. The spec only says software, it doesn't specify what > software, so I'm assuming partitioning tools. Obviously the kernel is > software, but it's not in a position to ask the user anything. GRUB logic is that it should be able to read corrupted as far as it's not too corrupted and let kernel/partitioning tool to do the permanent fix. signature.asc Description: OpenPGP digital signature ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: How important is the MBR partition offset of grub-mkrescue ?
Hello, Thomas. Noce to hear from you. > How important ist the partition start at LBA 1 in comparison > to this obvious drawback of grub-mkrescue images on Linux ? > (Start at LBA 0 solves the problem but makes the MBR part > of the first partition. I understand this is undesirable > somehow.) LBA 0 is not an option. It will make hang, at least some versions OVMF, quite possibly other firmwares as well. Nowadays what we have between 1 (inclusive) and isofs headers is all generated by xorriso (except on sparc where we supply LBA 1) It's possible to use another small value other than >1 in order to make a set of headers at another position pointing to the same data. Another workaround is to mount HFS+ filesystem which is already in a partition (GPT one). signature.asc Description: OpenPGP digital signature ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: Fwd: [grub-devel] error when compiling getroot
Fix committed, thanks for reporting this. On 02.11.2013 22:14, Javier Vasquez wrote: > I'm getting the following error when compiling from latest git repo > (e7b66a28de17b085a9b71d6c500b0b139e94d818) on mipsel (loongson-2f): > > gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1 > -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" > -DGRUB_FILE=\"grub-core/osdep/getroot.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 -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 -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 > grub-core/osdep/libgrubkern_a-getroot.o -MD -MP -MF > grub-core/osdep/.deps-util/libgrubkern_a-getroot.Tpo -c -o > grub-core/osdep/libgrubkern_a-getroot.o `test -f > 'grub-core/osdep/getroot.c' || echo './'`grub-core/osdep/getroot.c > In file included from grub-core/osdep/getroot.c:2:0: > grub-core/osdep/linux/getroot.c: In function ?get_btrfs_fs_prefix?: > grub-core/osdep/linux/getroot.c:317:10: error: cast increases required > alignment of target type [-Werror=cast-align] > nid = (grub_uint64_t *) (sargs.buf + 16); > ^ > grub-core/osdep/linux/getroot.c:319:9: error: cast increases required > alignment of target type [-Werror=cast-align] > br = (struct grub_btrfs_root_backref *) (sargs.buf + 32); > ^ > grub-core/osdep/linux/getroot.c:345:10: error: cast increases required > alignment of target type [-Werror=cast-align] > nid = (grub_uint64_t *) (sargs.buf + 16); > ^ > grub-core/osdep/linux/getroot.c:348:9: error: cast increases required > alignment of target type [-Werror=cast-align] > ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 32); > ^ > cc1: all warnings being treated as errors > make[2]: *** [grub-core/osdep/libgrubkern_a-getroot.o] Error 1 > make[2]: Leaving directory > `/home/general/download/grub/grub-e7b66a28de17b085a9b71d6c500b0b139e94d818' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory > `/home/general/download/grub/grub-e7b66a28de17b085a9b71d6c500b0b139e94d818' > make: *** [all] Error 2 > > Any idea? > > -- > Javier. > > ___ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > signature.asc Description: OpenPGP digital signature ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
[RFT] Truecrypt rescue image support
Hello, all. Basing my code on the information about truecrypt rescue image layout from Attila Lendvai's project I wrote its support in GRUB. Now you can do truecrypt boot instead of having to go through ruby converter. Since I don't use truecrypt myself I couldn't test it. Could someone test it? It's available from http://git.savannah.gnu.org/cgit/grub.git/log/?h=truecrypt @Attila: Thanks for figuring out the protocol. Do you have any problems with that information being used in that way? signature.asc Description: OpenPGP digital signature ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v0] Support to disable reed-solomon codes
I'm not at all familiar with this part of GRUB, so take this with a big grain of salt. On Sat, 2013-11-02 at 20:05 -0700, Jonathan McCune wrote: > I think it should be possible to generate all the necessary signatures > at *build time* instead of *install time* If I understand your email correctly, you're saying that at build time, grub builds core.img. Then at install time, it calculates: "core.img.rs" = Reed-Solomon(core.img) Then it writes the "core.img.rs" data to disk. At boot time, GRUB reads the "core.img.rs" data from disk, corrects errors, to reproduce core.img, which is executed. If you want to verify at boot time, you just do it after the error correction step. But it sounds like you want to verify the bits on disk from the host environment. Rather than "backing out" the Reed-Solomon coding, why not do it the other way around? Verify core.img, then re-encode the known good copy (for which code already exists as part of the installation procedure) and then just compare that to what is actually on disk? -- Richard signature.asc Description: This is a digitally signed message part ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel