2015-02-10 15:18:02 +00:00
|
|
|
#!/bin/bash -e
|
2014-04-24 13:42:18 +00:00
|
|
|
# vim: set ts=4 sw=4 sts=4 et :
|
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
source "${SCRIPTSDIR}/vars.sh"
|
|
|
|
source "${SCRIPTSDIR}/distribution.sh"
|
2014-10-14 16:02:12 +00:00
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
##### '-------------------------------------------------------------------------
|
|
|
|
debug ' Installing Qubes packages'
|
|
|
|
##### '-------------------------------------------------------------------------
|
2014-10-16 16:03:05 +00:00
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
# If .prepared_debootstrap has not been completed, don't continue
|
|
|
|
exitOnNoFile "${INSTALLDIR}/${TMPDIR}/.prepared_groups" "prepared_groups installataion has not completed!... Exiting"
|
2014-04-24 13:42:18 +00:00
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
# Create system mount points
|
|
|
|
prepareChroot
|
2014-10-14 16:02:12 +00:00
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
# ==============================================================================
|
2014-10-22 20:37:26 +00:00
|
|
|
# Execute any template flavor or sub flavor 'pre' scripts
|
2015-02-10 15:18:02 +00:00
|
|
|
# ==============================================================================
|
|
|
|
buildStep "${0}" "pre"
|
|
|
|
|
|
|
|
if ! [ -f "${INSTALLDIR}/${TMPDIR}/.prepared_qubes" ]; then
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
info ' Trap ERR and EXIT signals and cleanup (umount)'
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
trap cleanup ERR
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
info ' Install Qubes packages listed in packages_qubes.list file(s)'
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
installQubesRepo
|
|
|
|
aptUpdate
|
|
|
|
installPackages packages_qubes.list
|
|
|
|
uninstallQubesRepo
|
|
|
|
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
info ' Re-update locales'
|
|
|
|
# Locales get reset during package installation sometimes
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
updateLocale
|
|
|
|
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
info ' Cleanup'
|
|
|
|
#### '----------------------------------------------------------------------
|
|
|
|
umount_all "${INSTALLDIR}/" || true
|
|
|
|
touch "${INSTALLDIR}/${TMPDIR}/.prepared_qubes"
|
|
|
|
trap - ERR EXIT
|
|
|
|
trap
|
2014-10-14 16:02:12 +00:00
|
|
|
fi
|
2014-04-24 13:42:18 +00:00
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
# ==============================================================================
|
2014-10-22 20:37:26 +00:00
|
|
|
# Execute any template flavor or sub flavor 'post' scripts
|
2015-02-10 15:18:02 +00:00
|
|
|
# ==============================================================================
|
|
|
|
buildStep "${0}" "post"
|
2014-04-24 13:42:18 +00:00
|
|
|
|
2015-02-10 15:18:02 +00:00
|
|
|
# ==============================================================================
|
2014-10-28 08:09:55 +00:00
|
|
|
# Kill all processes and umount all mounts within ${INSTALLDIR}, but not
|
2015-02-10 15:18:02 +00:00
|
|
|
# ${INSTALLDIR} itself (extra '/' prevents ${INSTALLDIR} from being umounted)
|
|
|
|
# ==============================================================================
|
|
|
|
umount_all "${INSTALLDIR}/" || true
|