Skip to content

Commit e3cbd0b

Browse files
committed
app/nginx: Change naming convention and add script for qemu.x86_64.9pfs
Signed-off-by: GHEORGHISOR Mario-Alin <[email protected]>
1 parent a303eb9 commit e3cbd0b

File tree

5 files changed

+69
-0
lines changed

5 files changed

+69
-0
lines changed

nginx/scripts/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ e.g.
5454
./scripts/run/fc.x86_64
5555
./scripts/run/xen.arm64
5656
```
57+
58+
## Build and Run for <plat> / <arch> using a different file system
59+
60+
```console
61+
./scripts/run/<plat>.<arch>.<file_system>
62+
```
63+
64+
e.g.
65+
66+
```console
67+
./scripts/run/qemu.x86_64.9pfs
68+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/qemu.x86_64.9pfs make def>touch Makefile.uk
5+
make prepare
6+
if test -z "$CC"; then
7+
make -j $(nproc)
8+
else
9+
make CC="$CC" -j $(nproc)
10+
fi
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CONFIG_PLAT_KVM=y
2+
CONFIG_KVM_VMM_QEMU=y
3+
CONFIG_ARCH_X86_64=y
4+
CONFIG_LIBNGINX=y
5+
CONFIG_LIBNGINX_MAIN_FUNCTION=y
6+
CONFIG_LIBVFSCORE=y
7+
CONFIG_LIBVFSCORE_AUTOMOUNT_UP=y
8+
CONFIG_LIBUK9P=y
9+
CONFIG_LIB9PFS=y
10+
CONFIG_LIBDEVFS=y
11+
CONFIG_LIBDEVFS_AUTOMOUNT=y
12+
CONFIG_LIBDEVFS_DEVSTDOUT=y
13+
CONFIG_LIBUKNETDEV_EINFO_LIBPARAM=y

nginx/scripts/run/qemu.x86_64.9pfs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
if test ! -f "workdir/build/nginx_qemu-x86_64"; then
4+
echo "No kernel file workdir/build/nginx_qemu-x86_64." 1>&2
5+
echo "Did you run ./build.qemu.x86_64 ?" 1>&2
6+
exit 1
7+
fi
8+
9+
{
10+
# Remove previously created network interface.
11+
sudo ip link set dev virbr0 down
12+
sudo ip link del dev virbr0
13+
sudo ip link set dev tap0 down
14+
sudo ip link del dev tap0
15+
} > /dev/null 2>&1
16+
17+
# Create bridge interface for QEMU networking.
18+
sudo ip link add dev virbr0 type bridge
19+
sudo ip address add 172.44.0.1/24 dev virbr0
20+
sudo ip link set dev virbr0 up
21+
22+
# Create a copy of the filesystem to be mounted as 9pfs.
23+
rm -fr 9pfs-rootfs
24+
cp -r rootfs 9pfs-rootfs
25+
sudo qemu-system-x86_64 \
26+
-nographic \
27+
-m 8 \
28+
-cpu max \
29+
-netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 \
30+
-append "nginx netdev.ip=172.44.0.2/24:172.44.0.1::: vfs.fstab=[ \"fs0:/:9pfs:::\" ] -- -c /nginx/conf/nginx.conf" \
31+
-kernel workdir/build/nginx_qemu-x86_64 \
32+
-fsdev local,id=myid,path=$(pwd)/9pfs-rootfs/,security_model=none \
33+
-device virtio-9p-pci,fsdev=myid,mount_tag=fs0

nginx/scripts/test/all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ test_build_run()
2828
./setup.sh
2929
test -d ./scripts/test/log || mkdir ./scripts/test/log
3030
test_build_run qemu.x86_64
31+
test_build_run qemu.x86_64.9pfs
3132
test_build_run qemu.arm64
3233
test_build_run fc.x86_64
3334
test_build fc.arm64

0 commit comments

Comments
 (0)