fc60072 dissect: rework DISSECT_IMAGE_ADD_PARTITION_DEVICES + DISSECT_IMAGE_OPEN_PARTITION_DEVICES

10 files Authored by Lennart Poettering a year ago, Committed by zbyszek a year ago,
    dissect: rework DISSECT_IMAGE_ADD_PARTITION_DEVICES + DISSECT_IMAGE_OPEN_PARTITION_DEVICES
    
    Curently, these two flags were implied by dissect_loop_device(), but
    that's not right, because this means systemd-gpt-auto-generator will
    dissect the root block device with these flags set and that's not
    desirable: the generator should not cause the partition devices to be
    created (we don't intend to use them right-away after all, but expect
    udev to find/probe them first, and then mount them though .mount units).
    And there's no point in opening the partition devices, since we do not
    intend to mount them via fds either.
    
    Hence, rework this: instead of implying the flags, specify them
    explicitly.
    
    While we are at it, let's also rename the flags to make them more
    descriptive:
    
    DISSECT_IMAGE_MANAGE_PARTITION_DEVICES becomes
    DISSECT_IMAGE_ADD_PARTITION_DEVICES, since that's really all this does:
    add the partition devices via BLKPG.
    
    DISSECT_IMAGE_OPEN_PARTITION_DEVICES becomes
    DISSECT_IMAGE_PIN_PARTITION_DEVICES, since we not only open the devices,
    but keep the devices open continously (i.e. we "pin" them).
    
    Also, drop the DISSECT_IMAGE_BLOCK_DEVICE combination flag, since it is
    misleading, i.e. it suggests it was appropriate to specify on all
    dissected blocking devices, but that's precisely not the case, see the
    systemd-gpt-auto-generator case. My guess is that the confusion around
    this was actually the cause for this bug we are addressing here.
    
    Fixes: #25528
    (cherry picked from commit 73d88b806b92efa0738bb6bcccbf105441f6d8cb)
    
        
file modified
+3 -1
file modified
+3 -1
file modified
+3 -1
file modified
+3 -1
file modified
+3 -1
file modified
+14 -9
file modified
+2 -4
file modified
+3 -1
file modified
+3 -3