Patchwork [2/2] busybox: ensure $(BUSYBOX_BUILD_CONFIG) is writable

login
register
mail settings
Submitter Yann E. MORIN
Date Nov. 11, 2013, 5:45 p.m.
Message ID <0b4acecdd3e9fb7d9510c206338ebbdfa483ca9e.1384191560.git.yann.morin.1998@free.fr>
Download mbox | patch
Permalink /patch/290452/
State Superseded
Headers show

Comments

Yann E. MORIN - Nov. 11, 2013, 5:45 p.m.
From: Nathan Lynch <ntl@pobox.com>

If $(BUSYBOX_CONFIG_FILE) is read-only (eg. because Buildroot's
source dir is), the sed fixups to $(BUSYBOX_BUILD_CONFIG) fail.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
[yann.morin.1998@free.fr: use $(INSTALL) instead of cp]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
 package/busybox/busybox.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Danomi Manchego - Nov. 11, 2013, 8:22 p.m.
On Mon, Nov 11, 2013 at 12:45 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> From: Nathan Lynch <ntl@pobox.com>
>
> If $(BUSYBOX_CONFIG_FILE) is read-only (eg. because Buildroot's
> source dir is), the sed fixups to $(BUSYBOX_BUILD_CONFIG) fail.

These share the same issue:

- linux.mk:  $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
- uclibc,mk:  $(UCLIBC_DIR)/.oldconfig

Danomi -
Yann E. MORIN - Nov. 12, 2013, 5:42 p.m.
Danomi, All,

On 2013-11-11 15:22 -0500, Danomi Manchego spake thusly:
> On Mon, Nov 11, 2013 at 12:45 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > From: Nathan Lynch <ntl@pobox.com>
> >
> > If $(BUSYBOX_CONFIG_FILE) is read-only (eg. because Buildroot's
> > source dir is), the sed fixups to $(BUSYBOX_BUILD_CONFIG) fail.
> 
> These share the same issue:
> 
> - linux.mk:  $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
> - uclibc,mk:  $(UCLIBC_DIR)/.oldconfig

Indeed, I'll add them to the series. Thanks! :-)

Regards,
Yann E. MORIN.
Danomi Manchego - Nov. 12, 2013, 5:54 p.m.
On Tue, Nov 12, 2013 at 12:42 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Danomi, All,
>
> On 2013-11-11 15:22 -0500, Danomi Manchego spake thusly:
>> On Mon, Nov 11, 2013 at 12:45 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>> > From: Nathan Lynch <ntl@pobox.com>
>> >
>> > If $(BUSYBOX_CONFIG_FILE) is read-only (eg. because Buildroot's
>> > source dir is), the sed fixups to $(BUSYBOX_BUILD_CONFIG) fail.
>>
>> These share the same issue:
>>
>> - linux.mk:  $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
>> - uclibc,mk:  $(UCLIBC_DIR)/.oldconfig
>
> Indeed, I'll add them to the series. Thanks! :-)

I was going to say that the TARGET_DIR_WARNING_FILE copy in Makefile
and fs/common.mk might need the same treatment as well, but I think we
only ran into that issue once, when a coworker did something silly
like deleting output/build to force a rebuild rather than doing a
"make clean" or deleting all of output.  So that's probably not a real
problem.

Danomi -
Yann E. MORIN - Nov. 12, 2013, 6:26 p.m.
Danomi, All,

On 2013-11-12 12:54 -0500, Danomi Manchego spake thusly:
> On Tue, Nov 12, 2013 at 12:42 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > Danomi, All,
> >
> > On 2013-11-11 15:22 -0500, Danomi Manchego spake thusly:
> >> On Mon, Nov 11, 2013 at 12:45 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >> > From: Nathan Lynch <ntl@pobox.com>
> >> >
> >> > If $(BUSYBOX_CONFIG_FILE) is read-only (eg. because Buildroot's
> >> > source dir is), the sed fixups to $(BUSYBOX_BUILD_CONFIG) fail.
> >>
> >> These share the same issue:
> >>
> >> - linux.mk:  $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
> >> - uclibc,mk:  $(UCLIBC_DIR)/.oldconfig
> >
> > Indeed, I'll add them to the series. Thanks! :-)
> 
> I was going to say that the TARGET_DIR_WARNING_FILE copy in Makefile
> and fs/common.mk might need the same treatment as well, but I think we
> only ran into that issue once, when a coworker did something silly
> like deleting output/build to force a rebuild rather than doing a
> "make clean" or deleting all of output.  So that's probably not a real
> problem.

Well, the problem seems to exist today, since that file is copied with a
plain 'cp' and removed with 'rm -f'.

I don't know how it currently work if the skeletton is R/O. But since
this series ensures target/ is R/W, the 'rm -f' will succeed.

But for good measure, I'll fix that as well. Thanks.

Regards,
Yann E. MORIN.

Patch

diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index ad8bdaf..8d40bca 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -135,7 +135,7 @@  endef
 endif
 
 define BUSYBOX_COPY_CONFIG
-	cp -f $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
+	$(INSTALL) -D -m 0644 $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
 endef
 
 # Disable shadow passwords support if unsupported by the C library