- 十、嵌入式Linux环境搭建
- 10.1 安装FTP和ssh服务器
- 十一、交叉编译器
- 11.1 交叉编译器概念
- 11.2 下载、安装交叉编译器
- 十二、Qt移植
- 12.1 下载、安装qt
ubuntu提供的安装命令有apt-get、dokg等。
安装ftp服务器:
root@ubuntu:~$ sudo apt-get install vsftpd Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: vsftpd 0 upgraded, 1 newly installed, 0 to remove and 384 not upgraded. Need to get 115 kB of archives. After this operation, 334 kB of additional disk space will be used. Get:1 http://mirrors.aliyun.com/ubuntu bionic/main amd64 vsftpd amd64 3.0.3-9build1 [115 kB] Fetched 115 kB in 0s (271 kB/s) Preconfiguring packages ... Selecting previously unselected package vsftpd. (Reading database ... 229194 files and directories currently installed.) Preparing to unpack .../vsftpd_3.0.3-9build1_amd64.deb ... Unpacking vsftpd (3.0.3-9build1) ... Processing triggers for ureadahead (0.100.0-20) ... Setting up vsftpd (3.0.3-9build1) ... Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /lib/systemd/system/vsftpd.service. Processing triggers for systemd (237-3ubuntu10) ... Processing triggers for man-db (2.8.3-2) ... Processing triggers for ureadahead (0.100.0-20) ... root@ubuntu:~$
修改配置:
sudo gedit /etc/vsftpd.conf
注释掉以下两项:
local_enable = YES write_enable = YES
除此之外,需要把禁止访问FTP的用户注释掉:
# /etc/ftpusers: list of users disallowed FTP access. #root
之后启动vsftpd,命令如下:
root@ubuntu:~$ service vsftpd start root@ubuntu:~$
ssh安装
root@ubuntu:~# apt-get install openssh-service #ubuntu下安装openssh-service: root@ubuntu:~# /etc/init.d/ssh start #启动SSH服务 [ ok ] Starting ssh (via systemctl): ssh.service. root@ubuntu:~# root@ubuntu:~# ps -e | grep ssh 1558 ? 00:00:00 sshd 2599 ? 00:00:00 ssh-agent root@ubuntu:~#
提高登录ssh速度配置,修改ssh默认端口号,如将默认端口号从22改为222,配置文件:
root@ubuntu:~# gedit /etc/ssh/sshd_config
重启ssh服务:
root@ubuntu:~# /etc/init.d/ssh restart [ ok ] Restarting ssh (via systemctl): ssh.service. root@ubuntu:~#十一、交叉编译器 11.1 交叉编译器概念
交叉编译器(Cross compilation tool chain)概念上在一个平台(架构-Architecture和操作系统Operating System)开发另一个平台的可执行代码。
通过交叉编译工具可以在CPU性能很强、存储资源充足的主机平台上编译出针对运行平台的可执行程序。
1、下载交叉编译器:
使用git工具下载源码,如果没有安装git工具,可以使用sudo
#apt-get install git进行安装: root@ubuntu:/root/john$ sudo git clone https://github.com/xupsh/Codesourcery.git Cloning into 'Codesourcery'... remote: Enumerating objects: 10044, done. Receiving objects: 22% (2248/10044), 14.04 MiB | 211.00 KiB/s
2、解压到指定目录
sudo gedit ~/.bashrc #加入一下两行 export PATH=$PATH:~/arm/Codesourcery/bin export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
验证arm-xilinx-linux-gnueabi-gcc -v出来版本信息,构建成功:
root@ubuntu:~# arm-xilinx-linux-gnueabi-ggc -v十二、Qt移植 12.1 下载、安装qt
下载链接:https://www.qt.io/download
安装qt:
sudo ./qt-opensource-linux-x64-5.7.0.run
安装之后的执行文件在/usr/bin,qt配置文件在/user/share/qt5
在qt安装路径下,运行:
./qtcreator
感谢阅读,祝君成功!
-by aiziyou



