diff --git a/scripts/first_run.sh b/scripts/first_run.sh new file mode 100755 index 00000000..c92af453 --- /dev/null +++ b/scripts/first_run.sh @@ -0,0 +1,39 @@ +#! /bin/bash + +#======================================================================== +# Author: Edoardo Pasca +# Copyright 2018 Science Technology Facilities Council +# +# This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) virtual machine. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0.txt +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#========================================================================= + +# script to adjust gnome settings and other bits to be run only once +# after VM is created + +PID=$(pgrep -u sirfuser gnome-session) +export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) +export DISPLAY=$(grep -z DISPLAY /proc/$PID/environ | cut -d= -f2-) +#echo "display " $DISPLAY " dbus " $DBUS_SESSION_BUS_ADDRESS + +# add input sources +gsettings set org.gnome.desktop.input-sources sources "[('xkb','uk'), ('xkb','us'),('xkb','de'),('xkb','fr'),('xkb','es'),('xkb','it'),('xkb','pt'),('xkb','br'),('xkb','jp'),('xkb','cn')]" +# remove screen lock for sirfuser +gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true' + +#zerofill +dd if=/dev/zero of=/tmp/EMPTY bs=1M +rm -f /tmp/EMPTY + diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index 4ce07262..0c0a45e6 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -1,3 +1,24 @@ +#======================================================================== +# Author: Edoardo Pasca, Ben Thomas +# Copyright 2018 University College London +# Copyright 2018 Science Technology Facilities Council +# +# This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) virtual machine. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0.txt +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#========================================================================= + Vagrant.configure("2") do |config| config.vm.box = "ubuntu/xenial64" config.vm.synced_folder '.', '/vagrant', disabled: true @@ -95,6 +116,7 @@ Vagrant.configure("2") do |config| sudo locale-gen en_US.UTF-8 sudo locale-gen de_DE.UTF-8 sudo locale-gen fr_FR.UTF-8 + sudo locale-gen es_ES.UTF-8 sudo locale-gen it_IT.UTF-8 sudo locale-gen pt_PT.UTF-8 sudo locale-gen pt_BR.UTF-8 @@ -115,10 +137,8 @@ Vagrant.configure("2") do |config| sudo echo 'SystemAccount=true' >> vagrant sudo cp -v vagrant /var/lib/AccountsService/users/vagrant - # To Ubuntu user from login screen: - #sudo echo '[User]' > Ubuntu - #sudo echo 'SystemAccount=true' >> Ubuntu - #sudo cp -v Ubuntu /var/lib/AccountsService/users/Ubuntu + # To remove the Ubuntu user from VM: + sudo deluser --remove-home ubuntu # Could add custom logos here: /etc/gdm3/greeter.dconf-defaults cd /opt