[Buildroot] [git commit branch/2020.05.x] package/alsa-utils: fix install if directories exist
Peter Korsgaard
peter at korsgaard.com
Sat Sep 5 08:17:57 UTC 2020
commit: https://git.buildroot.net/buildroot/commit/?id=faed27194c9cda9ab6ac1b03d7428ef212355496
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2020.05.x
"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 at metanate.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
(cherry picked from commit a421da99a716b236081e1aa9c0ef7f327b42818d)
Signed-off-by: Peter Korsgaard <peter at korsgaard.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 7afa36d503..646f897943 100644
--- a/package/alsa-utils/alsa-utils.mk
+++ b/package/alsa-utils/alsa-utils.mk
@@ -90,10 +90,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
More information about the buildroot
mailing list