Changeset a35b458 in mainline for uspace/app/init/init.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r3061bc1 ra35b458 103 103 return false; 104 104 } 105 105 106 106 return true; 107 107 } … … 121 121 { 122 122 const char *opts = ""; 123 123 124 124 if (str_cmp(fstype, "tmpfs") == 0) 125 125 opts = "restore"; 126 126 127 127 errno_t rc = vfs_mount_path(ROOT_MOUNT_POINT, fstype, ROOT_DEVICE, opts, 128 128 IPC_FLAG_BLOCKING, 0); … … 157 157 return ENOENT; 158 158 } 159 159 160 160 printf("%s: Starting %s\n", NAME, path); 161 161 162 162 va_list ap; 163 163 const char *arg; 164 164 int cnt = 0; 165 165 166 166 va_start(ap, path); 167 167 do { … … 170 170 } while (arg != NULL); 171 171 va_end(ap); 172 172 173 173 va_start(ap, path); 174 174 task_id_t id; … … 176 176 errno_t rc = task_spawn(&id, &wait, path, cnt, ap); 177 177 va_end(ap); 178 178 179 179 if (rc != EOK) { 180 180 printf("%s: Error spawning %s (%s)\n", NAME, path, … … 182 182 return rc; 183 183 } 184 184 185 185 if (!id) { 186 186 printf("%s: Error spawning %s (invalid task id)\n", NAME, … … 188 188 return EINVAL; 189 189 } 190 190 191 191 task_exit_t texit; 192 192 int retval; … … 197 197 return rc; 198 198 } 199 199 200 200 if (texit != TASK_EXIT_NORMAL) { 201 201 printf("%s: Server %s failed to start (unexpectedly " … … 203 203 return EINVAL; 204 204 } 205 205 206 206 if (retval != 0) 207 207 printf("%s: Server %s failed to start (exit code %d)\n", NAME, 208 208 path, retval); 209 209 210 210 return retval == 0 ? EOK : EPARTY; 211 211 } … … 221 221 return rc; 222 222 } 223 223 224 224 /* Wait for the output service to be ready */ 225 225 rc = loc_service_get_id(osvc, &service_id, IPC_FLAG_BLOCKING); … … 229 229 return rc; 230 230 } 231 231 232 232 return srv_start(SRV_CONSOLE, isvc, osvc); 233 233 } … … 243 243 return rc; 244 244 } 245 245 246 246 return srv_start(SRV_COMPOSITOR, isvc, name); 247 247 } … … 251 251 char winreg[50]; 252 252 snprintf(winreg, sizeof(winreg), "%s%s%s", "comp", srv_name, "/winreg"); 253 253 254 254 printf("%s: Spawning %s %s\n", NAME, app, winreg); 255 255 256 256 task_id_t id; 257 257 task_wait_t wait; … … 262 262 return -1; 263 263 } 264 264 265 265 task_exit_t texit; 266 266 int retval; … … 271 271 return -1; 272 272 } 273 273 274 274 return retval; 275 275 } … … 280 280 printf("%s: Spawning %s %s %s --msg --wait -- %s\n", NAME, 281 281 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 282 282 283 283 errno_t rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 284 284 LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL); … … 289 289 printf("%s: Spawning %s %s %s --wait -- %s\n", NAME, 290 290 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 291 291 292 292 errno_t rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 293 293 LOCFS_MOUNT_POINT, "--wait", "--", app, NULL); … … 310 310 311 311 info_print(); 312 312 313 313 if (!mount_root(STRING(RDFMT))) { 314 314 printf("%s: Exiting\n", NAME); 315 315 return 1; 316 316 } 317 317 318 318 /* Make sure file systems are running. */ 319 319 if (str_cmp(STRING(RDFMT), "tmpfs") != 0) … … 325 325 srv_start("/srv/cdfs"); 326 326 srv_start("/srv/mfs"); 327 327 328 328 srv_start("/srv/klog"); 329 329 srv_start("/srv/locfs"); 330 330 srv_start("/srv/taskmon"); 331 331 332 332 if (!mount_locfs()) { 333 333 printf("%s: Exiting\n", NAME); 334 334 return 2; 335 335 } 336 336 337 337 mount_tmpfs(); 338 338 339 339 srv_start("/srv/devman"); 340 340 srv_start("/srv/s3c24xx_uart"); 341 341 srv_start("/srv/s3c24xx_ts"); 342 342 343 343 srv_start("/srv/vbd"); 344 344 srv_start("/srv/volsrv"); 345 345 346 346 srv_start("/srv/loopip"); 347 347 srv_start("/srv/ethip"); … … 352 352 srv_start("/srv/dhcp"); 353 353 srv_start("/srv/nconfsrv"); 354 354 355 355 srv_start("/srv/clipboard"); 356 356 srv_start("/srv/remcons"); 357 357 358 358 srv_start("/srv/input", HID_INPUT); 359 359 srv_start("/srv/output", HID_OUTPUT); 360 360 srv_start("/srv/hound"); 361 361 362 362 if (!config_key_exists("console")) { 363 363 rc = compositor(HID_INPUT, HID_COMPOSITOR_SERVER); … … 368 368 } 369 369 } 370 370 371 371 rc = console(HID_INPUT, HID_OUTPUT); 372 372 if (rc == EOK) { … … 378 378 getterm("term/vc5", "/app/bdsh", false); 379 379 } 380 380 381 381 return 0; 382 382 }
Note:
See TracChangeset
for help on using the changeset viewer.