Fail to automatically create if-scripts dirs
For the case of creating devices via mdev/udev I wanted to create those missing dirs in
output/target/etc/network/
Here is what I'm doing:
fs/common.mk +5 -0
@@ -33,6 +33,7 @@ FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs ROOTFS_DEVICE_TABLE = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) +NET_DIRS = if-down.d if-post-down.d if-post-down.d if-up.d define ROOTFS_TARGET_INTERNAL
@@ -45,6 +46,10 @@ echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) ifneq ($(ROOTFS_DEVICE_TABLE),) echo "$(HOST_DIR)/usr/bin/makedevs -d $(ROOTFS_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) +else + for i in $(NET_DIRS) ; do \ + [ -d $(TARGET_DIR)/etc/network/$$i ] || mkdir $(TARGET_DIR)/etc/network/$$i; \ + done endif echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT) chmod a+x $(FAKEROOT_SCRIPT)
As result the folders will not be created and even if I replace test & mkdir with echo $$i, I can just see 4 blank lines, but $$i doesn't show the value it should.
What am I doing wrong?
Regards,
Yegor