Can someone please apply the below changeset? It's been reviewed by David Comay. Dave Miner reviewed an earlier version as well.
Current webrev for this is : http://cr.opensolaris.org/~johnlev/osol-xvm-vnc/ thanks john # HG changeset patch # User John Levon <[EMAIL PROTECTED]> # Date 1226343362 28800 # Node ID 444586cde56698176d98fe3522b538acd52d1e90 # Parent 7f9f092b269575d12a68103e8c7b1a425195a4f6 141 PV OpenSolaris Live CD should start Xvnc diff --git a/src/util/distro-import/101a/SUNWfixes.prototype b/src/util/distro-import/101a/SUNWfixes.prototype --- a/src/util/distro-import/101a/SUNWfixes.prototype +++ b/src/util/distro-import/101a/SUNWfixes.prototype @@ -27,6 +27,7 @@ e none kernel/drv/sd.conf 0644 root sys f none lib/svc/method/sshd 0555 root bin f none lib/svc/method/svc-coreadm 0555 root bin +f none lib/svc/method/xvm-vnc-config 0555 root bin d none root 0700 root root e none root/.bashrc 0644 root root e none root/.profile 0644 root root @@ -45,6 +46,8 @@ f none usr/share/applications/services.desktop 0644 root bin f none usr/share/applications/shares.desktop 0644 root bin f none usr/share/man/man.cf 0644 root bin +f none var/svc/manifest/application/graphical-login/gdm.xml 444 root sys f none var/svc/manifest/system/coreadm.xml 444 root sys +f none var/svc/manifest/system/xvm/vnc-config.xml 444 root sys f none var/svc/profile/generic_limited_net.xml 0444 root sys f none var/svc/profile/generic_open.xml 0444 root sys diff --git a/src/util/distro-import/101a/common/SUNWgnome-display-mgr b/src/util/distro-import/101a/common/SUNWgnome-display-mgr new file mode 100644 --- /dev/null +++ b/src/util/distro-import/101a/common/SUNWgnome-display-mgr @@ -0,0 +1,9 @@ +package SUNWgnome-display-mgr +classification "Desktop (GNOME)/Sessions" +import SUNWgnome-display-mgr +import SUNWgnome-display-mgr-root +drop var/svc/manifest/application/graphical-login/gdm.xml +from SUNWfixes import +var/svc/manifest/application/graphical-login/gdm.xml +end import +end package diff --git a/src/util/distro-import/101a/gdm.xml b/src/util/distro-import/101a/gdm.xml new file mode 100644 --- /dev/null +++ b/src/util/distro-import/101a/gdm.xml @@ -0,0 +1,100 @@ +<?xml version="1.0"?> +<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> +<!-- + Copyright 2004 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. + + pragma ident "@(#)server.xml 1.2 04/08/09 SMI" +--> + +<service_bundle type='manifest' name='SUNWgnome-display-mgr:gdm2'> + +<service + name='application/graphical-login/gdm' + type='service' + version='1'> + + <dependency + name='filesystem' + grouping='require_all' + restart_on='none' + type='service'> + <service_fmri value='svc:/system/filesystem/local'/> + </dependency> + + <dependency name='multi-user' + grouping='require_all' + restart_on='error' + type='service'> + <service_fmri value='svc:/milestone/multi-user:default'/> + </dependency> + + <dependency + name='sysconfig' + grouping='require_all' + restart_on='none' + type='service'> + <service_fmri value='svc:/milestone/sysconfig'/> + </dependency> + + <dependency + name='vnc-config' + grouping='optional_all' + restart_on='none' + type='service'> + <service_fmri value='svc:/system/xvm/vnc-config'/> + </dependency> + + <dependency + name='fc-cache' + grouping='require_all' + restart_on='none' + type='service'> + <service_fmri value='svc:/application/font/fc-cache'/> + </dependency> + + <dependency + name='utmpx' + grouping='require_all' + restart_on='none' + type='service'> + <service_fmri value='svc:/system/utmp'/> + </dependency> + + <exec_method + type='method' + name='start' + exec='/usr/sbin/gdm' + timeout_seconds='60' /> + + <exec_method + type='method' + name='stop' + exec='/usr/sbin/gdm-stop' + timeout_seconds='60' /> + + <!-- Authorization --> + <property_group name='general' type='framework'> + <!-- to start stop gdm --> + <propval name='action_authorization' type='astring' + value='solaris.smf.manage.dt.login' /> + </property_group> + + <instance name='default' enabled='false' /> + + <stability value='Unstable' /> + + <template> + <common_name> + <loctext xml:lang='C'> + GNOME Display Manager + </loctext> + </common_name> + <documentation> + <manpage title='gdm' section='1' + manpath='/usr/share/man' /> + </documentation> + </template> +</service> + +</service_bundle> diff --git a/src/util/distro-import/101a/generic_limited_net.xml b/src/util/distro-import/101a/generic_limited_net.xml --- a/src/util/distro-import/101a/generic_limited_net.xml +++ b/src/util/distro-import/101a/generic_limited_net.xml @@ -336,4 +336,11 @@ <instance name='default' enabled='false'/> </service> + <!-- + Enable VNC config service for xVM + --> + <service name='system/xvm/vnc-config' version='1' type='service'> + <instance name='default' enabled='true'/> + </service> + </service_bundle> diff --git a/src/util/distro-import/101a/generic_open.xml b/src/util/distro-import/101a/generic_open.xml --- a/src/util/distro-import/101a/generic_open.xml +++ b/src/util/distro-import/101a/generic_open.xml @@ -184,4 +184,12 @@ Include inetd(1M) services profile. --> <xi:include href='file:/var/svc/profile/inetd_services.xml' /> + + <!-- + Enable VNC config service for xVM + --> + <service name='system/xvm/vnc-config' version='1' type='service'> + <instance name='default' enabled='true'/> + </service> + </service_bundle> diff --git a/src/util/distro-import/101a/i386/SUNWxvmdom b/src/util/distro-import/101a/i386/SUNWxvmdom new file mode 100644 --- /dev/null +++ b/src/util/distro-import/101a/i386/SUNWxvmdom @@ -0,0 +1,10 @@ +package SUNWxvmdom +classification "System/Virtualization" +import SUNWxvmdomu +import SUNWxvmdomr +from SUNWfixes import +lib/svc/method/xvm-vnc-config +var/svc/manifest/system/xvm/vnc-config.xml +end import +version 3.1 +end package diff --git a/src/util/distro-import/101a/redist_cluster b/src/util/distro-import/101a/redist_cluster --- a/src/util/distro-import/101a/redist_cluster +++ b/src/util/distro-import/101a/redist_cluster @@ -3085,6 +3085,7 @@ depend SUNWxorg-server depend SUNWxorg-xkb depend SUNWxsvc +depend SUNWxvmdom depend SUNWxvmipa depend SUNWxvmpv depend SUNWxvnc diff --git a/src/util/distro-import/101a/slim_cluster b/src/util/distro-import/101a/slim_cluster --- a/src/util/distro-import/101a/slim_cluster +++ b/src/util/distro-import/101a/slim_cluster @@ -596,6 +596,7 @@ include i386/SUNWxorg-mesa include i386/SUNWxorg-server include i386/SUNWxsvc +include i386/SUNWxvmdom include i386/SUNWxvmipa include i386/SUNWxvmpv include i386/SUNWxwice @@ -1133,6 +1134,7 @@ depend SUNWxorg-server depend SUNWxorg-xkb depend SUNWxsvc +depend SUNWxvmdom depend SUNWxvmipa depend SUNWxvmpv depend SUNWxvnc diff --git a/src/util/distro-import/101a/vnc-config.xml b/src/util/distro-import/101a/vnc-config.xml new file mode 100644 --- /dev/null +++ b/src/util/distro-import/101a/vnc-config.xml @@ -0,0 +1,85 @@ +<?xml version="1.0"?> +<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> +<!-- + 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 + + NOTE: This service manifest is not editable; its contents will + be overwritten by package or patch operations, including + operating system upgrade. Make customizations in a different + file. + +--> + +<service_bundle type='manifest' name='SUNWxvmdom:vnc-config'> + +<service + name='system/xvm/vnc-config' + type='service' + version='1'> + + <create_default_instance enabled='false' /> + + <single_instance /> + + <dependency + name='usr' + type='service' + grouping='require_all' + restart_on='none'> + <service_fmri value='svc:/system/filesystem/local' /> + </dependency> + + <exec_method + type='method' + name='start' + exec='/lib/svc/method/xvm-vnc-config %m' + timeout_seconds='60' /> + + <exec_method + type='method' + name='stop' + exec=':true' + timeout_seconds='60' /> + + <property_group name='startd' type='framework'> + <propval name='duration' type='astring' + value='transient' /> + </property_group> + + <stability value='Unstable' /> + + <template> + <common_name> + <loctext xml:lang='C'>xVM VNC Server</loctext> + </common_name> + + <documentation> + <manpage + title='Xorg' + section='1' + manpath='/usr/X11/share/man' /> + </documentation> + </template> +</service> + +</service_bundle> diff --git a/src/util/distro-import/101a/xvm-vnc-config b/src/util/distro-import/101a/xvm-vnc-config new file mode 100644 --- /dev/null +++ b/src/util/distro-import/101a/xvm-vnc-config @@ -0,0 +1,104 @@ +#!/sbin/sh +# +# 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 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# Configure Xvnc if we're in a PV domU. We write the password out to the +# dom0 via xenstore, on the presumption that anyone who can read +# xenstore also has permission to reach this domain during the install. +# We also provide a simple way to enable this post-install for those +# users who are happy doing so. +# + +. /lib/svc/share/smf_include.sh + +case $1 in +"start") + ;; +*) + exit $SMF_EXIT_ERR_FATAL + ;; +esac + +X11FMRI="svc:/application/x11/x11-server" +PASSWDFILE="/etc/X11/.vncpasswd" +PORT=5900 + +check_is_domu() +{ + if [ `uname -p` != "i386" -o `uname -i` != "i86xpv" ]; then + exit $SMF_EXIT_OK + fi + + /usr/sbin/devfsadm -i domcaps + domcaps=`cat /dev/xen/domcaps 2>/dev/null` + echo "$domcaps" | grep "control_d" > /dev/null + if [ $? = 0 ]; then + exit $SMF_EXIT_OK + fi +} + +enable() +{ + PASSWD=`/usr/bin/openssl rand -base64 8 2>/dev/null | cut -c0-8` + printf "%s\n%s\n" "$PASSWD" "$PASSWD" | \ + /usr/bin/vncpasswd $PASSWDFILE >/dev/null + + /usr/sbin/svccfg -s $X11FMRI setprop options/server = astring: \ + "/usr/X11/bin/Xvnc" + echo "setprop options/server_args = astring: " \ + "\"-rfbauth=$PASSWDFILE\"" | /usr/sbin/svccfg -s $X11FMRI + + /usr/lib/xen/bin/xenstore-write guest/vnc/passwd $PASSWD + /usr/lib/xen/bin/xenstore-write guest/vnc/port $PORT +} + +disable() +{ + SERVER=`/usr/bin/svcprop -p options/server $X11FMRI 2>/dev/null` + if [ "$SERVER" = "/usr/X11/bin/Xvnc" ]; then + /usr/sbin/svccfg -s $X11FMRI setprop options/server = \ + astring: "/usr/X11/bin/Xorg" + /usr/sbin/svccfg -s $X11FMRI setprop options/server_args = \ + astring: "" + fi +} + +check_is_domu + +XVMVNC=`/usr/bin/svcprop -p options/xvm_vnc $X11FMRI 2>/dev/null` +if [ -z "$XVMVNC" ]; then + if [ -f /.livecd ]; then + XVMVNC="true" + else + XVMVNC="false" + /usr/sbin/svccfg -s $X11FMRI setprop options/xvm_vnc = \ + astring: $XVMVNC + disable + fi +fi + +if [ "$XVMVNC" = "true" ]; then + enable +fi + +exit $SMF_EXIT_OK diff --git a/src/util/distro-import/98/i386/SUNWxvmipa b/src/util/distro-import/98/i386/SUNWxvmipa --- a/src/util/distro-import/98/i386/SUNWxvmipa +++ b/src/util/distro-import/98/i386/SUNWxvmipa @@ -2,4 +2,5 @@ classification "System/Virtualization" import SUNWxvmipar import SUNWxvmipau +depend SUNWxvmdom end package diff --git a/src/util/distro-import/Makefile b/src/util/distro-import/Makefile --- a/src/util/distro-import/Makefile +++ b/src/util/distro-import/Makefile @@ -97,12 +97,15 @@ lib/svc/method/sshd \ lib/svc/method/svc-coreadm \ lib/svc/method/svc-dlmgmtd \ + lib/svc/method/xvm-vnc-config \ root/.bashrc \ root/.profile \ usr/jdk/instances/jdk1.6.0/jre/lib/fontconfig.properties \ usr/lib/vp-services \ usr/lib/vp-shares \ + var/svc/manifest/application/graphical-login/gdm.xml \ var/svc/manifest/system/coreadm.xml \ + var/svc/manifest/system/xvm/vnc-config.xml \ var/svc/profile/generic_limited_net.xml \ var/svc/profile/generic_open.xml @@ -330,7 +333,8 @@ mkdir -p proto/usr/sbin mkdir -p proto/usr/share/applications mkdir -p proto/usr/share/man - mkdir -p proto/var/svc/manifest/system + mkdir -p proto/var/svc/manifest/application/graphical-login + mkdir -p proto/var/svc/manifest/system/xvm mkdir -p proto/var/svc/profile %/$(TMPPKGS): _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
