Skip to content

Commit 488ba0b

Browse files
committed
Moddify README to include 9pfs support documentation for elfloader-basic
Signed-off-by: Neagu Dragoș-Ionuț <dragosneagu28@gmail.com>
1 parent 3c8ca01 commit 488ba0b

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

elfloader-basic/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,92 @@ ELFs using require additional configuration of the ELF Loader.
255255
You can customize the ELF Loader build debug messages.
256256
For that, use the ["Configure" step](#configure) enable the [`ukdebug` library](https://github.com/unikraft/unikraft/tree/staging/lib/ukdebug) and its other options.
257257
Then, build and run again.
258+
259+
### Use a Different Filesystem Type for QEMU
260+
261+
You can use [`9pfs`](https://github.com/unikraft/unikraft/tree/staging/lib/9pfs) as an alternate filesystem to initrd.
262+
Note that 9pfs does not work with Firecracker.
263+
And it requires re-building Xen to add 9pfs support.
264+
Below find instructions on running Nginx on QEMU with 9pfs support.
265+
266+
You need to use these contents for the [`Config.uk`](Config.uk) configuration file:
267+
268+
```text
269+
# Configure ELF loader application, with networking support.
270+
271+
config APPELFLOADERNET
272+
bool "Configure ELF loader application (for binary compatibility) with networking support"
273+
default y
274+
275+
# Select app-elfloader component.
276+
select APPELFLOADER_DEPENDENCIES
277+
278+
# Configurations options for app-elfloader
279+
# (they can't be part of the template atm)
280+
select APPELFLOADER_ARCH_PRCTL
281+
select APPELFLOADER_BRK
282+
select APPELFLOADER_CUSTOMAPPNAME
283+
select APPELFLOADER_STACK_NBPAGES
284+
select APPELFLOADER_VFSEXEC_EXECBIT
285+
select APPELFLOADER_VFSEXEC
286+
select APPELFLOADER_HFS
287+
select APPELFLOADER_HFS_ETCRESOLVCONF
288+
select APPELFLOADER_HFS_ETCHOSTS
289+
select APPELFLOADER_HFS_ETCHOSTNAME
290+
select APPELFLOADER_HFS_REPLACEEXIST
291+
292+
# Select filesystem implementation: cpio, ramfs, devfs.
293+
select LIBVFSCORE
294+
select LIBVFSCORE_AUTOMOUNT_UP
295+
select LIBUK9P
296+
select LIB9PFS
297+
select LIBDEVFS
298+
select LIBDEVFS_AUTOMOUNT
299+
300+
# Select LWIP networking stack library.
301+
select LIBLWIP
302+
303+
# Use extended information (einfo) for configuring network parameters.
304+
# This component parses the configuration string in the command line:
305+
# netdev.ip=172.44.0.2/24:172.44.0.1:::
306+
select LIBUKNETDEV_EINFO_LIBPARAM```
307+
308+
This means you replace these two lines in [`Config.uk`](Config.uk):
309+
310+
```text
311+
select LIBRAMFS
312+
select LIBUKCPIO
313+
```
314+
315+
with these lines:
316+
317+
```text
318+
select LIBUK9P
319+
select LIB9PFS
320+
```
321+
322+
Now go through the [configure](#configure).
323+
324+
From the `Library Configuration` tab, select `uk9p` and `Process-related functions` ---> `Multiprocess support`.
325+
326+
From the `Application Options` tab, select `Multiprocess application`
327+
328+
Then continue with the [build](#build) step.
329+
330+
Finally, after configuring networking, use the commands below to run elfloader-basic on QEMU/x86_64 with 9pfs support:
331+
332+
```console
333+
# Create a copy of the filesystem to be mounted as 9pfs.
334+
rm -fr 9pfs-rootfs
335+
cp -r rootfs 9pfs-rootfs
336+
sudo qemu-system-x86_64 \
337+
-nographic \
338+
-m 512 \
339+
-cpu max \
340+
-append "elfloader_qemu-x86_64 vfs.fstab=[ \"fs0:/:9pfs:::\" ] -- /hello-c" \
341+
-kernel workdir/build/elfloader_qemu-x86_64 \
342+
-fsdev local,id=myid,path=$(pwd)/9pfs-rootfs/,security_model=none \
343+
-device virtio-9p-pci,fsdev=myid,mount_tag=fs0
344+
```
345+
346+
You would use a similar command for QEMU/ARM64.

0 commit comments

Comments
 (0)