[Sound-open-firmware] [PATCH 1/3] configure: Change install prefix for bin and keys
From: Pan Xiuli xiuli.pan@linux.intel.com
Install prefix will not influce PEM install path. Add the check to let PEM can install with the prefix.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac index 0f34acc..a948906 100644 --- a/configure.ac +++ b/configure.ac @@ -358,7 +358,11 @@ if test "$have_rimage" = "yes"; then fi fi
+if test "x$prefix" == "xNONE"; then PEM_KEY_PREFIX="/usr/local/share/rimage" +else +PEM_KEY_PREFIX=$prefix"/share/rimage" +fi AC_DEFINE_UNQUOTED([PEM_KEY_PREFIX], ["$PEM_KEY_PREFIX"], ["Path for PEM keys"]) AC_SUBST(PEM_KEY_PREFIX)
@@ -448,6 +452,7 @@ echo " Target Architecture: ${ARCH} Target Platform: ${PLATFORM} Target Core: ${XTENSA_CORE} +Install Prefix: ${prefix} PEM: ${PEM_KEY_PREFIX}
Compiler: ${CC}
From: Pan Xiuli xiuli.pan@linux.intel.com
Add a flag "-l" to make rimage install only in pdw/local. Also add parse for args, then simplify platform build for loop since in parse the args will be all legal
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- scripts/xtensa-build-all.sh | 130 ++++++++++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 54 deletions(-)
diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index 99db2b0..8406414 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -1,5 +1,34 @@ #!/bin/bash
+SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl) + +# parse the args +for args in $@ +do + if [[ "$args" == "-l" ]] + then + BUILD_LOCAL=1 + + # build all images for chosen targets + if [ "$#" -eq 1 ] + then + PLATFORMS=${SUPPORTED_PLATFORMS[@]} + break + fi + else + for j in ${SUPPORTED_PLATFORMS[@]} + do + if [ $j == $args ] + then + PLATFORMS+=$j" " + fi + done + fi +done + +# now build the firmware (depends on rimage) +rm -fr src/arch/xtensa/*.ri + # fail on any errors set -e
@@ -8,67 +37,60 @@ set -e
pwd=`pwd`
-# make sure rimage is built and aligned with code -./configure --enable-rimage -make -sudo make install - -# now build the firmware (depends on rimage) -rm -fr src/arch/xtensa/*.ri
-SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl) - -# build all images for chosen targets -if [ "$#" -eq 0 ] +# make sure rimage is built and aligned with code +if [[ "x$BUILD_LOCAL" == "x" ]] then - PLATFORMS=${SUPPORTED_PLATFORMS[@]} + ./configure --enable-rimage + make + sudo make install else - PLATFORMS=$@ + echo "BUILD IN ~/bin" + rm -rf $pwd/local/ + ./configure --enable-rimage --prefix=$pwd/local + make + make install + PATH=$pwd/local/bin:$PATH fi
+# build platform for i in ${PLATFORMS[@]} do - for j in ${SUPPORTED_PLATFORMS[@]} - do - if [ $j == $i ] - then - if [ $j == "byt" ] - then - PLATFORM="baytrail" - ROOT="xtensa-byt-elf" - fi - if [ $j == "cht" ] - then - PLATFORM="cherrytrail" - ROOT="xtensa-byt-elf" - fi - if [ $j == "bdw" ] - then - PLATFORM="broadwell" - ROOT="xtensa-hsw-elf" - fi - if [ $j == "hsw" ] - then - PLATFORM="haswell" - ROOT="xtensa-hsw-elf" - fi - if [ $j == "apl" ] - then - PLATFORM="apollolake" - ROOT="xtensa-bxt-elf" - fi - if [ $j == "cnl" ] - then - PLATFORM="cannonlake" - ROOT="xtensa-cnl-elf" - fi - PATH=$pwd/../xtensa-root/$ROOT/bin:$PATH - ./configure --with-arch=xtensa --with-platform=$PLATFORM --with-root-dir=$pwd/../xtensa-root/$ROOT --host=$ROOT - make clean - make - make bin - fi - done + if [ $j == "byt" ] + then + PLATFORM="baytrail" + ROOT="xtensa-byt-elf" + fi + if [ $j == "cht" ] + then + PLATFORM="cherrytrail" + ROOT="xtensa-byt-elf" + fi + if [ $j == "bdw" ] + then + PLATFORM="broadwell" + ROOT="xtensa-hsw-elf" + fi + if [ $j == "hsw" ] + then + PLATFORM="haswell" + ROOT="xtensa-hsw-elf" + fi + if [ $j == "apl" ] + then + PLATFORM="apollolake" + ROOT="xtensa-bxt-elf" + fi + if [ $j == "cnl" ] + then + PLATFORM="cannonlake" + ROOT="xtensa-cnl-elf" + fi + PATH=$pwd/../xtensa-root/$ROOT/bin:$PATH + ./configure --with-arch=xtensa --with-platform=$PLATFORM --with-root-dir=$pwd/../xtensa-root/$ROOT --host=$ROOT + make clean + make + make bin done
# list all the images
On Fri, 2018-06-08 at 18:32 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Install prefix will not influce PEM install path. Add the check to let PEM can install with the prefix.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
configure.ac | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac index 0f34acc..a948906 100644 --- a/configure.ac +++ b/configure.ac @@ -358,7 +358,11 @@ if test "$have_rimage" = "yes"; then fi fi
+if test "x$prefix" == "xNONE"; then PEM_KEY_PREFIX="/usr/local/share/rimage" +else +PEM_KEY_PREFIX=$prefix"/share/rimage" +fi AC_DEFINE_UNQUOTED([PEM_KEY_PREFIX], ["$PEM_KEY_PREFIX"], ["Path for PEM keys"]) AC_SUBST(PEM_KEY_PREFIX)
@@ -448,6 +452,7 @@ echo " Target Architecture: ${ARCH} Target Platform: ${PLATFORM} Target Core: ${XTENSA_CORE} +Install Prefix: ${prefix} PEM: ${PEM_KEY_PREFIX}
Compiler: ${CC}
Both building with -l and without fails. :-
With -l
make[2]: Leaving directory '/home/lrg/source/reef/sof.git' make[1]: Leaving directory '/home/lrg/source/reef/sof.git' ./scripts/xtensa-build-all.sh: line 59: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 64: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 69: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 74: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 79: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 84: [: ==: unary operator expected checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether UID '1000' is supported by ustar format... yes checking whether GID '1000' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking whether to enable maintainer-specific portions of Makefiles... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu configure: error: Host platform not specified
without :-
make[3]: Leaving directory '/home/lrg/source/reef/sof.git/rimage/keys' make[2]: Leaving directory '/home/lrg/source/reef/sof.git/rimage/keys' make[2]: Entering directory '/home/lrg/source/reef/sof.git/rimage' make[3]: Entering directory '/home/lrg/source/reef/sof.git/rimage' /bin/mkdir -p '/usr/local/bin' /bin/bash ../libtool --mode=install /usr/bin/install -c rimage '/usr/local/bin' libtool: install: /usr/bin/install -c rimage /usr/local/bin/rimage make[3]: Nothing to be done for 'install-data-am'. make[3]: Leaving directory '/home/lrg/source/reef/sof.git/rimage' make[2]: Leaving directory '/home/lrg/source/reef/sof.git/rimage' make[1]: Leaving directory '/home/lrg/source/reef/sof.git/rimage' make[1]: Entering directory '/home/lrg/source/reef/sof.git' make[2]: Entering directory '/home/lrg/source/reef/sof.git' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/home/lrg/source/reef/sof.git' make[1]: Leaving directory '/home/lrg/source/reef/sof.git' ls: cannot access 'src/arch/xtensa/*.ri': No such file or directory
Please test this stuff.
Thanks
Liam
On 6/9/2018 03:05, Liam Girdwood wrote:
On Fri, 2018-06-08 at 18:32 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Install prefix will not influce PEM install path. Add the check to let PEM can install with the prefix.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
configure.ac | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac index 0f34acc..a948906 100644 --- a/configure.ac +++ b/configure.ac @@ -358,7 +358,11 @@ if test "$have_rimage" = "yes"; then fi fi
+if test "x$prefix" == "xNONE"; then PEM_KEY_PREFIX="/usr/local/share/rimage" +else +PEM_KEY_PREFIX=$prefix"/share/rimage" +fi AC_DEFINE_UNQUOTED([PEM_KEY_PREFIX], ["$PEM_KEY_PREFIX"], ["Path for PEM keys"]) AC_SUBST(PEM_KEY_PREFIX)
@@ -448,6 +452,7 @@ echo " Target Architecture: ${ARCH} Target Platform: ${PLATFORM} Target Core: ${XTENSA_CORE} +Install Prefix: ${prefix} PEM: ${PEM_KEY_PREFIX}
Compiler: ${CC}
Both building with -l and without fails. :-
With -l
I found that I have some mismatch for the variable name in on of the loop.
make[2]: Leaving directory '/home/lrg/source/reef/sof.git' make[1]: Leaving directory '/home/lrg/source/reef/sof.git' ./scripts/xtensa-build-all.sh: line 59: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 64: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 69: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 74: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 79: [: ==: unary operator expected ./scripts/xtensa-build-all.sh: line 84: [: ==: unary operator expected checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether UID '1000' is supported by ustar format... yes checking whether GID '1000' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking whether to enable maintainer-specific portions of Makefiles... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu configure: error: Host platform not specified
without :-
I realized there is a bug for without no args yesterday when I think about this patch. It will do nothing for this.
Will send a v2 version.
Thanks Xiuli
make[3]: Leaving directory '/home/lrg/source/reef/sof.git/rimage/keys' make[2]: Leaving directory '/home/lrg/source/reef/sof.git/rimage/keys' make[2]: Entering directory '/home/lrg/source/reef/sof.git/rimage' make[3]: Entering directory '/home/lrg/source/reef/sof.git/rimage' /bin/mkdir -p '/usr/local/bin' /bin/bash ../libtool --mode=install /usr/bin/install -c rimage '/usr/local/bin' libtool: install: /usr/bin/install -c rimage /usr/local/bin/rimage make[3]: Nothing to be done for 'install-data-am'. make[3]: Leaving directory '/home/lrg/source/reef/sof.git/rimage' make[2]: Leaving directory '/home/lrg/source/reef/sof.git/rimage' make[1]: Leaving directory '/home/lrg/source/reef/sof.git/rimage' make[1]: Entering directory '/home/lrg/source/reef/sof.git' make[2]: Entering directory '/home/lrg/source/reef/sof.git' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/home/lrg/source/reef/sof.git' make[1]: Leaving directory '/home/lrg/source/reef/sof.git' ls: cannot access 'src/arch/xtensa/*.ri': No such file or directory
Please test this stuff.
Thanks
Liam
participants (3)
-
Liam Girdwood
-
Pan, Xiuli
-
Xiuli Pan