#!/bin/bash

# Dracut is bash too, and it doesn't play nicely with our usual sets
# dib-lint: disable=setu sete setpipefail

check() {
    return 0
}

depends() {
    return 0
}

install() {
    inst /usr/bin/python
    while IFS='' read -r -d '' i; do
        inst "$i"
    done < <(find /usr/lib64/python2.7/ /usr/lib/python2.7/ -type f -print0)
    inst /etc/ssh/sshd_config
}

installkernel() {
    instmods sg
    instmods ipmi_msghandler
    instmods ipmi_si
    instmods ipmi_devintf
}

#!/bin/bash

# Dracut is bash too, and it doesn't play nicely with our usual sets
# dib-lint: disable=setu sete setpipefail

check() {
    return 0
}

depends() {
    return 0
}

install() {
    inst /usr/bin/python
    local all_of_python=()
    while IFS='' read -r -d '' i; do
        all_of_python+=("$i")
    done < <(find /usr/lib64/python2.7/ /usr/lib/python2.7/ -type f -not -name "*.pyc" -not -name "*.pyo" -print0)
    inst_multiple "${all_of_python[@]}"
    inst /etc/ssh/sshd_config
}

installkernel() {
    instmods sg
    instmods ipmi_msghandler
    instmods ipmi_si
    instmods ipmi_devintf
}

Improve discovery image build time/size
Improve discovery image build time/size

This does a couple of things that reduce the time taken to build
the discovery image, and also the size of the final image.  First,
it generates a list of the files that need to installed, then uses
dracut's inst_multiple function to install them rather than using
inst on each individual file.  This seems to provide a small speed
improvement.

The major improvement is omitting pyc and pyo files from the image.
These are simply a Python optimization that is not required, and
we likely lose more time transferring the extra files to the target
system than we gain in improved module load speed.

On a reasonably fast system, the two techniques cut about 5 minutes
and 20 MB from the image build.

Change-Id: I75318a09689fbce59a61d05d427b6acb5f251064
