Author: Peng Donglin
E-mail: [email protected]
reference
https://gist.github.com/tessus/5e118d44261a6ab2f198
surroundings
Qemu-4.1
Linux-4.14
ARM64
aarch64-linux-gnu-gcc 8.3
Outline
During the embedded start, often used the serial port, so that you can use to log on to the board serial port, but if a serial port functions by a plurality of terminals, then, for our development and debugging will be more convenient, but it tmux It provides such functionality.
Here's how tmux static cross-compiled to run on the development board in the arm.
Software version
tmux-2.1
libevent:2.1.10
ncurses-6.1
text
Cross compiler tmux need libevent and ncurses two packages.
Download and compile libevent
1、下载libevent:https://github.com/libevent/libevent/releases/download/release-2.1.10-stable/libevent-2.1.10-stable.tar.gz
2, extract and cross-compiler, the following is compiled script:
1 ./configure --prefix=`pwd` \ 2 --host=aarch64-linux-gnu \ 3 --disable-shared 4 5 make 6 make install
Download and compile ncurses
1. Download ncurses: https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz
2, extract and cross-compiler, the following is compiled script:
1 ./configure --prefix=`pwd` \ 2 --host=aarch64-linux-gnu \ 3 --with-default-terminfo-dir=/usr/share/terminfo \ 4 --with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo" 5 6 make 7 make install
Download and compile tmux
1、下载tmux:https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz
2, unzip and cross-compiler, the following is compiled script:
1 export CFLAGS="-I/home/pengdl/work/Third_Part/tmux/libevent-2.1.10-stable/include/ \ 2 -I/home/pengdl/work/Third_Part/tmux/ncurses-6.1/include \ 3 -I /home/pengdl/work/Third_Part/tmux/ncurses-6.1/include/ncurses" 4 5 export LDFLAGS="--static -L/home/pengdl/work/Third_Part/tmux/libevent-2.1.10-stable/lib/ \ 6 -L/home/pengdl/work/Third_Part/tmux/ncurses-6.1/lib" 7 8 ./configure --prefix=`pwd` \ 9 --host=aarch64-linux-gnu \ 10 --enable-static
The above is complete cross-compiler, then the executable program tmux
Copy terminfo profile
The terminfo configuration files are copied to the development board, you can copy only the actual use of:
# Create the following directories in the file system with cd rootfs / mkdir -p usr / report this content share / terminfo / terminfo file copy on # PC cp / lib / terminfo / * usr / report this content share / terminfo / -Raf
The following configuration is available TERM:
$ tree usr/share/terminfo/ usr/share/terminfo/ ├── a │ └── ansi ├── c │ ├── cons25 │ ├── cons25-debian │ └── cygwin ├── d │ └── dumb ├── E │ ├── Eterm │ └── Eterm-color -> Eterm ├── h │ └── hurd ├── l │ └── linux ├── m │ ├── mach │ ├── mach-bold │ ├── mach-color │ ├── mach-gnu │ └── mach-gnu-color ├── p │ └── pcansi ├── r │ ├── rxvt │ ├── rxvt-basic │ ├── rxvt-m -> rxvt-basic │ ├── rxvt-unicode │ └── rxvt-unicode-256color ├── s │ ├── screen │ ├── screen-256color │ ├── screen-256color-bce │ ├── screen-bce │ ├── screen-s │ ├── screen-w │ ├── screen.xterm-256color │ └── sun ├── v │ ├── vt100 │ ├── vt102 │ ├── vt220 │ └── vt52 ├── w │ ├── wsvt25 │ └── wsvt25m └── x ├── xterm ├── xterm-256color ├── xterm-color ├── xterm-debian -> xterm ├── xterm-mono ├── xterm-r5 ├── xterm-r6 ├── xterm-vt220 └── xterm-xfree86 13 directories, 43 files
启动开发板,查看当前TERM
[root@aarch64 ]# echo $TERM vt102
可以根据自己的喜好,选择相应的配置,个人感觉linux配置不过,设置方法:
export TERM=linux
修改终端size
stty rows 30 cols 120
It can be modified according to the actual size of the terminal. View the current terminal size:
[root@aarch64 ]# stty rows 30 cols 120 [root@aarch64 ]# stty size 30 120
Start tmux
tmux new -s wk
Finish.