shithub: lwext4

Download patch

ref: bdd89bc6a923f1e22880d2485133db79f3773ff0
parent: f5be9f5ec391ee19a442c5db5f1ebb6660ce685d
author: gkostka <kostka.grzegorz@gmail.com>
date: Wed Dec 9 16:59:40 EST 2015

Add install target & new fs_tools names & readme update

--- a/README.md
+++ b/README.md
@@ -123,15 +123,15 @@
  make
  ```
 
-Compile
+Compile & install tools
 ------------
 ```bash
  cd build_generic
  make
+ sudo make install
  ```
 
-
-Generic demo application
+lwext4-generic demo application
 =====
 Simple lwext4 library presentation:
 * load ext2/3/4 images
@@ -142,34 +142,50 @@
 
 How to use for images/blockdevices:
 ```bash
- cd build_generic
- lwext4_generic -i ext_images/ext2 
- lwext4_generic -i ext_images/ext3 
- lwext4_generic -i ext_images/ext4 
+ lwext4-generic -i ext_images/ext2 
+ lwext4-generic -i ext_images/ext3 
+ lwext4-generic -i ext_images/ext4 
  ```
+ 
+Show full option set:
+```bash
+ lwext4-generic --help
+   ```
 
+Run automatic tests
+=====
 
-Build and run automatic tests
+Execute tests for 100MB unpacked images:
+```bash
+ make test
+   ```
+Execute tests for autogenerated 1GB images (only on Linux targets) + fsck:
+```bash
+ make test_all
+   ```
+Using lwext4-mkfs tool
 =====
-Build automatic test tools:
+It is possible to create ext2/3/4 partition by internal library tool.
+
+Generate empty file (1GB):
 ```bash
- make
- cd build_generic
- make
-  ```
-Uncompress ext/2/3/4 images:
+ dd if=/dev/zero of=ext_image bs=1M count=1024
+   ```
+Create ext2 partition:
 ```bash
- make unpack_images
+ lwext4-mkfs -i ext_image -e 2
    ```
-Run server for one of the image file:
+Create ext3 partition:
 ```bash
- make server_ext2
- make server_ext3
- make server_ext4
-  ```
-Execute tests:
+ lwext4-mkfs -i ext_image -e 3
+   ```
+Create ext4 partition:
 ```bash
