From c48b47daf87e85bdd347647a580e152f744d25e4 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sat, 15 Nov 2025 02:34:06 +0800
Subject: [PATCH] Add tools

---
 tools/setup_systools.sh |   72 ++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/tools/setup_systools.sh b/tools/setup_systools.sh
new file mode 100755
index 0000000..6ef04a3
--- /dev/null
+++ b/tools/setup_systools.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# display in red
+function pr_error() {
+	echo ""
+    echo -e "\033[40;31m --E-- $1 \033[0m"
+	echo ""
+}
+
+# display in yellow
+function pr_warn() {
+	echo ""
+    echo -e "\033[40;33m --W-- $1 \033[0m"
+	echo ""
+}
+
+# display in green
+function pr_info() {
+	echo ""
+    echo -e "\033[40;32m --I-- $1 \033[0m"
+	echo ""
+}
+
+function update_source()
+{
+    APT_FILE=/etc/apt/sources.list
+
+    pr_warn "start update apt source to ustc"
+
+    if [ ! -f $APT_FILE.orig ] ; then
+       mv $APT_FILE $APT_FILE.orig
+    fi
+
+cat > $APT_FILE <<EOF
+deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ bullseye main contrib non-free rpi
+deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ bullseye main contrib non-free rpi
+EOF
+}
+
+function apt_update()
+{
+    pr_warn "start update apt updata and upgrade"
+
+    apt update
+    apt upgrade -y
+    apt autoremove -y
+}
+
+function apt_install()
+{
+    pr_warn "start apt install system tools"
+
+    apt install -y make vim gawk wget curl unzip sed tree coreutils diffstat git subversion \
+    groff lzop make gcc g++ libtool automake autoconf autoconf-archive flex texinfo bison \
+    build-essential libelf-dev lrzsz
+
+    # apt-cache policy libssl-dev
+    apt install -y libssl-dev=1.1.1n-0+deb11u1 libssl1.1
+}
+
+if [ `id -u` != 0 ] ; then
+    pr_error "This shell script must run as root."
+	exit 1;
+fi
+
+update_source
+
+apt_update
+
+apt_install
+
+

--
Gitblit v1.9.1