summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/src/cmd/halt/Makefile4
-rw-r--r--usr/src/cmd/halt/smf/boot-config.xml2
-rw-r--r--usr/src/lib/libc/amd64/mapfile-vers3
-rw-r--r--usr/src/lib/libc/amd64/sys/uadmin.c17
-rw-r--r--usr/src/lib/libc/i386/mapfile-vers3
-rw-r--r--usr/src/lib/libc/i386/sys/uadmin.c19
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com4
-rw-r--r--usr/src/lib/libc/sparc/mapfile-vers3
-rw-r--r--usr/src/lib/libc/sparc/sys/__uadmin.s (renamed from usr/src/lib/libc/sparc/sys/uadmin.s)32
-rw-r--r--usr/src/lib/libc/sparc/sys/uadmin.c59
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile.com1
-rw-r--r--usr/src/lib/libc/sparcv9/mapfile-vers3
-rw-r--r--usr/src/pkgdefs/SUNWcsr/prototype_com2
-rw-r--r--usr/src/pkgdefs/SUNWcsr/prototype_i3862
14 files changed, 128 insertions, 26 deletions
diff --git a/usr/src/cmd/halt/Makefile b/usr/src/cmd/halt/Makefile
index bc622af56c..9860d1f67a 100644
--- a/usr/src/cmd/halt/Makefile
+++ b/usr/src/cmd/halt/Makefile
@@ -29,8 +29,10 @@ include ../Makefile.cmd
#
# Currently Fast Reboot is only supported on x86.
+# A new propery config/uadmin_boot_archive_sync is added to
+# boot-config service. Which needs a support on sparc also.
#
-sparc_SUBDIRS =
+sparc_SUBDIRS = smf
i386_SUBDIRS = smf
SUBDIRS = $($(MACH)_SUBDIRS)
diff --git a/usr/src/cmd/halt/smf/boot-config.xml b/usr/src/cmd/halt/smf/boot-config.xml
index 45dccefd57..4d6ea6b4b9 100644
--- a/usr/src/cmd/halt/smf/boot-config.xml
+++ b/usr/src/cmd/halt/smf/boot-config.xml
@@ -96,6 +96,8 @@
value='true' />
<propval name='value_authorization' type='astring'
value='solaris.system.shutdown' />
+ <propval name='uadmin_boot_archive_sync' type='boolean'
+ value='false' />
</property_group>
<property_group name='fastreboot_blacklist' type='application'>
diff --git a/usr/src/lib/libc/amd64/mapfile-vers b/usr/src/lib/libc/amd64/mapfile-vers
index 7c759736c1..5d22678f31 100644
--- a/usr/src/lib/libc/amd64/mapfile-vers
+++ b/usr/src/lib/libc/amd64/mapfile-vers
@@ -92,6 +92,9 @@ SUNW_0.7 {
errno = NODIRECT;
free = NODIRECT;
frexp = FUNCTION FILTER libm.so.2;
+ scf_simple_prop_get = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_next_boolean = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_free = FUNCTION FILTER libscf.so.1;
getdate_err;
_getdate_err;
getenv;
diff --git a/usr/src/lib/libc/amd64/sys/uadmin.c b/usr/src/lib/libc/amd64/sys/uadmin.c
index 1038e81bb9..45c4d155f0 100644
--- a/usr/src/lib/libc/amd64/sys/uadmin.c
+++ b/usr/src/lib/libc/amd64/sys/uadmin.c
@@ -44,6 +44,7 @@
#include <strings.h>
#include <pthread.h>
#include <zone.h>
+#include <libscf.h>
static int
legal_arg(char *bargs)
@@ -68,6 +69,10 @@ uadmin(int cmd, int fcn, uintptr_t mdep)
char *bargs, cmdbuf[256];
struct stat sbuf;
char *altroot;
+ scf_simple_prop_t *prop = NULL;
+ uint8_t *ret_val = NULL;
+ boolean_t update_flag = B_FALSE;
+ char *fmri = "svc:/system/boot-config:default";
bargs = (char *)mdep;
@@ -159,6 +164,18 @@ uadmin(int cmd, int fcn, uintptr_t mdep)
}
(void) system(cmdbuf);
}
+
+ prop = scf_simple_prop_get(NULL, fmri, "config",
+ "uadmin_boot_archive_sync");
+ if (prop) {
+ if ((ret_val = scf_simple_prop_next_boolean(prop)) !=
+ NULL)
+ update_flag = (*ret_val == 0) ? B_FALSE :
+ B_TRUE;
+ scf_simple_prop_free(prop);
+ }
+ if (update_flag == B_TRUE)
+ (void) system("/sbin/bootadm update-archive");
}
return (__uadmin(cmd, fcn, mdep));
diff --git a/usr/src/lib/libc/i386/mapfile-vers b/usr/src/lib/libc/i386/mapfile-vers
index c54c1b3d14..2d2207e96b 100644
--- a/usr/src/lib/libc/i386/mapfile-vers
+++ b/usr/src/lib/libc/i386/mapfile-vers
@@ -273,6 +273,9 @@ SYSVABI_1.3 {
_fp_hw;
free = NODIRECT;
frexp = FUNCTION FILTER libm.so.2;
+ scf_simple_prop_get = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_next_boolean = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_free = FUNCTION FILTER libscf.so.1;
getdate_err;
_getdate_err;
getenv;
diff --git a/usr/src/lib/libc/i386/sys/uadmin.c b/usr/src/lib/libc/i386/sys/uadmin.c
index 1038e81bb9..0d25a23eb0 100644
--- a/usr/src/lib/libc/i386/sys/uadmin.c
+++ b/usr/src/lib/libc/i386/sys/uadmin.c
@@ -44,6 +44,7 @@
#include <strings.h>
#include <pthread.h>
#include <zone.h>
+#include <libscf.h>
static int
legal_arg(char *bargs)
@@ -68,6 +69,10 @@ uadmin(int cmd, int fcn, uintptr_t mdep)
char *bargs, cmdbuf[256];
struct stat sbuf;
char *altroot;
+ scf_simple_prop_t *prop = NULL;
+ uint8_t *ret_val = NULL;
+ boolean_t update_flag = B_FALSE;
+ char *fmri = "svc:/system/boot-config:default";
bargs = (char *)mdep;
@@ -159,7 +164,19 @@ uadmin(int cmd, int fcn, uintptr_t mdep)
}
(void) system(cmdbuf);
}
- }
+ prop = scf_simple_prop_get(NULL, fmri, "config",
+ "uadmin_boot_archive_sync");
+ if (prop) {
+ if ((ret_val = scf_simple_prop_next_boolean(prop)) !=
+ NULL)
+ update_flag = (*ret_val == 0) ? B_FALSE :
+ B_TRUE;
+ scf_simple_prop_free(prop);
+ }
+
+ if (update_flag == B_TRUE)
+ (void) system("/sbin/bootadm update-archive");
+ }
return (__uadmin(cmd, fcn, mdep));
}
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index 97dfd0acfd..810e34749f 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -329,6 +329,7 @@ SYSOBJS= \
__getcontext.o \
_lwp_mutex_unlock.o \
_stack_grow.o \
+ __uadmin.o \
door.o \
forkx.o \
forkallx.o \
@@ -1078,7 +1079,8 @@ SRCS= \
$(LIBCBASE)/gen/siginfolst.c \
$(LIBCBASE)/gen/siglongjmp.c \
$(LIBCBASE)/gen/swapctxt.c \
- $(LIBCBASE)/sys/ptrace.c
+ $(LIBCBASE)/sys/ptrace.c \
+ $(LIBCBASE)/sys/uadmin.c
# conditional assignments
$(DYNLIB) := CRTI = crti.o
diff --git a/usr/src/lib/libc/sparc/mapfile-vers b/usr/src/lib/libc/sparc/mapfile-vers
index fa441961d4..0e654b6588 100644
--- a/usr/src/lib/libc/sparc/mapfile-vers
+++ b/usr/src/lib/libc/sparc/mapfile-vers
@@ -310,6 +310,9 @@ SYSVABI_1.3 {
_environ = NODIRECT;
free = NODIRECT;
frexp = FUNCTION FILTER libm.so.2;
+ scf_simple_prop_get = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_next_boolean = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_free = FUNCTION FILTER libscf.so.1;
getdate_err;
_getdate_err;
getenv;
diff --git a/usr/src/lib/libc/sparc/sys/uadmin.s b/usr/src/lib/libc/sparc/sys/__uadmin.s
index 772bcb6ce6..66fef18d66 100644
--- a/usr/src/lib/libc/sparc/sys/uadmin.s
+++ b/usr/src/lib/libc/sparc/sys/__uadmin.s
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,26 +18,17 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
-
-
-/* Copyright (c) 1989 by Sun Microsystems, Inc. */
-
-.ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */
-
-/* C library -- uadmin */
-/* int uadmin (int cmd, int fcn, int mdep); */
-
- .file "uadmin.s"
-
-#include <sys/asm_linkage.h>
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
- ANSI_PRAGMA_WEAK(uadmin,function)
+ .file "__uadmin.s"
#include "SYS.h"
- SYSCALL(uadmin)
+ ENTRY(__uadmin)
+ SYSTRAP_RVAL1(uadmin)
+ SYSCERROR
RET
-
- SET_SIZE(uadmin)
+ SET_SIZE(__uadmin)
diff --git a/usr/src/lib/libc/sparc/sys/uadmin.c b/usr/src/lib/libc/sparc/sys/uadmin.c
new file mode 100644
index 0000000000..b5d034a2ea
--- /dev/null
+++ b/usr/src/lib/libc/sparc/sys/uadmin.c
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/types.h>
+#include <libscf.h>
+#include <sys/uadmin.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <zone.h>
+
+int
+uadmin(int cmd, int fcn, uintptr_t mdep)
+{
+ extern int __uadmin(int cmd, int fcn, uintptr_t mdep);
+ scf_simple_prop_t *prop = NULL;
+ uint8_t *ret_val = NULL;
+ boolean_t update_flag = B_FALSE;
+ char *fmri = "svc:/system/boot-config:default";
+
+ if (geteuid() == 0 && getzoneid() == GLOBAL_ZONEID &&
+ (cmd == A_SHUTDOWN || cmd == A_REBOOT)) {
+ prop = scf_simple_prop_get(NULL, fmri, "config",
+ "uadmin_boot_archive_sync");
+ if (prop) {
+ if ((ret_val = scf_simple_prop_next_boolean(prop)) !=
+ NULL)
+ update_flag = (*ret_val == 0) ? B_FALSE :
+ B_TRUE;
+ scf_simple_prop_free(prop);
+ }
+
+ if (update_flag == B_TRUE)
+ (void) system("/sbin/bootadm update-archive");
+ }
+
+ return (__uadmin(cmd, fcn, mdep));
+}
diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com
index ea78232f22..e77ac5368e 100644
--- a/usr/src/lib/libc/sparcv9/Makefile.com
+++ b/usr/src/lib/libc/sparcv9/Makefile.com
@@ -309,6 +309,7 @@ COMSYSOBJS= \
SYSOBJS= \
__clock_gettime.o \
__getcontext.o \
+ __uadmin.o \
_lwp_mutex_unlock.o \
_stack_grow.o \
door.o \
diff --git a/usr/src/lib/libc/sparcv9/mapfile-vers b/usr/src/lib/libc/sparcv9/mapfile-vers
index 41be7234d1..681deb1c9a 100644
--- a/usr/src/lib/libc/sparcv9/mapfile-vers
+++ b/usr/src/lib/libc/sparcv9/mapfile-vers
@@ -110,6 +110,9 @@ SUNW_0.7 {
errno = NODIRECT;
free = NODIRECT;
frexp = FUNCTION FILTER libm.so.2;
+ scf_simple_prop_get = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_next_boolean = FUNCTION FILTER libscf.so.1;
+ scf_simple_prop_free = FUNCTION FILTER libscf.so.1;
getdate_err;
_getdate_err;
getenv;
diff --git a/usr/src/pkgdefs/SUNWcsr/prototype_com b/usr/src/pkgdefs/SUNWcsr/prototype_com
index eb68e238bb..962c49fd1d 100644
--- a/usr/src/pkgdefs/SUNWcsr/prototype_com
+++ b/usr/src/pkgdefs/SUNWcsr/prototype_com
@@ -577,3 +577,5 @@ f none var/svc/profile/ns_none.xml 0444 root sys
f none var/svc/profile/platform_none.xml 0444 root sys
f none var/svc/profile/prophist.SUNWcsr 0444 root sys
d none var/tmp 1777 root sys
+f none lib/svc/method/svc-boot-config 0555 root bin
+f manifest var/svc/manifest/system/boot-config.xml 0444 root sys
diff --git a/usr/src/pkgdefs/SUNWcsr/prototype_i386 b/usr/src/pkgdefs/SUNWcsr/prototype_i386
index d6de6ce08a..87539f8154 100644
--- a/usr/src/pkgdefs/SUNWcsr/prototype_i386
+++ b/usr/src/pkgdefs/SUNWcsr/prototype_i386
@@ -44,11 +44,9 @@
#
# SUNWcsr
#
-f none lib/svc/method/svc-boot-config 0555 root bin
f none lib/svc/method/svc-hostid 0555 root bin
f none sbin/biosdev 555 root bin
f none sbin/installgrub 0555 root sys
d none var/ld/amd64 755 root bin
s none var/ld/64=amd64
f manifest var/svc/manifest/system/hostid.xml 0444 root sys
-f manifest var/svc/manifest/system/boot-config.xml 0444 root sys