Changeset 25444332 in mainline for uspace/lib/fdisk/src/fdisk.c


Ignore:
Timestamp:
2026-04-06T14:26:00Z (23 hours ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
4116579, 8bf4494
Parents:
4f16db1
Message:

Sysinst should be able to install to an existing MBR label.

Provided that the first partition slot is empty and the largest
free block is large enough.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fdisk/src/fdisk.c

    r4f16db1 r25444332  
    11/*
    2  * Copyright (c) 2025 Jiri Svoboda
     2 * Copyright (c) 2026 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    673673        info->fstype = part->fstype;
    674674        info->pkind = part->pkind;
     675        info->index = part->index;
    675676        info->label = part->label;
    676677        info->svc_id = part->svc_id;
     
    10311032
    10321033        if (pspec->pkind != lpk_logical) {
    1033                 rc = fdisk_part_get_free_idx(dev, &index);
    1034                 if (rc != EOK)
    1035                         return EIO;
     1034                if (pspec->index == 0) {
     1035                        /* allocate first free index */
     1036                        rc = fdisk_part_get_free_idx(dev, &index);
     1037                        if (rc != EOK)
     1038                                return EIO;
     1039                } else {
     1040                        /* user-specified index */
     1041                        index = pspec->index;
     1042                }
    10361043        } else {
    10371044                index = 0;
Note: See TracChangeset for help on using the changeset viewer.