Print this page
4833 Remove volrmmount
4845 rm(u)mount don't always print mount/unmount errors
4846 HAL partition names don't match real parition names
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
*** 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
*
**************************************************************************/
*** 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);
--- 701,715 ----
/* 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 ("pNN") + 1);
if (doslink != NULL) {
for (i = 1; i < 16; i++) {
! snprintf(dospath, sizeof (dospath), "p%d", i);
! sprintf(doslink, "%sp%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;
--- 858,867 ----
*** 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);
}
--- 906,920 ----
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 ("pNN") + 1;
if ((doslink = (char *)calloc (1, doslink_len)) != NULL) {
for (i = 1; i < 16; i++) {
! snprintf(dospath, sizeof (dospath), "%sp%d", maindev->slice, i);
! snprintf(doslink, doslink_len, "%sp%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,
--- 1394,1423 ----
static gboolean
is_dos_path(char *path, int *partnum)
{
char *p;
! if ((p = strrchr (path, 'p')) == 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, 'p')) == NULL) {
return (FALSE);
}
if ((*partnum = atoi(p + 1)) == 0) {
return (FALSE);
}
p[0] = '\0';
*devpath = strdup(path);
! p[0] = 'p';
return (*devpath != NULL);
}
static void
devinfo_storage_cleanup_mountpoint_cb (HalDevice *d, guint32 exit_type,