Skip to content

Commit dac4e3c

Browse files
sculamacazrazvand
authored andcommitted
redis: Add scripts
Add `scripts/` directory: - `defconfig/<plat>.<arch>`: default configs, used by build scripts - `build/<plat>.<arch>`: scripts for building Unikraft images - `run/<plat>.<arch>`: scripts for running Unikraft images - `README.md`: accompanying document with instructions Signed-off-by: Luca Mazilescu <luca.mazilescu@protonmail.com>
1 parent f604055 commit dac4e3c

File tree

19 files changed

+376
-0
lines changed

19 files changed

+376
-0
lines changed

redis/scripts/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Scripts for Redis on Unikraft
2+
3+
These are companions instruction to the main instructions in the [`README`](README.md).
4+
5+
Use scripts as quick actions for building and running Redis on Unikraft.
6+
7+
**Note**: Run scripts from the application directory.
8+
9+
## Build for <plat> / <arch>:
10+
11+
```console
12+
./scripts/build/<plat>.<arch>
13+
```
14+
15+
e.g.:
16+
17+
```console
18+
./scripts/build/qemu.x86_64
19+
./scripts/build/qemu.arm64
20+
./scripts/build/fc.x86_64
21+
./scripts/build/xen.arm64
22+
```
23+
24+
## Build for <plat> / <arch> using a different compiler
25+
26+
```console
27+
CC=/path/to/compiler ./scripts/build/<plat>.<arch>
28+
```
29+
30+
e.g.
31+
32+
```console
33+
CC=/usr/bin/gcc-12 ./scripts/build/qemu.x86_64
34+
CC=/usr/bin/aarch64-linux-gnu-gcc-12 ./scripts/build/qemu.arm64
35+
CC=/usr/bin/clang ./scripts/build/qemu.x86_64
36+
CC=/usr/bin/clang ./scripts/build/qemu.arm64
37+
CC=/usr/bin/gcc-12 ./scripts/build/fc.x86_64
38+
CC=/usr/bin/aarch64-linux-gnu-gcc-12 ./scripts/build/fc.arm64
39+
CC=/usr/bin/clang ./scripts/build/fc.x86_64
40+
CC=/usr/bin/clang ./scripts/build/fc.arm64
41+
```
42+
43+
## Run on <plat> / <arch>
44+
45+
```console
46+
./scripts/run/<plat>.<arch>
47+
```
48+
49+
e.g.
50+
51+
```console
52+
./scripts/run/qemu.x86_64
53+
./scripts/run/qemu.arm64
54+
./scripts/run/fc.x86_64
55+
./scripts/run/xen.arm64
56+
```

redis/scripts/build/fc.arm64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/fc.arm64 make defconfig
5+
touch Makefile.uk
6+
make prepare
7+
if test -z "$CC"; then
8+
make -j $(nproc)
9+
else
10+
make CC="$CC" -j $(nproc)
11+
fi

redis/scripts/build/fc.x86_64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/fc.x86_64 make defconfig
5+
touch Makefile.uk
6+
make prepare
7+
if test -z "$CC"; then
8+
make -j $(nproc)
9+
else
10+
make CC="$CC" -j $(nproc)
11+
fi

redis/scripts/build/qemu.arm64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/qemu.arm64 make defconfig
5+
touch Makefile.uk
6+
make prepare
7+
if test -z "$CC"; then
8+
make -j $(nproc)
9+
else
10+
make CC="$CC" -j $(nproc)
11+
fi

redis/scripts/build/qemu.x86_64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/qemu.x86_64 make defconfig
5+
touch Makefile.uk
6+
make prepare
7+
if test -z "$CC"; then
8+
make -j $(nproc)
9+
else
10+
make CC="$CC" -j $(nproc)
11+
fi

redis/scripts/build/xen.arm64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/xen.arm64 make defconfig
5+
touch Makefile.uk
6+
make prepare
7+
if test -z "$CC"; then
8+
make -j $(nproc)
9+
else
10+
make CC="$CC" -j $(nproc)
11+
fi

redis/scripts/build/xen.x86_64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
make distclean
4+
UK_DEFCONFIG=$(pwd)/scripts/defconfig/xen.x86_64 make defconfig
5+
touch Makefile.uk
6+
make prepare
7+
if test -z "$CC"; then
8+
make -j $(nproc)
9+
else
10+
make CC="$CC" -j $(nproc)
11+
fi

redis/scripts/defconfig/fc.arm64

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CONFIG_PLAT_KVM=y
2+
CONFIG_KVM_VMM_FIRECRACKER=y
3+
CONFIG_ARCH_ARM_64=y
4+
CONFIG_LIBVFSCORE=y
5+
CONFIG_LIBVFSCORE_AUTOMOUNT_UP=y
6+
CONFIG_LIBRAMFS=y
7+
CONFIG_LIBUKCPIO=y
8+
CONFIG_LIBDEVFS=y
9+
CONFIG_LIBDEVFS_AUTOMOUNT=y
10+
CONFIG_LIBDEVFS_DEVSTDOUT=y
11+
CONFIG_LIBUKNETDEV_EINFO_LIBPARAM=y
12+
CONFIG_ARM64_ERRATUM_858921=n
13+
CONFIG_ARM64_ERRATUM_835769=n
14+
CONFIG_ARM64_ERRATUM_843419=n

redis/scripts/defconfig/fc.x86_64

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CONFIG_PLAT_KVM=y
2+
CONFIG_KVM_VMM_FIRECRACKER=y
3+
CONFIG_ARCH_X86_64=y
4+
CONFIG_LIBVFSCORE=y
5+
CONFIG_LIBVFSCORE_AUTOMOUNT_UP=y
6+
CONFIG_LIBRAMFS=y
7+
CONFIG_LIBUKCPIO=y
8+
CONFIG_LIBDEVFS=y
9+
CONFIG_LIBDEVFS_AUTOMOUNT=y
10+
CONFIG_LIBDEVFS_DEVSTDOUT=y
11+
CONFIG_LIBUKNETDEV_EINFO_LIBPARAM=y

redis/scripts/defconfig/qemu.arm64

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CONFIG_PLAT_KVM=y
2+
CONFIG_KVM_VMM_QEMU=y
3+
CONFIG_ARCH_ARM_64=y
4+
CONFIG_LIBVFSCORE=y
5+
CONFIG_LIBVFSCORE_AUTOMOUNT_UP=y
6+
CONFIG_LIBRAMFS=y
7+
CONFIG_LIBUKCPIO=y
8+
CONFIG_LIBDEVFS=y
9+
CONFIG_LIBDEVFS_AUTOMOUNT=y
10+
CONFIG_LIBDEVFS_DEVSTDOUT=y
11+
CONFIG_LIBUKNETDEV_EINFO_LIBPARAM=y
12+
CONFIG_ARM64_ERRATUM_858921=n
13+
CONFIG_ARM64_ERRATUM_835769=n
14+
CONFIG_ARM64_ERRATUM_843419=n

0 commit comments

Comments
 (0)