]> git.proxmox.com Git - grub2.git/commitdiff
Fix mismerge of mkconfig_loopback.patch.
authorColin Watson <cjwatson@debian.org>
Fri, 20 Dec 2013 11:45:22 +0000 (11:45 +0000)
committerColin Watson <cjwatson@debian.org>
Fri, 20 Dec 2013 11:45:22 +0000 (11:45 +0000)
debian/changelog
debian/patches/mkconfig_loopback.patch
debian/patches/mkconfig_nonexistent_loopback.patch
util/grub-mkconfig_lib.in

index 1b73f92f54f848c242fa8a17901e62e44a20f10f..c0a69faf6229752c2d004d5c61ea76f34e3f2035 100644 (file)
@@ -16,6 +16,7 @@ grub2 (2.02~beta1-1) UNRELEASED; urgency=low
   * Add OpenPGP signature checking configuration to watch file.
   * Drop mkconfig_skip_dmcrypt.patch; it breaks GRUB_ENABLE_CRYPTODISK=y,
     which is a better fix for the original problem (closes: #732245).
+  * Fix mismerge of mkconfig_loopback.patch.
 
  -- Colin Watson <cjwatson@debian.org>  Tue, 10 Dec 2013 17:39:47 +0000
 
index f9f0daa2588e60ed1758e4e3308adc2b2018df05..837976e58f4334834f4aa6fb9266cf295b730013 100644 (file)
@@ -13,20 +13,21 @@ Index: b/util/grub-mkconfig_lib.in
 ===================================================================
 --- a/util/grub-mkconfig_lib.in
 +++ b/util/grub-mkconfig_lib.in
-@@ -133,6 +133,21 @@
+@@ -133,6 +133,22 @@
      esac
    done
  
 +  loop_file=
-+  case ${device} in
++  case $1 in
 +    /dev/loop/*|/dev/loop[0-9])
-+      grub_loop_device="${device#/dev/}"
-+      loop_file=`losetup "${device}" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
++      grub_loop_device="${1#/dev/}"
++      loop_file=`losetup "$1" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
 +      case $loop_file in
 +        /dev/*) ;;
 +        *)
-+          loop_device="${device}"
-+          device=`"${grub_probe}" --target=device "${loop_file}"`
++          loop_device="$1"
++          shift
++          set -- `"${grub_probe}" --target=device "${loop_file}"` "$@"
 +        ;;
 +      esac
 +    ;;
@@ -35,10 +36,10 @@ Index: b/util/grub-mkconfig_lib.in
    # Abstraction modules aren't auto-loaded.
    abstraction="`"${grub_probe}" --device $@ --target=abstraction`"
    for module in ${abstraction} ; do
-@@ -234,6 +249,14 @@
-   else
-     return 1
+@@ -165,6 +181,14 @@
+     echo "fi"
    fi
+   IFS="$old_ifs"
 +
 +  if [ "x${loop_file}" != x ]; then
 +    loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
@@ -49,7 +50,7 @@ Index: b/util/grub-mkconfig_lib.in
 +  fi
  }
  
version_test_gt ()
grub_get_device_id ()
 Index: b/util/grub.d/10_linux.in
 ===================================================================
 --- a/util/grub.d/10_linux.in
index e172fd40c3c9aec1fcc13380052255b13e1030b1..25a3a331315a35f075c524425a9968947542b54b 100644 (file)
@@ -8,12 +8,12 @@ Index: b/util/grub-mkconfig_lib.in
 ===================================================================
 --- a/util/grub-mkconfig_lib.in
 +++ b/util/grub-mkconfig_lib.in
-@@ -142,7 +142,7 @@
-         /dev/*) ;;
+@@ -143,7 +143,7 @@
          *)
-           loop_device="${device}"
--          device=`"${grub_probe}" --target=device "${loop_file}"`
-+          device=`"${grub_probe}" --target=device "${loop_file}"` || return 0
+           loop_device="$1"
+           shift
+-          set -- `"${grub_probe}" --target=device "${loop_file}"` "$@"
++          set -- `"${grub_probe}" --target=device "${loop_file}"` "$@" || return 0
          ;;
        esac
      ;;
index d0415a2410d4d0bbfd38461311db2ed1be4bd37f..5992506a9e5762d2ed7feb59eca5a8797d9f085e 100644 (file)
@@ -134,15 +134,16 @@ prepare_grub_to_access_device ()
   done
 
   loop_file=
-  case ${device} in
+  case $1 in
     /dev/loop/*|/dev/loop[0-9])
-      grub_loop_device="${device#/dev/}"
-      loop_file=`losetup "${device}" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
+      grub_loop_device="${1#/dev/}"
+      loop_file=`losetup "$1" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
       case $loop_file in
         /dev/*) ;;
         *)
-          loop_device="${device}"
-          device=`"${grub_probe}" --target=device "${loop_file}"` || return 0
+          loop_device="$1"
+          shift
+          set -- `"${grub_probe}" --target=device "${loop_file}"` "$@" || return 0
         ;;
       esac
     ;;
@@ -180,6 +181,14 @@ prepare_grub_to_access_device ()
     echo "fi"
   fi
   IFS="$old_ifs"
+
+  if [ "x${loop_file}" != x ]; then
+    loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
+    if [ "x${loop_mountpoint}" != x ]; then
+      echo "loopback ${grub_loop_device} ${loop_file#$loop_mountpoint}"
+      echo "set root=(${grub_loop_device})"
+    fi
+  fi
 }
 
 grub_get_device_id ()
@@ -249,14 +258,6 @@ version_test_numeric ()
   else
     return 1
   fi
-
-  if [ "x${loop_file}" != x ]; then
-    loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
-    if [ "x${loop_mountpoint}" != x ]; then
-      echo "loopback ${grub_loop_device} ${loop_file#$loop_mountpoint}"
-      echo "set root=(${grub_loop_device})"
-    fi
-  fi
 }
 
 version_test_gt ()