mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 14:01:57 -09:00
Allow several device tables and split in two parts our device table
This allows to have a device table for all directories/files and another device table for the device files themselves. Both are needed for static /dev, but only the first one is needed when devtmpfs/mdev/udev are used. We take this opportunity to move the documentation of the device table format in a common location, package/makedevs/README. [Peter: simplify code slightly, fix indentation] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
committed by
Peter Korsgaard
parent
ca520507fc
commit
4e005c47e5
10
fs/common.mk
10
fs/common.mk
@@ -32,7 +32,8 @@
|
||||
# macro will automatically generate a compressed filesystem image.
|
||||
|
||||
FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
|
||||
ROOTFS_DEVICE_TABLE = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE))
|
||||
FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
|
||||
ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE))
|
||||
|
||||
define ROOTFS_TARGET_INTERNAL
|
||||
|
||||
@@ -46,13 +47,14 @@ $(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES)
|
||||
touch $(BUILD_DIR)/.fakeroot.00000
|
||||
cat $(BUILD_DIR)/.fakeroot* > $(FAKEROOT_SCRIPT)
|
||||
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)
|
||||
ifneq ($(ROOTFS_DEVICE_TABLES),)
|
||||
cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE)
|
||||
echo "$(HOST_DIR)/usr/bin/makedevs -d $(FULL_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
|
||||
endif
|
||||
echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)
|
||||
chmod a+x $(FAKEROOT_SCRIPT)
|
||||
$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
|
||||
-@rm -f $(FAKEROOT_SCRIPT)
|
||||
-@rm -f $(FAKEROOT_SCRIPT) $(FULL_DEVICE_TABLE)
|
||||
$(foreach hook,$(ROOTFS_$(2)_POST_GEN_HOOKS),$(call $(hook))$(sep))
|
||||
ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
|
||||
gzip -9 -c $$@ > $$@.gz
|
||||
|
||||
Reference in New Issue
Block a user