Changeset 25444332 in mainline for uspace/app/sysinst/sysinst.c
- Timestamp:
- 2026-04-06T14:26:00Z (23 hours ago)
- Branches:
- master
- Children:
- 4116579, 8bf4494
- Parents:
- 4f16db1
- File:
-
- 1 edited
-
uspace/app/sysinst/sysinst.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sysinst/sysinst.c
r4f16db1 r25444332 1 1 /* 2 * Copyright (c) 202 5Jiri Svoboda2 * Copyright (c) 2026 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 75 75 #define DEFAULT_DEV_2 "devices/\\hw\\sys\\00:01.0\\ide1\\c0d0" 76 76 //#define DEFAULT_DEV "devices/\\hw\\pci0\\00:01.2\\uhci_rh\\usb01_a1\\mass-storage0\\l0" 77 /** Index of partition which we must install to (hardwired in load.cfg) */ 78 #define INST_PART_IDX 1 77 79 /** Volume label for the new file system */ 78 80 #define INST_VOL_LABEL "HelenOS" … … 442 444 fdisk_t *fdisk = NULL; 443 445 fdisk_dev_t *fdev = NULL; 446 fdisk_label_info_t linfo; 444 447 fdisk_part_t *part; 445 448 fdisk_part_spec_t pspec; 446 449 fdisk_part_info_t pinfo; 450 bool create_label = false; 447 451 bool dir_created = false; 448 452 bool label_created = false; … … 483 487 sysinst_debug(sysinst, "sysinst_label_dev(): create label"); 484 488 485 rc = fdisk_label_create(fdev, lt_mbr); 486 if (rc != EOK) { 487 sysinst_error(sysinst, "Error creating label."); 488 goto error; 489 rc = fdisk_label_get_info(fdev, &linfo); 490 if (rc != EOK) { 491 sysinst_error(sysinst, "Error analyzing device."); 492 goto error; 493 } 494 495 switch (linfo.ltype) { 496 case lt_none: 497 /* need to create label */ 498 create_label = true; 499 break; 500 case lt_mbr: 501 /* MBR label already present */ 502 break; 503 default: 504 /* a different type of label already present */ 505 sysinst_error(sysinst, "Disk contains unusable label."); 506 goto error; 507 } 508 509 /* Need to create label? */ 510 if (create_label) { 511 rc = fdisk_label_create(fdev, lt_mbr); 512 if (rc != EOK) { 513 sysinst_error(sysinst, "Error creating label."); 514 goto error; 515 } 489 516 } 490 517 … … 505 532 pspec.fstype = fs_ext4; /* Cannot be changed without modifying core.img */ 506 533 pspec.mountp = MOUNT_POINT; 534 pspec.index = INST_PART_IDX; /* Cannot be changed without modifying core.img */ 507 535 pspec.label = INST_VOL_LABEL; 508 536
Note:
See TracChangeset
for help on using the changeset viewer.
