All of lore.kernel.org
 help / color / mirror / Atom feed
* Denys Dmytriyenko : setup-defconfig: support combined defconfig with listed config fragments
@ 2015-01-08 17:22 Arago Project git
  0 siblings, 0 replies; 4+ messages in thread
From: Arago Project git @ 2015-01-08 17:22 UTC (permalink / raw)
  To: meta-ti

Module: meta-ti
Branch: daisy
Commit: 91e70b16fcc165bfe8824ece198f64b7757aac40
URL:    http://arago-project.org/git/meta-ti.git?a=commit;h=91e70b16fcc165bfe8824ece198f64b7757aac40

Author: Denys Dmytriyenko <denys@ti.com>
Date:   Tue Jan  6 05:31:57 2015 +0000

setup-defconfig: support combined defconfig with listed config fragments

Signed-off-by: Denys Dmytriyenko <denys@ti.com>

---

 .../linux/linux-ti-staging-3.14/defconfig          |    2 +-
 recipes-kernel/linux/linux-ti-staging_3.14.bb      |    8 +--
 recipes-kernel/linux/setup-defconfig.inc           |   64 +++++++++++++-------
 3 files changed, 44 insertions(+), 30 deletions(-)

diff --git a/recipes-kernel/linux/linux-ti-staging-3.14/defconfig b/recipes-kernel/linux/linux-ti-staging-3.14/defconfig
index 926b35a..990e7f7 100644
--- a/recipes-kernel/linux/linux-ti-staging-3.14/defconfig
+++ b/recipes-kernel/linux/linux-ti-staging-3.14/defconfig
@@ -1 +1 @@
-use-kernel-config=omap2plus_defconfig
+use-combined-config=ti_config_fragments/defconfig_fragment
diff --git a/recipes-kernel/linux/linux-ti-staging_3.14.bb b/recipes-kernel/linux/linux-ti-staging_3.14.bb
index 61989c3..2e89ace 100644
--- a/recipes-kernel/linux/linux-ti-staging_3.14.bb
+++ b/recipes-kernel/linux/linux-ti-staging_3.14.bb
@@ -44,18 +44,14 @@ S = "${WORKDIR}/git"
 
 BRANCH = "ti-linux-3.14.y"
 
-SRCREV = "f93aba31cfc224ed7ea414d1b7ab988808d764ba"
+SRCREV = "4311f726041145161621593e5d67f106913c0f28"
 PV = "3.14.26"
 
 # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild
-MACHINE_KERNEL_PR_append = "b+gitr${SRCPV}"
+MACHINE_KERNEL_PR_append = "c+gitr${SRCPV}"
 PR = "${MACHINE_KERNEL_PR}"
 
 KERNEL_CONFIG_DIR = "${S}/ti_config_fragments"
-KERNEL_CONFIG_FRAGMENTS = "${KERNEL_CONFIG_DIR}/baseport.cfg ${KERNEL_CONFIG_DIR}/all_valid_socs.cfg \
-                           ${KERNEL_CONFIG_DIR}/power.cfg ${KERNEL_CONFIG_DIR}/connectivity.cfg \
-                           ${KERNEL_CONFIG_DIR}/ipc.cfg ${KERNEL_CONFIG_DIR}/audio_display.cfg \
-                           ${KERNEL_CONFIG_DIR}/wlan.cfg"
 
 KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${KERNEL_CONFIG_DIR}/am33xx_only.cfg"
 KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${KERNEL_CONFIG_DIR}/am43xx_only.cfg"
diff --git a/recipes-kernel/linux/setup-defconfig.inc b/recipes-kernel/linux/setup-defconfig.inc
index dbfd0d4..7468929 100644
--- a/recipes-kernel/linux/setup-defconfig.inc
+++ b/recipes-kernel/linux/setup-defconfig.inc
@@ -4,13 +4,9 @@ KERNEL_LOCALVERSION ?= ""
 
 # Check the defconfig file and see if it points to an in kernel
 # defconfig that should be used, or if it is a complete config file
+# Or if it points to a combined defconfig that lists both in kernel
+# defconfig and associated config fragments.
 
