All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/alsa-utils: fix install if directories exist
@ 2020-09-03 13:35 John Keeping
  2020-09-03 19:01 ` Thomas Petazzoni
  2020-09-05  8:18 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: John Keeping @ 2020-09-03 13:35 UTC (permalink / raw)
  To: buildroot

"mkdir" (without "-p") fails if the target directory exists, which means
that if alsa-utils is being reinstalled or if other files have
previously been installed in the alsa-state.d or alsa-restore.d
directories the installation will fail.

Switch to "$(INSTALL) -d" which allows us to be explicit about the
permissions and handles the case of a pre-existing directory correctly.

Signed-off-by: John Keeping <john@metanate.com>
---
 package/alsa-utils/alsa-utils.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/alsa-utils/alsa-utils.mk b/package/alsa-utils/alsa-utils.mk
index 27894d3e92..4776a17454 100644
--- a/package/alsa-utils/alsa-utils.mk
+++ b/package/alsa-utils/alsa-utils.mk
@@ -86,10 +86,10 @@ define ALSA_UTILS_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service
 	$(INSTALL) -D -m 0644 $(@D)/alsactl/alsa-state.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service
-	mkdir $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d
 	printf '[Install]\nWantedBy=multi-user.target\n' \
 		>$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d/buildroot-enable.conf
-	mkdir $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d
 	printf '[Install]\nWantedBy=multi-user.target\n' \
 		>$(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d/buildroot-enable.conf;
 endef
-- 
2.28.0

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

* [Buildroot] [PATCH] package/alsa-utils: fix install if directories exist
  2020-09-03 13:35 [Buildroot] [PATCH] package/alsa-utils: fix install if directories exist John Keeping
@ 2020-09-03 19:01 ` Thomas Petazzoni
  2020-09-05  8:18 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-09-03 19:01 UTC (permalink / raw)
  To: buildroot

On Thu,  3 Sep 2020 14:35:33 +0100
John Keeping <john@metanate.com> wrote:

> "mkdir" (without "-p") fails if the target directory exists, which means
> that if alsa-utils is being reinstalled or if other files have
> previously been installed in the alsa-state.d or alsa-restore.d
> directories the installation will fail.
> 
> Switch to "$(INSTALL) -d" which allows us to be explicit about the
> permissions and handles the case of a pre-existing directory correctly.
> 
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>  package/alsa-utils/alsa-utils.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

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

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

* [Buildroot] [PATCH] package/alsa-utils: fix install if directories exist
  2020-09-03 13:35 [Buildroot] [PATCH] package/alsa-utils: fix install if directories exist John Keeping
  2020-09-03 19:01 ` Thomas Petazzoni
@ 2020-09-05  8:18 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-09-05  8:18 UTC (permalink / raw)
  To: buildroot

>>>>> "John" == John Keeping <john@metanate.com> writes:

 > "mkdir" (without "-p") fails if the target directory exists, which means
 > that if alsa-utils is being reinstalled or if other files have
 > previously been installed in the alsa-state.d or alsa-restore.d
 > directories the installation will fail.

 > Switch to "$(INSTALL) -d" which allows us to be explicit about the
 > permissions and handles the case of a pre-existing directory correctly.

 > Signed-off-by: John Keeping <john@metanate.com>

Committed to 2020.02.x, 2020.05.x and 2020.08.x, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2020-09-05  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 13:35 [Buildroot] [PATCH] package/alsa-utils: fix install if directories exist John Keeping
2020-09-03 19:01 ` Thomas Petazzoni
2020-09-05  8:18 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.