diskimage-builder/diskimage_builder/elements/dracut-regenerate
Xinliang Liu 4c4f49abcc Fix building error with element dracut-regenerate
This fixes below building error When build centos with element
dracut-regenerate on ubuntu by specifying the initrd and kernel version.
...
2021-01-12 03:44:15.758 | dracut: Cannot find module directory /lib/modules/5.4.0-58-generic/
2021-01-12 03:44:15.759 | dracut: and --no-kernel was not specified
2021-01-12 03:44:15.765 | Traceback (most recent call last):
2021-01-12 03:44:15.766 |   File "/tmp/in_target.d/finalise.d/50-dracut-regenerate", line 102, in <module>
2021-01-12 03:44:15.766 |     main()
2021-01-12 03:44:15.766 |   File "/tmp/in_target.d/finalise.d/50-dracut-regenerate", line 82, in main
2021-01-12 03:44:15.766 |     raise e
2021-01-12 03:44:15.766 | subprocess.CalledProcessError: Command '['dracut', '--list-modules']' returned non-zero exit status 1.
...

Change-Id: I87ae20b3fa2f291bb107e607137fcd7b1c0a4996
2021-01-14 01:30:52 +00:00
..
environment.d Add dracut-regenerate elements 2017-05-19 09:43:11 +02:00
extra-data.d Ensure nouveau is blacklisted in initramfs too 2019-10-23 10:16:00 +11:00
finalise.d Fix building error with element dracut-regenerate 2021-01-14 01:30:52 +00:00
element-deps Add dracut-regenerate elements 2017-05-19 09:43:11 +02:00
package-installs.yaml Add missing package dependency for yaml 2017-09-13 14:16:41 +02:00
pkg-map update various gentoo bits 2020-08-24 10:21:35 -05:00
README.rst Ensure nouveau is blacklisted in initramfs too 2019-10-23 10:16:00 +11:00

=================
dracut-regenerate
=================
Adds the possibility of regenerating dracut on image build time, giving the
possibility to load extra modules.
It relies on the ``DIB_DRACUT_ENABLED_MODULES`` setting, that will accept
a yaml blob with the following format::

  - name: <module1>
    packages:
      - <package1>
      - <package2>
  - name: <module2>
    packages:
      - <package3>
      - <package4>

By default, this element will bring lvm and crypt modules.

Also adds the ability to copy specific files into /etc/dracut.conf.d directory
to allow any dracut settings to be configured. To achieve that the files to be
copied need to be placed inside an specific dracut.d directory of the element.