* [PATCH] merge_config.sh: Add the ability to perform make with an ARCH
@ 2015-07-23 20:51 Dan Murphy
2015-07-24 6:23 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Dan Murphy @ 2015-07-23 20:51 UTC (permalink / raw)
To: yann.morin.1998; +Cc: linux-kbuild, linux-kernel, Dan Murphy
The script does not allow building for different architectures.
It may assume that the developer has set the ARCH as a global
variable.
Add a switch argument to pass in the desired architecture.
Then verify that that architecture is supported in the arch
directory.
If not exit if it is supported then set it.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
scripts/kconfig/merge_config.sh | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index ec8e203..bdbff4b 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -19,7 +19,16 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
-
+verify_arch() {
+ cd arch
+ for d in * ; do
+ if [ "$d" = "$_TEST_ARCH" ]; then
+ BUILD_ARCH="ARCH="$d
+ break
+ fi
+ done
+ cd ..
+}
clean_up() {
rm -f $TMP_FILE
exit
@@ -33,6 +42,7 @@ usage() {
echo " -n use allnoconfig instead of alldefconfig"
echo " -r list redundant entries when merging fragments"
echo " -O dir to put generated output files"
+ echo " -A architecture to support for make"
}
RUNMAKE=true
@@ -71,6 +81,21 @@ while true; do
shift 2
continue
;;
+ "-A")
+ if [ "$2" != "" ]; then
+ _TEST_ARCH=$2
+ verify_arch
+ if [ "$BUILD_ARCH" = "" ]; then
+ echo "ARCH $_TEST_ARCH is not valid" 1>&2
+ exit 1
+ fi
+ else
+ echo "ARCH $_TEST_ARCH is not valid" 1>&2
+ exit 1
+ fi
+ shift 2
+ continue
+ ;;
*)
break
;;
@@ -139,7 +164,7 @@ fi
# Use the merged file as the starting point for:
# alldefconfig: Fills in any missing symbols with Kconfig default
# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
-make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
+make $BUILD_ARCH KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
# Check all specified config values took (might have missed-dependency issues)
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] merge_config.sh: Add the ability to perform make with an ARCH
2015-07-23 20:51 [PATCH] merge_config.sh: Add the ability to perform make with an ARCH Dan Murphy
@ 2015-07-24 6:23 ` Masahiro Yamada
2015-07-24 13:41 ` Dan Murphy
0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2015-07-24 6:23 UTC (permalink / raw)
To: Dan Murphy
Cc: yann.morin.1998, Linux Kbuild mailing list,
Linux Kernel Mailing List
Hi Dan,
2015-07-24 5:51 GMT+09:00 Dan Murphy <dmurphy@ti.com>:
> The script does not allow building for different architectures.
> It may assume that the developer has set the ARCH as a global
> variable.
>
> Add a switch argument to pass in the desired architecture.
> Then verify that that architecture is supported in the arch
> directory.
>
> If not exit if it is supported then set it.
>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
> scripts/kconfig/merge_config.sh | 29 +++++++++++++++++++++++++++--
> 1 file changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index ec8e203..bdbff4b 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -19,7 +19,16 @@
> # but WITHOUT ANY WARRANTY; without even the implied warranty of
> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> # See the GNU General Public License for more details.
> -
> +verify_arch() {
> + cd arch
> + for d in * ; do
> + if [ "$d" = "$_TEST_ARCH" ]; then
> + BUILD_ARCH="ARCH="$d
> + break
> + fi
> + done
> + cd ..
> +}
> clean_up() {
> rm -f $TMP_FILE
> exit
> @@ -33,6 +42,7 @@ usage() {
> echo " -n use allnoconfig instead of alldefconfig"
> echo " -r list redundant entries when merging fragments"
> echo " -O dir to put generated output files"
> + echo " -A architecture to support for make"
> }
>
> RUNMAKE=true
> @@ -71,6 +81,21 @@ while true; do
> shift 2
> continue
> ;;
> + "-A")
> + if [ "$2" != "" ]; then
> + _TEST_ARCH=$2
> + verify_arch
> + if [ "$BUILD_ARCH" = "" ]; then
> + echo "ARCH $_TEST_ARCH is not valid" 1>&2
> + exit 1
> + fi
> + else
> + echo "ARCH $_TEST_ARCH is not valid" 1>&2
> + exit 1
> + fi
> + shift 2
> + continue
> + ;;
> *)
> break
> ;;
> @@ -139,7 +164,7 @@ fi
> # Use the merged file as the starting point for:
> # alldefconfig: Fills in any missing symbols with Kconfig default
> # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
> -make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
> +make $BUILD_ARCH KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
>
Let me clarify what you want to achieve by this patch.
You want to invoke merge_config.sh directly and to do
scripts/kconfig/merge_config.sh -A <target_arch> ...
as a shorthand for
ARCH=<target_arch> scripts/kconfig/merge_config.sh ...
Correct?
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] merge_config.sh: Add the ability to perform make with an ARCH
2015-07-24 6:23 ` Masahiro Yamada
@ 2015-07-24 13:41 ` Dan Murphy
0 siblings, 0 replies; 3+ messages in thread
From: Dan Murphy @ 2015-07-24 13:41 UTC (permalink / raw)
To: Masahiro Yamada
Cc: yann.morin.1998, Linux Kbuild mailing list,
Linux Kernel Mailing List
Yamada
On 07/24/2015 01:23 AM, Masahiro Yamada wrote:
> Hi Dan,
>
>
> 2015-07-24 5:51 GMT+09:00 Dan Murphy <dmurphy@ti.com>:
>> The script does not allow building for different architectures.
>> It may assume that the developer has set the ARCH as a global
>> variable.
>>
>> Add a switch argument to pass in the desired architecture.
>> Then verify that that architecture is supported in the arch
>> directory.
>>
>> If not exit if it is supported then set it.
>>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
>> scripts/kconfig/merge_config.sh | 29 +++++++++++++++++++++++++++--
>> 1 file changed, 27 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
>> index ec8e203..bdbff4b 100755
>> --- a/scripts/kconfig/merge_config.sh
>> +++ b/scripts/kconfig/merge_config.sh
>> @@ -19,7 +19,16 @@
>> # but WITHOUT ANY WARRANTY; without even the implied warranty of
>> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>> # See the GNU General Public License for more details.
>> -
>> +verify_arch() {
>> + cd arch
>> + for d in * ; do
>> + if [ "$d" = "$_TEST_ARCH" ]; then
>> + BUILD_ARCH="ARCH="$d
>> + break
>> + fi
>> + done
>> + cd ..
>> +}
>> clean_up() {
>> rm -f $TMP_FILE
>> exit
>> @@ -33,6 +42,7 @@ usage() {
>> echo " -n use allnoconfig instead of alldefconfig"
>> echo " -r list redundant entries when merging fragments"
>> echo " -O dir to put generated output files"
>> + echo " -A architecture to support for make"
>> }
>>
>> RUNMAKE=true
>> @@ -71,6 +81,21 @@ while true; do
>> shift 2
>> continue
>> ;;
>> + "-A")
>> + if [ "$2" != "" ]; then
>> + _TEST_ARCH=$2
>> + verify_arch
>> + if [ "$BUILD_ARCH" = "" ]; then
>> + echo "ARCH $_TEST_ARCH is not valid" 1>&2
>> + exit 1
>> + fi
>> + else
>> + echo "ARCH $_TEST_ARCH is not valid" 1>&2
>> + exit 1
>> + fi
>> + shift 2
>> + continue
>> + ;;
>> *)
>> break
>> ;;
>> @@ -139,7 +164,7 @@ fi
>> # Use the merged file as the starting point for:
>> # alldefconfig: Fills in any missing symbols with Kconfig default
>> # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
>> -make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
>> +make $BUILD_ARCH KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
>>
>
> Let me clarify what you want to achieve by this patch.
>
>
> You want to invoke merge_config.sh directly and to do
>
> scripts/kconfig/merge_config.sh -A <target_arch> ...
>
> as a shorthand for
>
> ARCH=<target_arch> scripts/kconfig/merge_config.sh ...
>
>
> Correct?
>
Yes that is correct. Just another way of achieving the same result.
>
>
>
>
--
------------------
Dan Murphy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-24 13:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 20:51 [PATCH] merge_config.sh: Add the ability to perform make with an ARCH Dan Murphy
2015-07-24 6:23 ` Masahiro Yamada
2015-07-24 13:41 ` Dan Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).