IMX6ULL development board Ubuntu file system Ubuntu-base build
[Copy link]
This post was last edited by Yaojishanchuan on 2021-2-2 14:03
Article Contents
1 Unzip Ubuntu-base
2 Install Qemu-User-Static tool
3 Set software source
4 Mount the root file system and Chroot
1 Unzip Ubuntu-base
We use the command "tar xvf ubuntu-base-16.04.5-base-armhf.tar.gz", as shown in Figure 1.1:
After decompression is complete, it is the root file system. Use the command "ls" to view the directory.
2 Install the Qemu-User-Static tool
QEMU is a software that simulates different machine architectures. It is well supported in Ubuntu. If you need to mount the Ubuntu armhf version of the file, you must install the qemu-user-static tool.
First, use the command "apt-get install qemu-user-static" in Ubuntu to install it. Press y to continue during the installation process. As shown in Figure 2.1:
This step is to install qemu-user-static on Ubuntu on the PC, and then use the command
"cp /usr/bin/qemu-arm-static ./usr/bin/" to copy qemu-arm-static to the directory just decompressed. As shown in Figure 2.2:
3 Set up the software source
Ubuntu installs software by downloading it from the Internet through apt-get. We need to specify the software source.
In order to successfully create a root file system that can connect to the Internet, you can directly copy the local DNS configuration file to the corresponding location of the root file system, using the command "cp /etc/resolv.conf ./etc/resolv.conf", as shown in Figure 3.1:
Then modify the root file system software source and use the command "vim ./etc/apt/sources.list" to enter the file. As shown in Figure 3.2:
Add the Ubuntu arm source. I chose the source from USTC. Add the following at the end of the article:
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb http:/ /mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors .ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors .ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb -src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
as shown in Figure 3.3:
Save and exit.
4 Mount the root file system and Chroot
(1) First, mount the file system you just downloaded on the local machine. You need to mount the proc, sys, dev, dev/pts and other file systems. Use the command "vi mount.sh" to add a mount script. As shown in Figure 4.1:
The content of the umount.sh script for the mounting process is as follows:
Figure 4.2:
Save and exit:
(2) Then use the command "vi umount.sh" to add the uninstall script. As shown in Figure 4.3:
The content of the uninstallation script umount.sh is as follows:
As shown in Figure 4.4:
Save and exit.
(3) Then use the command "chmod 777 mount.sh umount.sh" to modify the script permissions, as shown in Figure 4.5:
(4) Then use the command "mount.sh" to run the mount. As shown in Figure 4.6:
At this point we can see that the root directory has been switched to the directory where Ubuntu is currently being created.
(5) Since Ubuntu Base is a minimal root file system, many commands and software are missing, so we need to install some commonly used commands and software first. Enter the following command:
Some screenshots are shown in Figure 4.7:
(6) Then use the command "passwd root" to set the root user password. Here we set it to topeet. As shown in Figure 4.8:
(7) Next, use the following command to set the host name and local IP:
As shown in Figure 4.9:
(8) Next, configure the serial port terminal. We use the command "ln -s /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttymxc0.service" to specify the serial port terminal. As shown in Figure 4.10:
Since I am using the i.mx6u platform, I need to add a link named getty@ttymxc0.service to connect to the getty@.service service. The i.mx platform is ttymxc0.
(9) Next, configure DHCP. You can also wait until it is downloaded to the development board before configuring it, but it will be very slow when starting. Use the following command:
As shown in Figure 4.11:
(10) After setting up, you can exit the root file system. Enter the command "exit" to exit. As shown in Figure 4.12:
(11) Finally, we will exit and then execute the umount.sh script to cancel the mount. As shown in Figure 4.13:
At this point, the ubuntu base root file system has been created, and then we can use the development board to test it.
|