~ubuntu-branches/ubuntu/maverick/grub/maverick-proposed

« back to all changes in this revision

Viewing changes to debian/update-grub

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-10-20 10:34:20 UTC
  • Revision ID: james.westby@ubuntu.com-20081020103420-ijdgc3gjajd4q0wi
Tags: 0.97-29ubuntu44
Brown paper bag bug: readd convert_kopt_to_uuid and use it only on
creation of a new menu.lst, because /this/ is the package the installer
uses to set the UUID on new installs.  This should eventually be
refactored to use the mostly-redundant convert_to_uuid function, but we
leave the refactoring until post-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
        echo "$uuid"
302
302
}
303
303
 
 
304
convert_kopt_to_uuid()
 
305
{
 
306
        local kopt; kopt=$1
 
307
 
 
308
        convert=false
 
309
        root=$(echo "$kopt" | sed 's/.*root=//;s/ .*//')
 
310
        case "$root" in
 
311
                UUID=*|LABEL=*)
 
312
                        ;;
 
313
                /dev/disk/*)
 
314
                        ;;
 
315
                /dev/mapper/*)
 
316
                        ;;
 
317
                /dev/evms/[hs]d[a-z][0-9]*)
 
318
                        convert=:
 
319
                        ;;
 
320
                /dev/evms/*)
 
321
                        ;;
 
322
                /dev/md[0-9]*)
 
323
                        ;;
 
324
                /dev/*)
 
325
                        convert=:
 
326
                        ;;
 
327
        esac
 
328
        if $convert; then
 
329
                if [ -L "$DEV" ] && readlink "$DEV" | grep -q "^/dev/mapper/"
 
330
                then
 
331
                        :
 
332
                elif [ -b "$root" ]; then
 
333
                        uuid=$(/sbin/vol_id -u "$root" || true)
 
334
                        if [ -n "$uuid" ]; then
 
335
                                kopt=$(echo "$kopt" | sed "s/\(.*root=\)[^ ]*/\1UUID=$uuid/")
 
336
                        fi
 
337
                fi
 
338
        fi
 
339
 
 
340
        echo "$kopt"
 
341
}
 
342
 
 
343
 
304
344
## Configuration Options
305
345
# directory's to look for the grub installation and the menu file
306
346
grub_dirs="/boot/grub /boot/boot/grub"
342
382
else
343
383
        default_kopt="root=$root_device ro"
344
384
fi
 
385
default_kopt="$(convert_kopt_to_uuid "$default_kopt")"
345
386
kopt="$default_kopt"
346
387
 
347
388
# Title