PackageKit: Remove hard coded first boot package processing scripts.

Once change 2342 is in place (running first boot scripts exported from
packages), see https://review.haiku-os.org/c/haiku/+/2342,
remove data/system/boot/post_install/add_catalog_entry_attributes.sh
and related support infrastructure (magic files, launch_roster entries).

The work this script did can in fact be done at image creation time
instead of at first boot.

Change-Id: I485e1a0a87c3e6a6ba3f882e65996f2327134d37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3751
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Alexander G. M. Smith 2021-02-22 14:55:00 -05:00 committed by Adrien Destugues
parent a4caca440c
commit b5efad4eae
21 changed files with 38 additions and 109 deletions

View File

@ -3,7 +3,7 @@
# create directories that may remain empty
AddDirectoryToHaikuImage home : home.rdef ;
AddDirectoryToHaikuImage home Desktop ;
AddDirectoryToHaikuImage home Desktop : home-desktop.rdef ;
AddDirectoryToHaikuImage home mail ;
AddDirectoryToHaikuImage home config : home-config.rdef ;
AddDirectoryToHaikuImage home config cache ;
@ -42,6 +42,7 @@ AddDirectoryToHaikuImage system non-packaged add-ons Screen\ Savers ;
AddDirectoryToHaikuImage system non-packaged add-ons Translators ;
AddDirectoryToHaikuImage system var empty ;
AddDirectoryToHaikuImage system var log ;
AddDirectoryToHaikuImage trash : trash.rdef ;
#pragma mark - Optional Packages

View File

