mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-27 06:30:35 +00:00
mkconfig_loopback.patch: Use different GRUB loop devices for different
OS loop devices (thanks, bcbc; LP: #888281).
This commit is contained in:
parent
dcf0754eaf
commit
c25fcec2d1
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -2,6 +2,8 @@ grub2 (1.99-18) UNRELEASED; urgency=low
|
|||||||
|
|
||||||
* Ensure that /sbin and /usr/sbin are in $PATH when running tests (closes:
|
* Ensure that /sbin and /usr/sbin are in $PATH when running tests (closes:
|
||||||
#662916).
|
#662916).
|
||||||
|
* mkconfig_loopback.patch: Use different GRUB loop devices for different
|
||||||
|
OS loop devices (thanks, bcbc; LP: #888281).
|
||||||
|
|
||||||
-- Colin Watson <cjwatson@debian.org> Wed, 07 Mar 2012 10:06:22 +0000
|
-- Colin Watson <cjwatson@debian.org> Wed, 07 Mar 2012 10:06:22 +0000
|
||||||
|
|
||||||
|
9
debian/patches/mkconfig_loopback.patch
vendored
9
debian/patches/mkconfig_loopback.patch
vendored
@ -13,13 +13,14 @@ Index: b/util/grub-mkconfig_lib.in
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- a/util/grub-mkconfig_lib.in
|
--- a/util/grub-mkconfig_lib.in
|
||||||
+++ b/util/grub-mkconfig_lib.in
|
+++ b/util/grub-mkconfig_lib.in
|
||||||
@@ -105,6 +105,20 @@
|
@@ -105,6 +105,21 @@
|
||||||
{
|
{
|
||||||
device="$1"
|
device="$1"
|
||||||
|
|
||||||
+ loop_file=
|
+ loop_file=
|
||||||
+ case ${device} in
|
+ case ${device} in
|
||||||
+ /dev/loop/*|/dev/loop[0-9])
|
+ /dev/loop/*|/dev/loop[0-9])
|
||||||
|
+ grub_loop_device="${device#/dev/}"
|
||||||
+ loop_file=`losetup "${device}" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
|
+ loop_file=`losetup "${device}" | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
|
||||||
+ case $loop_file in
|
+ case $loop_file in
|
||||||
+ /dev/*) ;;
|
+ /dev/*) ;;
|
||||||
@ -34,7 +35,7 @@ Index: b/util/grub-mkconfig_lib.in
|
|||||||
if dmsetup status $device 2>/dev/null | grep -q 'crypt[[:space:]]$'; then
|
if dmsetup status $device 2>/dev/null | grep -q 'crypt[[:space:]]$'; then
|
||||||
grub_warn \
|
grub_warn \
|
||||||
"$device is a crypto device, which GRUB cannot read directly. Some" \
|
"$device is a crypto device, which GRUB cannot read directly. Some" \
|
||||||
@@ -141,6 +155,14 @@
|
@@ -141,6 +156,14 @@
|
||||||
if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
|
if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
|
||||||
echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
|
echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
|
||||||
fi
|
fi
|
||||||
@ -42,8 +43,8 @@ Index: b/util/grub-mkconfig_lib.in
|
|||||||
+ if [ "x${loop_file}" != x ]; then
|
+ if [ "x${loop_file}" != x ]; then
|
||||||
+ loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
|
+ loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
|
||||||
+ if [ "x${loop_mountpoint}" != x ]; then
|
+ if [ "x${loop_mountpoint}" != x ]; then
|
||||||
+ echo "loopback loop0 ${loop_file#$loop_mountpoint}"
|
+ echo "loopback ${grub_loop_device} ${loop_file#$loop_mountpoint}"
|
||||||
+ echo "set root=(loop0)"
|
+ echo "set root=(${grub_loop_device})"
|
||||||
+ fi
|
+ fi
|
||||||
+ fi
|
+ fi
|
||||||
}
|
}
|
||||||
|
2
debian/patches/mkconfig_skip_readme.patch
vendored
2
debian/patches/mkconfig_skip_readme.patch
vendored
@ -9,7 +9,7 @@ Index: b/util/grub-mkconfig_lib.in
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- a/util/grub-mkconfig_lib.in
|
--- a/util/grub-mkconfig_lib.in
|
||||||
+++ b/util/grub-mkconfig_lib.in
|
+++ b/util/grub-mkconfig_lib.in
|
||||||
@@ -170,7 +170,7 @@
|
@@ -171,7 +171,7 @@
|
||||||
if test -f "$1" ; then
|
if test -f "$1" ; then
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*.dpkg-*) return 1 ;; # debian dpkg
|
*.dpkg-*) return 1 ;; # debian dpkg
|
||||||
|
Loading…
Reference in New Issue
Block a user