Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored April 18, 2012

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. 10  src/main.c
10  src/main.c
@@ -187,6 +187,16 @@ rtems_task Init(rtems_task_argument argument)
187 187
 	/*start_memcard();*/
188 188
 	mkdir("/ssd", 0777);
189 189
 	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);
190 200
 	
191 201
 	init_version();
192 202
 	load_usb_firmware();

0 notes on commit c1a99fe

Please sign in to comment.
Something went wrong with that request. Please try again.