118c2aff7Sartem /***************************************************************************
218c2aff7Sartem  *
318c2aff7Sartem  * devinfo_storage.c : storage devices
418c2aff7Sartem  *
53f7d54a6SGarrett D'Amore  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
6506aa7c6SGarrett D'Amore  * Copyright 2013 Garrett D'Amore <garrett@damore.org>
718c2aff7Sartem  *
818c2aff7Sartem  * Licensed under the Academic Free License version 2.1
918c2aff7Sartem  *
1018c2aff7Sartem  **************************************************************************/
1118c2aff7Sartem 
1200687e57Sartem #ifdef HAVE_CONFIG_H
1300687e57Sartem #  include <config.h>
1400687e57Sartem #endif
1500687e57Sartem 
1618c2aff7Sartem #include <stdio.h>
1718c2aff7Sartem #include <string.h>
1818c2aff7Sartem #include <strings.h>
1918c2aff7Sartem #include <ctype.h>
2018c2aff7Sartem #include <libdevinfo.h>
2118c2aff7Sartem #include <sys/types.h>
2218c2aff7Sartem #include <sys/mkdev.h>
2318c2aff7Sartem #include <sys/stat.h>
2418c2aff7Sartem #include <sys/mntent.h>
2518c2aff7Sartem #include <sys/mnttab.h>
2618c2aff7Sartem 
2718c2aff7Sartem #include "../osspec.h"
2818c2aff7Sartem #include "../logger.h"
2918c2aff7Sartem #include "../hald.h"
3018c2aff7Sartem #include "../hald_dbus.h"
3118c2aff7Sartem #include "../device_info.h"
3218c2aff7Sartem #include "../util.h"
3318c2aff7Sartem #include "../hald_runner.h"
3418c2aff7Sartem #include "hotplug.h"
3518c2aff7Sartem #include "devinfo.h"
3618c2aff7Sartem #include "devinfo_misc.h"
3718c2aff7Sartem #include "devinfo_storage.h"
3818c2aff7Sartem #include "osspec_solaris.h"
3918c2aff7Sartem 
4018c2aff7Sartem #ifdef sparc
4118c2aff7Sartem #define	WHOLE_DISK	"s2"
4218c2aff7Sartem #else
4318c2aff7Sartem #define	WHOLE_DISK	"p0"
4418c2aff7Sartem #endif
4518c2aff7Sartem 
4618c2aff7Sartem /* some devices,especially CDROMs, may take a while to be probed (values in ms) */
4718c2aff7Sartem #define	DEVINFO_PROBE_STORAGE_TIMEOUT	60000
4818c2aff7Sartem #define	DEVINFO_PROBE_VOLUME_TIMEOUT	60000
4918c2aff7Sartem 
5018c2aff7Sartem typedef struct devinfo_storage_minor {
5118c2aff7Sartem 	char	*devpath;
5218c2aff7Sartem 	char	*devlink;
53