All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel menuconfig/ncurses patch in linux-yocto
@ 2016-07-20 20:19 Jacob Kroon
  2016-07-21  3:22 ` Bruce Ashfield
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Kroon @ 2016-07-20 20:19 UTC (permalink / raw)
  To: Yocto Project; +Cc: jason.wessel

Hi,
I'm trying to get the SDK to be able to run the kernel's "make
menuconfig" target
using nativesdk-ncurses from the SDK. Looking at

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc

I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
in that patch looks weird:

    elif pkg-config --cflags ncurses 2>/dev/null; then
        echo '-DCURSES_LOC="<ncurses.h>"'
+   if [ x"$CROSS_CURSES_INC" != x ]; then
+   echo "$CROSS_CURSES_INC"
+   exit
+   fi
    elif [ -f /usr/include/ncursesw/curses.h ]; then
        echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'

(I had to do manual indentation with spaces in gmail)
Is the indentation or the logic incorrect ?

Regards Jacob


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

* Re: kernel menuconfig/ncurses patch in linux-yocto
  2016-07-20 20:19 kernel menuconfig/ncurses patch in linux-yocto Jacob Kroon
@ 2016-07-21  3:22 ` Bruce Ashfield
  2016-07-21  6:35   ` Jacob Kroon
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2016-07-21  3:22 UTC (permalink / raw)
  To: Jacob Kroon, Yocto Project; +Cc: jason.wessel

On 2016-07-20 4:19 PM, Jacob Kroon wrote:
> Hi,
> I'm trying to get the SDK to be able to run the kernel's "make
> menuconfig" target
> using nativesdk-ncurses from the SDK. Looking at
>
> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc
>
> I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
> in that patch looks weird:
>
>     elif pkg-config --cflags ncurses 2>/dev/null; then
>         echo '-DCURSES_LOC="<ncurses.h>"'
> +   if [ x"$CROSS_CURSES_INC" != x ]; then
> +   echo "$CROSS_CURSES_INC"
> +   exit
> +   fi
>     elif [ -f /usr/include/ncursesw/curses.h ]; then
>         echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>
> (I had to do manual indentation with spaces in gmail)
> Is the indentation or the logic incorrect ?

In the commit itself, the indentation is fine.

That block of code is just dumping flags that are used in the
build. So in this case, it is correct. If the variable is
non empty, it is echoed and then processing exits.

Bruce

>
> Regards Jacob
>



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

* Re: kernel menuconfig/ncurses patch in linux-yocto
  2016-07-21  3:22 ` Bruce Ashfield
@ 2016-07-21  6:35   ` Jacob Kroon
  2016-07-21 12:58     ` Bruce Ashfield
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Kroon @ 2016-07-21  6:35 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Yocto Project, jason.wessel

On Thu, Jul 21, 2016 at 5:22 AM, Bruce Ashfield
<bruce.ashfield@windriver.com> wrote:
> On 2016-07-20 4:19 PM, Jacob Kroon wrote:
>>
>> Hi,
>> I'm trying to get the SDK to be able to run the kernel's "make
>> menuconfig" target
>> using nativesdk-ncurses from the SDK. Looking at
>>
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc
>>
>> I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
>> in that patch looks weird:
>>
>>     elif pkg-config --cflags ncurses 2>/dev/null; then
>>         echo '-DCURSES_LOC="<ncurses.h>"'
>> +   if [ x"$CROSS_CURSES_INC" != x ]; then
>> +   echo "$CROSS_CURSES_INC"
>> +   exit
>> +   fi
>>     elif [ -f /usr/include/ncursesw/curses.h ]; then
>>         echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>>
>> (I had to do manual indentation with spaces in gmail)
>> Is the indentation or the logic incorrect ?
>
>
> In the commit itself, the indentation is fine.
>
> That block of code is just dumping flags that are used in the
> build. So in this case, it is correct. If the variable is
> non empty, it is echoed and then processing exits.

The check if CROSS_CURSES_INC is non-empty is only done if the preceeding
 "elif"-check is true, and not unconditionally as one would expect
judging by the indentation.


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

