bootstrap: cleanup test code
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define INIT_PATH "/usr/bin/test"
|
||||
#define INIT_PATH "/usr/bin/systemd"
|
||||
|
||||
static enum launch_status resolve_dependency(
|
||||
struct launch_ctx *ctx,
|
||||
@@ -31,14 +31,12 @@ static enum launch_status resolve_dependency(
|
||||
name++;
|
||||
}
|
||||
|
||||
snprintf(s, sizeof s, "searching for library %s", name);
|
||||
kern_log(s);
|
||||
kern_tracef("searching for library %s", name);
|
||||
|
||||
struct tar *fs = arg;
|
||||
struct tar_file file = {0};
|
||||
if (tar_open(fs, name, &file) != 0) {
|
||||
snprintf(s, sizeof s, "cannot find library %s", name);
|
||||
kern_log(s);
|
||||
kern_tracef("cannot find library %s", name);
|
||||
return LAUNCH_ERR_CANNOT_RESOLVE_DEPENDENCY;
|
||||
}
|
||||
|
||||
@@ -92,13 +90,6 @@ static void _fs_free(struct fs_allocator *alloc, void *p)
|
||||
heap_free(alloc->fs_arg, p);
|
||||
}
|
||||
|
||||
void *thread_func(void *arg)
|
||||
{
|
||||
kern_logf("a thread! (%p)", pthread_self());
|
||||
// kern_logf("a thread!");
|
||||
return (void *)0x123;
|
||||
}
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
const char **argv,
|
||||
@@ -151,7 +142,8 @@ int main(
|
||||
};
|
||||
|
||||
struct launch_parameters params = {
|
||||
.p_executable = image,
|
||||
.p_exec_image = image,
|
||||
.p_exec_path = INIT_PATH,
|
||||
.p_parent_task = task,
|
||||
.p_task_name = "init",
|
||||
.p_local_address_space = address_space,
|
||||
@@ -168,11 +160,6 @@ int main(
|
||||
kern_handle_t channel;
|
||||
channel_create(0, &channel);
|
||||
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, thread_func, NULL);
|
||||
pthread_detach(thread);
|
||||
kern_logf("created new thread %p", thread);
|
||||
|
||||
launch_ctx_init(&launch);
|
||||
launch.ctx_resolve_library = resolve_dependency;
|
||||
|
||||
@@ -210,7 +197,7 @@ int main(
|
||||
(void *)bsp_base,
|
||||
0);
|
||||
if (fs_status != FS_SUCCESS) {
|
||||
kern_logf("cannot mount filesustem (%d)", fs_status);
|
||||
kern_logf("cannot mount filesystem (%d)", fs_status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user