Skip to contentSkip to conversation

mkfs.jffs2: Add Support for Symlinks to Device Table

PATCH Applied Grant Erickson 2 participants 2 messages Jun 13, 2008 – Jun 18, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.jffs2: Add Support for Symlinks to Device Table

Added support for symbolic links to the grammar of the device table file such that links that already exist in the root working directory may have their permissions and ownership changed. Creating symbolic links anew is still unsupported.

Added a note to this effect in the manual reference page.

Print out the type character when encountering an unsupported file type (e.g. symbolic links when created anew).

---
 mkfs.jffs2.1 |    8 ++++++++
 mkfs.jffs2.c |    7 +++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
mkfs.jffs2.1 +8 -0
index 4080032..1eefeda 100644
@@ -241,6 +241,14 @@ Display version information.
 Generate an appendage image for FILE. If FILE is written to flash and flash
 is appended with the output, then it seems as if it was one thing.
 
+.SH LIMITATIONS
+The format and grammar of the device table file does not allow it to
+create symbolic links when the symbolic links are not already present
+in the root working directory.
+
+However, symbolic links may be specified in the device table file
+using the \fIl\fR type for the purposes of setting their permissions
+and ownership.
 .SH BUGS
 JFFS2 limits device major and minor numbers to 8 bits each.  Some
 consider this a bug.
mkfs.jffs2.c +5 -2
index f042ae7..7255536 100644
@@ -544,8 +544,11 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line)
 		case 'b':
 			mode |= S_IFBLK;
 			break;
+		case 'l':
+			mode |= S_IFLNK;
+			break;
 		default:
-			error_msg_and_die("Unsupported file type");
+			error_msg_and_die("Unsupported file type '%c'", type);
 	}
 	entry = find_filesystem_entry(root, name, mode);
 	if (entry) {
@@ -604,7 +607,7 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line)
 				}
 				break;
 			default:
-				error_msg_and_die("Unsupported file type");
+				error_msg_and_die("Unsupported file type '%c'", type);
 		}
 	}
 	free(name);
Signature · 1 line
1.5.4.3
Applied
#1 lore raw
Quoted 11 lines · On Fri, 13 Jun 2008 08:46:37 -0700 Grant Erickson <[email protected]>…

Added support for symbolic links to the grammar of the device table file such that links that already exist in the root working directory may have their permissions and ownership changed. Creating symbolic links anew is still unsupported.

Added a note to this effect in the manual reference page.

Print out the type character when encountering an unsupported file type (e.g. symbolic links when created anew).

applied.

josh