Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bc9b1288a | |||
| 3399456f48 | |||
| 4cd7d0453d |
@@ -9,7 +9,7 @@ on:
|
||||
env:
|
||||
DOCKER_BUILDKIT: "1"
|
||||
PRODUCT_NAME: "xxxigcc"
|
||||
PACKAGE_VERSION: "3.4.8-xg1"
|
||||
PACKAGE_VERSION: "3.4.9-xg1"
|
||||
BUILDX_NO_DEFAULT_ATTESTATIONS: "1"
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -34,10 +34,10 @@ sudo apt-get install xxxigcc
|
||||
|
||||
```bash
|
||||
# 1. 下载对应架构的包
|
||||
wget https://gitea.bcde.io/releases/download/3.4.8-xg1/xxxigcc-amd64-ubuntu-3.4.8-xg1.tar.gz
|
||||
wget https://gitea.bcde.io/releases/download/3.4.9-xg1/xxxigcc-amd64-ubuntu-3.4.9-xg1.tar.gz
|
||||
|
||||
# 2. 解压
|
||||
tar -xzf xxxigcc-amd64-ubuntu-3.4.8-xg1.tar.gz
|
||||
tar -xzf xxxigcc-amd64-ubuntu-3.4.9-xg1.tar.gz
|
||||
cd xxxigcc
|
||||
|
||||
# 3. 编辑配置文件
|
||||
|
||||
2
debian/build-deb.sh
vendored
2
debian/build-deb.sh
vendored
@@ -4,7 +4,7 @@ set -e
|
||||
# 参数检查
|
||||
if [ $# -ne 3 ]; then
|
||||
echo "Usage: $0 <ARCH> <VERSION> <TARGZ_FILE>"
|
||||
echo "Example: $0 amd64 3.4.8-xg1 xxxigcc-amd64-ubuntu-3.4.8-xg1.tar.gz"
|
||||
echo "Example: $0 amd64 3.4.9-xg1 xxxigcc-amd64-ubuntu-3.4.9-xg1.tar.gz"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
2
debian/xxxigcc-daemon.service
vendored
2
debian/xxxigcc-daemon.service
vendored
@@ -33,6 +33,8 @@ SyslogIdentifier=xxxigcc-daemon
|
||||
|
||||
# 资源限制
|
||||
LimitNOFILE=65535
|
||||
LimitMEMLOCK=infinity
|
||||
AmbientCapabilities=CAP_IPC_LOCK
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -53,8 +53,9 @@ get_arch() {
|
||||
|
||||
# 添加 APT 源并更新
|
||||
add_apt_repository() {
|
||||
echo "deb [trusted=yes] https://${GITEA_SERVER}/api/packages/${GITEA_OWNER}/debian stable main" \
|
||||
>/etc/apt/sources.list.d/xxxigcc.list
|
||||
curl https://${GITEA_SERVER}/api/packages/${GITEA_OWNER}/debian/repository.key -o /etc/apt/keyrings/gitea-${GITEA_OWNER}.asc
|
||||
echo "deb [signed-by=/etc/apt/keyrings/gitea-${GITEA_OWNER}.asc] https://${GITEA_SERVER}/api/packages/${GITEA_OWNER}/debian stable main" \
|
||||
>/etc/apt/sources.list.d/${GITEA_OWNER}.list
|
||||
apt-get update -qq
|
||||
}
|
||||
|
||||
@@ -100,6 +101,16 @@ configure_cpu_rx() {
|
||||
jq ".cpu.$field = [ $rx_array ]" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||
}
|
||||
|
||||
# 配置大页内存
|
||||
configure_hugepages() {
|
||||
if [[ "$one_gb_pages" == "true" ]]; then
|
||||
log "$BLUE" "配置 大页内存..."
|
||||
sysctl -w vm.nr_hugepages=3072
|
||||
echo "vm.nr_hugepages=3072" >>/etc/sysctl.conf
|
||||
log "$GREEN" "大页内存配置完成"
|
||||
fi
|
||||
}
|
||||
|
||||
# 更新配置文件
|
||||
replace_config() {
|
||||
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
||||
@@ -136,6 +147,7 @@ replace_config() {
|
||||
|
||||
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||
configure_cpu_rx
|
||||
configure_hugepages
|
||||
}
|
||||
|
||||
show_usage() {
|
||||
|
||||
@@ -108,6 +108,16 @@ configure_cpu_rx() {
|
||||
jq ".cpu.$field = [ $rx_array ]" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||
}
|
||||
|
||||
# 配置大页内存
|
||||
configure_hugepages() {
|
||||
if [[ "$one_gb_pages" == "true" ]]; then
|
||||
log "$BLUE" "配置 大页内存..."
|
||||
sysctl -w vm.nr_hugepages=3072
|
||||
echo "vm.nr_hugepages=3072" >>/etc/sysctl.conf
|
||||
log "$GREEN" "大页内存配置完成"
|
||||
fi
|
||||
}
|
||||
|
||||
# 更新配置文件
|
||||
replace_config() {
|
||||
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
||||
@@ -144,6 +154,7 @@ replace_config() {
|
||||
|
||||
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||
configure_cpu_rx
|
||||
configure_hugepages
|
||||
}
|
||||
|
||||
# 创建并启动服务
|
||||
|
||||
Reference in New Issue
Block a user