下载 ubuntu mono 字体:https://design.ubuntu.com/font
在系统中安装好字体后配置vs code中的font family,增加 “Ubuntu Mono“
下载 ubuntu mono 字体:https://design.ubuntu.com/font
在系统中安装好字体后配置vs code中的font family,增加 “Ubuntu Mono“
%USERPROFILE%\.wind\profiles\default.v10\terminal\session.config
{
"serial.baudRate" : "921600",
"session.dataType" : "text"
}
phytool read IFACE/ADDR/REG
phytool write IFACE/ADDR/REG <0-0xffff>
phytool print IFACE/ADDR[/REG]
Clause 22:
ADDR := <0-0x1f>
REG := <0-0x1f>
Clause 45 (not supported by all MDIO drivers):
ADDR := PORT:DEV
PORT := <0-0x1f>
DEV := <0-0x1f>
REG := <0-0xffff>
read
和write
命令是简单的寄存器级访问器。print
命令将漂亮地打印一个寄存器。使用print
命令时,寄存器是可选的。如果省略,将显示最常见的寄存器。
~ # phytool read eth4/0/4
0x0de1
~ # phytool print eth0/0
ieee-phy: id:0x01410eb1
ieee-phy: reg:BMCR(0x00) val:0x1140
flags: -reset -loopback +aneg-enable -power-down -isolate -aneg-restart -collision-test
speed: 1000-full
ieee-phy: reg:BMSR(0x01) val:0x7949
capabilities: -100-b4 +100-f +100-h +10-f +10-h -100-t2-f -100-t2-h
flags: +ext-status -aneg-complete -remote-fault +aneg-capable -link -jabber +ext-register
sudo apt-get install python3 python3-pip
pip3 install conan
source ~/.profile
以替换为中国科技大学为例
sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list
./
├── all
│ ├── conandata.yml
│ ├── conanfile.py
│ └── patches
│ └── 0001-fix-build-error-without-c++20.patch
├── build.sh
└── config.yml
from conan import ConanFile
from conan.tools.build import cross_building
from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain
from conan.tools.layout import basic_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, save
from conan.tools.microsoft import is_msvc
import os
required_conan_version = ">=2.0"
class live555Conan(ConanFile):
name = "live555"
# Optional metadata
license = "LGPL"
homepage = "http://live555.com/liveMedia/"
description = "libraries for standards-based RTP/RTCP/RTSP/SIP multimedia streaming, suitable for embedded and/or low-cost streaming applications"
url = "https://github.com/conan-io/conan-center-index"
topics = ("RTP", "RTCP", "RTSP", "SIP")
# Binary configuration
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}
# Sources are located in the same place as this recipe, copy them to the recipe
def export_sources(self):
export_conandata_patches(self)
def config_options(self):
if self.settings.os == "Windows":
self.options.rm_safe("fPIC")
def configure(self):
print("-- configure() --")
if self.options.shared:
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")
def layout(self):
basic_layout(self)
# set build folder to source folder in order to execute make in build()
self.folders.build = self.source_folder
# set generators folder to source folder in order to generate Makefile in generate()
self.folders.generators = self.source_folder
def requirements(self):
print("-- requirements() --")
self.requires("openssl/[>=1.1 <4]@thirdparty/stable")
# download source and copy to build forlder
def source(self):
print("-- source() --")
get(self, **self.conan_data["sources"][self.version], strip_root=True)
apply_conandata_patches(self)
def generate(self):
print("-- generate() --")
components = ["UsageEnvironment", "BasicUsageEnvironment", "groupsock", "liveMedia"]
for component in components:
self.run(f"chmod +w {component}/Makefile.tail")
replace_in_file(self, f"{component}/Makefile.tail", f"$(DESTDIR)$(PREFIX)/include/{component}", "$(DESTDIR)$(PREFIX)/include/")
if cross_building(self):
# add write permission for each config files
self.run("chmod +w config.*")
# for cross compile
replace_in_file(self, "config.armlinux", "CROSS_COMPILE?= arm-elf-", "CROSS_COMPILE= $(CROSS_COMPILE_PREFIX)")
replace_in_file(self, "config.armlinux", "CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1", "CPLUSPLUS_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) -Wall -DBSD=1")
replace_in_file(self, "config.armlinux", "LIBS_FOR_CONSOLE_APPLICATION = -lssl -lcrypto", "LIBS_FOR_CONSOLE_APPLICATION = $(LDFLAGS) -lssl -lcrypto -lz -ldl -lpthread -lrt")
save(self, "config.armlinux", "PREFIX = ", True)
if self.settings.arch == "x86_64":
self.run("./genMakefiles linux-64bit")
elif self.settings.arch == "armv8":
self.run("./genMakefiles armlinux")
else:
print(f"UNKNOWN arch:{self.settings.arch}")
return
env = VirtualBuildEnv(self)
env.generate()
tc = AutotoolsToolchain(self)
tc.generate()
td = AutotoolsDeps(self)
td.generate()
def build(self):
print("-- build() --")
# add execute permission for generated scripts
self.run("chmod +x conan*.sh deactivate*.sh")
self.run("./conanbuild.sh")
autotools = Autotools(self)
autotools.make()
self.run("./deactivate_conanbuild.sh")
def package(self):
print("-- package() --")
print("source_folder:", self.source_folder)
print("package_folder:", self.package_folder)
copy(self, "COPYING*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
self.run("./conanbuild.sh")
autotools = Autotools(self)
autotools.install()
self.run("./deactivate_conanbuild.sh")
@property
def _live555_components(self):
components = [
{"target": "UsageEnvironment", "lib": "UsageEnvironment", "requires": []},
{"target": "BasicUsageEnvironment", "lib": "BasicUsageEnvironment", "requires": []},
{"target": "groupsock", "lib": "groupsock", "requires": []},
{"target": "liveMedia", "lib": "liveMedia", "requires": []},
]
return components
def package_info(self):
version = self.version.split(".")
version = "".join(version) if self.settings.os == "Windows" else ""
debug = "d" if self.settings.build_type == "Debug" and is_msvc(self) else ""
def get_lib_name(module):
return module
def add_components(components):
for component in components:
conan_component = component["target"]
cmake_target = component["target"]
cmake_component = component["lib"]
lib_name = get_lib_name(component["lib"])
requires = component["requires"]
# TODO: we should also define COMPONENTS names of each target for find_package() but not possible yet in CMakeDeps
# see https://github.com/conan-io/conan/issues/10258
self.cpp_info.components[conan_component].set_property("cmake_target_name", cmake_target)
self.cpp_info.components[conan_component].libs = [lib_name]
self.cpp_info.components[conan_component].requires = requires
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.components[conan_component].system_libs = ["dl", "m", "pthread", "rt"]
self.cpp_info.set_property("cmake_file_name", "live555")
add_components(self._live555_components)
sources:
"2023.07.24":
url: "http://live555.com/liveMedia/public/live.2023.07.24.tar.gz"
sha1: "a56b6a79072d37f63d5e36828185e5efff7c99f8"
patches:
"2023.07.24":
- patch_file: "patches/0001-fix-build-error-without-c++20.patch"
patch_description: "fix build error while cross build without c++20 support"
patch_type: "portability"
#!/bin/bash
set -e
package_name=live555
package_version=2023.07.24
# libjpeg
conan create all/conanfile.py --name ${package_name} --version ${package_version} --user thirdparty --channel stable
conan upload -r conan-local --force --confirm ${package_name}/${package_version}@thirdparty/stable
打开wsl配置文件:
vi /etc/wsl.conf
新增如下内容:
[user]
default=YourName
sudo apt install language-pack-zh-hans
sudo dpkg-reconfigure locales #这一步要选择en_US.UTF-8和zh_CN.UTF-8, 并且en_US.UTF-8为默认语言
sudo apt install fontconfig
创建 /etc/fonts/local.conf 文件并添加以下内容
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/mnt/c/Windows/Fonts</dir>
</fontconfig>
fc-cache -f -v
wsl --shutdown
sudo apt install build-essential cmake git pkg-config libgtk-3-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
gfortran openexr libatlas-base-dev python3-dev python3-numpy \
libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev mlocate
https://github.com/opencv/opencv/releases
tar xzvf opencv-4.6.0.tar.gz
cd opencv-4.6.0
mkdir build
cd build
cmake -D OPENCV_GENERATE_PKGCONFIG=ON ..
make -j8
sudo make install
编译安装完成后使用pkg-config提示找不到opencv的错误
pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
原因是编译时缺少参数 -D OPENCV_GENERATE_PKGCONFIG=ON
重新安装后,更新一下数据库
sudo updatedb
再来试试
pkg-config --modversion opencv4
4.6.0
只需要执行下列三句话
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME