From 28d2eab949eb30b40f14e6a323e0230dda8a15d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Fri, 28 Jun 2024 08:26:58 +0200 Subject: [PATCH 1/5] improvement: add rustup command check and suggests installing it if its required --- src/build_rust.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/build_rust.sh b/src/build_rust.sh index 41bab51b..b5008148 100755 --- a/src/build_rust.sh +++ b/src/build_rust.sh @@ -36,6 +36,18 @@ else echo "LLVM/clang found." fi +if ! rustup -V &> /dev/null +then + echo "rustup is not installed." + echo "Visit https://rustup.rs and install Rust from there" + echo "Usually, you can copy the following and follow the on-screen instructions." + echo "Please don't install Rust as root." + echo "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" + exit 1 +else + echo "rustup found." +fi + # To enable heavy debug mode (slow) #BUILD_FLAGS="" #TARGET=debug From 0adcfd93bbf7ba44ecb18d9c0adc73bfd75aee73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Fri, 28 Jun 2024 08:39:43 +0200 Subject: [PATCH 2/5] build_rust.sh - use apt instead of apt-get --- src/build_rust.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/build_rust.sh b/src/build_rust.sh index b5008148..c4f1095f 100755 --- a/src/build_rust.sh +++ b/src/build_rust.sh @@ -13,7 +13,7 @@ if ! bpftool help &> /dev/null then echo "bpftool is not installed." echo "Let's try to install it" - sudo apt-get install linux-tools-common linux-tools-`uname -r` + sudo apt install linux-tools-common linux-tools-`uname -r` else echo "bpftool found." fi @@ -22,7 +22,7 @@ if ! pkg-config --help &> /dev/null then echo "pkg-config is not installed." echo "Let's try to install it" - sudo apt-get install pkg-config + sudo apt install pkg-config else echo "pkg-config found." fi @@ -31,7 +31,7 @@ if ! clang -v &> /dev/null then echo "LLVM/clang is not installed." echo "Let's try to install it" - sudo apt-get install llvm libelf-dev gcc gcc-multilib libbpf-dev + sudo apt install llvm libelf-dev gcc gcc-multilib libbpf-dev else echo "LLVM/clang found." fi From 32a417327a7dcf7c812a7c766d10336b56eab074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Fri, 28 Jun 2024 08:40:35 +0200 Subject: [PATCH 3/5] build_rust.sh - libssl-dev is also required during compilation --- src/build_rust.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build_rust.sh b/src/build_rust.sh index c4f1095f..ff1d99ee 100755 --- a/src/build_rust.sh +++ b/src/build_rust.sh @@ -31,7 +31,7 @@ if ! clang -v &> /dev/null then echo "LLVM/clang is not installed." echo "Let's try to install it" - sudo apt install llvm libelf-dev gcc gcc-multilib libbpf-dev + sudo apt install llvm libelf-dev gcc gcc-multilib libbpf-dev libssl-dev else echo "LLVM/clang found." fi From 3ad129f8414994e1a03accbe01335532b65815dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Fri, 28 Jun 2024 09:04:14 +0000 Subject: [PATCH 4/5] build_rust.sh - make is required --- src/build_rust.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/build_rust.sh b/src/build_rust.sh index ff1d99ee..d951282b 100755 --- a/src/build_rust.sh +++ b/src/build_rust.sh @@ -18,6 +18,16 @@ else echo "bpftool found." fi +if ! make -v &> /dev/null +then + echo "make is not installed." + echo "Let's try to install it" + sudo apt install make +else + echo "make found." +fi + + if ! pkg-config --help &> /dev/null then echo "pkg-config is not installed." From a031719baf79ed7b13384fe49bec2581fa5b0aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20K=C5=82opotek=20-=20INTERDUO?= Date: Fri, 28 Jun 2024 09:48:20 +0000 Subject: [PATCH 5/5] build_rust.sh - lets simplyfy requirements --- src/build_rust.sh | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/src/build_rust.sh b/src/build_rust.sh index d951282b..109c27f5 100755 --- a/src/build_rust.sh +++ b/src/build_rust.sh @@ -9,42 +9,7 @@ # Don't forget to setup `/etc/lqos.conf` # Check Pre-Requisites -if ! bpftool help &> /dev/null -then - echo "bpftool is not installed." - echo "Let's try to install it" - sudo apt install linux-tools-common linux-tools-`uname -r` -else - echo "bpftool found." -fi - -if ! make -v &> /dev/null -then - echo "make is not installed." - echo "Let's try to install it" - sudo apt install make -else - echo "make found." -fi - - -if ! pkg-config --help &> /dev/null -then - echo "pkg-config is not installed." - echo "Let's try to install it" - sudo apt install pkg-config -else - echo "pkg-config found." -fi - -if ! clang -v &> /dev/null -then - echo "LLVM/clang is not installed." - echo "Let's try to install it" - sudo apt install llvm libelf-dev gcc gcc-multilib libbpf-dev libssl-dev -else - echo "LLVM/clang found." -fi +sudo apt install python3-pip clang gcc gcc-multilib llvm libelf-dev git nano graphviz curl screen llvm pkg-config linux-tools-common linux-tools-`uname -r` libbpf-dev libssl-dev if ! rustup -V &> /dev/null then