Skip to contentSkip to conversation

Better detection of default firmware installation directory

PATCH Applied Eliot Blennerhassett 2 participants 4 messages Jun 13, 2006 – Jun 16, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Better detection of default firmware installation directory

Having recently added firmware to alsa-firmware, I noticed that the default installation location is /usr/lib/hotplug/firmware.

I think current recommended location is in /lib/firmware?

We have something like this in our configure.in to try to do the right thing on different systems. Heres a patch for alsa-firmware/configure.in

configure.in Wed Jun 14 10:04:04 2006 +1200 renamed from configure.in Tue Jun 13 12:07:11 2006 +0200 +15 -2
diff -r 8a1538f88e76 configure.in
@@ -29,13 +29,26 @@ AM_CONDITIONAL(USE_HOTPLUG, test "$hotpl
 AM_CONDITIONAL(USE_HOTPLUG, test "$hotplug" = "yes")
 AM_CONDITIONAL(BUILD_FW, test "$buildfw" = "yes")
 
+AC_MSG_CHECKING(firmware installation directory)
+# where to put the firmware. If none of these is right, can specify where
+# --with-hotplug-dir
+if test -d /lib/firmware ; then
+       detected_fwdir="/lib/firmware/"
+elif test -d /lib/hotplug/firmware ; then
+       detected_fwdir="/lib/hotplug/firmware/"
+elif test -d /usr/lib/hotplug/firmware ; then
+       detected_fwdir="/usr/lib/hotplug/firmware/"
+else
+       detected_fwdir="/lib/firmware/"
+fi
+
 AC_ARG_WITH(hotplug-dir,
   [  --with-hotplug-dir      Specify the hotplug firmware directory],
   [hotplugfwdir="$withval"],
-  [hotplugfwdir="/usr/lib/hotplug/firmware"])
+  [hotplugfwdir="$detected_fwdir"])
 HOTPLUGFWDIR="$hotplugfwdir"
 AC_SUBST(HOTPLUGFWDIR)
