For details, see the official website tutorial
Introduction: I came into contact with a factory-set ASUS TinkerBoard-S development board due to my graduation project. The flash memory is installed with Android by default, and it is configured from scratch. The hands-on experience record is as follows:
1. System startup method
1. Start the system from TF card
① Go to the official website of ASUS Pie to download the latest version of mirror
site one :
http://tinkerboarding.co.uk/wiki/index.php/TinkerOS
site two :
https://www.asus.com.cn/Single-Board-Computer /Tinker-Board-S/HelpDesk_Download/
②Download the image burning tool Etcher (or Win32DiskImager) to flash the image to the TF card
Etcher ( http://etcher.io/ )
Win32DiskImager ( http://sourceforge.net)
[Notes]
①It is best to use a high-speed TF card, 4G+ space
②If the TF card is not empty, you must back up the data in advance, once formatted, the data will be completely cleared. If the tf card has been swiped in other systems before, there is no need to format it again, and the flash will be cleared and divided into zones.
③The TF card after the flash can no longer be used for storing other things. It is normal that the recognized space becomes smaller after burning.
④If you need to restore as the original TF card, download bootsector.img and burn the images of bootsector.img into the TF card. After success, it will prompt that the TF card needs to be formatted, and it can be restored by formatting by default.
Link: https://pan.baidu.com/s/1bmUop4xch9Eq_F9W7jocjQ
Extraction code: v2t0
③After successful programming, insert the TF card into the development board and adjust the jumper cap as follows, then the development board will load the linux system from the TF card (otherwise the Android system will be loaded by default)
④Turn on the display screen, mouse and keyboard, then turn on the power, the Linux desktop will be displayed after about 30s
2. Boot the system from the built-in flash memory
Adjust the jumper cap as follows, the development board will load the Android system by default (equipped on the field)
3. Prepare for power-on
Connect HDMI to the display (display is necessary for the previous configuration), connect the mouse and keyboard to the USB, and then connect to the power supply. After about 30s, the Linux desktop will be displayed
2. Development environment configuration
1. Necessary prerequisite settings and updates
①Find the LXTerminal terminal from the menu in the lower left corner and open
② Initialize the root account
sudo passwd root
Enter root password
③Update
Modify the configuration file /etc/apt/sources.list
, (using nano editor, easy to paste)
sudo nano /etc/apt/sources.list
Comment out the original and replace the software source
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main non-free contrib
Then enter the root user
su root
Enter root password
Then update the software
sudo apt-get update
sudo apt-get upgrade
④By default, some common commands can only be used by root users. The following steps give ordinary users all command rights
sudo vi ~ / .profile
Add this line at the bottom of .profile:
export PATH= P A T H : " PATH:" PATH:"HOME/bin:/sbin"
Then validate the path file, or restart TinkerBoard
sudo source .profile
2. Set static IP on Linux
①Set static IP, gateway
sudo nano /etc/network/interfaces
Join (note: the Chinese comments at the back of the following should be removed)
auto eth0 #Automatically connect to the network at boot
allow-hotplug eth0
#hot start iface eth0 inet static #static means to use a fixed ip, set to dhcp to use dynamic ip
address 192.168.1.233 #set ip address
netmask 255.255.255.0 #set subnet mask Code
gateway 192.168.1.1 #Set the gateway
②Set up DNS
sudo nano /etc/resolv.conf
At the top, join
nameserver 192.168.1.1
Note: nameserver: set the first DNS as the first choice, and the others as the alternate DNS
③Restart TinkerBoard
After restarting, check whether the address of eth0 is the static IP set by default
3. Remove the SSH login permission of the development board
sudo nano /etc/ssh/sshd_config
①Login allowed
Find PermitRootLogin no and change it to yes (it should be commented out by default, remove the "#" comment)
②Open port 22
Find Port 22 (it should be commented out by default, remove the "#" comment)
③Restart the sshd service
service sshd restart
4. Set static IP on PC
①Connect the development board and the PC host with a network cable
②The PC host sets the static address of the network port connected to the development board to the same network segment as the development board IP, for example·:
Linux端IP:192.168.1.233
PC端IP:192.168.1.123
③Try to Ping each other
5. SSH client login to the development board
Username: linaro
Password: linaro
Host: (Static address set by the development board)
Port: 22
6, VNC remote login desktop
Foreword: The VNC service requires the system to have a graphical interface. The latest Debian system image on TinkerBoard's official website has a built-in LXDE graphical interface, no need to install it again (if it is a Linux server version system needs to install a graphical interface, the method is Baidu, this blog is for reference only)
①TinkerBoard official website mirror has built-in VNC service, follow the steps below to open
[Note] If your system does not have built-in VNC (or you cannot operate the graphical interface without plugging in the screen), you can download the VNC service
sudo apt-get install tightvncserver
②Open the VNC service in the terminal
To create a remote desktop, the "1" at the end means the number of remote desktops, corresponding to port 5901, and it needs to be incremented when opening more. In the following steps, "1" and "5901" should be changed accordingly (for example,> tightvncserver :2) Create a second remote desktop, corresponding to port 5092, and so on)
tightvncserver :1
Or (same effect)
vncserver :1
When you open it for the first time, you will be prompted to set the connection password, enter it twice (used when logging in on the PC), and then it will prompt:
Would you like to enter a view-only password (y/n)? n
Enter n and press Enter to pass.
The prompt is "Is it only for display?", if you select "y", you can only see it after logging in on the PC, and you cannot perform mouse and keyboard operations on the Linux desktop.
③Stop the VNC service (steps 3, 4, 5, and 6 can be ignored if VNC is enabled on the graphical interface)
The step ② just now is to create a remote desktop, because there are still some configurations that have not been made, turn it off first
tightvncserver -kill :1
or
vncserver -kill :1
④Open the VNC configuration file
sudo vi ~ / .vnc / xstartup
Paste the following Code text at the end of the existing content of the file:
lxterminal &
/usr/bin/lxsession -s LXDE &
(Additional content varies depending on the graphical interface used by the Linux system. Common graphical interfaces include KDE, GNOME, LXDE, XFCE, Mint, etc., and the graphical interface used by TinkerBoard is LXDE. Please Baidu for others)
⑤ Restart TinkerBoard
sudo reboot
⑥Open VNC service
vncserver :1
⑦Download and install VNC Viewer on PC,
Connect the network cable to the development board, open the VNC Viewer software, enter the Linux system IP address plus the port number, the usual format is: xx.xx.xx.xx::5901.
The first connection may prompt "unencrypted connect", which means an unencrypted connection. Don't care about daily use, just click "Continue" to ignore it.
⑧ Click Connect, enter the connection password set during installation in the pop-up dialog box (it is the connection password, not the root password, user password), and confirm the login.
⑨After logging in successfully, the classic LXDE desktop will appear in front of you, as shown below:
[Note] If the VNC Viewer does not display the taskbar: restart TinkerBoard, reopen the VNC service, and reconnect the VNC Viewer on the PC; if the above situation occurs, it is recommended that you do not kill the VNC after the first creation of the VNC after the TinkerBoard is turned on, and let it run in Backstage is fine.
7. FTP mutual file transfer
Install FTP server
sudo apt-get install vsftpd
After installation, you need to modify its configuration file /etc/vsftpd.conf, and find the following two lines in the file:
#local_enable=YES
#write_enable=YES
Remove the pound sign "#" in front of them, and then execute the following command to restart the FTP service:
sudo service vsftpd restart
Then log in with FTP client software (XShell, SecureCRT, etc.) on the PC.
Username: linaro
Password: linaro
Host: (Static address set by the development board)
Port: 21
3. Make a backup of the .img image (TinkerBoard-S verification, others for reference)
Foreword: It is more complicated to directly use the dd command to generate an img image in the Linux system, and the probability of error is high, so it is not suitable for promotion. So I developed a more intuitive and simplified way to back up images
Prerequisite: The system has been burned to the flash memory (the built-in flash memory of TinkerBoard-S is 16GB) and can be booted
①Connect the computer and the development board with USB, the development board is recognized.
②Create an empty .img file on the computer (create an empty .txt file, then change the suffix to .img)
③Put the empty .img file on the disk with more than 16GB of free space (because the size of the .img file read out is the same size as the flash memory of the development board)
④ Use Win32DiskImager, select the empty .img file just created, select the disk as the disk recognized by the development board, and press "Read" (a longer time, about 30 minutes)
⑤After completion, the img file becomes about 16GB in size
⑥Cut the image file, PiShrink crop
First put the image file in the Linux shared folder, open the virtual machine to run the terminal, and enter the shared folder
Download the pishrink.sh script and grant execution rights (the script and the mirror must be in the same folder)
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
Then execute the script (test.img is the image file)
sudo bash pishrink.sh test.img
⑦After waiting, the img file size will be much smaller (because only useful content is left)
⑧ You're done! The cropped img images can be burned into similar devices in batches using Etcher (or Win32DiskImager).