Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
src/main.c (Init): chmod /ssd to YAFFS_ROOT_MODE to keep up with RTEM…
…S 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.
  • Loading branch information
wpwrak committed Apr 18, 2012
1 parent e807609 commit c1a99fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.c
Expand Up @@ -187,6 +187,16 @@ rtems_task Init(rtems_task_argument argument)
/*start_memcard();*/
mkdir("/ssd", 0777);
mount("/dev/flash5", "/ssd", "yaffs", RTEMS_FILESYSTEM_READ_WRITE, "");
/*
* Older versions of RTEMS-YAFFS created the file system with the
* (persistent) root inode set to 0666. RTEMS didn't check permissions
* at that time but does now, causing most operations to fail (EACCES)
* on file systems created before the transition.
*
* The "chmod" below transparently updates the permission of /ssd files
* systems.
*/
chmod("/ssd", YAFFS_ROOT_MODE);

init_version();
load_usb_firmware();
Expand Down

0 comments on commit c1a99fe

Please sign in to comment.