From 7fab7bb1f99c930b0e72a3e5952ee21f2d38fa85 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Mon, 10 Mar 2008 17:24:48 +0000 Subject: [PATCH] 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 --- ChangeLog | 4 ++++ gen_cmdline.sh | 9 +++++++++ gen_determineargs.sh | 1 + gen_initramfs.sh | 15 +++++++++++++-- genkernel.conf | 3 +++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 928101d..566ecba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 10 Mar 2008; Andrew Gaffney 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 gen_cmdline.sh, gen_determineargs.sh, gen_initramfs.sh, genkernel.conf: Add support for --firmware and --firmware-dir options to include firmware in diff --git a/gen_cmdline.sh b/gen_cmdline.sh index b556127..7b0e58b 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -122,6 +122,10 @@ longusage() { echo " --firmware-dir=" echo " Specify directory to copy firmware from (defaults" echo " to /lib/firmware)" + echo " --firmware-files=" + echo " Specifies specific firmware files to copy. This" + echo " overrides --firmware-dir. For multiple files," + echo " separate the filenames with a comma" } usage() { @@ -490,6 +494,11 @@ parse_cmdline() { 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 diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 6a7b872..7203364 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -116,6 +116,7 @@ determine_real_args() { 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 diff --git a/gen_initramfs.sh b/gen_initramfs.sh index b5a15bd..6f05b72 100644 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -253,7 +253,7 @@ append_overlay(){ } 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 @@ -262,7 +262,18 @@ append_firmware() { 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/" diff --git a/genkernel.conf b/genkernel.conf index 305e8e6..e1dd86a 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -71,7 +71,10 @@ USECOLOR="yes" # 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========= # -- 2.26.2