Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package grub2 for openSUSE:Factory checked in at 2022-12-20 20:19:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/grub2 (Old) and /work/SRC/openSUSE:Factory/.grub2.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "grub2" Tue Dec 20 20:19:59 2022 rev:278 rq:1043936 version:2.06 Changes: -------- --- /work/SRC/openSUSE:Factory/grub2/grub2.changes 2022-12-07 17:35:09.580603085 +0100 +++ /work/SRC/openSUSE:Factory/.grub2.new.1835/grub2.changes 2022-12-20 20:20:10.337774765 +0100 @@ -1,0 +2,13 @@ +Mon Dec 19 08:39:05 UTC 2022 - Michael Chang <mch...@suse.com> + +- Setup multiple device paths for a nvmf boot device (bsc#1205666) + * 0001-grub2-Set-multiple-device-path-for-a-nvmf-boot-devic.patch + +------------------------------------------------------------------- +Fri Dec 16 01:51:45 UTC 2022 - Gary Ching-Pang Lin <g...@suse.com> + +- Increase the path buffer in the crypttab command for the long + volume name (bsc#1206333) + * grub2-increase-crypttab-path-buffer.patch + +------------------------------------------------------------------- New: ---- 0001-grub2-Set-multiple-device-path-for-a-nvmf-boot-devic.patch grub2-increase-crypttab-path-buffer.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub2.spec ++++++ --- /var/tmp/diff_new_pack.Mcva2O/_old 2022-12-20 20:20:13.465791912 +0100 +++ /var/tmp/diff_new_pack.Mcva2O/_new 2022-12-20 20:20:13.469791934 +0100 @@ -479,6 +479,8 @@ Patch950: 0001-fs-btrfs-Use-full-btrfs-bootloader-area.patch Patch951: 0002-Mark-environmet-blocks-as-used-for-image-embedding.patch Patch952: 0001-ieee1275-Increase-initially-allocated-heap-from-1-4-.patch +Patch953: grub2-increase-crypttab-path-buffer.patch +Patch954: 0001-grub2-Set-multiple-device-path-for-a-nvmf-boot-devic.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140 ++++++ 0001-grub2-Set-multiple-device-path-for-a-nvmf-boot-devic.patch ++++++ >From 3e77c5494fd06f430588ae9c304fea370439d531 Mon Sep 17 00:00:00 2001 From: Wen Xiong <Wen Xiong> Date: Thu, 15 Dec 2022 21:33:41 -0500 Subject: [PATCH] grub2: Set multiple device path for a nvmf boot device nvmf support native multipath(ANA) by default. The patch added the support for setting multiple device path for a nvmf boot device. localhost:~ grub2-install -v /dev/nvme1n1p1 ... ... ... grub2-install: info: executing nvsetenv boot-device /pci@800000020000132/fibre-channel@0,1/nvme-of/controller@5005076810193675,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec /pci@800000020000132/fibre-channel@0/nvme-of/controller@5005076810193675,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec /pci@800000020000132/fibre-channel@0/nvme-of/controller@50050768101935e5,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec /pci@800000020000132/fibre-channel@0,1/nvme-of/controller@50050768101935e5,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec. Installation finished. No error reported. localhost:~ # bootlist -m normal -o nvme7n1 nvme5n1 nvme1n1 nvme4n1 localhost:~ # bootlist -m normal -r /pci@800000020000132/fibre-channel@0,1/nvme-of/controller@5005076810193675,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec /pci@800000020000132/fibre-channel@0/nvme-of/controller@5005076810193675,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec /pci@800000020000132/fibre-channel@0/nvme-of/controller@50050768101935e5,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec /pci@800000020000132/fibre-channel@0,1/nvme-of/controller@50050768101935e5,ffff:nqn=nqn.1986-03.com.ibm:nvme:2145.0000020420006CEA/namespace@ec Signed-off-by: Wen Xiong <wenxi...@linux.ibm.com> --- grub-core/osdep/linux/ofpath.c | 6 ++--- grub-core/osdep/unix/platform.c | 48 +++++++++++++++++++++++++++++++++ include/grub/util/install.h | 3 +++ include/grub/util/ofpath.h | 9 +++++++ 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c index 7d31cfd0f..7129099db 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -209,7 +209,7 @@ find_obppath (const char *sysfs_path_orig) } } -static char * +char * xrealpath (const char *in) { char *out; @@ -224,7 +224,7 @@ xrealpath (const char *in) return out; } -static char * +char * block_device_get_sysfs_path_and_link(const char *devicenode) { char *rpath; @@ -535,7 +535,7 @@ of_path_get_nvme_nsid(const char* devname) } -static char * +char * nvme_get_syspath(const char *nvmedev) { char *sysfs_path, *controller_node; diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c index 1e2961e00..db8fa4b95 100644 --- a/grub-core/osdep/unix/platform.c +++ b/grub-core/osdep/unix/platform.c @@ -19,6 +19,7 @@ #include <config.h> #include <grub/util/install.h> +#include <grub/util/ofpath.h> #include <grub/emu/hostdisk.h> #include <grub/util/misc.h> #include <grub/misc.h> @@ -131,6 +132,51 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) return rc; } +char * +build_multi_boot_device(const char *install_device) +{ + char *sysfs_path; + char *nvme_ns; + unsigned int nsid; + char *ptr; + char *boot_device_string; + struct dirent *ep; + DIR *dp; + + nvme_ns = strchr(install_device, 'n'); + nsid = of_path_get_nvme_nsid(nvme_ns); + sysfs_path = nvme_get_syspath(nvme_ns); + strcat(sysfs_path, "/device"); + sysfs_path = xrealpath(sysfs_path); + + dp = opendir(sysfs_path); + ptr = boot_device_string = xmalloc (1000); + + /* We cannot have a boot list with more than five entries */ + while((ep = readdir(dp)) != NULL){ + char *nvme_device; + + if (grub_strstr(ep->d_name, "nvme")) { + nvme_device = xasprintf ("%s%s%x ", + get_ofpathname(ep->d_name),"/namespace@", nsid); + if ((strlen(boot_device_string) + strlen(nvme_device)) >= 200*5 - 1) { + grub_util_warn (_("More than five entries cannot be specified in the bootlist")); + free(nvme_device); + break; + } + + strncpy(ptr, nvme_device, strlen(nvme_device)); + ptr += strlen(nvme_device); + free(nvme_device); + } + } + + *--ptr = '\0'; + closedir(dp); + + return boot_device_string; +} + int grub_install_register_efi (const grub_disk_t *efidir_grub_disk, const char *efifile_path, @@ -242,6 +288,8 @@ grub_install_register_ieee1275 (int is_prep, const char *install_device, } *ptr = '\0'; } + else if (grub_strstr(install_device, "nvme")) + boot_device = build_multi_boot_device(install_device); else boot_device = get_ofpathname (install_device); diff --git a/include/grub/util/install.h b/include/grub/util/install.h index c144f3e4d..15f24efac 100644 --- a/include/grub/util/install.h +++ b/include/grub/util/install.h @@ -240,6 +240,9 @@ grub_install_register_efi (const grub_disk_t *efidir_grub_disk, const char *efi_distributor, const char *force_disk); +char * +build_multi_boot_device(const char *install_device); + void grub_install_register_ieee1275 (int is_prep, const char *install_device, int partno, const char *relpath); diff --git a/include/grub/util/ofpath.h b/include/grub/util/ofpath.h index a0ec30620..5b1f6a56d 100644 --- a/include/grub/util/ofpath.h +++ b/include/grub/util/ofpath.h @@ -32,4 +32,13 @@ void find_file(char* filename, char* directory, struct ofpath_files_list_root* r char* of_find_fc_host(char* host_wwpn); +char* nvme_get_syspath(const char *nvmedev); + +char* block_device_get_sysfs_path_and_link(const char *devicenode); + +char* xrealpath (const char *in); + +unsigned int of_path_get_nvme_nsid(const char* devname); + + #endif /* ! GRUB_OFPATH_MACHINE_UTIL_HEADER */ -- 2.35.3 ++++++ grub2-increase-crypttab-path-buffer.patch ++++++ >From bbf0d5b3bcdde357de343032ecf358764faf0339 Mon Sep 17 00:00:00 2001 From: Gary Lin <g...@suse.com> Date: Fri, 16 Dec 2022 09:19:50 +0800 Subject: [PATCH] commands/crypttab: increase the size of the path buffer Allocate a larger buffer for the cryptsetup.d path in case the system uses a long volume name. Signed-off-by: Gary Lin <g...@suse.com> --- grub-core/commands/crypttab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: grub-2.06/grub-core/commands/crypttab.c =================================================================== --- grub-2.06.orig/grub-core/commands/crypttab.c +++ grub-2.06/grub-core/commands/crypttab.c @@ -11,7 +11,7 @@ static grub_err_t grub_cmd_crypttab_entry (grub_command_t cmd __attribute__ ((unused)), int argc, char **argv) { - char buf[64]; + char buf[256]; const char *path = NULL; if (argc == 2)