Bug#854568: marked as done (grub2: Add support for modern sparc64 hardware)

2018-03-02 Thread Debian Bug Tracking System
Your message dated Fri, 02 Mar 2018 13:19:31 +
with message-id 
and subject line Bug#854568: fixed in grub2 2.02+dfsg1-3
has caused the Debian Bug report #854568,
regarding grub2: Add support for modern sparc64 hardware
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
854568: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854568
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: grub2
Version: 2.02~beta3-4
Severity: normal
Tags: patch
User: debian-sp...@lists.debian.org
Usertags: sparc64

Hi!

The attached patch adds support for modern sparc64 hardware to grub2.

This patch was generated out of a patch set [1] by Eric Snowberg (CC'ed)
from Oracle and is pending to be merged upstream. We have already tested
the patch set on Debian sparc64 and it seems to work fine so far.

According to Eric, it's also advised to tune the default grub2 configu-
ration for sparc64 to disable video mode and use a text console by
default. The current recommended settings for grub2 on sparc64
are:

GRUB_TERMINAL_OUTPUT="console"
GRUB_DISABLE_RECOVERY="true"
GRUB_PRELOAD_MODULES=“iso9660"

We have also verified that with the patch added, the grub2 package
still builds fine on non-sparc64 targets. This wasn't true for the
first revision of the patch.

I'm fully aware that this patch comes way too late due to the freeze,
but it might be an idea to add the patch to the experimental version
of the grub2 package to give it some testing on all targets.

Thanks,
Adrian

> [1] https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v2

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Add support for sparc64
Author: Eric Snowberg 
Last-Update: 2017-02-08
Source: https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v2

Index: grub2-2.02~beta3/grub-core/commands/ls.c
===
--- grub2-2.02~beta3.orig/grub-core/commands/ls.c
+++ grub2-2.02~beta3/grub-core/commands/ls.c
@@ -201,6 +201,8 @@ grub_ls_list_files (char *dirname, int l
   if (grub_errno == GRUB_ERR_UNKNOWN_FS)
grub_errno = GRUB_ERR_NONE;
 
+  grub_device_close (dev);
+  dev = NULL;
   grub_normal_print_device_info (device_name);
 }
   else if (fs)
Index: grub2-2.02~beta3/grub-core/disk/ieee1275/ofdisk.c
===
--- grub2-2.02~beta3.orig/grub-core/disk/ieee1275/ofdisk.c
+++ grub2-2.02~beta3/grub-core/disk/ieee1275/ofdisk.c
@@ -22,8 +22,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 static char *last_devpath;
 static grub_ieee1275_ihandle_t last_ihandle;
@@ -35,7 +37,9 @@ struct ofdisk_hash_ent
   char *grub_devpath;
   int is_boot;
   int is_removable;
-  int block_size_fails;
+  int block_size_retries;
+  grub_uint32_t block_size;
+  grub_ieee1275_ihandle_t ihandle;
   /* Pointer to shortest available name on nodes representing canonical names,
  otherwise NULL.  */
   const char *shortest;
@@ -43,13 +47,53 @@ struct ofdisk_hash_ent
   struct ofdisk_hash_ent *next;
 };
 
+struct ofdisk_hba_ent
+{
+  struct ofdisk_hba_ent *next;
+  struct ofdisk_hba_ent **prev;
+  grub_ieee1275_ihandle_t ihandle;
+  char *path;
+};
+
 static grub_err_t
-grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size,
-   struct ofdisk_hash_ent *op);
+grub_ofdisk_get_block_size (grub_uint32_t *block_size,
+struct ofdisk_hash_ent *op);
+
+static grub_err_t
+grub_ofdisk_open_real (grub_disk_t disk);
 
 #define OFDISK_HASH_SZ 8
 static struct ofdisk_hash_ent *ofdisk_hash[OFDISK_HASH_SZ];
 
+#ifdef __sparc__
+static grub_err_t
+sparc_disk_present (const char *path);
+
+static char *
+get_hbaname_from_path (const char *path);
+
+static char *
+get_diskname_from_path (const char *path);
+
+static struct ofdisk_hba_ent *
+ofdisk_hba_find (const char *devpath);
+
+static grub_ieee1275_ihandle_t
+ofdisk_hba_open (const char *hba_name);
+
+static struct ofdisk_hba_ent *ofdisk_hba_ents = NULL;
+
+static struct grub_scsi_test_unit_ready ofdisk_tur =
+{
+  .opcode = grub_scsi_cmd_test_unit_ready,
+  .lun = 0,
+  .reserved1 = 0,
+  .reserved2 = 0,
+  .reserved3 = 0,
+  .control = 0,
+};
+#endif
+
 static int
 ofdisk_hash_fn (const char *devpath)
 {
@@ -74,7 +118,7 @@ ofdisk_hash_find (const char *devpath)
 }
 
 static struct ofdisk_hash_ent *
-ofdisk_hash_

