LinuxTips14

TurnToJPG -->


1. ubuntu20.04 use python2

Via:

$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

this solves some aosp building issues when the aosp building tree requires python2.7 to be the default python version.

2. ubports issue

via:

B ) Manual installation

#Open Ubuntu Touch terminal (or a shell session on your host computer) and run:

sudo -s
sudo mount -o remount,rw /
apt update
apt install waydroid -y
waydroid init 
ubports-qa install xenial_-_fixwindowreopen
alternatively, to install Google Apps, replace the line

waydroid init
with:

waydroid init -s GAPPS
#For Vollaphone, add:

waydroid prop set persist.waydroid.height_padding 70

3. lock/unlock bootloader

via:

fastboot flashing lock
fastboot flashing unlock

4. reflashing pixel 3a

visit https://flash.android.com/release/10.0.0.

5. flashing kernel module

via:

# disable-verity on the phone
adb root
adb disable-verity
adb shell sync
adb reboot

# push module
adb root
adb remount
adb push out/android-msm-pixel-4.9/dist/*.ko /vendor/lib/modules/
# 重启设备以后可以设备正常使用 查看内核版本 的确已经是自编译的内核
adb reboot

6. Disable oh-my-zsh upgrade

By adding following lines in ~/.zshrc :

+ DISABLE_UPDATE_PROMPT=true
+ DISABLE_AUTO_UPDATE=true
source $ZSH/oh-my-zsh.sh

7. Install chromium on mips64el

Via:

wget http://okapps.oukan.online/lroapps/deb-loongson/chromium-browser-beta_82.0.4051.0-1_mips64el.deb
wget http://ftp.us.debian.org/debian/pool/main/libi/libindicator/libindicator3-7_0.5.0-4_mips64el.deb
wget http://ftp.us.debian.org/debian/pool/main/liba/libappindicator/libappindicator3-1_0.4.92-7_mips64el.deb
apt-get install -y ./libappindicator3-1_0.4.92-7_mips64el.deb ./libindicator3-7_0.5.0-4_mips64el.deb
apt-get install -y ./chromium-browser-beta_82.0.4051.0-1_mips64el.deb

8. grub configuration(Ubuntu)

Changed back to origin kernel version:

# vim /etc/default/grub
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-99-generic"
# update-grub2
# update-grub
# reboot

9. Install docker-ce on arm64

First remove conflict packages and import gpg:

sudo apt-get remove docker docker-engine docker.io
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Then import repository and install docker-ce:

# vim /etc/apt/sources.list
....
deb [arch=arm64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal stable

# apt-get update && apt-get install -y docker-ce

10. run redroid with amd

Command:

$ sudo docker run -itd --name redroid9 --memory-swappiness=0 --privileged   -p 5556:5555 redroid/redroid:9.0.0-latest redroid.fps=60 ro.sf.lcd_density=150 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD128
$ sudo docker run -itd --name redroid12 --memory-swappiness=0 --privileged   -p 5555:5555 redroid/redroid:12.0.0-latest redroid.fps=120 ro.sf.lcd_density=240 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD128

Or with virtio:

sudo docker run -itd --name redroid9 --memory-swappiness=0 --privileged   -p 5555:5555 redroid/redroid:9.0.0-latest redroid.fps=120 ro.sf.lcd_density=240 redroid.width=1080 redroid.height=1920

11. opengl issue

via virgl issue:

https://archived.forum.manjaro.org/t/qemu-kvm-vm-in-virt-manager-is-running-with-a-black-screen-when-opengl-acceleration-is-turned-on/138632/8

12. content of rpm

via:

# rpm -ql {packageName}
# rpm -ql htop
# rpm -qlp /path/to/nginx.rpm

13. apt-fast

install via:

sudo add-apt-repository ppa:apt-fast/stable
sudo apt-get update
sudo apt-get -y install apt-fast

14. ubuntu device driver

Install via:

$ ubuntu-drivers devices

15. yum groupremove

via:

yum groupremove "X Window System"

16. linux-zen

In archlinux via:

# sudo pacman -S linux-zen linux-zen-headers

Then update the entry:

# vim /etc/default/grub
#GRUB_DEFAULT=0
GRUB_DEFAULT="Advanced options for Arch Linux>Arch Linux, with Linux linux-zen"
GRUB_TIMEOUT=3
# grub-mkconfig -o /boot/grub/grub.cfg
# reboot
# uname -a
Linux archsg1 5.16.14-zen1-1-zen #1 ZEN SMP PREEMPT Fri, 11 Mar 2022 17:40:33 +0000 x86_64 GNU/Linux

17. Build linux-zen

Steps:

$ sudo pacman -S base-devel asp
$ asp checkout linux-zen
Copy to some place, and modify the config
$ makepkg --clean --syncdeps --rmdeps

gpg checksum failed, solved via:

==> Verifying source file signatures with gpg...
    archlinux-linux git repo ... FAILED (unknown public key 3B94A80E50A477C7)
==> ERROR: One or more PGP signatures could not be verified!

# vim /etc/pacman.d/gnupg/gpg.conf
no-greeting
no-permission-warning
lock-never
keyserver-options timeout=10
keyserver-options import-clean
keyserver-options no-self-sigs-only
+ keyserver hkps://keys.openpgp.org

# curl -s https://keybase.io/heftig/pgp_keys.asc/\?fingerprint\=a2ff3a36aaa56654109064ab19802f8b0d70fc30 | gpg --import
# gpg --lsign 3B94A80E50A477C7

Rebuild the kernel and install

18. Change password in single

/images/2022_03_18_16_40_49_526x166.jpg

19. find which file belong to rpm

via:

$ rpm -qf file_name

20. linux-zen

Install on ubuntu via:

sudo add-apt-repository ppa:damentz/liquorix && sudo apt-get update
sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64

20. arp-ignore

arp-ignore should be studied

21. Install vmplayer

On Ubuntu or other linux distribution:

$ sudo apt install build-essential linux-headers-generic
$ wget --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0" https://www.vmware.com/go/getplayer-linux
$ chmod +x getplayer-linux
$ sudo ./getplayer-linux --required --eulas-agreed

22. Install mate(Ubuntu)

via:

# apt  install tasksel
# tasksel install ubuntu-mate-desktop

16. rpm2cpio

Generating the working tar.gz files Steps:

# cd workingdirectory/
# cp ../kmod-ukmd-4.19.112-20212.el7.centos.src.rpm .
# rpm2cpio kmod-ukmd-4.19.112-20212.el7.centos.src.rpm| cpio -idmv
#  vim kmod.spec
Change 4.19.112->4.19.12
# rm -f kmod-ukmd-4.19.112.tar.gz 
# cp /root/rpmbuild/SOURCES/kmod-ukmd-4.19.12.tar.gz .
# mv workingdirectory/ kmod-ukmd-4.19.12.cpio
# tar czvf kmod-ukmd-4.19.12.cpio.tar.gz kmod-ukmd-4.19.12.cpio

17. limit bandwidth

via:

https://unix.stackexchange.com/questions/34116/how-can-i-limit-the-bandwidth-used-by-a-process

18. amdgpu centos howto(5700)

Download the rpms from:

https://www.amd.com/en/support/graphics/amd-radeon-5700-series/amd-radeon-rx-5700-series/amd-radeon-rx-5700

Installation Steps:

yum localinstall ./amdgpu-install-21.50.2.50002-1.el7.noarch.rpm 
# change the repo definition to something like: baseurl=https://repo.radeon.com/amdgpu/21.50.2/rhel/7.9/main/x86_64
yumdownloader dkm
rpm -i --nodeps ./dkms-3.0.3-1.el7.noarch.rpm 
yum install gcc elfutils-libelf-devel
amdgpu-install -y --usecase=graphics
# Then install graphical desktop environment, then
systemctl set-default graphical.target

19. virgl On CentOS

Steps:

# yum -y groupinstall Development --skip-broken
# rpm -ivh /mnt/Packages/systemtap-3.3-3.el7.x86_64.rpm /mnt/Packages/systemtap-client-3.3-3.el7.x86_64.rpm /mnt/Packages/systemtap-devel-3.3-3.el7.x86_64.rpm --nodeps
# yum-builddep mesa
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# yum makecache 
# yum install -y meson

Then:

yum-builddep libvirt

20. amd driver in ubuntu

Get the deb and Install via:

sudo apt-get install ./amdgpu-install_21.50.2.50002-1_all.deb
dpkg --add-architecture i386
amdgpu-install -y --usecase=graphics

21. zen kernel in ubuntu

Install via:

sudo add-apt-repository ppa:damentz/liquorix && sudo apt-get update
64-bit:
sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64

22. convert vdi to img

via:

root@lucky:/home/dash# cd /home/dash/manjavoLinux/
root@lucky:/home/dash/manjavoLinux# VBoxManage clonehd --format RAW manjavoLinux.vdi manjaro.img
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'RAW'. UUID: 8187b47d-86bb-4156-9996-48e921a53e7

23. ssh push to github

via adding following to ~/.ssh/config:

Host github.com
        Hostname ssh.github.com
        Port 443

24. Disable gdm sleeping

via:

sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'

25. last crash log

via:

journalctl --since=today

26. check virt host

via:

# virt-host-validate qemu
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
WARN (Unknown if this platform has IOMMU support)
  QEMU: Checking for secure guest support                                    : WARN (Unknown if this platform has Secure Guest support)

27. file belongs to apk

via:

$ apt-file search filename

28. screenshot

via:

xwd -root -out screenshot.xwd

29. build ampere kernel

Steps:

unzip ampere-lts-kernel-linux-5.4.y.zip 
cd ampere-lts-kernel-linux-5.4.y/
cp arch/arm64/configs/altra_5.4_defconfig .config
make olddefconfig
make menuconfig
make -j128 deb-pkg LOCALVERSION=-amp54-lts

But the kernel boot failed and let the system hang.

30. virtio-gpu On Arm

Via following command:

DISPLAY=:61 qemu-system-aarch64  -M virt-4.2 -machine gic-version=max -m 15192M -enable-kvm -cpu host -smp 8,sockets=1,cores=8,threads=1   \
	-netdev user,id=vnet,hostfwd=:127.0.0.1:2278-:22,hostfwd=tcp::5555-:5555,hostfwd=tcp::5556-:5556,hostfwd=tcp::5557-:5557,hostfwd=tcp::5800-:5800,hostfwd=tcp::3389-:3389,hostfwd=tcp::14000-:4000 -device virtio-net-pci,netdev=vnet \
	-drive file=ubuntu-image.img,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -display gtk,gl=on  \
	-drive file=ubuntu-20.04.3-live-server-arm64.iso,if=none,id=drive1,cache=writeback -device virtio-blk,drive=drive1,bootindex=1 \
	-drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash  -vga none -device virtio-gpu-pci,virgl=on -usb  -device usb-ehci,id=ehci -device usb-mouse -device usb-kbd

31. Manually add pool

Via:

 virsh pool-create-as --name sda --type dir --target /media/sda/images

32. no-machine issue

Change the configuration then restart the service, needn’t confirm on logged session:

grep DesktopAuthorization /usr/NX/etc/server.cfg
sudo /etc/NX/nxserver --restart


33. centos 8 docker installation

via:

# dnf remove -y podman
# REPO=https://mirrors.aliyun.com/docker-ce
# dnf config-manager --add-repo $REPO/linux/centos/docker-ce.repo
# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
# yum update
# dnf install --allowerasing -y containerd.io docker-ce docker-ce-cli
# docker -v

34. before build aosp

via:

apt install openssh-server screen  git openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses-dev lib32readline-dev lib32z1-dev  liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev libtinfo5 libncurses5

35. Install golang for ubuntu20.04

via:

sudo add-apt-repository ppa:longsleep/golang-backports 
sudo apt update
sudo apt install golang-go

36. Ubuntu driver install

via:

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001287sv00001642sd00003F86bc03sc00i00
vendor   : NVIDIA Corporation
model    : GK208B [GeForce GT 730]
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-470 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin
$ sudo ubuntu-drivers autoinstall

37. cuttlefish render mode

via:

# launch_cvd --gpu-mode=drm_virgl
# launch_cvd --gpu-mode=gfxstream

38. forward to vm

via iptables:

# iptables -I FORWARD -o virbr1 -d 10.17.18.2 -j ACCEPT
# iptables -t nat -I PREROUTING -p tcp --dport 2422 -j DNAT --to 10.17.18.2:22

39. Recompile Ubuntu Linux

via:

Clone the repo:

 git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal
Checkout the branch:

 cd focal
 git checkout origin/hwe-5.8
If you want to disable the nvidia driver, add this patch:

diff --git a/debian/rules b/debian/rules
index 8c3c71a..8742713 100755
--- a/debian/rules
+++ b/debian/rules
@@ -100,6 +100,8 @@ ifeq ($(do_mainline_build),true)
        skipretpoline=true
 endif
 
+do_dkms_nvidia=false
+
 # Disable tools build and packaging if do_tools != true
 ifneq ($(do_tools),true)
        do_linux_tools=
Install the build dependencies:

 sudo apt-get build-dep linux
Build the kernel:

 fakeroot debian/rules clean
 fakeroot debian/rules binary-headers binary-generic

40. iptables forbid only one ip

only one ip to specific port running ss server via:

sudo iptables -I INPUT \! --src 121.8.254.210 -m tcp -p tcp --dport 1080 -j DROP

41. yarn issue

via:

sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
then

yarn install

42. efi grub issue

via:

#GRUB_DEFAULT=0
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.11.0-46-generic"
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

43. disable auto-update ubuntu

via:

# vim /etc/apt/apt.conf.d/20auto-upgrades
Change content:
FROM:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
TO:

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "1"

Then:

systemctl stop apt-daily.timer;systemctl disable apt-daily.timer ; systemctl stop apt-daily-upgrade.timer ; systemctl disable apt-daily-upgrade.timer; systemctl stop apt-daily.service;  systemctl mask apt-daily.service; systemctl daemon-reload
systemctl stop unattended-upgrades.service && systemctl disable unattended-upgrades.service

44. start redroid

command:

sudo docker run -itd --name redroid9 --memory-swappiness=0 --privileged   -p 5556:5555 redroid:9officialhoudini redroid.fps=120 ro.sf.lcd_density=240 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD128 ro.sf.lcd_density=240 redroid.width=1080 redroid.height=1920

45. Upgrade Kernel

In centos via:

# 查看可用内核版本及启动顺序
$ sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /boot/grub2/grub.cfg

# 查看启动顺序
$ yum install -y grub2-pc
$ grub2-editenv list

# 设置开机启动
$ grub2-set-default 0
或者
$ grub2-mkconfig -o /boot/grub2/grub.cfg

# 重启生效
$ reboot

# 重启后查看内核版本
$ uname -sr

46. print photos

via:

https://www.phoyosystem.com/photo-booth-software/#the-id-photos-printing-tool-only

47. untar deb

command:

mkdir tmp
dpkg-deb -R abcde.deb  tmp

48. linux-zen for ArchLinux

Build via:

# vim trunk/config
Added something.
# makepkg --skipinteg --syncdeps

Install via:

# sudo pacman -U linux-zen-5.19.zen1-1-x86_64.pkg.tar.zst linux-zen-headers-5.19.zen1-1-x86_64.pkg.tar.zst linux-zen-docs-5.19.zen1-1-x86_64.pkg.tar.zst
# sudo grub-mkconfig -o /boot/grub/grub.cfg
# sudo reboot

Verify its kernel version:

# uname -r

49. disable gdm sleep

via:

sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'

50. redroid 12 issue

on linux-zen kernel, 5.19, should enter the adb shell and run:

setprop sys.use_memfd 1

51. ArchLinux Configuration IP

via:

ip addr add 10.17.18.3/24 dev enp1s0
ip link set enp1s0 up
ip route add default via 10.17.18.1 dev enp1s0
Then set resolv.conf

52. ubuntu install zen kernel

via:

sudo add-apt-repository ppa:damentz/liquorix && sudo apt-get update
sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64

53. ipmi reset lan

via:

ipmitool raw 0x32 0x76 0x08

53. efi grub recover

Type normal after you insert following commands:

/images/2022_08_18_09_26_33_688x238.jpg

normal boot will get you into the normal boot:

/images/2022_08_18_09_27_08_815x579.jpg

54. Ubuntu vfio sg1

commands:

docker run -itd --name redroidkkk --memory-swappiness=0 --privileged   -p 5555:5555 redroid12:latest redroid.fps=120 ro.sf.lcd_density=240 redroid.width=1080 redroid.height=1920 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD128 androidboot.use_memfd=1

Upgrade ubuntu mesa drivers:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update
sudo apt upgrade

55. Build linux-zen

via:

sudo INSTALL_MOD_STRIP=1 CONCURRENCY_LEVEL=X fakeroot make-kpkg --initrd kernel_image kernel_headers -j 16

56. find pkg in archlinux

via:

# pacman -Fy
# pacman -F genfstab(get the pkg which provides genfstab)

57. qemu-nbd

via:

modprobe nbd max_part=8

Step 2 - Connect the QCOW2 as a network block device

qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2
Step 3 - List partitions inside the QCOW2

fdisk /dev/nbd0 -l
Step 4 - Mount the partition from the VM

mount /dev/nbd0p1 /mnt/somepoint/
You can also mount the filesystem with normal user permissions, ie. non-root:

mount /dev/nbd0p1 /mnt/somepoint -o uid=$UID,gid=$(id -g)
Step 5 - After you're done, unmount and disconnect

umount /mnt/somepoint/
qemu-nbd --disconnect /dev/nbd0
rmmod nbd

58. arm64 mesa upgrade

checked via:

# dpkg -l | grep -i mesa
ii  libegl-mesa0:arm64                            21.2.6-0ubuntu0.1~20.04.2             arm64        free implementation of the EGL API -- Mesa vendor library
ii  libgl1-mesa-dri:arm64                         21.2.6-0ubuntu0.1~20.04.2             arm64        free implementation of the OpenGL API -- DRI modules
ii  libglapi-mesa:arm64                           21.2.6-0ubuntu0.1~20.04.2             arm64        free implementation of the GL API -- shared library
ii  libglu1-mesa:arm64                            9.0.1-1build1                         arm64        Mesa OpenGL utility library (GLU)
ii  libglx-mesa0:arm64                            21.2.6-0ubuntu0.1~20.04.2             arm64        free implementation of the OpenGL API -- GLX vendor library
ii  mesa-utils                                    8.4.0-1build1                         arm64        Miscellaneous Mesa GL utilities
ii  mesa-va-drivers:arm64                         21.2.6-0ubuntu0.1~20.04.2             arm64        Mesa VA-API video acceleration drivers
ii  mesa-vdpau-drivers:arm64                      21.2.6-0ubuntu0.1~20.04.2             arm64        Mesa VDPAU video acceleration drivers
ii  mesa-vulkan-drivers:arm64                     21.2.6-0ubuntu0.1~20.04.2             arm64        Mesa Vulkan graphics drivers

Upgrade to oibaf:

59. print message of last boot

via:

 journalctl --boot=-1

60. new xorg configure

via:

Xorg -configure
cat /root/xorg.conf.new | grep -i busid

61. build glmark2 on centos7

Steps:

$ git clone https://github.com/glmark2/glmark2.git

$  INSTALL_APP ="epel-release centos-release-scl hwdata libX11 libX11-common libXau libXdamage libudev-devel \
libXext libXfixes libXxf86vm libdrm libjpeg-turbo libpciaccess libpng12 libxcb libxshmfence mesa-libEGL \
mesa-libGL mesa-libGLES mesa-libgbm mesa-libglapi libXmu-devel libXi-devel libGL-devel libjpeg-turbo-devel \
libpng12-devel mesa-libEGL-devel mesa-libGLES mesa-libgbm-devel mesa-libGLES-devel mesa-dri-drivers \
devtoolset-4-toolchain"

$  flag=1; for pkg in $INSTALL_APP; do echo "INFO: installing $flag package $pkg ..."; yum install -y "$pkg" &> /dev/null || echo -e "\tERROR: cannot install $pkg ...."; flag=$((flag+1)); done
$ PATH="/opt/rh/devtoolset-4/root/bin:$PATH"
$  ./waf configure --with-flavors="drm-gl,drm-glesv2,x11-gl,x11-glesv2"
$ ./waf  -v
$ ./waf install

$ glmark2
=======================================================
    glmark2 2017.07
=======================================================
    OpenGL Information
    GL_VENDOR:     Intel Open Source Technology Center
    GL_RENDERER:   Mesa DRI Intel(R) Haswell Mobile 
    GL_VERSION:    3.0 Mesa 17.0.1
=======================================================
[build] use-vbo=false: FPS: 2567 FrameTime: 0.390 ms
=======================================================
                                  glmark2 Score: 2567 
=======================================================

change the devtoolset-4 to devtoolsset-8.

62. nvidia-smi slow on ampere 1804

solved via:

sudo nvidia-persistenced --persistence-mode

63. minimum xorg

installed via:

apt install -y xserver-xorg-core

64. repo init aosp_master

via:

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b master
repo sync -j4

search the commit via somebody:

git log --author='intel.com' --all --grep='SRIOV'

66. lspci tree view

via:

$ lspci -tvv

67. disable lock in gnome

via:

Found couple of ways finally.
First method : is to run in terminal the command

gsettings set org.gnome.desktop.lockdown disable-lock-screen true
That should remove the lock option from the tray. And it can be re-ebabled using reset instead of set in the same command and removing true attribute

gsettings reset org.gnome.desktop.lockdown disable-lock-screen

68. android sdk on aarch64

Steps:

docker run -d -p 5901:5901 -p 2222:22 android-sdk:latest
c38e2d3b3a730b34dc40dc632aa5fa7c6cd32f0631c18d3a965671f1d8115aa1
root@feiteng:/home/ctctest# docker ps
CONTAINER ID   IMAGE                COMMAND                  CREATED         STATUS        PORTS                                                                                        NAMES
c38e2d3b3a73   android-sdk:latest   "/usr/bin/supervisord"   2 seconds ago   Up 1 second   5037/tcp, 0.0.0.0:5901->5901/tcp, :::5901->5901/tcp, 0.0.0.0:2222->22/tcp, :::2222->22/tcp   mystifying_sammet
root@feiteng:/home/ctctest# docker exec -it c38e2d3b3a73 bash
root@c38e2d3b3a73:/# JAVA_HOME=/usr/lib/jvm/java-1
java-1.11.0-openjdk-arm64/ java-11-openjdk-arm64/     
root@c38e2d3b3a73:/# JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64/
root@c38e2d3b3a73:/# sdkmanager
[=======================================] 100% Computing updates...             
root@c38e2d3b3a73:/# cd /opt/
android-sdk/         gradle/              kotlinc/             license_accepter.sh  
root@c38e2d3b3a73:/# cd /opt/android-sdk/
root@c38e2d3b3a73:/opt/android-sdk# ls
cmdline-tools  licenses
root@c38e2d3b3a73:/opt/android-sdk# sdkmanager  "platform-tools"
[=======================================] 100% Unzipping... platform-tools/lib64
root@c38e2d3b3a73:/opt/android-sdk# sdkmanager "platforms;android-31"
[=======================================] 100% Unzipping... android-12/framework

Copy from host to docker:  

root@feiteng:/home/ctctest/20220915# docker cp arm64-v8a c38e2d3b3a73:/opt/android-sdk/system-images/android-31/default && docker cp emulator c38e2d3b3a73:/opt/android-sdk/

More readable:

root@feiteng:/home/ctctest# docker run --name emukvm -d -p 5901:5901 -p 2222:22  --privileged android-sdk:latest
16369be79d70267f1546d0937dd23c1693339f88cc4562624fe5d38b63ead65b
root@feiteng:/home/ctctest# docker exec -it emukvm bash
root@16369be79d70:/# JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64/
root@16369be79d70:/# sdkmanager  "platform-tools"; sdkmanager "platforms;android-31"
[=======================================] 100% Unzipping... platform-tools/lib64
[=======================================] 100% Unzipping... android-12/framework
root@16369be79d70:/# mkdir -p /opt/android-sdk/system-images/android-31/default

宿主机拷贝相关文件到sdk目录下
docker cp arm64-v8a emukvm:/opt/android-sdk/system-images/android-31/default && docker cp emulator emukvm:/opt/android-sdk


root@16369be79d70:/#  emulator @test -no-audio -no-boot-anim -no-window -gpu swiftshader_indirect -qemu -cpu max -machine gic-version=max

root@16369be79d70:/#  adb shell

emulator64_arm64:/ $ getprop | grep boot | grep com                                                      
[dev.bootcomplete]: [1]
[sys.boot_completed]: [1]
[sys.bootstat.first_boot_completed]: [1]

For demo:

$ sudo docker load<android-sdk-vnc-preinstalled.tar
af52716c484c: Loading layer [==================================================>]   68.1MB/68.1MB
6deb56f0ac41: Loading layer [==================================================>]  6.656kB/6.656kB
2a1d4f03ee1e: Loading layer [==================================================>]  837.8MB/837.8MB
1e7efcf3f6fb: Loading layer [==================================================>]  128.8MB/128.8MB
8a505bac510d: Loading layer [==================================================>]   77.7MB/77.7MB
b9e87b8a4eac: Loading layer [==================================================>]  119.8MB/119.8MB
d51220053622: Loading layer [==================================================>]  4.096kB/4.096kB
59258b7d9f06: Loading layer [==================================================>]  5.632kB/5.632kB
4004735b3e24: Loading layer [==================================================>]  3.072kB/3.072kB
44761079232a: Loading layer [==================================================>]  4.096kB/4.096kB
e70a6e71fc4d: Loading layer [==================================================>]  10.75kB/10.75kB
57a11ab28048: Loading layer [==================================================>]  3.584kB/3.584kB
102d57c5928f: Loading layer [==================================================>]   2.56kB/2.56kB
ea5ffb5cc89c: Loading layer [==================================================>]  40.02MB/40.02MB
d6f2e48784b2: Loading layer [==================================================>]  3.584kB/3.584kB
6751e3b147f7: Loading layer [==================================================>]   2.56kB/2.56kB
28c073eff8d4: Loading layer [==================================================>]  3.584kB/3.584kB
6b084044ff11: Loading layer [==================================================>]  3.584kB/3.584kB
b35e2fb65592: Loading layer [==================================================>]  137.5MB/137.5MB
9fef29544a2a: Loading layer [==================================================>]  9.602GB/9.602GB
Loaded image: android-sdk-vnc-preinstalled:latest
$ sudo docker run --name emukvm -d -p 5901:5901 -p 2222:22  --privileged android-sdk-vnc-preinstalled:latest
5699cd1823fbf54457b844513f2a2a77e7f252afbd1e15bea2fda4cb50ca3d2a
$ sudo docker ps

69. remount in single user

via:

mount -o ro,remount /
Then you could do passwd or other staffs.