# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 10 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
+ gen_determineargs.sh, gen_initramfs.sh, genkernel.conf:
+ Add support for --firmware-files option to make robbat2 happy
+
10 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
gen_determineargs.sh, gen_initramfs.sh, genkernel.conf:
Add support for --firmware and --firmware-dir options to include firmware in
echo " --firmware-dir=<dir>"
echo " Specify directory to copy firmware from (defaults"
echo " to /lib/firmware)"
+ echo " --firmware-files=<files>"
+ echo " Specifies specific firmware files to copy. This"
+ echo " overrides --firmware-dir. For multiple files,"
+ echo " separate the filenames with a comma"
}
usage() {
CMD_FIRMWARE=1
print_info 2 "CMD_FIRMWARE_DIR: ${CMD_FIRMWARE_DIR}"
;;
+ --firmware-files=*)
+ CMD_FIRMWARE_FILES=`parse_opt "$*"`
+ CMD_FIRMWARE=1
+ print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}"
+ ;;
all)
BUILD_KERNEL=1
BUILD_MODULES=1
set_config_with_override 1 MDADM CMD_MDADM
set_config_with_override 1 FIRMWARE CMD_FIRMWARE
set_config_with_override 2 FIRMWARE_DIR CMD_FIRMWARE_DIR "/lib/firmware"
+ set_config_with_override 2 FIRMWARE_FILES CMD_FIRMWARE_FILES
BOOTDIR=`arch_replace "${BOOTDIR}"`
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
}
append_firmware() {
- if [ ! -d "${FIRMWARE_DIR}" ]
+ if [ -z "${FIRMWARE_FILES}" -a ! -d "${FIRMWARE_DIR}" ]
then
gen_die "specified firmware directory (${FIRMWARE_DIR}) does not exist"
fi
rm -r "${TEMP}/initramfs-firmware-temp/"
fi
mkdir -p "${TEMP}/initramfs-firmware-temp/lib/firmware"
- cp -a "${FIRMWARE_DIR}/*" ${TEMP}/initramfs-firmware-temp/lib/firmware/
+ if [ -n "${FIRMWARE_FILES}" ]
+ then
+ OLD_IFS=$IFS
+ IFS=","
+ for i in ${FIRMWARE_FILES}
+ do
+ cp -a "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/
+ done
+ IFS=$OLD_IFS
+ else
+ cp -a "${FIRMWARE_DIR}/*" ${TEMP}/initramfs-firmware-temp/lib/firmware/
+ fi
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
|| gen_die "appending firmware to cpio"
rm -r "${TEMP}/initramfs-firmware-temp/"
# Enable copying of firmware into initramfs
# FIRMWARE="no"
+# Specify directory to pull from
# FIRMWARE_DIR="/lib/firmware"
+# Specify specific firmware files to include. This overrides FIRMWARE_DIR
+# FIRMWARE_FILES=""
# =========Low Level Compile Settings=========
#