Commit Graph
44 Commits
Author SHA1 Message Date
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
Lucjan Bryndza 2a17ec9254 [EGD-6075] Fix partition name typo
Fix partition name typo in the disk manager
2021-04-15 09:19:56 +02:00
Roman Kubiak 6bc6eccc34 [EGD-5565] Fix update process on new lf filesystem
These changes are needed for update to work with new
LFS fileystem, also minor bugfixes are included.
2021-03-11 07:35:31 -08:00
Lucjan Bryndza 7bcc1c9bd4 [EGD-6013] Fix no copy syscall
Due to lack of some filesystem syscalls std::filesystem::copy
functions family doesn't work. This path add missing syscalls
in the FS layer.
2021-03-10 19:05:07 +01:00
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
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
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
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 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
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 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 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 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
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
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
Roman Kubiak 0900f22c2c [EGD-4382] vfs fixups (#1126)
* initial value for boot config
* run boot config methods after vfs has been marked as initialized
* type-os
* in case .boot.json is broken, re-write it with defaults
2020-12-02 11:36:13 +01:00
Lucjan Bryndza 8be15b96e4 [EGD-4498] Virtual Filesystem Core Framework (#1074)
* [EGD-4498] Registering and unregistering VFS

* [EGD-4498] Mount structures added

* [EGD-4498] Mount filesystem completed

* [EGD-4498] Mount / unmount / and find mount impl

* [EGD-4498] Per thread directory TLS

* [EGD-4489] Absolute paths implementation

* [EGD-4498] Git ignore vim

* [EGD-4498] VFS core functions without cwd

* [EGD-4498] Other syscalls

* [EGD-4498] Code review fixes

* [EGD-4498] Code review #2

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

* [EGD-4498] Code review small fixes vol #3

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-12-02 09:47:17 +01:00
Lucjan Bryndza 236f7eac21 [EGD-4549] Mediaplayer read file timeout (#1098)
It is caused that fread() works really really slow after
changing ff_fread() items/num.
2020-11-27 10:23:58 +01:00
Lucjan BryndzaandLucjan Bryndza 43b9c45724 [EGD-4512] Prevent vfs crash before init (#1091)
Currently calling any method from class vfs
causes aplication crash when methods are called before
vfs.Init() call. This commit prevent to crash end return failure
instead. The fix is related to any any vfs methods and methods called
through the standard syscall.
It is only the hotfix and it will be removed when new VFS subsystem
will be ready.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-26 13:29:36 +01:00
Lucjan BryndzaandLucjan Bryndza 46aa1ee4e7 [EGD-4505] Fix problem with fread (#1092)
FIX: Fread from stdio returns not enough of data

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-26 13:14:47 +01:00
Bartosz CichockiandSP2FET 96c9cfa7b1 [EGD-4503] added missing library to compile with GCC 10 (#1075)
Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-11-24 15:20:59 +01:00
Lucjan BryndzaandLucjan 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
Lucjan BryndzaandLucjan Bryndza dc16684eab [EGD-4221] lseek syscall fix (#1028)
lseek return incorrect return value. This patch fix it

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-17 15:04:27 +01:00
Lucjan BryndzaandLucjan Bryndza d96856f898 [EGD4418] fix in syscalls translation (#1026)
Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-17 13:29:15 +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 KubiakandPiotr Tanski 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 BryndzaandLucjan Bryndza 707b31ac3e [EGD-4264] directory reordering (#1001)
* [EGD-4264] VFS directory reordering

Currently VFS uses flat directory structure
for disc manager I need more sofisticated directory layout

* [EGD-4264] Remove redundant -Wno

* [EGD-4261] New purefs API

* [EGD-4264] Unittest fixes

* [EGD-4264] Directory relativity

* [EGD-4264] Relative path fixes

* [EGD-4264] Fix RT1051 compile errors

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-16 12:11:24 +01:00