Changes in uspace/app/init/init.c [1bbc6dc:e229148] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r1bbc6dc re229148 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda3 2 * Copyright (c) 2005 Martin Decky 4 3 * All rights reserved. … … 36 35 37 36 #include <fibril.h> 38 #include <futil.h>39 37 #include <stdio.h> 40 38 #include <stdarg.h> … … 80 78 static const char *sys_dirs[] = { 81 79 "/w/cfg", 82 "/w/data", 83 NULL, 80 "/w/data" 84 81 }; 85 82 … … 354 351 vol_info_t vinfo; 355 352 volume_id_t *volume_ids = NULL; 356 service_id_t *part_ids = NULL;357 vol_part_info_t pinfo;358 353 size_t nvols; 359 size_t nparts;360 bool sv_mounted;361 354 size_t i; 362 355 errno_t rc; … … 392 385 } 393 386 387 vol_destroy(vol); 394 388 free(volume_ids); 395 volume_ids = NULL;396 389 397 390 if (!found_cfg) { … … 404 397 printf("%s: Error creating directory '%s'.\n", 405 398 NAME, *cp); 406 goto error;399 return rc; 407 400 } 408 401 409 402 ++cp; 410 403 } 411 412 /* Copy initial configuration files */413 rc = futil_rcopy_contents("/cfg", "/w/cfg");414 if (rc != EOK)415 goto error;416 404 } else { 417 405 printf("%s: System volume is configured.\n", NAME); 418 419 /* Wait until system volume is mounted */ 420 sv_mounted = false; 421 422 while (true) { 423 rc = vol_get_parts(vol, &part_ids, &nparts); 424 if (rc != EOK) { 425 printf("Error getting list of volumes.\n"); 426 goto error; 427 } 428 429 for (i = 0; i < nparts; i++) { 430 rc = vol_part_info(vol, part_ids[i], &pinfo); 431 if (rc != EOK) { 432 printf("Error getting partition " 433 "information.\n"); 434 rc = EIO; 435 goto error; 436 } 437 438 if (str_cmp(pinfo.cur_mp, "/w") == 0) { 439 sv_mounted = true; 440 break; 441 } 442 } 443 444 if (sv_mounted) 445 break; 446 447 free(part_ids); 448 part_ids = NULL; 449 450 fibril_sleep(1); 451 printf("Sleeping(1) for system volume.\n"); 452 } 453 } 454 455 vol_destroy(vol); 406 } 407 456 408 return EOK; 457 409 error: … … 459 411 if (volume_ids != NULL) 460 412 free(volume_ids); 461 if (part_ids != NULL)462 free(part_ids);463 413 464 414 return rc; … … 488 438 srv_start("/srv/klog"); 489 439 srv_start("/srv/fs/locfs"); 440 srv_start("/srv/taskmon"); 490 441 491 442 if (!mount_locfs()) { … … 503 454 srv_start("/srv/volsrv"); 504 455 505 init_sysvol();506 507 srv_start("/srv/taskmon");508 509 456 srv_start("/srv/net/loopip"); 510 457 srv_start("/srv/net/ethip"); 511 srv_start("/srv/net/dhcp");512 458 srv_start("/srv/net/inetsrv"); 513 459 srv_start("/srv/net/tcp"); 514 460 srv_start("/srv/net/udp"); 515 461 srv_start("/srv/net/dnsrsrv"); 462 srv_start("/srv/net/dhcp"); 463 srv_start("/srv/net/nconfsrv"); 516 464 517 465 srv_start("/srv/clipboard"); … … 521 469 srv_start("/srv/hid/output", HID_OUTPUT); 522 470 srv_start("/srv/audio/hound"); 471 472 init_sysvol(); 523 473 524 474 #ifdef CONFIG_WINSYS
Note:
See TracChangeset
for help on using the changeset viewer.