Optimize the script. #1
29
Loonggpu.sh
29
Loonggpu.sh
@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 检查是否为root用户,若非则使用sudo重新执行脚本
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
|
||||||
echo "请使用Root用户执行!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -v /tmp/loonggpu_install
|
|
||||||
|
|
||||||
cd /tmp/loonggpu_install
|
|
||||||
|
|
||||||
URL=https://git.whlug.cn/manxing/L2GI/releases/download
|
|
||||||
VER=v1.0.1
|
|
||||||
|
|
||||||
wget -q --show-progress ${URL}/${VER}/firmware-loongson-graphics_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
wget -q --show-progress ${URL}/${VER}/libldrm_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
wget -q --show-progress ${URL}/${VER}/libloong-gpucomp_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
wget -q --show-progress ${URL}/${VER}/loonggl_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
wget -q --show-progress ${URL}/${VER}/loonggpu-kernel-dkms_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
wget -q --show-progress ${URL}/${VER}/loonggpu-settings_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
wget -q --show-progress ${URL}/${VER}/xserver-xorg-video-loonggpu_1.0.1-alpha-lnd25.5_loong64.deb
|
|
||||||
# 使用apt安装缺失的头文件
|
|
||||||
apt-get install --yes linux-headers-6.12.25-loong64
|
|
||||||
|
|
||||||
# 使用apt安装所有包(自动处理依赖)
|
|
||||||
apt install --yes ./**.deb
|
|
||||||
|
|
||||||
rm -rvf /tmp/loonggpu_install
|
|
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
> 目前安装脚本仅在Debian系统中验证可用!
|
> 目前安装脚本仅在Debian系统中验证可用!
|
||||||
|
|
||||||
请在命令行中执行如下命令:
|
请在命令行中执行如下命令以下载并执行`自动安装脚本`:
|
||||||
`wget -q --show-progress https://git.whlug.cn/manxing/L2GI/raw/branch/master/Loonggpu.sh && bash Loonggpu.sh && rm Loonggpu.sh`
|
`wget -q --show-progress https://git.whlug.cn/manxing/L2GI/raw/branch/master/install_loonggpu.sh && bash install_loonggpu.sh`
|
||||||
|
35
install_loonggpu.sh
Normal file
35
install_loonggpu.sh
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
pwd_cp=$(pwd)
|
||||||
|
d_dir=${HOME}/Downloads
|
||||||
|
|
||||||
|
mkdir -v ${d_dir}
|
||||||
|
cd ${d_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;
|
||||||
|
|
||||||
|
sudo apt-get install --yes linux-headers-loong64
|
||||||
|
sudo dpkg --install ${loonggpu_pkgs[*]}
|
||||||
|
|
||||||
|
cd ${pwd_cp}
|
||||||
|
echo "Installation completed!"
|
||||||
|
echo "The downloaded packages were saved to ${d_dir} ."
|
||||||
|
# The end.
|
Reference in New Issue
Block a user