-# define our own do_configure that will:
-#   1. Check the .config file and see if string use-kernel-config= is present
-#   2. If the use-kernel-config string is present parse out the config to use
-#      and run make $config
-#   3. else run yes '' | oe_runmake oldconfig like the default do_configure
-#      does
 do_configure() {
     # Always copy the defconfig file to .config to keep consistency
     # between the case where there is a real config and the in kernel
@@ -19,40 +15,62 @@ do_configure() {
 
     echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
     echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
+
+    # First, check if pointing to a combined config with config fragments
+    config=`cat ${S}/.config | grep use-combined-config | cut -d= -f2`
+    if [ -n "$config" ]
+    then
+        cp $config ${S}/.config
+    fi
+
+    # Second, extract any config fragments listed in the defconfig
+    config=`cat ${S}/.config | grep config-fragment | cut -d= -f2`
+    if [ -n "$config" ]
+    then
+        configfrags=""
+        for f in $config
+        do
+            # Check if the config fragment is available
+            if [ ! -e "$f" ]
+            then
+                echo "Could not find kernel config fragment $f"
+                exit 1
+            else
+                # Sanitize config fragment files to be relative to sources
+                configfrags+=" ${S}/$f"
+            fi
+        done
+    fi
+
+    # Third, check if pointing to a known in kernel defconfig
     config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2`
-    if [ ! -z "$config" ]
+    if [ -n "$config" ]
     then
         oe_runmake $config
     else
         yes '' | oe_runmake oldconfig
     fi
 
-    # Check for kernel config fragments.  The assumption is that the config
-    # fragment will be specified with the absolute path.  For example:
-    #   * ${WORKDIR}/config1.cfg
-    #   * ${S}/config2.cfg
-    # Iterate through the list of configs and make sure that you can find
-    # each one.  If not then error out.
-    # NOTE: If you want to override a configuration that is kept in the kernel
-    #       with one from the OE meta data then you should make sure that the
-    #       OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed
-    #       after the in kernel configuration fragment.
-    # Check if any config fragments are specified.
-    if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ]
+    # Fourth, handle config fragments specified in the recipe
+    # The assumption is that the config fragment will be specified with the absolute path.
+    # E.g. ${WORKDIR}/config1.cfg or ${S}/config2.cfg
+    if [ -n "${KERNEL_CONFIG_FRAGMENTS}" ]
     then
         for f in ${KERNEL_CONFIG_FRAGMENTS}
         do
-            # Check if the config fragment was copied into the WORKDIR from
-            # the OE meta data
+            # Check if the config fragment is available
             if [ ! -e "$f" ]
             then
                 echo "Could not find kernel config fragment $f"
                 exit 1
             fi
         done
+    fi
 
-        # Now that all the fragments are located merge them.
-        ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
+    # Now that all the fragments are located merge them
+    if [ -n "${KERNEL_CONFIG_FRAGMENTS}" -o -n "$configfrags" ]
+    then
+        ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config $configfrags ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
         yes '' | oe_runmake oldconfig
     fi
 }



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Denys Dmytriyenko : setup-defconfig: support combined?defconfig with listed config fragments
  2015-01-09  9:58 ` Francesco Del Degan
@ 2015-01-09 16:03   ` Denys Dmytriyenko
  0 siblings, 0 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2015-01-09 16:03 UTC (permalink / raw)
  To: Francesco Del Degan; +Cc: meta-ti

On Fri, Jan 09, 2015 at 09:58:10AM +0000, Francesco Del Degan wrote:
> Arago Project git <git@...> writes:
> 
> > +    config=`cat ${S}/.config | grep config-fragment | cut -d= -f2`
> > +    if [ -n "$config" ]
> > +    then
> > +        configfrags=""
> > +        for f in $config
> > +        do
> > +            # Check if the config fragment is available
> > +            if [ ! -e "$f" ]
> > +            then
> > +                echo "Could not find kernel config fragment $f"
> > +                exit 1
> > +            else
> > +                # Sanitize config fragment files to be relative to 
> sources
> > +                configfrags+=" ${S}/$f"
> > +            fi
> > +        done
> > +    fi
> > +
> 
> Hi,
> 
> I think that configfrags+="..." here is a bashism. It fails on my builder 
> with "configfrags+= ..... not found".
> 
> I resolved with configfrags="$configfrags ${S}/$f"

Thanks. I'll fix it.
There are many more bashisms in other places, so I'm not specifically looking 
for them...

-- 
Denys


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Denys Dmytriyenko : setup-defconfig: support combined defconfig with listed config fragments
  2015-01-08 17:22 Arago Project git
@ 2015-01-09  9:58 ` Francesco Del Degan
  2015-01-09 16:03   ` Denys Dmytriyenko : setup-defconfig: support combined?defconfig " Denys Dmytriyenko
  0 siblings, 1 reply; 4+ messages in thread
From: Francesco Del Degan @ 2015-01-09  9:58 UTC (permalink / raw)
  To: meta-ti

Arago Project git <git@...> writes:

> +    config=`cat ${S}/.config | grep config-fragment | cut -d= -f2`
> +    if [ -n "$config" ]
> +    then
> +        configfrags=""
> +        for f in $config
> +        do
> +            # Check if the config fragment is available
> +            if [ ! -e "$f" ]
> +            then
> +                echo "Could not find kernel config fragment $f"
> +                exit 1
> +            else
> +                # Sanitize config fragment files to be relative to 
sources
> +                configfrags+=" ${S}/$f"
> +            fi
> +        done
> +    fi
> +

Hi,

I think that configfrags+="..." here is a bashism. It fails on my builder 
with "configfrags+= ..... not found".

I resolved with configfrags="$configfrags ${S}/$f"

Cheers,
  Francesco




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Denys Dmytriyenko : setup-defconfig: support combined defconfig with listed config fragments
@ 2015-01-08 17:22 Arago Project git
  2015-01-09  9:58 ` Francesco Del Degan
  0 siblings, 1 reply; 4+ messages in thread
From: Arago Project git @ 2015-01-08 17:22 UTC (permalink / raw)
  To: meta-ti

Module: meta-ti
Branch: master
Commit: abdbb75fb09037f85ab8b653dd5900a33f382e84
URL:    http://arago-project.org/git/meta-ti.git?a=commit;h=abdbb75fb09037f85ab8b653dd5900a33f382e84

Author: Denys Dmytriyenko <denys@ti.com>
Date:   Tue Jan  6 05:31:57 2015 +0000

setup-defconfig: support combined defconfig with listed config fragments

Signed-off-by: Denys Dmytriyenko <denys@ti.com>

---

 .../linux/linux-ti-staging-3.14/defconfig          |    2 +-
 recipes-kernel/linux/linux-ti-staging_3.14.bb      |    8 +--
 recipes-kernel/linux/setup-defconfig.inc           |   64 +++++++++++++-------
 3 files changed, 44 insertions(+), 30 deletions(-)

diff --git a/recipes-kernel/linux/linux-ti-staging-3.14/defconfig b/recipes-kernel/linux/linux-ti-staging-3.14/defconfig
index 926b35a..990e7f7 100644
--- a/recipes-kernel/linux/linux-ti-staging-3.14/defconfig
+++ b/recipes-kernel/linux/linux-ti-staging-3.14/defconfig
@@ -1 +1 @@
-use-kernel-config=omap2plus_defconfig
+use-combined-config=ti_config_fragments/defconfig_fragment
diff --git a/recipes-kernel/linux/linux-ti-staging_3.14.bb b/recipes-kernel/linux/linux-ti-staging_3.14.bb
index 61989c3..2e89ace 100644
--- a/recipes-kernel/linux/linux-ti-staging_3.14.bb
+++ b/recipes-kernel/linux/linux-ti-staging_3.14.bb
@@ -44,18 +44,14 @@ S = "${WORKDIR}/git"
 
 BRANCH = "ti-linux-3.14.y"
 
-SRCREV = "f93aba31cfc224ed7ea414d1b7ab988808d764ba"
+SRCREV = "4311f726041145161621593e5d67f106913c0f28"
 PV = "3.14.26"
 
 # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild
-MACHINE_KERNEL_PR_append = "b+gitr${SRCPV}"
+MACHINE_KERNEL_PR_append = "c+gitr${SRCPV}"
 PR = "${MACHINE_KERNEL_PR}"
 
 KERNEL_CONFIG_DIR = "${S}/ti_config_fragments"
-KERNEL_CONFIG_FRAGMENTS = "${KERNEL_CONFIG_DIR}/baseport.cfg ${KERNEL_CONFIG_DIR}/all_valid_socs.cfg \
-                           ${KERNEL_CONFIG_DIR}/power.cfg ${KERNEL_CONFIG_DIR}/connectivity.cfg \
-                           ${KERNEL_CONFIG_DIR}/ipc.cfg ${KERNEL_CONFIG_DIR}/audio_display.cfg \
-                           ${KERNEL_CONFIG_DIR}/wlan.cfg"
 
 KERNEL_CONFIG_FRAGMENTS_append_ti33x = " ${KERNEL_CONFIG_DIR}/am33xx_only.cfg"
 KERNEL_CONFIG_FRAGMENTS_append_ti43x = " ${KERNEL_CONFIG_DIR}/am43xx_only.cfg"
diff --git a/recipes-kernel/linux/setup-defconfig.inc b/recipes-kernel/linux/setup-defconfig.inc
index dbfd0d4..7468929 100644
--- a/recipes-kernel/linux/setup-defconfig.inc
+++ b/recipes-kernel/linux/setup-defconfig.inc
@@ -4,13 +4,9 @@ KERNEL_LOCALVERSION ?= ""
 
 # Check the defconfig file and see if it points to an in kernel
 # defconfig that should be used, or if it is a complete config file
+# Or if it points to a combined defconfig that lists both in kernel
+# defconfig and associated config fragments.
 
-# define our own do_configure that will:
-#   1. Check the .config file and see if string use-kernel-config= is present
-#   2. If the use-kernel-config string is present parse out the config to use
-#      and run make $config
-#   3. else run yes '' | oe_runmake oldconfig like the default do_configure
-#      does
 do_configure() {
     # Always copy the defconfig file to .config to keep consistency
     # between the case where there is a real config and the in kernel
@@ -19,40 +15,62 @@ do_configure() {
 
     echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
     echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
+
+    # First, check if pointing to a combined config with config fragments
+    config=`cat ${S}/.config | grep use-combined-config | cut -d= -f2`
+    if [ -n "$config" ]
+    then
+        cp $config ${S}/.config
+    fi
+
+    # Second, extract any config fragments listed in the defconfig
+    config=`cat ${S}/.config | grep config-fragment | cut -d= -f2`
+    if [ -n "$config" ]
+    then
+        configfrags=""
+        for f in $config
+        do
+            # Check if the config fragment is available
+            if [ ! -e "$f" ]
+            then
+                echo "Could not find kernel config fragment $f"
+                exit 1
+            else
+                # Sanitize config fragment files to be relative to sources
+                configfrags+=" ${S}/$f"
+            fi
+        done
+    fi
+
+    # Third, check if pointing to a known in kernel defconfig
     config=`cat ${S}/.config | grep use-kernel-config | cut -d= -f2`
-    if [ ! -z "$config" ]
+    if [ -n "$config" ]
     then
         oe_runmake $config
     else
         yes '' | oe_runmake oldconfig
     fi
 
-    # Check for kernel config fragments.  The assumption is that the config
-    # fragment will be specified with the absolute path.  For example:
-    #   * ${WORKDIR}/config1.cfg
-    #   * ${S}/config2.cfg
-    # Iterate through the list of configs and make sure that you can find
-    # each one.  If not then error out.
-    # NOTE: If you want to override a configuration that is kept in the kernel
-    #       with one from the OE meta data then you should make sure that the
-    #       OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed
-    #       after the in kernel configuration fragment.
-    # Check if any config fragments are specified.
-    if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ]
+    # Fourth, handle config fragments specified in the recipe
+    # The assumption is that the config fragment will be specified with the absolute path.
+    # E.g. ${WORKDIR}/config1.cfg or ${S}/config2.cfg
+    if [ -n "${KERNEL_CONFIG_FRAGMENTS}" ]
     then
         for f in ${KERNEL_CONFIG_FRAGMENTS}
         do
-            # Check if the config fragment was copied into the WORKDIR from
-            # the OE meta data
+            # Check if the config fragment is available
             if [ ! -e "$f" ]
             then
                 echo "Could not find kernel config fragment $f"
                 exit 1
             fi
         done
+    fi
 
-        # Now that all the fragments are located merge them.
-        ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
+    # Now that all the fragments are located merge them
+    if [ -n "${KERNEL_CONFIG_FRAGMENTS}" -o -n "$configfrags" ]
+    then
+        ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${S} ${S}/.config $configfrags ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
         yes '' | oe_runmake oldconfig
     fi
 }



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-09 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 17:22 Denys Dmytriyenko : setup-defconfig: support combined defconfig with listed config fragments Arago Project git
  -- strict thread matches above, loose matches on Subject: below --
2015-01-08 17:22 Arago Project git
2015-01-09  9:58 ` Francesco Del Degan
2015-01-09 16:03   ` Denys Dmytriyenko : setup-defconfig: support combined?defconfig " Denys Dmytriyenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.