summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os
diff options
context:
space:
mode:
authorsetje <none@none>2007-12-07 16:04:33 -0800
committersetje <none@none>2007-12-07 16:04:33 -0800
commit986fd29a0dc13f7608ef7f508f6e700bd7bc2720 (patch)
tree8612567367832542a32a2c8bbf3b9b7ef7639ab7 /usr/src/uts/common/os
parentf3b585ce799a83688c5532c430f6133f098431c2 (diff)
downloadillumos-joyent-986fd29a0dc13f7608ef7f508f6e700bd7bc2720.tar.gz
6521412 PSARC 2006/525: new boot sparc
6451467 bootadm update-archive does the wrong thing if interrupted 6477079 ability to pick up post bfu binaries from bfu PATH conflicts with sane scripting --HG-- rename : usr/src/psm/stand/boot/sparc/common/boot.c => deleted_files/usr/src/psm/stand/boot/sparc/common/boot.c rename : usr/src/psm/stand/boot/sparc/common/boot_services.c => deleted_files/usr/src/psm/stand/boot/sparc/common/boot_services.c rename : usr/src/psm/stand/boot/sparc/common/hsfsconf.c => deleted_files/usr/src/psm/stand/boot/sparc/common/hsfsconf.c rename : usr/src/psm/stand/boot/sparc/common/ufsconf.c => deleted_files/usr/src/psm/stand/boot/sparc/common/ufsconf.c rename : usr/src/psm/stand/bootblks/Makefile.obp => deleted_files/usr/src/psm/stand/bootblks/Makefile.obp rename : usr/src/psm/stand/bootblks/hsfs/common/Makefile.com => deleted_files/usr/src/psm/stand/bootblks/hsfs/common/Makefile.com rename : usr/src/psm/stand/bootblks/hsfs/common/boot_obp.fth => deleted_files/usr/src/psm/stand/bootblks/hsfs/common/boot_obp.fth rename : usr/src/psm/stand/bootblks/hsfs/common/hsfs.c => deleted_files/usr/src/psm/stand/bootblks/hsfs/common/hsfs.c rename : usr/src/psm/stand/bootblks/hsfs/common/hsfs_sig.h => deleted_files/usr/src/psm/stand/bootblks/hsfs/common/hsfs_sig.h rename : usr/src/psm/stand/bootblks/hsfs/common/hsfs_small.c => deleted_files/usr/src/psm/stand/bootblks/hsfs/common/hsfs_small.c rename : usr/src/psm/stand/bootblks/hsfs/common/iob.h => deleted_files/usr/src/psm/stand/bootblks/hsfs/common/iob.h rename : usr/src/psm/stand/bootblks/hsfs/sparc/unix/Makefile => deleted_files/usr/src/psm/stand/bootblks/hsfs/sparc/unix/Makefile rename : usr/src/psm/stand/bootblks/obp-c/Makefile.rules => deleted_files/usr/src/psm/stand/bootblks/obp-c/Makefile.rules rename : usr/src/psm/stand/bootblks/obp-c/Makefile.targ => deleted_files/usr/src/psm/stand/bootblks/obp-c/Makefile.targ rename : usr/src/psm/stand/bootblks/obp-c/common/cbootblk.h => deleted_files/usr/src/psm/stand/bootblks/obp-c/common/cbootblk.h rename : usr/src/psm/stand/bootblks/obp-c/common/makevers.sh => deleted_files/usr/src/psm/stand/bootblks/obp-c/common/makevers.sh rename : usr/src/psm/stand/bootblks/obp-c/common/mkboot.c => deleted_files/usr/src/psm/stand/bootblks/obp-c/common/mkboot.c rename : usr/src/psm/stand/bootblks/obp-c/common/romp.h => deleted_files/usr/src/psm/stand/bootblks/obp-c/common/romp.h rename : usr/src/psm/stand/bootblks/obp-c/common/stub.c => deleted_files/usr/src/psm/stand/bootblks/obp-c/common/stub.c rename : usr/src/psm/stand/bootblks/obp-c/common/unix_devio.c => deleted_files/usr/src/psm/stand/bootblks/obp-c/common/unix_devio.c rename : usr/src/psm/stand/bootblks/obp-c/sparc/common/mapfile => deleted_files/usr/src/psm/stand/bootblks/obp-c/sparc/common/mapfile rename : usr/src/psm/stand/bootblks/obp-c/sparc/common/obp_srt0.s => deleted_files/usr/src/psm/stand/bootblks/obp-c/sparc/common/obp_srt0.s rename : usr/src/psm/stand/bootblks/ufs/common/Makefile.com => deleted_files/usr/src/psm/stand/bootblks/ufs/common/Makefile.com rename : usr/src/psm/stand/bootblks/ufs/common/boot_1275.fth => deleted_files/usr/src/psm/stand/bootblks/ufs/common/boot_1275.fth rename : usr/src/psm/stand/bootblks/ufs/common/boot_obp.fth => deleted_files/usr/src/psm/stand/bootblks/ufs/common/boot_obp.fth rename : usr/src/psm/stand/bootblks/ufs/common/iob.h => deleted_files/usr/src/psm/stand/bootblks/ufs/common/iob.h rename : usr/src/psm/stand/bootblks/ufs/common/ufs.c => deleted_files/usr/src/psm/stand/bootblks/ufs/common/ufs.c rename : usr/src/psm/stand/bootblks/ufs/sparc/sun4c/Makefile => deleted_files/usr/src/psm/stand/bootblks/ufs/sparc/sun4c/Makefile rename : usr/src/psm/stand/bootblks/ufs/sparc/sun4d/Makefile => deleted_files/usr/src/psm/stand/bootblks/ufs/sparc/sun4d/Makefile rename : usr/src/psm/stand/bootblks/ufs/sparc/sun4m/Makefile => deleted_files/usr/src/psm/stand/bootblks/ufs/sparc/sun4m/Makefile rename : usr/src/psm/stand/bootblks/ufs/sparc/unix/Makefile => deleted_files/usr/src/psm/stand/bootblks/ufs/sparc/unix/Makefile rename : usr/src/uts/sparc/krtld/Makefile => deleted_files/usr/src/uts/sparc/krtld/Makefile rename : usr/src/uts/sparc/krtld/kobj_alloc.c => deleted_files/usr/src/uts/sparc/krtld/kobj_alloc.c rename : usr/src/uts/sparc/krtld/kobj_boot.c => deleted_files/usr/src/uts/sparc/krtld/kobj_boot.c rename : usr/src/uts/sparc/krtld/kobj_crt.s => deleted_files/usr/src/uts/sparc/krtld/kobj_crt.s rename : usr/src/cmd/boot/bootadm/filelist.ramdisk => usr/src/cmd/boot/filelist/i386/filelist.ramdisk rename : usr/src/cmd/boot/bootadm/filelist.safe => usr/src/cmd/boot/filelist/i386/filelist.safe
Diffstat (limited to 'usr/src/uts/common/os')
-rw-r--r--usr/src/uts/common/os/autoconf.c2
-rw-r--r--usr/src/uts/common/os/instance.c16
-rw-r--r--usr/src/uts/common/os/modsysfile.c2
-rw-r--r--usr/src/uts/common/os/space.c27
-rw-r--r--usr/src/uts/common/os/swapgeneric.c60
-rw-r--r--usr/src/uts/common/os/vfs_conf.c1
6 files changed, 68 insertions, 40 deletions
diff --git a/usr/src/uts/common/os/autoconf.c b/usr/src/uts/common/os/autoconf.c
index 2adffdd7b0..0bd34a64a9 100644
--- a/usr/src/uts/common/os/autoconf.c
+++ b/usr/src/uts/common/os/autoconf.c
@@ -48,6 +48,7 @@
#include <sys/sysevent_impl.h>
#include <sys/sunldi_impl.h>
#include <sys/disp.h>
+#include <sys/bootconf.h>
#include <sys/fm/util.h>
extern dev_info_t *top_devinfo;
@@ -126,7 +127,6 @@ impl_create_root_class(void)
major_t major;
size_t size;
char *cp;
- extern struct bootops *bootops;
/*
* The name for the root nexus is exactly as the manufacturer
diff --git a/usr/src/uts/common/os/instance.c b/usr/src/uts/common/os/instance.c
index 08537f3372..7134d93c56 100644
--- a/usr/src/uts/common/os/instance.c
+++ b/usr/src/uts/common/os/instance.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -195,7 +195,7 @@ e_ddi_instance_init(void)
case PTI_REBUILD:
cmn_err(CE_CONT,
- "?Using default device instance data\n");
+ "?Using default device instance data\n");
break;
}
@@ -245,14 +245,14 @@ in_preassign_instance()
static int
in_get_infile(char *filename)
{
- intptr_t file;
+ struct _buf *file;
int return_val;
char buf[PTI_MAGIC_STR_LEN];
/*
* Try to open the file.
*/
- if ((file = kobj_open(filename)) == -1) {
+ if ((file = kobj_open_file(filename)) == (struct _buf *)-1) {
return (PTI_NOT_FOUND);
}
return_val = PTI_FOUND;
@@ -263,7 +263,7 @@ in_get_infile(char *filename)
* in the file, then assume file is correct and no magic string
* and move on.
*/
- switch (kobj_read(file, buf, PTI_MAGIC_STR_LEN, 0)) {
+ switch (kobj_read_file(file, buf, PTI_MAGIC_STR_LEN, 0)) {
case PTI_MAGIC_STR_LEN:
/*
@@ -285,7 +285,7 @@ in_get_infile(char *filename)
break;
}
- kobj_close(file);
+ kobj_close_file(file);
return (return_val);
}
@@ -1360,13 +1360,13 @@ i_log_devfs_instance_mod(void)
return;
ev = sysevent_alloc(EC_DEVFS, ESC_DEVFS_INSTANCE_MOD, EP_DDI,
- SE_NOSLEEP);
+ SE_NOSLEEP);
if (ev == NULL) {
return;
}
if (log_sysevent(ev, SE_NOSLEEP, &eid) != 0) {
cmn_err(CE_WARN, "i_log_devfs_instance_mod: failed to post "
- "event");
+ "event");
} else {
sent_one = 1;
}
diff --git a/usr/src/uts/common/os/modsysfile.c b/usr/src/uts/common/os/modsysfile.c
index 07076f02dd..5ba026e22e 100644
--- a/usr/src/uts/common/os/modsysfile.c
+++ b/usr/src/uts/common/os/modsysfile.c
@@ -64,7 +64,7 @@ static char class_file[] = CLASSFILE;
static char dafile[] = DAFILE;
static char dacffile[] = DACFFILE;
-char *systemfile = "etc/system"; /* name of ascii system file */
+char *systemfile = "/etc/system"; /* name of ascii system file */
static struct sysparam *sysparam_hd; /* head of parameters list */
static struct sysparam *sysparam_tl; /* tail of parameters list */
diff --git a/usr/src/uts/common/os/space.c b/usr/src/uts/common/os/space.c
index d21630cb22..08384fab47 100644
--- a/usr/src/uts/common/os/space.c
+++ b/usr/src/uts/common/os/space.c
@@ -106,15 +106,12 @@ struct var v;
*/
struct vnode *rootvp; /* vnode of the root device */
dev_t rootdev; /* dev_t of the root device */
-int root_is_svm; /* root is a mirrored device flag */
-
-int netboot;
-int obpdebug;
-char *dhcack; /* Used to cache ascii form of DHCPACK handed up by boot */
-char *netdev_path; /* Used to cache the netdev_path handed up by boot */
+boolean_t root_is_svm; /* root is a mirrored device flag */
+boolean_t root_is_ramdisk; /* root is ramdisk */
+uint32_t ramdisk_size; /* (KB) currently set only for sparc netboots */
/*
- * Data from arp.c that must be resident.
+ * dhcp
*/
#include <sys/socket.h>
#include <sys/errno.h>
@@ -123,6 +120,17 @@ char *netdev_path; /* Used to cache the netdev_path handed up by boot */
#include <sys/stropts.h>
#include <sys/dlpi.h>
#include <net/if.h>
+
+int netboot;
+int obpdebug;
+char *dhcack; /* dhcp response packet */
+int dhcacklen;
+char *netdev_path; /* Used to cache the netdev_path handed up by boot */
+char dhcifname[IFNAMSIZ];
+
+/*
+ * Data from arp.c that must be resident.
+ */
#include <net/if_arp.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
@@ -130,6 +138,7 @@ char *netdev_path; /* Used to cache the netdev_path handed up by boot */
ether_addr_t etherbroadcastaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
/*
* Data from timod that must be resident
*/
@@ -260,7 +269,7 @@ static void
store_fetch_initspace()
{
space_hash = mod_hash_create_strhash(space_hash_name,
- space_hash_nchains, mod_hash_null_valdtor);
+ space_hash_nchains, mod_hash_null_valdtor);
ASSERT(space_hash);
}
@@ -288,7 +297,7 @@ space_store(char *key, uintptr_t ptr)
bcopy(key, s, l);
rval = mod_hash_insert(space_hash,
- (mod_hash_key_t)s, (mod_hash_val_t)ptr);
+ (mod_hash_key_t)s, (mod_hash_val_t)ptr);
switch (rval) {
case 0:
diff --git a/usr/src/uts/common/os/swapgeneric.c b/usr/src/uts/common/os/swapgeneric.c
index 23fe002d2f..33ce90b489 100644
--- a/usr/src/uts/common/os/swapgeneric.c
+++ b/usr/src/uts/common/os/swapgeneric.c
@@ -91,7 +91,7 @@ static boolean_t netboot_over_ib(char *bootpath);
* Module linkage information for the kernel.
*/
static struct modlmisc modlmisc = {
- &mod_miscops, "root and swap configuration %I%"
+ &mod_miscops, "root and swap configuration"
};
static struct modlinkage modlinkage = {
@@ -308,7 +308,7 @@ loadrootmodules(void)
char *name;
int err;
/* ONC_PLUS EXTRACT END */
- int i, proplen, dhcacklen;
+ int i, proplen;
extern char *impl_module_list[];
extern char *platform_module_list[];
@@ -415,23 +415,19 @@ loop:
* ("bootp-response" boot property exists). If so, then before
* bootops disappears we need to save the value of this property
* such that the userland dhcpagent can adopt the DHCP management
- * of our primary network interface. We leave room at the beginning of
- * saved property to cache the interface name we used to boot the
- * client. This context is necessary for the user land dhcpagent
- * to do its job properly on a multi-homed system.
+ * of our primary network interface.
*/
proplen = BOP_GETPROPLEN(bootops, "bootp-response");
if (proplen > 0) {
- dhcacklen = proplen + IFNAMSIZ;
- dhcack = kmem_zalloc(dhcacklen, KM_SLEEP);
- if (BOP_GETPROP(bootops, "bootp-response",
- (uchar_t *)&dhcack[IFNAMSIZ]) == -1) {
+ dhcack = kmem_zalloc(proplen, KM_SLEEP);
+ if (BOP_GETPROP(bootops, "bootp-response", dhcack) == -1) {
cmn_err(CE_WARN, "BOP_GETPROP of "
"\"bootp-response\" failed\n");
kmem_free(dhcack, dhcacklen);
dhcack = NULL;
goto out;
}
+ dhcacklen = proplen;
/*
* Fetch the "netdev-path" boot property (if it exists), and
@@ -522,6 +518,36 @@ out:
}
/* ONC_PLUS EXTRACT END */
+static int
+get_bootpath_prop(char *bootpath)
+{
+ if (root_is_ramdisk) {
+ if (BOP_GETPROP(bootops, "bootarchive", bootpath) == -1)
+ return (-1);
+ (void) strlcat(bootpath, ":a", BO_MAXOBJNAME);
+ } else {
+ /*
+ * Look for the 1275 compliant name 'bootpath' first,
+ * but make certain it has a non-NULL value as well.
+ */
+ if ((BOP_GETPROP(bootops, "bootpath", bootpath) == -1) ||
+ strlen(bootpath) == 0) {
+ if (BOP_GETPROP(bootops,
+ "boot-path", bootpath) == -1)
+ return (-1);
+ }
+ }
+ return (0);
+}
+
+static int
+get_fstype_prop(char *fstype)
+{
+ char *prop = (root_is_ramdisk) ? "archive-fstype" : "fstype";
+
+ return (BOP_GETPROP(bootops, prop, fstype));
+}
+
/*
* Get the name of the root or swap filesystem type, and return
* the corresponding entry in the vfs switch.
@@ -558,7 +584,7 @@ getfstype(char *askfor, char *fsname, size_t fsnamelen)
int root = 0;
if (strcmp(askfor, "root") == 0) {
- (void) BOP_GETPROP(bootops, "fstype", defaultfs);
+ (void) get_fstype_prop(defaultfs);
root++;
} else {
(void) strcpy(defaultfs, "swapfs");
@@ -628,16 +654,8 @@ getphysdev(char *askfor, char *name, size_t namelen)
* ease-of-use ..
*/
if (strcmp(askfor, "root") == 0) {
- /*
- * Look for the 1275 compliant name 'bootpath' first,
- * but make certain it has a non-NULL value as well.
- */
- if ((BOP_GETPROP(bootops, "bootpath", defaultpath) == -1) ||
- strlen(defaultpath) == 0) {
- if (BOP_GETPROP(bootops,
- "boot-path", defaultpath) == -1)
- boothowto |= RB_ASKNAME | RB_VERBOSE;
- }
+ if (get_bootpath_prop(defaultpath) == -1)
+ boothowto |= RB_ASKNAME | RB_VERBOSE;
} else {
(void) strcpy(defaultpath, rootfs.bo_name);
defaultpath[strlen(defaultpath) - 1] = 'b';
diff --git a/usr/src/uts/common/os/vfs_conf.c b/usr/src/uts/common/os/vfs_conf.c
index fec5cc998f..b15c834fbe 100644
--- a/usr/src/uts/common/os/vfs_conf.c
+++ b/usr/src/uts/common/os/vfs_conf.c
@@ -80,6 +80,7 @@ struct vfssw vfssw[] = {
{ "ctfs" }, /* CONTRACTFS */
{ "objfs" }, /* OBJFS */
{ "sharefs" }, /* SHAREFS */
+ { "dcfs" }, /* DCFS */
{ "" }, /* reserved for loadable fs */
{ "" },
{ "" },