--- mage/branches/alx-0_6_0/profiles/alx-060/forced-uninstall 2011/08/08 08:23:09 2716 +++ mage/branches/alx-0_6_0/profiles/alx-060/forced-uninstall 2011/08/10 16:10:50 2724 @@ -1,18 +1,6 @@ #!/bin/bash # $Id$ -# setup exit trap for reboot -trap_exit() -{ - if [[ -f /.dist-upgrade ]] - then - rm -f /.dist-upgrade - # force a reboot at this point here - ( sleep 3 && reboot -f & ); exit 0 - fi -} -trap "trap_exit" EXIT - # get a suitable environment source /etc/profile @@ -183,8 +171,8 @@ mage install ${BASESYSTEM} unset MAGE_BOOTSTRAP - # fix locale - echo "LANG=\"de_DE\"" > /etc/conf.d/locale +# # fix locale +# echo "LANG=\"de_DE\"" > /etc/conf.d/locale # enable run of orphaned files check touch /.orphaned @@ -202,9 +190,6 @@ touch /.orphaned fi -# etc-update -#etc-update - # clean mage cache mage clean @@ -225,6 +210,13 @@ mage uninstall ${i} done +if [[ -f /.orphaned ]] +then + echo "Searching for orphaned files and directories ..." + bash /etc/mage-profile/prune-orphaned-files + rm -f /.orphaned +fi + if [[ -f /.dist-upgrade ]] then # array of wireless opts @@ -267,29 +259,31 @@ install -d /etc/modprobe.d || die echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > /etc/modprobe.d/uvesafb.conf || die # create an updated initrd - local DISKMODS="sd_mod" - local OLDPATAMODS="amd74xx piix sis5513 via82cxxx" - local PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" - local SATAMODS="sata_via sata_sis sata_nv" - local DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via" - local FBMODS="uvesafb" + DISKMODS="sd_mod" + OLDPATAMODS="amd74xx piix sis5513 via82cxxx" + PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" + SATAMODS="sata_via sata_sis sata_nv" + DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via" + FBMODS="uvesafb" echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd - local kernelver=$(readlink /boot/vmlinuz | sed 's:kernel-::') + kernelver=$(readlink /boot/vmlinuz | sed 's:kernel-::') mkinitrd -f /boot/initrd-${kernelver}.img ${kernelver} # update grub bootloader updategrub2 fi -if [[ -f /.orphaned ]] +if [[ -f /.dist-upgrade ]] then - echo "Searching for orphaned files and directories ..." - bash /etc/mage-profile/prune-orphaned-files - rm -f /.orphaned + echo "preparing a reboot in 60 seconds ..." + # reboot via cronjob + [[ ! -d /var/spool/cron/crontabs ]] && install -d /var/spool/cron/crontabs + # setup a proper cronjob + tmp=$(mktemp) + echo "* * * * * crontab -r && reboot -f" > ${tmp} + crontab ${tmp} + [[ -f ${tmp} ]] && rm -f ${tmp} + # start cron daemon in background + crond -b -S fi -#if [[ -f /.dist-upgrade ]] -#then -# rm -f /.dist-upgrade -# # force a reboot at this point here -# ( reboot -f & ); exit 0 -#fi +exit 0