16 Commits

Author SHA1 Message Date
6482964332 Update README.md 2025-08-18 09:53:51 +08:00
1497fb00ec Resolving the Conflict. 2025-08-11 15:14:52 +08:00
42b9c4d561 Update install_loonggpu.sh 2025-08-11 14:44:02 +08:00
81315d1192 Update README.md 2025-08-11 06:18:55 +08:00
168328d88a Update install_loonggpu.sh 2025-08-11 05:40:46 +08:00
977e6d54f7 Update install_loonggpu.sh 2025-08-11 05:36:21 +08:00
fd2f53f738 [更新]重命名变量 2025-05-30 10:22:30 +08:00
fba8dc8d9b [更新]将下载目录更改为tmp 2025-05-30 10:13:13 +08:00
6fbb7e2c75 【文本】优化文本输出 2025-05-22 17:10:27 +08:00
dd61c0344b 【更新】修改dpkg为apt安装 2025-05-22 17:00:22 +08:00
aae582498a Merge pull request 'Optimize the script.' (#1) from larryw3i/L2GI:master into master
Reviewed-on: manxing/L2GI#1
2025-05-21 14:39:00 +08:00
5ca2d5785d Optimize the script. 2025-05-21 11:17:19 +08:00
cf68d32870 [更新]脚本 2025-04-28 11:43:02 +08:00
079bc11793 [更新]添加脚本安装头文件 2025-04-27 15:29:46 +08:00
199f58d3f4 更新 README.md 2025-04-21 18:39:37 +08:00
b01da940c8 更新安装脚本 2025-04-21 18:35:49 +08:00
3 changed files with 35 additions and 46 deletions

View File

@ -1,44 +0,0 @@
#!/bin/bash
# 保存当前工作目录
original_dir=$(pwd)
# 检查是否为root用户,若非则使用sudo重新执行脚本
if [[ $EUID -ne 0 ]]; then
echo "检测到非root权限,正在通过sudo提升权限..."
exec sudo -E bash -c "cd \"$original_dir\" && \"$0\""
fi
# 确保切换到原目录(防止路径错误)
cd "$original_dir" || {
echo "无法切换至目录:$original_dir"
exit 1
}
# 启用nullglob以防止无匹配时的字面量输出
shopt -s nullglob
deb_packages=( ./*.deb )
shopt -u nullglob
echo "更新包管理器..."
if [ -x "$(command -v oma)" ]; then
sudo oma refresh
elif [ -x "$(command -v apt)" ]; then
sudo apt-get update
elif [ -x "$(command -v yum)" ]; then
sudo yum update
fi
echo "包管理器更新完毕"
# 检查是否存在.deb文件
if [[ ${#deb_packages[@]} -eq 0 ]]; then
echo "错误:当前目录下未找到任何.deb文件。"
exit 1
fi
echo "开始安装以下.deb包:"
printf ' - %s\n' "${deb_packages[@]##*/}" # 仅显示文件名,去除路径
# 使用apt安装所有包(自动处理依赖)
apt install --yes ./**.deb

View File

@ -1,2 +1,6 @@
请在命令行中执行如下命令:
wget -q --show-progress https://git.whlug.cn/manxing/LoongGPU && bash LoongGPU.sh
# 使用说明
> 目前安装脚本仅在Debian系统中验证可用!
请在命令行中执行如下命令以下载并执行`自动安装脚本`
`wget -q --show-progress https://git.whlug.cn/manxing/L2GI/raw/branch/test/install_loonggpu.sh && bash install_loonggpu.sh`

29
install_loonggpu.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
loongnix_url="https://pkg.loongnix.cn/loongnix/25"
packages_url="${loongnix_url}/dists/loongnix/main/binary-loong64/Packages.gz"
packages_file="Packages"
if [[ ! -f ${packages_file} ]]; then
wget -O ${packages_file}.gz ${packages_url}
gzip -d ${packages_file}.gz
fi
packages=($(
cat ${packages_file} |
grep Filename\: |
grep 'loonggpu\|loong\-gpu\|loonggl\|ldrm\|firmware\-loongson' |
cut -f2 -d " "
))
names=""
for p in ${packages[*]}; do
_name="$(echo ${p} | rev | cut -f1 -d "/" | rev)"
echo "Downloading ${_name} ..."
wget -O ${_name} "${loongnix_url}/${p}"
names="${_name} ${names}"
done
echo "Installing ${names} ..."
sudo dpkg -i ${names}
echo "Done!"
# The end.