#!/bin/sh dev=/dev/xvdb if mountpoint -q /rw ; then # This means /rw is mounted now. echo "Checking /rw" >&2 echo "Private device size management: enlarging $dev" >&2 if content=$(resize2fs "$dev" 2>&1) ; then echo "Private device size management: resize2fs of $dev succeeded" >&2 else echo "Private device size management: resize2fs $dev failed:" >&2 echo "$content" >&2 fi if ! [ -d /rw/config ] ; then echo "Virgin boot of the VM: populating /rw/config" >&2 mkdir -p /rw/config touch /rw/config/rc.local cat > /rw/config/rc.local < /rw/config/qubes-firewall-user-script < /rw/config/suspend-module-blacklist <&2 cp -af /usr/local.orig /rw/usrlocal else echo "Virgin boot of the VM: creating /rw/usrlocal" >&2 mkdir -p /rw/usrlocal fi fi echo "Finished checking /rw" >&2 fi # Old Qubes versions had symlink /home -> /rw/home; now we use mount --bind if [ -L /home ]; then rm /home mkdir /home fi if [ ! -e /var/lib/qubes/first-boot-completed ]; then touch /var/lib/qubes/first-boot-completed fi