[기타] JZ2440은 NFS 네트워크 파일 시스템을 마운트합니다.

1. 가상 머신, PC 및 개발 보드에 대해 ping을 수행합니다.

이번에 PC는 무선 네트워크 카드를 사용해 WIFI에 연결해 인터넷 접속을 한 뒤, PC는 유선 네트워크 카드를 이용해 네트워크 케이블을 통해 JZ2440 네트워크 포트에 연결한다.다음 단계는 PC, JZ2440을 만드는 것이다. 및 동일한 네트워크의 가상 머신 네트워크.

호스트: 192.168.1.10
가상 머신: 192.168.1.108
개발 보드: 192.168.1.17

1.1 컴퓨터 네트워크 케이블 구성

네트워크 케이블을 연결한 후, 네트워크 케이블의 포트 번호를 설정하세요.구체적인 과정은 다음과 같습니다:
나타나다네트워크 케이블의 포트를 찾아 속성을 통해 포트 번호를 설정하세요.

여기에 이미지 설명을 삽입하세요.
여기에 이미지 설명을 삽입하세요.
여기에서는 네트워크 IP 주소, 서브넷 마스크 및 게이트웨이가 설정됩니다.

1.2 가상 머신의 네트워크 구성

가상 네트워크 편집기를 열고 브리지 모드를 선택한 후 PC의 유선 네트워크 카드를 연결합니다.
여기에 이미지 설명을 삽입하세요.
가상 머신의 IP 주소를 다음과 같이 설정합니다.
여기에 이미지 설명을 삽입하세요.
컴퓨터의 로컬 핑이 실패하면 로컬 방화벽이 켜져 있다는 의미이므로 끄기만 하면 됩니다.3
여기에 이미지 설명을 삽입하세요.
개의 네트워크를 서로 ping하여 ping이 성공하는지 확인합니다. ping에 성공하면 적응이 완료된 것입니다.

2. NFS를 자동으로 시작하도록 개발 보드를 구성합니다.

개발 보드를 켭니다. u-boot 인터페이스에서 네트워크 NFS 시작을 마운트하려면 set cmd를
여기에 이미지 설명을 삽입하세요.
변경해야 한다는 것을 알 수 있습니다. 다음 명령을 설정합니다.

nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]

  If the `nfsroot' parameter is NOT given on the command line,
  the default "/tftpboot/%s" will be used.

  <server-ip>	Specifies the IP address of the NFS server.
		The default address is determined by the `ip' parameter
		(see below). This parameter allows the use of different
		servers for IP autoconfiguration and NFS.

  <root-dir>	Name of the directory on the server to mount as root.
		If there is a "%s" token in the string, it will be
		replaced by the ASCII-representation of the client's
		IP address.

  <nfs-options>	Standard NFS options. All options are separated by commas.
		The following defaults are used:
			port		= as given by server portmap daemon
			rsize		= 4096
			wsize		= 4096
			timeo		= 7
			retrans		= 3
			acregmin	= 3
			acregmax	= 60
			acdirmin	= 30
			acdirmax	= 60
			flags		= hard, nointr, noposix, cto, ac


ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>

  This parameter tells the kernel how to configure IP addresses of devices
  and also how to set up the IP routing table. It was originally called
  `nfsaddrs', but now the boot-time IP configuration works independently of
  NFS, so it was renamed to `ip' and the old name remained as an alias for
  compatibility reasons.

  If this parameter is missing from the kernel command line, all fields are
  assumed to be empty, and the defaults mentioned below apply. In general
  this means that the kernel tries to configure everything using
  autoconfiguration.

  The <autoconf> parameter can appear alone as the value to the `ip'
  parameter (without all the ':' characters before) in which case auto-
  configuration is used.

  <client-ip>	IP address of the client.

  		Default:  Determined using autoconfiguration.

  <server-ip>	IP address of the NFS server. If RARP is used to determine
		the client address and this parameter is NOT empty only
		replies from the specified server are accepted.

		Only required for for NFS root. That is autoconfiguration
		will not be triggered if it is missing and NFS root is not
		in operation.

		Default: Determined using autoconfiguration.
		         The address of the autoconfiguration server is used.

  <gw-ip>	IP address of a gateway if the server is on a different subnet.

		Default: Determined using autoconfiguration.

  <netmask>	Netmask for local network interface. If unspecified
		the netmask is derived from the client IP address assuming
		classful addressing.

		Default:  Determined using autoconfiguration.

  <hostname>	Name of the client. May be supplied by autoconfiguration,
  		but its absence will not trigger autoconfiguration.

  		Default: Client IP address is used in ASCII notation.

  <device>	Name of network device to use.

		Default: If the host only has one device, it is used.
			 Otherwise the device is determined using
			 autoconfiguration. This is done by sending
			 autoconfiguration requests out of all devices,
			 and using the device that received the first reply.

  <autoconf>	Method to use for autoconfiguration. In the case of options
                which specify multiple autoconfiguration protocols,
		requests are sent using all protocols, and the first one
		to reply is used.

		Only autoconfiguration protocols that have been compiled
		into the kernel will be used, regardless of the value of
		this option.

                  off or none: don't use autoconfiguration (default)
		  on or any:   use any protocol available in the kernel
		  dhcp:        use DHCP
		  bootp:       use BOOTP
		  rarp:        use RARP
		  both:        use both BOOTP and RARP but not DHCP
		               (old option kept for backwards compatibility)

                Default: any

작성자의 설정은 다음과 같습니다.

bootargs noinitrd root=/dev/nfs nfsroot=192.168.1.108:/work/nfs_root/first_fs ip=192.168.1.17:192.168.1.108:192.168.1.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0 설정 ,115200

설정을 완료한 후 저장하고, 아래와 같이 재시작하면 부팅할 때마다 NFS가 자동으로 마운트됩니다.
여기에 이미지 설명을 삽입하세요.

문제 발생:
가상 머신에서 브리지 모드를 설정한 후 가상 머신을 다시 시작하면 가상 머신이 인터넷에 액세스할 수 없습니다. 브리지 네트워크 설정을 자동으로 재설정해야 합니다. 브리지 네트워크 케이블이 직접 연결되어 있기 때문에 발생할 수 있습니다. 개발 보드)

추천

출처blog.csdn.net/weixin_45281868/article/details/126294407