Index: bootadm/usr/src/cmd/boot/bootadm/Makefile =================================================================== --- bootadm.orig/usr/src/cmd/boot/bootadm/Makefile 2012-12-29 21:54:13.808947514 +0400 +++ bootadm/usr/src/cmd/boot/bootadm/Makefile 2012-12-29 22:14:02.412091491 +0400 @@ -36,7 +36,7 @@ .KEEP_STATE: LDLIBS_i386= -lfdisk -LDLIBS += -lnvpair -lgen -lefi -lscf -lz $(LDLIBS_$(MACH)) +LDLIBS += -lnvpair -lgen -lefi -lz $(LDLIBS_$(MACH)) # Writing into string literals is incorrect. We need to match gcc's # behavior, which causes us to take SIGSEGV on such a write. Index: bootadm/usr/src/cmd/boot/bootadm/bootadm.c =================================================================== --- bootadm.orig/usr/src/cmd/boot/bootadm/bootadm.c 2012-12-29 21:55:04.332345403 +0400 +++ bootadm/usr/src/cmd/boot/bootadm/bootadm.c 2012-12-29 22:13:48.635223338 +0400 @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -7370,92 +7369,6 @@ return (0); } -/* - * Certain services needed to run metastat successfully may not - * be enabled. Enable them now. - */ -/* - * Checks if the specified service is online - * Returns: 1 if the service is online - * 0 if the service is not online - * -1 on error - */ -static int -is_svc_online(char *svc) -{ - char *state; - const char *fcn = "is_svc_online()"; - - BAM_DPRINTF((D_FUNC_ENTRY1, fcn, svc)); - - state = smf_get_state(svc); - INJECT_ERROR2("GET_SVC_STATE", free(state), state = NULL); - if (state == NULL) { - bam_error(GET_SVC_STATE_ERR, svc); - return (-1); - } - BAM_DPRINTF((D_GOT_SVC_STATUS, fcn, svc)); - - if (strcmp(state, SCF_STATE_STRING_ONLINE) == 0) { - BAM_DPRINTF((D_SVC_ONLINE, fcn, svc)); - free(state); - return (1); - } - - BAM_DPRINTF((D_SVC_NOT_ONLINE, fcn, state, svc)); - - free(state); - - return (0); -} - -static int -enable_svc(char *svc) -{ - int ret; - int sleeptime; - const char *fcn = "enable_svc()"; - - ret = is_svc_online(svc); - if (ret == -1) { - bam_error(SVC_IS_ONLINE_FAILED, svc); - return (-1); - } else if (ret == 1) { - BAM_DPRINTF((D_SVC_ALREADY_ONLINE, fcn, svc)); - return (0); - } - - /* Service is not enabled. Enable it now. */ - ret = smf_enable_instance(svc, 0); - INJECT_ERROR1("ENABLE_SVC_FAILED", ret = -1); - if (ret != 0) { - bam_error(ENABLE_SVC_FAILED, svc); - return (-1); - } - - BAM_DPRINTF((D_SVC_ONLINE_INITIATED, fcn, svc)); - - sleeptime = 0; - do { - ret = is_svc_online(svc); - INJECT_ERROR1("SVC_ONLINE_SUCCESS", ret = 1); - INJECT_ERROR1("SVC_ONLINE_FAILURE", ret = -1); - INJECT_ERROR1("SVC_ONLINE_NOTYET", ret = 0); - if (ret == -1) { - bam_error(ERR_SVC_GET_ONLINE, svc); - return (-1); - } else if (ret == 1) { - BAM_DPRINTF((D_SVC_NOW_ONLINE, fcn, svc)); - return (1); - } - (void) sleep(1); - } while (++sleeptime < 60); - - bam_error(TIMEOUT_ENABLE_SVC, svc); - - return (-1); -} - static int ufs_get_physical(char *special, char ***physarray, int *n) { @@ -7495,11 +7408,6 @@ BAM_DPRINTF((D_UFS_SVM_SHORT, fcn, special, shortname)); - svc = "network/rpc/meta:default"; - if (enable_svc(svc) == -1) { - bam_error(UFS_SVM_METASTAT_SVC_ERR, svc); - } - (void) snprintf(cmd, sizeof (cmd), "/sbin/metastat -p %s", shortname); ret = exec_cmd(cmd, &flist);