+# fix possible wrong params in menu.lst
+if [ "x$GRUB2" = "xno" ]; then
+ # Grub1 part
+ cp_check_and_sed '^# groot=' \
+ "s;^# groot=.*;# groot=$grub_root_device;g" \
+ "$menu_file" || true
+ cp_check_and_sed '^# kopt=' \
+ "s;^# kopt=\(.*\)root=[^[:space:]]*\(.*\);# kopt=\1root=$root_device\2;g" \
+ "$menu_file" || true
+fi
+update-grub >/dev/null 2>&1 || true
+echo -n " grub6"
+
+# fix possible wrong params in menu.lst
+if [ "x$GRUB2" = "xno" ]; then
+ # Grub1 part
+ # ... and final stage of devfs/udev brokeness fix
+ if [ "x$install_device_resolved" != "x$install_device" ]; then
+ # get original (symlinked device)
+ root_device=$(find_device_nonresolved "/")
+ if [ -z "$root_device" ]; then
+ root_device=$(find_root_device)
+ fi
+
+ # fix (hd0) mapping
+ cp_check_and_sed '^\(hd0\)' \
+ "s;^(hd0).*;(hd0) $install_device;" "$device_map" \
+ || true
+
+ # fix global root= invocation
+ cp_check_and_sed '^# kopt=' \
+ "s;^# kopt=\(.*\)root=[^[:space:]]*\(.*\);# kopt=\1root=$root_device\2;g" \
+ "$menu_file" || true
+
+ # fix root= invocation for individual kernel profiles
+ cp_check_and_sed '^kernel' \
+ "s;\(^kernel.*\)root=[^[:space:]]*\(.*\);\1root=$root_device\2;g" \
+ "$menu_file" || true
+ fi