diff -u

--- /home/src/extern/grub-0.97/debian/update-grub       2007-10-09 
21:52:49.000000000 +0100
+++ update-grub 2008-01-02 09:05:01.000000000 +0000
@@ -297,7 +297,18 @@
 crashdump="0"
 
 # Default kernel options, overidden by the kopt statement in the menufile.
-kopt="root=$(awk '$2 == "/" {print $1}' /etc/fstab) ro"
+loop_file=$(awk '$2=="/" && $4~"loop" {print $1}' /etc/fstab)
+host_device=$(awk '"'${loop_file}'"~"^"$2 && $2!="/" {print $1}' /proc/mounts)
+host_mountpoint=$(awk '$1=="'${host_device}'" && $2!="/boot" {print $2}' 
/proc/mounts)
+loop_file=${loop_file#$host_mountpoint}
+if [ -n "$host_device" ]; then
+    boot_device=
+    root_device="$host_device"
+    default_kopt="root=$host_device loop=$loop_file ro"
+else
+    default_kopt="root=$root_device ro"
+fi
+kopt="$default_kopt"
 
 # Title
 title=$(lsb_release --short --description 2>/dev/null) || title="Ubuntu"
@@ -822,7 +833,7 @@
 # Set the kernel 2.6 option only for fresh install (but convert it to
 # mount-by-UUID on upgrade)
 test -z "$kopt_2_6" && test -z "$(GetMenuOpt "kopt" "")" && \
-       kopt_2_6="root=$root_device ro"
+       kopt_2_6="$default_kopt"
 test -n "$kopt_2_6" && kopt_2_6=$(convert_kopt_to_uuid "$kopt_2_6")
 
 # Extract the grub root

-- 
Update-grub does not set kopt correctly in loopinstallations
https://bugs.launchpad.net/bugs/175772
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to