Changeset 04e520e in mainline for uspace/app/init/init.c
- Timestamp:
- 2024-07-24T10:33:58Z (6 months ago)
- Branches:
- master
- Children:
- 3d2d455b, 53bff11, ddfe233
- Parents:
- 145d4e2e
- git-author:
- Jiri Svoboda <jiri@…> (2024-07-23 17:33:46)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-07-24 10:33:58)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r145d4e2e r04e520e 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> … … 351 353 vol_info_t vinfo; 352 354 volume_id_t *volume_ids = NULL; 355 service_id_t *part_ids = NULL; 356 vol_part_info_t pinfo; 353 357 size_t nvols; 358 size_t nparts; 359 bool sv_mounted; 354 360 size_t i; 355 361 errno_t rc; … … 385 391 } 386 392 387 vol_destroy(vol);388 393 free(volume_ids); 394 volume_ids = NULL; 389 395 390 396 if (!found_cfg) { … … 397 403 printf("%s: Error creating directory '%s'.\n", 398 404 NAME, *cp); 399 return rc;405 goto error; 400 406 } 401 407 402 408 ++cp; 403 409 } 410 411 /* Copy initial configuration files */ 412 rc = futil_rcopy_contents("/cfg", "/w/cfg"); 413 if (rc != EOK) 414 goto error; 404 415 } else { 405 416 printf("%s: System volume is configured.\n", NAME); 406 } 407 417 418 /* Wait until system volume is mounted */ 419 sv_mounted = false; 420 421 while (true) { 422 rc = vol_get_parts(vol, &part_ids, &nparts); 423 if (rc != EOK) { 424 printf("Error getting list of volumes.\n"); 425 goto error; 426 } 427 428 for (i = 0; i < nparts; i++) { 429 rc = vol_part_info(vol, part_ids[i], &pinfo); 430 if (rc != EOK) { 431 printf("Error getting partition " 432 "information.\n"); 433 rc = EIO; 434 goto error; 435 } 436 437 if (str_cmp(pinfo.cur_mp, "/w") == 0) { 438 sv_mounted = true; 439 break; 440 } 441 } 442 443 if (sv_mounted) 444 break; 445 446 free(part_ids); 447 part_ids = NULL; 448 449 fibril_sleep(1); 450 printf("Sleeping(1) for system volume.\n"); 451 } 452 } 453 454 vol_destroy(vol); 408 455 return EOK; 409 456 error: … … 411 458 if (volume_ids != NULL) 412 459 free(volume_ids); 460 if (part_ids != NULL) 461 free(part_ids); 413 462 414 463 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.