diff -rupN grub2-2.02~beta2/debian/build-efi-images grub2-2.02~beta2-partxloop/debian/build-efi-images --- grub2-2.02~beta2/debian/build-efi-images 2018-01-24 16:21:35.000000000 -0500 +++ grub2-2.02~beta2-partxloop/debian/build-efi-images 2019-09-16 10:59:39.356901056 -0400 @@ -30,6 +30,9 @@ outdir="$3" platform="$4" efi_name="$5" +# mkfs.msdos may not be on the default PATH. +export PATH="$PATH:/sbin:/usr/sbin" + workdir= cleanup () { diff -rupN grub2-2.02~beta2/debian/changelog grub2-2.02~beta2-partxloop/debian/changelog --- grub2-2.02~beta2/debian/changelog 2019-08-08 19:36:44.610112109 -0400 +++ grub2-2.02~beta2-partxloop/debian/changelog 2019-09-16 11:05:37.231291334 -0400 @@ -1,3 +1,13 @@ +grub2 (2.02~beta2-36ubuntu3.23) xenial; urgency=medium + + * debian/patches/Support-partitioned-partx-loop-devices.patch: + Cherry-pick upstream patch to install to partitioned loop devices (LP: #1824245) + * debian/control: Add missing 'dosfstools' Build-Depends to make efi images + * debian/build-efi-images: Ensure that build-efi-images has a suitable PATH + for running mkfs.msdos (backported from Debian to close #852001) + + -- Neal Gompa Mon, 16 Sep 2019 11:05:08 -0400 + grub2 (2.02~beta2-36ubuntu3.22) xenial; urgency=medium * debian/patches/skip_text_gfxpayload_where_not_supported.patch: Skip the diff -rupN grub2-2.02~beta2/debian/control grub2-2.02~beta2-partxloop/debian/control --- grub2-2.02~beta2/debian/control 2018-01-24 16:21:35.000000000 -0500 +++ grub2-2.02~beta2-partxloop/debian/control 2019-04-25 10:17:14.067543172 -0400 @@ -8,6 +8,7 @@ Build-Depends: debhelper (>= 7.4.2~), patchutils, dh-autoreconf, automake, + dosfstools, python, flex, bison, diff -rupN grub2-2.02~beta2/debian/patches/series grub2-2.02~beta2-partxloop/debian/patches/series --- grub2-2.02~beta2/debian/patches/series 2019-08-08 19:39:18.440004523 -0400 +++ grub2-2.02~beta2-partxloop/debian/patches/series 2019-08-08 19:39:57.322724308 -0400 @@ -135,3 +135,4 @@ linuxefi_fix_relocate_coff.patch linuxefi_truncate_overlong_relocs.patch squash4-fix-fragments-and-sparse-files.patch skip_text_gfxpayload_where_not_supported.patch +Support-partitioned-partx-loop-devices.patch diff -rupN grub2-2.02~beta2/debian/patches/Support-partitioned-partx-loop-devices.patch grub2-2.02~beta2-partxloop/debian/patches/Support-partitioned-partx-loop-devices.patch --- grub2-2.02~beta2/debian/patches/Support-partitioned-partx-loop-devices.patch 1969-12-31 19:00:00.000000000 -0500 +++ grub2-2.02~beta2-partxloop/debian/patches/Support-partitioned-partx-loop-devices.patch 2019-04-10 17:27:47.765266675 -0400 @@ -0,0 +1,45 @@ +From 21026cb20c81fba1d639c00779413aa71bf24e75 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 10 Apr 2019 17:25:31 -0400 +Subject: [PATCH] Backport support for partitioned partx loop devices in + grub-install + +Cherry-picked from 35f2d96c0d68772c831952b2ee4eba6519d6ea1b + +From: Mike Gilbert +Date: Sun, 26 Jan 2014 02:56:04 +0100 +Subject: grub-install: support for partitioned partx loop devices. + +* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect +/dev/loopX as being the parent of /dev/loopXpY. +--- + grub-core/osdep/linux/getroot.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c +index f97f3a6..ad47d45 100644 +--- a/grub-core/osdep/linux/getroot.c ++++ b/grub-core/osdep/linux/getroot.c +@@ -910,6 +910,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, + + return path; + } ++ ++ /* If this is a loop device */ ++ if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9') ++ { ++ char *pp = p + 4; ++ while (*pp >= '0' && *pp <= '9') ++ pp++; ++ if (*pp == 'p') ++ *is_part = 1; ++ /* /dev/loop[0-9]+p[0-9]* */ ++ *pp = '\0'; ++ return path; ++ } + } + + return path; +-- +2.20.1 +