dib fails to cleanup images with several partitions and volumes

Bug #1777861 reported by Yolanda Robla on 2018-06-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Undecided
Ian Wienand

Bug Description

When having an image with different partitions and volumes, the order of the cleanup is incorrectly set.

As a sample, when using that schema:

- local_loop:
    name: image0
- partitioning:
    base: image0
    label: gpt
    partitions:
      - name: root
        flags: [ boot ]
        size: 23G
      - name: ESP
        type: 'EF00'
        size: 8MiB
        mkfs:
          type: vfat
          mount:
            mount_point: /boot/efi
            fstab:
              options: "defaults"
              fsck-passno: 1
      - name: BSP
        type: 'EF02'
        size: 8MiB
- lvm:
    name: lvm
    base: [ root ]
    pvs:
        - name: pv
          base: root
          options: [ "--force" ]
    vgs:
        - name: vg
          base: [ "pv" ]
          options: [ "--force" ]
    lvs:
        - name: lv_root
          base: vg
          extents: 28%VG
        - name: lv_tmp
          base: vg
          extents: 4%VG
        - name: lv_var
          base: vg
          extents: 40%VG
        - name: lv_log
          base: vg
          extents: 23%VG
        - name: lv_audit
          base: vg
          extents: 4%VG
        - name: lv_home
          base: vg
          extents: 1%VG
- mkfs:
    name: fs_root
    base: lv_root
    type: xfs
    label: "img-rootfs"
    mount:
        mount_point: /
        fstab:
            options: "rw,relatime"
            fck-passno: 1
- mkfs:
    name: fs_tmp
    base: lv_tmp
    type: xfs
    mount:
        mount_point: /tmp
        fstab:
            options: "rw,nosuid,nodev,noexec,relatime"
- mkfs:
    name: fs_var
    base: lv_var
    type: xfs
    mount:
        mount_point: /var
        fstab:
            options: "rw,relatime"
- mkfs:
    name: fs_log
    base: lv_log
    type: xfs
    mount:
        mount_point: /var/log
        fstab:
            options: "rw,relatime"
- mkfs:
    name: fs_audit
    base: lv_audit
    type: xfs
    mount:
        mount_point: /var/log/audit
        fstab:
            options: "rw,relatime"
- mkfs:
    name: fs_home
    base: lv_home
    type: xfs
    mount:
        mount_point: /home
        fstab:
            options: "rw,nodev,relatime"

The system unmounts first the ESP and BSP partitions, but then goes up in the tree and tries to detach the image, without having cleaned the root partition and volumes first.

Sample of the iteration: https://paste.fedoraproject.org/paste/ljXthlbiJbLvr0J7tG64rg

Changed in diskimage-builder:
status: New → In Progress
assignee: nobody → Yolanda Robla (yolanda.robla)
Changed in diskimage-builder:
assignee: Yolanda Robla (yolanda.robla) → Ian Wienand (iwienand)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers