工具/软件:
我已在 u-boot 中设置了一个 MAC 地址并保存了环境、但一旦启动、Linux 中就不会反映这一点。 当我在 u-boot 中设置 serial#时、它也反映在 Linux 中。 我不确定内核为什么不使用设置的 MAC 地址。 我是否需要使用设置或配置选项来配置内核以允许此操作?
U-boot 版本:TI-uboot-2023.04
内核版本:TI-Linux-6.1
在 u-boot 中设置环境(这在下电上电后是持久的、并保存在 eMMC 的引导分区中):
U-Boot 2023.04-gc30478b7-dirty (Apr 24 2025 - 13:20:35 +0200) CPU : AM335X-GP rev 2.1 Model: TI AM335x BeagleBone Black DRAM: 512 MiB Core: 161 devices, 18 uclasses, devicetree: separate WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) NAND: 0 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... <ethaddr> not set. Validating first E-fuse MAC Net: eth2: ethernet@4a100000, eth3: usb_ether Hit any key to stop autoboot: 0 => print ethaddr ethaddr=88:0c:e0:3f:d3:0e => print serial# serial#=88:0c:e0:3f:d3:0e => setenv ethaddr D4:84:31:9C:68:2C => setenv serial# 1234-1234 => saveenv Saving Environment to FAT... OK =>
在下电上电后确认变量:
U-Boot SPL 2023.04-gc30478b7-dirty (Oct 08 2024 - 12:05:34 +0200) Trying to boot from MMC2 U-Boot 2023.04-gc30478b7-dirty (Apr 24 2025 - 13:20:35 +0200) CPU : AM335X-GP rev 2.1 Model: TI AM335x BeagleBone Black DRAM: 512 MiB Core: 161 devices, 18 uclasses, devicetree: separate WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout) NAND: 0 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Loading Environment from FAT... OK Net: eth2: ethernet@4a100000, eth3: usb_ether Hit any key to stop autoboot: 0 => print ethaddr ethaddr=D4:84:31:9C:68:2C => print serial# serial#=1234-1234 =>
相关启动日志:
... [ 1.803560] omap_rng 48310000.rng: Random Number Generator ver. 20 [ 1.810404] random: crng init done [ 1.870255] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000 [ 1.878163] davinci_mdio 4a101000.mdio: detected phy mask fffffffe [ 1.911397] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 [ 1.930809] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property [ 1.939388] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4 [ 1.960273] cpsw 4a100000.ethernet: ALE Table size 1024 [ 1.965760] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies) [ 1.990289] cpsw 4a100000.ethernet: Detected MACID = 88:0c:e0:3f:d3:0e [ 2.017371] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present! [ 2.040265] edma 49000000.dma: TI EDMA DMA engine driver ...
如果您希望获得任何帮助、
TJ