* Re: kernel menuconfig/ncurses patch in linux-yocto
  2016-07-21  6:35   ` Jacob Kroon
@ 2016-07-21 12:58     ` Bruce Ashfield
  2016-07-21 13:06       ` Bruce Ashfield
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2016-07-21 12:58 UTC (permalink / raw)
  To: Jacob Kroon; +Cc: Yocto Project, jason.wessel

On 2016-07-21 02:35 AM, Jacob Kroon wrote:
> On Thu, Jul 21, 2016 at 5:22 AM, Bruce Ashfield
> <bruce.ashfield@windriver.com> wrote:
>> On 2016-07-20 4:19 PM, Jacob Kroon wrote:
>>>
>>> Hi,
>>> I'm trying to get the SDK to be able to run the kernel's "make
>>> menuconfig" target
>>> using nativesdk-ncurses from the SDK. Looking at
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc
>>>
>>> I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
>>> in that patch looks weird:
>>>
>>>      elif pkg-config --cflags ncurses 2>/dev/null; then
>>>          echo '-DCURSES_LOC="<ncurses.h>"'
>>> +   if [ x"$CROSS_CURSES_INC" != x ]; then
>>> +   echo "$CROSS_CURSES_INC"
>>> +   exit
>>> +   fi
>>>      elif [ -f /usr/include/ncursesw/curses.h ]; then
>>>          echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>>>
>>> (I had to do manual indentation with spaces in gmail)
>>> Is the indentation or the logic incorrect ?
>>
>>
>> In the commit itself, the indentation is fine.
>>
>> That block of code is just dumping flags that are used in the
>> build. So in this case, it is correct. If the variable is
>> non empty, it is echoed and then processing exits.
>
> The check if CROSS_CURSES_INC is non-empty is only done if the preceeding
>   "elif"-check is true, and not unconditionally as one would expect
> judging by the indentation.

Yep, that's the point. It goes to pkgconfig first, and then falls
back to that.

The indention is fine in the actual repository.

--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,6 +4,10 @@
  # What library to link
  ldflags()
  {
+       if [ "$CROSS_CURSES_LIB" != "" ]; then
+               echo "$CROSS_CURSES_LIB"
+               exit
+       fi
         pkg-config --libs ncursesw 2>/dev/null && exit
         pkg-config --libs ncurses 2>/dev/null && exit
         for ext in so a dll.a dylib ; do
@@ -25,6 +29,10 @@ ccflags()
                 echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
         elif pkg-config --cflags ncurses 2>/dev/null; then
                 echo '-DCURSES_LOC="<ncurses.h>"'
+       if [ x"$CROSS_CURSES_INC" != x ]; then
+               echo "$CROSS_CURSES_INC"
+               exit
+       fi
         elif [ -f /usr/include/ncursesw/curses.h ]; then
                 echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
                 echo ' -DNCURSES_WIDECHAR=1'



Bruce

>



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

* Re: kernel menuconfig/ncurses patch in linux-yocto
  2016-07-21 12:58     ` Bruce Ashfield
@ 2016-07-21 13:06       ` Bruce Ashfield
  2016-07-21 14:24         ` Jacob Kroon
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2016-07-21 13:06 UTC (permalink / raw)
  To: Jacob Kroon; +Cc: Yocto Project, jason.wessel

On 2016-07-21 08:58 AM, Bruce Ashfield wrote:
> On 2016-07-21 02:35 AM, Jacob Kroon wrote:
>> On Thu, Jul 21, 2016 at 5:22 AM, Bruce Ashfield
>> <bruce.ashfield@windriver.com> wrote:
>>> On 2016-07-20 4:19 PM, Jacob Kroon wrote:
>>>>
>>>> Hi,
>>>> I'm trying to get the SDK to be able to run the kernel's "make
>>>> menuconfig" target
>>>> using nativesdk-ncurses from the SDK. Looking at
>>>>
>>>>
>>>> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc
>>>>
>>>>
>>>> I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
>>>> in that patch looks weird:
>>>>
>>>>      elif pkg-config --cflags ncurses 2>/dev/null; then
>>>>          echo '-DCURSES_LOC="<ncurses.h>"'
>>>> +   if [ x"$CROSS_CURSES_INC" != x ]; then
>>>> +   echo "$CROSS_CURSES_INC"
>>>> +   exit
>>>> +   fi
>>>>      elif [ -f /usr/include/ncursesw/curses.h ]; then
>>>>          echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>>>>
>>>> (I had to do manual indentation with spaces in gmail)
>>>> Is the indentation or the logic incorrect ?
>>>
>>>
>>> In the commit itself, the indentation is fine.
>>>
>>> That block of code is just dumping flags that are used in the
>>> build. So in this case, it is correct. If the variable is
>>> non empty, it is echoed and then processing exits.
>>
>> The check if CROSS_CURSES_INC is non-empty is only done if the preceeding
>>   "elif"-check is true, and not unconditionally as one would expect
>> judging by the indentation.
>
> Yep, that's the point. It goes to pkgconfig first, and then falls
> back to that.
>
> The indention is fine in the actual repository.

