Commit Graph

57 Commits

Author SHA1 Message Date
Maciej Janicki
2b2bb13a49 [MOS-296] Merge remote-tracking branch 'origin/stable'
Merge stable Harmony branch into merge wip branch
2022-03-09 19:27:50 +01:00
Mateusz Piesta
c1391090c6 [BH-1389] Catch2 unit tests optimization
Removed redundant recompilation of catch2 main
resulted in over 20% speed up of unit tests compilation.
2022-01-26 15:04:23 +01:00
Marcin Smoczyński
9267e2d871 [EGD-7161] Remove image name reference in vfs
Add ability to change an image name in the vfs code by decoupling vfs
from a so-called board code.

Introduce platforms as a hardware and os abstraction layer for product
code.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-07-21 12:53:47 +02:00
Lucjan Bryndza
b652f098a0 [CP-326] Reformat recovery partition as littlefs
Recovery partition will be needed by update process for store and
process update data recovery etc
But using fat partition is due to
problem with power loss in not
recommended.
This patch change BACKUP partition to the LFS

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-07-15 11:05:18 +02:00
DariuszSabala
6eeb1d7570 [BH-628] Cleaned up module-vfs cmake
Cleaned up pattern of sharing source files among libraries
using cached lists, ultimately leading to silent linkage
failures. Symbols build repeatedly in different libraries
was linked depending on which library was passed in linker
command arguments first, so for example in same cases
cellular bsp files compiled in module-vfs was linked instead
of those from module-bsp leading to failure of cellular work
despite no explicite build failure.
2021-07-14 15:42:14 +02:00
Lukasz Skrzypczak
028804eab6 [BH-459] Moved fatfs to third-party v2
2nd approach to moving fatfs to third-party. Declared as INTERFACE.
2021-06-18 02:21:12 -07:00
Mateusz Grzegorzek
0684b1271b [BH-515] Create main Bell app
Create main Bell app
2021-06-15 16:02:40 +02:00
Radoslaw Wicik
943fef9643 [BH-353] Add Documentation for main targets
* clean up mimimu required cmake version
* fixes for release workflow

Add documentation for targets, fixes for cmake
and release workflow.
2021-06-11 09:07:41 +02:00
Lucjan Bryndza
325f8696b8 [EGD-6835] Fix UT link errors with inotify
Fix UT linkage error when trying to link with
libiosyscalls with inotify mechanism

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-06-01 13:06:38 +02:00
Lucjan Bryndza
2f3e24c7d5 [EGD-6835] Add inotify mechanism in the VFS
Add file monitoring event mechanism to the
VFS subsystem. Now it will be possible to
monitoring file changes in the reistered
path

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-06-01 13:06:38 +02:00
Lucjan Bryndza
b04b66e8e0 [EGD-6522] Add EEPROM emulation in the emulator
Add possibility to emulate eeprom in the linux emulator
2021-04-16 12:29:56 +02:00
Lucjan Bryndza
8818b30d1e [EGD-6075] Add support for emmc system partitions
Add support for EMMC hardware partitions to the
disk manager
Hardware system partitions are visible as <device_name>sys<num>
Disk user partitions are visible as <device_name>part<num>

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-04-15 09:19:56 +02:00
Wiktor S. Ovalle Correa
3fe2bff567 [EGD-3469] Fix assets and image creation
Preparing and copying of assets to the image was unreliable.
Switched from cmake mechanism to rsync, making resulting
scheme universal and reducing output folder pollution.
2021-04-09 12:47:57 +02: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
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
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
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
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
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
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
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
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
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
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
Lucjan Bryndza
a6766b27db [EGD-4758] Fix littlefs directory iterator
Directory iterator now seams to be working
2020-12-17 18:20:13 +01:00
Lucjan Bryndza
26b791702c [EGD-4758] Add unit tests for littlefs
Some tests passed but it needs some work...
2020-12-17 18:20:13 +01:00
Lucjan Bryndza
a036b75121 [EGD-4758] Fix littlefs boundary check
Currently littlefs boudary is checked in the wrong place
    this commit fix this issue
