[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#606147: yaboot-installer: Use short unique OS labels returned by os-prober

Package: yaboot-installer
Tags: patch

Yaboot-installer should use short unique OS labels returned by os-prober
instead of long titles. It should add oldlabel to the label, if available.

Currently, first word from long title is actually used by yaboot. This
regularly makes duplicate labels. Current solution of prepending the
last part of the partition name to the label just adds to the confusion
as unix device/partition names are not persistent anymore.

Index: debian/postinst
--- debian/postinst	(revision 65533)
+++ debian/postinst	(working copy)
@@ -255,10 +255,10 @@
 	    linux-boot-prober "$partition" | while read \
-		    rootpart bootpart label kernel initrd params; do
+		    rootpart bootpart oldlabel kernel initrd params; do
 		info "linux-boot-probed:" \
-		     "$rootpart:$bootpart:$label:$kernel:$initrd:$params"
+		     "$rootpart:$bootpart:$oldlabel:$kernel:$initrd:$params"
 		ofrootpart="$(map_of_path "$mappedpartition")" || continue
 		debug "OF root partition: $ofrootpart"
 		# bootpart may or may not be in devfs syntax.
@@ -267,13 +267,8 @@
 		debug "mapped boot partition: $mappedbootpart"
 		ofbootpart="$(map_of_path "$mappedbootpart")" || continue
 		debug "OF boot partition: $ofbootpart"
-		if [ -z "$label" ]; then
-		    label="$title"
-		fi
-		# Prepend the last part of the partition name to the label,
-		# for uniqueness and (I hope) clarity, given that we don't
-		# have a way to display a useful description in yaboot.
-		label="${mappedbootpart##*/}-$label"
+		# Add oldlabel to os-prober provided label, if available.
+		label="$label${oldlabel:+-${oldlabel}}"
 		if echo "$kernel" | grep -q '^/boot/' && \
 		   [ "$mappedbootpart" != "$mappedpartition" ]; then
 		    # separate /boot partition

Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: