All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Disable unsupported grub_util_get_fd_sectors in geli on MINGW32
@ 2011-09-21 21:29 Mario Limonciello
  2011-09-21 22:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2011-09-29  8:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello @ 2011-09-21 21:29 UTC (permalink / raw)
  To: grub-devel@gnu.org

=== modified file 'ChangeLog'
--- ChangeLog   2011-09-21 21:00:59 +0000
+++ ChangeLog   2011-09-21 21:18:21 +0000
@@ -6,6 +6,8 @@
         Windows CreateFile calls.
         * Undefine GRUB_UTIL in grub-core/lib/crypto.c for MINGW32 as
         termios is not supported.
+       * Disable unsupported grub_util_get_fd_sectors in geli on
+       MINGW32.

  2011-09-17  Grégoire Sutre <gregoire.sutre@gmail.com>


=== modified file 'grub-core/disk/geli.c'
--- grub-core/disk/geli.c       2011-04-25 12:52:07 +0000
+++ grub-core/disk/geli.c       2011-09-21 21:18:21 +0000
@@ -189,8 +189,10 @@
    if (fd < 0)
      return NULL;

+#if !defined(__MINGW32__)
    s = grub_util_get_fd_sectors (fd, &log_secsize);
    grub_util_fd_seek (fd, dev, (s << log_secsize) - 512);
+#endif

    uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1);
    if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0)




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

* Re: [PATCH 2/2] Disable unsupported grub_util_get_fd_sectors in geli on MINGW32
  2011-09-21 21:29 [PATCH 2/2] Disable unsupported grub_util_get_fd_sectors in geli on MINGW32 Mario Limonciello
@ 2011-09-21 22:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2011-09-29  8:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-09-21 22:08 UTC (permalink / raw)
  To: grub-devel

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

On 21.09.2011 23:29, Mario Limonciello wrote:
> +#if !defined(__MINGW32__)
>    s = grub_util_get_fd_sectors (fd, &log_secsize);
>    grub_util_fd_seek (fd, dev, (s << log_secsize) - 512);
> +#endif
This would make GRUB behave erratically if this code is ever reached
which is always a bad thing. While doing something like
#if defined (GRUB_UTIL) && ! defined (__MINGW32__)
on whole function is a cheap and functionality-reducing way to port,
correct way is to add a windows equivalent of this call (getting
disk/file size)

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



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

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

* Re: [PATCH 2/2] Disable unsupported grub_util_get_fd_sectors in geli on MINGW32
  2011-09-21 21:29 [PATCH 2/2] Disable unsupported grub_util_get_fd_sectors in geli on MINGW32 Mario Limonciello
  2011-09-21 22:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2011-09-29  8:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2011-09-29  8:42 UTC (permalink / raw)
  To: grub-devel

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

Rejected. Better a compilation error than an eratic behaviour on runtime.
On 21.09.2011 23:29, Mario Limonciello wrote:
> === modified file 'ChangeLog'
> --- ChangeLog   2011-09-21 21:00:59 +0000
> +++ ChangeLog   2011-09-21 21:18:21 +0000
> @@ -6,6 +6,8 @@
>         Windows CreateFile calls.
>         * Undefine GRUB_UTIL in grub-core/lib/crypto.c for MINGW32 as
>         termios is not supported.
> +       * Disable unsupported grub_util_get_fd_sectors in geli on
> +       MINGW32.
>
>  2011-09-17  Grégoire Sutre <gregoire.sutre@gmail.com>
>
>
> === modified file 'grub-core/disk/geli.c'
> --- grub-core/disk/geli.c       2011-04-25 12:52:07 +0000
> +++ grub-core/disk/geli.c       2011-09-21 21:18:21 +0000
> @@ -189,8 +189,10 @@
>    if (fd < 0)
>      return NULL;
>
> +#if !defined(__MINGW32__)
>    s = grub_util_get_fd_sectors (fd, &log_secsize);
>    grub_util_fd_seek (fd, dev, (s << log_secsize) - 512);
> +#endif
>
>    uuid = xmalloc (GRUB_MD_SHA256->mdlen * 2 + 1);
>    if (grub_util_fd_read (fd, (void *) &hdr, 512) < 0)
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>


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



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

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

end of thread, other threads:[~2011-09-29  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21 21:29 [PATCH 2/2] Disable unsupported grub_util_get_fd_sectors in geli on MINGW32 Mario Limonciello
2011-09-21 22:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-09-29  8:42 ` Vladimir 'φ-coder/phcoder' Serbinenko

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