oh wait.

I had my coffee and I see now what you mean, I was checking
older repos, and when this merged into the 4.4 tree it does
look like the conditional is hosed.

I'll queue up a closer look at this later today.

Bruce

>
> --- a/scripts/kconfig/lxdialog/check-lxdialog.sh
> +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
> @@ -4,6 +4,10 @@
>   # What library to link
>   ldflags()
>   {
> +       if [ "$CROSS_CURSES_LIB" != "" ]; then
> +               echo "$CROSS_CURSES_LIB"
> +               exit
> +       fi
>          pkg-config --libs ncursesw 2>/dev/null && exit
>          pkg-config --libs ncurses 2>/dev/null && exit
>          for ext in so a dll.a dylib ; do
> @@ -25,6 +29,10 @@ ccflags()
>                  echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
>          elif pkg-config --cflags ncurses 2>/dev/null; then
>                  echo '-DCURSES_LOC="<ncurses.h>"'
> +       if [ x"$CROSS_CURSES_INC" != x ]; then
> +               echo "$CROSS_CURSES_INC"
> +               exit
> +       fi
>          elif [ -f /usr/include/ncursesw/curses.h ]; then
>                  echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>                  echo ' -DNCURSES_WIDECHAR=1'
>
>
>
> Bruce
>
>>
>



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

* Re: kernel menuconfig/ncurses patch in linux-yocto
  2016-07-21 13:06       ` Bruce Ashfield
@ 2016-07-21 14:24         ` Jacob Kroon
  2016-07-21 17:01           ` Bruce Ashfield
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Kroon @ 2016-07-21 14:24 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Yocto Project, jason.wessel

On Thu, Jul 21, 2016 at 3:06 PM, Bruce Ashfield
<bruce.ashfield@windriver.com> wrote:
> On 2016-07-21 08:58 AM, Bruce Ashfield wrote:
>>
>> On 2016-07-21 02:35 AM, Jacob Kroon wrote:
>>>
>>> On Thu, Jul 21, 2016 at 5:22 AM, Bruce Ashfield
>>> <bruce.ashfield@windriver.com> wrote:
>>>>
>>>> On 2016-07-20 4:19 PM, Jacob Kroon wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>> I'm trying to get the SDK to be able to run the kernel's "make
>>>>> menuconfig" target
>>>>> using nativesdk-ncurses from the SDK. Looking at
>>>>>
>>>>>
>>>>>
>>>>> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc
>>>>>
>>>>>
>>>>> I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
>>>>> in that patch looks weird:
>>>>>
>>>>>      elif pkg-config --cflags ncurses 2>/dev/null; then
>>>>>          echo '-DCURSES_LOC="<ncurses.h>"'
>>>>> +   if [ x"$CROSS_CURSES_INC" != x ]; then
>>>>> +   echo "$CROSS_CURSES_INC"
>>>>> +   exit
>>>>> +   fi
>>>>>      elif [ -f /usr/include/ncursesw/curses.h ]; then
>>>>>          echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>>>>>
>>>>> (I had to do manual indentation with spaces in gmail)
>>>>> Is the indentation or the logic incorrect ?
>>>>
>>>>
>>>>
>>>> In the commit itself, the indentation is fine.
>>>>
>>>> That block of code is just dumping flags that are used in the
>>>> build. So in this case, it is correct. If the variable is
>>>> non empty, it is echoed and then processing exits.
>>>
>>>
>>> The check if CROSS_CURSES_INC is non-empty is only done if the preceeding
>>>   "elif"-check is true, and not unconditionally as one would expect
>>> judging by the indentation.
>>
>>
>> Yep, that's the point. It goes to pkgconfig first, and then falls
>> back to that.
>>
>> The indention is fine in the actual repository.
>
>
> oh wait.
>
> I had my coffee and I see now what you mean, I was checking
> older repos, and when this merged into the 4.4 tree it does
> look like the conditional is hosed.
>
> I'll queue up a closer look at this later today.
>
> Bruce
>

Ah, that explains it. Thank you for looking into it.

Jacob


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

* Re: kernel menuconfig/ncurses patch in linux-yocto
  2016-07-21 14:24         ` Jacob Kroon
@ 2016-07-21 17:01           ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2016-07-21 17:01 UTC (permalink / raw)
  To: Jacob Kroon; +Cc: Yocto Project, jason.wessel

On 2016-07-21 10:24 AM, Jacob Kroon wrote:
> On Thu, Jul 21, 2016 at 3:06 PM, Bruce Ashfield
> <bruce.ashfield@windriver.com> wrote:
>> On 2016-07-21 08:58 AM, Bruce Ashfield wrote:
>>>
>>> On 2016-07-21 02:35 AM, Jacob Kroon wrote:
>>>>
>>>> On Thu, Jul 21, 2016 at 5:22 AM, Bruce Ashfield
>>>> <bruce.ashfield@windriver.com> wrote:
>>>>>
>>>>> On 2016-07-20 4:19 PM, Jacob Kroon wrote:
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>> I'm trying to get the SDK to be able to run the kernel's "make
>>>>>> menuconfig" target
>>>>>> using nativesdk-ncurses from the SDK. Looking at
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-4.4/commit/scripts/kconfig/lxdialog/check-lxdialog.sh?h=standard/beaglebone&id=badf6fedf455958fe0ff3c060c8e3965ef6d80dc
>>>>>>
>>>>>>
>>>>>> I figured out I could pass CROSS_CURSES_[INC,LIB], but the second chunk
>>>>>> in that patch looks weird:
>>>>>>
>>>>>>       elif pkg-config --cflags ncurses 2>/dev/null; then
>>>>>>           echo '-DCURSES_LOC="<ncurses.h>"'
>>>>>> +   if [ x"$CROSS_CURSES_INC" != x ]; then
>>>>>> +   echo "$CROSS_CURSES_INC"
>>>>>> +   exit
>>>>>> +   fi
>>>>>>       elif [ -f /usr/include/ncursesw/curses.h ]; then
>>>>>>           echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"'
>>>>>>
>>>>>> (I had to do manual indentation with spaces in gmail)
>>>>>> Is the indentation or the logic incorrect ?
>>>>>
>>>>>
>>>>>
>>>>> In the commit itself, the indentation is fine.
>>>>>
>>>>> That block of code is just dumping flags that are used in the
>>>>> build. So in this case, it is correct. If the variable is
>>>>> non empty, it is echoed and then processing exits.
>>>>
>>>>
>>>> The check if CROSS_CURSES_INC is non-empty is only done if the preceeding
>>>>    "elif"-check is true, and not unconditionally as one would expect
>>>> judging by the indentation.
>>>
>>>
>>> Yep, that's the point. It goes to pkgconfig first, and then falls
>>> back to that.
>>>
>>> The indention is fine in the actual repository.
>>
>>
>> oh wait.
>>
>> I had my coffee and I see now what you mean, I was checking
>> older repos, and when this merged into the 4.4 tree it does
>> look like the conditional is hosed.
>>
>> I'll queue up a closer look at this later today.
>>
>> Bruce
>>
>
> Ah, that explains it. Thank you for looking into it.

Yup. The original patch (of 3.14 vintage) had migrated that chunk over
time to an invalid location.

I fixed the block in the 4.4 kernel, and have refreshed the path so
it will be fixed for the next linux-yocto kernel as well.

I've pushed the changes to the tree, and will follow up with SRCREV
bumps when my next change queue is ready.

Bruce

>
> Jacob
>



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

end of thread, other threads:[~2016-07-21 17:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-20 20:19 kernel menuconfig/ncurses patch in linux-yocto Jacob Kroon
2016-07-21  3:22 ` Bruce Ashfield
2016-07-21  6:35   ` Jacob Kroon
2016-07-21 12:58     ` Bruce Ashfield
2016-07-21 13:06       ` Bruce Ashfield
2016-07-21 14:24         ` Jacob Kroon
2016-07-21 17:01           ` Bruce Ashfield

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.