-
+AC_MSG_RESULT($HOTPLUGFWDIR)
 
 AC_OUTPUT(Makefile \
          hdsploader/Makefile \
# where to put the firmware. If none of these is right, can specify where
 # --with-hotplug-dir
if test -d /lib/firmware ; then
	detected_fwdir="/lib/firmware/"
elif test -d /lib/hotplug/firmware ; then
	detected_fwdir="/lib/hotplug/firmware/"
elif test -d /usr/lib/hotplug/firmware ; then
	detected_fwdir="/usr/lib/hotplug/firmware/"
else
	detected_fwdir="/lib/firmware/"
fi

AC_ARG_WITH(hotplug-dir,
[ --with-hotplug-dir Specify the hotplug firmware directory],
[hotplugfwdir="$withval"],
[hotplugfwdir="$detected_fwdir])
HOTPLUGFWDIR="$hotplugfwdir"
AC_SUBST(HOTPLUGFWDIR)

--
Eliot

#1 lore raw

At Wed, 14 Jun 2006 10:06:40 +1200,

Quoted 5 lines · Eliot Blennerhassett

Having recently added firmware to alsa-firmware, I noticed that the default installation location is /usr/lib/hotplug/firmware.

I think current recommended location is in /lib/firmware?

Currently, yes. The above directory was the old default.

Quoted 4 lines

We have something like this in our configure.in to try to do the right thing on different systems. Heres a patch for alsa-firmware/configure.in

The patch seems broken but the change suggested looks OK. Could you also change README together?

thanks,

Takashi

Quoted 61 lines

diff -r 8a1538f88e76 configure.in

configure.in Wed Jun 14 10:04:04 2006 +1200 renamed from configure.in Tue Jun 13 12:07:11 2006 +0200 +15 -2
@@ -29,13 +29,26 @@ AM_CONDITIONAL(USE_HOTPLUG, test "$hotpl
 AM_CONDITIONAL(USE_HOTPLUG, test "$hotplug" = "yes")
 AM_CONDITIONAL(BUILD_FW, test "$buildfw" = "yes")
 
+AC_MSG_CHECKING(firmware installation directory)
+# where to put the firmware. If none of these is right, can specify where
+# --with-hotplug-dir
+if test -d /lib/firmware ; then
+       detected_fwdir="/lib/firmware/"
+elif test -d /lib/hotplug/firmware ; then
+       detected_fwdir="/lib/hotplug/firmware/"
+elif test -d /usr/lib/hotplug/firmware ; then
+       detected_fwdir="/usr/lib/hotplug/firmware/"
+else
+       detected_fwdir="/lib/firmware/"
+fi
+
 AC_ARG_WITH(hotplug-dir,
   [  --with-hotplug-dir      Specify the hotplug firmware directory],
   [hotplugfwdir="$withval"],
-  [hotplugfwdir="/usr/lib/hotplug/firmware"])
+  [hotplugfwdir="$detected_fwdir"])
 HOTPLUGFWDIR="$hotplugfwdir"
 AC_SUBST(HOTPLUGFWDIR)
-
+AC_MSG_RESULT($HOTPLUGFWDIR)
 
 AC_OUTPUT(Makefile \
          hdsploader/Makefile \
# where to put the firmware. If none of these is right, can specify where
 # --with-hotplug-dir
if test -d /lib/firmware ; then
	detected_fwdir="/lib/firmware/"
elif test -d /lib/hotplug/firmware ; then
	detected_fwdir="/lib/hotplug/firmware/"
elif test -d /usr/lib/hotplug/firmware ; then
	detected_fwdir="/usr/lib/hotplug/firmware/"
else
	detected_fwdir="/lib/firmware/"
fi

AC_ARG_WITH(hotplug-dir,
[ --with-hotplug-dir Specify the hotplug firmware directory],
[hotplugfwdir="$withval"],
[hotplugfwdir="$detected_fwdir])
HOTPLUGFWDIR="$hotplugfwdir"
AC_SUBST(HOTPLUGFWDIR)

--
Eliot

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#2 lore raw
Quoted 4 lines · Takashi Iwai
Quoted 1 line

The patch seems broken but the change suggested looks OK. Could you also change README together?

Attached complete files this time. The patch was the output of 'hg diff'

Also Hg Makefile.am seems to be still missing asihpi from SUBDIRS SUBDIRS = hdsploader mixartloader pcxhrloader usx2yloader vxloader \
echoaudio asihpi

regards

Eliot

AC_PREREQ(2.53)
AC_INIT(hdsploader/tobin.c)
AM_INIT_AUTOMAKE(alsa-firmware, 1.0.11)
AC_PROG_CC
AC_PROG_INSTALL
AC_HEADER_STDC

echo $VERSION > $srcdir/version

AC_ARG_ENABLE(loader,
[ --disable-loader Disable the old ALSA fw loader support],
[loader="$enableval"],[loader=yes])
AC_ARG_ENABLE(hotplug,
[ --disable-hotplug Disable the hotplug fw loader support],
[hotplug="$enableval"],[hotplug=yes])
AC_ARG_ENABLE(buildfw,
[ --enable-buildfw Enable building fw from source files],
[buildfw="$enableval"],[buildfw=no])

AC_PATH_PROGS(AS31, as31)
AS31_FLAGS="-Fhex"
AC_SUBST(AS31_FLAGS)

if test x"${AS31}" = x""; then
buildfw=false
fi

AM_CONDITIONAL(USE_LOADER, test "$loader" = "yes") AM_CONDITIONAL(USE_HOTPLUG, test "$hotplug" = "yes") AM_CONDITIONAL(BUILD_FW, test "$buildfw" = "yes")

AC_MSG_CHECKING(firmware installation directory)

# where to put the firmware. If none of these is right, can specify where
# --with-hotplug-dir
if test -d /lib/firmware ; then
	detected_fwdir="/lib/firmware/"
elif test -d /lib/hotplug/firmware ; then
	detected_fwdir="/lib/hotplug/firmware/"
elif test -d /usr/lib/hotplug/firmware ; then
	detected_fwdir="/usr/lib/hotplug/firmware/"
else
	detected_fwdir="/lib/firmware/"
fi

AC_ARG_WITH(hotplug-dir,
[ --with-hotplug-dir Specify the hotplug firmware directory],
[hotplugfwdir="$withval"],
[hotplugfwdir="$detected_fwdir"])
HOTPLUGFWDIR="$hotplugfwdir"
AC_SUBST(HOTPLUGFWDIR)
AC_MSG_RESULT($HOTPLUGFWDIR)

AC_OUTPUT(Makefile \
	  hdsploader/Makefile \
	  mixartloader/Makefile \
	  usx2yloader/Makefile \
	  vxloader/Makefile \
	  pcxhrloader/Makefile \
	  echoaudio/Makefile \
	  asihpi/Makefile) 

GENERAL
=======

This package contains the firmware binaries for each loader program included in alsa-tools package. The firmware data can be used by each ALSA firmware loader program like vxloader, or passed through the hotplug firmware-loading mechanism.

HOTPLUG FIRMWARE LOADER SUPPORT
===============================

The recent ALSA driver supports the hotplug firmware loader. As default, the package will install firmware data to the places for both the old ALSA fw loader and the hotplug fw loader. To disable the installation of old ALSA fw loader data (if both ALSA and hotplug fw loaders are available), pass --disable-loader to configure. Similarly, to disable the hotplug fw loader data, pass --disable-hotplug option.

For the old ALSA fw loader, specify the same prefix option given to the alsa-tools configure script, too, in order to keep the installation directories consistent.

The default directory for hotplug firmware data files is /lib/firmware. (or if existing /lib/hotplug/firmware or /usr/lib/hotplug/firmware are found they are used)
You can change to another path via --with-hotplug-dir option.

LICENSE AND COPYRIGHT
=====================

The files contained in this package is regarded as the example data for each alsa-tools program. Hence, their copyright and license follow basically to the definition of alsa-tools programs. The detailed license and copyright is found in README of each subdirectory.

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Applied
#3 lore raw

At Thu, 15 Jun 2006 09:26:26 +1200,

Quoted 9 lines · Eliot Blennerhassett
Quoted 4 lines · Takashi Iwai
Quoted 1 line

The patch seems broken but the change suggested looks OK. Could you also change README together?

Attached complete files this time. The patch was the output of 'hg diff'

Applied to HG tree now.

Quoted 3 lines

Also Hg Makefile.am seems to be still missing asihpi from SUBDIRS SUBDIRS = hdsploader mixartloader pcxhrloader usx2yloader vxloader \
echoaudio asihpi

Fixed, too.

Thanks,

Takashi