--- trunk/installer-simple/bin/installer.sh.in 2014/01/07 13:13:26 2399 +++ trunk/installer-simple/bin/installer.sh.in 2014/01/07 13:27:16 2409 @@ -22,13 +22,20 @@ exit 1 } -# configuration -if [ -e %SYSCONFDIR%/installer.conf ] -then - source %SYSCONFDIR%/installer.conf -else - die "/etc/installer.conf not found" -fi +# load common includes +for inc in %SYSCONFDIR%/installer.conf \ + ${INSTALLER_LIBDIR}/functions/common.sh \ + ${INSTALLER_LIBDIR}/functions/common-dialogs.sh \ + ${INSTALLER_LIBDIR}/functions/hwdetection.sh \ + ${INSTALLER_LIBDIR}/functions/installer-dialogs.sh +do + if [ -e ${inc} ] + then + source "${inc}" + else + die "'${inc}' not found" + fi +done # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 ! # -> now in images.conf @@ -45,37 +52,38 @@ die "/mnt/cdrom/system/images.conf not found" fi -# includes -source ${INSTALLER_LIBDIR}/functions/hwdetection.sh - ### System/Config Version VERSION="%VERSIONTAG%" TITLE="${DEFAULT_TITLE} - ${VERSION}" +# some sane defaults CDROOT="${DEFAULT_CDROOT}" INSTALLROOT="${DEFAULT_INSTALLROOT}" - -# standard kernel opts -KERNELOPTS="quiet video=1024x768" - -# grub options +KERNELPKG="${DEFAULT_KERNELPKG}" +KERNELOPTS="${DEFAULT_KERNELOPTS}" GRUBLEGACYOPTS="" GRUB2OPTS="" - -# fdisk options FDISKPARTIONBELOW256MB=0 - -# default specialdevices SPECIALDEVICE="" -FORMFACTOR="desktop" - -# target filesystem +FORMFACTOR="${DEFAULT_FORMFACTOR}" FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" ################################################# # DIALOG BOXEN # ################################################# +trap_exit() +{ + is_mounted --location "${INSTALLROOT}/dev" && umount ${INSTALLROOT}/dev + is_mounted --location "${INSTALLROOT}/proc" && umount ${INSTALLROOT}/proc + is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys + is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot + is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT} + + echo $"Installation aborted." + exit 1 +} + dialog_die() { ERROR="$1" @@ -867,6 +875,9 @@ dialog_install_successful } +# set some proper traps +trap "trap_exit" SIGINT SIGQUIT + dialog_main exit 0