Commit Graph

176 Commits

Author SHA1 Message Date
Roman Kubiak
2a29e27996 [EGD-5757] Fix backup API
Fix backup endpoint to work with new paths and FS api
The flow is based on the design in confluence.
2021-02-25 16:04:04 +01:00
Wiktor S. Ovalle Correa
18198ffa80 [EGD-5737] Fix filesystem unit tests
Remove old VFS and utils::filesystem calls
Update unittest lists
2021-02-18 14:48:52 +01:00
Lucjan Bryndza
25d1831bdd [EGD-5737] Fix ugly crash on boot
Fix ugly crash on boot fs
2021-02-17 17:10:45 +01:00
Wiktor S. Ovalle Correa
3b141041e9 [EGD-5737] Merge master into experimental
Keep experimental up to date with changes from master
2021-02-17 17:09:37 +01:00
Lucjan Bryndza
436c2ed3cc [EGD-5609] Fix lfs partition erase size bug
Storing LFS erase size in the boot byte is not possible
because Linux kernel is unable to detect the partitions
after change boot bytes to values other than 0x80 or 0x00

In this patch LFS_BLOCK_SIZE is moved to the second
MBR bootcode AREA
2021-02-17 17:08:18 +01:00
Tomek Sobkowiak
40d68bb7b5 [EGD-4495] Check partitions during registering new disk image
Check partitions validity when registering disk.
Add unittest and test disk image generation.
2021-02-17 17:08:18 +01:00
Wiktor S. Ovalle Correa
dc2059fd8b [EGD-5522] Remount fs R/W for backup or update
After setting vFAT to be read only by default backup,
update and factory reset procedures need to remount R/W
first.
2021-02-17 17:08:18 +01:00
Borys Jelenski
c4fc4e8afd [EGD-4761] Add unit tests for littlefs and dual-mount
Additionally, old tests have been refactored for consistency
and readability. Also, files were added to littlefs test image.
2021-02-17 17:08:18 +01:00
Lucjan Bryndza
f2cff39f27 [EGD-5515] Remove unused code lfxextension
Remove unused code for detecting block size from user blocks
2021-02-17 17:08:18 +01:00
Borys Jelenski
0f0192a8b4 [EGD-5072] Refactor legacy VFS functions
Functions were refactored and renamed for better readability.
Some of them were moved to different files. In stat_vfs function
the order of member initializations was corrected.
2021-02-17 17:07:41 +01:00
Lucjan Bryndza
f60b9c0013 [EGD-5392] Add switch vfat to RO mode
VFAT partition should be mounted in RO mode by default
because writing to FAT filesystem is unsafe.
Writing is allowed only in the LFS filesystem.
If upgrade is needed FAT partition can be temporary
switched to RW mode using mount() syscall with REMOUNT flag
but it should be switched to RO mode again after upgrade.
2021-02-17 17:07:41 +01:00
Lucjan Bryndza
af960b6fac [EGD-5146] Add read LFS block size from part
Add littlefs block size from partition bootable offset
2021-02-17 17:07:00 +01:00
Lucjan Bryndza
706321b268 [EGD-5350] Add increase lfs cluster size
Incrase LFS clustrer size and cache bitmap improve
the FS free blocks scan time, because LFS don't have
free block bitmap.
2021-02-17 17:06:59 +01:00
Hubert Chrzaniuk
d02a8e446e [EGD-5014] Change MMC erase logic
MMC erase group size is 512 kB which would enforce
512 kB blocks on file system. Since for our purposes this
would be inefficient erase command has been disallowed.
2021-02-17 17:06:59 +01:00
Lucjan Bryndza
adc3d34aed [EGD-5334] Fix phone crash when MTP access
Fix phone crash when accessing file when new filesystem is used
2021-02-17 17:06:59 +01:00
Hubert Chrzaniuk
f8c2680476 [EGD-5014] Fix global FS locks
Global locks are redundant and lower the performance.
2021-02-17 17:05:32 +01:00
Hubert Chrzaniuk
5400c1861e [EGD-5014] Add eMMC block device API
Add PureOS wrapper for eMMC driver with support
for basic block device operations.
2021-02-17 17:05:32 +01:00
Lucjan Bryndza
79a6264b7c [EGD-5020] Add autodetect filesystem
Add support for autodetect filesystem in the fs core
2021-02-17 17:05:32 +01:00
Lucjan Bryndza
eff6c3f026 [EGD-4498] Fix code after code review #1
Fixed some small minor issus in the RO mode in the vfs
2021-02-17 17:05:32 +01:00
Lucjan Bryndza
8545fa3bb3 [EGD-4498] Add unit test for remount RO
Add unit test for remount filesystem in ro mode
Some minor fixes
2021-02-17 17:05:32 +01:00
Lucjan Bryndza
c13eb5ade9 [EGD-4498] Fix vfscore-ut
Some paths are no longer available in the fat fs
this patch fix this issue.
2021-02-17 17:05:32 +01:00
Lucjan Bryndza
537629013b [EGD-4498] Add support RO filesystem in the vfscore
Add support readonly filesystem mount flag
Add support for mount / remount
2021-02-17 17:05:31 +01:00
Lucjan Bryndza
1c0c20e69c [EGD-4498] Add user functions for mount
Add user functions and methods for mount and unmount
capable with linux filesystem.
2021-02-17 17:05:31 +01:00
Jakub Pyszczak
2f22395368 [EGD-5182] Fix UT module vfs
Minor fixes to adjust vfs disk tests to the newer PurePhone image.
2021-02-17 17:05:31 +01:00
Lucjan Bryndza
cb5b5a37b8 [EGD-5170] Fix native diropen
In the current implementation diropen is unable to listdir
in the native filesystem. This patch fix this issue.
2021-02-17 17:05:31 +01:00
Lucjan Bryndza
37aee3901c [EGD-5165] Fix emulator crash on lfs and fat
Disk access was not protected by the mutex and race contition
occurs when multiple access was made for lfs and fat.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-02-17 17:05:31 +01:00
Lucjan Bryndza
37c5c2fcc8 [EGD-5153] Fix errors in generate image script
Script for generate partitions for emulator by mistake
overwrites the littlefs image and fatfs image due to the
overlap fat parition and littlefs partition

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-02-17 17:02:15 +01:00
Lucjan Bryndza
9dea864c4a [EGD-5153] Fix disk manager sector_count
Currently when partition handle is passed to the disk manager
it returns total disk sector count instead of partitions sector count
2021-02-17 17:02:15 +01:00
Lucjan Bryndza
3a0f402fde [EGD-5149] Fix temporary path
Currently temporary path is in the fat partition. This patch
changes the temporary directory to the LFS partition.
2021-02-17 17:02:15 +01:00
Lucjan Bryndza
ad4fba1f58 [EGD-5135] Add new lfs part scheme in emulator
Add new littlefs filesystem user partion in the fat database
2021-02-17 17:02:15 +01:00
Lucjan Bryndza
dde4bef8a5 [EGD-5075] Add new vfs core to new lib syscalls
Add new vfs core support to the new lib filesystem syscalls,
so currently new platform is switched to the new fs
2021-02-17 17:02:15 +01:00
Lucjan Bryndza
32de9ec671 [EGD-5102] Fix compile on rt1051 platform
It is initial commmit which fix compilation after
vfs. global object removal. It still need implementation
newlib syscalls.
2021-02-17 17:02:15 +01:00
Lucjan Bryndza
6c4c4e8aef [EGD-5098] Fix and remove old vfs class
Fix and remove global vfs object remove all old data
included in the vfs.hpp class
2021-02-17 16:06:33 +01:00
Lucjan Bryndza
52ca291b30 [EGD-5097] Fix minor issues with littlefs fuse
Fix minor issues with littlefs implementation
2021-02-17 16:06:33 +01:00
Lucjan Bryndza
da7ab8f464 [EGD-5097] Fix open flag translate
Fix open translation flags in the littlefs fuse
2021-02-17 16:06:33 +01:00
Radoslaw Wicik
49548152b6 [EGD-4763] Fix Unit Tests
First attempt, move vfs to be init in tests
2021-02-04 16:45:50 +01:00
Adam Dobrowolski
5995cfa6ff [EGD-5451] Cleaned i18n header from vfs
internationalization is included nearly everywhere in system it
should not be polluted with include which is to be removed
2021-01-31 11:24:37 +01:00
Borys Jelenski
d896843d44 [EGD-5415] Fix missing assets dep for lfstest.img
Addionally, the genlfstestimg.sh script now accepts files to include
in the image as arguments
2021-01-28 16:16:03 +01:00
Lucjan Bryndza
3780b4844c [EGD-5074] Add native fscore for emulator
This is a first commit when the emulator uses
the new filesystem core.