2020-12-17 18:20:13 +01:00
Lucjan Bryndza
06e7a1a32a [EGD-4758] Add Littlefs unit test
This is an initial implementation of littlefs
unit tests
2020-12-17 18:20:13 +01:00
jimmorrisson
d57f44fee0 [EGD-4493] Unit test checks for disk manager. (#1118) 2020-12-10 17:21:06 +01:00
Lucjan Bryndza
55ab66e55a [EGD-4499] Create drivers for the VFS (#1128)
* GId modules updated

* Remove module

* Gitmodules update

* [EGD-4499] Global module VFS

* [EGD-4499] vfat driver in progress + fsfat

* [EGD-4499] fffat glue to our implementation.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD-4498] Glue logic between ff_fat and disk mgr.

* [EGD-4499] Mount and unmount fat_fs.

* [EGD-4499] Filesystem mount seams to be working

* [EGD-4499] Missing umount volume removal

* [EGD-4499] Code review vol 1

* [EGD-4499] Missing erase element from map

* [EGD-4499] Missing mount umount

* [EGD-4261] Mount and unmount tests

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD-4499] Initial filesystem implementation

Iterate over directories are not completed yet

* [EGD-4261] unit test fix

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD-4499] Stat vfs for RT1051

* [EGD-4499] Small fix in the seek

* [EGD-4499] Directory handle fix

* [EGD4499] Completed ffat implementation

It is already completed vfat driver for vfs core
but it is not tested yet.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD4499] Code review part #1

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD4499] Remove double dynamic allocation of mount point

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD4499] Partition out of range fix

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD-4499] Handle leak fix

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD-4499] VFS vfat completed.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

* [EGD-4499] File descriptors from 3 according to POSIX std

