grub_util_error (_("translator `%s' for path `%s' is given only options, "
"cannot find device part"), argz, path);
+ int part = -1;
+ if (strncmp (name, "part:", sizeof ("part:") - 1) == 0)
+ {
+ char *next = strchr (name + sizeof ("part:") - 1, ':');
+ if (next)
+ {
+ part = atoi (name + sizeof ("part:") - 1);
+ name = next + 1;
+ }
+ }
if (strncmp (name, "device:", sizeof ("device:") - 1) == 0)
{
char *dev_name = name + sizeof ("device:") - 1;
dev_name = next_name + 1;
}
- size = sizeof ("/dev/") - 1 + strlen (dev_name) + 1;
- ret = xmalloc (size);
- next = stpncpy (ret, "/dev/", size);
- stpncpy (next, dev_name, size - (next - ret));
+ if (part >= 0)
+ ret = xasprintf("/dev/%ss%u", dev_name, part);
+ else
+ ret = xasprintf("/dev/%s", dev_name);
}
else if (!strncmp (name, "file:", sizeof ("file:") - 1))
ret = strdup (name + sizeof ("file:") - 1);
else
opts=
fi
+ device=device:${GRUB_DEVICE#/dev/}
+ device=$(echo "$device" | sed -e 's/^device:\(.*[0-9]\+\)s\([0-9]\+\)$/part:\2:device:\1'/)
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
- multiboot ${kernel} root=device:${GRUB_DEVICE#/dev/} $opts ${GRUB_CMDLINE_GNUMACH}
+ multiboot ${kernel} root=$device $opts ${GRUB_CMDLINE_GNUMACH}
EOF
if [ x$type != xrecovery ] ; then