Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there
@ 2018-12-03 19:12 Yann E. MORIN
  2018-12-03 19:14 ` Matthew Weber
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yann E. MORIN @ 2018-12-03 19:12 UTC (permalink / raw)
  To: buildroot

When using an initramfs, on the first-pass build, we create a dummy cpio
so that the build succeeeds. The real cpio will come later, and we'll do
a second-pass build to use the actual cpio.

However, when we touch that dummy cpio, the images/ directory may not
yet exist, since commit d0f4f95e39 (Makefile: rework main directory
creation logic) removed its creation at the begining of the build, to
only at the moment we need it, i.e. during the *_INSTALL_IMAGES_CMDS
steps.

However, the linux build is not a _INSTALL_IMAGES_CMDS step, so there is
no guarantee that images/ already exist at that time.

Fix that by explicitly creating images/ before touching the dummy cpio.

Reported-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 linux/linux.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index c00b326e8a..110260723b 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -311,6 +311,7 @@ define LINUX_KCONFIG_FIXUP_CMDS
 	# replaced later by the real cpio archive, and the kernel will be
 	# rebuilt using the linux-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
+		mkdir -p $(BINARIES_DIR)
 		touch $(BINARIES_DIR)/rootfs.cpio
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$${BR_BINARIES_DIR}/rootfs.cpio",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
-- 
2.14.1

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

* [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there
  2018-12-03 19:12 [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there Yann E. MORIN
@ 2018-12-03 19:14 ` Matthew Weber
  2018-12-06 20:51 ` Thomas Petazzoni
  2018-12-16 15:01 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Weber @ 2018-12-03 19:14 UTC (permalink / raw)
  To: buildroot

All,

On Mon, Dec 3, 2018 at 1:12 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> When using an initramfs, on the first-pass build, we create a dummy cpio
> so that the build succeeeds. The real cpio will come later, and we'll do
> a second-pass build to use the actual cpio.
>
> However, when we touch that dummy cpio, the images/ directory may not
> yet exist, since commit d0f4f95e39 (Makefile: rework main directory
> creation logic) removed its creation at the begining of the build, to
> only at the moment we need it, i.e. during the *_INSTALL_IMAGES_CMDS
> steps.
>
> However, the linux build is not a _INSTALL_IMAGES_CMDS step, so there is
> no guarantee that images/ already exist at that time.
>
> Fix that by explicitly creating images/ before touching the dummy cpio.
>
> Reported-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Thanks Yann!

Reviewed-by: Matthew Weber <matthew.weber@rockwellcollins.com>

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

* [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there
  2018-12-03 19:12 [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there Yann E. MORIN
  2018-12-03 19:14 ` Matthew Weber
@ 2018-12-06 20:51 ` Thomas Petazzoni
  2018-12-16 15:01 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-12-06 20:51 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon,  3 Dec 2018 20:12:19 +0100, Yann E. MORIN wrote:
> When using an initramfs, on the first-pass build, we create a dummy cpio
> so that the build succeeeds. The real cpio will come later, and we'll do
> a second-pass build to use the actual cpio.
> 
> However, when we touch that dummy cpio, the images/ directory may not
> yet exist, since commit d0f4f95e39 (Makefile: rework main directory
> creation logic) removed its creation at the begining of the build, to
> only at the moment we need it, i.e. during the *_INSTALL_IMAGES_CMDS
> steps.
> 
> However, the linux build is not a _INSTALL_IMAGES_CMDS step, so there is
> no guarantee that images/ already exist at that time.
> 
> Fix that by explicitly creating images/ before touching the dummy cpio.
> 
> Reported-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  linux/linux.mk | 1 +
>  1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there
  2018-12-03 19:12 [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there Yann E. MORIN
  2018-12-03 19:14 ` Matthew Weber
  2018-12-06 20:51 ` Thomas Petazzoni
@ 2018-12-16 15:01 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2018-12-16 15:01 UTC (permalink / raw)
  To: buildroot

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

 > When using an initramfs, on the first-pass build, we create a dummy cpio
 > so that the build succeeeds. The real cpio will come later, and we'll do
 > a second-pass build to use the actual cpio.

 > However, when we touch that dummy cpio, the images/ directory may not
 > yet exist, since commit d0f4f95e39 (Makefile: rework main directory
 > creation logic) removed its creation at the begining of the build, to
 > only at the moment we need it, i.e. during the *_INSTALL_IMAGES_CMDS
 > steps.

 > However, the linux build is not a _INSTALL_IMAGES_CMDS step, so there is
 > no guarantee that images/ already exist at that time.

 > Fix that by explicitly creating images/ before touching the dummy cpio.

 > Reported-by: Matthew Weber <matthew.weber@rockwellcollins.com>
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
 > Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2018.02.x, 2018.08.x and 2018.11.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2018-12-16 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-03 19:12 [Buildroot] [PATCH] linux: ensure images/ exist before creatign files there Yann E. MORIN
2018-12-03 19:14 ` Matthew Weber
2018-12-06 20:51 ` Thomas Petazzoni
2018-12-16 15:01 ` Peter Korsgaard

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