Skip to content

Commit

Permalink
docs(deps): Update documentation regarding dependencies and Vagrantfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Oct 20, 2024
1 parent f5acd68 commit d5d67f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,23 @@
</details>


### 开发环境

源码目录:
开发环境如下:
* 系统:Ubuntu 22.04
* 依赖 (安装和配置方法详见 [CI](https://github.com/mozillazg/cloud-native-security-with-ebpf/blob/master/.github/workflows/build.yml) ,也可以使用 [Vagrant](https://www.vagrantup.com/) 一键创建开发环境):
* Go >= 1.21
* Clang/LLM 12
* libelf-dev
* zlib1g-dev
* libzstd-dev
* pkgconf
* make
* git
* linux-tools-common linux-tools-generic linux-tools-$(uname -r)
* build-essential

### 源码目录


| 章节 | 源代码 |
Expand Down Expand Up @@ -229,3 +244,4 @@
| 14.3 探测和审计恶意 eBPF 程序 | |
| 14.3.2 | [chapter14/inspect-ebpf-helpers](chapter14/inspect-ebpf-helpers) |
| 14.3.3 | [chapter14/check-helper-call](chapter14/check-helper-call) |

9 changes: 5 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ Vagrant.configure("2") do |config|
config.vm.box_version = "20220902.0.0"
config.vm.disk :disk, size: "20GB"
config.vm.synced_folder "../", "/home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf", create: true
config.ssh.extra_args = ["-t", "cd /home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf/chapter11; bash --login"]
config.ssh.extra_args = ["-t", "cd /home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf; bash --login"]
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end

# install dependencies
config.vm.provision "shell", inline: <<-SHELL
cd /home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf/chapter11
cd /home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf
sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
apt-get update
apt-get update
apt-get install --yes build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-$(uname -r)
apt-get install --yes build-essential pkgconf zlib1g-dev libelf-dev libzstd-dev llvm-12 clang-12 \
linux-tools-common linux-tools-generic linux-tools-$(uname -r)
for tool in "clang" "llc" "llvm-strip"
do
path=$(which $tool-12)
ln -s -f $path ${path%-*}
done
snap install go --channel=1.18/stable --classic
snap install go --channel=1.21/stable --classic
chown vagrant -R /home/vagrant/go/
grep GOPROXY /home/vagrant/.bashrc || \
echo 'export GOPROXY=https://goproxy.cn,direct' >> /home/vagrant/.bashrc
Expand Down

0 comments on commit d5d67f2

Please sign in to comment.