Re: two patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 16, 2010 at 11:01:31PM +0400, Yury G. Kudryashov wrote:
> Yury G. Kudryashov wrote:
> 
> > I really should stop posting patches after midnight. I hope that the
> > attached version is better.
> I should also stop posting "fixed" versions of patches without re-compiling. 
> First patch is OK, new version of the second patch is attached.

> From 499a8e76e856b1cec3f045407eeb52a5c3d85a18 Mon Sep 17 00:00:00 2001
> From: Yury G. Kudryashov <urkud.urkud@xxxxxxxxx>
> Date: Fri, 16 Apr 2010 09:38:32 +0400
> Subject: [PATCH 2/2] Add --with-firmware-path configure option
> 
> In NixOS we need to use non-standard firmware path: we have no /lib.
> ---
>  Makefile.am                |    1 +
>  configure.ac               |   21 +++++++++++++++++++++
>  extras/firmware/firmware.c |    5 +----
>  3 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 68a68d9..3b628a4 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -194,6 +194,7 @@ dist_udevrules_DATA += \
>  # ------------------------------------------------------------------------------
>  extras_firmware_firmware_SOURCES = extras/firmware/firmware.c
>  extras_firmware_firmware_LDADD = libudev/libudev-private.la
> +extras_firmware_firmware_CPPFLAGS = $(AM_CPPFLAGS) -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
>  dist_udevrules_DATA += extras/firmware/50-firmware.rules
>  libexec_PROGRAMS = extras/firmware/firmware
>  
> diff --git a/configure.ac b/configure.ac
> index 492fa02..cce70d1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -82,6 +82,26 @@ if test "x$enable_extras" = xyes; then
>  		fi])
>  	AC_SUBST(PCI_DATABASE)
>  
> +	AC_ARG_WITH(firmware-path,
> +		AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
> +		   [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
> +		[],
> +		[with_firmware_path="/lib/fimware/updates:/lib/fimware"]
> +		)
> +	OLD_IFS=$IFS
> +	IFS=:
> +	for i in $with_firmware_path
> +	do
> +		if test "x${FIRMWARE_PATH}" = "x"
> +		then
> +			FIRMWARE_PATH="\\\"${i}/\\\""
> +		else
> +			FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
> +		fi
> +	done
> +	IFS=$OLD_IFS
> +	AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
> +
>  	AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
>  	AC_SUBST([INCLUDE_PREFIX], [$(echo '#include <linux/input.h>' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')])
>  fi
> @@ -144,6 +164,7 @@ AC_MSG_RESULT([
>  
>  	usb.ids:		${USB_DATABASE}
>  	pci.ids:		${PCI_DATABASE}
> +	firmware path:		${FIRMWARE_PATH}
>  
>  	xsltproc:		${XSLTPROC}
>  	gperf:			${GPERF}
> diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c
> index 92f0918..76593ba 100644
> --- a/extras/firmware/firmware.c
> +++ b/extras/firmware/firmware.c
> @@ -79,10 +79,7 @@ int main(int argc, char **argv)
>  		{ "help", no_argument, NULL, 'h' },
>  		{}
>  	};
> -	static const char *searchpath[] = {
> -		"/lib/firmware/updates/",
> -		"/lib/firmware/"
> -	};
> +	static const char *searchpath[] = { FIRMWARE_PATH };
>  	char fwencpath[UTIL_PATH_SIZE];
>  	char misspath[UTIL_PATH_SIZE];
>  	char loadpath[UTIL_PATH_SIZE];
> -- 
> 1.7.0.5

Looks good on inspection, although I didn't test it.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux