Boot the system via launch_daemon.

* This is actually working already, although we cannot reproduce all
  the features of the former Bootscript yet. This is without any
  dependency support in launch_daemon.
* All shell activity like cleaning out /tmp, setting up the environment,
  setting the time, etc. is not yet working.
This commit is contained in:
Axel Dörfler
2015-07-22 20:40:33 +02:00
parent 592ffe6461
commit 89168ad8b9
4 changed files with 31 additions and 14 deletions
+1
View File
@@ -115,6 +115,7 @@ SYSTEM_SERVERS = [ FFilterByBuildFeatures
debug_server dns_resolver_server debug_server dns_resolver_server
input_server input_server
keystore_server keystore_server
launch_daemon
mount_server mount_server
net_server notification_server net_server notification_server
package_daemon power_daemon package_daemon power_daemon
+5 -2
View File
@@ -124,11 +124,14 @@ AddSymlinkToPackage bin : trash : untrash ;
AddSymlinkToPackage bin : less : more ; AddSymlinkToPackage bin : less : more ;
# scripts and data files # scripts and data files
local bootScripts = Bootscript Bootscript.cd SetupEnvironment local bootScripts = SetupEnvironment InstallerInitScript InstallerFinishScript ;
InstallerInitScript InstallerFinishScript ;
SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ; SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ;
AddFilesToPackage boot : $(bootScripts) ; AddFilesToPackage boot : $(bootScripts) ;
local launchScripts = <data!launch>system ;
SEARCH on $(launchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
AddFilesToPackage data launch : $(launchScripts) ;
# post install scripts # post install scripts
local postInstallFiles = add_catalog_entry_attributes.sh local postInstallFiles = add_catalog_entry_attributes.sh
default_deskbar_items.sh ; default_deskbar_items.sh ;
+10
View File
@@ -14,6 +14,7 @@ service x-vnd.Haiku-debug_server {
service x-vnd.Haiku-package_daemon { service x-vnd.Haiku-package_daemon {
launch /system/servers/package_daemon launch /system/servers/package_daemon
create_port
} }
service x-vnd.Haiku-syslog_daemon { service x-vnd.Haiku-syslog_daemon {
@@ -58,3 +59,12 @@ service x-vnd.Haiku-power_daemon {
launch /system/servers/power_daemon launch /system/servers/power_daemon
no_safemode no_safemode
} }
# The following will be moved into the user launch data
service x-vnd.Be-TRAK {
launch /system/Tracker
}
service x-vnd.Be-TSKB {
launch /system/Deskbar
}
+15 -12
View File
@@ -358,28 +358,31 @@ main2(void* /*unused*/)
// start the init process // start the init process
{ {
KPath bootScriptPath; KPath serverPath;
status_t status = __find_directory(B_SYSTEM_BOOT_DIRECTORY, gBootDevice, status_t status = __find_directory(B_SYSTEM_SERVERS_DIRECTORY,
false, bootScriptPath.LockBuffer(), bootScriptPath.BufferSize()); gBootDevice, false, serverPath.LockBuffer(),
serverPath.BufferSize());
if (status != B_OK) if (status != B_OK)
dprintf("main2: find_directory() failed: %s\n", strerror(status)); dprintf("main2: find_directory() failed: %s\n", strerror(status));
bootScriptPath.UnlockBuffer(); serverPath.UnlockBuffer();
status = bootScriptPath.Append("/Bootscript"); status = serverPath.Append("/launch_daemon");
if (status != B_OK) { if (status != B_OK) {
dprintf("main2: constructing path to Bootscript failed: " dprintf("main2: constructing path to launch_daemon failed: %s\n",
"%s\n", strerror(status)); strerror(status));
} }
const char *args[] = { "/bin/sh", bootScriptPath.Path(), NULL }; const char* args[] = { serverPath.Path(), NULL };
int32 argc = 2; int32 argc = 1;
thread_id thread; thread_id thread;
thread = load_image(argc, args, NULL); thread = load_image(argc, args, NULL);
if (thread >= B_OK) { if (thread >= B_OK) {
resume_thread(thread); resume_thread(thread);
TRACE("Bootscript started\n"); TRACE("launch_daemon started\n");
} else } else {
dprintf("error starting \"%s\" error = %" B_PRId32 " \n", args[0], thread); dprintf("error starting \"%s\" error = %" B_PRId32 " \n",
args[0], thread);
}
} }
return 0; return 0;