debian-forge/osbuild
Dusty Mabe ce8408a9c6 mounts: support mounting partitions
This allows us to map in a whole disk as a loopback device with parition
scanning rather than slicing up the disk and creating several loopback
devices. Something like this:

```
      - type: org.osbuild.copy
        inputs:
          tree:
            type: org.osbuild.tree
            origin: org.osbuild.pipeline
            references:
              - name:tree
        options:
          paths:
            - from: input://tree/
              to: mount://root/
        devices:
          efi:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              start:
                mpp-format-int: '{image.layout[''EFI-SYSTEM''].start}'
              size:
                mpp-format-int: '{image.layout[''EFI-SYSTEM''].size}'
          boot:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              start:
                mpp-format-int: '{image.layout[''boot''].start}'
              size:
                mpp-format-int: '{image.layout[''boot''].size}'
          root:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              start:
                mpp-format-int: '{image.layout[''root''].start}'
              size:
                mpp-format-int: '{image.layout[''root''].size}'
        mounts:
          - name: root
            type: org.osbuild.xfs
            source: root
            target: /
          - name: boot
            type: org.osbuild.ext4
            source: boot
            target: /boot
          - name: efi
            type: org.osbuild.fat
            source: efi
            target: /boot/efi
```

now becomes a little more simple:

```
      - type: org.osbuild.copy
        inputs:
          tree:
            type: org.osbuild.tree
            origin: org.osbuild.pipeline
            references:
              - name:tree
        options:
          paths:
            - from: input://tree/
              to: mount://root/
        devices:
          disk:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              partscan: true
        mounts:
          - name: root
            type: org.osbuild.xfs
            source: disk
            partition:
              mpp-format-int: '{image.layout[''root''].partnum}'
            target: /
          - name: boot
            type: org.osbuild.ext4
            source: disk
            partition:
              mpp-format-int: '{image.layout[''boot''].partnum}'
            target: /boot
          - name: efi
            type: org.osbuild.fat
            source: disk
            partition:
              mpp-format-int: '{image.layout[''EFI-SYSTEM''].partnum}'
            target: /boot/efi
```

Fixes https://github.com/osbuild/osbuild/issues/1495
2023-12-22 10:18:29 -05:00
..
formats mounts: support mounting partitions 2023-12-22 10:18:29 -05:00
testutil test: Move make_fake_input_tree to testutil 2023-12-12 19:45:04 +01:00
util create org.osbuild.ostree.aleph stage 2023-12-19 17:58:39 +01:00
__init__.py Post release version bump 2023-12-20 08:12:39 +00:00
__main__.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
api.py Fix errors reported by new version of mypy 2023-04-12 11:57:18 +02:00
buildroot.py tox: add tox 2023-08-01 15:01:13 +02:00
devices.py devices: new helper to ensure a device node exists 2022-11-22 18:28:38 +01:00
host.py tox: add tox 2023-08-01 15:01:13 +02:00
inputs.py inputs: Move arguments for InputService.map to a temporary file 2023-06-27 10:56:10 +02:00
loop.py devices/loopback: make setting sector_size meaningful 2023-11-29 10:37:08 +01:00
main_cli.py osbuild: honor OSBUILD_EXPORT_FORCE_NO_PRESERVE_OWNER env 2023-12-20 09:28:39 +01:00
meta.py osbuild. add comment why AST is used and not importlib 2023-11-22 09:52:47 +01:00
monitor.py osbuild: improve monitor docstrings/signatures 2023-11-28 09:56:56 +01:00
mounts.py mounts: support mounting partitions 2023-12-22 10:18:29 -05:00
objectstore.py objectstore: add new skip_preserve_owner to Object.export() 2023-12-20 09:28:39 +01:00
pipeline.py mounts: support mounting partitions 2023-12-22 10:18:29 -05:00
remoteloop.py loop: use LOOP_CONFIGURE instead of LOOP_SET_FD 2023-05-05 15:42:47 +02:00
sources.py Fix errors reported by new version of mypy 2023-04-12 11:57:18 +02:00