diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 7b0ad68312..a93a5aaded 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -337,9 +337,12 @@ SEARCH on $(networkSettingsFiles) = [ FDirName $(HAIKU_TOP) data settings network ] ; AddFilesToHaikuImage common settings network : $(networkSettingsFiles) ; -# fresh install indicator file -SEARCH on fresh_install = [ FDirName $(HAIKU_TOP) data settings ] ; -AddFilesToHaikuImage home config settings : fresh_install ; +# post install scripts and fresh install indicator file +local postInstallFiles = fresh_install mime_update.sh ; +postInstallFiles = $(postInstallFiles:G=post-install) ; +SEARCH on $(postInstallFiles) + = [ FDirName $(HAIKU_TOP) data etc post_install ] ; +AddFilesToHaikuImage beos etc post_install : $(postInstallFiles) ; # boot loader AddFilesToHaikuImage beos system : zbeos ; diff --git a/data/settings/fresh_install b/data/etc/post_install/fresh_install similarity index 100% rename from data/settings/fresh_install rename to data/etc/post_install/fresh_install diff --git a/data/etc/post_install/mime_update.sh b/data/etc/post_install/mime_update.sh new file mode 100755 index 0000000000..78f7bca9b7 --- /dev/null +++ b/data/etc/post_install/mime_update.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Make sure all apps have a MIME DB entry. + +mimeset -apps -f /boot/beos/apps +mimeset -apps -f /boot/beos/preferences +mimeset -apps -f /boot/beos/system/servers +mimeset -apps -f /boot/apps diff --git a/data/system/boot/Bootscript b/data/system/boot/Bootscript index a49feb3d8d..085ca6d7f7 100644 --- a/data/system/boot/Bootscript +++ b/data/system/boot/Bootscript @@ -138,12 +138,21 @@ if [ "$SAFEMODE" != "yes" ]; then fi fi -# Check for fresh install and register all bundled app mimetypes -FRESH_INSTALL_INDICATOR_FILE=$HOME/config/settings/fresh_install -if [ -e $FRESH_INSTALL_INDICATOR_FILE ]; then -# mimeset -all -f /boot/beos/apps -# mimeset -all -f /boot/beos/preferences -# mimeset -all -f /boot/beos/system/servers -# mimeset -all -f /boot/apps - rm $FRESH_INSTALL_INDICATOR_FILE +# Check for fresh install and run post install scripts. +postInstallDir=/boot/beos/etc/post_install +freshInstallIndicator=$postInstallDir/fresh_install +if [ -e $freshInstallIndicator ]; then + # wait a moment for things to calm down a bit + sleep 3 + + # execute scripts + for f in $postInstallDir/*.sh; do + if [ -f $f ]; then + echo "Running post install script $f ..." > /dev/dprintf + $f + fi + done + + sync + rm $freshInstallIndicator fi