Skip to content

Commit

Permalink
Split out littlefs mbed-os implementation from 'ca7b5e8eed574a7295280…
Browse files Browse the repository at this point in the history
…d9276de3f9bb7cb7f05'

This is not a true subtree split due to the complication moves in the
mbed-os tree. While I could patch the history together to keep the
subtree intact, the ultimate goal for this split is to be merged in
parallel to littlefs-v1. This would give us duplicate histories anyway
so it's probably better to keep this split as a single squashed commit.

source-dir: features/storage/filesystem/littlefs/littlefs
source-hash: ca7b5e8
  • Loading branch information
geky committed Jan 29, 2019
0 parents commit 8b609ec
Show file tree
Hide file tree
Showing 59 changed files with 15,569 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .mbedignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
littlefs/emubd/
littlefs/tests/
TESTS/util
70 changes: 70 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
script:
# Check that example compiles
- sed -n '/``` c++/,/```/{/```/d; p;}' README.md > main.cpp
- PYTHONPATH=mbed-os python mbed-os/tools/make.py -t GCC_ARM -m K82F
--source=. --build=BUILD/K82F/GCC_ARM -j0

# Check that tests compile
- rm -rf main.cpp BUILD
- PYTHONPATH=mbed-os python mbed-os/tools/test.py -t GCC_ARM -m K82F
--source=. --build=BUILD/TESTS/K82F/GCC_ARM -j0
-n 'tests*'

# Run littlefs functional tests
- CFLAGS="-Wno-format" make -Clittlefs test QUIET=1

# Run littlefs functional tests with different configurations
# Note: r/w size of 64 is default in mbed
- CFLAGS="-Wno-format -DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64"
make -Clittlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
make -Clittlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
make -Clittlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_BLOCK_COUNT=1023"
make -Clittlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_LOOKAHEAD=2048"
make -Clittlefs test QUIET=1

# Self-host with littlefs-fuse for fuzz test
- CFLAGS="-Wno-format" make -C littlefs-fuse

- littlefs-fuse/lfs --format /dev/loop0
- littlefs-fuse/lfs /dev/loop0 mount

- ls mount
- mkdir mount/littlefs
- cp -r $(git ls-tree --name-only HEAD littlefs/) mount/littlefs
- cd mount/littlefs
- ls
- CFLAGS="-Wno-format" make -B test_dirs QUIET=1

install:
# Get arm-none-eabi-gcc
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-arm-none-eabi --force-yes
# Get dependencies
- git clone https://github.com/armmbed/mbed-os.git
- git clone https://github.com/armmbed/spiflash-driver.git
# Install python dependencies
- pip install --user -r mbed-os/requirements.txt
# Install littlefs-fuse and dependencies
- sudo apt-get install libfuse-dev
- git clone https://github.com/geky/littlefs-fuse
# Check versions
- fusermount -V
- arm-none-eabi-gcc --version
- python --version
- gcc --version

before_script:
# Patch littlefs-fuse
- rm -rf littlefs-fuse/littlefs/*
- cp -r $(git ls-tree --name-only HEAD littlefs/) littlefs-fuse/littlefs
- echo '*' > littlefs-fuse/.mbedignore
# Create file-backed disk
- mkdir mount
- sudo chmod a+rw /dev/loop0
- dd if=/dev/zero bs=512 count=2048 of=disk
- losetup /dev/loop0 disk
Loading

0 comments on commit 8b609ec

Please sign in to comment.