1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/tools
David Teigland 3321a669d8 Allow system.devices to be automatically created on first boot
An OS installer can create system.devices for the system and
disks, but an OS image cannot create the system-specific
system.devices.  The OS image can instead configure the
image so that lvm will create system.devices on first boot.

Image preparation steps to enable auto creation of system.devices:
- create empty file /etc/lvm/devices/auto-import-rootvg
- remove any existing /etc/lvm/devices/system.devices
- enable lvm-devices-import.path
- enable lvm-devices-import.service

On first boot of the prepared image:
- udev triggers vgchange -aay --autoactivation event <rootvg>
- vgchange activates LVs in the root VG
- vgchange finds the file /etc/lvm/devices/auto-import-rootvg,
  and no /etc/lvm/devices/system.devices, so it creates
  /run/lvm/lvm-devices-import
- lvm-devices-import.path is run when /run/lvm/lvm-devices-import
  appears, and triggers lvm-devices-import.service
- lvm-devices-import.service runs vgimportdevices --rootvg --auto
- vgimportdevices finds /etc/lvm/devices/auto-import-rootvg,
  and no system.devices, so it creates system.devices containing
  PVs in the root VG, and removes /etc/lvm/devices/auto-import-rootvg
  and /run/lvm/lvm-devices-import

Run directly, vgimportdevices --rootvg (without --auto), will create
a new system.devices for the root VG, or will add devices for the
root VG to an existing system.devices.