- make test
+ lwext4-mkfs -i ext_image -e 4
+   ```
+Show full option set:
+```bash
+ lwext4-mkfs --help
    ```
 
 Cross compile standalone library
--- a/fs_test.mk
+++ b/fs_test.mk
@@ -1,10 +1,10 @@
 
 ifeq ($(OS),Windows_NT)
-LWEXT4_CLIENT = @build_generic\\fs_test\\lwext4_client
-LWEXT4_SERVER = @build_generic\\fs_test\\lwext4_server
+LWEXT4_CLIENT = @build_generic\\fs_test\\lwext4-client
+LWEXT4_SERVER = @build_generic\\fs_test\\lwext4-server
 else
-LWEXT4_CLIENT = @build_generic/fs_test/lwext4_client
-LWEXT4_SERVER = @build_generic/fs_test/lwext4_server
+LWEXT4_CLIENT = @build_generic/fs_test/lwext4-client
+LWEXT4_SERVER = @build_generic/fs_test/lwext4-server
 endif
 
 TEST_DIR = /test
@@ -575,6 +575,9 @@
 	
 server_ext4:
 	$(LWEXT4_SERVER) -i ext_images/ext4
+	
+server_kill:
+	-killall lwext4-server
 
 fsck_images:
 	sudo fsck.ext2 ext_images/ext2 -v -f
@@ -595,45 +598,45 @@
 test_set_full: t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26
 
 test_ext2_full:
-	-killall lwext4_server
+	make server_kill
 	$(LWEXT4_SERVER) -i ext_images/ext2 &
 	make test_set_full
-	-killall lwext4_server
+	make server_kill
 
 
 test_ext3_full:
-	-killall lwext4_server
+	make server_kill
 	$(LWEXT4_SERVER) -i ext_images/ext3 &
 	make test_set_full
-	-killall lwext4_server
+	make server_kill
 
 test_ext4_full:
-	-killall lwext4_server
+	make server_kill
 	$(LWEXT4_SERVER) -i ext_images/ext4 &
 	make test_set_full
-	-killall lwext4_server
+	make server_kill
 
 test_all: images_big test_ext2_full test_ext3_full test_ext4_full fsck_images
 
 
 test_ext2_small:
-	-killall lwext4_server
+	make server_kill
 	$(LWEXT4_SERVER) -i ext_images/ext2 &
 	make test_set_small
-	-killall lwext4_server
+	make server_kill
 
 
 test_ext3_small:
-	-killall lwext4_server
+	make server_kill
 	$(LWEXT4_SERVER) -i ext_images/ext3 &
 	make test_set_small
-	-killall lwext4_server
+	make server_kill
 
 test_ext4_small:
-	-killall lwext4_server
+	make server_kill
 	$(LWEXT4_SERVER) -i ext_images/ext4 &
 	make test_set_small
-	-killall lwext4_server
+	make server_kill
 	
 test: unpack_images test_ext2_small test_ext3_small test_ext4_small
 	
--- a/fs_test/CMakeLists.txt
+++ b/fs_test/CMakeLists.txt
@@ -1,25 +1,31 @@
 #fs_test executables
-add_executable(lwext4_server lwext4_server.c)
-target_link_libraries(lwext4_server lwext4)
-target_link_libraries(lwext4_server blockdev)
+add_executable(lwext4-server lwext4_server.c)
+target_link_libraries(lwext4-server lwext4)
+target_link_libraries(lwext4-server blockdev)
 if(WIN32)
-target_link_libraries(lwext4_server ws2_32)
+target_link_libraries(lwext4-server ws2_32)
 endif(WIN32)
-add_executable(lwext4_client lwext4_client.c)
-target_link_libraries(lwext4_client lwext4)
+add_executable(lwext4-client lwext4_client.c)
+target_link_libraries(lwext4-client lwext4)
 if(WIN32)
-target_link_libraries(lwext4_client ws2_32)
+target_link_libraries(lwext4-client ws2_32)
 endif(WIN32)
 
 aux_source_directory(common COMMON_SRC)
-add_executable(lwext4_generic lwext4_generic.c ${COMMON_SRC})
-target_link_libraries(lwext4_generic blockdev)
-target_link_libraries(lwext4_generic lwext4)
+add_executable(lwext4-generic lwext4_generic.c ${COMMON_SRC})
+target_link_libraries(lwext4-generic blockdev)
+target_link_libraries(lwext4-generic lwext4)
 
-add_executable(lwext4_mkfs lwext4_mkfs.c)
-target_link_libraries(lwext4_mkfs blockdev)
-target_link_libraries(lwext4_mkfs lwext4)
+add_executable(lwext4-mkfs lwext4_mkfs.c)
+target_link_libraries(lwext4-mkfs blockdev)
+target_link_libraries(lwext4-mkfs lwext4)
 
-add_executable(lwext4_mbr lwext4_mbr.c)
-target_link_libraries(lwext4_mbr blockdev)
-target_link_libraries(lwext4_mbr lwext4)
\ No newline at end of file
+add_executable(lwext4-mbr lwext4_mbr.c)
+target_link_libraries(lwext4-mbr blockdev)
+target_link_libraries(lwext4-mbr lwext4)
+
+install (TARGETS lwext4-server DESTINATION /usr/bin)
+install (TARGETS lwext4-client DESTINATION /usr/bin)
+install (TARGETS lwext4-generic DESTINATION /usr/bin)
+install (TARGETS lwext4-mkfs DESTINATION /usr/bin)
+install (TARGETS lwext4-mbr DESTINATION /usr/bin)