mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 12:38:11 +00:00
commit
431a60746d
@ -6,7 +6,7 @@ COPY cdefs.h /usr/include/sys/
|
|||||||
ADD kernel-headers.tar /
|
ADD kernel-headers.tar /
|
||||||
ADD kernel-dev.tar /
|
ADD kernel-dev.tar /
|
||||||
ADD kernel-modules.tar /
|
ADD kernel-modules.tar /
|
||||||
ADD 100-musl-compat.patch decl.patch intl.patch bcc-gnuism.patch ./
|
ADD 100-musl-compat.patch decl.patch intl.patch bcc-gnuism.patch bcc-stack-protector.patch ./
|
||||||
RUN cat elfutils-$ELFUTILS_VERSION.tar.bz2 | tar xjf -
|
RUN cat elfutils-$ELFUTILS_VERSION.tar.bz2 | tar xjf -
|
||||||
RUN cd elfutils-$ELFUTILS_VERSION && \
|
RUN cd elfutils-$ELFUTILS_VERSION && \
|
||||||
patch -p1 < ../100-musl-compat.patch && \
|
patch -p1 < ../100-musl-compat.patch && \
|
||||||
@ -15,9 +15,11 @@ RUN cd elfutils-$ELFUTILS_VERSION && \
|
|||||||
automake && \
|
automake && \
|
||||||
./configure --prefix=/usr CFLAGS=-Wno-strict-aliasing && \
|
./configure --prefix=/usr CFLAGS=-Wno-strict-aliasing && \
|
||||||
make -C libelf && make -C libelf install
|
make -C libelf && make -C libelf install
|
||||||
RUN cd bcc && patch -p0 < ../bcc-gnuism.patch
|
RUN cd bcc && patch -p0 < ../bcc-gnuism.patch && patch -p0 < ../bcc-stack-protector.patch
|
||||||
RUN mkdir -p bcc/build && cd bcc/build && \
|
RUN mkdir -p bcc/build && cd bcc/build && \
|
||||||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DLUAJIT_INCLUDE_DIR=/usr/include/luajit-2.1 && \
|
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DLUAJIT_INCLUDE_DIR=/usr/include/luajit-2.1 && \
|
||||||
make && \
|
make && \
|
||||||
make install
|
make install
|
||||||
RUN mkdir -p /usr/local/share/lua/5.1/ && cd ljsyscall && cp -a *.lua syscall /usr/local/share/lua/5.1/
|
RUN mkdir -p /usr/local/share/lua/5.1/ && cd ljsyscall && cp -a *.lua syscall /usr/local/share/lua/5.1/
|
||||||
|
|
||||||
|
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib64
|
||||||
|
@ -2,7 +2,7 @@ KERNEL_FILES=-C ../../kernel/x86_64 kernel-headers.tar kernel-dev.tar kernel-mod
|
|||||||
|
|
||||||
default: ebpf.tag
|
default: ebpf.tag
|
||||||
|
|
||||||
ebpf.tag: Dockerfile 100-musl-compat.patch bcc-gnuism.patch decl.patch intl.patch temp_failure.patch cdefs.h error.h
|
ebpf.tag: Dockerfile 100-musl-compat.patch bcc-gnuism.patch bcc-stack-protector.patch decl.patch intl.patch temp_failure.patch cdefs.h error.h
|
||||||
BUILD=$$( tar cf - $^ $(KERNEL_FILES) | docker build -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && \
|
BUILD=$$( tar cf - $^ $(KERNEL_FILES) | docker build -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && \
|
||||||
echo $$BUILD > $@
|
echo $$BUILD > $@
|
||||||
|
|
||||||
|
10
alpine/base/ebpf/bcc-stack-protector.patch
Normal file
10
alpine/base/ebpf/bcc-stack-protector.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- src/cc/frontends/clang/kbuild_helper.cc
|
||||||
|
+++ src/cc/frontends/clang/kbuild_helper.cc
|
||||||
|
@@ -89,6 +89,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector<string> *cflags) {
|
||||||
|
cflags->push_back("-D__HAVE_BUILTIN_BSWAP64__");
|
||||||
|
cflags->push_back("-Wno-unused-value");
|
||||||
|
cflags->push_back("-Wno-pointer-sign");
|
||||||
|
+ cflags->push_back("-fno-stack-protector");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -11,7 +11,12 @@ benchmarks etc.
|
|||||||
|
|
||||||
You probably want to run with
|
You probably want to run with
|
||||||
|
|
||||||
`docker run -it -v /sys/kernel/debug:/sys/kernel/debug --privileged mobylinux/ebpf:tag sh` for
|
`docker run -it -v /sys/kernel/debug:/sys/kernel/debug --privileged --pid=host mobylinux/ebpf:tag sh` for
|
||||||
interactive use as some things use debugfs. You need at least `CAP_SYS_ADMIN` to do anything.
|
interactive use as some things use debugfs. You need at least `CAP_SYS_ADMIN` to do anything.
|
||||||
There are examples in `bcc/examples` that should generally just work, I have tried several of
|
There are examples in `bcc/examples` that should generally just work, I have tried several of
|
||||||
the Lua ones.
|
the Lua ones.
|
||||||
|
|
||||||
|
Some of the `iovisor/bcc` samples try to access the kernel symbols. For them to work correctly you should also execute:
|
||||||
|
```sh
|
||||||
|
echo 0 > /proc/sys/kernel/kptr_restrict
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user