libiosyscall library read environment variable

IOSYSCALS_REDIRECT_TO_IMAGE

When  IOSYSCALS_REDIRECT_TO_IMAGE=1 all syscalls
are redirected to the image. If env is not defined
or set to 0 only paths are translated and redirected
to the native linux syscalls

[EGD-5074] Remove free rtox library

Remove unneeded fat library from the freertos

[EGD-5074] Fix freertos mutex as unique

Add freertos mutex in the unique_ptr for avoid inclusion of the
freertos.h

[EGD-5074] Remove frertos-fat submodule

Remove uneeded fat freertos submodule

[EGD-5074] Add handle types in the vfs_subsystem

Add handle types in the vfs subsystem

[EGD-5074] Add submodule for hashmap

Add submodule for hashmap

[EGD-5074] Add support for dirent

Add support for dirent for new filesystem

[EGD-5074] Fix mutex class

Remove mutex in header

[EGD-5074] Remove old vfs from file indexer

File indexer should be fixed for use new vfs

[EGD-5074] Fix unit test vfs

Remove unit tests vfs for clas

[EGD-5074] Add Posix implementation with new fs

Add posix implementation with new fs core

[EGD-5074] Fix stdio syscalls

Fix all stdio syscalls

[EGD-5074] Fix iosyscalls scan family

