You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/lib.md
+60-1Lines changed: 60 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ of the manifest header.
21
21
22
22
23
23
On success, zero is returned. If the image does not contain a valid 'magic number' at the beginning
24
-
of the manifest, or if the size of the image is bigger than `WOLFBOOT_PARTITION_SIZE`, -1 is returned.
24
+
of the manifest, or if the size of the image is bigger than `WOLFBOOT_PARTITION_SIZE`, -1 is returned.
25
25
26
26
27
27
If the `open_image_address` operation is successful, two other functions can be invoked:
@@ -123,3 +123,62 @@ Firmware Valid
123
123
booting 0x5609e3526590(actually exiting)
124
124
```
125
125
126
+
## Library mode: Partition Manager CLI Example
127
+
128
+
An example application using filesystem access is provided in `hal/library_fs.c`.
129
+
130
+
The CLI application `lib-fs` allow querying partition states, triggering updates, and marking the boot partition as successful.
131
+
132
+
### Building the lib-fs example
133
+
134
+
Step 1: use the example configuration to compile wolfBoot in library mode:
135
+
136
+
```
137
+
cp config/examples/library_fs.config .config
138
+
```
139
+
140
+
Step 2: Adjust the configuration to fit your partition layout and file path.
141
+
142
+
Step 3: Build the CLI application:
143
+
144
+
```
145
+
make lib-fs
146
+
```
147
+
148
+
This will produce the `lib-fs` executable.
149
+
150
+
### Using the Partition Manager CLI
151
+
152
+
The example configuration points the binary to access `/dev/mtd0` for partition data. You can simulate this file path with `modprobe mtdram total_size=16384 erase_size=128`. You may need to adjust the file permissions to allow read/write access.
153
+
154
+
Run the application with one of the supported commands:
155
+
156
+
```
157
+
./lib-fs <command>
158
+
```
159
+
160
+
Available commands:
161
+
162
+
-`status` : Show state of all partitions
163
+
-`get-boot` : Get BOOT partition state
164
+
-`get-update` : Get UPDATE partition state
165
+
-`update-trigger` : Trigger an update (sets UPDATE partition to UPDATING)
0 commit comments