Add support for --firmware-files option to make robbat2 happy
authorAndrew Gaffney <agaffney@gentoo.org>
Mon, 10 Mar 2008 17:24:48 +0000 (17:24 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Mon, 10 Mar 2008 17:24:48 +0000 (17:24 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@613 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
gen_cmdline.sh
gen_determineargs.sh
gen_initramfs.sh
genkernel.conf

index 928101d79b030083639ef7522f3b765bba66aaf9..566ecba84ac69c201901395a74db625375d40881 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 # 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
index b556127c72937a98e5b44d05dca6fd500dfc36cb..7b0e58b93b3aa1a8575483a0ec2dc9723080fcb6 100755 (executable)
@@ -122,6 +122,10 @@ longusage() {
   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() {
@@ -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
index 6a7b8720132d3bea7d496eb745f30c487a670791..7203364e43888ca862e92bd9bfa69903084b2ad7 100644 (file)
@@ -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
index b5a15bd730ac005843043bb701f100669516d85d..6f05b72f4486a9662033e51397613b1924bc29c7 100644 (file)
@@ -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/"
index 305e8e6b81bc759356575bd174402029598428e6..e1dd86a17cda60b5cc71923e8f34ab6352ac3524 100755 (executable)
@@ -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=========
 #