sidk_s5jt200 : add romfs device automount support
authorManohara HK <manohara.hk@samsung.com>
Wed, 28 Jun 2017 05:43:00 +0000 (11:13 +0530)
committerManohara HK <manohara.hk@samsung.com>
Thu, 20 Jul 2017 06:25:14 +0000 (11:55 +0530)
This patch adds configuration and mount code for supporting
romfs device auto mount
If the romfs partition size and type and name are added in the
FLASH_PART_* configurtion and CONFIG_FS_ROMFS enabled,
a smart device(/dev/smart0pX) will be created and
romfs filesystem will be automounted on it.

To test it,
1. configure for sidk_s5jt200/hello_with_tash
2. make menuconfig
- Enable CONFIG_FS_ROMFS
- Split last partition size to (256,256) in CONFIG_SIDK_S5JT200_FLASH_PART_LIST
- Append "smartfs" at the end to CONFIG_SIDK_S5JT200_FLASH_PART_TYPE
- Append "romfs" at the end to CONFIG_SIDK_S5JT200_FLASH_PART_NAME
  (Above 3 steps created romfs partition with size 256K at the end,
where romfs device is a smart device and romfs filesystem will be
mounted on smartdevice "/dev/smart0p15" )

- Enable CONFIG_SIDK_S5JT200_AUTOMOUNT_ROMFS
3. make
4. Put "contents" into "external/contents" directory
4. make download ALL

Signed-off-by: Manohara HK <manohara.hk@samsung.com>
os/arch/arm/src/sidk_s5jt200/Kconfig
os/arch/arm/src/sidk_s5jt200/src/s5jt200_tash.c

index 1b6d38a..6d64911 100644 (file)
@@ -99,6 +99,31 @@ config SIDK_S5JT200_AUTOMOUNT
        ---help---
                If enabled, mount userrw and sssrw partitions at boot.
 
+config SIDK_S5JT200_AUTOMOUNT_ROMFS
+       bool "Automount ROM read only partiton"
+       default n
+       depends on SIDK_S5JT200_AUTOMOUNT
+       depends on FS_ROMFS
+       ---help---
+               If enabled, rom readonly partition will be mounted automatically
+               at boot.
+
+config SIDK_S5JT200_AUTOMOUNT_ROMFS_DEVNAME
+       string "Device name of the partition for rom readonly file system"
+       default "/dev/smart0p15"
+       depends on SIDK_S5JT200_AUTOMOUNT_ROMFS
+       ---help---
+               Specifies the device name (/dev/smart0pX) of the partition
+               for rom readonly file system.
+
+config SIDK_S5JT200_AUTOMOUNT_ROMFS_MOUNTPOINT
+       string "Mountpoint of the partition for rom read only file system"
+       default "/rom"
+       depends on SIDK_S5JT200_AUTOMOUNT_ROMFS
+       ---help---
+               Specifies the mount point where rom readonly file system
+               will be mounted at.
+
 config SIDK_S5JT200_AUTOMOUNT_USERFS
        bool "Automount user r/w partiton"
        default n
index ee57d4b..0fec471 100644 (file)
@@ -273,6 +273,17 @@ int board_app_initialize(void)
 
        sidk_s5jt200_configure_partitions();
 
+#if defined(CONFIG_SIDK_S5JT200_AUTOMOUNT_ROMFS_DEVNAME)
+       ret = mount(CONFIG_SIDK_S5JT200_AUTOMOUNT_ROMFS_DEVNAME,
+                       CONFIG_SIDK_S5JT200_AUTOMOUNT_ROMFS_MOUNTPOINT,
+                       "romfs", 0, NULL);
+
+       if (ret != OK) {
+               lldbg("ERROR: mounting '%s'(ROMFS) failed\n",
+                       CONFIG_SIDK_S5JT200_AUTOMOUNT_ROMFS_DEVNAME);
+       }
+#endif /* CONFIG_SIDK_S5JT200_AUTOMOUNT_ROMFS_DEVNAME */
+
 #ifdef CONFIG_SIDK_S5JT200_AUTOMOUNT_USERFS_DEVNAME
        /* Initialize and mount user partition (if we have) */
        ret = mksmartfs(CONFIG_SIDK_S5JT200_AUTOMOUNT_USERFS_DEVNAME, false);