File: 50-modprobe-blacklist

package info (click to toggle)
python-diskimage-builder 3.37.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,572 kB
  • sloc: sh: 7,380; python: 6,444; makefile: 37
file content (31 lines) | stat: -rwxr-xr-x 944 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

# This would only not be here if there was no kmod package installed,
# which can happen in some container situations.  Obviously
# blacklisting a kernel module is not really useful; however allowing
# this to work can allow modules that do other things that *are*
# useful for a container to "just work" without a whole bunch of
# refactoring.
if [ ! -d $TMP_MOUNT_PATH/etc/modprobe.d ]; then
    # ^ so we can see in the logs if we took this path ...
    sudo mkdir -p $TMP_MOUNT_PATH/etc/modprobe.d
fi

# copy all modprobe.d snippets to /etc/modprobe.d

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}/modprobe.d/" ]; then
        sudo cp ${element_dir}/modprobe.d/*.conf $TMP_MOUNT_PATH/etc/modprobe.d/
    fi
done