在以前的固件版本里,安装了Container Station之后,在Container Station的安装目录下/share/CACHEDEV1_DATA/.qpkg/container-station/usr/local/container-station/git/bin 就有git客户端,不知道从什么版本开始移除了。
参考:https://sdhuang32.github.io/install-git-on-qts/
创建两个脚本文件:
install-git-on-qts.sh
#!/bin/bash
BASE_DIR=$(dirname $0)
BUILD_SCRIPT_NAME="build-git.sh"
BUILD_SCRIPT="${BASE_DIR}/${BUILD_SCRIPT_NAME}"
if [ ! -d /share/Public/toolchain ]; then
mkdir /share/Public/toolchain
fi
if [ -z "$(system-docker ps | grep 'builder')" ]; then
system-docker run --name builder --privileged -v /share/Public/toolchain:/share/Public/toolchain -d sdhuang32/c7-systemd
fi
system-docker cp ${BUILD_SCRIPT} builder:/root/${BUILD_SCRIPT_NAME}
system-docker exec -t builder bash /root/${BUILD_SCRIPT_NAME}
if [ -z "$(cat /etc/profile | grep 'toolchain')" ]; then
echo "PATH=/share/Public/toolchain/bin:\$PATH" >> /etc/profile
fi
system-docker stop builder; system-docker rm builder
build-git.sh
#!/bin/bash
GIT_VERSION="2.23.0"
yum install -y gcc wget make curl-devel expat-devel \
gettext-devel openssl-devel perl-devel zlib-devel
cd ~
if [ ! -f git-${GIT_VERSION}.tar.gz ]; then
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz
fi
if [ -d git-${GIT_VERSION} ]; then
rm -rf git-${GIT_VERSION}
fi
tar zxvf git-${GIT_VERSION}.tar.gz
cd git-${GIT_VERSION}; ./configure --prefix=/share/Public/toolchain/
make all
make install
然后运行文件install-git-on-qts.sh
运行完毕之后,如果不报错,git会被安装到/share/Public/toolchain/下面