~kirkland/grub/285269

« back to all changes in this revision

Viewing changes to debian/update-grub

  • Committer: Steve Langasek
  • Date: 2008-10-17 22:44:52 UTC
  • Revision ID: steve.langasek@canonical.com-20081017224452-sa09mwlscnb1s8zy
Drop the convert_kopt_to_uuid handling: this is no longer needed because
all systems (new installs and upgrades from 8.04) should now have UUID
settings in menu.lst, and the code was never made to respect admin
overrides so update-grub is unusable for anyone who needs to specify
their root by device instead of by UUID.  LP: #62195.

Show diffs side-by-side

added added

removed removed

Lines of Context:
798
798
        echo >> $buffer
799
799
}
800
800
 
801
 
convert_kopt_to_uuid()
802
 
{
803
 
        local kopt; kopt=$1
804
 
 
805
 
        convert=false
806
 
        root=$(echo "$kopt" | sed 's/.*root=//;s/ .*//')
807
 
        case "$root" in
808
 
                UUID=*|LABEL=*)
809
 
                        ;;
810
 
                /dev/disk/*)
811
 
                        ;;
812
 
                /dev/mapper/*)
813
 
                        ;;
814
 
                /dev/evms/[hs]d[a-z][0-9]*)
815
 
                        convert=:
816
 
                        ;;
817
 
                /dev/evms/*)
818
 
                        ;;
819
 
                /dev/md[0-9]*)
820
 
                        ;;
821
 
                /dev/*)
822
 
                        convert=:
823
 
                        ;;
824
 
        esac
825
 
        if $convert; then
826
 
                if [ -L "$DEV" ] && readlink "$DEV" | grep -q "^/dev/mapper/"
827
 
                then
828
 
                        :
829
 
                elif [ -b "$root" ]; then
830
 
                        uuid=$(/sbin/vol_id -u "$root" || true)
831
 
                        if [ -n "$uuid" ]; then
832
 
                                kopt=$(echo "$kopt" | sed "s/\(.*root=\)[^ ]*/\1UUID=$uuid/")
833
 
                        fi
834
 
                fi
835
 
        fi
836
 
 
837
 
        echo "$kopt"
838
 
}
839
 
 
840
801
## write out the kernel entries
841
802
output_kernel_list() {
842
803
        counter=0
1093
1054
# Extract the kernel options to use
1094
1055
kopt=$(GetMenuOpt "kopt" "$kopt")
1095
1056
 
1096
 
# Update the root device to mount-by-UUID
1097
 
old_kopt="$kopt"
1098
 
kopt=$(convert_kopt_to_uuid "$kopt")
1099
 
 
1100
1057
# Extract options for specific kernels
1101
1058
opts="$(ExtractMenuOpts "\(kopt_[[:alnum:]_]\+\)")"
1102
1059
test -z "$opts" || eval "$opts"
1107
1064
# mount-by-UUID on upgrade)
1108
1065
test -z "$kopt_2_6" && test -z "$(GetMenuOpt "kopt" "")" && \
1109
1066
        kopt_2_6="$default_kopt"
1110
 
old_kopt_2_6="$kopt_2_6"
1111
 
test -n "$kopt_2_6" && kopt_2_6=$(convert_kopt_to_uuid "$kopt_2_6")
1112
1067
 
1113
1068
# Extract the grub root
1114
1069
grub_root_device=$(GetMenuOpt "groot" "$grub_root_device")
1326
1281
        if [ -z "$title" ]; then
1327
1282
                title="$savetitle"
1328
1283
        fi
1329
 
        savekopt="$kopt"
1330
 
        savekopt_2_6="$kopt_2_6"
1331
 
        kopt="$old_kopt"
1332
 
        kopt_2_6="$old_kopt_2_6"
1333
1284
 
1334
1285
        # Hack: the kernel list output in Ubuntu 6.06 was different than
1335
1286
        # in the current version, so to support smooth upgrades we need to
1350
1301
        dapper_upgrade=""
1351
1302
        buffer="$savebuffer"
1352
1303
        title="$savetitle"
1353
 
        kopt="$savekopt"
1354
 
        kopt_2_6="$savekopt_2_6"
1355
1304
 
1356
1305
        ucf_update_kernels "$menu" "$otherbuffer"
1357
1306