Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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...
commit c1a99feeed387466cbb1cd5c9f734763d25aa450 1 parent e807609
Werner Almesberger wpwrak authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/main.c
10 src/main.c
View
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.