Bug#353725: grub: should use more focused method to replace / with ! in device names

Frans Pop aragorn at tiscali.nl
Mon Feb 20 13:48:31 UTC 2006


Package: grub
Version: 0.97-5

The patch implemented for http://bugs.debian.org/302359 will replace any 
second "/" in a device name with a "!" for 2.6 kernels.
Recently this was discovered to break LVM based installations as
/dev/mapper/<LV-name> would be replaced with /dev/mapper!<LV-name> and an 
exception was added for that.

After looking at the code in update-grub, I've come to the conclusion that 
the original patch is broken in that it will act on _any_ device name 
instead of only the devices using the weird ! naming.
Rather than adding exceptions when we find things broken by the 
replacement, the code should make sure that the replacement only happens 
in cases where it is known to be needed.

Thus I propose to replace the current code:
convert_kernel26 ()
{
    # skip /dev/mapper/ from conversion
    if ! echo "$1" | grep -q "^/dev/mapper/"; then
        echo "$1" | sed 's%^\(/dev/[^/]*\)/\(.*\)%\1!\2%'
    else
        echo "$1"
    fi
}

by something like:
convert_kernel26 ()
{
    case "$1" in
	/dev/rd/*|/dev/ida/*)
            echo "$1" | sed 's%^\(/dev/[^/]*\)/\(.*\)%\1!\2%'
	    ;;
	*)
	    echo "$1"
	    ;;
    esac
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20060220/dd359934/attachment.pgp


More information about the Pkg-grub-devel mailing list