[dpdk-dev,2/3] scripts: avoid editing defconfig_* files in validate-abi.sh

Message ID 2e7fcffec863b7f60cf62707b3be3dd81a5de991.1457607217.git.pmatilai@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Panu Matilainen March 10, 2016, 10:53 a.m. UTC
  The defconfig_* files are templates which are not supposed to be
edited, and doing so tends to leave unwanted cruft behind. Edit
the "working copy" config instead, which is the intended DPDK way.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 scripts/validate-abi.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
  

Comments

Ferruh Yigit March 10, 2016, 12:25 p.m. UTC | #1
On 3/10/2016 10:53 AM, Panu Matilainen wrote:
> The defconfig_* files are templates which are not supposed to be
> edited, and doing so tends to leave unwanted cruft behind. Edit
> the "working copy" config instead, which is the intended DPDK way.
> 
> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> ---
>  scripts/validate-abi.sh | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
> index f094582..ea60639 100755
> --- a/scripts/validate-abi.sh
> +++ b/scripts/validate-abi.sh
> @@ -90,11 +90,11 @@ cleanup_and_exit() {
>  # Make sure we configure SHARED libraries
>  # Also turn off IGB and KNI as those require kernel headers to build
>  fixup_config() {
> -	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
> -	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
> -	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
> -	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
> -	sed -i -e"$ a\CONFIG_RTE_KNI_KMOD=n" config/defconfig_$TARGET
> +	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" $TARGET/.config
> +	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" $TARGET/.config
> +	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" $TARGET/.config
> +	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" $TARGET/.config
> +	sed -i -e"$ a\CONFIG_RTE_KNI_KMOD=n" $TARGET/.config
>  }
>  
Since working .config copy updated, is there a benefit to save and
restore the original .config file (if exists)?

And is "git reset --hard" still required in the script?

Thanks,
ferruh
  
Panu Matilainen March 10, 2016, 12:36 p.m. UTC | #2
On 03/10/2016 02:25 PM, Ferruh Yigit wrote:
> On 3/10/2016 10:53 AM, Panu Matilainen wrote:
>> The defconfig_* files are templates which are not supposed to be
>> edited, and doing so tends to leave unwanted cruft behind. Edit
>> the "working copy" config instead, which is the intended DPDK way.
>>
>> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
>> ---
>>   scripts/validate-abi.sh | 18 +++++++++---------
>>   1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
>> index f094582..ea60639 100755
>> --- a/scripts/validate-abi.sh
>> +++ b/scripts/validate-abi.sh
>> @@ -90,11 +90,11 @@ cleanup_and_exit() {
>>   # Make sure we configure SHARED libraries
>>   # Also turn off IGB and KNI as those require kernel headers to build
>>   fixup_config() {
>> -	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
>> -	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
>> -	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
>> -	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
>> -	sed -i -e"$ a\CONFIG_RTE_KNI_KMOD=n" config/defconfig_$TARGET
>> +	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" $TARGET/.config
>> +	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" $TARGET/.config
>> +	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" $TARGET/.config
>> +	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" $TARGET/.config
>> +	sed -i -e"$ a\CONFIG_RTE_KNI_KMOD=n" $TARGET/.config
>>   }
>>
> Since working .config copy updated, is there a benefit to save and
> restore the original .config file (if exists)?

Maybe, but it already is being modified and not restored, so that 
behavior is not new in this patch.

> And is "git reset --hard" still required in the script?

Perhaps not, strictly speaking. It does ensure there are no other 
artifacts left around though.

	- Panu -

> Thanks,
> ferruh
>
  

Patch

diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
index f094582..ea60639 100755
--- a/scripts/validate-abi.sh
+++ b/scripts/validate-abi.sh
@@ -90,11 +90,11 @@  cleanup_and_exit() {
 # Make sure we configure SHARED libraries
 # Also turn off IGB and KNI as those require kernel headers to build
 fixup_config() {
-	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
-	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
-	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
-	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
-	sed -i -e"$ a\CONFIG_RTE_KNI_KMOD=n" config/defconfig_$TARGET
+	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" $TARGET/.config
+	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" $TARGET/.config
+	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" $TARGET/.config
+	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" $TARGET/.config
+	sed -i -e"$ a\CONFIG_RTE_KNI_KMOD=n" $TARGET/.config
 }
 
 ###########################################
@@ -177,8 +177,6 @@  log "INFO" "Checking out version $TAG1 of the dpdk"
 # Move to the old version of the tree
 git checkout $HASH1
 
-fixup_config
-
 # Checking abi compliance relies on using the dwarf information in
 # The shared objects.  Thats only included in the DSO's if we build
 # with -g
@@ -189,6 +187,8 @@  export EXTRA_LDFLAGS="$EXTRA_LDFLAGS -g"
 log "INFO" "Configuring DPDK $TAG1"
 make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
 
+fixup_config
+
 log "INFO" "Building DPDK $TAG1. This might take a moment"
 make $MAKEJOBS O=$TARGET > $VERBOSE 2>&1
 
@@ -214,12 +214,12 @@  git reset --hard
 log "INFO" "Checking out version $TAG2 of the dpdk"
 git checkout $HASH2
 
-fixup_config
-
 # Now configure the build
 log "INFO" "Configuring DPDK $TAG2"
 make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
 
+fixup_config
+
 log "INFO" "Building DPDK $TAG2. This might take a moment"
 make $MAKEJOBS O=$TARGET > $VERBOSE 2>&1