values;
33 | @@ -176,7 +177,7 @@ public class RedisClient extends DB {
34 | result.add(values);
35 | }
36 |
37 | - return Status.OK;
38 | + return Status.OK; */
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/modulefiles/httpd/orig:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict httpd
4 |
5 | set prefix /root/orbit/apps/httpd/rel-orig
6 |
7 | prepend-path PATH ${prefix}/bin
8 | prepend-path CPATH ${prefix}/include
9 | prepend-path C_INCLUDE_PATH ${prefix}/include
10 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
11 | prepend-path LIBRARY_PATH ${prefix}/lib
12 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
13 | #prepend-path MANPATH ${prefix}/man
14 |
--------------------------------------------------------------------------------
/modulefiles/httpd/proxy:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict httpd
4 |
5 | module load userlib/reuse
6 |
7 | set prefix /root/orbit/apps/httpd/rel-proxy
8 |
9 | prepend-path PATH ${prefix}/bin
10 | prepend-path CPATH ${prefix}/include
11 | prepend-path C_INCLUDE_PATH ${prefix}/include
12 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
13 | prepend-path LIBRARY_PATH ${prefix}/lib
14 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
15 | #prepend-path MANPATH ${prefix}/man
16 |
--------------------------------------------------------------------------------
/modulefiles/httpd/segfault:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict httpd
4 |
5 | set prefix /root/orbit/apps/httpd/rel-segfault
6 |
7 | prepend-path PATH ${prefix}/bin
8 | prepend-path CPATH ${prefix}/include
9 | prepend-path C_INCLUDE_PATH ${prefix}/include
10 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
11 | prepend-path LIBRARY_PATH ${prefix}/lib
12 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
13 | #prepend-path MANPATH ${prefix}/man
14 |
--------------------------------------------------------------------------------
/modulefiles/httpd/watchdog:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict httpd
4 |
5 | module load userlib/reuse
6 |
7 | set prefix /root/orbit/apps/httpd/rel-watchdog
8 |
9 | prepend-path PATH ${prefix}/bin
10 | prepend-path CPATH ${prefix}/include
11 | prepend-path C_INCLUDE_PATH ${prefix}/include
12 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
13 | prepend-path LIBRARY_PATH ${prefix}/lib
14 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
15 | #prepend-path MANPATH ${prefix}/man
16 |
--------------------------------------------------------------------------------
/modulefiles/httpd/watchdog-inject:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict httpd
4 |
5 | module load userlib/reuse
6 |
7 | set prefix /root/orbit/apps/httpd/rel-watchdog-inject
8 |
9 | prepend-path PATH ${prefix}/bin
10 | prepend-path CPATH ${prefix}/include
11 | prepend-path C_INCLUDE_PATH ${prefix}/include
12 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
13 | prepend-path LIBRARY_PATH ${prefix}/lib
14 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
15 | #prepend-path MANPATH ${prefix}/man
16 |
--------------------------------------------------------------------------------
/modulefiles/leveldb/orbit:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict leveldb
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/leveldb/rel-orbit
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/leveldb/orig:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict leveldb
4 |
5 | set prefix /root/orbit/apps/leveldb/rel-orig
6 |
7 | prepend-path PATH ${prefix}/bin
8 |
--------------------------------------------------------------------------------
/modulefiles/mysql/fork:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict mysql
4 |
5 | set prefix /root/orbit/apps/mysql/rel-fork/dist
6 |
7 | prepend-path PATH ${prefix}/bin
8 | prepend-path CPATH ${prefix}/include
9 | prepend-path C_INCLUDE_PATH ${prefix}/include
10 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
11 | prepend-path LIBRARY_PATH ${prefix}/lib
12 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
13 | #prepend-path MANPATH ${prefix}/man
14 |
--------------------------------------------------------------------------------
/modulefiles/mysql/orbit:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict mysql
4 |
5 | module load userlib/plain
6 |
7 | set prefix /root/orbit/apps/mysql/rel-orbit/dist
8 |
9 | prepend-path PATH ${prefix}/bin
10 | prepend-path CPATH ${prefix}/include
11 | prepend-path C_INCLUDE_PATH ${prefix}/include
12 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
13 | prepend-path LIBRARY_PATH ${prefix}/lib
14 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
15 | #prepend-path MANPATH ${prefix}/man
16 |
--------------------------------------------------------------------------------
/modulefiles/mysql/orig:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict mysql
4 |
5 | set prefix /root/orbit/apps/mysql/rel-orig/dist
6 |
7 | prepend-path PATH ${prefix}/bin
8 | prepend-path CPATH ${prefix}/include
9 | prepend-path C_INCLUDE_PATH ${prefix}/include
10 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
11 | prepend-path LIBRARY_PATH ${prefix}/lib
12 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
13 | #prepend-path MANPATH ${prefix}/man
14 |
--------------------------------------------------------------------------------
/modulefiles/mysql/sync:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict mysql
4 |
5 | module load userlib/plain
6 |
7 | set prefix /root/orbit/apps/mysql/rel-sync/dist
8 |
9 | prepend-path PATH ${prefix}/bin
10 | prepend-path CPATH ${prefix}/include
11 | prepend-path C_INCLUDE_PATH ${prefix}/include
12 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
13 | prepend-path LIBRARY_PATH ${prefix}/lib
14 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
15 | #prepend-path MANPATH ${prefix}/man
16 |
--------------------------------------------------------------------------------
/modulefiles/nginx/orbit:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict nginx
4 |
5 | module load userlib/reuse
6 |
7 | set prefix /root/orbit/apps/nginx/rel-orbit
8 |
9 | prepend-path PATH ${prefix}/sbin
10 |
--------------------------------------------------------------------------------
/modulefiles/nginx/orig:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict nginx
4 |
5 | set prefix /root/orbit/apps/nginx/rel-orig
6 |
7 | prepend-path PATH ${prefix}/sbin
8 |
--------------------------------------------------------------------------------
/modulefiles/nginx/segfault:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict nginx
4 |
5 | set prefix /root/orbit/apps/nginx/rel-segfault
6 |
7 | prepend-path PATH ${prefix}/sbin
8 |
--------------------------------------------------------------------------------
/modulefiles/redis/cpu-hog:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/redis/rel-cpu-hog
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/redis/memleak:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | set prefix /root/orbit/apps/redis/rel-memleak
6 |
7 | prepend-path PATH ${prefix}/bin
8 |
--------------------------------------------------------------------------------
/modulefiles/redis/oom:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/redis/rel-oom
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/redis/orig:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | set prefix /root/orbit/apps/redis/rel-orig
6 |
7 | prepend-path PATH ${prefix}/bin
8 |
--------------------------------------------------------------------------------
/modulefiles/redis/rdb:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/redis/rel-rdb
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/redis/rdb-fault:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/redis/rel-rdb-fault
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/redis/slowlog:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/redis/rel-slowlog
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/redis/slowlog-delay:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict redis
4 |
5 | module load userlib/dealloc
6 |
7 | set prefix /root/orbit/apps/redis/rel-slowlog-delay
8 |
9 | prepend-path PATH ${prefix}/bin
10 |
--------------------------------------------------------------------------------
/modulefiles/userlib/dealloc:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict userlib
4 |
5 | set prefix /root/orbit/userlib/build/rel-dealloc
6 |
7 | prepend-path CPATH ${prefix}/include
8 | prepend-path C_INCLUDE_PATH ${prefix}/include
9 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
10 | prepend-path LIBRARY_PATH ${prefix}/lib
11 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
12 |
--------------------------------------------------------------------------------
/modulefiles/userlib/plain:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict userlib
4 |
5 | set prefix /root/orbit/userlib/build/rel-plain
6 |
7 | prepend-path CPATH ${prefix}/include
8 | prepend-path C_INCLUDE_PATH ${prefix}/include
9 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
10 | prepend-path LIBRARY_PATH ${prefix}/lib
11 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
12 |
--------------------------------------------------------------------------------
/modulefiles/userlib/reuse:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict userlib
4 |
5 | set prefix /root/orbit/userlib/build/rel-reuse
6 |
7 | prepend-path CPATH ${prefix}/include
8 | prepend-path C_INCLUDE_PATH ${prefix}/include
9 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
10 | prepend-path LIBRARY_PATH ${prefix}/lib
11 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
12 |
--------------------------------------------------------------------------------
/modulefiles/varnish/orbit:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict varnish
4 |
5 | module load userlib/reuse
6 |
7 | set prefix /root/orbit/apps/varnish/rel-orbit
8 |
9 | prepend-path PATH ${prefix}/bin
10 | prepend-path PATH ${prefix}/sbin
11 | prepend-path CPATH ${prefix}/include
12 | prepend-path C_INCLUDE_PATH ${prefix}/include
13 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
14 | prepend-path LIBRARY_PATH ${prefix}/lib
15 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
16 | #prepend-path MANPATH ${prefix}/man
17 |
--------------------------------------------------------------------------------
/modulefiles/varnish/orig:
--------------------------------------------------------------------------------
1 | #%Module1.0
2 |
3 | conflict varnish
4 |
5 | set prefix /root/orbit/apps/varnish/rel-orig
6 |
7 | prepend-path PATH ${prefix}/bin
8 | prepend-path PATH ${prefix}/sbin
9 | prepend-path CPATH ${prefix}/include
10 | prepend-path C_INCLUDE_PATH ${prefix}/include
11 | prepend-path CPLUS_INCLUDE_PATH ${prefix}/include
12 | prepend-path LIBRARY_PATH ${prefix}/lib
13 | prepend-path LD_LIBRARY_PATH ${prefix}/lib
14 | #prepend-path MANPATH ${prefix}/man
15 |
--------------------------------------------------------------------------------
/patches/userlib_reuse.patch:
--------------------------------------------------------------------------------
1 | diff --git a/lib/src/orbit.c b/lib/src/orbit.c
2 | index 152ef19..db3462f 100644
3 | --- a/lib/src/orbit.c
4 | +++ b/lib/src/orbit.c
5 | @@ -593,7 +593,7 @@ int orbit_sendv(struct orbit_scratch *s)
6 | /* If the send is not successful, we do not call trunc(), and it is
7 | * safe to allocate a new scratch in the same area since we will
8 | * rewrite it later anyway. */
9 | - scratch_trunc(s);
10 | + // scratch_trunc(s);
11 |
12 | return ret;
13 | }
14 |
--------------------------------------------------------------------------------
/scripts/1k.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Welcome to nginx!
5 |
8 |
9 |
10 | Welcome to nginx!
11 | If you see this page, the nginx web server is successfully installed and
12 | working. Further configuration is required.
13 |
14 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
15 | incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
16 | nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
17 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
18 | fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
19 | culpa qui officia deserunt mollit anim id est laborum.
20 |
21 | For online documentation and support please refer to
22 | nginx.org.
23 | Commercial support is available at
24 | nginx.com.
25 |
26 | Thank you for using nginx.
27 |
28 |
29 |
--------------------------------------------------------------------------------
/scripts/alias.sh:
--------------------------------------------------------------------------------
1 | export __ORBIT_ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/../" &> /dev/null && pwd )
2 | export __ORBIT_IMAGE_FILE=$__ORBIT_ROOT_DIR/qemu-image.img
3 | export __ORBIT_MOUNT_DIR=$__ORBIT_ROOT_DIR/mount-point.dir
4 | function mount_qemu_image() {
5 | sudo mount -o loop $__ORBIT_IMAGE_FILE $__ORBIT_MOUNT_DIR && \
6 | sudo mount -o bind,ro /dev $__ORBIT_MOUNT_DIR/dev && \
7 | sudo mount -o bind,ro /dev/pts $__ORBIT_MOUNT_DIR/dev/pts && \
8 | sudo mount -t proc none $__ORBIT_MOUNT_DIR/proc
9 | }
10 | function unmount_qemu_image() {
11 | busy_process=$(sudo lsof | grep $__ORBIT_MOUNT_DIR | awk '{print($2)}')
12 | if [ ! -z "$busy_process" ]; then
13 | echo "Mount point $__ORBIT_MOUNT_DIR is busy."
14 | echo "Used by the following PID(s):"
15 | echo "$busy_process"
16 | echo "To unmount it, kill these processes or exit properly"
17 | echo "(e.g., 'cd' outside if you are inside the mount point)."
18 | return 1
19 | fi
20 |
21 | sudo umount $__ORBIT_MOUNT_DIR/dev/pts
22 | sudo umount $__ORBIT_MOUNT_DIR/dev
23 | sudo umount $__ORBIT_MOUNT_DIR/proc
24 | sudo umount $__ORBIT_MOUNT_DIR
25 | }
26 | # Mount/unmount disk image (do not mount if qemu is running)
27 | alias m='pgrep qemu && echo "QEMU is running (with pid above)" || mount_qemu_image'
28 | alias um=unmount_qemu_image
29 | # Chroot into mounted disk image
30 | # (`sudo' is used for setting $HOME and other variables correctly)
31 | alias ch='sudo -i chroot $__ORBIT_MOUNT_DIR'
32 | # Run the VM (fail if still mounted)
33 | alias r='um; (mount | grep $__ORBIT_MOUNT_DIR) || $__ORBIT_ROOT_DIR/scripts/run-kernel.sh'
34 | # Force kill QEMU
35 | alias k='killall qemu-system-x86_64'
36 |
--------------------------------------------------------------------------------
/scripts/build_compiler_support.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5 | cd $SCRIPT_DIR/../
6 |
7 | git submodule update --init --remote compiler
8 | cd compiler
9 | mkdir build
10 | cd build
11 | cmake ..
12 | make -j$(nproc)
13 |
--------------------------------------------------------------------------------
/scripts/build_kernel.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5 | cd $SCRIPT_DIR/../
6 |
7 | git submodule update --init --remote kernel
8 |
9 | cd kernel
10 | cp $SCRIPT_DIR/orbit.config kernel/configs/
11 | make x86_64_defconfig
12 | make kvm_guest.config
13 | make orbit.config
14 |
15 | git checkout 7139b41f
16 | make -j$(nproc)
17 | cp arch/x86/boot/bzImage bzImage-7139b41f
18 |
19 | git checkout ddcd247b
20 | make -j$(nproc)
21 | cp arch/x86/boot/bzImage bzImage-ddcd247b
22 |
--------------------------------------------------------------------------------
/scripts/build_userlib.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE-$0}")"/..; pwd)
5 |
6 | cd $ROOT_DIR
7 |
8 | git submodule update --init --remote userlib
9 |
10 | cd userlib
11 | mkdir -p build
12 | mkdir -p build/rel-{plain,dealloc,reuse}/{include,lib}
13 |
14 | function build {
15 | commit=$1
16 | target=$2
17 | patch=$3
18 |
19 | cd $ROOT_DIR/userlib
20 | git checkout $commit
21 | [ -n "$patch" ] && git apply $patch
22 |
23 | cd build
24 | cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
25 | make -j$(nproc)
26 |
27 | cd $ROOT_DIR/userlib
28 | # TODO: install script within cmake
29 | cp lib/include/orbit.h build/$target/include/
30 | cp build/lib/liborbit.so build/$target/lib/
31 | git checkout -- .
32 | }
33 |
34 | build b5ee3a2 rel-plain
35 | build b5ee3a2 rel-reuse $ROOT_DIR/patches/userlib_reuse.patch
36 | build c5770e9 rel-dealloc
37 |
--------------------------------------------------------------------------------
/scripts/fix-modulefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4 | cd $SCRIPT_DIR/../
5 |
6 | echo "Please also run:"
7 | echo " echo 'export MODULEPATH=$(pwd)/modulefiles' >> ~/.bashrc"
8 | echo "to setup the MODULEPATH environment."
9 |
10 | newroot=$(pwd | sed 's/\//\\\//g')
11 |
12 | for d in `ls modulefiles`; do
13 | for f in `ls modulefiles/$d`; do
14 | sed "s/\/root\/orbit/${newroot}/" -i modulefiles/$d/$f;
15 | done
16 | done
17 |
--------------------------------------------------------------------------------
/scripts/guest_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4 | cd $SCRIPT_DIR
5 |
6 | if [[ $(id -u) != 0 ]]; then
7 | echo Please run this script as root.
8 | exit 1
9 | fi
10 |
11 | apt update
12 | apt install -y xterm neovim git psmisc procps tmux cmake build-essential bison \
13 | libssl-dev libncurses5-dev pkg-config python3 zlib1g-dev curl cgroup-tools \
14 | automake autotools-dev libedit-dev libjemalloc-dev libncurses-dev \
15 | libpcre3-dev libtool libtool-bin python3-docutils python3-sphinx cpio \
16 | llvm-6.0 llvm-6.0-dev llvm-6.0-tools llvm-6.0-runtime llvm-6.0-doc \
17 | libllvm6.0 clang-6.0 clang-tools-6.0 clang-6.0-doc clang-format-6.0 \
18 | clang-tidy-6.0 libclang-6.0-dev libclang-common-6.0-dev libclang1-6.0 python-clang-6.0 lld-6.0 \
19 | maven environment-modules tclsh libcurl4-openssl-dev nginx python3-pip python3-pandas
20 |
21 | cp $SCRIPT_DIR/nginx-orbit-test /etc/nginx/sites-enabled/orbit-test
22 | systemctl disable nginx
23 | systemctl stop nginx
24 | mkdir -p /var/www/rep{1,2}
25 | cp $SCRIPT_DIR/1k.html /var/www/rep1/index.html
26 | cp $SCRIPT_DIR/1k.html /var/www/rep2/index.html
27 | echo "127.0.0.1 fe01 fe02 fe03" >> /etc/hosts
28 |
29 | echo '/dev/sda / ext4 errors=remount-ro,acl 0 1' > /etc/fstab
30 | passwd -d root
31 | echo 'resize > /dev/null 2>&1' >> ~/.bashrc
32 | echo 'if [[ $TMUX = "" ]]; then shutdown -h now; fi' > ~/.bash_logout
33 |
34 | # Varnish will set user to "nobody", and then it cannot see its header
35 | # installed in `/root`... Workaround for this:
36 | chmod 755 /root
37 |
--------------------------------------------------------------------------------
/scripts/mkimg.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4 | cd $SCRIPT_DIR/../
5 |
6 | IMG=qemu-image.img
7 | DIR=mount-point.dir
8 | qemu-img create $IMG 40G
9 | mkfs.ext4 $IMG
10 | mkdir $DIR
11 | sudo mount -o loop $IMG $DIR
12 | sudo debootstrap --arch amd64 buster $DIR
13 | sudo umount $DIR
14 |
--------------------------------------------------------------------------------
/scripts/nginx-orbit-test:
--------------------------------------------------------------------------------
1 | server {
2 | listen 1111;
3 | root /var/www/rep1;
4 | index index.html;
5 | }
6 | server {
7 | listen 1112;
8 | root /var/www/rep2;
9 | index index.html;
10 | }
11 |
--------------------------------------------------------------------------------
/scripts/orbit.config:
--------------------------------------------------------------------------------
1 | # CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION is not set
2 | # CONFIG_COMPACTION is not set
3 | # CONFIG_MIGRATION is not set
4 | # CONFIG_NUMA_BALANCING is not set
5 | CONFIG_MEMCG=y
6 | CONFIG_CFS_BANDWIDTH=y
7 |
--------------------------------------------------------------------------------
/scripts/run-kernel.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd $__ORBIT_ROOT_DIR
4 |
5 | if [[ $1 = '-d' ]]; then
6 | DBG='-s -S' # gdb debug options (port 1234; stop cpu)
7 | shift
8 | else
9 | DBG=
10 | fi
11 | # in gdb console, `break start_kernel`
12 |
13 | if [[ $1 = 'formysql' ]]; then
14 | image=kernel/bzImage-7139b41f
15 | elif [ -n "$1" ] && [[ $1 != 'formysql' ]]; then
16 | echo Unknown kernel version "\"$1\"".
17 | exit 1
18 | else
19 | image=kernel/bzImage-ddcd247b
20 | fi
21 |
22 | KVM=--enable-kvm
23 | #KVM=
24 |
25 | qemu-system-x86_64 -kernel $image \
26 | -hda qemu-image.img \
27 | -append "root=/dev/sda console=ttyS0 nokaslr cgroup_enable=memory loglevel=6" \
28 | ${DBG} \
29 | ${KVM} \
30 | -smp cores=4 -m 10G \
31 | -nographic
32 | #-serial stdio -display none
33 |
--------------------------------------------------------------------------------