ALT Linux: KVM Backend for VirtualBox

$ sudo apt-get install chrpath doxygen libalsa-devel libcap-devel libcap-devel libdevmapper-devel libIDL-devel libopus-devel libpam0-devel libpulseaudio-devel libpulseaudio-devel libSDL-devel libvpx-devel libXcursor-devel libXinerama-devel libxml2-devel libXmu-devel libXrandr-devel make nasm  python3-dev texlive texlive-fonts-extra texlive-latex-extra unzip libstdc++6 libxslt-devel kernel-headers-common makeself subversion yasm zlib-devel glslang-devel libtpms-devel jwasm libcurl-devel libogg-devel libvorbis-devel liblzma-devel rpm-build libusb-compat-devel qt6-base-devel libstdc++-devel libstdc++-devel libstdc++-devel-static makeself libgsoap-devel libgsoap-devel-static libqt6-help qt6-declarative-devel qt6-tools-devel qt6-multimedia-devel qt6-svg-devel qt6-scxml-devel docbook-dtds i586-libstdc++6 i586-gcc libghttp-devel

# Download the VirtualBox 7.1.6 source package from Oracle.
$ tar xf VirtualBox-7.1.6a.tar.bz2
# Get project sources for 7.1.6
# wget https://github.com/cyberus-technology/virtualbox-kvm/archive/refs/tags/dev-20250207.tar.gz
# extract archive to vbox-kvm
$ cd VirtualBox-7.1.6
$ git init
$ git add *
$ git commit -m "VirtualBox vanilla code"
$ git am ../vbox-kvm/patches/*.patch
$ ./configure --with-kvm --disable-kmods --disable-docs --disable-hardening --disable-java
$ echo "__memset_chk" >> /home/ali/Build/VirtualBox-KVM/7.1.6a/VirtualBox-7.1.6/src/VBox/Additions/x11/undefined_xorg
$ sed -i '702s/CURLPROXY_HTTP/(curl_proxytype)CURLPROXY_HTTP/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '877s/CURLPROXY_HTTP/(curl_proxytype)CURLPROXY_HTTP/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '885s/CURLPROXY_HTTPS/(curl_proxytype)CURLPROXY_HTTPS/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '893s/CURLPROXY_SOCKS4/(curl_proxytype)CURLPROXY_SOCKS4/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '895s/CURLPROXY_SOCKS4A/(curl_proxytype)CURLPROXY_SOCKS4A/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '897s/CURLPROXY_SOCKS5/(curl_proxytype)CURLPROXY_SOCKS5/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '899s/CURLPROXY_SOCKS5_HOSTNAME/(curl_proxytype)CURLPROXY_SOCKS5_HOSTNAME/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '903s/CURLPROXY_HTTP/(curl_proxytype)CURLPROXY_HTTP/' src/VBox/Runtime/generic/http-curl.cpp
sed -i '2097s/CURLPROXY_HTTP/(curl_proxytype)CURLPROXY_HTTP/' src/VBox/Runtime/generic/http-curl.cpp
$ source ./env.sh
$ kmk

ALT Linux realtime kernel

https://www.altlinux.org/Kernel/build_unpackaged
https://www.altlinux.org/Kernel/getting_sources
https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/preemptrt_setup
https://wiki.linuxaudio.org/wiki/system_configuration

5.10:
git clone -n -o gears/std-def https://git.altlinux.org/gears/k/kernel-image-std-def.git linux-rt
git checkout tags/v5.10.192
xzcat ../patch-5.10.192-rt92.patch.xz | patch -p1

6.4:
git clone -n -o gears/un-def https://git.altlinux.org/gears/k/kernel-image-un-def.git linux-rt
git checkout tags/kernel-image-un-def-6.4.6-alt1
xzcat ../patch-6.4.6-rt8.patch.xz | patch -p1
make mrproper
scripts/kconfig/merge_config.sh -m config config-$HOSTTYPE config-std
make olddefconfig
Activate “Fully Preemptible Kernel (Real-Time)” option from “General setup” / “Preemption Model” then SAVE and EXIT.

Btrfs create snapshot and send | receive to backup

btrfs subvolume snapshot -r @astralinux @astralinux_ro
btrfs send /mnt/btrfs/@astralinux_ro | btrfs receive /mnt/flash
btrfs subvolume snapshot /mnt/flash/@astralinux_ro /mnt/flash/@astralinux
btrfs property set -f -ts /mnt/btrfs/@astralinux_ro ro false
btrfs property set -f -ts /mnt/flash/@astralinux_ro ro false
rm -rf /mnt/btrfs/@astralinux_ro
rm -rf /mnt/flash/@astralinux_ro

RSYNC — клонирование системы

rsync -vaHAXS --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/lost+found"} -e ssh root@192.168.x.x:/ /mnt

rsync -aHAXS SOURCE_DIR DESTINATION_DIR

-H, --hard-links      preserve hard links
-A, --acls            preserve ACLs (implies -p)
-X, --xattrs          preserve extended attributes
-S, --sparse          handle sparse files efficiently

OpenWrt links

https://openwrt.org/toh/tp-link/archer_c5_v4

Корневая файловая система на внешнем устройстве (extroot)

https://athunder.livejournal.com/646951.html

No icons in skrooge (ALT Linux)

sudo apt-get install qt5ct
sudo apt-get install icon-theme-breeze

Далее настроить тему в qt5ct

Cisco IOU on ALT Linux

https://linux-faq.ru/page/komanda-hostid

Нужно создать /etc/hostid -> genhostid.py

#!/usr/bin/python
 
from sys import argv, exit
from struct import pack
 
filename = "/etc/hostid"
 
if len(argv) != 2:
    print("Usage: genhostid.py <hostid>")
    exit(1)
 
if argv[1].startswith("0x"):
    hostid = int(argv[1][2:], 16)
else:
    hostid = int(argv[1])
 
hostid = pack("I", hostid)
open(filename,"wb").write(hostid)

$ sudo python genhostid.py 0x00010203

Далее CiscoIOUKeygen3f.py

pidof / killall in OpenBSD

# cat /sbin/pidof
#!/bin/sh
ps axc -o pid,command | awk "/`echo $1`/ {print \$1}"

# cat /sbin/killall
#!/bin/sh
kill `/sbin/pidof $1`

https://misc.openbsd.narkive.com/Bj3bNWTv/reason-against-pidof-killall

Бекап диска в Linux

Бекап:

sudo sh -c "dd if=/dev/nvme0n1 status=progress | xz -T0 -c > /mnt/Win10_21H2_Russian_x64.img.xz"

Восстановление:

sudo sh -c "xz -T0 -d -c /mnt/Win10_21H2_Russian_x64.img.xz | dd of=/dev/nvme0n1 status=progress"

Upgrade Ampache

https://github-wiki-see.page/m/ampache/ampache/wiki/Upgrade