Commit Graph

45 Commits

Author SHA1 Message Date
Bartosz
a4406ec5a7 [MOS-783] Fixed tests and simulator for Harmony
Fixed tests and simulator for Harmony
after implementation of new filesystem
structure.
2023-01-19 16:41:56 +01:00
Lefucjusz
215e4d96b7 [MOS-783] Fixed Pure unit tests
Fixed (most of the) hardcoded
paths in Pure's unit tests.
2023-01-19 16:41:56 +01:00
Lefucjusz
afd7e7bc2c [MOS-783] Working Pure simulator after partition changes
Fixed iosyscalls so that Pure simulator
works after directory structure changes.
2023-01-19 16:41:56 +01:00
Lefucjusz
49e6eca966 [MOS-790] Workaround for ext4 booting
Workaround required to make MuditaOS
able to boot from ext4-formatted OS
partition.
Previously OS partition was mounted
on /sys and user partition on
/sys/user. This worked
when two separate FS drivers
(FATFS and lwext4) were used.
Changing OS partition to ext4
created an ambiguity whether
/sys/user is user partition
mountpoint or folder 'user'
on OS partition. This
workaround still may create
ambiguities, so the issue
should be fixed in one of
the further releases by
completely removing 'sys'
prefix.
2022-11-10 00:24:52 +01:00
Adam Wulkiewicz
fe708cdf31 [MOS-670] Change clang-format AlwaysBreakTemplateDeclarations to Yes
Add --all and --fix-all options to style-check-hook
2022-08-26 15:22:39 +02:00
Dawid Wojtas
58319eba9a [MOS-574] Fix GCC12 port
Add missing include file.
2022-06-24 11:23:43 +02:00
Dawid Wojtas
915f3334c3 [MOS-549] Linux simulator crashes on GCC12
Add wrapper for posix stat function
in order to invoke our implementation.
2022-06-23 16:45:40 +02:00
Dawid Wojtas
0a6799579e [MOS-534] Pure simulator crashes on startup fix
Fix missing syscall used by std::filesystem and update glibc version.txt
file.
2022-06-15 10:03:55 +02:00
Lucjan Bryndza
ca75ebe449 [EGD-7587] Change user partition to ext4 fs
Add support for the EXT4 filesystem using LWEXT4
Add minor VFS fixes
Add unittest for the EXT4 partitions
Reformat partition for use EXT4 filesystem

[EGD-7587] Initial cmake of the ext4

[EGD-7587] Block driver for the ext4

Initial version of the block driver for the ext4 device

[EGD-7587] Initial version of the EXT4 fs support

Initial version of the ext4 filesystem support

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

[EGD-7587] Mount unmount initial unit tests

Mount and unmount initial unit tests

[EGD-7587] Unit tests and fixes for ext4

Unit tests and fixes for the ext4 partition

