Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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
Expand Down
2 changes: 1 addition & 1 deletion grub-core/osdep/unix/getroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
21 changes: 21 additions & 0 deletions util/grub-mkconfig_lib.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions util/grub.d/10_linux_zfs.in
Original file line number Diff line number Diff line change
Expand Up @@ -998,14 +998,15 @@ echo
fi
fi

root_dataset=$(findmnt -n / -o SOURCE)
case "${section}" in
main)
title="${name}"
main_dataset_name="${name}"
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" "${root_dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
at_least_one_entry=1
;;
advanced)
Expand All @@ -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" "${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" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
zfs_linux_entry 1 "${title}" "recovery" "${root_dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
fi
at_least_one_entry=1
;;
Expand Down