haiku/data/system/boot/PostInstallScript
Alexander G. M. Smith 3376ed1a72 Package Kit: Proper Installation for First Boot Packages
Do the final installation operations for all the packages in the
/system/packages directory when the OS is booted for the first time.

This will run their post-install scripts, create users, groups and generate
settings files (marked with a package version attribute).  Previously we just
ran all the shell scripts found in the /system/boot/post-install directory
(don't do that as much now).

Fixes bug #14382

This patch has simpler code flow in CommitTransactionHandler::_ApplyChanges
Tested on 32 and 64 bit systems.  Once it's official, need to remove the
open_ssh redundant post-install script that creates users etc. from HaikuPorts.
Now we can notice bugs like package version attributes on settings files aren't
fully working. :-)

Didn't remove special case for add_catalog_entry_attributes.sh since it
still does stuff that the build system doesn't do.  Might be able to add
that script as part of the Haiku.hpkg.  See change 3751 for removing it,
https://review.haiku-os.org/c/haiku/+/3751

Change-Id: I3807b78042fdb70e5a79eca2e2a45816ece0236f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2342
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-14 09:10:18 +00:00

40 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# Check for fresh install and run oddball system post install stuff that the
# package_daemon doesn't handle. All Home and other post install scripts
# get run the old way here (probably won't be any, unless you reinstalled?).
title=$1
freshInstallIndicator=$2
postInstallDir=$3
if [ -e $freshInstallIndicator ]; then
# execute scripts
if [ "$postInstallDir" == "/boot/system/boot/post-install" ]; then
# Special case for one script file that isn't in a package. Rest
# of the files in there will be run by package_daemon when
# doing first boot processing. Can be removed when Gerrit
# Change #3751 is done.
specialCaseFile="$postInstallDir/add_catalog_entry_attributes.sh"
if [ -e "$specialCaseFile" ]; then
echo "Running $title special case $specialCaseFile first boot processing." > /dev/dprintf
"$specialCaseFile"
else
echo "Skipping $title obsolete first boot processing, files:" > /dev/dprintf
ls "$postInstallDir" > /dev/dprintf
fi
else
for f in $postInstallDir/*.sh
do
if [ -f $f ]; then
echo "Running $title script $f ..." > /dev/dprintf
$f
fi
done
fi
sync
rm $freshInstallIndicator
fi