Changeset ebb1489 in mainline for uspace/app/init/init.c
- Timestamp:
- 2024-10-13T08:23:40Z (2 months ago)
- Children:
- 0472cf17
- Parents:
- 2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
- git-committer:
- GitHub <noreply@…> (2024-10-13 08:23:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r2a0c827c rebb1489 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2005 Martin Decky 3 4 * All rights reserved. … … 35 36 36 37 #include <fibril.h> 38 #include <futil.h> 37 39 #include <stdio.h> 38 40 #include <stdarg.h> … … 78 80 static const char *sys_dirs[] = { 79 81 "/w/cfg", 80 "/w/data" 82 "/w/data", 83 NULL, 81 84 }; 82 85 … … 351 354 vol_info_t vinfo; 352 355 volume_id_t *volume_ids = NULL; 356 service_id_t *part_ids = NULL; 357 vol_part_info_t pinfo; 353 358 size_t nvols; 359 size_t nparts; 360 bool sv_mounted; 354 361 size_t i; 355 362 errno_t rc; … … 385 392 } 386 393 387 vol_destroy(vol);388 394 free(volume_ids); 395 volume_ids = NULL; 389 396 390 397 if (!found_cfg) { … … 397 404 printf("%s: Error creating directory '%s'.\n", 398 405 NAME, *cp); 399 return rc;406 goto error; 400 407 } 401 408 402 409 ++cp; 403 410 } 411 412 /* Copy initial configuration files */ 413 rc = futil_rcopy_contents("/cfg", "/w/cfg"); 414 if (rc != EOK) 415 goto error; 404 416 } else { 405 417 printf("%s: System volume is configured.\n", NAME); 406 } 407 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); 408 456 return EOK; 409 457 error: … … 411 459 if (volume_ids != NULL) 412 460 free(volume_ids); 461 if (part_ids != NULL) 462 free(part_ids); 413 463 414 464 return rc; … … 438 488 srv_start("/srv/klog"); 439 489 srv_start("/srv/fs/locfs"); 440 srv_start("/srv/taskmon");441 490 442 491 if (!mount_locfs()) { … … 454 503 srv_start("/srv/volsrv"); 455 504 505 init_sysvol(); 506 507 srv_start("/srv/taskmon"); 508 456 509 srv_start("/srv/net/loopip"); 457 510 srv_start("/srv/net/ethip"); 511 srv_start("/srv/net/dhcp"); 458 512 srv_start("/srv/net/inetsrv"); 459 513 srv_start("/srv/net/tcp"); 460 514 srv_start("/srv/net/udp"); 461 515 srv_start("/srv/net/dnsrsrv"); 462 srv_start("/srv/net/dhcp");463 srv_start("/srv/net/nconfsrv");464 516 465 517 srv_start("/srv/clipboard"); … … 469 521 srv_start("/srv/hid/output", HID_OUTPUT); 470 522 srv_start("/srv/audio/hound"); 471 472 init_sysvol();473 523 474 524 #ifdef CONFIG_WINSYS
Note:
See TracChangeset
for help on using the changeset viewer.