Print this page
4846 HAL partition names don't match real partition names

*** 2,11 **** --- 2,12 ---- * * devinfo_storage.c : storage devices * * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2013 Garrett D'Amore <garrett@damore.org> + * Copyright 2014 Andrew Stormont. * * Licensed under the Academic Free License version 2.1 * **************************************************************************/
*** 37,48 **** --- 38,55 ---- #include "devinfo_storage.h" #include "osspec_solaris.h" #ifdef sparc #define WHOLE_DISK "s2" + #define DOS_SEPERATOR ":" + #define DOS_FORMAT "s2:%d" + #define DOS_TEMPLATE ":NN" #else #define WHOLE_DISK "p0" + #define DOS_SEPERATOR "p" + #define DOS_FORMAT "p%d" + #define DOS_TEMPLATE "pNN" #endif /* some devices,especially CDROMs, may take a while to be probed (values in ms) */ #define DEVINFO_PROBE_STORAGE_TIMEOUT 60000 #define DEVINFO_PROBE_VOLUME_TIMEOUT 60000
*** 700,714 **** /* add volumes: one on main device and a few pcfs candidates */ m = devinfo_storage_new_minor(minor_path, WHOLE_DISK, devlink, dev, -1); devinfo_volume_add (d, node, m); devinfo_storage_free_minor (m); ! doslink = (char *)calloc (1, strlen (devlink) + sizeof (":NNN") + 1); if (doslink != NULL) { for (i = 1; i < 16; i++) { ! snprintf(dospath, sizeof (dospath), WHOLE_DISK":%d", i); ! sprintf(doslink, "%s:%d", devlink, i); m = devinfo_storage_new_minor(minor_path, dospath, doslink, dev, i); devinfo_volume_add (d, node, m); devinfo_storage_free_minor (m); } free (doslink); --- 707,721 ---- /* add volumes: one on main device and a few pcfs candidates */ m = devinfo_storage_new_minor(minor_path, WHOLE_DISK, devlink, dev, -1); devinfo_volume_add (d, node, m); devinfo_storage_free_minor (m); ! doslink = (char *)calloc (1, strlen (devlink) + sizeof (DOS_TEMPLATE) + 1); if (doslink != NULL) { for (i = 1; i < 16; i++) { ! snprintf(dospath, sizeof (dospath), DOS_FORMAT, i); ! sprintf(doslink, "%s"DOS_SEPERATOR"%d", devlink, i); m = devinfo_storage_new_minor(minor_path, dospath, doslink, dev, i); devinfo_volume_add (d, node, m); devinfo_storage_free_minor (m); } free (doslink);
*** 857,874 **** free (devlink); di_devfs_path_free (minor_path); continue; } - /* ignore p1..N - we'll use p0:N instead */ - if ((strlen (slice) > 1) && (slice[0] == 'p') && isdigit(slice[1]) && - ((atol(&slice[1])) > 0)) { - free (devlink); - di_devfs_path_free (minor_path); - continue; - } - m = devinfo_storage_new_minor(minor_path, slice, devlink, dev, -1); if (m == NULL) { free (devlink); di_devfs_path_free (minor_path); continue; --- 864,873 ----
*** 913,927 **** devinfo_add_enqueue (parent, maindev_path, &devinfo_storage_handler); } /* add virtual dos volumes to enable pcfs probing */ if (!is_cdrom) { ! doslink_len = strlen (maindev->devlink) + sizeof (":NNN") + 1; if ((doslink = (char *)calloc (1, doslink_len)) != NULL) { for (i = 1; i < 16; i++) { ! snprintf(dospath, sizeof (dospath), "%s:%d", maindev->slice, i); ! snprintf(doslink, doslink_len, "%s:%d", maindev->devlink, i); m = devinfo_storage_new_minor(maindev_path, dospath, doslink, maindev->dev, i); g_queue_push_tail (mq, m); } free (doslink); } --- 912,926 ---- devinfo_add_enqueue (parent, maindev_path, &devinfo_storage_handler); } /* add virtual dos volumes to enable pcfs probing */ if (!is_cdrom) { ! doslink_len = strlen (maindev->devlink) + sizeof (DOS_TEMPLATE) + 1; if ((doslink = (char *)calloc (1, doslink_len)) != NULL) { for (i = 1; i < 16; i++) { ! snprintf(dospath, sizeof (dospath), "%s"DOS_SEPERATOR"%d", maindev->slice, i); ! snprintf(doslink, doslink_len, "%s"DOS_SEPERATOR"%d", maindev->devlink, i); m = devinfo_storage_new_minor(maindev_path, dospath, doslink, maindev->dev, i); g_queue_push_tail (mq, m); } free (doslink); }
*** 1401,1430 **** static gboolean is_dos_path(char *path, int *partnum) { char *p; ! if ((p = strrchr (path, ':')) == NULL) { return (FALSE); } return ((*partnum = atoi(p + 1)) != 0); } static gboolean dos_to_dev(char *path, char **devpath, int *partnum) { char *p; ! if ((p = strrchr (path, ':')) == NULL) { return (FALSE); } if ((*partnum = atoi(p + 1)) == 0) { return (FALSE); } p[0] = '\0'; *devpath = strdup(path); ! p[0] = ':'; return (*devpath != NULL); } static void devinfo_storage_cleanup_mountpoint_cb (HalDevice *d, guint32 exit_type, --- 1400,1429 ---- static gboolean is_dos_path(char *path, int *partnum) { char *p; ! if ((p = strrchr (path, DOS_SEPERATOR)) == NULL) { return (FALSE); } return ((*partnum = atoi(p + 1)) != 0); } static gboolean dos_to_dev(char *path, char **devpath, int *partnum) { char *p; ! if ((p = strrchr (path, DOS_SEPERATOR)) == NULL) { return (FALSE); } if ((*partnum = atoi(p + 1)) == 0) { return (FALSE); } p[0] = '\0'; *devpath = strdup(path); ! p[0] = DOS_SEPERATOR; return (*devpath != NULL); } static void devinfo_storage_cleanup_mountpoint_cb (HalDevice *d, guint32 exit_type,