Changeset b6f8f69 in mainline
- Timestamp:
- 2024-05-21T15:45:23Z (7 months ago)
- Branches:
- master
- Children:
- 9b95b964
- Parents:
- 3526f4f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sysinst/sysinst.c
r3526f4f3 rb6f8f69 62 62 * in Grub notation). 63 63 */ 64 #define DEFAULT_DEV "devices/\\hw\\sys\\00:01.0\\ata1\\c0d0" 64 #define DEFAULT_DEV_0 "devices/\\hw\\sys\\00:01.1\\c0d0" 65 #define DEFAULT_DEV_1 "devices/\\hw\\sys\\00:01.0\\ata1\\c0d0" 65 66 //#define DEFAULT_DEV "devices/\\hw\\pci0\\00:01.2\\uhci_rh\\usb01_a1\\mass-storage0\\l0" 66 67 /** Volume label for the new file system */ … … 79 80 #define BOOT_BLOCK_IDX 0 /* MBR */ 80 81 82 static const char *default_devs[] = { 83 DEFAULT_DEV_0, 84 DEFAULT_DEV_1, 85 NULL 86 }; 87 81 88 static const char *sys_dirs[] = { 82 89 "/cfg", 83 90 "/data" 84 91 }; 92 93 /** Check the if the destination device exists. 94 * 95 * @param dev Disk device 96 * 97 * @return EOK on success or an error code 98 */ 99 static errno_t sysinst_check_dev(const char *dev) 100 { 101 service_id_t sid; 102 errno_t rc; 103 104 rc = loc_service_get_id(dev, &sid, 0); 105 if (rc != EOK) 106 return rc; 107 108 (void)sid; 109 return EOK; 110 } 85 111 86 112 /** Label the destination device. … … 490 516 int main(int argc, char *argv[]) 491 517 { 492 const char *dev = DEFAULT_DEV; 493 return sysinst_install(dev); 518 unsigned i; 519 errno_t rc; 520 521 i = 0; 522 while (default_devs[i] != NULL) { 523 rc = sysinst_check_dev(default_devs[i]); 524 if (rc == EOK) 525 break; 526 } 527 528 if (default_devs[i] == NULL) { 529 printf("Cannot determine installation device.\n"); 530 return 1; 531 } 532 533 return sysinst_install(default_devs[i]); 494 534 } 495 535
Note:
See TracChangeset
for help on using the changeset viewer.