Mercurial > illumos > illumos-gate
changeset 6319:03c1299ed2bb
PSARC 2008/213 Bootadm: managing a diskless client
6625247 NBS: diskless client setup scripts don't work with newboot sparc
6678886 building a boot archive must not require access to other than root
line wrap: on
line diff
--- a/usr/src/Makefile.psm Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/Makefile.psm Sat Mar 29 19:24:05 2008 -0700 @@ -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. # # ident "%Z%%M% %I% %E% SMI" @@ -119,6 +119,12 @@ ROOT_PSM_MOD_DIRS_32 += $(ROOT_PSM_PCBE_DIR_32) ROOT_PSM_MOD_DIRS_32 += $(ROOT_PSM_BRAND_DIR_32) +ROOT_PSM_LIB_FS_DIR = $(ROOT_PSM_LIB_DIR)/fs +ROOT_PSM_LIB_UFS_DIR = $(ROOT_PSM_LIB_FS_DIR)/ufs +ROOT_PSM_LIB_NFS_DIR = $(ROOT_PSM_LIB_FS_DIR)/nfs +ROOT_PSM_LIB_HSFS_DIR = $(ROOT_PSM_LIB_FS_DIR)/hsfs +ROOT_PSM_LIB_ZFS_DIR = $(ROOT_PSM_LIB_FS_DIR)/zfs + USR_PLAT_DIR = $(ROOT)/usr/platform USR_PSM_DIR = $(USR_PLAT_DIR)/$(PLATFORM)
--- a/usr/src/Makefile.psm.targ Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/Makefile.psm.targ Sat Mar 29 19:24:05 2008 -0700 @@ -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. # # ident "%Z%%M% %I% %E% SMI" @@ -114,6 +114,27 @@ $(ROOT_PSM_BRAND_DIR)/%: $(OBJS_DIR)/% $(ROOT_PSM_BRAND_DIR) FRC $(INS.file) +$(ROOT_PSM_LIB_FS_DIR): $(ROOT_PSM_LIB_DIR) + -$(INS.dir.root.bin) + +$(ROOT_PSM_LIB_UFS_DIR) \ +$(ROOT_PSM_LIB_NFS_DIR) \ +$(ROOT_PSM_LIB_HSFS_DIR) \ +$(ROOT_PSM_LIB_ZFS_DIR): $(ROOT_PSM_LIB_FS_DIR) + $(INS.dir.root.bin) + +$(ROOT_PSM_LIB_UFS_DIR)/%: % $(ROOT_PSM_LIB_UFS_DIR) + $(INS.file) + +$(ROOT_PSM_LIB_NFS_DIR)/%: % $(ROOT_PSM_LIB_NFS_DIR) + $(INS.file) + +$(ROOT_PSM_LIB_HSFS_DIR)/%: % $(ROOT_PSM_LIB_HSFS_DIR) + $(INS.file) + +$(ROOT_PSM_LIB_ZFS_DIR)/%: % $(ROOT_PSM_LIB_ZFS_DIR) + $(INS.file) + # # # @@ -166,16 +187,16 @@ $(INS.file) $(USR_PSM_LIB_UFS_DIR)/%: % $(USR_PSM_LIB_UFS_DIR) - $(INS.file) + $(RM) -r $@ ; $(SYMLINK) $(BOOTBLK_LINK) $@ $(CHOWNLINK) $(CHGRPLINK) $(USR_PSM_LIB_NFS_DIR)/%: % $(USR_PSM_LIB_NFS_DIR) $(INS.file) $(USR_PSM_LIB_HSFS_DIR)/%: % $(USR_PSM_LIB_HSFS_DIR) - $(INS.file) + $(RM) -r $@ ; $(SYMLINK) $(BOOTBLK_LINK) $@ $(CHOWNLINK) $(CHGRPLINK) $(USR_PSM_LIB_ZFS_DIR)/%: % $(USR_PSM_LIB_ZFS_DIR) - $(INS.file) + $(RM) -r $@ ; $(SYMLINK) $(BOOTBLK_LINK) $@ $(CHOWNLINK) $(CHGRPLINK) $(USR_PSM_MOD_DIR)/%: % $(USR_PSM_MOD_DIR) $(INS.file)
--- a/usr/src/cmd/boot/bootadm/bootadm.c Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/cmd/boot/bootadm/bootadm.c Sat Mar 29 19:24:05 2008 -0700 @@ -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. */ @@ -62,9 +62,7 @@ #include <pwd.h> #include <grp.h> #include <device_info.h> - #include <locale.h> - #include <assert.h> #include "message.h" @@ -201,6 +199,8 @@ static int bam_lock_fd = -1; static char rootbuf[PATH_MAX] = "/"; static int bam_update_all; +static int bam_alt_platform; +static char *bam_platform; /* function prototypes */ static void parse_args_internal(int, char *[]); @@ -292,9 +292,10 @@ /* archive usage */ - (void) fprintf(stderr, "\t%s update-archive [-vn] [-R altroot]\n", - prog); - (void) fprintf(stderr, "\t%s list-archive [-R altroot]\n", prog); + (void) fprintf(stderr, + "\t%s update-archive [-vn] [-R altroot [-p platform>]]\n", prog); + (void) fprintf(stderr, + "\t%s list-archive [-R altroot [-p platform>]]\n", prog); #if !defined(_OPB) /* x86 only */ (void) fprintf(stderr, "\t%s set-menu [-R altroot] key=value\n", prog); @@ -418,7 +419,7 @@ opterr = 0; error = 0; - while ((c = getopt(argc, argv, "a:d:fm:no:vCR:")) != -1) { + while ((c = getopt(argc, argv, "a:d:fm:no:vCR:p:")) != -1) { switch (c) { case 'a': if (bam_cmd) { @@ -489,6 +490,16 @@ bam_root = rootbuf; bam_rootlen = strlen(rootbuf); break; + case 'p': + bam_alt_platform = 1; + bam_platform = optarg; + if ((strcmp(bam_platform, "i86pc") != 0) && + (strcmp(bam_platform, "sun4u") != 0) && + (strcmp(bam_platform, "sun4v") != 0)) { + error = 1; + bam_error(INVALID_PLAT, bam_platform); + } + break; case '?': error = 1; bam_error(BAD_OPT, optopt); @@ -501,6 +512,14 @@ } /* + * An alternate platform requires an alternate root + */ + if (bam_alt_platform && bam_alt_root == 0) { + usage(); + bam_exit(0); + } + + /* * A command option must be specfied */ if (!bam_cmd) { @@ -1367,7 +1386,7 @@ return (0); /* - * If we are invoked as part of system/filesyste/boot-archive, then + * If we are invoked as part of system/filesystem/boot-archive, then * there are a number of things we should not worry about */ if (bam_smf_check) { @@ -1467,14 +1486,13 @@ /* * If archive is missing, create archive */ - - if (is_sun4u()) + if (is_sun4u()) { (void) snprintf(path, sizeof (path), "%s%s", root, - SUN4U__ARCHIVE); - else if (is_sun4v()) + SUN4U_ARCHIVE); + } else if (is_sun4v()) { (void) snprintf(path, sizeof (path), "%s%s", root, - SUN4V__ARCHIVE); - else { + SUN4V_ARCHIVE); + } else { if (bam_direct == BAM_DIRECT_DBOOT) { (void) snprintf(path, sizeof (path), "%s%s", root, DIRECT_BOOT_ARCHIVE_64); @@ -1552,13 +1570,29 @@ /* * build arguments to exec extract_boot_filelist.ksh */ + char *rootarg, *platarg; + int platarglen = 1, rootarglen = 1; + if (strlen(root) > 1) + rootarglen += strlen(root) + strlen("-R "); + if (bam_alt_platform) + platarglen += strlen(bam_platform) + strlen("-p "); + platarg = s_calloc(1, platarglen); + rootarg = s_calloc(1, rootarglen); + *platarg = 0; + *rootarg = 0; + if (strlen(root) > 1) { - n = snprintf(cmd, sizeof (cmd), "%s -R %s /%s /%s", - path, root, BOOT_FILE_LIST, ETC_FILE_LIST); - } else { - n = snprintf(cmd, sizeof (cmd), "%s /%s /%s", - path, BOOT_FILE_LIST, ETC_FILE_LIST); + (void) snprintf(rootarg, rootarglen, + "-R %s", root); } + if (bam_alt_platform) { + (void) snprintf(platarg, platarglen, + "-p %s", bam_platform); + } + n = snprintf(cmd, sizeof (cmd), "%s %s %s /%s /%s", + path, rootarg, platarg, BOOT_FILE_LIST, ETC_FILE_LIST); + free(platarg); + free(rootarg); if (n >= sizeof (cmd)) { bam_error(NO_FLIST); return (BAM_ERROR); @@ -1893,9 +1927,17 @@ } len = strlen(path) + strlen(root) + 10; /* room for space + -R */ + if (bam_alt_platform) + len += strlen(bam_platform) + strlen("-p "); cmdline = s_calloc(1, len); - if (strlen(root) > 1) { + if (bam_alt_platform) { + assert(strlen(root) > 1); + (void) snprintf(cmdline, len, "%s -p %s -R %s", + path, bam_platform, root); + /* chop off / at the end */ + cmdline[strlen(cmdline) - 1] = '\0'; + } else if (strlen(root) > 1) { (void) snprintf(cmdline, len, "%s -R %s", path, root); /* chop off / at the end */ cmdline[strlen(cmdline) - 1] = '\0'; @@ -4560,12 +4602,19 @@ if (amd64 != -1) return (amd64); - if (sysinfo(SI_ISALIST, isabuf, sizeof (isabuf)) > 0 && - strncmp(isabuf, "amd64 ", strlen("amd64 ")) == 0) - amd64 = 1; - else if (strstr(isabuf, "i386") == NULL) - amd64 = 1; /* diskless server */ - else + if (bam_alt_platform) { + if (strcmp(bam_platform, "i86pc") == 0) { + amd64 = 1; /* diskless server */ + } + } else { + if (sysinfo(SI_ISALIST, isabuf, sizeof (isabuf)) > 0 && + strncmp(isabuf, "amd64 ", strlen("amd64 ")) == 0) { + amd64 = 1; + } else if (strstr(isabuf, "i386") == NULL) { + amd64 = 1; /* diskless server */ + } + } + if (amd64 == -1) amd64 = 0; return (amd64); @@ -4574,12 +4623,24 @@ static int is_sun4u(void) { - static int sun4u = 0; + static int sun4u = -1; char mbuf[257]; /* from sysinfo(2) manpage */ - if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0 && - strncmp(mbuf, "sun4u", strlen("sun4u")) == 0) - sun4u = 1; + if (sun4u != -1) + return (sun4u); + + if (bam_alt_platform) { + if (strcmp(bam_platform, "sun4u") == 0) { + sun4u = 1; + } + } else { + if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0 && + strncmp(mbuf, "sun4u", strlen("sun4u")) == 0) { + sun4u = 1; + } + } + if (sun4u == -1) + sun4u = 0; return (sun4u); } @@ -4587,12 +4648,24 @@ static int is_sun4v(void) { - static int sun4v = 0; + static int sun4v = -1; char mbuf[257]; /* from sysinfo(2) manpage */ - if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0 && - strncmp(mbuf, "sun4v", strlen("sun4v")) == 0) - sun4v = 1; + if (sun4v != -1) + return (sun4v); + + if (bam_alt_platform) { + if (strcmp(bam_platform, "sun4v") == 0) { + sun4v = 1; + } + } else { + if (sysinfo(SI_MACHINE, mbuf, sizeof (mbuf)) > 0 && + strncmp(mbuf, "sun4v", strlen("sun4v")) == 0) { + sun4v = 1; + } + } + if (sun4v == -1) + sun4v = 0; return (sun4v); }
--- a/usr/src/cmd/boot/bootadm/bootadm.h Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/cmd/boot/bootadm/bootadm.h Sat Mar 29 19:24:05 2008 -0700 @@ -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. */ @@ -188,8 +188,8 @@ #define DIRECT_BOOT_FAILSAFE_LINE DIRECT_BOOT_FAILSAFE_KERNEL " -s" /* Boot archives */ -#define SUN4U__ARCHIVE "/platform/sun4u/boot_archive" -#define SUN4V__ARCHIVE "/platform/sun4v/boot_archive" +#define SUN4U_ARCHIVE "/platform/sun4u/boot_archive" +#define SUN4V_ARCHIVE "/platform/sun4v/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"
--- a/usr/src/cmd/boot/bootadm/message.h Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/cmd/boot/bootadm/message.h Sat Mar 29 19:24:05 2008 -0700 @@ -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. */ @@ -368,6 +368,9 @@ gettext("bootadm -m upgrade run, but the failsafe archives have not been\n\ updated. Not updating line %d\n") +#define INVALID_PLAT \ + gettext("invalid platform %s - must be one of sun4u, sun4v or i86pc\n") + #ifdef __cplusplus } #endif
--- a/usr/src/cmd/boot/scripts/create_ramdisk.ksh Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/cmd/boot/scripts/create_ramdisk.ksh Sat Mar 29 19:24:05 2008 -0700 @@ -27,21 +27,25 @@ format=ufs ALT_ROOT= -ALTROOT_ARG= +EXTRACT_ARGS= compress=yes SPLIT=unknown ERROR=0 dirsize32=0 dirsize64=0 -PLAT=`uname -m` -if [ $PLAT = i86pc ] ; then - ARCH64=amd64 -else - ARCH64=sparcv9 -fi -BOOT_ARCHIVE=platform/$PLAT/boot_archive -BOOT_ARCHIVE_64=platform/$PLAT/$ARCH64/boot_archive +usage() { + echo "This utility is a component of the bootadm(1M) implementation" + echo "and it is not recommended for stand-alone use." + echo "Please use bootadm(1M) instead." + echo "" + echo "Usage: ${0##*/}: [-R \<root\>] [-p \<platform\>] [--nocompress]" + echo "where \<platform\> is one of i86pc, sun4u or sun4v" + exit +} + +# default platform is what we're running on +PLATFORM=`uname -m` # # set path, but inherit /tmp/bfubin if owned by @@ -68,14 +72,17 @@ ALT_ROOT="$1" if [ "$ALT_ROOT" != "/" ]; then echo "Creating boot_archive for $ALT_ROOT" - ALTROOT_ARG="-R $ALT_ROOT" + EXTRACT_ARGS="${EXTRACT_ARGS} -R ${ALT_ROOT}" EXTRACT_FILELIST="${ALT_ROOT}${EXTRACT_FILELIST}" fi ;; -n|--nocompress) compress=no ;; - *) echo Usage: ${0##*/}: [-R \<root\>] [--nocompress] - exit + -p) shift + PLATFORM="$1" + EXTRACT_ARGS="${EXTRACT_ARGS} -p ${PLATFORM}" + ;; + *) usage ;; esac shift @@ -101,18 +108,50 @@ echo "Creating boot_archive for $ALT_ROOT" fi -if [ $PLAT = i86pc ] ; then - rundir=`dirname $0` - if [ ! -x "$rundir"/symdef ]; then +case $PLATFORM in +i386) PLATFORM=i86pc + ISA=i386 + ARCH64=amd64 + ;; +i86pc) ISA=i386 + ARCH64=amd64 + ;; +sun4u) ISA=sparc + ARCH64=sparcv9 + ;; +sun4v) ISA=sparc + ARCH64=sparcv9 + ;; +*) usage + ;; +esac + +BOOT_ARCHIVE=platform/$PLATFORM/boot_archive +BOOT_ARCHIVE_64=platform/$PLATFORM/$ARCH64/boot_archive + +if [ $PLATFORM = i86pc ] ; then + NM=/bin/nm + SYMDEF=/boot/solaris/bin/symdef + if [ -x $NM ]; then + $NM "$ALT_ROOT"/platform/i86pc/kernel/unix | \ + grep dboot_image >/dev/null 2>&1 + if [ $? = 0 ]; then + SPLIT=yes + else + SPLIT=no + compress=no + fi + elif [ ! -x $SYMDEF ]; then # Shouldn't happen - echo "Warning: $rundir/symdef not present." + echo "Warning: both $NM and $SYMDEF not present." echo "Creating single archive at $ALT_ROOT/$BOOT_ARCHIVE" SPLIT=no compress=no - elif "$rundir"/symdef "$ALT_ROOT"/platform/i86pc/kernel/unix \ + elif $SYMDEF "$ALT_ROOT"/platform/i86pc/kernel/unix \ dboot_image 2>/dev/null; then SPLIT=yes else + # no dboot SPLIT=no compress=no fi @@ -193,7 +232,7 @@ fi done <"$list" | cpio -pdum "$rdmnt" 2>/dev/null - if [ `uname -p` = sparc ] ; then + if [ $ISA = sparc ] ; then # copy links find $filelist -type l -print 2>/dev/null |\ cpio -pdum "$rdmnt" 2>/dev/null @@ -245,10 +284,11 @@ umount "$rdmnt" rmdir "$rdmnt" - if [ `uname -p` = sparc ] ; then + if [ $ISA = sparc ] ; then rlofidev=`echo "$lofidev" | sed -e "s/dev\/lofi/dev\/rlofi/"` - bb="$ALT_ROOT/usr/platform/`uname -i`/lib/fs/ufs/bootblk" - installboot "$bb" $rlofidev + bb="$ALT_ROOT/platform/$PLATFORM/lib/fs/ufs/bootblk" + # installboot is not available on all platforms + dd if=$bb of=$rlofidev bs=1b oseek=1 count=15 conv=sync 2>&1 fi # @@ -260,7 +300,7 @@ # compressed, and the final compression will accomplish very # little. To save time, we skip the gzip in this case. # - if [ `uname -p` = i386 ] && [ $compress = no ] && \ + if [ $ISA = i386 ] && [ $compress = no ] && \ [ -x $GZIP_CMD ] ; then gzip -c "$rdfile" > "${archive}-new" else @@ -300,8 +340,8 @@ files= isocmd="mkisofs -quiet -graft-points -dlrDJN -relaxed-filenames" - if [ `uname -p` = sparc ] ; then - bb="$ALT_ROOT/usr/platform/`uname -i`/lib/fs/hsfs/bootblk" + if [ $ISA = sparc ] ; then + bb="$ALT_ROOT/platform/$PLATFORM/lib/fs/hsfs/bootblk" isocmd="$isocmd -G \"$bb\"" fi @@ -318,7 +358,7 @@ # compressed, and the final compression will accomplish very # little. To save time, we skip the gzip in this case. # - if [ `uname -p` = i386 ] &&[ $compress = no ] && [ -x $GZIP_CMD ] + if [ $ISA = i386 ] &&[ $compress = no ] && [ -x $GZIP_CMD ] then ksh -c "$isocmd" 2> "$errlog" | \ gzip > "${archive}-new" @@ -327,8 +367,8 @@ fi dd_ret=0 - if [ `uname -p` = sparc ] ; then - bb="$ALT_ROOT/usr/platform/`uname -i`/lib/fs/hsfs/bootblk" + if [ $ISA = sparc ] ; then + bb="$ALT_ROOT/platform/$PLATFORM/lib/fs/hsfs/bootblk" dd if="$bb" of="${archive}-new" bs=1b oseek=1 count=15 \ conv=notrunc conv=sync >> "$errlog" 2>&1 dd_ret=$? @@ -361,7 +401,7 @@ # sanity check the archive before moving it into place # ARCHIVE_SIZE=`ls -l "${archive}-new" | nawk '{ print $5 }'` - if [ $compress = yes ] || [ `uname -p` = sparc ] ; then + if [ $compress = yes ] || [ $ISA = sparc ] ; then # # 'file' will report "English text" for uncompressed # boot_archives. Checking for that doesn't seem stable, @@ -408,8 +448,10 @@ print -u2 "Can't find filelist.ramdisk" exit 1 fi -filelist=$($EXTRACT_FILELIST $ALTROOT_ARG /boot/solaris/filelist.ramdisk \ - /etc/boot/solaris/filelist.ramdisk 2>/dev/null | sort -u) +filelist=$($EXTRACT_FILELIST $EXTRACT_ARGS \ + /boot/solaris/filelist.ramdisk \ + /etc/boot/solaris/filelist.ramdisk \ + 2>/dev/null | sort -u) # # We use /tmp/ for scratch space now. This may be changed later if there @@ -541,6 +583,9 @@ if [ $? = 0 ]; then rm -f "$ALT_ROOT/boot/boot_archive" "$ALT_ROOT/boot/amd64/boot_archive" ln "$ALT_ROOT/$BOOT_ARCHIVE" "$ALT_ROOT/boot/boot_archive" - ln "$ALT_ROOT/$BOOT_ARCHIVE_64" "$ALT_ROOT/boot/amd64/boot_archive" + if [ $SPLIT = yes ]; then + ln "$ALT_ROOT/$BOOT_ARCHIVE_64" \ + "$ALT_ROOT/boot/amd64/boot_archive" + fi fi [ -n "$rddir" ] && rm -rf "$rddir"
--- a/usr/src/cmd/boot/scripts/extract_boot_filelist.ksh Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/cmd/boot/scripts/extract_boot_filelist.ksh Sat Mar 29 19:24:05 2008 -0700 @@ -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. # # ident "%Z%%M% %I% %E% SMI" @@ -35,35 +35,53 @@ fi usage() { - echo "Usage: ${0##*/}: [-R \<root\>] <filelist> ..." + echo "This utility is a component of the bootadm(1M) implementation" + 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" exit 2 } +# default platform is what we're running on +PLATFORM=`uname -m` + altroot="" filelists= -while getopts R FLAG +platform_provided=no + +OPTIND=1 +while getopts R:p: FLAG do case $FLAG in - R) shift - if [ "$1" != "/" ]; then - altroot="$1" + R) if [ "$OPTARG" != "/" ]; then + altroot="$OPTARG" fi ;; + p) platform_provided=yes + PLATFORM="$OPTARG" + ;; *) usage ;; esac - shift done +shift `expr $OPTIND - 1` if [ $# -eq 0 ]; then usage fi filelists=$* +# +# If the target platform is provided, as is the case for diskless, +# or we're building an archive for this machine, we can build +# a smaller archive by not including unnecessary components. +# filtering=no -if [ "$altroot" == "" ]; then - case `uname -m` in +if [ "$altroot" == "" ] || [ $platform_provided = yes ]; then + case $PLATFORM in i86pc) filtering=no ;; @@ -75,6 +93,9 @@ filtering=yes exclude_pattern="sun4u" ;; + *) + usage + ;; esac fi
--- a/usr/src/cmd/boot/scripts/root_archive.ksh Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/cmd/boot/scripts/root_archive.ksh Sat Mar 29 19:24:05 2008 -0700 @@ -455,7 +455,7 @@ if [ -d "$MINIROOT/platform/sun4u" ] ; then mkdir -p "$MEDIA/boot" - dd if="$MINIROOT/usr/platform/sun4u/lib/fs/hsfs/bootblk" \ + dd if="$MINIROOT/platform/sun4u/lib/fs/hsfs/bootblk" \ of="$MEDIA/boot/hsfs.bootblock" \ bs=1b oseek=1 count=15 conv=sync 2> /dev/null fi @@ -773,7 +773,7 @@ if [ -d "$UNPACKED_ROOT/kernel/drv/sparcv9" ] ; then "$UNPACKED_ROOT/usr/sbin/installboot" \ - "$UNPACKED_ROOT/usr/platform/sun4u/lib/fs/ufs/bootblk" \ + "$UNPACKED_ROOT/platform/sun4u/lib/fs/ufs/bootblk" \ $RLOFIDEV fi
--- a/usr/src/pkgdefs/SUNWcar.u/prototype_com Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/pkgdefs/SUNWcar.u/prototype_com Sat Mar 29 19:24:05 2008 -0700 @@ -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. # # ident "%Z%%M% %I% %E% SMI" @@ -215,9 +215,19 @@ s none platform/SUNW,Netra-CP2300/lib/sparcv9/libmd_psr.so.1=../../../sun4u/lib/sparcv9/libmd_psr.so.1 s none platform/TAD,SPARCLE/lib/sparcv9/libmd_psr.so.1=../../../sun4u/lib/sparcv9/libmd_psr.so.1 # +# platform/sun4u/lib/bootblks +# +d none platform/sun4u/lib 755 root bin +d none platform/sun4u/lib/fs 755 root bin +d none platform/sun4u/lib/fs/ufs 755 root bin +f none platform/sun4u/lib/fs/ufs/bootblk 444 root sys +d none platform/sun4u/lib/fs/hsfs 755 root bin +f none platform/sun4u/lib/fs/hsfs/bootblk 444 root sys +d none platform/sun4u/lib/fs/zfs 755 root bin +f none platform/sun4u/lib/fs/zfs/bootblk 444 root sys +# # lib/libc_psr.so.1 and links to it for each sun4u platform # -d none platform/sun4u/lib 755 root bin d none platform/SUNW,Netra-T12/lib 755 root bin d none platform/SUNW,Netra-T4/lib 755 root bin d none platform/SUNW,Serverblade1/lib 755 root bin
--- a/usr/src/pkgdefs/SUNWcar.v/prototype_com Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/pkgdefs/SUNWcar.v/prototype_com Sat Mar 29 19:24:05 2008 -0700 @@ -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. # #pragma ident "%Z%%M% %I% %E% SMI" @@ -52,6 +52,13 @@ d none platform 755 root sys d none platform/sun4v 755 root sys d none platform/sun4v/lib 755 root bin +d none platform/sun4v/lib/fs 755 root bin +d none platform/sun4v/lib/fs/ufs 755 root bin +f none platform/sun4v/lib/fs/ufs/bootblk 444 root sys +d none platform/sun4v/lib/fs/hsfs 755 root bin +f none platform/sun4v/lib/fs/hsfs/bootblk 444 root sys +d none platform/sun4v/lib/fs/zfs 755 root bin +f none platform/sun4v/lib/fs/zfs/bootblk 444 root sys d none platform/sun4v/lib/libc_psr 755 root bin v none platform/sun4v/lib/libc_psr.so.1 644 root bin f none platform/sun4v/lib/libc_psr/libc_psr_hwcap1.so.1 644 root bin
--- a/usr/src/pkgdefs/SUNWkvm.u/Makefile Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/pkgdefs/SUNWkvm.u/Makefile Sat Mar 29 19:24:05 2008 -0700 @@ -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. @@ -22,14 +21,15 @@ # #ident "%Z%%M% %I% %E% SMI" # -# Copyright (c) 1993 by Sun Microsystems, Inc. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. # include ../Makefile.com .KEEP_STATE: -all: $(FILES) +all: $(FILES) depend install: all pkg include ../Makefile.targ
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/pkgdefs/SUNWkvm.u/depend Sat Mar 29 19:24:05 2008 -0700 @@ -0,0 +1,43 @@ +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# 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 +# +#ident "%Z%%M% %I% %E% SMI" +# +# This package information file defines software dependencies associated +# with the pkg. You can define three types of pkg dependencies with this file: +# P indicates a prerequisite for installation +# I indicates an incompatible package +# R indicates a reverse dependency +# <pkg.abbr> see pkginfo(4), PKG parameter +# <name> see pkginfo(4), NAME parameter +# <version> see pkginfo(4), VERSION parameter +# <arch> see pkginfo(4), ARCH parameter +# <type> <pkg.abbr> <name> +# (<arch>)<version> +# (<arch>)<version> +# ... +# <type> <pkg.abbr> <name> +# ... +# + +P SUNWcar.u Core Architecture, (Root)
--- a/usr/src/pkgdefs/SUNWkvm.u/prototype_com Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/pkgdefs/SUNWkvm.u/prototype_com Sat Mar 29 19:24:05 2008 -0700 @@ -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. # # ident "%Z%%M% %I% %E% SMI" @@ -37,6 +37,7 @@ # packaging files i pkginfo i copyright +i depend # # source locations relative to the prototype file # @@ -286,11 +287,11 @@ s none usr/platform/TAD,SPARCLE/lib/fs=../../sun4u/lib/fs # d none usr/platform/sun4u/lib/fs/ufs 755 root bin -f none usr/platform/sun4u/lib/fs/ufs/bootblk 444 root sys +s none usr/platform/sun4u/lib/fs/ufs/bootblk=../../../../../../platform/sun4u/lib/fs/ufs/bootblk d none usr/platform/sun4u/lib/fs/hsfs 755 root bin -f none usr/platform/sun4u/lib/fs/hsfs/bootblk 444 root sys +s none usr/platform/sun4u/lib/fs/hsfs/bootblk=../../../../../../platform/sun4u/lib/fs/hsfs/bootblk d none usr/platform/sun4u/lib/fs/zfs 755 root bin -f none usr/platform/sun4u/lib/fs/zfs/bootblk 444 root sys +s none usr/platform/sun4u/lib/fs/zfs/bootblk=../../../../../../platform/sun4u/lib/fs/zfs/bootblk d none usr/platform/sun4u/lib/fs/nfs 755 root bin f none usr/platform/sun4u/lib/fs/nfs/inetboot 644 root sys #
--- a/usr/src/pkgdefs/SUNWkvm.v/Makefile Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/pkgdefs/SUNWkvm.v/Makefile Sat Mar 29 19:24:05 2008 -0700 @@ -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. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #pragma ident "%Z%%M% %I% %E% SMI" @@ -30,7 +29,7 @@ .KEEP_STATE: -all: $(FILES) +all: $(FILES) depend install: all pkg include ../Makefile.targ
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usr/src/pkgdefs/SUNWkvm.v/depend Sat Mar 29 19:24:05 2008 -0700 @@ -0,0 +1,43 @@ +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# 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 +# +#ident "%Z%%M% %I% %E% SMI" +# +# This package information file defines software dependencies associated +# with the pkg. You can define three types of pkg dependencies with this file: +# P indicates a prerequisite for installation +# I indicates an incompatible package +# R indicates a reverse dependency +# <pkg.abbr> see pkginfo(4), PKG parameter +# <name> see pkginfo(4), NAME parameter +# <version> see pkginfo(4), VERSION parameter +# <arch> see pkginfo(4), ARCH parameter +# <type> <pkg.abbr> <name> +# (<arch>)<version> +# (<arch>)<version> +# ... +# <type> <pkg.abbr> <name> +# ... +# + +P SUNWcar.v Core Architecture, (Root)
--- a/usr/src/pkgdefs/SUNWkvm.v/prototype_com Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/pkgdefs/SUNWkvm.v/prototype_com Sat Mar 29 19:24:05 2008 -0700 @@ -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. # #pragma ident "%Z%%M% %I% %E% SMI" @@ -37,6 +37,7 @@ # packaging files i pkginfo i copyright +i depend # # source locations relative to the prototype file # @@ -71,10 +72,10 @@ d none usr/platform/sun4v/lib/fs 755 root bin # d none usr/platform/sun4v/lib/fs/ufs 755 root bin -f none usr/platform/sun4v/lib/fs/ufs/bootblk 444 root sys +s none usr/platform/sun4v/lib/fs/ufs/bootblk=../../../../../../platform/sun4v/lib/fs/ufs/bootblk d none usr/platform/sun4v/lib/fs/hsfs 755 root bin -f none usr/platform/sun4v/lib/fs/hsfs/bootblk 444 root sys +s none usr/platform/sun4v/lib/fs/hsfs/bootblk=../../../../../../platform/sun4v/lib/fs/hsfs/bootblk d none usr/platform/sun4v/lib/fs/zfs 755 root bin -f none usr/platform/sun4v/lib/fs/zfs/bootblk 444 root sys +s none usr/platform/sun4v/lib/fs/zfs/bootblk=../../../../../../platform/sun4v/lib/fs/zfs/bootblk d none usr/platform/sun4v/lib/fs/nfs 755 root bin f none usr/platform/sun4v/lib/fs/nfs/inetboot 644 root sys
--- a/usr/src/psm/stand/bootblks/Makefile.com Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/psm/stand/bootblks/Makefile.com Sat Mar 29 19:24:05 2008 -0700 @@ -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. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 1994-2003 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -53,6 +52,11 @@ PROG = bootblk # +# base prefix for the usr/platform bootblk links +# +BOOTBLK_LINK_PREFIX =../../../../../../platform/$(PLATFORM)/lib/fs + +# # Used to convert Forth source to isa-independent FCode. # TOKENIZE = tokenize
--- a/usr/src/psm/stand/bootblks/Makefile.targ Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/psm/stand/bootblks/Makefile.targ Sat Mar 29 19:24:05 2008 -0700 @@ -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. @@ -22,8 +21,8 @@ # #ident "%Z%%M% %I% %E% SMI" # -# Copyright (c) 1994, by Sun Microsystems, Inc. -# All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. # # psm/stand/bootblks/Makefile.targ # @@ -31,7 +30,7 @@ # # Targets common to all versions. # -install: all $(USR_PSM_BOOTBLOCK) $(USR_PSM_UFS_DIR_LINKS) +install: all $(ROOT_PSM_BOOTBLOCK) .WAIT $(USR_PSM_BOOTBLOCK) # # Install rules
--- a/usr/src/psm/stand/bootblks/hsfs/Makefile.hsfs Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/psm/stand/bootblks/hsfs/Makefile.hsfs Sat Mar 29 19:24:05 2008 -0700 @@ -21,7 +21,7 @@ # #ident "%Z%%M% %I% %E% SMI" # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/bootblks/hsfs/Makefile.hsfs @@ -49,7 +49,9 @@ # # Where and how stuff gets installed # +ROOT_PSM_BOOTBLOCK = $(ROOT_PSM_LIB_HSFS_DIR)/$(PROG) USR_PSM_BOOTBLOCK = $(USR_PSM_LIB_HSFS_DIR)/$(PROG) +BOOTBLK_LINK = $(BOOTBLK_LINK_PREFIX)/hsfs/$(PROG) USR = $(ROOT)/usr USR_SBIN = $(USR)/sbin
--- a/usr/src/psm/stand/bootblks/ufs/Makefile.ufs Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/psm/stand/bootblks/ufs/Makefile.ufs Sat Mar 29 19:24:05 2008 -0700 @@ -21,7 +21,7 @@ # #ident "%Z%%M% %I% %E% SMI" # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # psm/stand/bootblks/ufs/Makefile.ufs @@ -49,7 +49,9 @@ # # Where and how stuff gets installed # +ROOT_PSM_BOOTBLOCK = $(ROOT_PSM_LIB_UFS_DIR)/$(PROG) USR_PSM_BOOTBLOCK = $(USR_PSM_LIB_UFS_DIR)/$(PROG) +BOOTBLK_LINK = $(BOOTBLK_LINK_PREFIX)/ufs/$(PROG) USR = $(ROOT)/usr USR_SBIN = $(USR)/sbin
--- a/usr/src/psm/stand/bootblks/zfs/Makefile.zfs Sat Mar 29 11:32:36 2008 -0700 +++ b/usr/src/psm/stand/bootblks/zfs/Makefile.zfs Sat Mar 29 19:24:05 2008 -0700 @@ -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. # #ident "%Z%%M% %I% %E% SMI" @@ -56,7 +56,9 @@ # # Where and how stuff gets installed # +ROOT_PSM_BOOTBLOCK = $(ROOT_PSM_LIB_ZFS_DIR)/$(PROG) USR_PSM_BOOTBLOCK = $(USR_PSM_LIB_ZFS_DIR)/$(PROG) +BOOTBLK_LINK = $(BOOTBLK_LINK_PREFIX)/zfs/$(PROG) %.fcode: $(BASEDIR)/zfs/common/%.fth $(TOKENIZE) $<