This series adds basic support for accessing LVM logical volumes.

Example session:

    wkz@spa:~/src/github.com/barebox/barebox$ ./barebox -i 
disk0=infix-x86_64.disk,blkdev
    [...]
    barebox@Sandbox:/ lvm info
    VG "internal":
      UUID:    sN8htx-oD18-wHWH-SuCU-1EWy-th1l-5WPU6j
      SeqNum:  1
      Size:    132 MiB (1 MiB extents)
      #PV:     1
      #LV:     1
      PV disk0.2:
        UUID:  6VHjVF-WVt7-Gk4Y-oTrK-lsgY-ve7N-GJ0CUn
        Size:  134 MiB
      LV "infix-x86_64.raw":
        UUID:  Xp76Ig-9XXj-aBfK-Xv2U-rbsY-nEWX-omt4Bo
        Type:  linear
        Size:  132 MiB
    barebox@Sandbox:/ lvm activate internal infix-x86_64.raw
    [GPT warnings...]
    Created internal-infix-x86_64.raw
    barebox@Sandbox:/ ls /mnt/internal-infix-x86_64.raw.0/
    mounted /dev/internal-infix-x86_64.raw.0 on /mnt/internal-infix-x86_64.raw.0
    bin       boot      cfg       config    dev       etc       home
    lib       lib64     loader    log       media     mnt       opt
    proc      root      run       sbin      srv       sys       tmp
    usr       var
    barebox@Sandbox:/

A while back, I sent an RFC of this series [1]. Based on the lack of
critique of the overall structure, I went ahead and added the missing
tests and fixed up the issues it uncovered.

[1]: 
https://lore.kernel.org/barebox/[email protected]/

Tobias Waldekranz (5):
  dm: lvm: Initial Logical Volume Management support
  dm: lvm: Add fuzz testers for metadata parser and binary headers
  test: self: lvm: Add tests for metadata parser and binary headers
  commands: lvm: inspect VGs, activate LVs
  test: py: lvm: Add basic LV activation test

 commands/Kconfig                              |  11 +
 commands/Makefile                             |   1 +
 commands/lvm.c                                | 264 ++++++
 .../boards/configs/enable_dm_testing.config   |   2 +
 drivers/block/dm/Kconfig                      |  10 +
 drivers/block/dm/Makefile                     |   1 +
 drivers/block/dm/lvm/Makefile                 |   3 +
 drivers/block/dm/lvm/lvm-core.c               | 714 +++++++++++++++
 drivers/block/dm/lvm/lvm-fuzz.c               | 182 ++++
 drivers/block/dm/lvm/lvm-md.c                 | 423 +++++++++
 drivers/block/dm/lvm/lvm-md.h                 | 109 +++
 drivers/block/dm/lvm/lvm2.h                   |  79 ++
 images/Makefile.sandbox                       |   2 +
 include/lvm.h                                 | 100 +++
 scripts/lvm-pvs.guestfish                     |  53 ++
 test/py/test_lvm.py                           |  76 ++
 test/self/Kconfig                             |  14 +
 test/self/Makefile                            |   2 +
 test/self/lvm.c                               | 818 ++++++++++++++++++
 test/testdata/fuzz/lvm-md.dict                |  29 +
 test/testdata/fuzz/lvm.dict                   |  30 +
 test/testdata/lvm-pvs.disk.xz                 | Bin 0 -> 2956 bytes
 22 files changed, 2923 insertions(+)
 create mode 100644 commands/lvm.c
 create mode 100644 drivers/block/dm/lvm/Makefile
 create mode 100644 drivers/block/dm/lvm/lvm-core.c
 create mode 100644 drivers/block/dm/lvm/lvm-fuzz.c
 create mode 100644 drivers/block/dm/lvm/lvm-md.c
 create mode 100644 drivers/block/dm/lvm/lvm-md.h
 create mode 100644 drivers/block/dm/lvm/lvm2.h
 create mode 100644 include/lvm.h
 create mode 100755 scripts/lvm-pvs.guestfish
 create mode 100644 test/py/test_lvm.py
 create mode 100644 test/self/lvm.c
 create mode 100644 test/testdata/fuzz/lvm-md.dict
 create mode 100644 test/testdata/fuzz/lvm.dict
 create mode 100644 test/testdata/lvm-pvs.disk.xz

-- 
2.43.0


Reply via email to