diskimage-builder/diskimage_builder/elements/dracut-regenerate/extra-data.d/50-dracut-conf
Oliver Walsh ceaf79d191 Ensure nouveau is blacklisted in initramfs too
To ensure dracut does not load nouveau we need to explicitly disable it via
omit_drivers.
This change adds a method to drop in arbitary dracut conf files to an element
which are picked up by dracut-regenerate and included in the chroot where we
run dracut.

The disable-nouveau element just adds a conf file with
`omit_drivers += " nouveau"`
The default dracut conf files in /usr/lib include a similar file to omit the
nvidia kernel modules.

Change-Id: I6375e4843fd08d1410141fbbd8658042dcd5ad05
Closes-bug: 1842664
2019-10-23 10:16:00 +11:00

23 lines
561 B
Bash
Executable file

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 1 ]; then
set -x
fi
set -eu
set -o pipefail
if [ ! -d $TMP_MOUNT_PATH/etc/dracut.conf.d ]; then
sudo mkdir -p $TMP_MOUNT_PATH/etc/dracut.conf.d
fi
eval declare -A image_elements=($(get_image_element_array))
for i in "${!image_elements[@]}"; do
element=$i
element_dir=${image_elements[$i]}
if [ -d "${element_dir}/dracut.conf.d/" ]; then
echo "Copying dracut config from ${element_dir}"
sudo cp ${element_dir}/dracut.conf.d/*.conf $TMP_MOUNT_PATH/etc/dracut.conf.d/
fi
done