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:
parent
592ffe6461
commit
89168ad8b9
@ -115,6 +115,7 @@ SYSTEM_SERVERS = [ FFilterByBuildFeatures
|
||||
debug_server dns_resolver_server
|
||||
input_server
|
||||
keystore_server
|
||||
launch_daemon
|
||||
mount_server
|
||||
net_server notification_server
|
||||
package_daemon power_daemon
|
||||
|
@ -124,11 +124,14 @@ AddSymlinkToPackage bin : trash : untrash ;
|
||||
AddSymlinkToPackage bin : less : more ;
|
||||
|
||||
# scripts and data files
|
||||
local bootScripts = Bootscript Bootscript.cd SetupEnvironment
|
||||
InstallerInitScript InstallerFinishScript ;
|
||||
local bootScripts = SetupEnvironment InstallerInitScript InstallerFinishScript ;
|
||||
SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ;
|
||||
AddFilesToPackage boot : $(bootScripts) ;
|
||||
|
||||
local launchScripts = <data!launch>system ;
|
||||
SEARCH on $(launchScripts) = [ FDirName $(HAIKU_TOP) data launch ] ;
|
||||
AddFilesToPackage data launch : $(launchScripts) ;
|
||||
|
||||
# post install scripts
|
||||
local postInstallFiles = add_catalog_entry_attributes.sh
|
||||
default_deskbar_items.sh ;
|
||||
|
@ -14,6 +14,7 @@ service x-vnd.Haiku-debug_server {
|
||||
|
||||
service x-vnd.Haiku-package_daemon {
|
||||
launch /system/servers/package_daemon
|
||||
create_port
|
||||
}
|
||||
|
||||
service x-vnd.Haiku-syslog_daemon {
|
||||
@ -58,3 +59,12 @@ service x-vnd.Haiku-power_daemon {
|
||||
launch /system/servers/power_daemon
|
||||
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
|
||||
}
|
||||
|
@ -358,28 +358,31 @@ main2(void* /*unused*/)
|
||||
|
||||
// start the init process
|
||||
{
|
||||
KPath bootScriptPath;
|
||||
status_t status = __find_directory(B_SYSTEM_BOOT_DIRECTORY, gBootDevice,
|
||||
false, bootScriptPath.LockBuffer(), bootScriptPath.BufferSize());
|
||||
KPath serverPath;
|
||||
status_t status = __find_directory(B_SYSTEM_SERVERS_DIRECTORY,
|
||||
gBootDevice, false, serverPath.LockBuffer(),
|
||||
serverPath.BufferSize());
|
||||
if (status != B_OK)
|
||||
dprintf("main2: find_directory() failed: %s\n", strerror(status));
|
||||
bootScriptPath.UnlockBuffer();
|
||||
status = bootScriptPath.Append("/Bootscript");
|
||||
serverPath.UnlockBuffer();
|
||||
status = serverPath.Append("/launch_daemon");
|
||||
if (status != B_OK) {
|
||||
dprintf("main2: constructing path to Bootscript failed: "
|
||||
"%s\n", strerror(status));
|
||||
dprintf("main2: constructing path to launch_daemon failed: %s\n",
|
||||
strerror(status));
|
||||
}
|
||||
|
||||
const char *args[] = { "/bin/sh", bootScriptPath.Path(), NULL };
|
||||
int32 argc = 2;
|
||||
const char* args[] = { serverPath.Path(), NULL };
|
||||
int32 argc = 1;
|
||||
thread_id thread;
|
||||
|
||||
thread = load_image(argc, args, NULL);
|
||||
if (thread >= B_OK) {
|
||||
resume_thread(thread);
|
||||
TRACE("Bootscript started\n");
|
||||
} else
|
||||
dprintf("error starting \"%s\" error = %" B_PRId32 " \n", args[0], thread);
|
||||
TRACE("launch_daemon started\n");
|
||||
} else {
|
||||
dprintf("error starting \"%s\" error = %" B_PRId32 " \n",
|
||||
args[0], thread);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user