summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorartem <none@none>2006-11-14 19:39:57 -0800
committerartem <none@none>2006-11-14 19:39:57 -0800
commit00687e57f8c568d4f8fb446b6530a2942842292f (patch)
tree990f8c5d58d1b2d53bebb5578bf87e27c3189e8a
parenta604d238c5e1858f018e4e7f16c760afb009e655 (diff)
downloadillumos-joyent-00687e57f8c568d4f8fb446b6530a2942842292f.tar.gz
6486706 after upgrade from snv_50 to snv_51, volfs service is left in maintenance state
6487052 Tamarack services not started on upgrade 6488975 auto mount of a compact flash card in a pcmcia holder does not work on nv_51 6492003 hal: nits from merging with git head
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo.c23
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_ieee1394.c4
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_misc.c6
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_pci.c4
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_storage.c170
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_storage.h1
-rw-r--r--usr/src/cmd/hal/hald/solaris/devinfo_usb.c8
-rw-r--r--usr/src/cmd/hal/hald/solaris/hotplug.c8
-rw-r--r--usr/src/cmd/hal/hald/solaris/sysevent.c6
-rw-r--r--usr/src/cmd/hal/probing/storage/probe-storage.c7
-rw-r--r--usr/src/pkgdefs/SUNWhalr/postinstall17
-rw-r--r--usr/src/pkgdefs/SUNWrmvolmgrr/postinstall16
-rw-r--r--usr/src/pkgdefs/SUNWsmediar/postinstall28
13 files changed, 200 insertions, 98 deletions
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo.c b/usr/src/cmd/hal/hald/solaris/devinfo.c
index 8e2c562660..d2bab8acf2 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <libdevinfo.h>
@@ -86,7 +90,7 @@ devinfo_set_default_properties (HalDevice *d, HalDevice *parent, di_node_t node,
char udi[HAL_PATH_MAX];
if (parent != NULL) {
- hal_device_property_set_string (d, "info.parent", parent->udi);
+ hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent));
} else {
hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/local");
}
@@ -128,6 +132,7 @@ static DevinfoDevHandler *devinfo_handlers[] = {
&devinfo_cpu_handler,
&devinfo_ide_handler,
&devinfo_scsi_handler,
+ &devinfo_pcata_handler,
&devinfo_floppy_handler,
&devinfo_usb_handler,
&devinfo_ieee1394_handler,
@@ -158,7 +163,7 @@ devinfo_add_node(HalDevice *parent, di_node_t node)
di_devfs_path_free(devfs_path);
- HAL_INFO (("add_node: %s", d ? d->udi : "none"));
+ HAL_INFO (("add_node: %s", d ? hal_device_get_udi (d) : "none"));
return (d);
}
@@ -215,7 +220,7 @@ devinfo_callouts_probing_done (HalDevice *d, guint32 exit_type, gint return_code
/* Discard device if probing reports failure */
if (exit_type != HALD_RUN_SUCCESS || (return_code != 0)) {
- HAL_INFO (("Probing for %s failed %d", d->udi, return_code));
+ HAL_INFO (("Probing for %s failed %d", hal_device_get_udi (d), return_code));
hal_device_store_remove (hald_get_tdl (), d);
g_object_unref (d);
hotplug_event_end (end_token);
@@ -266,7 +271,7 @@ devinfo_callouts_preprobing_done (HalDevice *d, gpointer userdata1, gpointer use
if (prober != NULL) {
/* probe the device */
- HAL_INFO(("Probing udi=%s", d->udi));
+ HAL_INFO(("Probing udi=%s", hal_device_get_udi (d)));
hald_runner_run (d,
prober, NULL,
prober_timeout,
@@ -281,7 +286,7 @@ devinfo_callouts_preprobing_done (HalDevice *d, gpointer userdata1, gpointer use
void
hotplug_event_begin_add_devinfo (HalDevice *d, HalDevice *parent, DevinfoDevHandler *handler, void *end_token)
{
- HAL_INFO(("Preprobing udi=%s", d->udi));
+ HAL_INFO(("Preprobing udi=%s", hal_device_get_udi (d)));
if (parent != NULL && hal_device_property_get_bool (parent, "info.ignore")) {
HAL_INFO (("Ignoring device since parent has info.ignore==TRUE"));
@@ -322,14 +327,14 @@ devinfo_remove_branch (gchar *devfs_path, HalDevice *d)
return;
}
- HAL_INFO (("remove_branch: %s %s\n", devfs_path, d->udi));
+ HAL_INFO (("remove_branch: %s %s\n", devfs_path, hal_device_get_udi (d)));
/* first remove children */
children = hal_device_store_match_multiple_key_value_string (hald_get_gdl(),
- "info.parent", d->udi);
+ "info.parent", hal_device_get_udi (d));
for (i = children; i != NULL; i = g_slist_next (i)) {
child = HAL_DEVICE (i->data);
- HAL_INFO (("remove_branch: child %s\n", child->udi));
+ HAL_INFO (("remove_branch: child %s\n", hal_device_get_udi (child)));
devinfo_remove_branch ((gchar *)hal_device_property_get_string (child, "solaris.devfs_path"), child);
}
g_slist_free (children);
@@ -345,7 +350,7 @@ devinfo_callouts_remove_done (HalDevice *d, gpointer userdata1, gpointer userdat
{
void *end_token = (void *) userdata1;
- HAL_INFO (("Remove callouts completed udi=%s", d->udi));
+ HAL_INFO (("Remove callouts completed udi=%s", hal_device_get_udi (d)));
if (!hal_device_store_remove (hald_get_gdl (), d)) {
HAL_WARNING (("Error removing device"));
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_ieee1394.c b/usr/src/cmd/hal/hald/solaris/devinfo_ieee1394.c
index 7262f2d740..2346e833e1 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_ieee1394.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_ieee1394.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <libdevinfo.h>
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_misc.c b/usr/src/cmd/hal/hald/solaris/devinfo_misc.c
index 4d01b8c830..d0509caee2 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_misc.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_misc.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <sys/utsname.h>
@@ -82,7 +86,7 @@ devinfo_computer_add(HalDevice *parent, di_node_t node, char *devfs_path, char *
/* all devinfo devices belong to the 'local' branch */
local_d = hal_device_new ();
- hal_device_property_set_string (local_d, "info.parent", d->udi);
+ hal_device_property_set_string (local_d, "info.parent", hal_device_get_udi (d));
hal_device_property_set_string (local_d, "info.bus", "unknown");
hal_device_property_set_string (local_d, "info.product", "Local devices");
hal_device_property_set_string (local_d, "info.udi", "/org/freedesktop/Hal/devices/local");
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_pci.c b/usr/src/cmd/hal/hald/solaris/devinfo_pci.c
index 1f0499197f..14162550e0 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_pci.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_pci.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <libdevinfo.h>
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_storage.c b/usr/src/cmd/hal/hald/solaris/devinfo_storage.c
index b5df98c06c..e6b41ec3c1 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_storage.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_storage.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <strings.h>
@@ -56,9 +60,11 @@ typedef struct devinfo_storage_minor {
HalDevice *devinfo_ide_add(HalDevice *parent, di_node_t node, char *devfs_path, char *device_type);
static HalDevice *devinfo_ide_host_add(HalDevice *parent, di_node_t node, char *devfs_path);
static HalDevice *devinfo_ide_device_add(HalDevice *parent, di_node_t node, char *devfs_path);
-static HalDevice *devinfo_ide_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, char *devfs_path);
+static HalDevice *devinfo_ide_storage_add(HalDevice *parent, di_node_t node, char *devfs_path);
HalDevice *devinfo_scsi_add(HalDevice *parent, di_node_t node, char *devfs_path, char *device_type);
-static HalDevice *devinfo_scsi_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, char *devfs_path);
+static HalDevice *devinfo_scsi_storage_add(HalDevice *parent, di_node_t node, char *devfs_path);
+HalDevice *devinfo_pcata_add(HalDevice *parent, di_node_t node, char *devfs_path, char *device_type);
+static HalDevice *devinfo_pcata_storage_add(HalDevice *parent, di_node_t node, char *devfs_path);
HalDevice *devinfo_floppy_add(HalDevice *parent, di_node_t node, char *devfs_path, char *device_type);
static void devinfo_floppy_add_volume(HalDevice *parent, di_node_t node);
static HalDevice *devinfo_lofi_add(HalDevice *parent, di_node_t node, char *devfs_path, char *device_type);
@@ -100,6 +106,14 @@ DevinfoDevHandler devinfo_scsi_handler = {
NULL,
NULL
};
+DevinfoDevHandler devinfo_pcata_handler = {
+ devinfo_pcata_add,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
DevinfoDevHandler devinfo_floppy_handler = {
devinfo_floppy_add,
NULL,
@@ -184,11 +198,11 @@ devinfo_ide_device_add(HalDevice *parent, di_node_t node, char *devfs_path)
devinfo_add_enqueue (d, devfs_path, &devinfo_ide_handler);
- return (devinfo_ide_storage_add (parent, d, node, devfs_path));
+ return (devinfo_ide_storage_add (d, node, devfs_path));
}
static HalDevice *
-devinfo_ide_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, char *devfs_path)
+devinfo_ide_storage_add(HalDevice *parent, di_node_t node, char *devfs_path)
{
HalDevice *d;
char *s;
@@ -206,7 +220,7 @@ devinfo_ide_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, ch
hal_device_property_set_string (d, "info.category", "storage");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s/%s%d", parent->udi, driver_name, di_instance (node));
+ "%s/%s%d", hal_device_get_udi (parent), driver_name, di_instance (node));
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
PROP_STR(d, node, s, "devid", "info.product");
@@ -252,7 +266,7 @@ devinfo_scsi_add(HalDevice *parent, di_node_t node, char *devfs_path, char *devi
hal_device_property_set_string (d, "info.bus", "scsi");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s/%s%d", parent->udi, di_node_name(node), di_instance (node));
+ "%s/%s%d", hal_device_get_udi (parent), di_node_name(node), di_instance (node));
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
@@ -265,11 +279,11 @@ devinfo_scsi_add(HalDevice *parent, di_node_t node, char *devfs_path, char *devi
devinfo_add_enqueue (d, devfs_path, &devinfo_scsi_handler);
- return (devinfo_scsi_storage_add (parent, d, node, devfs_path));
+ return (devinfo_scsi_storage_add (d, node, devfs_path));
}
static HalDevice *
-devinfo_scsi_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, char *devfs_path)
+devinfo_scsi_storage_add(HalDevice *parent, di_node_t node, char *devfs_path)
{
HalDevice *d;
int *i;
@@ -282,7 +296,7 @@ devinfo_scsi_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, c
hal_device_property_set_string (d, "info.category", "storage");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s/sd%d", parent->udi, di_instance (node));
+ "%s/sd%d", hal_device_get_udi (parent), di_instance (node));
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
PROP_STR(d, node, s, "inquiry-product-id", "info.product");
@@ -327,7 +341,8 @@ devinfo_scsi_storage_add(HalDevice *grampa, HalDevice *parent, di_node_t node, c
return (d);
}
-static char *devinfo_scsi_dtype2str(int dtype)
+static char *
+devinfo_scsi_dtype2str(int dtype)
{
char *dtype2str[] = {
"disk" , /* DTYPE_DIRECT 0x00 */
@@ -355,6 +370,73 @@ static char *devinfo_scsi_dtype2str(int dtype)
}
+/* PCMCIA */
+
+HalDevice *
+devinfo_pcata_add(HalDevice *parent, di_node_t node, char *devfs_path, char *device_type)
+{
+ int *i;
+ char *driver_name;
+ HalDevice *d;
+ char udi[HAL_PATH_MAX];
+
+ driver_name = di_driver_name (node);
+ if ((driver_name == NULL) || (strcmp (driver_name, "pcata") != 0)) {
+ return (NULL);
+ }
+
+ d = hal_device_new ();
+
+ devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.bus", "pcmcia");
+
+ hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+ "%s/%s%d", hal_device_get_udi (parent), di_node_name(node), di_instance (node));
+ hal_device_set_udi (d, udi);
+ hal_device_property_set_string (d, "info.udi", udi);
+ hal_device_property_set_string (d, "info.product", "PCMCIA Disk");
+
+ devinfo_add_enqueue (d, devfs_path, &devinfo_pcata_handler);
+
+ return (devinfo_pcata_storage_add (d, node, devfs_path));
+}
+
+static HalDevice *
+devinfo_pcata_storage_add(HalDevice *parent, di_node_t node, char *devfs_path)
+{
+ HalDevice *d;
+ char *driver_name;
+ int *i;
+ char *s;
+ char udi[HAL_PATH_MAX];
+
+ d = hal_device_new ();
+
+ devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.category", "storage");
+
+ hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+ "%s/sd%d", hal_device_get_udi (parent), di_instance (node));
+ hal_device_set_udi (d, udi);
+ hal_device_property_set_string (d, "info.udi", udi);
+
+ hal_device_add_capability (d, "storage");
+
+ hal_device_property_set_int (d, "storage.lun", 0);
+ hal_device_property_set_bool (d, "storage.hotpluggable", TRUE);
+ hal_device_property_set_bool (d, "storage.removable", FALSE);
+ hal_device_property_set_bool (d, "storage.requires_eject", FALSE);
+ hal_device_property_set_bool (d, "storage.media_check_enabled", TRUE);
+ hal_device_property_set_string (d, "storage.drive_type", "disk");
+ hal_device_property_set_bool (d, "storage.requires_eject", FALSE);
+
+ hal_device_add_capability (d, "block");
+
+ devinfo_storage_minors (d, node, devfs_path, FALSE);
+
+ return (d);
+}
+
/* floppy */
HalDevice *
@@ -474,20 +556,20 @@ devinfo_floppy_rescan_probing_done (HalDevice *d, guint32 exit_type, gint return
HalDevice *v;
if (!hal_device_property_get_bool (d, "storage.removable.media_available")) {
- HAL_INFO (("no floppy media", d->udi));
+ HAL_INFO (("no floppy media", hal_device_get_udi (d)));
/* remove child (can only be single volume) */
if (((v = hal_device_store_match_key_value_string (hald_get_gdl(),
- "info.parent", d->udi)) != NULL) &&
+ "info.parent", hal_device_get_udi (d))) != NULL) &&
((devfs_path = hal_device_property_get_string (v,
"solaris.devfs_path")) != NULL)) {
devinfo_remove_enqueue ((char *)devfs_path, NULL);
}
} else {
- HAL_INFO (("floppy media found", d->udi));
+ HAL_INFO (("floppy media found", hal_device_get_udi (d)));
if ((devfs_path = hal_device_property_get_string(d, "solaris.devfs_path")) == NULL) {
- HAL_INFO (("no devfs_path", d->udi));
+ HAL_INFO (("no devfs_path", hal_device_get_udi (d)));
hotplug_event_process_queue ();
return;
}
@@ -539,7 +621,7 @@ devinfo_lofi_add_major(HalDevice *parent, di_node_t node, char *devfs_path, char
hal_device_property_set_string (d, "info.bus", "pseudo");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s/%s%d", parent->udi, di_node_name(node), di_instance (node));
+ "%s/%s%d", hal_device_get_udi (parent), di_node_name(node), di_instance (node));
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
@@ -662,7 +744,7 @@ devinfo_lofi_remove_minor(char *parent_devfs_path, char *name)
if ((devfs_path = hal_device_property_get_string (d,
"solaris.devfs_path")) == NULL) {
- HAL_INFO (("devfs_path not found %s", d->udi));
+ HAL_INFO (("devfs_path not found %s", hal_device_get_udi (d)));
return;
}
@@ -936,7 +1018,7 @@ devinfo_volume_add(HalDevice *parent, di_node_t node, devinfo_storage_minor_t *m
hal_device_property_set_string (d, "info.category", "volume");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s/%s", parent->udi, slice);
+ "%s/%s", hal_device_get_udi (parent), slice);
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
hal_device_property_set_string (d, "info.product", slice);
@@ -952,7 +1034,7 @@ devinfo_volume_add(HalDevice *parent, di_node_t node, devinfo_storage_minor_t *m
hal_device_property_set_string (d, "block.solaris.slice", slice);
hal_device_property_set_bool (d, "block.is_volume", TRUE); /* XXX */
- hal_device_property_set_string (d, "block.storage_device", parent->udi);
+ hal_device_property_set_string (d, "block.storage_device", hal_device_get_udi (parent));
/* set volume defaults */
hal_device_property_set_string (d, "volume.fstype", "");
@@ -996,7 +1078,7 @@ devinfo_volume_preprobing_done (HalDevice *d, gpointer userdata1, gpointer userd
int dos_num;
if (hal_device_property_get_bool (d, "info.ignore")) {
- HAL_INFO (("Preprobing merged info.ignore==TRUE %s", d->udi));
+ HAL_INFO (("Preprobing merged info.ignore==TRUE %s", hal_device_get_udi (d)));
goto skip;
}
@@ -1008,12 +1090,12 @@ devinfo_volume_preprobing_done (HalDevice *d, gpointer userdata1, gpointer userd
slice = hal_device_property_get_string(d, "block.solaris.slice");
if ((block_device == NULL) || (storage_udi == NULL) ||
(slice == NULL) || (strlen (slice) < 2)) {
- HAL_INFO (("Malformed volume properties %s", d->udi));
+ HAL_INFO (("Malformed volume properties %s", hal_device_get_udi (d)));
goto skip;
}
storage_d = hal_device_store_match_key_value_string (hald_get_gdl (), "info.udi", storage_udi);
if (storage_d == NULL) {
- HAL_INFO (("Storage device not found %s", d->udi));
+ HAL_INFO (("Storage device not found %s", hal_device_get_udi (d)));
goto skip;
}
@@ -1025,19 +1107,19 @@ devinfo_volume_preprobing_done (HalDevice *d, gpointer userdata1, gpointer userd
if ((hal_device_property_get_bool (storage_d, "storage.no_partitions_hint") ||
(dos_num > hal_device_property_get_int (storage_d, "storage.solaris.num_dos_partitions")))) {
HAL_INFO (("%d > %d %s", dos_num, hal_device_property_get_int (storage_d,
- "storage.solaris.num_dos_partitions"), storage_d->udi));
+ "storage.solaris.num_dos_partitions"), hal_device_get_udi (storage_d)));
goto skip;
}
} else {
/* if no VTOC slices found, don't probe slices except s2 */
if ((slice[0] == 's') && (isdigit(slice[1])) && ((strcmp (slice, whole_disk)) != 0) &&
!hal_device_property_get_bool (storage_d, "storage.solaris.vtoc_slices")) {
- HAL_INFO (("Not probing slice %s", d->udi));
+ HAL_INFO (("Not probing slice %s", hal_device_get_udi (d)));
goto skip;
}
}
- HAL_INFO(("Probing udi=%s", d->udi));
+ HAL_INFO(("Probing udi=%s", hal_device_get_udi (d)));
hald_runner_run (d,
"hald-probe-volume", NULL,
DEVINFO_PROBE_VOLUME_TIMEOUT,
@@ -1055,7 +1137,7 @@ skip:
static void
devinfo_volume_hotplug_begin_add (HalDevice *d, HalDevice *parent, DevinfoDevHandler *handler, void *end_token)
{
- HAL_INFO(("Preprobing volume udi=%s", d->udi));
+ HAL_INFO(("Preprobing volume udi=%s", hal_device_get_udi (d)));
if (hal_device_property_get_bool (parent, "info.ignore")) {
HAL_INFO (("Ignoring volume: parent's info.ignore is TRUE"));
@@ -1091,10 +1173,10 @@ devinfo_storage_hotplug_begin_add (HalDevice *d, HalDevice *parent, DevinfoDevHa
"pseudo" };
int i;
- HAL_INFO (("Preprobing udi=%s", d->udi));
+ HAL_INFO (("Preprobing udi=%s", hal_device_get_udi (d)));
if (parent == NULL) {
- HAL_INFO (("no parent %s", d->udi));
+ HAL_INFO (("no parent %s", hal_device_get_udi (d)));
goto error;
}
@@ -1126,11 +1208,11 @@ devinfo_storage_hotplug_begin_add (HalDevice *d, HalDevice *parent, DevinfoDevHa
p_d = hal_device_store_find (hald_get_gdl (), p_udi);
}
if (phys_d == NULL) {
- HAL_INFO (("no physical device %s", d->udi));
- goto error;
+ HAL_INFO (("no physical device %s", hal_device_get_udi (d)));
+ } else {
+ hal_device_property_set_string (d, "storage.physical_device", hal_device_get_udi (phys_d));
+ hal_device_property_set_string (d, "storage.bus", phys_bus);
}
- hal_device_property_set_string (d, "storage.physical_device", phys_d->udi);
- hal_device_property_set_string (d, "storage.bus", phys_bus);
skip_bus:
@@ -1155,7 +1237,7 @@ devinfo_storage_probing_done (HalDevice *d, guint32 exit_type, gint return_code,
{
void *end_token = (void *) userdata1;
- HAL_INFO (("devinfo_storage_probing_done %s", d->udi));
+ HAL_INFO (("devinfo_storage_probing_done %s", hal_device_get_udi (d)));
/* Discard device if probing reports failure */
if (exit_type != HALD_RUN_SUCCESS || return_code != 0) {
@@ -1201,7 +1283,7 @@ devinfo_storage_rescan_probing_done (HalDevice *d, guint32 exit_type, gint retur
char *p;
di_node_t node;
- HAL_INFO (("devinfo_storage_rescan_probing_done %s", d->udi));
+ HAL_INFO (("devinfo_storage_rescan_probing_done %s", hal_device_get_udi (d)));
devfs_path_orig = hal_device_property_get_string (d, "solaris.devfs_path");
if (devfs_path_orig == NULL) {
@@ -1221,7 +1303,7 @@ devinfo_storage_rescan_probing_done (HalDevice *d, guint32 exit_type, gint retur
}
if ((node = di_init (devfs_path, DINFOCPYALL)) == DI_NODE_NIL) {
- HAL_INFO (("di_init %s failed %d %s", devfs_path, errno, d->udi));
+ HAL_INFO (("di_init %s failed %d %s", devfs_path, errno, hal_device_get_udi (d)));
hotplug_event_process_queue ();
return;
} else {
@@ -1254,7 +1336,7 @@ devinfo_storage_device_rescan (HalDevice *d)
gboolean is_floppy;
gboolean media_available;
- HAL_INFO (("devinfo_storage_device_rescan udi=%s", d->udi));
+ HAL_INFO (("devinfo_storage_device_rescan udi=%s", hal_device_get_udi (d)));
if (hal_device_property_get_bool (d, "block.is_volume")) {
HAL_INFO (("nothing to do for volume"));
@@ -1268,26 +1350,26 @@ devinfo_storage_device_rescan (HalDevice *d)
hal_device_property_get_bool (d, "storage.removable.media_available");
if (!media_available && !is_floppy) {
- HAL_INFO (("media gone %s", d->udi));
+ HAL_INFO (("media gone %s", hal_device_get_udi (d)));
volumes = hal_device_store_match_multiple_key_value_string (hald_get_gdl(),
- "block.storage_device", d->udi);
+ "block.storage_device", hal_device_get_udi (d));
for (i = volumes; i != NULL; i = g_slist_next (i)) {
v = HAL_DEVICE (i->data);
v_devfs_path = (gchar *)hal_device_property_get_string (v, "solaris.devfs_path");
- HAL_INFO (("child volume %s", v->udi));
+ HAL_INFO (("child volume %s", hal_device_get_udi (v)));
if ((v_devfs_path != NULL) && hal_device_has_capability (v, "volume")) {
- HAL_INFO (("removing volume %s", v->udi));
+ HAL_INFO (("removing volume %s", hal_device_get_udi (v)));
devinfo_remove_enqueue (v_devfs_path, NULL);
} else {
- HAL_INFO (("not a volume %s", v->udi));
+ HAL_INFO (("not a volume %s", hal_device_get_udi (v)));
}
}
g_slist_free (volumes);
hotplug_event_process_queue ();
} else if (is_floppy) {
- HAL_INFO (("rescanning floppy %s", d->udi));
+ HAL_INFO (("rescanning floppy %s", hal_device_get_udi (d)));
hald_runner_run (d,
"hald-probe-storage --only-check-for-media", NULL,
@@ -1295,7 +1377,7 @@ devinfo_storage_device_rescan (HalDevice *d)
devinfo_floppy_rescan_probing_done,
NULL, NULL);
} else {
- HAL_INFO (("media available %s", d->udi));
+ HAL_INFO (("media available %s", hal_device_get_udi (d)));
hald_runner_run (d,
"hald-probe-storage --only-check-for-media", NULL,
@@ -1494,7 +1576,7 @@ devinfo_volume_force_unmount_cb (HalDevice *d, guint32 exit_type,
{
void *end_token = (void *) data1;
- HAL_INFO (("devinfo_volume_force_unmount_cb for udi='%s', exit_type=%d, return_code=%d", d->udi, exit_type, return_code));
+ HAL_INFO (("devinfo_volume_force_unmount_cb for udi='%s', exit_type=%d, return_code=%d", hal_device_get_udi (d), exit_type, return_code));
if (exit_type == HALD_RUN_SUCCESS && error != NULL &&
error[0] != NULL && error[1] != NULL) {
@@ -1529,7 +1611,7 @@ devinfo_volume_force_unmount (HalDevice *d, void *end_token)
return;
}
- HAL_INFO (("devinfo_volume_force_unmount for udi='%s'", d->udi));
+ HAL_INFO (("devinfo_volume_force_unmount for udi='%s'", hal_device_get_udi (d)));
unmount_stdin = "\n";
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_storage.h b/usr/src/cmd/hal/hald/solaris/devinfo_storage.h
index eb741c1896..67a0c3228b 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_storage.h
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_storage.h
@@ -18,6 +18,7 @@
extern DevinfoDevHandler devinfo_ide_handler;
extern DevinfoDevHandler devinfo_scsi_handler;
+extern DevinfoDevHandler devinfo_pcata_handler;
extern DevinfoDevHandler devinfo_floppy_handler;
extern DevinfoDevHandler devinfo_lofi_handler;
diff --git a/usr/src/cmd/hal/hald/solaris/devinfo_usb.c b/usr/src/cmd/hal/hald/solaris/devinfo_usb.c
index f6eec0543c..b2b5f0e9b7 100644
--- a/usr/src/cmd/hal/hald/solaris/devinfo_usb.c
+++ b/usr/src/cmd/hal/hald/solaris/devinfo_usb.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <string.h>
#include <libdevinfo.h>
@@ -116,7 +120,7 @@ devinfo_usb_if_add(HalDevice *parent, di_node_t node, gchar *devfs_path, int ifn
hal_device_property_set_string (d, "info.bus", "usb");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s_if%d", parent->udi, ifnum);
+ "%s_if%d", hal_device_get_udi (parent), ifnum);
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
hal_device_property_set_string (d, "info.product", "USB Device Interface");
@@ -206,7 +210,7 @@ devinfo_usb_scsa2usb_add(HalDevice *usbd, di_node_t node, gchar *devfs_path)
hal_device_property_set_int (d, "scsi_host.host", 0);
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
- "%s/scsi_host%d", usbd->udi,
+ "%s/scsi_host%d", hal_device_get_udi (usbd),
hal_device_property_get_int (d, "scsi_host.host"));
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.udi", udi);
diff --git a/usr/src/cmd/hal/hald/solaris/hotplug.c b/usr/src/cmd/hal/hald/solaris/hotplug.c
index c6072469d8..9ccf7b56cc 100644
--- a/usr/src/cmd/hal/hald/solaris/hotplug.c
+++ b/usr/src/cmd/hal/hald/solaris/hotplug.c
@@ -86,10 +86,10 @@ hotplug_event_begin_devfs_add (HotplugEvent *hotplug_event, HalDevice *d)
}
/* children of ignored parent should be ignored */
- if (hal_device_property_get_bool (parent, "info.ignore")) {
+ if (parent != NULL && hal_device_property_get_bool (parent, "info.ignore")) {
HAL_INFO (("parent ignored %s", parent_udi));
- hotplug_event_end ((void *) hotplug_event);
- return;
+ hotplug_event_end ((void *) hotplug_event);
+ return;
}
/* custom or generic add function */
@@ -111,7 +111,7 @@ hotplug_event_begin_devfs_remove (HotplugEvent *hotplug_event, HalDevice *d)
hotplug_event_end ((void *) hotplug_event);
return;
}
- HAL_INFO (("hotplug_event_begin_devfs_remove %s", d->udi));
+ HAL_INFO (("hotplug_event_begin_devfs_remove %s", hal_device_get_udi (d)));
hotplug_event_begin_remove_devinfo(d,
hotplug_event->un.devfs.devfs_path,
diff --git a/usr/src/cmd/hal/hald/solaris/sysevent.c b/usr/src/cmd/hal/hald/solaris/sysevent.c
index 2d698d0841..54d398882f 100644
--- a/usr/src/cmd/hal/hald/solaris/sysevent.c
+++ b/usr/src/cmd/hal/hald/solaris/sysevent.c
@@ -11,6 +11,10 @@
#pragma ident "%Z%%M% %I% %E% SMI"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -275,7 +279,7 @@ sysevent_lofi_add(gchar *devfs_path, gchar *name)
return;
}
- HAL_INFO (("device %s parent %s", d->udi, parent_udi));
+ HAL_INFO (("device %s parent %s", hal_device_get_udi (d), parent_udi));
devinfo_lofi_add_major (parent, node, devfs_path, NULL, TRUE, d);
di_fini (node);
diff --git a/usr/src/cmd/hal/probing/storage/probe-storage.c b/usr/src/cmd/hal/probing/storage/probe-storage.c
index 0783adbf82..f15e49c8cb 100644
--- a/usr/src/cmd/hal/probing/storage/probe-storage.c
+++ b/usr/src/cmd/hal/probing/storage/probe-storage.c
@@ -334,7 +334,6 @@ main (int argc, char *argv[])
char *raw_device_file;
LibHalContext *ctx = NULL;
DBusError error;
- char *bus;
char *drive_type;
dbus_bool_t is_cdrom;
dbus_bool_t is_floppy;
@@ -359,8 +358,6 @@ main (int argc, char *argv[])
goto out;
if ((raw_device_file = getenv ("HAL_PROP_BLOCK_SOLARIS_RAW_DEVICE")) == NULL)
goto out;
- if ((bus = getenv ("HAL_PROP_STORAGE_BUS")) == NULL)
- goto out;
if ((drive_type = getenv ("HAL_PROP_STORAGE_DRIVE_TYPE")) == NULL)
goto out;
@@ -385,8 +382,8 @@ main (int argc, char *argv[])
goto out;
}
- HAL_DEBUG (("Doing probe-storage for %s (bus %s) (drive_type %s) (udi=%s) (--only-check-for-media==%d)",
- device_file, bus, drive_type, udi, only_check_for_media));
+ HAL_DEBUG (("Doing probe-storage for %s (drive_type %s) (udi=%s) (--only-check-for-media==%d)",
+ device_file, drive_type, udi, only_check_for_media));
if ((rfd = open (raw_device_file, O_RDONLY | O_NONBLOCK)) < 0) {
HAL_DEBUG (("Cannot open %s: %s", raw_device_file, strerror (errno)));
diff --git a/usr/src/pkgdefs/SUNWhalr/postinstall b/usr/src/pkgdefs/SUNWhalr/postinstall
index 377cc97d7a..45395706a7 100644
--- a/usr/src/pkgdefs/SUNWhalr/postinstall
+++ b/usr/src/pkgdefs/SUNWhalr/postinstall
@@ -30,17 +30,14 @@
# be it enabled or disabled.
if [ -f $PKG_INSTALL_ROOT/var/tmp/hal_installed.tmp ]; then
rm -f $PKG_INSTALL_ROOT/var/tmp/hal_installed.tmp
+elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
+ # live system
+ /usr/sbin/svcadm enable svc:/system/hal:default
else
- # enable HAL only in global zone
- if [ "$UPDATE" = yes ]; then
- # upgrade
- cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
- /usr/sbin/svcadm enable svc:/system/hal:default
-EOF
- elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
- # live system
- /usr/sbin/svcadm enable svc:/system/hal:default
- fi
+ # upgrade
+ cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
+ /usr/sbin/svcadm enable svc:/system/hal:default
+ EOF
fi
exit 0
diff --git a/usr/src/pkgdefs/SUNWrmvolmgrr/postinstall b/usr/src/pkgdefs/SUNWrmvolmgrr/postinstall
index 2aad094792..7b8bdfb025 100644
--- a/usr/src/pkgdefs/SUNWrmvolmgrr/postinstall
+++ b/usr/src/pkgdefs/SUNWrmvolmgrr/postinstall
@@ -30,16 +30,14 @@
# be it enabled or disabled.
if [ -f $PKG_INSTALL_ROOT/var/tmp/rmvolmgr_installed.tmp ]; then
rm -f $PKG_INSTALL_ROOT/var/tmp/rmvolmgr_installed.tmp
+elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
+ # live system
+ /usr/sbin/svcadm enable svc:/system/filesystem/rmvolmgr:default
else
- if [ "$UPDATE" = yes ]; then
- # upgrade
- cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
- /usr/sbin/svcadm enable svc:/system/filesystem/rmvolmgr:default
-EOF
- elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
- # live system
- /usr/sbin/svcadm enable svc:/system/filesystem/rmvolmgr:default
- fi
+ # upgrade
+ cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
+ /usr/sbin/svcadm enable svc:/system/filesystem/rmvolmgr:default
+ EOF
fi
exit 0
diff --git a/usr/src/pkgdefs/SUNWsmediar/postinstall b/usr/src/pkgdefs/SUNWsmediar/postinstall
index 1f6acc1e1c..b5c7e97f2b 100644
--- a/usr/src/pkgdefs/SUNWsmediar/postinstall
+++ b/usr/src/pkgdefs/SUNWsmediar/postinstall
@@ -30,21 +30,23 @@
# be it enabled or disabled.
if [ -f $PKG_INSTALL_ROOT/var/tmp/smserver_installed.tmp ]; then
rm -f $PKG_INSTALL_ROOT/var/tmp/smserver_installed.tmp
+elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
+ # live system
+ if [ -z "$SUNW_PKG_INSTALL_ZONENAME" -o "$SUNW_PKG_INSTALL_ZONENAME" = "global" ]; then
+ /usr/sbin/svcadm enable svc:/network/rpc/smserver:default
+ fi
else
- # enable only in global zone
- if [ "$UPDATE" = yes ]; then
- # upgrade
- cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
- if [ \`/sbin/zonename\` = global ]; then
- /usr/sbin/svcadm enable svc:/network/rpc/smserver:default
- fi
-EOF
- elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
- # live system
- if [ -z "$SUNW_PKG_INSTALL_ZONENAME" -o "$SUNW_PKG_INSTALL_ZONENAME" = "global" ]; then
- /usr/sbin/svcadm enable svc:/network/rpc/smserver:default
- fi
+ # upgrade
+ cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
+ if [ \`/sbin/zonename\` = global ]; then
+ /usr/sbin/svcadm enable svc:/network/rpc/smserver:default
fi
+
+ # This works around the problem of legacy volfs service removal
+ # until r.manifest is fixed to work on alternate pkg root.
+ # SUNWsmediar was chosen because it replaces SUNWvolr in pkghistory.
+ /usr/sbin/svccfg delete -f svc:/system/filesystem/volfs
+ EOF
fi
exit 0