Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd2f53f738 | |||
fba8dc8d9b | |||
6fbb7e2c75 | |||
dd61c0344b | |||
aae582498a | |||
5ca2d5785d | |||
cf68d32870 | |||
079bc11793 | |||
199f58d3f4 | |||
b01da940c8 |
44
Loonggpu.sh
44
Loonggpu.sh
@ -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
|
||||
|
||||
|
@ -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/master/install_loonggpu.sh && bash install_loonggpu.sh`
|
||||
|
37
install_loonggpu.sh
Normal file
37
install_loonggpu.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# 检查是否为root用户,若非请使用root用户重新执行脚本
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "请使用Root用户执行!"
|
||||
exit 1
|
||||
fi
|
||||
pwd_cp=$(pwd)
|
||||
tmp_dir=/tmp/Loonggpu
|
||||
mkdir ${tmp_dir}
|
||||
cd ${tmp_dir}
|
||||
|
||||
_URL="https://git.whlug.cn/manxing/L2GI/releases/download"
|
||||
VER="1.0.1"
|
||||
URL=${_URL}/v${VER}
|
||||
_VER="alpha"
|
||||
|
||||
loonggpu_pkgs=( \
|
||||
./firmware-loongson-graphics_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
./libldrm_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
./libloong-gpucomp_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
./loonggl_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
./loonggpu-kernel-dkms_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
./loonggpu-settings_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
./xserver-xorg-video-loonggpu_${VER}-${_VER}-lnd25.5_loong64.deb \
|
||||
)
|
||||
|
||||
for p in ${loonggpu_pkgs[@]};
|
||||
do
|
||||
wget -q --show-progress ${URL}/${p}
|
||||
done;
|
||||
|
||||
apt-get install --yes linux-headers-loong64
|
||||
apt install --yes ${loonggpu_pkgs[*]}
|
||||
|
||||
cd ${pwd_cp}
|
||||
echo "安装完成!"
|
||||
# The end.
|
Reference in New Issue
Block a user