2
1
Эх сурвалжийг харах

fs: change the way the device table is configured

Until now, the location of the device table was specified by a
variable in board Makefiles. Unfortunately, this variable is not
accessible from fs/common.mk, since the target/ code is included
*after* fs/common.mk.

Anyway, the general idea is to move away from these boards Makefile,
and provide configuration option for things like the device table
location.

Therefore, this patch adds a BR2_ROOTFS_DEVICE_TABLE option which
allows to specify which device table should be used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thomas Petazzoni 15 жил өмнө
parent
commit
64ec20e6c0
2 өөрчлөгдсөн 11 нэмэгдсэн , 2 устгасан
  1. 8 0
      fs/Config.in
  2. 3 2
      fs/common.mk

+ 8 - 0
fs/Config.in

@@ -15,6 +15,14 @@ config BR2_ROOTFS_POST_BUILD_SCRIPT
 	  only argument. Make sure the exit code of that script is 0,
 	  only argument. Make sure the exit code of that script is 0,
 	  otherwise make will stop after calling it.
 	  otherwise make will stop after calling it.
 
 
+config BR2_ROOTFS_DEVICE_TABLE
+       string "Path to the device table"
+       default "target/generic/device_table.txt"
+       help
+         Specify the location of a device table, that will be passed
+         to the makedevs utility to create all the special device
+         files in the target filesystem.
+
 source "fs/cramfs/Config.in"
 source "fs/cramfs/Config.in"
 source "fs/cloop/Config.in"
 source "fs/cloop/Config.in"
 source "fs/ext2/Config.in"
 source "fs/ext2/Config.in"

+ 3 - 2
fs/common.mk

@@ -28,6 +28,7 @@
 # macro will automatically generate a compressed filesystem image.
 # macro will automatically generate a compressed filesystem image.
 
 
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
+ROOTFS_DEVICE_TABLE = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE))
 
 
 define ROOTFS_TARGET_INTERNAL
 define ROOTFS_TARGET_INTERNAL
 
 
@@ -38,8 +39,8 @@ $(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES) host-fakeroot makedevs
 	touch $(BUILD_DIR)/.fakeroot.00000
 	touch $(BUILD_DIR)/.fakeroot.00000
 	cat $(BUILD_DIR)/.fakeroot* > $(FAKEROOT_SCRIPT)
 	cat $(BUILD_DIR)/.fakeroot* > $(FAKEROOT_SCRIPT)
 	echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 	echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
-ifneq ($(TARGET_DEVICE_TABLE),)
-	echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+ifneq ($(ROOTFS_DEVICE_TABLE),)
+	echo "$(HOST_DIR)/usr/bin/makedevs -d $(ROOTFS_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 endif
 endif
 	echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)
 	echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)
 	chmod a+x $(FAKEROOT_SCRIPT)
 	chmod a+x $(FAKEROOT_SCRIPT)