Rev 4263 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4263 | Rev 4327 | ||
---|---|---|---|
Line 43... | Line 43... | ||
43 | #include <fcntl.h> |
43 | #include <fcntl.h> |
44 | #include <task.h> |
44 | #include <task.h> |
45 | #include <malloc.h> |
45 | #include <malloc.h> |
46 | #include <macros.h> |
46 | #include <macros.h> |
47 | #include <console.h> |
47 | #include <console.h> |
- | 48 | #include <string.h> |
|
48 | #include "init.h" |
49 | #include "init.h" |
49 | #include "version.h" |
50 | #include "version.h" |
50 | 51 | ||
51 | static bool mount_fs(const char *fstype) |
52 | static bool mount_fs(const char *fstype) |
52 | { |
53 | { |
53 | int rc = -1; |
54 | int rc = -1; |
- | 55 | char *opts = ""; |
|
54 | 56 | ||
- | 57 | if (str_cmp(fstype, "tmpfs") == 0) |
|
- | 58 | opts = "restore"; |
|
- | 59 | ||
55 | while (rc < 0) { |
60 | while (rc < 0) { |
56 | rc = mount(fstype, "/", "initrd", IPC_FLAG_BLOCKING); |
61 | rc = mount(fstype, "/", "initrd", opts, IPC_FLAG_BLOCKING); |
57 | 62 | ||
58 | switch (rc) { |
63 | switch (rc) { |
59 | case EOK: |
64 | case EOK: |
60 | printf(NAME ": Root filesystem mounted\n"); |
65 | printf(NAME ": Root filesystem mounted\n"); |
61 | break; |
66 | break; |
Line 81... | Line 86... | ||
81 | printf(NAME ": Spawning %s\n", fname); |
86 | printf(NAME ": Spawning %s\n", fname); |
82 | 87 | ||
83 | argv[0] = fname; |
88 | argv[0] = fname; |
84 | argv[1] = NULL; |
89 | argv[1] = NULL; |
85 | 90 | ||
86 | if (task_spawn(fname, argv)) { |
91 | if (!task_spawn(fname, argv)) |
87 | /* Add reasonable delay to avoid intermixed klog output. */ |
- | |
88 | usleep(10000); |
- | |
89 | } else { |
- | |
90 | printf(NAME ": Error spawning %s\n", fname); |
92 | printf(NAME ": Error spawning %s\n", fname); |
91 | } |
- | |
92 | } |
93 | } |
93 | 94 | ||
94 | int main(int argc, char *argv[]) |
95 | int main(int argc, char *argv[]) |
95 | { |
96 | { |
96 | info_print(); |
97 | info_print(); |