Skip to content

Commit 5d0fe08

Browse files
committed
add Customize section in README
Signed-off-by: Valentin-Razvan Bogdan <bogdanvrazvan@gmail.com>
1 parent fc3b46f commit 5d0fe08

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

rs-hello/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rust Hello on Unikraft
22

3-
Build and run a Rust Hello program on Unikraft.
3+
Build and run a `std` independent Rust Hello program on Unikraft.
44
Follow the instructions below to set up, configure, build and run Rust Hello.
55
Make sure you installed the [requirements](../README.md#requirements) and the [Rust toolchain channel through Rustup](https://www.rust-lang.org/tools/install).
66

@@ -160,3 +160,36 @@ In order to remove the generated files by Cargo in the `target` directory, use:
160160
```console
161161
cargo clean
162162
```
163+
## Customize
164+
165+
Rust Hello is the simplest application to be run with Unikraft.
166+
This makes it ideal as a minimal testing ground for new features: it builds fast, it doesn't have dependencies.
167+
168+
### Update the Unikraft Core Code
169+
170+
If updating the Unikraft core code in the `./workdir/unikraft/` directory, you then go through the [configure](#configure), [build](#build) and [run](#run) steps.
171+
172+
### Add Other Object Files
173+
174+
The current configuration use a object file.
175+
If looking to add another file to the build, update the [`Makefile.uk`](Makefile.uk) file.
176+
177+
For example, to add a new object file `support.o` to the build, update the [`Makefile.uk`](Makefile.uk) file to:
178+
179+
```make
180+
$(eval $(call addlib,apprshello))
181+
182+
APPRSHELLO_OBJS-y += $(APPRSHELLO_BASE)/target/x86_64-unknown-none/debug/deps/rs_hello-*.o
183+
APPRSHELLO_OBJS-y += $(APPRSHELLO_BASE)/support.o
184+
```
185+
186+
To include a Rust library, such as `librs_hello.rlib`, update the [`Makefile.uk`](Makefile.uk) file to:
187+
188+
```make
189+
$(eval $(call addlib,apprshello))
190+
191+
APPRSHELLO_OBJS-y += $(APPRSHELLO_BASE)/target/x86_64-unknown-none/debug/deps/rs_hello-*.o
192+
APPRSHELLO_ALIBS-y += $(APPRSHELLO_BASE)/librs_hello.rlib
193+
```
194+
195+
Then go through the [configure](#configure), [build](#build) and [run](#run) steps.

0 commit comments

Comments
 (0)