Skip to contentSkip to conversation

package/dash: Create $(TARGET_DIR)/bin before install

PATCH New Vadim Kochan 4 participants 5 messages Jan 14, 2019 – Jan 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/dash: Create $(TARGET_DIR)/bin before install

The build fails because $(TARGET_DIR)/bin folder may not exist if for example to use the following defconfig:

	BR2_x86_64=y
	BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
	BR2_SYSTEM_BIN_SH_DASH=y
	BR2_TARGET_GENERIC_GETTY_PORT="tty1"
	BR2_LINUX_KERNEL=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7"
	BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
	BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
	BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
	BR2_PACKAGE_S6_LINUX_INIT=y
	BR2_TARGET_ROOTFS_EXT2=y
---
 package/dash/dash.mk | 1 +
 1 file changed, 1 insertion(+)
package/dash/dash.mk +1 -0
index f699f40686..606b5db34a 100644
@@ -28,6 +28,7 @@ DASH_CONF_OPTS += --without-libedit
 endif
 
 define DASH_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/bin
 	$(INSTALL) -m 0755 $(@D)/src/dash $(TARGET_DIR)/bin/dash
 endef
 
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 package/dash: Create $(TARGET_DIR)/bin before install

Hi Vadim,

Quoted 26 lines · Vadim Kochan

The build fails because $(TARGET_DIR)/bin folder may not exist if for example to use the following defconfig:

	BR2_x86_64=y
	BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
	BR2_SYSTEM_BIN_SH_DASH=y
	BR2_TARGET_GENERIC_GETTY_PORT="tty1"
	BR2_LINUX_KERNEL=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7"
	BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
	BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
	BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
	BR2_PACKAGE_S6_LINUX_INIT=y
	BR2_TARGET_ROOTFS_EXT2=y
---
 package/dash/dash.mk | 1 +
 1 file changed, 1 insertion(+)
package/dash/dash.mk +0 -0
index f699f40686..606b5db34a 100644

package/dash/dash.mk DASH_CONF_OPTS += --without-libedit · line 33

Quoted 6 lines
package/dash/dash.mk +1 -0
@@ -28,6 +28,7 @@ DASH_CONF_OPTS += --without-libedit
 endif
 
 define DASH_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/bin
 	$(INSTALL) -m 0755 $(@D)/src/dash $(TARGET_DIR)/bin/dash
 endef

I can't reproduce this issue here. I tested this config:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-basic-2018.05.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_16=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_DASH=y
BR2_PACKAGE_S6_LINUX_INIT=y

The build log shows this:

Quoted 1 line
Quoted 1 line
Quoted 1 line

skeleton-init-common Installing to target

rsync -a --ignore-times --exclude .svn --exclude .git --exclude .hg --exclude .bzr --exclude CVS --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' system/skeleton/ /.../buildroot/output/target/ /usr/bin/install -d -m 0755 /home/baruch/git/buildroot/output/target/bin
/usr/bin/install -d -m 0755 /home/baruch/git/buildroot/output/target/sbin
/usr/bin/install -d -m 0755 /home/baruch/git/buildroot/output/target/lib

The SYSTEM_USR_SYMLINKS_OR_DIRS macro defined in system/system.mk created the /bin directory. Do you have any idea why it doesn't work in your case?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 package/dash: Create $(TARGET_DIR)/bin before install

In reply to Vadim Kochan

Hello,

Quoted 26 lines · Vadim Kochan

The build fails because $(TARGET_DIR)/bin folder may not exist if for example to use the following defconfig:

	BR2_x86_64=y
	BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
	BR2_SYSTEM_BIN_SH_DASH=y
	BR2_TARGET_GENERIC_GETTY_PORT="tty1"
	BR2_LINUX_KERNEL=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7"
	BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
	BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
	BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
	BR2_PACKAGE_S6_LINUX_INIT=y
	BR2_TARGET_ROOTFS_EXT2=y
---
 package/dash/dash.mk | 1 +
 1 file changed, 1 insertion(+)
package/dash/dash.mk +0 -0
index f699f40686..606b5db34a 100644

package/dash/dash.mk DASH_CONF_OPTS += --without-libedit · line 32

Quoted 5 lines
package/dash/dash.mk +1 -0
@@ -28,6 +28,7 @@ DASH_CONF_OPTS += --without-libedit
 endif
 
 define DASH_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/bin
 	$(INSTALL) -m 0755 $(@D)/src/dash $(TARGET_DIR)/bin/dash

Please use

	$(INSTALL) -D

instead, which does exactly what is needed here: create the intermediate directories if missing.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/1 package/dash: Create $(TARGET_DIR)/bin before install

In reply to Vadim Kochan
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vadim" == Vadim Kochan <[email protected]> writes:

The build fails because $(TARGET_DIR)/bin folder may not exist if for example to use the following defconfig:

	BR2_x86_64=y
	BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
	BR2_SYSTEM_BIN_SH_DASH=y
	BR2_TARGET_GENERIC_GETTY_PORT="tty1"
	BR2_LINUX_KERNEL=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7"
	BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
	BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
	BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
	BR2_PACKAGE_S6_LINUX_INIT=y
	BR2_TARGET_ROOTFS_EXT2=y
Quoted 1 line

Committed after chaning it to use install -D instead, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 package/dash: Create $(TARGET_DIR)/bin before install

In reply to Vadim Kochan
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vadim" == Vadim Kochan <[email protected]> writes:

The build fails because $(TARGET_DIR)/bin folder may not exist if for example to use the following defconfig:

	BR2_x86_64=y
	BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
	BR2_SYSTEM_BIN_SH_DASH=y
	BR2_TARGET_GENERIC_GETTY_PORT="tty1"
	BR2_LINUX_KERNEL=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION=y
	BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7"
	BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
	BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config"
	BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
	BR2_PACKAGE_S6_LINUX_INIT=y
	BR2_TARGET_ROOTFS_EXT2=y
Quoted 1 line

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

Signature · 1 line
Bye, Peter Korsgaard