package/alsa-utils: fix install if directories exist
authorJohn Keeping <john@metanate.com>
Thu, 3 Sep 2020 13:35:33 +0000 (14:35 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 3 Sep 2020 19:01:07 +0000 (21:01 +0200)
"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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/alsa-utils/alsa-utils.mk

index 27894d3e92b1008b3d624bdeed036eb6c726df85..4776a1745439168f10a7bdb895dcbd4ce2d2fa6e 100644 (file)
@@ -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