Fix mkyaffs2image in the case where the directory tree already holds a /dev entry. Previous to this fix we would try to add /dev from the device_table_min.txt file, and as its already in the rootfs, then a hard link from ./dev to ./dev would be created in the FS. Fix is to notice that process_directory calls dev_table_set_parent(), and as the entry already exits, then we can skip the entry... Note, this has been there for a while, but has been hidden due to /dev being a mount point for udev so it didn't become apparent until testing where the rootfs.yaffs2 was burned/mounted and then a find showed "fine: /mnt/fs/dev/dev/dev/dev/dev/dev/dev/dev/.... too many open files" diff --exclude CVS -uNr mkyaffs2image-20090406/dev_table.c mkyaffs2image-20090406.modified/dev_table.c --- mkyaffs2image-20090406/dev_table.c 2009-09-08 14:03:52.000000000 -0400 +++ mkyaffs2image-20090406.modified/dev_table.c 2009-09-08 13:48:35.000000000 -0400 @@ -51,6 +51,7 @@ struct deventry *child; // children struct deventry *next; // next at this level struct deventry *parent_next; // next at parent level + int skip; // !0 if entry is to be skipped }; struct deventry *root; @@ -212,6 +213,7 @@ if (progress) printf("%s: path %s parentId %d\n", __FUNCTION__, path, parentId); p->parentId = parentId; + p->skip = 1; // as we already have the object, no need to create it again } } @@ -223,7 +225,7 @@ char name[128]; p = root; while (p) { - if (!p->dumped) { + if (!p->dumped && !p->skip) { strcpy(d.d_name, p->name); sprintf(name, "%s%s", in_file, p->full_name); process_entry(&d, p->parentId, name);