Merge branch 'master' of git.qubes-os.org:/var/lib/qubes/git/marmarek/core

This commit is contained in:
Joanna Rutkowska 2012-07-13 13:25:55 +02:00
commit 0fd1e2d7dc
6 changed files with 44 additions and 14 deletions

View File

@ -1612,12 +1612,6 @@ class QubesTemplateVm(QubesVm):
raise IOError ("Error while copying {0} to {1}".\
format(self.clean_img, self.volatile_img))
if verbose:
print >> sys.stderr, "--> Copying the template's DispVM prerun script..."
retcode = subprocess.call (["cp", src_vm.dir_path + '/dispvm-prerun.sh', self.dir_path + '/dispvm-prerun.sh'])
if retcode != 0:
raise IOError ("Error while copying DispVM prerun script")
# Create root-cow.img
self.commit_changes(verbose=verbose)

View File

@ -1,11 +1,15 @@
#!/bin/bash
get_encoded_script()
{
if ! [ -f "$1" ] ; then
if [ "$1" == "vm-default" ]; then
SCRIPT_CMD="echo /usr/lib/qubes/dispvm-prerun.sh"
elif ! [ -f "$1" ] ; then
echo $1 is not a file ?
exit 1
else
SCRIPT_CMD="cat $1"
fi
ENCODED_SCRIPT=`cat "$1" | perl -e 'use MIME::Base64 qw(encode_base64); local($/) = undef;print encode_base64(<STDIN>)'|tr -d "\n"`
ENCODED_SCRIPT=`$SCRIPT_CMD | perl -e 'use MIME::Base64 qw(encode_base64); local($/) = undef;print encode_base64(<STDIN>)'|tr -d "\n"`
}
if [ $# != 2 -a $# != 3 ] ; then

View File

@ -21,13 +21,9 @@ if [ "$TEMPLATENAME" = --default-template ] ; then
fi
if [ "X""$2" = "X""--default-script" ] ; then
SCRIPTNAME="/var/lib/qubes/vm-templates/$TEMPLATENAME"/dispvm-prerun.sh
if ! [ -f $SCRIPTNAME ] ; then
echo $SCRIPTNAME does not exist
exit 1
fi
SCRIPTNAME="vm-default"
else
SCRIPTNAME=$2
SCRIPTNAME=$2
fi
if ! [ -d "/var/lib/qubes/vm-templates/$TEMPLATENAME" ] ; then

BIN
misc/dispvm-dotfiles.tbz Normal file

Binary file not shown.

27
misc/dispvm-prerun.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
apps="evince /usr/libexec/evinced soffice firefox"
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >/tmp/dispvm-dotfiles-errors.log
for app in $apps ; do
echo "Launching: $app..."
$app >>/tmp/dispvm_prerun_errors.log 2>&1 &
done
echo "Sleeping..."
PREV_IO=0
while true; do
IO=`vmstat -D | awk '/read|write/ {IOs+=$1} END {print IOs}'`
if [ $IO -lt $[ $PREV_IO + 50 ] ]; then
break;
fi
PREV_IO=$IO
sleep 1
done
ps ax > /tmp/dispvm-prerun-proclist.log
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >>/tmp/dispvm-dotfiles-errors.log
echo done.

View File

@ -119,6 +119,13 @@ install misc/qubes_trigger_sync_appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes/
install -D -m 0644 misc/qubes_trigger_sync_appmenus.action $RPM_BUILD_ROOT/etc/yum/post-actions/qubes_trigger_sync_appmenus.action
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
if [ -r misc/dispvm-dotfiles.%{dist}.tbz ]; then
install misc/dispvm-dotfiles.%{dist}.tbz $RPM_BUILD_ROOT/etc/dispvm-dotfiles.tbz
else
install misc/dispvm-dotfiles.tbz $RPM_BUILD_ROOT/etc/dispvm-dotfiles.tbz
fi
install misc/dispvm-prerun.sh $RPM_BUILD_ROOT/usr/lib/qubes/dispvm-prerun.sh
install -D misc/qubes_core.modules $RPM_BUILD_ROOT/etc/sysconfig/modules/qubes_core.modules
install -m 0644 network/qubes_network.rules $RPM_BUILD_ROOT/etc/udev/rules.d/99-qubes_network.rules
@ -355,6 +362,7 @@ rm -rf $RPM_BUILD_ROOT
/etc/NetworkManager/dispatcher.d/30-qubes_external_ip
/etc/NetworkManager/dispatcher.d/qubes_nmhook
/etc/X11/xorg-preload-apps.conf
/etc/dispvm-dotfiles.tbz
/etc/dhclient.d/qubes_setup_dnat_to_ns.sh
/etc/fstab
/etc/pki/rpm-gpg/RPM-GPG-KEY-qubes*
@ -386,6 +394,7 @@ rm -rf $RPM_BUILD_ROOT
/usr/lib/qubes/block_add_change
/usr/lib/qubes/block_cleanup
/usr/lib/qubes/block_remove
/usr/lib/qubes/dispvm-prerun.sh
/usr/lib/qubes/sync-ntp-clock
/usr/lib/qubes/meminfo-writer
/usr/lib/qubes/network-manager-prepare-conf-dir