Qemu builds ARM vexpress development environment (Part 3) ---- NFS network root file system

Publisher:温暖心情Latest update time:2020-02-14 Source: eefocusKeywords:Qemu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the previous article "Qemu builds ARM vexpress development environment (II) ---- Start the Linux kernel through u-boot", it has been realized to load the kernel through u-boot to start the development board and mount the root file system. This article describes how to mount the root file system through the NFS network.


Through the NFS network root file system, the development board can mount the root file system on another PC host through the NFS network after starting the kernel through u-boot. It provides great convenience for work and study in the development and debugging stage. You can directly develop and compile drivers or APPs on the Linux host, and copy the target files to the NFS service directory for use (the files are equivalent to being copied to the root file system of the development board). You can also directly modify other files in the rootfs file system on the host side, which is equivalent to directly modifying them on the development board.


This article introduces the steps to mount the network root file system using NFS. This method is not only applicable to the ARM vexpress development board environment built by Qemu, but also to all other development board entities.


Since the NFS network file system production methods of each development board are the same, you can also refer to the NFS network file system production method part in the Exynos4412 and NanopiNEO development board environment construction.


1. Environment Configuration

Linux host supports NFS service

Modify bootargs startup parameters

Set up NFS as the root file system

Set the host NFS file system address

The kernel supports NFS mounting file systems


2. Install and configure NFS service

2.1 Enabling NFS service on Linux host

Install:


# sudo apt install nfs-kernel-server

Configure NFS:


# vim /etc/exports

// Add NFS shared directory

/home/mcy/qemu/rootfs *(rw, sync, no_root_squash, no_subtree_check)

    rw Readable and writable operation

    sync Keep the contents of memory and disk synchronized

    no_root_squash The Linux host no longer sets the development board to an anonymous user, and can operate file reading and writing

    no_subtree_check Do not check the root file system subdirectory files

Restart the NFS service:


sudo /etc/init.d/rpcbind restart

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

or:


# systemctl restart nfs-kernel-server

Check whether the NFS shared directory is created:


# sudo showmount -e

Export list for mcy-VirtualBox:

/home/mcy/qemu/rootfs *

Note:

When using the NFS network file system, the Linux host needs to close the system firewall; otherwise, the system will fail during operation.


2.2 Development board configuration supports NFS network

Modify the startup parameters in u-boot:


# vim include/configs/

CONFIG_BOOTCOMMAND

    setenv bootargs 'root=/dev/nfs rw   

    nfsroot=192.168.0.105:/home/mcy/qemu/rootfs init=/linuxrc   

    ip=192.168.0.110 console=ttyAMA0';   

Configure the kernel to support NFS mounting file systems


Improve NFS file system

Reboot command


3. Create a root file system

Compile busybox


nfs

Linux System Utilities --->

    [*] mount (30 kb)

        [*] Support mounting NFS file systems on Linux < 2.6.23

Create a rootfs directory and create files under the rootfs directory:


# mkdir etc

# cd etc

# vim inittab

::sysinit:/etc/init.d/rcS // Execute the rcS script

#::respawn:-/bin/sh

#tty2::askfirst:-/bin/sh

#::ctrlaltdel:/bin/umount -a -r


console::askfirst:-/bin/sh

::ctrlaltdel:/sbin/reboot

::shutdown:/bin/umount -a -r

# vim init.d/rcS

#!/bin/sh

PATH=/sbin:/bin:/user/sbin:/usr/bin

LD_LIBRARY_PATH=/lib

export PATH LD_LIBRARY_PATH


mount -a // Mount the root file system fstab

mkdir -p /dev/pts

mount -t devpts devpts dev/pts

mdev -s

mkdir -p /var/lock


echo "......"

# vim fstab

proc /proc proc defaults 0 0

tmpfs /tmp tmpfs default 0 0

sysfs /sys sysfs default 0 0

tmpfs /dev tmpfs default 0 0

var /dev tmpfs default 0 0

ramfs /dev ramfs default 0 0

# vim profile

PS1='xiami@vexpress:w #'

export PS1

You can also modify or set PS1 in ~/.bashrc


Startup process:

After the Linux kernel starts, mount the root file system

Start the init process, bootargs init=/linuxrc, and start the first user process

Read the inittab script in the user process,


Building other directories

Other directories can be empty directories


# cd rootfs

# mkdir proc mnt tmp sys root


Keywords:Qemu Reference address:Qemu builds ARM vexpress development environment (Part 3) ---- NFS network root file system

Previous article:ARM development environment based on Allwinner H3 chip
Next article:Qemu builds ARM vexpress development environment (Part 2) ---- Start the Linux kernel through u-boot

Recommended ReadingLatest update time:2024-11-16 19:33

Linux-ARM Interrupt GIC Analysis
  1. “Stand high and pee far”   GIC is an interrupt controller. Don't confuse it with the ARM core interrupts. These interrupts are connected to the ARM core's IRQ or FIQ.   To understand the ARM interrupt system, GIC is definitely not to be missed. Here is a picture that everyone can find on Baidu.       Don't co
[Microcontroller]
Linux-ARM Interrupt GIC Analysis
ARM basics: correspondence between Linux operating state and ARM operating mode
ask: From a certain perspective, kernel state is similar to soft interrupt. The system usually runs in user state. It switches to kernel state only after a specific operation occurs. There is always an idle process (user state) running. This idle process ensures that the system usually runs in user state. The process
[Microcontroller]
ARM UART initialization program
 
[Microcontroller]
Quickly learn Arm (23)--lpc2300 system clock 2
Continuing from the previous article, let's take a look at the PLL setup steps: 1. If the PLL is already connected, we disconnect it first by using a feed sequence to disconnect the PLL. The feed sequence is of course implemented by writing the feed register PLLFEED. The feed sequence mechanism is used to prevent the
[Microcontroller]
ARM7 LPC2103 interrupt processing method
        The Vectored Interrupt Controller (VIC) has 32 interrupt request inputs that can be programmed into three categories: FIQ, Vectored IRQ, and Non-Vectored IRQ. The programmable allocation mechanism means that the interrupt priorities of different peripherals can be dynamically allocated and adjusted. Fast inter
[Microcontroller]
Multi-channel motor control solution based on ARM and FPGA
This paper introduces a multi-axis controller based on FPGA. The controller is mainly composed of arm7 (LPC2214) and FPGA (EP2C5T144C8) and its peripheral circuits, which is used to control the movement of multiple motors at the same time. The motor control logic is implemented in FPGA using Verilog HDL hardware descr
[Microcontroller]
Multi-channel motor control solution based on ARM and FPGA
Optimizing Industrial Control with ARM Architecture Processors
Operating modern factories and processing plants is technically complex. To achieve precise control of machinery and production processes, manufacturers need to adopt the latest series of sensors, actuators and servo systems. As an example of adding technology to gain the advantages of precise control functions, var
[Industrial Control]
Optimizing Industrial Control with ARM Architecture Processors
Build nfs on Centos and mount it on 6410 development board
Use rpm -qa | grep nfs to check whether the tftp server is installed yum  install nfs 1. Server installation: 1.setup 2.System Services 3. Check *nfs 4.service nfs restart Permissions file configuration example: 1.vi /etc/exports 2. Write /nfsroot/rootfs 172.22.17.* (rw,
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号