0,1,2 fds are reserved for stdin,stdout,stderr

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-12-07 14:18:03 +01:00
Lucjan Bryndza
9cbebacd78 [EGD-4262] Disk manager (#1025)
* [EGD-4262] Disk manager API draft

* [EGD-4262] New filesystem master user class

* [EGD-4262] Directory fops

* [EGD-4262] Initial version of disk manager API

* [EGD-4261] Registering and finding block devices.

* [EGD-4262] Disk manager without partition parser

* [EGD-4262] Partition parser intial ver.

* [EGD-4262] Disk read driver for Linux

* [EGD-4262] Disk manager unittests.

This unittests should be improved. Currrently it checks
only minimum functionality. Boundary tests should be added
in the next stage.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-24 12:02:39 +01:00
Roman Kubiak
5ce2f3d329 Revert "[EGD-4344] vfs-utils refactor (#1010)" (#1027)
This reverts commit e6ca468d2c.
2020-11-17 12:27:25 +01:00
Roman Kubiak
e6ca468d2c [EGD-4344] vfs-utils refactor (#1010)
* [EGD-4344] removed vfs-utils.cpp and moved all the functions
to utils or eventStore

* [EGD-4344] removed vfs-utils.cpp and moved all the functions
to utils or eventStore

* [EGD-4344] moved methods to utils::filesystem

* Update module-utils/Utils.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* Update module-utils/Utils.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* Update module-utils/Utils.cpp

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>

* [EGD-4344] test fixes, linux fixes, GUI fixes

* [EGD-4344] rebase fixes

* [EGD-4344] bugfixes for rt1051 and mutex support in EventStore

Co-authored-by: Piotr Tanski <piotr.tanski@mudita.com>
2020-11-16 15:36:52 +01:00
Lucjan Bryndza
4736ebddf3 [EGD-4029] File indexer notifier (#862)
* [EGD-4029] Initial version of file notifier in the VFS

* [EGD-4029] File indexer notifier in the VFS

* [EGD-4029] Minor syntax fixes in code

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-23 13:07:47 +02:00
Lucjan Bryndza
bc44592e62 [EGD-4139] VFS unit tests for lseek (#885)
* [EGD-4139] VFS unit tests for lseek

* [EGD-4139] lseek fat VFS test

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-23 11:32:49 +02:00
Lucjan Bryndza
bf2609524c [EGD-4075] Use FATFS in the Linux builds (#843)
* [EGD-4075] Use FAT fs in the emulator

Add script for genrate base phone image

* [EGD-4075] Use FreeRTOS-FAT in emulator initial commit

* [EGD-4075] Thread local storage fix

Fixing thread local storage when running on the
Linux platform in the test mode

* [EGD-4075] Improve image generation

Improve image generation script on the linux platform

* [EGD-4075] Fix all test with FAT fs image

Fix all tests with fatfs image

* [EGD-4075] Fix calculator utility test

* [EGD-4075] Image dependencies fix

* Remove uneeded comments

* Missing headers in CR

* [EGD-4075] Fixed whitespaces

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-22 10:34:12 +02:00
Przemyslaw Brudny
e131dae68f [EGD-3743] Removed old doxygen copyright statements from project. 2020-10-20 12:55:10 +02:00
Radoslaw Wicik
2276ceed67 [EGD-3743] Update copyrights in fies 2020-10-20 12:55:10 +02:00
Roman Kubiak
9f993bca0b added UT for new load/write file contents from std::string 2020-08-10 13:26:09 +02:00
Marcin Smoczyński
a9cb37d7f4 tests: add proper catch2 handling
Add proper catch2 support:
 - add catch2 as a submodule
 - add cmake function to add test easily
 - discover each test in test binary
 - remove copies of catch.hpp
 - do not try to process tests for rt1051

Do not test internals of utf8, only public interface (nasty bugs could
occur otherwise).

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-06-24 10:38:14 +02:00
Roman Kubiak
8e5813205b removed ifdefs from vfs-utils
unittest for randomness a bit more sane
2020-06-02 11:28:53 +02:00
Roman Kubiak
9dab138b05 UT for randomId generator and CRC32 computation 2020-06-02 11:28:53 +02:00
rkubiak01
2c9b0768c8 Fix for vfs tests when removed sys/ prefix on Linux 2020-05-11 11:58:36 +02:00
rkubiak01
7cac882c7a [2306] VFS: support .boot.ini and "current" and "previous" os types (#315)
* VFS: support .boot.ini and "current" and "previous" os types

* fixes for first batch of comments
- moved crc32 functions to a seperate file
- changed naming of constant with _
- removed one magic number
- crc methods now cross platform

* using smart pointer for buffer management

* created a simple USER_FILE macro for database names

* removed commented-out code

* style fixes

* Updated crc32 version

* Update module-vfs/vfs-utils.cpp

Co-Authored-By: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* Update module-vfs/vfs-utils.cpp

Co-Authored-By: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* renamed USER_FILE to USER_PATH macro, this was also
bromen and was returning incorrect paths, std::filesystem::path
behavior is causing these issues.

* VFS: remove method changed

* fixed path for assets copy

* UNITTEST: vfs test fixed

* VFS: changed computeCRC32 return type to void

* Max supported partition to 2 (was 1)

* EOL in vfs.cpp

* nullptr check in computeCRC32
include for log.hpp fixed

* flash_eMMC merged properly

* CRC32 commit update

* testBuild

* fix newline at start of smsdb.cpp
removed test from cmake

* no user/ folder on the root of emmc causes sqlite3 to fault
this adds a create empty user call for rt1051

* flash script fixes
- do not use build-*/sys
- common.sh contains a static list of iles that land on the flash

Co-authored-by: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>
2020-05-08 10:27:17 +02:00
Radoslaw Wicik
189779675a Repair vfs tests 2020-03-20 16:46:11 +01:00