[PATCH] mkfs.ubifs: Add support for symlinks in device table

David Engraf david.engraf at sysgo.com
Thu May 18 06:38:54 PDT 2017


It is not possible to change permissions and ownership for symlinks in the
device table file. This patch adds support for symlinks equal to mkfs.jffs2
and updates the sample device table file.

Signed-off-by: David Engraf <david.engraf at sysgo.com>
---
 jffsX-utils/device_table.txt      | 1 +
 ubifs-utils/mkfs.ubifs/devtable.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/jffsX-utils/device_table.txt b/jffsX-utils/device_table.txt
index 394a62b..8930cae 100644
--- a/jffsX-utils/device_table.txt
+++ b/jffsX-utils/device_table.txt
@@ -14,6 +14,7 @@
 #	c	Character special device file
 #	b	Block special device file
 #	p	Fifo (named pipe)
+#	l	Link
 # uid is the user id for the target file, gid is the group id for the
 # target file.  The rest of the entried apply only to device special
 # file.
diff --git a/ubifs-utils/mkfs.ubifs/devtable.c b/ubifs-utils/mkfs.ubifs/devtable.c
index dee035d..c96de53 100644
--- a/ubifs-utils/mkfs.ubifs/devtable.c
+++ b/ubifs-utils/mkfs.ubifs/devtable.c
@@ -33,6 +33,7 @@
  * c  Character special device file
  * b  Block special device file
  * p  Fifo (named pipe)
+ * l  Link
  *
  * Don't bother with symlinks (permissions are irrelevant), hard links (special
  * cases of regular files), or sockets (why bother).
@@ -177,6 +178,9 @@ static int interpret_table_entry(const char *line)
 		case 'b':
 			mode |= S_IFBLK;
 			break;
+		case 'l':
+			mode |= S_IFLNK;
+			break;
 		default:
 			return err_msg("unsupported file type '%c'", type);
 	}
-- 
2.11.0




More information about the linux-mtd mailing list