diff options
author | setje <none@none> | 2008-05-08 13:25:47 -0700 |
---|---|---|
committer | setje <none@none> | 2008-05-08 13:25:47 -0700 |
commit | 7975540170826a816320fa0cf07ba06a66c4252d (patch) | |
tree | c37674a0851161d8d9dab34f6ef28d84279c84bc | |
parent | 63c99f9316851ebfab1e6d91ff1807739e55bd5b (diff) | |
download | illumos-joyent-7975540170826a816320fa0cf07ba06a66c4252d.tar.gz |
6654900 prtconf retreives non ascii character that attachs to the machine type
6667053 pse array size calculation is broken by newboot putback
6668123 archive creation should not be limited to sun4u and sun4v
6673009 Solaris does not boot with SUNW,Netra-T5440 platform path anymore after new boot putback in snv_80
6698810 kobj_open()'ing tiny compressed files results in corrupt data
-rw-r--r-- | usr/src/cmd/boot/bootadm/bootadm.c | 74 | ||||
-rw-r--r-- | usr/src/cmd/boot/bootadm/bootadm.h | 4 | ||||
-rw-r--r-- | usr/src/cmd/boot/filelist/sparc/filelist.ramdisk | 73 | ||||
-rw-r--r-- | usr/src/cmd/boot/scripts/extract_boot_filelist.ksh | 46 | ||||
-rw-r--r-- | usr/src/uts/common/krtld/kobj.c | 2 | ||||
-rw-r--r-- | usr/src/uts/common/os/autoconf.c | 10 | ||||
-rw-r--r-- | usr/src/uts/sun4/os/startup.c | 2 |
7 files changed, 79 insertions, 132 deletions
diff --git a/usr/src/cmd/boot/bootadm/bootadm.c b/usr/src/cmd/boot/bootadm/bootadm.c index af3b2c5c5c..b5f223cec9 100644 --- a/usr/src/cmd/boot/bootadm/bootadm.c +++ b/usr/src/cmd/boot/bootadm/bootadm.c @@ -269,8 +269,7 @@ static int is_zfs(char *root); static int is_ufs(char *root); static int is_pcfs(char *root); static int is_amd64(void); -static int is_sun4u(void); -static int is_sun4v(void); +static char *get_machine(void); static void append_to_flist(filelist_t *, char *); static char *mount_top_dataset(char *pool, zfs_mnted_t *mnted); static int umount_top_dataset(char *pool, zfs_mnted_t mnted, char *mntpt); @@ -1359,12 +1358,9 @@ check_flags_and_files(char *root) /* * If archive is missing, create archive */ - if (is_sun4u()) { - (void) snprintf(path, sizeof (path), "%s%s", root, - SUN4U_ARCHIVE); - } else if (is_sun4v()) { - (void) snprintf(path, sizeof (path), "%s%s", root, - SUN4V_ARCHIVE); + if (is_sparc()) { + (void) snprintf(path, sizeof (path), "%s%s%s%s", root, + ARCHIVE_PREFIX, get_machine(), ARCHIVE_SUFFIX); } else { if (bam_direct == BAM_DIRECT_DBOOT) { (void) snprintf(path, sizeof (path), "%s%s", root, @@ -7521,60 +7517,52 @@ is_amd64(void) return (amd64); } -static int -is_sun4u(void) +static char * +get_machine(void) { - static int sun4u = -1; - char mbuf[257]; /* from sysinfo(2) manpage */ + static int cached = -1; + static char mbuf[257]; /* from sysinfo(2) manpage */ - if (sun4u != -1) - return (sun4u); + if (cached == 0) + return (mbuf); if (bam_alt_platform) { - if (strcmp(bam_platform, "sun4u") == 0) { - sun4u = 1; - } + return (bam_platform); } else { - if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0 && - strncmp(mbuf, "sun4u", strlen("sun4u")) == 0) { - sun4u = 1; + if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0) { + cached = 1; } } - if (sun4u == -1) - sun4u = 0; + if (cached == -1) { + mbuf[0] = '\0'; + cached = 0; + } - return (sun4u); + return (mbuf); } -static int -is_sun4v(void) +int +is_sparc(void) { - static int sun4v = -1; + static int issparc = -1; char mbuf[257]; /* from sysinfo(2) manpage */ - if (sun4v != -1) - return (sun4v); + if (issparc != -1) + return (issparc); if (bam_alt_platform) { - if (strcmp(bam_platform, "sun4v") == 0) { - sun4v = 1; + if (strncmp(bam_platform, "sun4", 4) == 0) { + issparc = 1; } } else { - if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0 && - strncmp(mbuf, "sun4v", strlen("sun4v")) == 0) { - sun4v = 1; - } + if (sysinfo(SI_ARCHITECTURE, mbuf, sizeof (mbuf)) > 0 && + strcmp(mbuf, "sparc") == 0) + issparc = 1; + else + issparc = 0; } - if (sun4v == -1) - sun4v = 0; - - return (sun4v); -} -int -is_sparc(void) -{ - return (is_sun4u() || is_sun4v()); + return (issparc); } static void diff --git a/usr/src/cmd/boot/bootadm/bootadm.h b/usr/src/cmd/boot/bootadm/bootadm.h index 94279ff771..a92c310397 100644 --- a/usr/src/cmd/boot/bootadm/bootadm.h +++ b/usr/src/cmd/boot/bootadm/bootadm.h @@ -222,8 +222,8 @@ extern int is_sparc(void); #define XEN_KERNEL_SUBSTR "xen.gz" /* Boot archives */ -#define SUN4U_ARCHIVE "/platform/sun4u/boot_archive" -#define SUN4V_ARCHIVE "/platform/sun4v/boot_archive" +#define ARCHIVE_PREFIX "/platform/" +#define ARCHIVE_SUFFIX "/boot_archive" #define DIRECT_BOOT_ARCHIVE "/platform/i86pc/$ISADIR/boot_archive" #define DIRECT_BOOT_ARCHIVE_32 "/platform/i86pc/boot_archive" #define DIRECT_BOOT_ARCHIVE_64 "/platform/i86pc/amd64/boot_archive" diff --git a/usr/src/cmd/boot/filelist/sparc/filelist.ramdisk b/usr/src/cmd/boot/filelist/sparc/filelist.ramdisk index e1db3353ed..b99c4ccaa0 100644 --- a/usr/src/cmd/boot/filelist/sparc/filelist.ramdisk +++ b/usr/src/cmd/boot/filelist/sparc/filelist.ramdisk @@ -2,75 +2,4 @@ etc/cluster/nodeid etc/dacf.conf etc/mach kernel -platform/SUNW,A70/kernel -platform/SUNW,Netra-210 -platform/SUNW,Netra-210/kernel -platform/SUNW,Netra-240 -platform/SUNW,Netra-240/kernel -platform/SUNW,Netra-440 -platform/SUNW,Netra-440/kernel -platform/SUNW,Netra-CP2300/kernel -platform/SUNW,Netra-CP3010/kernel -platform/SUNW,Netra-CP3060 -platform/SUNW,Netra-CP3060/kernel -platform/SUNW,Netra-CP3260 -platform/SUNW,Netra-T12/kernel -platform/SUNW,Netra-T2000 -platform/SUNW,Netra-T4/kernel -platform/SUNW,Netra-T5220 -platform/SUNW,SPARC-Enterprise-T1000 -platform/SUNW,SPARC-Enterprise-T2000 -platform/SUNW,SPARC-Enterprise-T5120 -platform/SUNW,SPARC-Enterprise-T5220 -platform/SUNW,SPARC-Enterprise/kernel -platform/SUNW,Serverblade1/kernel -platform/SUNW,Sun-Blade-100/kernel -platform/SUNW,Sun-Blade-1000/kernel -platform/SUNW,Sun-Blade-1500/kernel -platform/SUNW,Sun-Blade-2500/kernel -platform/SUNW,Sun-Blade-T6300 -platform/SUNW,Sun-Blade-T6320 -platform/SUNW,Sun-Fire-15000/kernel -platform/SUNW,Sun-Fire-280R/kernel -platform/SUNW,Sun-Fire-480R/kernel -platform/SUNW,Sun-Fire-880/kernel -platform/SUNW,Sun-Fire-T1000 -platform/SUNW,Sun-Fire-T200 -platform/SUNW,Sun-Fire-T200/kernel -platform/SUNW,Sun-Fire-V210 -platform/SUNW,Sun-Fire-V210/kernel -platform/SUNW,Sun-Fire-V215/kernel -platform/SUNW,Sun-Fire-V240/kernel -platform/SUNW,Sun-Fire-V245 -platform/SUNW,Sun-Fire-V245/kernel -platform/SUNW,Sun-Fire-V250/kernel -platform/SUNW,Sun-Fire-V440/kernel -platform/SUNW,Sun-Fire-V445/kernel -platform/SUNW,Sun-Fire-V490 -platform/SUNW,Sun-Fire-V490/kernel -platform/SUNW,Sun-Fire-V890 -platform/SUNW,Sun-Fire-V890/kernel -platform/SUNW,Sun-Fire/kernel -platform/SUNW,T5140 -platform/SUNW,T5240 -platform/SUNW,T5440 -platform/SUNW,USBRDT-5240 -platform/SUNW,USBRDT-5440 -platform/SUNW,Ultra-2 -platform/SUNW,Ultra-250/kernel -platform/SUNW,Ultra-30 -platform/SUNW,Ultra-4/kernel -platform/SUNW,Ultra-5_10/kernel -platform/SUNW,Ultra-60 -platform/SUNW,Ultra-80/kernel -platform/SUNW,Ultra-Enterprise-10000/kernel -platform/SUNW,Ultra-Enterprise/kernel -platform/SUNW,UltraAX-i2/kernel -platform/SUNW,UltraSPARC-IIe-NetraCT-40/kernel -platform/SUNW,UltraSPARC-IIe-NetraCT-60/kernel -platform/SUNW,UltraSPARC-IIi-Netract/kernel -platform/TAD,SPARCLE/kernel -platform/sun4u-opl -platform/sun4u-us3/kernel -platform/sun4u/kernel -platform/sun4v/kernel +platform diff --git a/usr/src/cmd/boot/scripts/extract_boot_filelist.ksh b/usr/src/cmd/boot/scripts/extract_boot_filelist.ksh index 5c155ca991..52479b7471 100644 --- a/usr/src/cmd/boot/scripts/extract_boot_filelist.ksh +++ b/usr/src/cmd/boot/scripts/extract_boot_filelist.ksh @@ -39,11 +39,25 @@ usage() { echo "and it is not recommended for stand-alone use." echo "Please use bootadm(1M) instead." echo "" - echo "Usage: ${0##*/}: [-R \<root\>] [-p \<platform\>] \<filelist\> ..." - echo "where \<platform\> is one of i86pc, sun4u or sun4v" + echo "Usage: ${0##*/}: [-R <root>] [-p <platform>] <filelist> ..." + echo "where <platform> is one of i86pc, sun4u or sun4v" exit 2 } +build_platform() { + + altroot=$1 + + ( + cd $altroot/ + if [ -z "$STRIP" ] ; then + ls -d platform/*/kernel + else + ls -d platform/*/kernel | grep -v $STRIP + fi + ) +} + # default platform is what we're running on PLATFORM=`uname -m` @@ -83,18 +97,16 @@ filtering=no if [ "$altroot" == "" ] || [ $platform_provided = yes ]; then case $PLATFORM in i86pc) - filtering=no + STRIP= ;; sun4u) - filtering=yes - exclude_pattern="sun4v" + STRIP=platform/sun4v/ ;; sun4v) - filtering=yes - exclude_pattern="sun4u" + STRIP=platform/sun4u/ ;; *) - usage + STRIP= ;; esac fi @@ -102,11 +114,23 @@ fi for list in $filelists do if [ -f $altroot/$list ]; then - if [ $filtering = yes ]; then - cat $altroot/$list | grep -v $exclude_pattern + grep ^platform$ $altroot/$list > /dev/null + if [ $? = 0 ] ; then + build_platform $altroot + if [ -z "$STRIP" ] ; then + cat $altroot/$list | grep -v ^platform$ + else + cat $altroot/$list | grep -v ^platform$ | \ + grep -v $STRIP + fi else - cat $altroot/$list + if [ -z "$STRIP" ] ; then + cat $altroot/$list + else + cat $altroot/$list | grep -v $STRIP + fi fi + fi done diff --git a/usr/src/uts/common/krtld/kobj.c b/usr/src/uts/common/krtld/kobj.c index 28bd94c7c9..20352979f5 100644 --- a/usr/src/uts/common/krtld/kobj.c +++ b/usr/src/uts/common/krtld/kobj.c @@ -3921,7 +3921,7 @@ kobj_uncomp_blk(struct _buf *file, char *buf, uint_t off) i = off / file->_bsize; src = file->_dbuf + hdr->ch_blkmap[i]; if (i == hdr->ch_fsize / file->_bsize) - slen = hdr->ch_fsize - hdr->ch_blkmap[i]; + slen = file->_dsize - hdr->ch_blkmap[i]; else slen = hdr->ch_blkmap[i + 1] - hdr->ch_blkmap[i]; if (z_uncompress(buf, &dlen, src, slen) != Z_OK) diff --git a/usr/src/uts/common/os/autoconf.c b/usr/src/uts/common/os/autoconf.c index 0bd34a64a9..2953ce3975 100644 --- a/usr/src/uts/common/os/autoconf.c +++ b/usr/src/uts/common/os/autoconf.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -135,7 +135,13 @@ impl_create_root_class(void) if ((major = ddi_name_to_major("rootnex")) == (major_t)-1) panic("Couldn't find major number for 'rootnex'"); - size = (size_t)BOP_GETPROPLEN(bootops, "mfg-name"); + /* + * C OBP (Serengeti) does not include the NULL when returning + * the length of the name property, while this violates 1275, + * Solaris needs to work around this by allocating space for + * an extra character. + */ + size = (size_t)BOP_GETPROPLEN(bootops, "mfg-name") + 1; rootname = kmem_zalloc(size, KM_SLEEP); (void) BOP_GETPROP(bootops, "mfg-name", rootname); diff --git a/usr/src/uts/sun4/os/startup.c b/usr/src/uts/sun4/os/startup.c index 68c5f0b215..d90157a937 100644 --- a/usr/src/uts/sun4/os/startup.c +++ b/usr/src/uts/sun4/os/startup.c @@ -1116,7 +1116,7 @@ startup_memlist(void) /* * Place the array that protects pp->p_selock in the kmem64 wad. */ - pse_shift = size_pse_array(physmem, max_ncpus); + pse_shift = size_pse_array(npages, max_ncpus); PRM_DEBUG(pse_shift); pse_table_size = 1 << pse_shift; PRM_DEBUG(pse_table_size); |