diff options
author | wiktor w brodlo <wiktor@brodlo.net> | 2011-07-07 22:41:09 +0000 |
---|---|---|
committer | wiktor w brodlo <wiktor@brodlo.net> | 2011-07-07 22:41:09 +0000 |
commit | f1a49dbf6383678d9672f3c122e1e5415e6c3be0 (patch) | |
tree | 28a536506d725870437bc5ec3c0899dd14bac90a /sys-boot/grub/files/ubuntu-upstream-1.98/957_handle_loopback.diff | |
parent | the libuser patch (diff) | |
download | anaconda-overlay-f1a49dbf6383678d9672f3c122e1e5415e6c3be0.tar.gz anaconda-overlay-f1a49dbf6383678d9672f3c122e1e5415e6c3be0.tar.bz2 anaconda-overlay-f1a49dbf6383678d9672f3c122e1e5415e6c3be0.zip |
GRUB2 from Sabayon
Diffstat (limited to 'sys-boot/grub/files/ubuntu-upstream-1.98/957_handle_loopback.diff')
-rw-r--r-- | sys-boot/grub/files/ubuntu-upstream-1.98/957_handle_loopback.diff | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sys-boot/grub/files/ubuntu-upstream-1.98/957_handle_loopback.diff b/sys-boot/grub/files/ubuntu-upstream-1.98/957_handle_loopback.diff new file mode 100644 index 0000000..0ee868f --- /dev/null +++ b/sys-boot/grub/files/ubuntu-upstream-1.98/957_handle_loopback.diff @@ -0,0 +1,45 @@ +Ubuntu: needed for Wubi +Description: Change prepare_grub_to_access_device to handle filesystems + loop-mounted on file images. +UbuntuSpecific: Not inherently. losetup and /proc/mounts are Linux-specific, + though, so we might need to refine this before sending it upstream. + +diff -Nur -x '*.orig' -x '*~' grub2-1.97~beta3/util/grub-mkconfig_lib.in grub2-1.97~beta3.new/util/grub-mkconfig_lib.in +--- grub2-1.97~beta3/util/grub-mkconfig_lib.in 2009-09-15 00:23:50.000000000 +0100 ++++ grub2-1.97~beta3.new/util/grub-mkconfig_lib.in 2009-09-15 00:31:31.000000000 +0100 +@@ -142,6 +142,20 @@ + { + device=$1 + ++ loop_file= ++ case ${device} in ++ /dev/loop/*|/dev/loop[0-9]) ++ loop_file=`losetup ${device} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` ++ case $loop_file in ++ /dev/*) ;; ++ *) ++ loop_device=${device} ++ device=`${grub_probe} --target=device "${loop_file}"` ++ ;; ++ esac ++ ;; ++ esac ++ + # Abstraction modules aren't auto-loaded. + abstraction="`${grub_probe} --device ${device} --target=abstraction`" + for module in ${abstraction} ; do +@@ -159,6 +173,14 @@ + if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then + echo "search --no-floppy --fs-uuid --set ${fs_uuid}" + 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 loop0 ${loop_file#$loop_mountpoint}" ++ echo "set root=(loop0)" ++ fi ++ fi + } + + grub_file_is_not_garbage () |