From 0524a10f66991814ec6178a32420ca01a8a56c02 Mon Sep 17 00:00:00 2001 From: Palash Gandhi <87093175+palash-gandhi@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:31:43 -0800 Subject: [PATCH 1/5] DLPX-93019 24.04: grub config contains the wrong root pool reference (#36) PR URL: https://www.github.com/delphix/grub2/pull/36 --- util/grub.d/10_linux_zfs.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux_zfs.in b/util/grub.d/10_linux_zfs.in index b805909e2..3147c16d7 100755 --- a/util/grub.d/10_linux_zfs.in +++ b/util/grub.d/10_linux_zfs.in @@ -998,6 +998,7 @@ echo fi fi + root=$(findmnt / | grep '^/' | awk '{print $2}' | sed 's@^[^/]*/@@') case "${section}" in main) title="${name}" @@ -1005,7 +1006,7 @@ echo main_dataset="${dataset}" kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g") - zfs_linux_entry 0 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" + zfs_linux_entry 0 "${title}" "simple" "rpool/${root}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" at_least_one_entry=1 ;; advanced) @@ -1021,12 +1022,12 @@ echo kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g") title="$(gettext_printf "%s%s, with Linux %s" "${last_booted_kernel_marker}" "${name}" "${kernel_version}")" - zfs_linux_entry 1 "${title}" "advanced" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" + zfs_linux_entry 1 "${title}" "advanced" "rpool/${root}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" GRUB_DISABLE_RECOVERY=${GRUB_DISABLE_RECOVERY:-} if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then title="$(gettext_printf "%s%s, with Linux %s (%s)" "${last_booted_kernel_marker}" "${name}" "${kernel_version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" - zfs_linux_entry 1 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" + zfs_linux_entry 1 "${title}" "recovery" "rpool/${root}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" fi at_least_one_entry=1 ;; From 59a5dc5ef4ae9e63ae27390f4159feffdd407c23 Mon Sep 17 00:00:00 2001 From: Palash Gandhi <87093175+palash-gandhi@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:16:49 -0800 Subject: [PATCH 2/5] DLPX-93247 grub2 build fails on 24.04 DE-based buildserver due to package conflit (#40) PR URL: https://www.github.com/delphix/grub2/pull/40 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index efd46e3b9..6dc1fe77b 100644 --- a/debian/control +++ b/debian/control @@ -37,7 +37,7 @@ Build-Depends: debhelper-compat (= 13), bash-completion, libefiboot-dev [i386 amd64 ia64 x32 armel armhf arm64 riscv64], libefivar-dev [i386 amd64 ia64 x32 armel armhf arm64 riscv64], -Build-Conflicts: autoconf2.13, libzfs-dev, libnvpair-dev +Build-Conflicts: autoconf2.13, libzfs-dev Standards-Version: 3.9.6 Homepage: https://www.gnu.org/software/grub/ Vcs-Git: https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu From 71c880130b6ed956cfe13ea35f6c3fcb81d186fe Mon Sep 17 00:00:00 2001 From: Prakash Surya Date: Thu, 24 Mar 2022 11:05:07 -0700 Subject: [PATCH 3/5] DLPX-80252 [Backport of DLPX-80189 to 6.0.14.0] grub-probe failed during upgrade of kdump-tools package (#27) --- grub-core/osdep/unix/getroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index 92dac13f8..cbac88504 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -292,7 +292,7 @@ grub_util_find_root_devices_from_poolname (char *poolname) && !sscanf (name, "raidz1%u", &dummy) && !sscanf (name, "raidz2%u", &dummy) && !sscanf (name, "raidz3%u", &dummy) - && !strcmp (state, "ONLINE")) + && (!strcmp (state, "ONLINE") || !strcmp (state, "DEGRADED"))) { if (ndevices >= devices_allocated) { From a89970cdb58215f38cc16045f8744150e6d24e89 Mon Sep 17 00:00:00 2001 From: Pavel Zakharov Date: Mon, 11 Jan 2021 11:49:54 -0500 Subject: [PATCH 4/5] DLPX-73603 Grub should always default to the kernel version that comes with the active Delphix version (#10) --- util/grub-mkconfig_lib.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index cabac83e2..2b9737509 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -300,8 +300,29 @@ version_test_gt () version_find_latest () { grub_warn "version_find_latest() is deprecated. Use version_sort() instead." + + # + # Delphix: we define the latest kernel version as the one listed in the + # package-list file of the delphix-entire package. + # + appliance_platform=$(get-appliance-platform) + if [ "x$appliance_platform" = "x" ]; then + echo "Error: file /var/lib/delphix-appliance/platform empty or missing" >&2 + return 1 + fi + delphix_pkgs_list="/usr/share/doc/delphix-entire-${appliance_platform}/packages.list.gz" + delphix_latest=$(zcat "$delphix_pkgs_list" | grep '^delphix-kernel-' | cut -d= -f1 | sed 's/delphix-kernel-//') + if [ "x$delphix_latest" = "x" ]; then + echo "Error: Failed to retrieve latest delphix-kernel version from '$delphix_pkgs_list'" >&2 + return 1 + fi + version_find_latest_a="" for i in "$@" ; do + if echo "$i" | grep -q "$delphix_latest\$" ; then + echo "$i" + return + fi if version_test_gt "$i" "$version_find_latest_a" ; then version_find_latest_a="$i" fi From b19cac4f4ff93bd62c14d15104085c53d8bb880c Mon Sep 17 00:00:00 2001 From: Prakash Surya Date: Tue, 1 Apr 2025 10:26:08 -0700 Subject: [PATCH 5/5] DLPX-93019 24.04: grub config contains the wrong root pool reference PR URL: https://www.github.com/delphix/grub2/pull/41 --- util/grub.d/10_linux_zfs.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux_zfs.in b/util/grub.d/10_linux_zfs.in index 3147c16d7..487c7e857 100755 --- a/util/grub.d/10_linux_zfs.in +++ b/util/grub.d/10_linux_zfs.in @@ -998,7 +998,7 @@ echo fi fi - root=$(findmnt / | grep '^/' | awk '{print $2}' | sed 's@^[^/]*/@@') + root_dataset=$(findmnt -n / -o SOURCE) case "${section}" in main) title="${name}" @@ -1006,7 +1006,7 @@ echo main_dataset="${dataset}" kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g") - zfs_linux_entry 0 "${title}" "simple" "rpool/${root}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" + zfs_linux_entry 0 "${title}" "simple" "${root_dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" at_least_one_entry=1 ;; advanced) @@ -1022,12 +1022,12 @@ echo kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g") title="$(gettext_printf "%s%s, with Linux %s" "${last_booted_kernel_marker}" "${name}" "${kernel_version}")" - zfs_linux_entry 1 "${title}" "advanced" "rpool/${root}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" + zfs_linux_entry 1 "${title}" "advanced" "${root_dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" GRUB_DISABLE_RECOVERY=${GRUB_DISABLE_RECOVERY:-} if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then title="$(gettext_printf "%s%s, with Linux %s (%s)" "${last_booted_kernel_marker}" "${name}" "${kernel_version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" - zfs_linux_entry 1 "${title}" "recovery" "rpool/${root}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" + zfs_linux_entry 1 "${title}" "recovery" "${root_dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" fi at_least_one_entry=1 ;;