File: 01-ensure-drivers

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 (29 lines) | stat: -rwxr-xr-x 625 bytes parent folder | download | duplicates (6)
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
#!/bin/bash

set -eu
set -o pipefail

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

TARGET_DIR="/tmp/in_target.d/"

EXTRA_DRIVERS=

for _FILE in $(ls ${TARGET_DIR}/dracut-drivers.d/) ; do
    _FILE="${TARGET_DIR}/dracut-drivers.d/${_FILE}"
    if [ -s $_FILE ]; then
        for _LINE in $(cat $_FILE) ; do
            EXTRA_DRIVERS="${EXTRA_DRIVERS} $_LINE"
        done
    fi
done

if [ "$EXTRA_DRIVERS" = "" ]; then
    echo "No extra drivers found"
else
    DRIVERS_OUTPUT="/etc/dib_dracut_drivers"
    echo "Creating extra drivers record at: ${DRIVERS_OUTPUT}"
    echo "$EXTRA_DRIVERS" >${DRIVERS_OUTPUT}
fi