Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] skeleton: ensure that /usr/{lib, bin, sbin} exist
@ 2017-01-05  3:55 Danomi Manchego
  2017-01-05 21:31 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Danomi Manchego @ 2017-01-05  3:55 UTC (permalink / raw)
  To: buildroot

It is possible to have a custom skeleton without a /usr/{lib,bin,sbin},
and indeed without a /usr directory at all.  These directories eventually
get created when packages install there, but at skeleton installation time,
the following command fails if /usr does not yet exist:

ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)

So, in the spirit of ensuring that directories exist before installing there,
ensure that at least /usr exists to avoid the above failure.  While doing
so, lets ensure that /usr/{lib,bin,sbin} exist too, to be thematically
consistent with SKELETON_USR_SYMLINKS_OR_DIRS.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
---
 package/skeleton/skeleton.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 1000161..4b661fe 100644
--- a/package/skeleton/skeleton.mk
+++ b/package/skeleton/skeleton.mk
@@ -91,6 +91,9 @@ define SKELETON_INSTALL_TARGET_CMDS
 	rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
 		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
 		$(SKELETON_PATH)/ $(TARGET_DIR)/
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/bin
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/sbin
 	$(call SKELETON_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
 	ln -snf lib $(TARGET_DIR)/$(SKELETON_LIB_SYMLINK)
 	ln -snf lib $(TARGET_DIR)/usr/$(SKELETON_LIB_SYMLINK)
-- 
1.9.1

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

end of thread, other threads:[~2017-01-05 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05  3:55 [Buildroot] [PATCH 1/1] skeleton: ensure that /usr/{lib, bin, sbin} exist Danomi Manchego
2017-01-05 21:31 ` Yann E. MORIN

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