Moved per user post install actions to first-login script.
* The same mechanism (and the same PostInstallScript) is used for this. * If a file first_login exists in ~/config/settings/boot, the first-login scripts are launched, and the file removed. * This fixes adding the deskbar tray icons even when there is no Deskbar running yet (for example on first boot when the FirstBootPrompt starts), or, IOW bug #12275.
This commit is contained in:
@@ -254,6 +254,10 @@ local userBootScripts = UserBootscript UserSetupEnvironment.sample ;
|
|||||||
SEARCH on $(userBootScripts) = [ FDirName $(HAIKU_TOP) data config boot ] ;
|
SEARCH on $(userBootScripts) = [ FDirName $(HAIKU_TOP) data config boot ] ;
|
||||||
AddFilesToHaikuImage home config settings boot : $(userBootScripts) ;
|
AddFilesToHaikuImage home config settings boot : $(userBootScripts) ;
|
||||||
|
|
||||||
|
SEARCH on <user-first-login>first_login
|
||||||
|
= [ FDirName $(HAIKU_TOP) data settings ] ;
|
||||||
|
AddFilesToHaikuImage home config settings : <user-first-login>first_login ;
|
||||||
|
|
||||||
local etcDir = [ FDirName $(HAIKU_TOP) data etc ] ;
|
local etcDir = [ FDirName $(HAIKU_TOP) data etc ] ;
|
||||||
local etcFiles = inputrc profile ;
|
local etcFiles = inputrc profile ;
|
||||||
etcFiles = $(etcFiles:G=etc) ;
|
etcFiles = $(etcFiles:G=etc) ;
|
||||||
|
|||||||
@@ -137,14 +137,19 @@ local userLaunchScripts = <data!launch>user ;
|
|||||||
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
|
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
|
||||||
AddFilesToPackage data user_launch : $(userLaunchScripts) ;
|
AddFilesToPackage data user_launch : $(userLaunchScripts) ;
|
||||||
|
|
||||||
# post install scripts
|
# post install + first login scripts
|
||||||
local postInstallFiles = add_catalog_entry_attributes.sh
|
local postInstallFiles = add_catalog_entry_attributes.sh ;
|
||||||
default_deskbar_items.sh ;
|
|
||||||
postInstallFiles = $(postInstallFiles:G=post-install) ;
|
postInstallFiles = $(postInstallFiles:G=post-install) ;
|
||||||
SEARCH on $(postInstallFiles)
|
SEARCH on $(postInstallFiles)
|
||||||
= [ FDirName $(HAIKU_TOP) data system boot post_install ] ;
|
= [ FDirName $(HAIKU_TOP) data system boot post_install ] ;
|
||||||
AddFilesToPackage boot post-install : $(postInstallFiles) ;
|
AddFilesToPackage boot post-install : $(postInstallFiles) ;
|
||||||
|
|
||||||
|
local firstLoginFiles = default_deskbar_items.sh ;
|
||||||
|
firstLoginFiles = $(firstLoginFiles:G=first-login) ;
|
||||||
|
SEARCH on $(firstLoginFiles)
|
||||||
|
= [ FDirName $(HAIKU_TOP) data system boot first_login ] ;
|
||||||
|
AddFilesToPackage boot first-login : $(firstLoginFiles) ;
|
||||||
|
|
||||||
# artwork and sounds
|
# artwork and sounds
|
||||||
local logoArtwork =
|
local logoArtwork =
|
||||||
$(HAIKU_INCLUDE_TRADEMARKS)"HAIKU logo - white on blue - big.png"
|
$(HAIKU_INCLUDE_TRADEMARKS)"HAIKU logo - white on blue - big.png"
|
||||||
|
|||||||
@@ -134,12 +134,12 @@ local userLaunchScripts = <data!launch>user ;
|
|||||||
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
|
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
|
||||||
AddFilesToPackage data user_launch : $(userLaunchScripts) ;
|
AddFilesToPackage data user_launch : $(userLaunchScripts) ;
|
||||||
|
|
||||||
# post install scripts
|
# first login scripts
|
||||||
local postInstallFiles = default_deskbar_items.sh ;
|
local firstLoginFiles = default_deskbar_items.sh ;
|
||||||
postInstallFiles = $(postInstallFiles:G=post-install) ;
|
firstLoginFiles = $(firstLoginFiles:G=first-login) ;
|
||||||
SEARCH on $(postInstallFiles)
|
SEARCH on $(firstLoginFiles)
|
||||||
= [ FDirName $(HAIKU_TOP) data system boot post_install ] ;
|
= [ FDirName $(HAIKU_TOP) data system boot first_login ] ;
|
||||||
AddFilesToPackage boot post-install : $(postInstallFiles) ;
|
AddFilesToPackage boot first_login : $(firstLoginFiles) ;
|
||||||
|
|
||||||
local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes
|
local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes
|
||||||
: [a-zA-Z0-9]* ] ;
|
: [a-zA-Z0-9]* ] ;
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ job x-vnd.Haiku-cddb_lookup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
job post-install {
|
job post-install {
|
||||||
launch /bin/sh /system/boot/PostInstallScript
|
launch /bin/sh /system/boot/PostInstallScript "post install" /boot/system/settings/fresh_install /boot/system/boot/post-install
|
||||||
if file_exists /boot/system/settings/fresh_install
|
if file_exists /boot/system/settings/fresh_install
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ target desktop {
|
|||||||
launch /bin/sh ~/config/settings/boot/UserBootscript
|
launch /bin/sh ~/config/settings/boot/UserBootscript
|
||||||
}
|
}
|
||||||
|
|
||||||
|
job first-login {
|
||||||
|
launch /bin/sh /system/boot/PostInstallScript "first login" ~/config/settings/first_login /boot/system/boot/first-login
|
||||||
|
if file_exists ~/config/settings/first_login
|
||||||
|
}
|
||||||
|
|
||||||
job create-installer-link {
|
job create-installer-link {
|
||||||
# When run from a read-only medium a.k.a. live desktop
|
# When run from a read-only medium a.k.a. live desktop
|
||||||
if {
|
if {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
@@ -2,17 +2,16 @@
|
|||||||
|
|
||||||
# Check for fresh install and run post install scripts.
|
# Check for fresh install and run post install scripts.
|
||||||
|
|
||||||
freshInstallIndicator=/boot/system/settings/fresh_install
|
title=$1
|
||||||
postInstallDir=boot/post-install
|
freshInstallIndicator=$2
|
||||||
if [ -e $freshInstallIndicator ]; then
|
postInstallDir=$3
|
||||||
# wait a moment for things to calm down a bit
|
|
||||||
sleep 3
|
|
||||||
|
|
||||||
|
if [ -e $freshInstallIndicator ]; then
|
||||||
# execute scripts
|
# execute scripts
|
||||||
for f in /boot/system/$postInstallDir/*.sh
|
for f in $postInstallDir/*.sh
|
||||||
do
|
do
|
||||||
if [ -f $f ]; then
|
if [ -f $f ]; then
|
||||||
echo "Running post install script $f ..." > /dev/dprintf
|
echo "Running $title script $f ..." > /dev/dprintf
|
||||||
$f
|
$f
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user