Skip to content

Commit c1a99fe

Browse files
committedApr 18, 2012
src/main.c (Init): chmod /ssd to YAFFS_ROOT_MODE to keep up with RTEMS changes
RTEMS now enforces permissions and RTEMS-YFFS got them wrong before, making all M1 /ssd file systems created before this change de facto inaccessible for Flickernoise. With this commit, we change the permission to the YAFFS default (0777) when mounting /ssd, transparently migrating all older installations.
1 parent e807609 commit c1a99fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/main.c

+10
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ rtems_task Init(rtems_task_argument argument)
187187
/*start_memcard();*/
188188
mkdir("/ssd", 0777);
189189
mount("/dev/flash5", "/ssd", "yaffs", RTEMS_FILESYSTEM_READ_WRITE, "");
190+
/*
191+
* Older versions of RTEMS-YAFFS created the file system with the
192+
* (persistent) root inode set to 0666. RTEMS didn't check permissions
193+
* at that time but does now, causing most operations to fail (EACCES)
194+
* on file systems created before the transition.
195+
*
196+
* The "chmod" below transparently updates the permission of /ssd files
197+
* systems.
198+
*/
199+
chmod("/ssd", YAFFS_ROOT_MODE);
190200

191201
init_version();
192202
load_usb_firmware();

0 commit comments

Comments
 (0)
Please sign in to comment.