]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: Add support for symlinks in device table
authorDavid Engraf <david.engraf@sysgo.com>
Tue, 23 May 2017 06:52:52 +0000 (08:52 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 31 May 2017 08:56:25 +0000 (10:56 +0200)
It is not possible to change 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. The permission entry for symlinks in the device
table must be set to 0777.

Signed-off-by: David Engraf <david.engraf@sysgo.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
jffsX-utils/device_table.txt
ubifs-utils/mkfs.ubifs/devtable.c

index 394a62be450614249e9e900c383cd03a9dab23e3..8930cae25468f2c523b0c57adeb2dbe5bc728e4b 100644 (file)
@@ -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.
index dee035d5e948835ca728c2e824cd6609893cd625..3b46abc0f3189503bf2f12e67ce96682b7cd4b55 100644 (file)
  * 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).
+ * Don't bother with hard links (special cases of regular files), or sockets
+ * (why bother).
  *
  * Regular files must exist in the target root directory. If a char, block,
  * fifo, or directory does not exist, it will be created.
@@ -177,6 +178,11 @@ static int interpret_table_entry(const char *line)
                case 'b':
                        mode |= S_IFBLK;
                        break;
+               case 'l':
+                       mode |= S_IFLNK;
+                       if ((mode & 0777) != 0777)
+                               return err_msg("link permission must be 0777");
+                       break;
                default:
                        return err_msg("unsupported file type '%c'", type);
        }