Merge "Ensure nouveau is blacklisted in initramfs too"

This commit is contained in:
Zuul 2019-11-22 06:57:39 +00:00 committed by Gerrit Code Review
commit 9dd161471a
4 changed files with 38 additions and 5 deletions

View file

@ -0,0 +1 @@
omit_drivers+=" nouveau "

View file

@ -16,3 +16,7 @@ a yaml blob with the following format::
- <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.

View file

@ -0,0 +1,23 @@
#!/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

View file

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import glob
import logging
import os
import re
@ -52,8 +53,10 @@ def main():
# second, compose the list of modules to boot
modules_to_boot.append(dracut_object.get('name', None))
# regenerate dracut with the list of installed modules
if len(modules_to_boot) > 0:
conf_overrides = glob.glob('/etc/dracut.conf.d/*.conf')
# regenerate dracut with the list of installed modules and conf overrides
if modules_to_boot or conf_overrides:
cmdline = ["select-boot-kernel-initrd"]
logging.debug("Calling: %s" % cmdline)
subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
@ -67,10 +70,12 @@ def main():
kernel_search = re.match("vmlinuz-(.*)", kernel_set[0])
kernel_version = "%s" % kernel_search.groups(1)
ramdisk_path = "/boot/%s" % kernel_set[1].strip()
modules_to_boot = ' ' .join(modules_to_boot)
cmdline = ['dracut', '--force', '--add', modules_to_boot,
'-f', ramdisk_path, kernel_version]
cmdline = ['dracut', '--force']
if modules_to_boot:
modules_to_boot = ' ' .join(modules_to_boot)
cmdline += ['--add', modules_to_boot]
cmdline += ['-f', ramdisk_path, kernel_version]
logging.debug("Calling: %s" % cmdline)
subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
out, err = subp.communicate()