zoukankan      html  css  js  c++  java
  • IT日常日志:系统配置与库编译

    1.Windows10系统安装与配置

    1.1 Win10安装配置(Uboot制定)

    1.相关链接

    Windows10 vm: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines

    Windows10 pre: https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewadvanced

    Windows10 ver: BuildXXX.YYYY、VersionYearMonth、YearH1、YearH2,H=HalfYear

    VS installation: https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2019

    WSL changelog: https://docs.microsoft.com/en-us/windows/wsl/release-notes

    WSL instruction: https://docs.microsoft.com/en-us/windows/wsl/reference

    ROS2 guidance: https://github.com/ros2/ros2

    vcredist all links: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

    suitesparse-metis-for-windows: https://github.com/jlblancoc/suitesparse-metis-for-windows

    2.下载VS:C:vs_enterprise.exe

    --layout C:VS2019Ent

    --lang en-US

    --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended

    --add Microsoft.VisualStudio.Workload.NativeCrossPlat;includeRecommended;includeOptional

    --add Microsoft.Component.PythonTools;includeRecommended

    --verify

    --fix

    3.安装VS:断网后双击C:VS2019Entvs_setup.exe安装

    4..启用功能

    SMB: SMB 1.0/CIFS File Sharing Support

    SMB Direct

    NFS Service

    Telnet Client

    Telnet Server

    OpenSSH Client

    OpenSSH Server

    FTP Server

    Virtual Machine Platform

    Windows subsystem for Linux

    Optional: Hyper-V && Windows sandbox

    5.重要软件

    (1)Base+Docker

    (2)Foxy+Gazebo

    (3)Nav2+TB3

    (4)[Webots+WebotsROS2]

    (5)CudaToolkit

    1.EFI启动概要

    (1)主干启动流程:主板固件加载EFI文件àEFI文件加载配置文件à配置文件加载内核文件

    (2)加载EFI文件

             1)默认加载EFI:/esp/efi/boot/bootx64.efi、可由任何系统的efi或自定义的efi重命名得到

             2)其它路径EFI:由第三方工具(如bootice)添加其它路径的efi到UEFI启动管理器、或先加载能启动efi的efi(如uefishell.efi)再由此efi启动其它路径的efi

             1)WindowsEFI:/esp/efi/microsoft/boot/bootmgrfw.efi、此文件可复制到其它地方(因为其指向的启动配置文件使用的是绝对路径)且为方便管理可复制到/esp/efi/boot

             2)UbuntuEFI:/esp/efi/ubuntu/shimx64.efi&&grubx64.efi、此两文件可复制到其它地方(因为其指向的启动配置文件使用的是绝对路径)且为方便管理可复制到/esp/efi/boot

    (3)加载配置文件

             Win10OS:/esp/efi/microsoft/boot/bootmgrfw.efi                              à/esp/efi/microsoft/boot/bcd&&others

             UbuntuOS:/esp/efi/ubuntu/grubx64.efi                                             à/esp/efi/ubuntu/grub.cfgà/boot/grub/grub.cfg&&x86_x64-efi&&others

             Win10ISO:/iso/efi/boot/bootx64.efi                                                   à/iso/boot/bcd&&&boot.sdi&&others

             UbuntuISO:/iso/efi/boot/bootx64.efi                                                 à/iso/boot/grub/grub.cfg&&x86_x64-efi&&others

             ClonezillaISOUbuntuISO

     (4)加载内核文件:不同的启动配置文件,其指向的系统核心文件不同

    2.EFI启动盘制作

    (1)操作原理:基于EFI启动原理可知将操作系统或安装盘复的相应的文件到esp分区即可,以下操作基于已经安装操作系统进行

    (2)对Win10:复制/esp/efi/microsoft/boot/*/iso/boot/boot.sdi(用于WinPE)到/esp/efi/microsoft/boot、编辑/esp/efi/microsoft/boot/bcd添加Win10OS和Win10PE

    (3)对Ubuntu:复制/esp/efi/ubuntu/*/boot/grub/*/esp/efi/ubuntu、编辑/esp/efi/ubuntu/grub.cfg添加UbuntuOS和UbuntuCD

    (3)对Ubuntu:grub-install --efi-directory=/mnt/sdx/A --boot-directory=/mnt/sdx/B --removable /dev/sdx、前者自动创建/mnt/sdx/A/efi/boot&ubuntu、后者自动创建/mnt/sdx/B/grub、复制/mnt/sdx/A/efi/ubuntu/*和/mnt/sdx/B/grub/*到/esp/efi/ubuntu、编辑/esp/efi/ubuntu/grub.cfg添加UbuntuOS和UbuntuCD

    (4)添加rEFInd:复制refindXXX/refind/drivers_x64&&tools_x64&&refind.conf-sample&&icons/esp/efi/refind、重命名配置文件为refind.conf并配置启动项

    ▲:若引导UbuntuCD不成功则可将/usr/lib/syslinux/memdisk到/esp/efi/ubuntu/grub再尝试

    ▲:grub2可启动ubuntuOS、ubuntuCD、efiFile,BCD可启动winOS、winPE.wim、winos.vhd、efiFile

    ▲:更改Grub默认值编辑/etc/default/grub、增加Grub入口编辑/etc/grub.d/40_custom、执行update-grub后将更新到/boot/grub/grub.cfg

    3.第三方启动盘AIO(all in one)

    主页: https://www.aioboot.com/en/ && https://github.com/nguyentumine/AIO-Boot

    使用:https://www.aioboot.com/en/install-grub2-from-windows  && https://www.aioboot.com/en/ubuntu-bootable-usb/

    1.2 WSL2安装配置(Ubuntu配置)

    1.Basic操作

    下载UbuntuXXX:MSStore下载并备份到期望位置后卸载之

    安装UbuntuXXX:命令导入install.tar.gz(避免新建用户)或运行EXE正规安装

    配置WinTerminal:命令行为wsl.exe -d ubuntuxxx -u root

    快速访问LinuxWLS:文件浏览器\wsl$

    安装盘启动ISO先执行:sudo umount -l /isodevice

    gedit /etc/apt/source.list

    apt-get update

    apt-get upgrade

    apt-get install -d minicom squashfs-tools-ng gparted

    apt-get install -d openbsd-inetd telnetd net-tools

    apt-get install -d openssh-server openssh-client

    apt-get install -d samba samba-common smbclient cifs-utils

    apt-get install -d nfs-kernel-server nfs-common rpcbind

    apt-get install -d vsftpd ftp

    apt-get install -d git git-core apache2 apache2-utils

    apt-get install -d cmake cmake-qt-gui python3 python3-vcstool python3-colcon-common-extensions

    apt-get install -d synaptic bleachbit ubuntu-restricted-extras guvcview ffmpeg libssh-dev

    apt-get install -d qtcreator qtbase5-dev libqt5opengl5-dev libqt5serialport5-dev libqt5sensors5-dev

    apt-get install -d libqt5charts5-dev libqt5datavisualization5-dev libqt5x11extras5-dev

    apt-get install -d qtmultimedia5-dev qtdeclarative5-dev qtpositioning5-dev

    apt-get install -d ninja-build rsync zip#VS

    apt-get install -d xfce4 xfce4-terminal#WSL

    apt-get install -d xrdp dconf-editor gdm3 lightdm barrier#PC

    apt-get install -d fcitx fcitx-table-wbpy#PC、配置输入系统为fcitx五笔拼音且提示安装

    安装bcompare&vscode:apt-get install ./xxx.deb 这里点杠很重要#PC、其它语言支持时选否

    安装dockerhttps://docs.docker.com/engine/install/ubuntu #PC

    apt-get install apt-transport-https  ca-certificates  curl  gnupg-agent software-properties-common

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    apt-key fingerprint 0EBFCD88

    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

    apt-get update

    apt-get install docker-ce docker-ce-cli containerd.io

    安装timeshifthttps://github.com/teejee2008/timeshift #PC

    sudo add-apt-repository -y ppa:teejee2008/timeshift

    sudo apt-get update

    sudo apt-get install timeshift

    安装systembackhttps://github.com/BluewhaleRobot/systemback #PC

    sudo sh -c 'echo "deb [arch=amd64] http://mirrors.bwbot.org/ stable main" > /etc/apt/sources.list.d/systemback.list'

    sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 7D9C279F

    sudo apt-get update

    sudo apt-get install systemback

    由于systemback本身bug需在重装后先如下操作再重启(具体软链接与系统版本相关)

    rm -r bin sbin lib lib32 lib64 libx32

    ln -s usr/bin bin & ln -s usr/sbin sbin & ln -s usr/lib lib & ln -s usr/lib32 lib32 & ln -s usr/lib64 lib64

    恢复时要将/boot/efi安装到某分区(安装后再删除该分区即可)才能正确地安装/boot

    选择BleachBit:除FreeDiskSpace和Memory处的所有选项

    apt-get clean: 清理所有安装包

    apt-get autoclean: 清理已被卸载的软件的安装包

    apt-get autoremove: 删除系统认为不再使用的孤立软件

    apt-get remove --purge softname: 卸载指定软件且删除配置

    在/root下建立:app(用于安装相关软件)、start.sh(添加所有启动项)

    2.配置Telnet

    vim /etc/inetd.conf

    vim /etc/pam.d/login #注释auth requisite pam_nologin.so以允许root登录

    /etc/init.d/openbsd-inetd restart

    netstat -a | grep telnet #display{tcp…telnet…}

    连接命令telnet ip

    3. 配置SSH

    vim /etc/ssh/sshd_config

    dpkg-reconfigure openssh-server

    /etc/init.d/ssh restart

    ps -e |grep ssh   #display{…sshd}

    连接命令ssh username@ip

    连接失败检查是否需要删除缓存:C:UsersAdministrator.ssh

    4. 配置Samba

    vim /etc/samba/smb.conf

    smbpasswd -a root

    /etc/init.d/smbd restart

    smbclient -L ip -N

    mount -t cifs -o username=root,password=aaron //ip/sharedPath localPath

    umount localPath

    #windows10: \ip in Explorer

    #clear cache: net use * /del /y

    5. 配置NFS

    vim /etc/exports

    /etc/init.d/rpcbind restart

    /etc/init.d/nfs-kernel-server restart

    showmount -e ip

    mount -t nfs -o nolock ip:/sharedPath localPath

    umount localPath

    #Window10

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftClientForNFSCurrentVersionDefault

    create AnonymousUid QWORD 0

    create AnonymousGid QWORD 0

    reboot windows

    mount -o nolock \ipsharedPath driveName:

    umount driveName:

    6. 配置FTP

    vim /etc/vsftpd.conf

    vim /etc/ftpusers应无root和其它期望用于登录的本地账户

    vim /etc/vsftpd.chroot_list应有root和其它可跨自主目录的本地用户

    /etc/init.d/vsftpd restart

    命令访问ftp ip 或文件浏览器访问ftp://ip

    7.安装foxy&noetic&gazebo11&tb3&cartographer&nav2安装ROS1是为兼容第三方库

    apt-get install ros-foxy-desktop ros-noetic-desktop-full ros-foxy-ros1-bridge ros-foxy-move-base-msgs

    apt-get install gazebo11 ros-foxy-gazebo-ros-pkgs ros-noetic-gazebo-ros-pkgs

    apt-get install ros-foxy-turtlebot3* ros-foxy-cartographer* ros-foxy-navigation2 ros-foxy-nav2-bringup

    安装tb3sim:当前只能https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/手动编译

    可下载https://github.com/osrf/gazebo_modelshttp://models.gazebosim.org/置于/root/.gazebo

    8.安装webots&webots_ros2&nvidia&cuda

    apt-get install ./webots_xxx_amd64.deb

    apt-get install ros-foxy-webots-ros2* ros-noetic-webots-ros

    查看推荐:ubuntu-drivers devices

    查看安装:nvidia-smi

    切换显卡:nvidia-settings

    查看当前:settings->about

    apt-get install -d nvidia-driver-xxx  #installation after system backup

    apt-get install -d nvidia-cuda-toolkit #nvcc --version

    9.检测并安装常用开发库

    (1)便携库:eigen3、gflags、glog、ceres、spdlog

    (2)基本库:qt5、opencv

    (3)大型库:ros2、webots

    (4)扩展库:octomap&octovis&dynamicEDT

    (5)Python库:opencv-contrib-python、PyQt5、PyQtChart、PyQtDataVisualization

             查看CV版本:import cv2 à cv2.__version__

             查看QT版本:import PyQt5.Qt as Qt à Qt.PYQT_VERSION_STR

    (6)链接失败:ln -sf /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld

    PC:启用root账户

    sudo passwd root 设置密码

    /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf追加greeter-show-manual-login=true

    /etc/pam.d/gdm-autologin注释auth required pam_succeed_if.so user!= root quiet_success

    /etc/pam.d/gdm-password注释auth required pam_succeed_if.so user!= root quiet_success

    /root/.profile注释mesg n 2> /dev/null || true追加tty -s && mesg n || true

    PC:启用root声音

    终端执行(临时)或/root/.profile追加(永久):pulseaudio --start --log-target=syslog

    设置启动菜单:/etc/default/grub设置GRUB_TIMEOUT&STYLE=menu&30、终端update-grub

    PC:启用远程桌面

    1)setting->sharing->ScreenSharing&RemoteLogin: ActiveWithEthernet&&On

    2)apt install xrdp dconf-editor synaptic bleachbit

    3)dconf-editor->org->gnome->desktop->remote-access: uncheck require-encryption

    4)ufw allow 3389 5900

    5)查看显管:cat /etc/X11/default-display-manager或systemctl status display-manager

    6)切换显管:dpkg-reconfigure gdm3/lightdm/sddm

    7)Barrier设置屏幕名:AaronUPC

    PC:docker相关配置

    配源:vim /etc/docker/daemon.json: {"registry-mirrors": ["http://hub-mirror.c.163.com"]}

    重启:systemctl restart docker.service #系统转移设备后需删除/var/lib/docker后重启才可用

    GUI界面:https://www.portainer.io/installation

             docker pull portainer/portainer-ce

             mkdir /root/PortainerCE

             docker run -d -p 9000:9000 -h PortainerPC--name=PortainerPC --restart=always

                      -v /var/run/docker.sock:/var/run/docker.sock

                      -v /root/PortainerCE:/data portainer/portainer-ce

             Browser: http://localhost:9000

    ROS镜像: https://github.com/osrf/docker_images

             docker pull osrf/ros:foxy-ros1-bridge

             docker pull osrf/ros:noetic-desktop-full-focal

             docker pull osrf/ros:foxy-desktop

    其它镜像:

    WSL:配置xfce4

    Win10启动XLaunch(设置防火墙允许其通过)

    echo "export DISPLAY=winIP:0.0" >> ~/.bashrc

    source ~/.bashrc

    startxfce4

    1./etc/apt/sources.list重写

    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

     

    2./etc/inetd.conf应有

    telnet stream tcp nowait telnetd /usr/sbin/tcpd  /usr/sbin/in.telnetd

    3./etc/ssh/sshd_config设置

    PermitRootLogin yes

    PasswordAuthentication yes

     

    4./etc/samba/smb.conf追加

    [root]

    comment = root directory

    path = /root

    writeable = yes

    browseable = yes

    valid users = root

    [ubuntu]

    comment = system directory

    path = /

    writeable = yes

    browseable = yes

    valid users = root

    5./etc/exports追加

    /root *(insecure,rw,sync,no_subtree_check,no_root_squash)

    / *(insecure,rw,sync,no_subtree_check,no_root_squash)

    #*: 所有能ping到的主机可挂载

    #192.168.0.*: 指定网段的主机可挂载

    #192.168.1.12: 仅此主机能挂载

    #ro/rw:只读/读写

    #sync:同步

    #no_root_squash: 不降低root用户的权限

    6./etc/vsftpd.conf查找如下项并设值

    local_enable=YES#允许本地用户登录

    write_enable=YES#允许上传

    local_umask=000#操作权限无限制

    chroot_local_user=YES#限制本地用户在自主目录

    chroot_list_enable=YES#使指定本地用户可跨自主目录

    chroot_list_file=/etc/vsftpd.chroot_list #可跨自主目录的本地用户

    ftp>help [cmd]                  ftp>quit                        ftp>status

    ftp>dir [dir]                       ftp>ls                           ftp>verbose

    ftp>pwd                            ftp>cd dir0                   ftp>lcd [dir1]

    ftp>delete file                    ftp>rename src dst

    ftp>mkdir dir                    ftp>rmdir dirname

    ftp>get file0 [file1]            ftp>put file1 [file0]

     

    7.测试tb3&cartographer&nav2

    (1)公共环境设置

             export TURTLEBOT3_MODEL=burger或waffle或waffle_pi

             export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:

                       /root/app/ros2ex/tb3sim/turtlebot3_gazebo/models

             source /root/app/ros2ex/out/install/setup.bash &&  source /usr/share/gazebo/setup.sh

    (2)测试tb3sim基于tb3PKG

             ros2 launch turtlebot3_gazebo empty_world.launch.py

             ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

             ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py

    (3)测试cartographer基于tb3PKG

             ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

             ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True

             ros2 run turtlebot3_teleop teleop_keyboard

             ros2 run nav2_map_server map_saver_cli -f /root/app/map

    (4)测试nav2基于tb3PKG

             ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

             复制/opt/ros/foxy/share/nav2_bringup/launch/bringup_launch.py

                       为/opt/ros/foxy/share/nav2_bringup/launch/nav2_bringup_launch.py

             ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True

                       map:=/opt/ros/foxy/share/turtlebot3_navigation2/map/map.yaml

    (5)测试nav2基于nav2PKG

    8.测试ros2webots

    (1)测试EPuck

             配置:source /opt/ros/foxy/setup.bash

             启动:ros2 launch webots_ros2_epuck robot_launch.py

             速控:ros2 topic pub --once  /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.1, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"

             建图:ros2 launch webots_ros2_epuck robot_tools_launch.py rviz:=true mapper:=true

             导航:ros2 launch webots_ros2_epuck robot_tools_launch.py rviz:=true nav:=true

    (2)测试Turtlebot3

             配置:source /opt/ros/foxy/setup.bash && export TURTLEBOT3_MODEL=burger

             启动:ros2 launch webots_ros2_turtlebot robot_launch.py

             建图导航:参见官网

    1.3 ROS2安装配置(Python配置)

    1.安装ROS2-Core

    (1)下载并解压ROS2XXX到D:app os2

    (2)基于D:app os2Scriptsxxx.py安装相应的Python版本到相应的路径并追加Path

    (3)安装OpenSSL到D:app os2openssl并添加OPENSSL_CONF和追加Path

    (4)编译OpenCV到D:appopencv并添加OpenCV_DIR和追加Path

    (5)安装辅助工具:git、cmake、bcompare

    2.安装ROS2-Choco依赖

    预设置:set ChocolateyInstall=D:app os2choco   #先设置此变量再安装chocolatey

    下载包:choco download ???

    安装包:choco install -y -s D: mp asio cunit tinyxml-usestl tinyxml2 log4cxx bullet curl

    3.安装ROS2-Python依赖

    预安装:安装Python到~ os2scripts*.py中指定的位置

    下载包:python -m pip download catkin_pkg cryptography empy ifcfg lark-parser lxml netifaces numpy opencv-contrib-python pyparsing pyyaml setuptools pydot PyQt5 PyQtChart PyQtDataVisualization vcstool colcon-common-extensions transforms3d -d D: mp

    安装包:python -m pip install --prefix=D:app os2python --no-index --find-links=D: mp catkin_pkg cryptography empy ifcfg lark-parser lxml netifaces numpy opencv-contrib-python pyparsing pyyaml setuptools pydot PyQt5 PyQtChart PyQtDataVisualization vcstool colcon-common-extensions transforms3d

    4.测试并配置ROS2配置参见lib.doc

    call D:app os2setup.bat 或 参见lib.doc中内省工具调用配置

    ros2 run demo_nodes_cpp talker

    ros2 run demo_nodes_py listener

    5.安装并配置Webots:安装到D:appwebots、配置参见lib.doc

    (1)运行webots报OpenGL错误:安装CUDA(将自动更新驱动)后禁用集成显卡

    (2)运行webots_ros2_xxx出错:删除C:UsersAdministratorAppDataLocalTemp*

    6.安装并配置WebotsROS2:迭代克隆代码到D:app ros2webots

    (1)下载https://github.com/cyberbotics/webots_ros2.git到D:app os2ex

    (2)下载https://github.com/cyberbotics/urdf2webots.git到D:app os2ex

    webots_ros2_importerwebots_ros2_importerurdf2webots

    (3)下载https://github.com/ros-industrial/motoman.git到D:app os2ex

    webots_ros2_importerwebots_ros2_importerurdf2webots estssourcesmotoman

    (4)下载https://github.com/ros-controls/control_msgs到D:app os2ex

    (5)进入D:app os2webotsout并执行:colcon build --merge-install --base-paths ..

    (6)开发配置:见lib.doc中的ROS2-Python环境配置

    7.

    8.

    9.

    10.添加环境变量

    (1)只能手动进行的配置(未考虑Path变量)

             setx -m OPENSSL_CONF D:app os2opensslinopenssl.cfg

             setx -m OpenCV_DIR D:appopencvoutinstall

             setx -m PYTHONPATH C:Python38libsite-packages;D:app os2pythonlibsite-packages;D:appwebotslibcontrollerpython38

             setx -m WEBOTS_HOME D:appwebots

    (2)近似setup.bat的配置(未考虑Path变量)

             setx -m PYTHONPATH %PYTHONPATH%;

                      D:app os2libsite-packages;

                      D:app os2exoutinstalllibsite-packages

             setx -m AMENT_PREFIX_PATH

                      D:app os2;

                      D:app os2exoutinstall

    11.设置Path变量

    D:appqt5.9.9msvc2015_64in

    D:appvtkoutinstallin

    D:appopencvoutinstallx64vc16in

    D:appoctomapoutinstallin

    C:Program FilesGitcmd

    C:Program FilesCMakein

    C:Python38

    C:Python38Scripts

    D:appwebotslibcontroller

    D:appwebotsmsys64mingw64in

    D:app os2in

    D:app os2Scripts

    D:app os2optlibcurl_vendorin

    D:app os2opt viz_ogre_vendorin

    D:app os2opt viz_assimp_vendorin

    D:app os2optyaml_cpp_vendorin

    D:app os2opensslin

    D:app os2chocoin

    D:app os2chocolibulletlib

    D:app os2chocolibcunitlib

    D:app os2chocoliblog4cxxlib

    D:app os2chocolib inyxml2lib

    D:app os2pythonscripts

    D:app os2exoutinstallin

    D:wks obotsimoutDebug

    D:wks obotsimoutRelease

    C:Windows

    C:WindowsSystem32

    C:WindowsSystem32Wbem

    C:WindowsSystem32OpenSSH

    C:WindowsSystem32WindowsPowerShellv1.0

    C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.1in

    C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.1libnvvp

    C:Program FilesNVIDIA CorporationNsight Compute 2020.2.0

    C:Program Files (x86)NVIDIA CorporationPhysXCommon

    12.创建快速命令文件:ros2vc.batros2vs.bat

    set OPENSSL_CONF=D:app os2opensslinopenssl.cfg

    set OpenCV_DIR=D:appopencvoutinstall

    set PYTHONPATH=C:Python38libsite-packages;D:app os2pythonlibsite-packages; D:appwebotslibcontrollerpython38

    set WEBOTS_HOME=D:appwebots

    call D:app os2setup.bat

    call D:app os2exoutinstalllocal_setup.bat

    ::call "C:Program Files (x86)Microsoft Visual Studio2019EnterpriseCommon7IDEdevenv.exe"

    call "C:Program Files (x86)Microsoft Visual Studio2019EnterpriseVCAuxiliaryBuildvcvars64.bat"

    cmd /K D:

    1.4 Win10系统备份(Grub/UEFI/Squashfs/Dism/WSL/Docker命令)

     

     

    1.Grub2命令

    (1)常用变量

             root:当前所在分区

             prefix:当前grub.cfg所有目录

             cmdpath:被启动的grubx64.efi所在目录

             grub_cpu:x86_64

             grub_platform:efi

    (2)常用指令

             reboot&halt:重启&关机

             ls&ls (hdX,Y)&ls (hdX,Y):显示所有分区&显示分区类型&显示分区内容(X始于0但Y始于1)

             ls (hdX,Y)/dir:显露指定目录下的所有内容

             set&set var=val&unset var&echo $var:显示所有变&定义或重设变量&删除变量&显示变量

             search --file filepath --set=root:在所有分区查找指定文件并将首次找到所在分区设为当前分区

             loopback loopX isopath:将指定镜像文件挂载到loopX

             insmod module:加载指定grub模块,如fat, ntfs, memdisk, ntldr, linux16, initrd16

             chainloader filepath:链式加载指定文件

                      chainloader +1表示加载当前分区引导记录

                      chainloader (hdX,Y)+1表示加载指定分区引导记录

                      chainloader (hdX)+1表示加载指定硬盘主引导记录

                      chainloader efifilepath表示加载指定的efi文件

             boot:执行引导,在内核已经加载或chainloader后执行

             configfile filepath:加载配置文件

             cat filepath:显示指定文件的内容

             cmp file1path file2path:比较两个文件是否相同(若相同则无任何显示)

    (3)常用配置

             GRUB_DEFAULT=0

             GRUB_TIMEOUT=30

             GRUB_TIMEOUT_STYLE=menu/hidden

    2.UEFI命令

    (1)常用指令

             fsX:进入指定分区

             cd dir:进行指定目录

             ls [dir]:列举指定目录下的所有文件及目录

             path.efi:启动指定efi文件

             exit:退出uefishell(将执行下一uefi启动项)

    (2)

    3.squashfs命令

    (1)squashfs-tools: https://github.com/plougher/squashfs-tools

    (2)squashfs-tools-ng:https://github.com/AgentD/squashfs-tools-ng

    (3)创建系统:gensquashfs

    (4)浏览系统:rdsquashfs

    (5)转换系统:sqfs2tar、tar2sqfs

    (6)对比系统:sqfsdiff

    4.dism命令

    (1)WIM相关

             1)装载:/Mount-Wim /WimFile:F:sourcesinstall.wim /index:1 /MountDir:D:Win10 /ReadOnly

             2)卸载:/Unmount-Wim /MountDir:D:Win10 /discard

             3)版本详细:/Get-WimInfo /WimFile:F:sourcesinstall.wim

             4)装载详细:/Get-MountedWimInfo

             6)清理混淆:/Cleanup-Wim

             7)恢复关联:/Remount-Wim /MountDir:D:Win10

             8)保存修改:/Commit-Wim /MountDir:D:Win10

    (2)FFU相关

             1)获取:/Capture-Ffu

             2)应用:/Apply-Ffu

             3)优化:/Optimize-Ffu

    5.wsl命令

    (1)常用命令

             登录系统:wsl [--distribution osName] [--user userName]

             查看系统:wsl --list --all/--running/--quiet/--verbose

             关闭所有系统:wsl --shutdown

             关闭指定系统:wsl --terminate osName

             移除指定系统:wsl --unregister osName

    (2)默认设置

             设置默认系统:wsl --set-default osName

             设置默认版本:wsl --set-default-version wslVersion

             设置为指定版:wsl --set-version osName wslVersion

    (3)导入导出

             导入系统:wsl --import osName installDir tarPath #若失败则临时设置较大的虚拟内存反复尝试

             导出系统:wsl --export osName tarPath

             导出/导入的实质:tar与vhdx之间的转换(也可直接备份vhdx)

             用导入方式安装:直接导入install.tar.gz、避免新建用户而直接默认root登录

    6.docker命令

    (0)命令归类

             全局查看:version、info、inspect

             镜像管理:images|save|load|rmi|history、build|tag|commit、pull|push|search|login|logout、event

             容器管理:ps|import|export|rm|rename、create|run

             容器操控:start|restart|stop|kill|wait、top|pasue|unpause|exec、stats、logs、port

             容器通信:attach、cp、diff、update

    (1)状态查询

             镜像数量:docker images -a

             容器数量:docker ps -a

             容器进程:docker top

             容器能耗:docker stats -a

             文件详细:docker inspect ima/con

    (2)备份恢复

             镜像转文件:docker save -o tarPath ima

             文件转镜像:docker load -i tartPath

             文件转镜像:docker import tarPath

             容器转文件:docker export -o tarPath con

    (3)创建删除

             删除镜像:docker rmi -f ima

             删除容器:docker rm -fv con

             改名容器:docker rename con name

             创建容器:docker run/create [options] ima [command] [args]

             别名创建镜像:docker tag ima repname:tagname

             容器创建镜像:docker commit -p -m “changes” -a “author” conId repname:tagname

             编译创建镜像:docker build [options] dir

    (4)开关登录

             开机:docker start con

             关机:docker stop con

             重启:docker restart con

             硬关:docker kill con

             休眠:docker pause con

             复原:docker unpause con

             共享终端登录且退出就关机(适合个人):docker attach con

             独立终端登录且退出不关机(适合团队):docker exec -it [-u user -w wks -e env] con /bin/bash

    (5)容器更新管理

             更新容器硬件配置:docker update [options] con

             交换容器主机数据:docker cp hostPath con:conPath 或 docker cp con:conPath hostPath

             查看容器数据更改:docker diff con

    (6)容器创建详细

             --name=

             -h --hostname=

             -u --user=

             -w --workdir=

             -e --env=

             -i --interative

             -t --tty

             -a --attach=STDIN/STDOUT/STDERR

             -c --cpu-shares=

             -m --memory=

             -v --volume=

             -p --publish=

             --network=none/bridge/host/container

             --dns=

    (9)典型使用流程:createàstartàexec|attachàstop、镜像为应用名、容器加后缀PC

             docker create -it -h NoticPC --name NoeticPC

                      -e DISPLAY=unix$DISPLAY -e GDK_SCALE -e GDK_DPI_SCALE

                      -v /tmp/.X11-unix:/tmp/.X11-unix aaron:noetic

             docker start NoeticPC

             docker exec -it NoeticPC /bin/bash

             docker exec -d NoeticPC cmd args

             docker attach NoeticPC

             docker stop NoeticPC

    2.Window10开发库安装与配置

    2.1 git + cmake + bcompare + python + qt + eigen + gflags + glog + ceres + spdlog + octomap

    1.安装git&cmake&bcompare&python:除Python要考虑ROS2外其它默认安装即可

    git config --global user.name "user"

    git config --global user.email user@user.com

    git config --global core.filemode false

    git config --global core.autocrlf true   #仅Win

    git config --global diff.tool bc3

    git config --global difftool.prompt false

    git config --global difftool.bc3.path "C:/Program Files/Beyond Compare 4/bcompare.exe"

    git config --global difftool.bc3.cmd

    2.安装qt安装到D:/app/qt并设置D:/app/qt/5.9.9/msvc2015_64/bin到Path头(非常重要)

    (1)Qt5.9.9组选择msvc2015-64bit和除QtScript外所有Qt打头的库

    (2)DevDes组成选择CBDebuger和MinGW

    (3)WIN移植到第三方时用C:WindowsSystem32WindowsPowerShellv1.0作为目标路径

    (4)WIN移植到第三方时根据实际需求还需要将~/plugins中的某些目录复制到与运行程序相同的目录,当前有:imageformats、sqldrivers、platforms

    3.安装eigen&gflags&glog&ceres&spdlog

    (0)搜索C:和D:确认依赖:eigen和gflags无依赖、glog仅依赖gflags、ceres依赖前三者

    (1)安装eigen到CMAKE_INSTALL_PREFIX=D:/app/eigen/out/install且仅安装头文件

    (2)安装gflags到CMAKE_INSTALL_PREFIX=D:/app/gflags/out/install且用静态库

    (3)安装glog到CMAKE_INSTALL_PREFIX=D:/app/glog/out/install且用静态库

    (4)安装ceres到CMAKE_INSTALL_PREFIX=D:/app/ceres/out/install且用静态库

    (5)ceres使用说明:直接包含lib文件会缺少宏定义使得在Debug模式下会出错,可通过find_package生成工程找到宏后再在简易配置中加上宏

    (6)安装spdlog到CMAKE_INSTALL_PREFIX=D:/app/spdlog/out/install且仅安装头文件或不使用最新版本而使用WinROS2解压包中附带的、spdlog无依赖

    4.安装octomap添加环境变量D:/app/octomap/out/install/bin

    (1)编译须知(搜索C:和D:确认依赖)

         1)删除~/octovis/src/extern以免调用本身提供的旧版本的libqglviewer

             2)从octovis工程复制${QT_LIBRARIES}到octovis-share工程才能使之编译通过

             3)继承关系变化:ViewerWidgetàQGLVieweràQOpenGLWidget

             4)安装到CMAKE_INSTALL_BIN_DIR=D:/app/octomap/out/install

    (2)编译选项

             1)OCTOVIS_OT5=TURE

             2)BUILD_OCTOVIS_SUBPROJECT=TRUE

             3)BUILD_DYNAMICETD3D_SUBPROJECT=TRUE

             4)QT5XXX_DIR=D:/app/qt/5.9.9/msvc2015_64/lib/cmake/XXX

             5)QGLViewer_INCLUDE_DIR=D:/app/qt/5.9.9/msvc2015_64/include/QGLViewer

             6)QGLViewer_LIBRARY_DIR_WINDOWS=D:/app/qt/5.9.9/msvc2015_64/lib/QGLViewer2.lib

    5.安装qglviewer

    (1)用qt打开QGLViewer.pro,设置C/C++编译器为MVCM14.0(amd64)

    (2)构建Release版本,无需理会找不到QGLViewer2.lib的错误

    (3)复制QGLViewer2.lib为~qtversion_idmsvc2015_64lib

    (4)复制QGLViewer2.dll到~qtversion_idmsvc2015_64in

    (5)复制libQGLViewer-qt5.prl和libQGLViewer-qt5.so*到~qtversion_idgcc_64lib

    (6)复制QGLViewer中所有h文件和VRender到~qtversion_idmsvc2015_64

    (7)复制QGLViewer中所有h文件和VRender到~qtversion_id\_gcc_64include

    (8)在QGLViewer中增加文件QGLViewer

                      #ifndef QT_QGLVIEWER_MODULE_H

                      #define QT_QGLVIEWER_MODULE_H

                      #include "camera.h"

                      #include "config.h"

                      #include "constraint.h"

                      #include "domUtils.h"

                      #include "frame.h"

                      #include "keyFrameInterpolator.h"

                      #include "manipulatedCameraFrame.h"

                      #include "manipulatedFrame.h"

                      #include "mouseGrabber.h"

                      #include "qglviewer.h"

                      #include "quaternion.h"

                      #include "vec.h"

                      #endif

    (9)这些头文件中包含的关于QT的头文件要作修改,主要是增加包含目录

    (10)复制examples为~qtExamplesversion_idqglviewer

    (11)备份以上文件,对Qt5.9.x全适用,对5.x.x只需更新dll和lib文件

    2.2 vtk+openvino+opencv

    2.安装vtk添加环境变量D:/app/vtk/out/install/bin

    (1)搜索C:和D:确认依赖正确、若自动找到QT则残废之

    (2)安装到CMAKE_INSTALL_PREFIX=D:/app/vtk/out/install

    3.安装opencv添加环境变量D:/app/opencv/out/install/x64/vc16/bin

    (1)编译须知(搜索C:和D:确认依赖)

             1)修改modules_contrib/cvv/src/stfl/stringutils.cpp中u8”…”为u8”...”

             2)非开源OPENCV_ENABLE_NONFREE=ON

             3)扩展源OPENCV_EXTRA_MODULES_PATH=D:/app/opencv/modules_contrib

             4)安装到CMAKE_INSTALL_PREFIX=D:/app/opencv/out/install

    (2)配置WITH

             1)至少选中:QT、VTK、INF_ENGINE、NGRAPH、TBB

             2)至少取消:CUDA、EIGEN

             1)QT5XXX_DIR=D:/app/qt/5.9.9/msvc2015_64/lib/cmake/XXX

             2)VTK_DIR=D:/app/vtk/out/install/lib/cmake/vtk-8.2

             3)InferenceEngine_Dir=D:/app/openvino/deployment_tools/inference_engine/share

             4)ngraph_DIR=D:/app/openvino/deployment_tools/ngraph/cmake

             5)TBB_DIR=D:/app/openvino/deployment_tools/inference_engine/external/tbb/cmake

             6)INF_ENGINE_RELEASE=2021010000

    (3)配置BUID

             1)至少选中:opencv_world

             2)至少取消:CUDA_STUBS、TBB、TESTS、PER_TESTS、EXAMPLES、opencv_apps、opencv_cvv(与opencv_world冲突)、

    (4)待考虑选项:BLAS_XXX、Ceres_DIR

    (5)备份须知

             1)完成CMake的Generate后备份为out.zip

             2)安装并复制OpenCVDLDT中除*.pbd、*.exe、opencv_*外的所有到~/install/x64/vc16/bin

             3)删除除out.zip及install外后的所有并进行整体备份

    1.安装openvino

    (1)安装过程详细

             1)选择D:/app后将自动创建快捷目录D:/app/openvino和原始目录D:/app/openvino_year.month.id

             2)安装组件包括:ModelOptimizer(用于模型转换)、OpenModelZoo(避免再次下载)、

                      IEDevKit(OpenMoelZoo引入)、IERuntimeForXXX(占极小空间)、于是仅OpenCV被排除

             3)安装后删除D:/app/openvino而将D:/app/openvino_year.month.id重命名为D:/app/openvino

             4)通过BeyondCompare比较复制的与原始的D:/app/openvino来移除其中的快捷目录

             5)不为之添加任何永久环境变量而仅针对即时的命令窗口(因为主要想使用它的模型转换器)

             6)备份须知:无需单独备份、因为备份文件没比原文件小多少且重装如同解压、所以需要时直接安装即可

    (2)最终文件结构

             python

             opencv

             licensing

             documentation

             binsetupvars.bat:环境变量设置脚本

             data_processingaudiospeech_recognition:语音识别库API

             deployment_tools

                      demo:安装验证脚本

                      tools:模型处理工具

                      open_model_zoo:推理引擎实例SRC

                      model_optimizer:模型优化器APP

                      ngraph:模型优化库API

                      inference_engine:推理引擎库API、推理引擎驱动DLL、推理引擎示例SRC

    (3)环境变量说明

             C:Program Files (x86)Common FilesIntelShared Libraries edistintel64_wincompiler

             D:appopenvinodeployment_tools graphlib

             D:appopenvinodeployment_toolsinference_engineexternal bbin

             D:appopenvinodeployment_toolsinference_engineexternalhddlin

             D:appopenvinodeployment_toolsinference_engineinintel64Release

             D:appopenvinodeployment_toolsinference_engineinintel64Debug

             D:appopenvinodeployment_toolsmodel_optimizer

    (4)配置验证详细

             设置环境变量:D:appopenvinoin: setupvars.bat

             配所有优化器:D:appopenvinodeployment_toolsmodel_optimizerinstall_prerequisites: install_prerequisites.bat

             转为DLDT模型:D:appopenvinodeployment_toolsdemo: demo_squeezenet_download_convert_run.bat

             推理DLDT模型:D:appopenvinodeployment_toolsdemo: demo_security_barrier_camera.bat

    2.3 orbslam3

    2.安装orbslam2(fbow + g2o +pangolin)

    (1)安装路径:CMAKE_INSTALL_BIN_DIR=D:/app/octomap/out/install

    (2)环境变量

    (3)手动确认

    (4)安装须知

             1)可对比原始源码与Window版本源码的区别,然后按readme安装

             2)在ORBextractor.cc中添加头文件#include <iterator>

             3)删除提供的Thirdparty/eigen而用D:/app/eigen

             4)生成g2o工程打开后添加预处理选项WINDOWS

             5)编译pangolin时会不能打开”pthread.lib”的错误无需理会

    (5)测试用例:解压Vocabulary/ORBvoc.txt.tar.gz到当前目录

             1)单目KITTI:.ExamplesMonocularReleasemono_kitti .VocabularyORBvoc.txt .ExamplesMonocularKITTI03.yaml G:data_odometry_gray3

             2)单目EuRoc:

             3)单目TUM:.ExamplesMonocularReleasemono_tum .VocabularyORBvoc.txt .ExamplesMonocularTUM1.yaml G: gbd_dataset_freiburg1_desk

             4)双目KITTI:.ExamplesStereoReleasestereo_kitti .VocabularyORBvoc.txt .ExamplesStereoKITTI03.yaml G:data_odometry_gray3

             5)双目EuRoC:

             6)深度TUM:.ExamplesRGB-DRelease gbd_tum .VocabularyORBvoc.txt ExamplesRGB-DTUM1.yaml G: gbd_dataset_freiburg1_desk G: gbd_dataset_freiburg1_deskassociations.txt

    3.Ubuntu2004系统安装配置(WSL2)

    3.1 初始设置

    (1)开户root账号并重启系统:

             打开gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

             添加greeter-show-manual-login=true

             设置密码sudo passwd root

    (2)登录root账号并更改语言为英语

             打开gedit /etc/default/locale修改

             LANG="en_US.UTF-8"

             LANGUAGE="en_US:en"

    (3)解决root登陆报错:

             打开gedit /root/.profile

             注释mesg n

             添加tty -s && mesg n

             回到终端执行init 6

    (4)安装vmwaretools

             提取iso文件中的压缩文件中的wmware-tools-distrib

             进入此目录执行./vmware-install.pl之后一路回车即可

             windows共享的目录位于/mnt/hgfs

    (5)修改源: gedit /etc/apt/sources.list

             deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse

             deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse

             deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse

             deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

             #测试版源

             deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse

             #源码

             deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse

             deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse

             deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse

             deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

             #测试版源

             deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse

             #Canonical 合作伙伴和附加

             deb http://archive.canonical.com/ubuntu/ xenial partnerlibe

             #deb http://extras.ubuntu.com/ubuntu/ xenial main

    (6)安装基本

             add-apt-repository ppa:nemh/systemback

             apt-get update

             apt-get upgrade

             apt-get dist-upgrade

             apt-get install synaptic gparted systemback fcitx-table-all bleachbit adobe-flashplugin guvcview vlc audacious uget aria2 ubuntu-restricted-extras

             apt-get install xrdp dconf-editor samba system-config-samba gksu vsftpd filezilla openssh-client openssh-server git git-core apache2 apache2-utils

             apt-get install minicom picocom cutecom nfs-common portmap nfs-kernel-server

             打开LanguageSupport配置KeyboardInputMethodSystem为fcitx

             打开bleachbit选中除PackageLists和FreeDiskSpace外的所有

             打开rmvb+mkv+mp4+mp3安装提示插件

    3.2 个性配置

    (1)个性配置

             桌面无任何图标

             输入法仅五笔和拼音

             窗口菜单在本窗口并一直显示

             任务栏无多余程序停靠(包括不含桌面图标和工作空间图标)且任务栏图标尺寸30

    (2)标签配置

             打开/etc/xdg/user-dirs.defaults注释所有

             打开~/.config/user-dirs.dirs注释只剩下XDG_DESKTOP_DIR="$HOME/Desktop"从而完成位置栏配置

             打开菜单栏上的书签栏完成书签栏配置

    (3)办公配置

             见后文

    (4)制本地源

             复制/var/cache/apt/archives/*.deb到/root/app/aptget(若软件包被删除或更新则进入synaptic选择全部重新但仅下载)

             进行入/root/app执行{dpkg-scanpackages aptget /dev/null | gzip > aptget/Packages.gz}生成源信

             打开gedit /etc/apt/sources.list后删除所有并添加deb file:/root/app/ aptget/然后打开synaptic并reload即可

             可以通过dpkg -i /root/app/aptget/*.deb安装强制安装deb软件(确保彼此依赖都存在)

    (5)清理缓存

             bleachbit: 清理垃圾

             apt-get clean: 清理所有deb安装包

             apt-get autoclean: 清理已被卸载的软件的deb安装包

             apt-get autoremove: 删除系统认为不再使用的孤立软件

             apt-get remove --purge softname: 卸载指定软件且删除配置

             synaptic: 清除残留配置

    (6)备份系统

             用systemback备份系统为LiveCD

             直接用LiveCD工作时可能无权限时则执行chmod u+x file/dir

             直接进行安装模式..../ubuntu160403-dzy.iso ro finstall quiet splash locale=zh_CN.UTF-8

             在不同配置的电脑上安装或试用LiveCD时,驱动有问题首先更新或重装内核(此方法可联网可离线),若都不行则在软件更新界面的附加驱动中安装(此方法要联网)

    (7)压缩数据

    常用功能

    常用压缩

    常用选项

    常用格式

    -c新建压缩

    -x解压文件

    -t查看文件

    -r追加文件

    -J为lmzma压缩(后缀tar.xz)

    -z为gzip压缩(后缀tar.gz)

    -j为bzip2压缩(后缀tar.bz2)

    -Z为传统压缩(后缀tar.Z)

    -f压缩名

    -v显示过程

    --exclude=path排除路径

    -C解压位置

    压缩: tar   -cvJf   file.tar.xz   --exclude=path1   --exclude=path2   srcPath

    解压: tar   -xvJf   file.tar.xz   -C   dstPath

    压缩用例: tar   -cvzf   /root/app.tgz   --exclude=/root/app/tmp1   --exclude=/root/app/tmp2   /root/app/

    解压用例: tar   -xvzf   /root/app.tgz   -C   /root/app/

    .

    3.3 开发配置

    (1)从源安装

             apt-get install  libqt5multimedia5-plugins  qtmultimedia5-dev  libsuitesparse-dev              CMakeLists添加: /usr/include/suitesparse

             apt-get install  git  cmake  cmake-qt-gui  python3  libqt5*5-dev  libboost-all-dev  libeigen3-dev  liboctomap-dev  libdynamicedt3d-dev  liboctovis-dev  octomap-tools  octovis                  手动: sophus

             apt-get install  libvtk6-dev  libopencv-dev                       手动: opencv

             apt-get install  libgflags-dev  libgoogle-glog-dev            手动: ceres

             apt-get install  libflann-dev  libqhull-dev  libpcl-dev  pcl-tools libproj-dev

    (2)手动安装

             sophus: 与win相似,直接复制到/usr/include/sophus-dzy

             opencv: 除安装路径外与win相同, 包括重建本地本可以提供的第三项

             pangolin: 除安装路径外与win相同, 但不重建本地已存在的第三项,若所需第三方项不存在会提示错误,基于之前安装这里就需要再安装libglew-dev

             ceres: 除安装路径外与win相同

             qt&&vscode&&vscode-plugins: vscode-icons, CMake, CMake Tools, CMake Tools Helper, C/C++

    (3)备份恢复

             1)备份:复制/usr/local/*到/root/app/local,复制所有deb包到root/app/base-dev,删除所有out中除out.zip外的文件

             2)恢复:以base-dev制作本地源安装,复制local覆盖/usr/local,终端执行ldconfig

    3.4 环境变量配置

    (1)可设置处

             /etc/environment:系统启动时加载

             /etc/profile:每个用户首次登录时加载

             /etc/bash.bashrc:每个用户每次打开shell时加载

             ~/.profile:对应用户首次登录时加载

             ~/.bashrc:对应用户每次打开shell时加载

             立即生效:source /etc/bash.bashrc 或source ~/.bashrc

    (2)设置变量

             对C头文件:export C_INCLUDE_PATH = dzypath:${C_INCLUDE_PATH}

             对CXX文件:export CPLUS_INCLUDE_PATH = dzypth:${CPLUS_INCLUDE_PATH}

             对静态库文件:export LIBRARY_PATH = dzypath: ${LIBRARY_PATH}

             对动态库文件:export LD_LIBRARY_PATH = dzypath:${LD_LIBRARY_PATH} 或 修改/etc/ld.so.conf并执行ldconfig

             对可执行文件:export PATH = dzypath:${PATH}

    4.移动系统定制

    4.1 BIOSUEFI的硬件差异

     

    1.BIOS硬盘结构

    (1)LBA0:因该扇区中,引导代码占有绝大部分的空间,故将此扇区称为MBR扇区

             MBR:446字节,存储系统的引导程序

             PEs:64字节,每16字节描述描述一个PE(Partition Entry),所以最多共4个分区

             End:2字节,值为0xAA55

    (2)LBA1~LBA62:隐藏扇区,保留备用。

    (3)LBA63:第一分区的起始位置。

    (4)LBA64~LBAEnd:参见《挨踢_硬盘结构+文件系统+系统启动+数据恢复1st.doc》

     

    2.UEFI硬盘结构

    (1)LBA0:MBR扇区,记录了启动代码和分区信息。

             若LBA0记录了仅0xEE标志的分区或LBA0后存在PHs(Partition Headers),说明此硬盘为UEFI独占模式,只能由UEFI主板启动

             若LBA0记录了非0xEE标志的分区且LBA0后存在PHs,说明此硬盘为UEFI/BIOS混合模式,两类主板或混合主板都能启动

             若LBA0记录了非0xEE标志的分区且LBA0后没有PHs,说明此硬盘为BIOS独占模式,只能由BIOS主板启动

    (2)LBA1:主PTH(Partition Table Header),记录硬盘的GUID、分区可用的始末LBA、PEs包含的项数及每项占用的字节数等信息

    Offset

    Length

    Contents

    0 (0x00)

    8 字节

    签名,"EFI PART",值为0x54 52 41 50 20 49 46 45

    8 (0x08)

    4 字节

    修订,对GPT 1.0,值为0x00 01 00 00

    12 (0x0C)

    4 字节

    PTH尺寸,值为0x00 00 00 5C = 92

    16 (0x10)

    4 字节

     

    20 (0x14)

    4 字节

    保留,必须是0

    24 (0x18)

    8 字节

    当前PTH的LBA位置(对主PTH恒为1)

    32 (0x20)

    8 字节

    另一PTH的LBA位置(对副PTH恒为总LBA数减2)

    40 (0x28)

    8 字节

    分区可用的第一LBA位置(主PEs的最后LBA加1=LB34)

    48 (0x30)

    8 字节

    分区可用的最后LBA位置(副PEs的第一LBA减1=LB-34)

    56 (0x38)

    16 字节

    硬盘GUID (在UNIX及派生系统中也叫UUID)

    72 (0x48)

    8 字节

    主PEs的LBA位置(恒为2)

    80 (0x50)

    4 字节

    PEs包含的PTE数(即分区数)

    84 (0x54)

    4 字节

    每个PE的尺寸(通常为128字节)

    88 (0x58)

    4 字节

    PEs的CRC32校验码

    92 (0x5C)

    *

    保留,必须是0(对512字节的LBA,剩余420字节)

    (3)LBA2~LBA33:主PEs,每个PE用128字节描述

    Offset

    Length

    Contents

    常用分区类型GUID

    EFI/ESP分区:C12A7328-F81F-11D2-BA4B-00A0C93EC93B,与操作系统无关

    基本数据分区:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7,对Windows和Linux相同

    微软保留分区:E3C9E316-0B5C-4DB8-817D-F92DF00215AE,Windows专用

    Linux交换分区:0657FD6D-A4AB-43C4-84E5-0933C84B4F4F,Linux专用

    0 (0x00)

    16 字节

    分区类型标志GUID

    16 (0x10)

    16 字节

    分区唯一标志GUID

    32 (0x20)

    8 字节

    起始LBA

    40 (0x28)

    8 字节

    终止LBA

    48 (0x30)

    8 字节

    属性标志(如60代表只读)

    56 (0x38)

    72 字节

    分区名(36个UTF-16字符)

    (4)LBA34:第一分区的起始位置

    (5)LBA-2~LBA-33:副PEs

    (6)LBA-1:副PTH

    4.2 BIOSUEFI的软件差异

    1.电脑主板固件程序分别:BIOS和UEFI

    2.BIOS分区结构将MBR和PEs存储在了一个扇区LBA0

    3.UEFI分区结构将MBR存储在一个扇区LBA0,将PEs存储在多个扇区(LBA2~LBA33),还增加了PTH(存储在LBA1扇区)

    4.UEFI必须有一个ESP分区,ESP用于存储系统启动相关的文件

    5.BIOS硬盘启动过程概要

    (1)开机自检

    (2)加载硬盘主引导记录(每类系统的主引导记录都不相同)

    (3)搜索并激活系统引导文件(如winnt5_ntldr或winnt6_bootmgr或ubuntu_)

    (4)加载启动配置文件(如winnt5_boot.ini或winnt6_bcd或ubuntu_grub.cfg)

    (5)加载系统核心文件

    6.UEFI硬盘启动流程详细

    (1)开机自检

    (2)加载系统引导文件:自动加载/esp/efi/boot/bootx64.efi(可由任何系统的efi文件或uefishell.efi重命名得到),可手动添加多个不同路径的efi文件

             Windows默认安装在:/esp/efi/microsoft/boot/bootmgrfw.efi

             Ubuntu默认安装:/esp/efi/ubuntu/shimx64.efi及/esp/efi/ubuntu/grubx64.efi

    (3)加载启动配置文件:不同的efi文件,其指向的启动配置文件不同

             Windows操作系统:/esp/efi/microsoft/boot/bootmgrfw.efià/esp/efi/microsoft/boot/bcd

             Windows安装镜像:/iso/efi/boot/bootx64.efià/iso/efi/microsoft/boot/bcd

             Ubuntu操作系统:/esp/efi/ubuntu/shimx64.efià/esp/efi/ubuntu/grubx64.efià/esp/efi/ubuntu/grub.cfg

             Ubuntu安装镜像:/iso/efi/boot/bootx64.efià/iso/efi/boot/grubx64.efià/iso/boot/grub/x86_x64-efi/*及/iso/boot/grub/grub.cfg

    (4)加载系统核心文件:不同的启动配置文件,其指向的系统核心文件不同

    7.UEFI启动盘制作须知

    (1)基于《UEFI硬盘启动流程》可知,从操作系统或安装盘复制相应的文件到esp分区后,此硬盘就是UEFI启动盘

    (2)为使用grub2的附加功能,将Ubuntu操作系统中的boot/grub/x86_x64-efi目录也复制到/esp/efi/ubuntu目录中(若复制到其它位置则insmod时就需要指定模块详细路径)

    (3)为引导镜像(如.iso或.ima或.wim等),复制ubuntu操作系统中的/usr/lib/syslinux/memdisk到/esp/efi/ubuntu中(可复制到其它任何位置反正加载时都要指定具体位置)

    (4)开发者希望开机启动uefishell.efi,使用者角度希望开机启动grub2,折中方案是将shimx64.efi复制重合名为bootx64.efi(即将grub2设置默认),因为可以从grub2中启动任何efi

    ▲:暂没实现grub2启动winpe.iso。当前,grub2只负责启动ubuntu系统和ubuntu镜像及efi文件,BCD负责启动windows及winpe.wim及winos.vhd

    8.UEFIBIOS相互转换

    (0)BIOS启动盘制作:用grub4dos作为主干(即用grub4dos的引导代码作为硬盘的MBR)引导相关操作系统,详细制作流程略。

    (1)BIOS转换为UEFI:不论bios硬盘如何分区及有多少个分区

             MBR(001~446):被置0

             DPT1(447~462):被修改为恒定值且分类类型被置为0xEE

             0x00, 0x00, 0x02, 0x00, 0xEE, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,

             DPT2(463~478):被置0

             DPT3(479~494):被置0

             DPT4(495~410):被置0

             END(411~412):不变。

    (2)UEFI转换为BIOS:不论uefi硬盘如何分区及有多少个分区

             MBR(001~446):被修改为某系统的引导代码

             DPT1(447~462):被修改为第一分区的信息数据,若无第一分区则置为0

             DPT2(463~478):被修改为第二分区的信息数据,若无第二分区则置为0

             DPT3(479~494):被修改为第三分区的信息数据,若无第三分区则置为0

             DPT4(495~410):被修改为第四分区的信息数据,若无第四分区则置为0

             END(411~412):不变。uefi模式的第五及之后的分区在bios将不能被识别,或某些分区软件直接提示不能转换为bios硬盘。

    4.3 BIOSWinPE启动盘制作

    1.WinPE.ISO目录(仿照安装镜像生成):打开从Windows安装镜像并删除所有文件后添加如下文件

             bootmgr                                 从WindowsNT6安装镜像中获取(使bios主板能启动)

             bootmgr.efi                            从WindowsNT6安装镜像中获取(使uefi主板能启动)

             boot                                      新建目录

                      boot.sdi                        从WindowsNT6安装镜像中获取

                      winpe.wim                   从第三方获取 (本质上就是windowsNT6安装镜像中install.win的精简)

                  BCD                            从WindowsNT6安装镜像中获取并作修改:设备文件由sourcesinstall.wim改为ootwinpe.wim

    2.BCD启动WinPE.wim:打开BCD增加一项并指定boot.sdi和winpe.wim路径即可

    3.BCD启动WinPE.iso:不支持

    4.grub4dos启动WinPE.wim:不支持

    5.grub4dos启动WinPE.iso

             title winpe.iso

             map --mem /hitsz/iso/winpe.iso (hd32)

             map --e820cycles=0 ###解决蓝屏问题

             map --hook

             chainloader (hd32)                                           ###grub4dos不支持uefi启动,据说开发团队也不打算支持,所以抛弃grub4dos而转向grub2

  • 相关阅读:
    10个用jQuery实现图片幻灯片/画廊效果和源码
    老赵面试题参考答案(二)
    C#的显式接口和隐式接口
    老赵面试题参考答案(三)
    C#中的参数传递:值类型(value type)和引用类型(reference type)
    word转换成html的方法
    老赵面试题参考答案(四)
    五个Metro UI 风格的网页设计
    老赵面试题参考答案(六)
    概要设计怎么写?
  • 原文地址:https://www.cnblogs.com/dzyBK/p/5965287.html
Copyright © 2011-2022 走看看