Author: juhliarik Date: Thu Feb 11 13:54:10 2010 New Revision: 60800 URL: http://svn.opensuse.org/viewcvs/yast?rev=60800&view=rev Log: updated converitng device names to persisten device names Modified: trunk/bootloader/src/modules/BootStorage.ycp Modified: trunk/bootloader/src/modules/BootStorage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/modules/BootStorage.ycp?rev=60800&r1=60799&r2=60800&view=diff ============================================================================== --- trunk/bootloader/src/modules/BootStorage.ycp (original) +++ trunk/bootloader/src/modules/BootStorage.ycp Thu Feb 11 13:54:10 2010 @@ -323,10 +323,11 @@ * @param dev string device name * @return string device name according to "mountby" */ -global define string Dev2MountByDev(string dev) +global define string Dev2MountByDev(string dev) { - y2milestone ("Dev2MountByDev: %1", dev); + string tmp_dev = MountByDev2Dev(dev); + y2milestone ("Dev2MountByDev: %1 as kernel device name: %2", dev, tmp_dev); // add all_partitions to partitions if (MapAllPartitions()) y2milestone("Init all_partitions was done"); @@ -342,9 +343,9 @@ if (!Arch::ppc()) { by_mount = Storage::GetDefaultMountBy(); - if (haskey(partitions, dev)) + if (haskey(partitions, tmp_dev)) { - symbol partition_mount_by = (symbol) partitions[dev, "mountby"]:nil; + symbol partition_mount_by = (symbol) partitions[tmp_dev, "mountby"]:nil; if ((partition_mount_by != nil)) by_mount = partition_mount_by; } @@ -354,23 +355,23 @@ } y2milestone("Mount-by: %1", by_mount); - string ret = dev; + string ret = tmp_dev; switch(by_mount) { // convert to udev_id case (`id): // partitions - if ((partitions[dev, "udev_id"]:nil != nil) && (partitions[dev, "udev_id", 0]:nil != "")) + if ((partitions[tmp_dev, "udev_id"]:nil != nil) && (partitions[tmp_dev, "udev_id", 0]:nil != "")) { - ret = sformat ("/dev/disk/by-id/%1", partitions[dev, "udev_id", 0]:""); - y2milestone ("Device name: %1 is converted to udev id: %2", dev, ret); + ret = sformat ("/dev/disk/by-id/%1", partitions[tmp_dev, "udev_id", 0]:""); + y2milestone ("Device name: %1 is converted to udev id: %2", tmp_dev, ret); return ret; } // disks - if ((devices[dev, "udev_id"]:nil != nil) && (devices[dev, "udev_id", 0]:nil != "")) + if ((devices[tmp_dev, "udev_id"]:nil != nil) && (devices[tmp_dev, "udev_id", 0]:nil != "")) { - ret = sformat ("/dev/disk/by-id/%1", devices[dev, "udev_id", 0]:""); - y2milestone ("Device name: %1 is converted to udev id: %2", dev, ret); + ret = sformat ("/dev/disk/by-id/%1", devices[tmp_dev, "udev_id", 0]:""); + y2milestone ("Device name: %1 is converted to udev id: %2", tmp_dev, ret); return ret; } break; @@ -378,17 +379,17 @@ // convert to uuid case (`uuid): // partitions - if ((partitions[dev, "uuid"]:nil != nil) && (partitions[dev, "uuid"]:nil != "")) + if ((partitions[tmp_dev, "uuid"]:nil != nil) && (partitions[tmp_dev, "uuid"]:nil != "")) { - ret = sformat ("/dev/disk/by-uuid/%1", partitions[dev, "uuid"]:""); - y2milestone ("Device name: %1 is converted to uuid: %2", dev, ret); + ret = sformat ("/dev/disk/by-uuid/%1", partitions[tmp_dev, "uuid"]:""); + y2milestone ("Device name: %1 is converted to uuid: %2", tmp_dev, ret); return ret; } // disks - if ((devices[dev, "uuid"]:nil != nil) && (devices[dev, "uuid"]:nil != "")) + if ((devices[tmp_dev, "uuid"]:nil != nil) && (devices[tmp_dev, "uuid"]:nil != "")) { - ret = sformat ("/dev/disk/by-uuid/%1", devices[dev, "uuid"]:""); - y2milestone ("Device name: %1 is converted to uuid: %2", dev, ret); + ret = sformat ("/dev/disk/by-uuid/%1", devices[tmp_dev, "uuid"]:""); + y2milestone ("Device name: %1 is converted to uuid: %2", tmp_dev, ret); return ret; } break; @@ -396,17 +397,17 @@ // convert to udev_path case (`path): // partitions - if ((partitions[dev, "udev_path"]:nil != nil) && (partitions[dev, "udev_path"]:nil != "")) + if ((partitions[tmp_dev, "udev_path"]:nil != nil) && (partitions[tmp_dev, "udev_path"]:nil != "")) { - ret = sformat ("/dev/disk/by-path/%1", partitions[dev, "udev_path"]:""); - y2milestone ("Device name: %1 is converted to udev path: %2", dev, ret); + ret = sformat ("/dev/disk/by-path/%1", partitions[tmp_dev, "udev_path"]:""); + y2milestone ("Device name: %1 is converted to udev path: %2", tmp_dev, ret); return ret; } // disks - if ((devices[dev, "udev_path"]:nil != nil) && (devices[dev, "udev_path"]:nil != "")) + if ((devices[tmp_dev, "udev_path"]:nil != nil) && (devices[tmp_dev, "udev_path"]:nil != "")) { - ret = sformat ("/dev/disk/by-path/%1", devices[dev, "udev_path"]:""); - y2milestone ("Device name: %1 is converted to udev path: %2", dev, ret); + ret = sformat ("/dev/disk/by-path/%1", devices[tmp_dev, "udev_path"]:""); + y2milestone ("Device name: %1 is converted to udev path: %2", tmp_dev, ret); return ret; } break; @@ -414,20 +415,20 @@ // convert to label case (`label): // partitions - if ((partitions[dev, "label"]:nil != nil) && (partitions[dev, "label"]:nil != "")) + if ((partitions[tmp_dev, "label"]:nil != nil) && (partitions[tmp_dev, "label"]:nil != "")) { - ret = sformat ("/dev/disk/by-label/%1", partitions[dev, "label"]:""); - y2milestone ("Device name: %1 is converted to label: %2", dev, ret); + ret = sformat ("/dev/disk/by-label/%1", partitions[tmp_dev, "label"]:""); + y2milestone ("Device name: %1 is converted to label: %2", tmp_dev, ret); return ret; } // disks - y2milestone ("Disk doesn't support labels - name: %1 is converted to label: %2", dev, ret); + y2milestone ("Disk doesn't support labels - name: %1 is converted to label: %2", tmp_dev, ret); return ret; break; // convert to device or uknown type default: - y2warning ("Convert %1 to `device or unknwn type, result: %2", dev, ret); + y2warning ("Convert %1 to `device or unknwn type, result: %2", tmp_dev, ret); return ret; break; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org