diff options
author | Jonathan Adams <Jonathan.Adams@Sun.COM> | 2009-12-18 21:37:42 -0800 |
---|---|---|
committer | Jonathan Adams <Jonathan.Adams@Sun.COM> | 2009-12-18 21:37:42 -0800 |
commit | ae1049320dd687abe67d8ed2ce29f4d478f64841 (patch) | |
tree | 4f262e918099a77372abb0f02b3ae732949831a2 | |
parent | 7e0821a4b901733b2be678c208de8e2805f2cb7a (diff) | |
download | illumos-joyent-ae1049320dd687abe67d8ed2ce29f4d478f64841.tar.gz |
6911381 solaris 10 branded zones should use native class-specific binaries
-rw-r--r-- | usr/src/lib/brand/native/zone/common.ksh | 30 | ||||
-rw-r--r-- | usr/src/lib/brand/solaris10/zone/s10_boot.ksh | 18 |
2 files changed, 48 insertions, 0 deletions
diff --git a/usr/src/lib/brand/native/zone/common.ksh b/usr/src/lib/brand/native/zone/common.ksh index e12781e079..95abe86351 100644 --- a/usr/src/lib/brand/native/zone/common.ksh +++ b/usr/src/lib/brand/native/zone/common.ksh @@ -205,6 +205,35 @@ safe_replace() chown $own $filename } +safe_wrap() +{ + typeset filename="$1" + typeset runname="$2" + typeset mode="$3" + typeset own="$4" + + if [ -f $filename ]; then + log "$e_cannot_wrap" "$filename" + exit 1 + fi + + cat <<-END >$filename || exit 1 + #!/bin/sh + # + # Solaris Brand Wrapper + # + # Attention. This file has been created for use in a + # virtualized environment. Modification of this script + # is not supported and all changes will be lost upon reboot. + # + END + + echo ". $runname \"\$@\"" >>$filename || exit 1 + + chmod $mode $filename + chown $own $filename +} + # # Read zonecfg ipd and fs entries and save the relevant data, one entry per # line. @@ -1001,6 +1030,7 @@ install_image() TEXTDOMAIN="SUNW_OST_OSCMD" export TEXTDOMAIN +e_cannot_wrap=$(gettext "%s: error: wrapper file already exists") e_baddir=$(gettext "Invalid '%s' directory within the zone") e_badfile=$(gettext "Invalid '%s' file within the zone") e_path_abs=$(gettext "Pathname specified to -a '%s' must be absolute.") diff --git a/usr/src/lib/brand/solaris10/zone/s10_boot.ksh b/usr/src/lib/brand/solaris10/zone/s10_boot.ksh index 2b2d1a34f6..09c4f39a59 100644 --- a/usr/src/lib/brand/solaris10/zone/s10_boot.ksh +++ b/usr/src/lib/brand/solaris10/zone/s10_boot.ksh @@ -81,6 +81,10 @@ replace_with_native() { fi } +wrap_with_native() { + safe_wrap $ZONEROOT/$1 $BRANDDIR/s10_isaexec_wrapper $2 $3 +} + # # Before we boot we validate and fix, if necessary, the required files within # the zone. These modifications can be lost if a patch is applied within the @@ -152,6 +156,20 @@ if [ ! -h $ZONEROOT/usr/lib/autofs -a -d $ZONEROOT/usr/lib/autofs ]; then fi # +# The class-specific dispadmin(1M) and priocntl(1) binaries must be native +# wrappers, and we must have all of the ones the native zone does. This +# allows new scheduling classes to appear without causing dispadmin and +# priocntl to be unhappy. +# +rm -rf $ZONEROOT/usr/lib/class +mkdir $ZONEROOT/usr/lib/class || exit 1 + +find /usr/lib/class -type d -o -type f | while read x; do + [ -d $x ] && mkdir -p -m 755 $ZONEROOT$x + [ -f $x ] && wrap_with_native $x 0555 root:bin +done + +# # END OF STEP TWO # |