The reason why Can & #39; t over write is prompted when setenv ethaddr is executed and the solution is as follows:

Source: Internet
Author: User

The UBOOT mac can be changed only once. You can check the UBOOT source code. Whether the UBOOT mac can be changed repeatedly depends on the system configuration.

The relevant code is in common \ cmd_nvedit.c under the uboot source code directory.


#ifndef CONFIG_ENV_OVERWRITE      /*      * Ethernet Address and serial# can be set only once,      * ver is readonly.      */      if ( (strcmp (name, "serial#") == 0) ||      ((strcmp (name, "ethaddr") == 0)      #if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) &&                    defined(CONFIG_ETHADDR)                  && (strcmp (env_get_addr(oldval),MK_STR                  (CONFIG_ETHADDR)) != 0)      #endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */      ) ) {      printf ("Can't overwrite \"%s\"\n", name);      return 1;      }      #endif


From this code analysis, we know that if CONFIG_ENV_OVERWRITE is not defined, it cannot

Change the MAC address multiple times, so as long as # define CONFIG_ENV_OVERWRITE is defined

Yes. I don't know where the definition is suitable. I defined it in "include/configs/" and

In the configuration header file corresponding to the board. For reference only


This article is from the "ITDS" blog, please be sure to keep this source http://limingshang.blog.51cto.com/2975568/1281350

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.