Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Unable to apply a patch for the buildroot makedevs tool
@ 2021-04-16  6:58 Ivan Castell
  2021-04-16 22:14 ` Peter Seiderer
  2021-04-17  7:13 ` Yann E. MORIN
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Castell @ 2021-04-16  6:58 UTC (permalink / raw)
  To: buildroot

Hello! I did a patch for the makedevs tool that provides a new 'x' option that allows setting permissions for directories recursively without modifiying permissions for regular files. The patch is named 'makedevs-0001-custom-opts-exclude-regular-files.patch' (see below), and is located inside package/makedevs/ directory. When I try to re-build the framework, I get this error:

# make all
>>> host-makedevs  Patching

Applying makedevs-0001-custom-opts-exclude-regular-files.patch using patch:
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -purN makedevs.orig/makedevs.c makedevs/makedevs.c
|--- makedevs.orig/makedevs.c 2021-04-15 14:40:03.439990661 +0000
|+++ makedevs/makedevs.c 2021-04-15 14:40:46.128006533 +0000
--------------------------
No file to patch.  Skipping patch.
3 out of 3 hunks ignored
package/pkg-generic.mk:187: recipe for target '/usr/local/share/buildroot/output/build/host-makedevs/.stamp_patched' failed
make: *** [/usr/local/share/buildroot/output/build/host-makedevs/.stamp_patched] Error 1

I was able to apply other patches properly that run on the target, but this tool is compiled to run on the host, and makedevs.mk rules compiles the makedevs.c source file without deploying it on output/build, and I think that's the main issue, but I am not completely sure.

Can you explain why is this patch not aplying properly and what should be the proper way to apply a patch for this makedevs tool, located inside the buildroot framework?

Thanks!




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210416/ab61fdd1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makedevs-0001-custom-opts-exclude-regular-files.patch
Type: text/x-patch
Size: 2103 bytes
Desc: makedevs-0001-custom-opts-exclude-regular-files.patch
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210416/ab61fdd1/attachment.bin>

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

* [Buildroot] Unable to apply a patch for the buildroot makedevs tool
  2021-04-16  6:58 [Buildroot] Unable to apply a patch for the buildroot makedevs tool Ivan Castell
@ 2021-04-16 22:14 ` Peter Seiderer
  2021-04-17  7:13 ` Yann E. MORIN
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Seiderer @ 2021-04-16 22:14 UTC (permalink / raw)
  To: buildroot

Hello Ivan,

On Fri, 16 Apr 2021 06:58:05 +0000, Ivan Castell <icastell@circontrol.com> wrote:

> Hello! I did a patch for the makedevs tool that provides a new 'x' option that allows setting permissions for directories recursively without modifiying permissions for regular files. The patch is named 'makedevs-0001-custom-opts-exclude-regular-files.patch' (see below), and is located inside package/makedevs/ directory. When I try to re-build the framework, I get this error:
>
> # make all
> >>> host-makedevs  Patching
>
> Applying makedevs-0001-custom-opts-exclude-regular-files.patch using patch:
> can't find file to patch at input line 4
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |diff -purN makedevs.orig/makedevs.c makedevs/makedevs.c
> |--- makedevs.orig/makedevs.c 2021-04-15 14:40:03.439990661 +0000
> |+++ makedevs/makedevs.c 2021-04-15 14:40:46.128006533 +0000
> --------------------------
> No file to patch.  Skipping patch.
> 3 out of 3 hunks ignored
> package/pkg-generic.mk:187: recipe for target '/usr/local/share/buildroot/output/build/host-makedevs/.stamp_patched' failed
> make: *** [/usr/local/share/buildroot/output/build/host-makedevs/.stamp_patched] Error 1

The makedevs package is a little bit special, as there is no download source package,
and the build receipt package/makedevs/makedevs.mk is just compiling the
(buildroot internal) file package/makedevs/makedevs.c, so no chance to apply a
patch, you need to patch the file package/makedevs/makedevs.c itself...

Regards,
Peter

>
> I was able to apply other patches properly that run on the target, but this tool is compiled to run on the host, and makedevs.mk rules compiles the makedevs.c source file without deploying it on output/build, and I think that's the main issue, but I am not completely sure.
>
> Can you explain why is this patch not aplying properly and what should be the proper way to apply a patch for this makedevs tool, located inside the buildroot framework?
>
> Thanks!
>
>
>
>

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

* [Buildroot] Unable to apply a patch for the buildroot makedevs tool
  2021-04-16  6:58 [Buildroot] Unable to apply a patch for the buildroot makedevs tool Ivan Castell
  2021-04-16 22:14 ` Peter Seiderer
@ 2021-04-17  7:13 ` Yann E. MORIN
  2021-04-19  5:58   ` Ivan Castell
  2021-04-26 21:48   ` Peter Korsgaard
  1 sibling, 2 replies; 6+ messages in thread
