dracut/modules.d/99base
Petr Pavlu 6685d99448 Prevent creating unexpected files on the host when running dracut
Library file modules.d/99base/dracut-lib.sh contains initialization code
that makes sure certain directories and links are created when a system
runs from the produced initramfs. This file is normally sourced only
from initramfs scripts. However, modules.d/99base/module-setup.sh
includes it also when an initramfs image is being created to gain access
to some of the functions in this library. This can result in creating
unexpected directories and links on the current root file system when
the dracut command is executed.

For instance, during a system installation when dracut is invoked to
create an initial initramfs, the target sysroot might not contain
directory /run/initramfs but have /var/log. This situation results in
the code in modules.d/99base/dracut-lib.sh creating an unexpected link
/var/log/log that points to /run/initramfs/log. This link is then also
present on the installed system.

The patch fixes the problem by skipping the described logic in
modules.d/99base/dracut-lib.sh when the PREFIX variable is non-empty
which indicates that a target initramfs is being prepared. The variable
is set by modules.d/99base/module-setup.sh prior to including
dracut-lib.sh.
2020-11-15 00:47:39 +01:00
..
dracut-lib.sh Prevent creating unexpected files on the host when running dracut 2020-11-15 00:47:39 +01:00
init.sh Remove cleanup_trace_mem calls 2020-05-27 16:51:52 +02:00
initqueue.sh initqueue: add online queue 2015-11-11 15:20:36 +01:00
loginit.sh change "while read x" to cope with EOF without newline 2015-04-28 11:39:15 +02:00
module-setup.sh Remove memtrace-ko and rd.memdebug=4 support in dracut 2020-04-20 20:22:37 +02:00
parse-root-opts.sh remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
rdsosreport.sh rdsosreport.sh: best effort to strip out passwords 2018-07-05 14:49:23 +02:00