[EGD-7587[ adjust flags

Adjust ext configuration flags

[EGD-7587] Change to generate ext4 image

Change image generation script to generate ext4 image

[EGD-7584] Change cache memory settings

Change cache memory settings

[EGD-7587] Change create image flags

Change create image flags

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

[EGD-7587] Git change lwext4 to the mudita version

Change LWEXT4 to mudita version

[EGD-7587] Modify ext4 implementation

Modify ext4 implementation according to the new lwext4
mudita branch. Some issues were fixed in this branch

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

[EGD-7587] Add to VFS rmdir syscall

Add to VFS missing rmdir for compliance POSIX std

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-10-07 14:39:28 +02:00
Marcin Smoczyński
74ae1a6589 [EGD-7031] Remove UT deps to the production image
Remove dependency to the production image by creating separate sysroot
for test assets alongside with a test image Test.img.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-07-27 23:36:37 +02:00
Wiktor S. Ovalle Correa
20180437c8 [EGD-6035] Fix support for glibc-2.32
GLIBC 2.32 doesn't work with changes made for 2.33.
2021-06-03 16:16:21 +02:00
Wiktor S. Ovalle Correa
35ef7358fd [EGD-6035] Fix iosyscalls build on GLIBC_2.33
Newer versions of glibc have stat symbols family
incompatible with earlier versions.
2021-05-14 15:40:26 +02:00
Lucjan Bryndza
b419649f7f [EGD-6590] Add /mfgconf mount to iosyscalls lib
Add translation of the /mfgconf mount point in the libiosyscall
library when redirection is disabled.
2021-04-21 11:13:19 +02:00
tomaszkrosnowski
5ef611b30e [EGD-6557] Support glibc older than 2.28
Added preprocessor cases to disable code not supported in glibc older
2021-04-16 13:03:51 +02:00
Wiktor S. Ovalle Correa
b09cd552c1 [EGD-6482] Remove unnecessary iosyscalls messages
Unimplemented syscalls should fail silently to avoid breaking
tests.
2021-04-09 13:01:46 +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
b07bcacbaf [EGD-6239] Fix Linux Release build on gcc-10
strncpy() was provided with size equal to a buffer size, not leaving
buffer space for a trailing zero; also sml fix.
2021-03-23 12:38:47 +01:00
Wiktor S. Ovalle Correa
2c4dd15023 [EGD-5927] Redirect access to '/lib' in emulator
Sanitizer was trying to access libraries after all objects
got deleted and hung in a nested bug state.
2021-03-01 18:13:54 +01:00
Wiktor S. Ovalle Correa
2d2e432893 [EGD-5900] Fix filesystem performance issue (Linux)
Make fread/fwrite ignore requested item size
and perform on 8KB blocks
2021-03-01 11:50:58 +01:00
Wiktor S. Ovalle Correa
4614846d38 [EGD-5590] Fix boot config procedure
Boot config procedure was outdated and didn't actually work
2021-02-17 17:08:18 +01:00
Wiktor S. Ovalle Correa
0cea748888 [EGD-5596] Fix fread() handling of EOF
iosyscalls' fread() should interpret zero bytes read as EOF.
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
Jakub Pyszczak
7797a2eaf0 [EGD-5266] Fix test harness
Covers harness issues that occures on experimental branch
due to the new filesystem implementation.
2021-02-17 17:08:18 +01:00
Wiktor S. Ovalle Correa
fa22300369 [EGD-5378] Fix missing condition
Some strange mistake happened during a rebase.
2021-02-17 17:07:41 +01:00
Wiktor S. Ovalle Correa
da4ed4e2da [EGD-5378] Add informative message before aborting iosyscalls
This fix gives basic information about missing syscalls
before aborting from libiosyscalls preload.
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
Wiktor S. Ovalle Correa
7d06115f3e [EGD-5318] Fix coding style in board/
Code style check was disabled for board/ subfolder.
This commit fixes coding and enables style check
for this folder.
2021-02-17 17:06:59 +01:00
Wiktor S. Ovalle Correa
dca37deb75 [EGD-5297] Fix Release build on linux
Some minor warnings were preventing us from completing
Release build of Linux emulator.
2021-02-17 17:06:49 +01:00
Lucjan Bryndza
dcc72e0bec [EGD-5332] Fix heap size and other merge fixes
After merge with master we are unable to run any application
It was caused by the insufficent heap size
2021-02-17 17:06:49 +01:00
Wiktor S. Ovalle Correa
6b386720e8 [EGD-5289] Fix VFS folder mapping in emulator
Folder filtering prevented us from accessing /sys folder
of VFS image. This fix redirects all /sys references to
the image by default, requiring us to explicitly specify
all paths we want to redirect to Linux fs.
2021-02-17 17:05:32 +01:00
Jakub Pyszczak
f51a1e525e [EGD-5248] Add statvfs to the libiosyscall library
Added support for statvfs in the libiosyscall library.
It is needed in service desktop implementation.
2021-02-17 17:05:32 +01:00
Wiktor S. Ovalle Correa
165788e15f [EGD-5139] Add some missing POSIX calls
This commit adds interceptions for common POSIX calls.
Issue [EGD-4551] has shown that some calls can be made from
stdlibc++ that we didn't trace or intercept so far. Our goal
here is to improve our POSIX coverage.
2021-02-17 17:05:32 +01:00
Wiktor S. Ovalle Correa
5bc3a96dbd [EGD-4551] Add missing read() interception
Fix error caused by libstdc++ passing our fd to native read()
2021-02-17 17:05:32 +01:00
Wiktor S. Ovalle Correa
e8d1fd23a3 [EGD-5177] Change iosyscalls code style
This commit is part of libiosyscalls refining task.
Its purpose is to make this code more predictable and
easier to maintain (as well as fixing some minor bugs).
2021-02-17 17:05:32 +01:00
Lucjan Bryndza
6f3a6b4f7d [EGD-5199] Add support for mount umount
Add support for mount umount in the libiosyscall library
due to planning to use ro fatfs and remount to rw only
for update purposes.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-02-17 17:05:32 +01:00
Wiktor S. Ovalle Correa
a92f163afc [EGD-5137] Change iosyscalls symbols
Move iosyscalls symbols to a separate namespace `_iosys_*`

This helps us avoid accidentally overriding library calls
which are not exported as symbols.
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
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
3178bc7256 [EGD-4524] Fix unable to build Linux Release tgt (#1093)
Due to the errors in the libiosyscalls it was impossible
to build emulator for Linux Debug target. This commit will fix this
problem.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-26 13:50:12 +01:00
Lucjan 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 Bryndza
47740cabfd [EGD-4440] Redirect syscalls to underlay linux fs. (#1043)
Currently if file doens't exists on image the error is reported
but some subsystems need access to the underlaying linux fs.

In the feature release add strict checking for allowed paths
now it redirect syscall with warning.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-19 09:11:45 +01:00
Lucjan Bryndza
192f5bc854 [EGD-4331] Strict check fat handles (#1034)
In previous version fat handles was not strict checked.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-18 11:47:48 +01:00
Lucjan 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
Lucjan Bryndza
97d865c070 [EGD-4330] file streams ld preload library (#982)
* [EGD-4330] file streams ld preload library

It is concept library LD_PRELOAD for handle syscalls wrapper to the
image fat file.

* [EGD-4330] Stdlib implementation

* [EGD-4330] Stdio syscalls

* [EGD-4330] Dir searching stdlib replacement

* [EGD-4330] NL at end of file

* [EGD-4261] Working version of library wrapper

* [EGD-4330] Script for run emulator on fs image

Run phone emulator using filesystem image

* [EGD-4261] Missing debug file

* [EGD-4330] Not needed to link...

* [EGD-4330] Code review fixes #1
    iosyscalls

* [EGD-4330] Code review fixes round #2

* [EGD-4330] Code review round #3

* Ident fixes

* [EGD-4330] Ident fixes

* [EGD-4330] Code review round #4

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