Add support for --firmware-files option to make robbat2 happy

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@613 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Andrew Gaffney 17 years ago
parent 6ea20790b7
commit 7fab7bb1f9

@ -2,6 +2,10 @@
# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $ # $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, 10 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
gen_determineargs.sh, gen_initramfs.sh, genkernel.conf: gen_determineargs.sh, gen_initramfs.sh, genkernel.conf:
Add support for --firmware and --firmware-dir options to include firmware in Add support for --firmware and --firmware-dir options to include firmware in

@ -122,6 +122,10 @@ longusage() {
echo " --firmware-dir=<dir>" echo " --firmware-dir=<dir>"
echo " Specify directory to copy firmware from (defaults" echo " Specify directory to copy firmware from (defaults"
echo " to /lib/firmware)" 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() { usage() {
@ -490,6 +494,11 @@ parse_cmdline() {
CMD_FIRMWARE=1 CMD_FIRMWARE=1
print_info 2 "CMD_FIRMWARE_DIR: ${CMD_FIRMWARE_DIR}" 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) all)
BUILD_KERNEL=1 BUILD_KERNEL=1
BUILD_MODULES=1 BUILD_MODULES=1

@ -116,6 +116,7 @@ determine_real_args() {
set_config_with_override 1 MDADM CMD_MDADM set_config_with_override 1 MDADM CMD_MDADM
set_config_with_override 1 FIRMWARE CMD_FIRMWARE 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_DIR CMD_FIRMWARE_DIR "/lib/firmware"
set_config_with_override 2 FIRMWARE_FILES CMD_FIRMWARE_FILES
BOOTDIR=`arch_replace "${BOOTDIR}"` BOOTDIR=`arch_replace "${BOOTDIR}"`
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash BOOTDIR=${BOOTDIR%/} # Remove any trailing slash

@ -253,7 +253,7 @@ append_overlay(){
} }
append_firmware() { append_firmware() {
if [ ! -d "${FIRMWARE_DIR}" ] if [ -z "${FIRMWARE_FILES}" -a ! -d "${FIRMWARE_DIR}" ]
then then
gen_die "specified firmware directory (${FIRMWARE_DIR}) does not exist" gen_die "specified firmware directory (${FIRMWARE_DIR}) does not exist"
fi fi
@ -262,7 +262,18 @@ append_firmware() {
rm -r "${TEMP}/initramfs-firmware-temp/" rm -r "${TEMP}/initramfs-firmware-temp/"
fi fi
mkdir -p "${TEMP}/initramfs-firmware-temp/lib/firmware" mkdir -p "${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/ cp -a "${FIRMWARE_DIR}/*" ${TEMP}/initramfs-firmware-temp/lib/firmware/
fi
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
|| gen_die "appending firmware to cpio" || gen_die "appending firmware to cpio"
rm -r "${TEMP}/initramfs-firmware-temp/" rm -r "${TEMP}/initramfs-firmware-temp/"

@ -71,7 +71,10 @@ USECOLOR="yes"
# Enable copying of firmware into initramfs # Enable copying of firmware into initramfs
# FIRMWARE="no" # FIRMWARE="no"
# Specify directory to pull from
# FIRMWARE_DIR="/lib/firmware" # FIRMWARE_DIR="/lib/firmware"
# Specify specific firmware files to include. This overrides FIRMWARE_DIR
# FIRMWARE_FILES=""
# =========Low Level Compile Settings========= # =========Low Level Compile Settings=========
# #

Loading…
Cancel
Save