2022-01-17
- Copyright notice: original articles cannot be reproduced without the permission of the blogger
At the beginning of 3A5000, Godson turned to loongarch. Although the new architecture got rid of the historical burden, it also takes some time to accumulate ecology. In more than half a year, loongnix20 loongarch64 has made rapid progress. Today, Godson's binary translation can run familiar games such as angry birds and commonly used Windows software such as PhotoShop CS6, while the native (WEB) wechat and (third-party) qq also make efforts for the daily use of loongarch. The loongnix20 mips64el side is slightly bleak. I haven't received an update for several months, so I have to turn to Debian, which has greatly improved the cpu support of Godson 3A4000 and its predecessors.
last time As mentioned, we can use debootstrap to get a root file system and install our final Debian system based on it. Because the kernel is incompatible, we can also solve this problem by replacing the kernel package. However, it started from Fedora28 at that time. Now Fedora28 has withdrawn from the historical stage. We can start from Loongnix20 mips64el.
Since Loongnix20 itself is based on Debian10, there are some benefits from Loongnix20. I wanted to use it netboot It is said that this can be used normally, but I always load the kernel from the card, so I'd better simply and intuitively debootstrap.
For details about debootstrap, see Debian Wiki
Preparing the installation environment
Prepare LiveCD
The image of Loongnix20 can be viewed from here , download directly. The latest version is still rc2. Use Win32 Disk Imager perhaps dd command Write your favorite U SB flash drive.
If it is a machine before 3A4000, you may need to consider the compatibility of U SB flash disk. In addition, the machines before 3A3000 do not seem to be supported by Loongnix20. At this time, we need to reconsider the use Fedora28 , mate live 7.2 is recommended. The production method is the same.
Boot and install debootstrap
First, boot the LiveCD to the desktop.
Loongnix20
The address of the mirror station of Loongnix20 rc2 is wrong and the configuration needs to be changed manually.
First switch to the root user with the password loongnix:
$ su
Then edit sources list :
# vim /etc/apt/sources.list
Synchronize the image and install debootstrap:
# apt-get update # apt-get upgrade # apt-get install debootstrap
If you do not have a disk partitioning tool, you can install one:
# apt-get install gparted
Fedora28
Change the root password, which may be used later:
$ sudo passwd
Directly synchronize the image and install debootstrap:
$ sudo dnf upgrade $ sudo dnf install debootstrap
If you do not have a disk partitioning tool, you can install one:
$ sudo dnf install gparted
Prepare disk partition
Please complete the partition in advance with graphical tools such as gparted or more advanced and flexible command-line tools. The following is a relatively general partition example, in which / dev/sda1 is the boot partition, / dev/sda2 is the root directory, / dev/sda3 is the home directory and / dev/sda4 is the exchange partition:
# fdisk -l Disk /dev/sda: 447.13 GiB, 480103981056 bytes, 937703088 sectors Disk model: UNIC2 S100-480 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Device Start End Sectors Size Type /dev/sda1 34 2099199 2099166 1G EFI System /dev/sda2 2099200 211814399 209715200 100G Linux filesystem /dev/sda3 211814400 903874559 692060160 330G Linux filesystem /dev/sda4 903874560 937703054 33828495 16.1G Linux swap
The following operations are authorized to root:
$ su
The default password of LiveCD is usually loongson or loongnix. If the root password has been changed, the modified password will be used.
Mount partition:
# mkdir /mnt/debian-stable # mount /dev/sda2 /mnt/debian-stable # mkdir /mnt/debian-stable/boot # mkdir /mnt/debian-stable/home # mount /dev/sda3 /mnt/debian-stable/home # mount /dev/sda1 /mnt/debian-stable/boot
Install basic operating system
debootstrap
# debootstrap --arch mips64el stable /mnt/debian-stable http://ftp2.cn.debian.org/debian
Mount additional required directories
# mount --bind /sys /mnt/debian-stable/sys # mount --bind /proc /mnt/debian-stable/proc # mount --bind /dev /mnt/debian-stable/dev
Copy efi boot
Since we didn't find which package the EFI of Godson mips64el belongs to (loongarch64 belongs to grub-efi-loongarch64), we directly copy the binary in the / boot directory after the LiveCD is started to the / boot directory of the system to be installed.
Copy / boot except vmlinuz *, initrid ima* , System. Files other than map *, config - *:
# cp -r /boot/boot /mnt/debian-stable/boot/ # cp -r /boot/grub /mnt/debian-stable/boot/ # cp -r /boot/EFI /mnt/debian-stable/boot/ # cp /boot/boot.cfg /mnt/debian-stable/boot/ # cp /boot/grub.cfg /mnt/debian-stable/boot/ # cp /boot/grub.efi /mnt/debian-stable/boot/
chroot to the new root directory
# chroot /mnt/debian-stable /bin/bash
Set root password
# passwd root
Add non free source
Change / etc / apt / sources List, here is an example:
deb http://ftp2.cn.debian.org/debian stable main non-free
nano and vi text editors are installed by default.
In addition, the source of tuna for bullseye is copied and pasted here Full configuration:
# The source image is annotated by default to improve apt update speed. You can cancel the annotation if necessary deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
Verify the network and refresh the package cache
# ping debian.com # apt-get update
Installing grub2
# apt-get install grub-common
Install kernel
Debian's kernel can be used directly in theory, but after all kernel modules are installed, initrd If the IMG is too large, it will be out of memory or directly stuck during startup. Install according to the following method. By default, when the graphical interface is not installed, initrd IMG is about 25M (you can boot normally at this time), and 52M after installing the graphical interface. Therefore, we also install Loongnix20 kernel as a backup when the default kernel cannot be started.
Download and install the kernel package of Loongnix20 from the image of Loongnix20. If there is an updated one, please use the updated one:
# apt-get install wget # mkdir /home/tmp # cd /home/tmp # wget <loongnix kernel package link> # apt-get install ./<loongnix kernel package name>
Install Debian's default kernel:
# apt-get install linux-image-loongson-3
Install the drive. If it is amd display only, this step includes the display only driver:
# apt-get install firmware-linux-free firmware-linux-nonfree
Manually update the grub configuration, which will be automatically updated when installing the kernel:
# grub-mkconfig -o /boot/EFI/BOOT/grub.cfg
Configure fstab
Viewing UUIDs via blkid:
# blkid /dev/sda1: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" BLOCK_SIZE="4096" TYPE="ext3" PARTUUID="00000000-0000-0000-0000-000000000000" /dev/sda2: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="00000000-0000-0000-0000-000000000000" /dev/sda3: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="00000000-0000-0000-0000-000000000000" /dev/sda4: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" TYPE="swap" PARTUUID="00000000-0000-0000-0000-000000000000"
Configure fstab. Here is an example:
# UNCONFIGURED FSTAB FOR BASE SYSTEM UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX / ext4 defaults,noatime 0 1 UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /boot ext3 defaults,noatime 0 2 UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /home ext4 defaults,noatime 0 2 UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none swap defaults 0 0
Installing and configuring locale s
# apt-get install locales # nano /etc/locale.gen
Uncomment / etc / locale The locale required in Gen. here is an example:
en_US.UTF-8 UTF-8 zh_CN GB2312 zh_CN.GB18030 GB18030 zh_CN.UTF-8 UTF-8
Application:
# locale-gen
Configure default locale:
# nano /etc/locale.conf
Here is / etc / locale Chinese configuration of conf:
LANG=zh_CN.UTF-8
Configure hosts
View your hostname:
# cat /etc/hostname
If it is empty, the default hostname is localhost. Here, set the hostname as Loongson PC, and add a configuration in / etc/hosts:
127.0.1.1 loongnix-pc.localdomain loongnix-pc
Create a new user
Add a favorite user, and the - m option creates a default user directory for this user:
# useradd -m myuser
By default, the newly created user name is myuser.
Set the default shell for new users:
# usermod -s /bin/bash myuser
Set password:
# passwd myuser
Install sudo
# apt-get install sudo
Add the previously created new user to the sudo user group:
# usermod -a -G sudo myuser
Run visudo to see the default configuration, some of which are excerpted as follows:
# Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
You can see that the sudo user group is allowed to run sudo commands.
Restart the system
At this time, the installation of the basic operating system has been completed, and you can restart and enter the new Debian system.
In fact, it can also be installed in the chroot environment without restarting. Especially when wifi is used, the configuration on the command line interface is relatively complex. If you do not restart, just skip to the "installation graphical interface" section.
Exit chroot:
# exit
Restart:
# reboot
After restart, you will enter the login interface of the text command line. At this time, you can continue to log in with root or ordinary user.
Check the network after logging in.
Wired networking
dhcp needs to be run manually:
# dhclient
Wifi
You can use iwd with relatively simple configuration. Note that it depends on the 4.20 + kernel, that is, Loongnix20 kernel (4.19) can't be used.
# apt-get install iwd # systemctl start iwd.service # iwctl
Installation graphical interface
It will still default to root.
KDE Plasma out of the box
# apt-get install task-kde-desktop
Supporting software including sddm and liberoffice will be installed.
MATE desktop environment out of the box
# apt-get install task-mate-desktop
Supporting software including lightdm and liberoffice will be installed.
Simple KDE Plasma
If you don't want to install too many redundant built-in software, you can partially install it.
Plasma desktop and sddm are two basic packages, while plasma nm is network management:
# apt-get install plasma-desktop sddm plasma-nm
Here are some necessary software on plasma:
- dolphin default file manager
- Konsol default terminal simulator
- okular default document viewer
- ark default compression software
- KDE spectrum's default screenshot tool (of course, flameshot is also great)
- kate's default text editor (although usually kwrite)
- kcalc default small calculator
- Plasma Browser Integration Browser Integration (requires the browser to install a plug-in with the same name)
- phonon media control
Install all:
# apt-get install dolphin konsole ark kde-spectacle kate kcalc plasma-browser-integration
Phonon is installed by default. It has two back ends, vlc and gstreamer. Phonon4qt5 backend vlc is installed by default. If necessary, it can be replaced with phonon4qt5 backend gstreamer:
# apt-get install phonon4qt5-backend-gstreamer # apt-get remove phonon4qt5-backend-vlc
Note that there is at least one of them, so install first and then remove.
restart
If you have restarted once before, you can log in to the graphical interface by starting the corresponding login manager through systemctl.
If you are still in the chroot environment, you can exit the chroot environment and restart to the newly installed Debian according to the methods mentioned above. If successful, you should be able to directly enter the graphical interface and log in with ordinary users (not root users). If the default kernel cannot be started, please select Loongnix20 kernel in the grub interface.
Please complete the following contents in the graphical interface.
typewriting
Here we recommend fcitx5 and take KDE Plasma as an example. Other desktops can refer to it Wiki
Installing fcitx5
$ sudo apt-get fcitx5 fcitx5-pinyin kde-config-fcitx5 fcitx5-frontend-gtk2
kde-config-fcitx5 is a configuration program matched with KDE Plasma.
Except fcitx5-frontend-gtk2, other dependent packages should be installed by default.
Set default input method
Debian uses im config to configure the default input method. Im config relies on zenity and is not installed by default. You can see the relevant error messages when running im config on the terminal.
To install zenity:
$ sudo apt-get install zenity
Configure using IM config:
$ im-config
Select fcitx5.
Other topics
Debian also packs a theme:
$ sudo apt-get install fcitx5-material-color
Can from Upstream page Learn relevant information.
If there is a program that can't use input method
You can run the following command to help find the problem:
$ fcitx5-diagnose
browser
Godson browser
lbrowser v3 can be installed, but v2 cannot be installed (dependencies are not satisfied).
stay here Download the latest deb package for mips and install it manually.
Firefox
It can be used normally, and its performance is not as good as lbrowser.
$ sudo apt-get install firefox-esr
If there is amd alone, you can force the hardware acceleration to be turned on, otherwise it is difficult to use.
Force hardware acceleration
Open Firefox, type about:config in the address bar, and accept the warning.
according to Mozilla Wiki , search and modify the following settings and set them to true:
- webgl.force-enabled
- webgl.msaa-force
- layers.acceleration.force-enabled
The functions are: force enable WebGL, force enable WebGL anti aliasing, force enable hardware rendering (ignore blacklist / whitelist). Due to the existence of blacklist / whitelist, Firefox will render in software in most cases even if hardware acceleration is enabled in the setting.
Please restart Firefox after setting.
WebGL Aquarium Is a small test that can be used to compare the performance changes before and after forced hardware acceleration.
Hardware decoding
Note that the hardware decoding here mainly depends on the unique display of amd. The hard de dependent driver mesa vdpau drivers is usually installed by default.
ancient loongnix graphics card support list Attached here (there should be no reference value).
If there is no default installation:
$ sudo apt-get install mesa-vdpau-drivers
Install vdpauinfo and vainfo to view hardware codec information:
$ sudo apt-get install vdpauinfo vainfo $ vdpauinfo $ vainfo
Install radeontop to view the usage of the graphics card:
$ sudo apt-get install radeontop $ sudo radeontop
Video playback
vlc
$ sudo apt-get install vlc
smplayer
$ sudo apt-get install smplayer
Set hard solution
Find the General tab in settings, select Multimedia engine as mplayer in general, and select Output driver as vdpau in Video.
mpv
$ sudo apt-get install mpv
Music playing
audacious
$ sudo apt-get install audacious
NetEase cloud music
have access to netease-cloud-music-gtk , you can compile it yourself according to its readme, or you can download the one I compiled deb package.
This package cannot be used on loongnix20. If you need to use it on loongnix20, you can download it this.
Debian installation:
$ sudo apt-get install ./netease-cloud-music-gtk_1.2.2_mips64el.deb
Loongnix20 installation:
$ sudo apt-get install ./netease-cloud-music-gtk_1.2.2_lnd_mips64el.deb
install osdlyrics Support desktop lyrics:
$ sudo apt-get install osdlyrics
osdlyrics will fail to start due to the lack of dependent packages (curious about why they are missing). Install the missing dependent packages:
$ sudo apt-get install python3-chardet
Start Netease cloud music GTK, set to open desktop lyrics, and then start osdlyrics to display lyrics when playing music.
instant messaging
icalingua
icalingua Is a great third-party QQ based on Electron, now Support loongnix20 , it also works well in Debian.
The project hopes to build a session front-end framework for Linux and adapt various chat platforms by implementing the Adapter back-end interface. There are already oicq And the backend of Icalingua's own protocol
stay Project release Download the package of mips64el architecture. The latest version is 2.4.5. Select icalingua-2.4.5-mips64el tar. xz .
Extract and install it below. An example is provided later. Please modify it according to the actual situation.
Unzip and move to a custom location:
$ tar xvf ./icalingua-2.4.5-mips64el.tar.xz $ sudo mv ./icalingua-2.4.5-mips64el /opt/icalingua
In version 2.4.5, the binary position is / opt/icalingua/electron, and the icon position is / opt / icalingua / resources / APP / dist / electron / static / icons / 512x512 png .
The desktop icon will be established in / usr/local/share/applications /. If there is no such directory, you need to create it:
$ sudo mkdir /usr/local/share/applications $ sudo touch /usr/local/share/applications/icalingua.desktop
according to Author's guidance , you can get calingua The content of desktop is as follows:
[Desktop Entry] Categories=chat;Network; Exec=/opt/icalingua/electron %u Icon=/opt/icalingua/resources/app/dist/electron/static/icons/512x512.png Name=Icalingua Comment=A Linux client for QQ and more StartupNotify=true Terminal=false Type=Application
Now that the installation is complete, you can click the icon to use it.
If you need to uninstall, run the following command:
$ sudo rm /usr/local/share/applications/icalingua.desktop $ sudo rm -r /opt/icalingua
telegram
Install the telegraph desktop to sources Put the backports source in the list, and refer to the source of tuna Full configuration , because the version in main is too low to log in, you need to install the version of backports. Apt get install telegraph desktop directly. I don't know why I installed a lower version of main.
View all available versions:
$ apt-cache search telegram-desktop Package: telegram-desktop Version: 3.1.1+ds-1~bpo11+1 Installed-Size: 94864 Maintainer: Nicholas Guriev <guriev-ns@ya.ru> Architecture: mips64el ...ellipsis Package: telegram-desktop Version: 2.6.1+ds-1+deb11u1 Installed-Size: 86397 Maintainer: Nicholas Guriev <guriev-ns@ya.ru> Architecture: mips64el ...ellipsis
To view the output assumed above, please install a higher version, such as 3.1.1+ds-1~bpo11+1:
$ sudo apt-get install telegram-desktop=3.1.1+ds-1~bpo11+1
QQ for linux
linuxqq , you need it.
Office suite
I won't say more about this part, just wps.
Directly from Official website Download and install.
Suppose the downloaded installation package is WPS office_ 11.1.0.10702_ mips64el. deb :
$ sudo apt-get install ./wps-office_11.1.0.10702_mips64el.deb
You also need to install the missing fonts from here Download, double-click each file to install.
Partition tool
KDE Partition Manager
KDE Partition Manager KDE Plasma is the default partitioning tool.
$ sudo apt-get install partitionmanager
GNOME Partition Editor
GParted In fact, there's nothing to say. It should be the first graphical partitioning tool many people come into contact with on Linux.
$ sudo apt-get install gparted
Markdown editor
I don't know why there is no ghostwriter, so I can only introduce retext here. A concise editor, anyway, just a preview. kate could have previews, but this feature doesn't seem to be turned on.
$ sudo apt-get install retext
OBS Studio
It can be used normally and can be installed directly. Occasionally there is a fault in audio acquisition. I don't know how to solve it.
$ sudo apt-get install obs-studio
JetBrains family bucket
See Dog leftover Encyclopedia , I won't repeat it here.
by SDUST weilinfox