[source]
git = "https://gitlab.redox-os.org/redox-os/drivers.git"

[build]
template = "custom"
script = """
BINS=(
    ahcid
    nvmed
    pcid
    vesad
)

case "${TARGET}" in
    i686-unknown-redox | x86_64-unknown-redox)
        BINS+=(acpid ided ps2d)
        ;;
    *)
        ;;
esac

mkdir -pv "${COOKBOOK_STAGE}/bin"
for bin in "${BINS[@]}"
do
    "${COOKBOOK_CARGO}" rustc --release \
        --manifest-path "${COOKBOOK_SOURCE}/${bin}/Cargo.toml" \
        --bin "${bin}" \
        -- \
        -C opt-level=z \
        -C panic=abort
    cp -v "target/${TARGET}/release/${bin}" "${COOKBOOK_STAGE}/bin"
done

mkdir -pv "${COOKBOOK_STAGE}/etc/pcid"
cp -v "${COOKBOOK_SOURCE}/initfs.toml" "${COOKBOOK_STAGE}/etc/pcid/initfs.toml"
"""

[source]
git = "https://gitlab.redox-os.org/redox-os/drivers.git"

[build]
template = "custom"
script = """
BINS=(
    ahcid
    nvmed
    pcid
    vesad
)

case "${TARGET}" in
    i686-unknown-redox | x86_64-unknown-redox)
        BINS+=(acpid ided ps2d)
        ;;
    *)
        ;;
esac

mkdir -pv "${COOKBOOK_STAGE}/bin"
for bin in "${BINS[@]}"
do
    "${COOKBOOK_CARGO}" rustc --release \
        --manifest-path "${COOKBOOK_SOURCE}/${bin}/Cargo.toml" \
        --bin "${bin}" \
        -- \
        -C opt-level=s \
        -C panic=abort
    cp -v "target/${TARGET}/release/${bin}" "${COOKBOOK_STAGE}/bin"
done

mkdir -pv "${COOKBOOK_STAGE}/etc/pcid"
cp -v "${COOKBOOK_SOURCE}/initfs.toml" "${COOKBOOK_STAGE}/etc/pcid/initfs.toml"
"""

Change drivers-initfs opt level to s
Change drivers-initfs opt level to s