Fix iosyscalls scan family

[EGD-5074] Fix native API

Fix native api

Work in progress some minor fixes

[EGD-5074] Fix lib stdio

Fix lib stdio

[EGD-5074] fix lseek return value in fat driver

Fix lseek return value in the fat driver

[EGD-5074]  Unit test fix

Unittest fixes

[EGD-5074] Emulator syscalls

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-01-04 16:04:33 +01:00
Jakub Pyszczak
7a942e2b92 [EGD-5070] Change new filesystem in module bt
Due to vfs deprecation there is need to
remove all vfs calls from code.
This PR covers module bluetooth.

[EGD-5070] Review changes.

[EGD-5070] Change new filesystem in module bt

Due to vfs deprecation there is need to
remove all vfs calls from code.
This PR covers module bluetooth
2020-12-23 12:54:57 +01:00
Lucjan Bryndza
b5474f4b6a [EGD-5018] Add umount all filesystem
Add umount all mounted filesystem. This function
can be used in the cleanup vfs core stage
2020-12-23 09:38:31 +01:00
Lucjan Bryndza
a7484bf9c1 [EGD-4754] Add automount default filesystems
Default automount and parse partitions according to
their configurations using new vfs core. Currently
old (without lfs) and new (with lfs) part schemes are supported
2020-12-22 19:17:16 +01:00
Lucjan Bryndza
f56609aa3b [EGD-4502] Fix and remove old vfs boot
Remove old vfs bootconfig from the vfs which
will be removed in the later commit
2020-12-22 09:26:30 +01:00
Jakub Pyszczak
879213397d [EGD-4757] Add unit test for new filesystem
Due to vfs deprecation new filesystem needs
unit tests to verify it's behaviour.This PR
covers core filesystem operations.
2020-12-22 09:05:23 +01:00
Jakub Pyszczak
43526432f4 [EGD-5035] Fix error translation fs
Quickfix for error translation issue in new filesystem.
2020-12-21 13:15:38 +01:00
Lucjan Bryndza
17f64cb3e4 [EGD-5022] Fix invalid open flags in vfscore
Opening file with O_CREAT mode on the mounted fat filesystem
should create file if doesn't exist. Currently it returns ENOENT
This path fix this issue. ff_fat create flags are fixed.
2020-12-18 11:22:56 +01:00
Lucjan Bryndza
62615d6cc6 [EGD-5016] Fix vfs-littlefs failed mount init
Fix issue with memory leak during mount in littlefs core
when mount fails.
2020-12-18 09:40:29 +01:00
Lucjan Bryndza
f980abd28a [EGD-4758] Add lfs object state sync
Add lfs object state sync.
2020-12-17 18:20:13 +01:00
Lucjan Bryndza
0f3a622ad2 [EGD-4758] Fix includes in littlefs
Fix includes in the littlefs
2020-12-17 18:20:13 +01:00
Lucjan Bryndza
afa37eef2c [EGD-4758] Add block size and fs size
Add blocks size and blocks count detecting
of the file size.
2020-12-17 18:20:13 +01:00