(cherry picked from commit c609dedc2f)
2024-05-22 10:16:55 +02:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore tools: add generated headers to .gitignore 2017-03-10 13:13:41 +00:00
args.h Allow system.devices to be automatically created on first boot 2024-05-22 10:16:55 +02:00
cmdnames.h doc: change fsf address 2016-01-21 12:11:37 +01:00
command_enums.h lv_type: simplier macro usage 2024-05-13 02:21:28 +02:00
command-lines.in Allow system.devices to be automatically created on first boot 2024-05-22 10:16:55 +02:00
command.c gcc: better initilizer for older gcc compilers 2024-05-14 17:59:26 +02:00
command.h lv_type: simplier macro usage 2024-05-13 02:21:28 +02:00
commands.h devices file: limit warnings about devices file entries not found 2021-08-05 13:20:26 -05:00
dumpconfig.c lvmconfig: add --valuesonly option 2022-08-17 10:47:24 +02:00
errors.h tools: Introduce exit code EINIT_FAILED. 2017-07-26 23:18:03 +01:00
formats.c doc: change fsf address 2016-01-21 12:11:37 +01:00
license.inc makefiles: avoid piping 2023-02-10 17:50:27 +01:00
lv_props.h lv_prop: simplier macro usage 2024-05-13 02:20:29 +02:00
lv_types.h lv_types: sort order of types 2024-05-13 12:58:37 +02:00
lvchange.c command: use command_id_to_enum 2024-05-13 02:15:55 +02:00
lvconvert_poll.c lv: swap more lv properties 2024-03-17 13:17:53 +01:00
lvconvert_poll.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvconvert.c command: use command_id_to_enum 2024-05-13 02:15:55 +02:00
lvcreate.c lvcreate: --yes option for thin-pool vdo creation 2024-05-04 00:56:32 +02:00
lvdisplay.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
lvextend.c lvresize: restructure code 2022-09-09 16:18:55 -05:00
lvm2cmd-static.c lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm2cmd.c lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm2cmd.h lvmcmdlib: lvm2_init_threaded 2020-10-20 22:22:52 +02:00
lvm2cmdline.h lvmcmdline: use strcut as const 2024-05-13 02:15:55 +02:00
lvm-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm.c lvmcmdline: use strcut as const 2024-05-13 02:15:55 +02:00
lvmcmdlib.c cmdlib_lvm2_init: release cmd on failure path 2021-09-13 12:34:41 +02:00
lvmcmdline.c lvmcmdline: check for NULL 2024-05-13 14:49:54 +02:00
lvmdevices.c lvmdevices: fix memleak of use_old du 2024-04-03 15:29:17 -05:00
lvmdiskscan.c cleanup: add static _ 2024-05-13 02:21:37 +02:00
lvpoll.c const: _fns poll_function 2024-05-04 01:01:57 +02:00
lvreduce.c lvresize: restructure code 2022-09-09 16:18:55 -05:00
lvremove.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
lvrename.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
lvresize.c command: use command_id_to_enum 2024-05-13 02:15:55 +02:00
lvscan.c debug: print WARNING: 2023-07-15 11:05:35 +02:00
Makefile.in command: split man-generator code 2024-04-29 00:13:43 +02:00
man-generator.c command: use command_id_to_enum 2024-05-13 02:15:55 +02:00
polldaemon.c const: _fns poll_function 2024-05-04 01:01:57 +02:00
pvchange.c device_id: ensure pvid buffers are ID_LEN+1 2023-11-09 13:15:02 -06:00
pvck.c cleanup: add static _ 2024-05-13 02:21:37 +02:00
pvcreate.c exit with error when --devicesfile name doesn't exist 2022-07-06 10:10:58 -05:00
pvdisplay.c add device hints to reduce scanning 2019-01-15 10:23:47 -06:00
pvmove_poll.c cov: ensure NULL baton is not dereferenced 2023-05-06 19:22:05 +02:00
pvmove_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove.c const: _fns poll_function 2024-05-04 01:01:57 +02:00
pvremove.c exit with error when --devicesfile name doesn't exist 2022-07-06 10:10:58 -05:00
pvresize.c exported vg handling 2019-06-25 15:39:08 -05:00
pvscan.c Allow system.devices to be automatically created on first boot 2024-05-22 10:16:55 +02:00
reporter.c const: report_name 2024-05-04 01:01:57 +02:00
segtypes.c doc: change fsf address 2016-01-21 12:11:37 +01:00
stub.h Remove vgconvert 2018-06-13 14:14:03 -05:00
tags.c doc: change fsf address 2016-01-21 12:11:37 +01:00
tool.h configure: avoid repeative inclusion of configure.h 2018-12-21 19:19:50 +01:00
toollib.c cleanup: some missed public symbols static 2024-05-13 12:58:19 +02:00
toollib.h command: futher move to single struct 2024-05-12 22:15:15 +02:00
tools.h Allow system.devices to be automatically created on first boot 2024-05-22 10:16:55 +02:00
vals.h command: embedding strings to structs 2024-05-02 11:59:42 +02:00
vgcfgbackup.c cov: annotate to silent some coverity warning 2024-05-08 01:55:21 +02:00
vgcfgrestore.c refactor: update dm_strncpy to _dm_strncpy 2024-04-04 19:38:21 +02:00
vgchange.c Allow system.devices to be automatically created on first boot 2024-05-22 10:16:55 +02:00
vgck.c vgck: fix updatemetadata writing different descriptions 2019-10-11 12:57:32 -05:00
vgcreate.c exit with error when --devicesfile name doesn't exist 2022-07-06 10:10:58 -05:00
vgdisplay.c tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
vgexport.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgextend.c exit with error when --devicesfile name doesn't exist 2022-07-06 10:10:58 -05:00
vgimport.c vgimport: invalidate hints 2023-02-22 16:19:48 -06:00
vgimportclone.c refactor: remove (void) from dm_strncpy usage 2024-04-04 19:38:21 +02:00
vgimportdevices.c Allow system.devices to be automatically created on first boot 2024-05-22 10:16:55 +02:00
vgmerge.c exit with error when --devicesfile name doesn't exist 2022-07-06 10:10:58 -05:00
vgmknodes.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
vgreduce.c backup: automatically store data on vg_unlock 2021-06-09 14:56:13 +02:00
vgremove.c vgremove: remove online files in run dir 2022-09-14 14:19:29 -05:00
vgrename.c cov: clean up pvid and vgid usage 2021-08-16 11:31:15 -05:00
vgscan.c debug: print WARNING: 2023-07-15 11:05:35 +02:00
vgsplit.c exit with error when --devicesfile name doesn't exist 2022-07-06 10:10:58 -05:00