Bug#854568: marked as done (grub2: Add support for modern sparc64 hardware)

2018-02-28 Thread Debian Bug Tracking System
Your message dated Wed, 28 Feb 2018 12:19:45 +
with message-id 
and subject line Bug#854568: fixed in grub2 2.02+dfsg1-2
has caused the Debian Bug report #854568,
regarding grub2: Add support for modern sparc64 hardware
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
854568: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854568
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: grub2
Version: 2.02~beta3-4
Severity: normal
Tags: patch
User: debian-sp...@lists.debian.org
Usertags: sparc64

Hi!

The attached patch adds support for modern sparc64 hardware to grub2.

This patch was generated out of a patch set [1] by Eric Snowberg (CC'ed)
from Oracle and is pending to be merged upstream. We have already tested
the patch set on Debian sparc64 and it seems to work fine so far.

According to Eric, it's also advised to tune the default grub2 configu-
ration for sparc64 to disable video mode and use a text console by
default. The current recommended settings for grub2 on sparc64
are:

GRUB_TERMINAL_OUTPUT="console"
GRUB_DISABLE_RECOVERY="true"
GRUB_PRELOAD_MODULES=“iso9660"

We have also verified that with the patch added, the grub2 package
still builds fine on non-sparc64 targets. This wasn't true for the
first revision of the patch.

I'm fully aware that this patch comes way too late due to the freeze,
but it might be an idea to add the patch to the experimental version
of the grub2 package to give it some testing on all targets.

Thanks,
Adrian

> [1] https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v2

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Add support for sparc64
Author: Eric Snowberg 
Last-Update: 2017-02-08
Source: https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v2

Index: grub2-2.02~beta3/grub-core/commands/ls.c
===
--- grub2-2.02~beta3.orig/grub-core/commands/ls.c
+++ grub2-2.02~beta3/grub-core/commands/ls.c
@@ -201,6 +201,8 @@ grub_ls_list_files (char *dirname, int l
   if (grub_errno == GRUB_ERR_UNKNOWN_FS)
grub_errno = GRUB_ERR_NONE;
 
+  grub_device_close (dev);
+  dev = NULL;
   grub_normal_print_device_info (device_name);
 }
   else if (fs)
Index: grub2-2.02~beta3/grub-core/disk/ieee1275/ofdisk.c
===
--- grub2-2.02~beta3.orig/grub-core/disk/ieee1275/ofdisk.c
+++ grub2-2.02~beta3/grub-core/disk/ieee1275/ofdisk.c
@@ -22,8 +22,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 static char *last_devpath;
 static grub_ieee1275_ihandle_t last_ihandle;
@@ -35,7 +37,9 @@ struct ofdisk_hash_ent
   char *grub_devpath;
   int is_boot;
   int is_removable;
-  int block_size_fails;
+  int block_size_retries;
+  grub_uint32_t block_size;
+  grub_ieee1275_ihandle_t ihandle;
   /* Pointer to shortest available name on nodes representing canonical names,
  otherwise NULL.  */
   const char *shortest;
@@ -43,13 +47,53 @@ struct ofdisk_hash_ent
   struct ofdisk_hash_ent *next;
 };
 
+struct ofdisk_hba_ent
+{
+  struct ofdisk_hba_ent *next;
+  struct ofdisk_hba_ent **prev;
+  grub_ieee1275_ihandle_t ihandle;
+  char *path;
+};
+
 static grub_err_t
-grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size,
-   struct ofdisk_hash_ent *op);
+grub_ofdisk_get_block_size (grub_uint32_t *block_size,
+struct ofdisk_hash_ent *op);
+
+static grub_err_t
+grub_ofdisk_open_real (grub_disk_t disk);
 
 #define OFDISK_HASH_SZ 8
 static struct ofdisk_hash_ent *ofdisk_hash[OFDISK_HASH_SZ];
 
+#ifdef __sparc__
+static grub_err_t
+sparc_disk_present (const char *path);
+
+static char *
+get_hbaname_from_path (const char *path);
+
+static char *
+get_diskname_from_path (const char *path);
+
+static struct ofdisk_hba_ent *
+ofdisk_hba_find (const char *devpath);
+
+static grub_ieee1275_ihandle_t
+ofdisk_hba_open (const char *hba_name);
+
+static struct ofdisk_hba_ent *ofdisk_hba_ents = NULL;
+
+static struct grub_scsi_test_unit_ready ofdisk_tur =
+{
+  .opcode = grub_scsi_cmd_test_unit_ready,
+  .lun = 0,
+  .reserved1 = 0,
+  .reserved2 = 0,
+  .reserved3 = 0,
+  .control = 0,
+};
+#endif
+
 static int
 ofdisk_hash_fn (const char *devpath)
 {
@@ -74,7 +118,7 @@ ofdisk_hash_find (const char *devpath)
 }
 
 static struct ofdisk_hash_ent *
-ofdisk_hash_