@ -277,11 +277,6 @@ SEARCH on $(networkSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings network ] ;
AddFilesToHaikuImage system settings network : $(networkSettingsFiles) ;
# fresh install indicator file for the post install scripts
SEARCH on <post-install>fresh_install
= [ FDirName $(HAIKU_TOP) data system settings ] ;
AddFilesToHaikuImage system settings : <post-install>fresh_install ;
# repository config and cache files
local repository ;
for repository in $(HAIKU_REPOSITORIES) {

View File

@ -250,9 +250,13 @@ SYSTEM_ADD_ONS_FILE_SYSTEMS +=
;
# Mailbox folders and symlink
AddDirectoryToHaikuImage home mail draft ;
AddDirectoryToHaikuImage home mail in ;
AddDirectoryToHaikuImage home mail out ;
AddDirectoryToHaikuImage home mail : home-mail.rdef ;
AddDirectoryToHaikuImage home mail draft : home-mail-draft.rdef ;
AddDirectoryToHaikuImage home mail in : home-mail-in.rdef ;
AddDirectoryToHaikuImage home mail out : home-mail-out.rdef ;
AddDirectoryToHaikuImage home mail queries : home-mail-queries.rdef ;
AddDirectoryToHaikuImage home mail sent : home-mail-sent.rdef ;
AddDirectoryToHaikuImage home mail spam : home-mail-spam.rdef ;
# Add boot launch directory
AddDirectoryToHaikuImage home config settings boot launch ;
@ -262,6 +266,8 @@ AddFilesToHaikuImage home config settings Mail ProviderInfo :
$(HAIKU_PROVIDER_INFOS) ;
# Add Tracker New Templates
AddDirectoryToHaikuImage home config settings Tracker "Tracker New Templates"
: tracker-new-templates.rdef ;
AddFilesToHaikuImage home config settings Tracker "Tracker New Templates"
:
"<tracker-new-templates>C++ header"
@ -278,4 +284,4 @@ AddDirectoryToHaikuImage home config settings printers "Save as PDF"
: home-config-settings-printers-save-as-pdf.rdef ;
# padblocker
AddDirectoryToHaikuImage home config settings touchpad ;
AddDirectoryToHaikuImage home config settings touchpad ;

View File

@ -135,13 +135,7 @@ local userLaunchScripts = <data!launch>user ;
SEARCH on $(userLaunchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
AddFilesToPackage data user_launch : $(userLaunchScripts) ;
# post install + first login scripts
local postInstallFiles = add_catalog_entry_attributes.sh ;
postInstallFiles = $(postInstallFiles:G=post-install) ;
SEARCH on $(postInstallFiles)
= [ FDirName $(HAIKU_TOP) data system boot post_install ] ;
AddFilesToPackage boot post-install : $(postInstallFiles) ;
# first login scripts
local firstLoginFiles = default_deskbar_items.sh ;
firstLoginFiles = $(firstLoginFiles:G=first-login) ;
SEARCH on $(firstLoginFiles)
@ -275,21 +269,27 @@ AddDirectoryToPackage preferences : system-preferences.rdef ;
# Deskbar menu symlinks
# "Applications" links
local linkTarget ;
# "Applications" links
AddDirectoryToPackage data deskbar menu Applications
: deskbar-applications.rdef ;
for linkTarget in $(DESKBAR_APPLICATIONS) {
AddSymlinkToPackage data deskbar menu Applications
: ../../../../apps/$(linkTarget) : $(linkTarget) ;
}
# "Desktop applets" links
AddDirectoryToPackage data deskbar menu Desktop\ applets
: deskbar-applets.rdef ;
for linkTarget in $(DESKBAR_DESKTOP_APPLETS) {
AddSymlinkToPackage data deskbar menu Desktop\ applets
: ../../../../apps/$(linkTarget) : $(linkTarget) ;
}
# "Preferences" links
AddDirectoryToPackage data deskbar menu Preferences ;
AddDirectoryToPackage data deskbar menu Preferences
: deskbar-preferences.rdef ;
DESKBAR_PREFERENCES = $(SYSTEM_PREFERENCES:B) ;
for linkTarget in $(DESKBAR_PREFERENCES) {
AddSymlinkToPackage data deskbar menu Preferences
@ -298,7 +298,8 @@ for linkTarget in $(DESKBAR_PREFERENCES) {
}
# "Demo" links
AddDirectoryToPackage data deskbar menu Demos ;
AddDirectoryToPackage data deskbar menu Demos
: deskbar-demos.rdef ;
for linkTarget in $(SYSTEM_DEMOS) {
AddSymlinkToPackage data deskbar menu Demos
: ../../../../demos/$(linkTarget) : $(linkTarget) ;

View File

@ -73,11 +73,6 @@ job x-vnd.Haiku-cddb_lookup {
on volume_mounted
}
job post-install {
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
}
target login {
job x-vnd.Haiku-autologin {
launch /system/bin/autologin

View File

@ -1,83 +0,0 @@
#!/bin/sh
WriteCatalogEntryAttribute()
{
# $1 : signature
# $2 : path
# $3 : context
if ! [ -e "$2" ]
then
mkdir --parents "$2"
fi
addattr -t string SYS:NAME "$1:$3:$(basename "$2")" "$2"
}
WriteTrackerCatalogEntryAttribute()
{
WriteCatalogEntryAttribute "x-vnd.Haiku-libtracker" "$1" "$2"
}
WriteDeskbarCatalogEntryAttribute()
{
WriteCatalogEntryAttribute "x-vnd.Be-TSKB" "$1" "$2"
}
WriteMailCatalogEntryAttribute()
{
WriteCatalogEntryAttribute "x-vnd.Be-MAIL" "$1" "$2"
}
# TODO: Several of the directories are read-only, so this doesn't work.
WriteTrackerCatalogEntryAttribute \
"$(finddir B_DESKTOP_DIRECTORY)" B_DESKTOP_DIRECTORY
WriteTrackerCatalogEntryAttribute \
"$(finddir B_USER_SETTINGS_DIRECTORY)/Tracker/Tracker New Templates" \
"B_USER_SETTINGS_DIRECTORY/Tracker/Tracker New Templates"
WriteTrackerCatalogEntryAttribute \
"$(finddir B_TRASH_DIRECTORY)" B_TRASH_DIRECTORY
WriteDeskbarCatalogEntryAttribute \
"$(finddir B_USER_DESKBAR_DIRECTORY)/Applications" "B_USER_DESKBAR_DIRECTORY/Applications"
WriteDeskbarCatalogEntryAttribute \
"$(finddir B_USER_DESKBAR_DIRECTORY)/Demos" "B_USER_DESKBAR_DIRECTORY/Demos"
WriteDeskbarCatalogEntryAttribute \
"$(finddir B_USER_DESKBAR_DIRECTORY)/Desktop applets" "B_USER_DESKBAR_DIRECTORY/Desktop applets"
WriteDeskbarCatalogEntryAttribute \
"$(finddir B_USER_DESKBAR_DIRECTORY)/Preferences" "B_USER_DESKBAR_DIRECTORY/Preferences"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail" "B_USER_DIRECTORY/mail"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail/draft" "B_USER_DIRECTORY/mail/draft"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail/in" "B_USER_DIRECTORY/mail/in"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail/out" "B_USER_DIRECTORY/mail/out"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail/queries" "B_USER_DIRECTORY/mail/queries"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail/sent" "B_USER_DIRECTORY/mail/sent"
WriteMailCatalogEntryAttribute \
"$(finddir B_USER_DIRECTORY)/mail/spam" "B_USER_DIRECTORY/mail/spam"

View File

@ -1 +0,0 @@
This file is only supposed to exist on fresh Haiku installations.

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-TSKB:B_USER_DESKBAR_DIRECTORY/Desktop applets:Desktop applets";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-TSKB:B_USER_DESKBAR_DIRECTORY/Applications:Applications";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-TSKB:B_USER_DESKBAR_DIRECTORY/Demos:Demos";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-TSKB:B_USER_DESKBAR_DIRECTORY/Preferences:Preferences";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Haiku-libtracker:B_DESKTOP_DIRECTORY:home";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail/draft:draft";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail/in:in";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail/out:out";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail/queries:queries";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail/sent:sent";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail/spam:spam";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Be-MAIL:B_USER_DIRECTORY/mail:mail";

View File

@ -0,0 +1,2 @@
resource(0, "SYS:NAME") "x-vnd.Haiku-libtracker:B_USER_SETTINGS_DIRECTORY/Tracker/Tracker New Templates:Tracker New Templates";

View File

@ -0,0 +1 @@
resource(0, "SYS:NAME") "x-vnd.Haiku-libtracker:B_TRASH_DIRECTORY:Trash";