From: Yann E. MORIN @ 2021-04-17  7:13 UTC (permalink / raw)
  To: buildroot

Ivan, All,

On 2021-04-16 06:58 +0000, Ivan Castell spake thusly:
> Hello! I did a patch for the makedevs tool that provides a new 'x' option
> that allows setting permissions for directories recursively without
> modifiying permissions for regular files.

As Peter said, makedev is directly compiled from its single source file
in Buildroot's tree, so no way to patch it with the standard package
infrastructure.

However, your patch looks like it would provide an interesting feature
that we want in Buildroot.

Would you mind officially contributing your patch so we can apply it?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] Unable to apply a patch for the buildroot makedevs tool
  2021-04-17  7:13 ` Yann E. MORIN
@ 2021-04-19  5:58   ` Ivan Castell
  2021-04-19 17:04     ` Yann E. MORIN
  2021-04-26 21:48   ` Peter Korsgaard
  1 sibling, 1 reply; 6+ messages in thread
From: Ivan Castell @ 2021-04-19  5:58 UTC (permalink / raw)
  To: buildroot

Hello all.

Thanks for confirming my suspicions with makedevs patch. Please, proceed applying the patch, of course!

Kind regards,
  -- Ivan



________________________________
De: Yann E. MORIN <yann.morin.1998@free.fr>
Enviado: s?bado, 17 de abril de 2021 9:13
Para: Ivan Castell <icastell@circontrol.com>
Cc: buildroot at busybox.net <buildroot@busybox.net>
Asunto: Re: [Buildroot] Unable to apply a patch for the buildroot makedevs tool

Ivan, All,

On 2021-04-16 06:58 +0000, Ivan Castell spake thusly:
> Hello! I did a patch for the makedevs tool that provides a new 'x' option
> that allows setting permissions for directories recursively without
> modifiying permissions for regular files.

As Peter said, makedev is directly compiled from its single source file
in Buildroot's tree, so no way to patch it with the standard package
infrastructure.

However, your patch looks like it would provide an interesting feature
that we want in Buildroot.

Would you mind officially contributing your patch so we can apply it?

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210419/c2c4f5cc/attachment.html>

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

* [Buildroot] Unable to apply a patch for the buildroot makedevs tool
  2021-04-19  5:58   ` Ivan Castell
@ 2021-04-19 17:04     ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2021-04-19 17:04 UTC (permalink / raw)
  To: buildroot

Ivan, All,

On 2021-04-19 05:58 +0000, Ivan Castell spake thusly:
> Please, proceed applying the patch, of course!

Can you please send the patch with:
  - a proper commit title
  - a proper commit log
  - your signed-off-by line

And then use 'git send-email' to actually send the patch.

See the manual for extensive explanations on how to send a patch:
    https://buildroot.org/downloads/manual/manual.html#submitting-patches

See also the actual 'git log' for examples pertaining to makedevs:

    git log package/makedevs/makedevs.c

Commit bdbbc72934bc7 (makedevs: support optional files) is a good
example: it also adds a new feature to makedevs, so you can model your
commit log after that one for example.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] Unable to apply a patch for the buildroot makedevs tool
  2021-04-17  7:13 ` Yann E. MORIN
  2021-04-19  5:58   ` Ivan Castell
@ 2021-04-26 21:48   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2021-04-26 21:48 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Ivan, All,
 > On 2021-04-16 06:58 +0000, Ivan Castell spake thusly:
 >> Hello! I did a patch for the makedevs tool that provides a new 'x' option
 >> that allows setting permissions for directories recursively without
 >> modifiying permissions for regular files.

 > As Peter said, makedev is directly compiled from its single source file
 > in Buildroot's tree, so no way to patch it with the standard package
 > infrastructure.

With that said, there is no specific reason why this is done like that -
And E.G. mcookie does copy its .c file to the build directory so the
patch step works - So it IMHO makes sense to fix makedevs to also do it
so the normal infrastructure works as expected.

I've sent a series to do that:

https://patchwork.ozlabs.org/project/buildroot/list/?series=240851

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2021-04-26 21:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-16  6:58 [Buildroot] Unable to apply a patch for the buildroot makedevs tool Ivan Castell
2021-04-16 22:14 ` Peter Seiderer
2021-04-17  7:13 ` Yann E. MORIN
2021-04-19  5:58   ` Ivan Castell
2021-04-19 17:04     ` Yann E. MORIN
2021-04-26 21:48   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox