是否可以完全从 NVME 启动 Rpi CM4 + io-board?我更新了 Rpi 引导程序,它可以在没有 U-boot 的情况下很好地加载内核。当我切换到 U-boot 时,它不会加载位于同一 FAT 分区中的 boot.scr。它尝试 mmc、usb,但从不尝试 nvme 驱动器。我的问题是什么?
我正在学习u-boot。使用 qemu 模型,我可以(使用 qemu)将图像加载到我想要的内存位置,并且可以使用booti addr
命令运行内核启动。如您所知,在 arm64 中,没有 uImage。
那么,在为arm(32位)构建linux内核时,是什么make LOADADDR=0x20008000 uImage
意思呢?无论如何,我们可以使用 u-boot shell 在任何我们想要的地方加载(从 SD 卡或网络)uImage。那么,是不是说当我们运行bootm
命令时,u-boot程序将uImage里面的内核镜像重定位到了0x20008000呢?很难找到这些信息。
我有一个 ARM 开发板(STM32MP157A-DK1),我正在四处寻找 Linux 映像是如何构建的。
我boot.scr.uimg
在引导分区中有文件。据我所知boot.scr.uimg
是压缩版boot.scr
。
有什么方法可以解压缩/提取原始boot.scr
文件boot.scr.uimg
吗?
这是结果file boot.scr.uimg
:
boot.scr.uimg: u-boot legacy uImage, , Linux/ARM, Script File (Not compressed), 1489 bytes, Thu Jan 1 00:00:00 1970, Load Address: 0x00000000, Entry Point: 0x00000000, Header CRC: 0xC80D8B27, Data CRC: 0x62B32EA2
printenv
U-Boot CLI 中的结果:
STM32MP> printenv
altbootcmd=run bootcmd
arch=arm
autoload=no
baudrate=115200
board=stm32mp1
board_name=stm32mp157c-dk2
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_device=mmc
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_instance=0
boot_net_usb_start=true
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0
bootcmd=run distro_bootcmd
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_mmc2=setenv devnum 2; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_ubifs0=setenv devnum 0; run ubifs_boot
bootcount=2
bootdelay=1
bootlimit=0
cpu=armv7
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
ethaddr=00:80:e1:42:5d:63
fdt_addr_r=0xc4000000
fdt_high=0xffffffff
fdtcontroladdr=ddc3c4f8
initrd_high=0xffffffff
kernel_addr_r=0xc2000000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
mtdparts_nand0=2m(fsbl),2m(ssbl1),2m(ssbl2),-(UBI)
mtdparts_nor0=256k(fsbl1),256k(fsbl2),2m(ssbl),256k(logo),-(nor_user)
preboot=echo "Boot over ${boot_device}${boot_instance}!"; if test ${boot_device} = serial; then stm32prog serial ${boot_instance}; else if test ${boot_device} = usb; then stm32prog usb ${boot_instance}; else if test ${boot_device} = mmc; then env set boot;
pxefile_addr_r=0xc4200000
ramdisk_addr_r=0xc4400000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0xc4100000
serial#=0038001A3338510A39303435
serverip=192.168.1.1
soc=stm32mp
splashimage=0xc4300000
stderr=serial
stdin=serial
stdout=serial
ubifs_boot=env exists bootubipart || env set bootubipart UBI; env exists bootubivol || env set bootubivol boot; if ubi part ${bootubipart} && ubifsmount ubi${devnum}:${bootubivol}; then setenv devtype ubi; run scan_dev_for_boot; fi
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
usb_pgood_delay=2000
vendor=st
Environment size: 3053/4092 bytes
STM32MP>
我对 U-Boot 还没有太多经验,所以我不确定它是否与boot.scr
. 我仍然想知道如何在不访问 U-Boot CLI的情况下boot.scr
从中提取。boot.scr.uimg
我的 u-boot 脚本中有一行如下所示:
# set default Linux kernel boot parameters
setenv bootargs console=ttyPS0,115200 root=/dev/mmcblk0p2 ro rootfstype=ext4 earlyprintk rootwait uio_pdrv_genirq.of_id="generic-uio" fsck.mode=force fsck.repair=yes
使用 setenv 设置 u-boot 变量的最大行长是多少?我以前看过很长的引用,我想知道什么是最佳实践。
我在尝试为我的嵌入式 linux 系统配置 bootargs 时遇到了问题。设备树被编译成与内核相同的映像。它包括引导参数 ( /chosen/bootargs )。此外,我需要在(uboot)运行时配置一些时间。这意味着我需要能够同时使用两者。我知道内核有一个配置定义(https://stackoverflow.com/a/48814885/11312396),但这仅适用于arm(我使用的是aarch64)。
我目前正在尝试使用 uboot 的 fdt 命令将设备树引导参数加载到 uboot 中并将它们附加到那里。然后内核使用 uboot 传递的那些。
那里的问题是获取设备树地址。因为它被编译成一个扁平化的图像树,我只知道它的基地址,我没有设备树 blob 本身的地址。我可以通过使用iminfo
uboot 命令手动找到它,但 uboot 没有工具来解析该命令的输出。
## Checking Image at 03000000 ...
FIT image found
FIT description: U-Boot fitImage for Ultra96 kernel
Image 0 (kernel@0)
Description: Linux Kernel
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x030000d4
Data Size: 7399390 Bytes = 7.1 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x00080000
Entry Point: 0x00080000
Hash algo: sha1
Hash value: 47edccde80d64c636a01dbf4916662e2cdbfda96
Image 1 (fdt@0)
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x0370e9ac
Data Size: 41889 Bytes = 40.9 KiB
Architecture: AArch64
Hash algo: sha1
Hash value: d977763b2ec8079aca8908b28c732c3a79e1f7ab
Default Configuration: 'conf@1'
Configuration 0 (conf@1)
Description: Boot Linux kernel with FDT blob
Kernel: kernel@0
FDT: fdt@0
## Checking hash(es) for FIT Image at 03000000 ...
Hash(es) for Image 0 (kernel@0): sha1+
Hash(es) for Image 1 (fdt@0): sha1+
所以我试图自己反编译它的标题,但这有点超出我的能力:
03000000: edfe0dd0 98907100 38000000 988e7100 .....q.....8.q..
03000010: 28000000 11000000 10000000 00000000 ...(............
03000020: 6c000000 608e7100 00000000 00000000 ...l.q.`........
03000030: 00000000 00000000 01000000 00000000 ................
03000040: 03000000 04000000 5c000000 e1e8455c ...........\\E..
03000050: 03000000 23000000 00000000 6f422d55 .......#....U-Bo
03000060: 6620746f 6d497469 20656761 20726f66 ot fitImage for
03000070: 72746c55 20363961 6e72656b 00006c65 Ultra96 kernel..
03000080: 03000000 04000000 0c000000 01000000 ................
03000090: 01000000 67616d69 00007365 01000000 ....images......
030000a0: 6e72656b 30406c65 00000000 03000000 kernel@0........
030000b0: 0d000000 00000000 756e694c 654b2078 ........Linux Ke
030000c0: 6c656e72 00000000 03000000 dee77000 rnel.........p..
030000d0: 1b000000 00088b1f 00000000 5bec0302 ...............[
030000e0: d754540d f7bfff9d 23010f86 c087c332 .TT........#2...
030000f0: 8c0199d9 59ac493a e4688106 d1a260cd ....:I.Y..h..`..
TLDR:是否有可能从上面列出的 FIT 文件头转储到设备树的起始地址 (0x0370e9ac)
我有一个 BeagleBone Black,带有 Debian 8.3、Linux 4.1.15-ti-rt-r43。
编辑:系统安装在内部闪存上。
我修改了 /boot/uEnv.txt 以加载不同的 dtb 文件,显然文件名错误,因此它无法启动到 Linux。
所以我通过我的 PC 上的 J1 引脚/UART0 -> 终端程序连接。我看到 U-Boot 抱怨找不到文件,所以它不会启动 Linux,并给了我 U-Boot 命令。输入“帮助”后列出的内容看起来不是很有用。
使用 U-Boot 命令从我的串行控制台修复 uEnv.txt 是否可能且可行 - 这会起作用......如何?或者,最好的方法是什么?
编辑#2:在这个网站上找到一些有用的碎片,这并不能完全说明问题,但会引导一个有用的方向:https ://www.compulab.co.il/utilite-computer/wiki/index.php/Utilite_U-Boot_User_How -To%27s我发现我实际上可以看到 uEnv.txt 在 U-Boot 控制台中输入:“ls mmc 1 boot”,U-Boot 中的 ls 命令需要设备名 + num,显然我的 SD 卡是 mmc0,内部闪存 mmc1,有趣的命令。唉,U-Boot 没有“猫”,显然更不用说编辑器了。就像一个带着遥控手臂的孩子试图抓住一只毛绒动物换一些硬币,不能完全抓住我的文件,而且它是如此接近,啊!
编辑#3:我看到我在 mmc1 上有一个旧的 uEnv.txt 备份文件。有 U-Boot 命令“加载”,将文件加载到内存中,以及“保存”,以保存文件。您必须指定地址和大小。您从“ls mmc 1 boot”命令看到的文件大小。查看这张幻灯片第 35 页上的内存映射:https ://www.slideshare.net/chrissimmonds/embedded-linux-quick-start-guide,RAM从0x80000000开始。猜测如果只有 U-Boot 在 RAM 中,希望在 384 MB 上什么都没有,我尝试将文件加载到98000000,并从那里保存,但保存返回“无法写入文件”。太糟糕了。
注意:这不是关于使用 nfs 作为 rootfs 或使用 tftp 下载内核。
U-boot 基于v2017.11
,板子是定制的,但类似于 imx6dl-sabresd。
我已经入驻CONFIG_CMD_NFS=y
了.config
。我在 Arch Linux 主机上有一个可以工作的 nfs 服务器。我可以将 nfs 共享挂载为我的 rootfs。
我的 nfs 共享位于/srv/nfs/foo
,/etc/exports.d/foo.exports
看起来像
/srv/nfs/foo *(rw,async,no_subtree_check,no_root_squash)
当我尝试做 egnfs $loadaddr $nfsroot/boot/zImage
时,它只是继续打印T
超时。(nfsroot=/srv/nfs/foo
以匹配导出。)该文件存在于共享中并且网络正在运行(ping $serverip
工作)。
一段时间后,我启动了我的 Cubox i4 Pro。这台微型计算机使用 U-Boot,或者至少应该这样做。但是,盒子无法启动。
当我通过 micro-USB 连接我的 Mac 或通过 HDMI 连接显示器时,我看到:
U-Boot SPL 2017.11-armbian (Jan 24 2018 - 22:39:16)
Trying to boot from MMC1
U-Boot 2017.11-armbian (Jan 24 2018 - 22:39:16 +0100)
CPU: Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
CPU: Extended Commercial temperature grade (-20C to 105C) at 41C
Reset cause: POR
Board: MX6 Cubox-i
DRAM: 2 GiB
MMC: FSL_SDHC: 0
*** Warning - bad CRC, using default environment
auto-detected panel HDMI
Display: HDMI (1024x768)
In: serial
Out: serial
Err: serial
Net: FEC
starting USB...
USB0: Port not available.
USB1: USB EHCI 1.00
scanning bus 1 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
907 bytes read in 98 ms (8.8 KiB/s)
## Executing script at 12000000
## Error: "autodetectfdt" not defined
** File not found /boot/dtb/ **
** Unrecognized filesystem type **
** File not found /dtb/ **
5783761 bytes read in 483 ms (11.4 MiB/s)
5546904 bytes read in 427 ms (12.4 MiB/s)
## Loading init Ramdisk from Legacy Image at 14800000 ...
Image Name: uInitrd
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 5783697 Bytes = 5.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
还有一些。我怀疑这Error: "autodetectfdt" not defined
是无法启动的罪魁祸首。有没有办法可以恢复它autodetectfdt
,最好不要刷新整个 SD 卡?上面有一些数据我想保留...
我正在尝试使用 yocto 构建嵌入式 linux 来工作。我非常接近,但我在启动时遇到了问题。我有 2 个根文件系统。一个是主要的,另一个是在固件升级期间使用的。但是,除了第一个 rootfs 之外,我无法让系统启动任何东西。
这是我的分区布局:
Disk /dev/mmcblk1: 3825 MB, 3825205248 bytes
4 heads, 16 sectors/track, 116736 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/mmcblk1p1 * 33 6432 204800 c Win95 FAT32 (LBA)
/dev/mmcblk1p2 6433 19232 409600 83 Linux
/dev/mmcblk1p3 19233 32032 409600 83 Linux
/dev/mmcblk1p4 32033 97568 2097152 5 Extended
/dev/mmcblk1p5 32065 43264 358400 83 Linux
/dev/mmcblk1p6 43297 97568 1736704 83 Linux
/dev/mmcblk1p2 和 /dev/mmcblk1p3 是根文件系统。
当前,当我启动机器时,它会从 /dev/mmcblk1p2 启动,尽管在 uEnv.txt 中将 mmcroot 配置为 /dev/mmcblk1p3。这是我的uEnv:
bootdir=
bootfile=zImage
fdtfile=am335x-boneblack.dtb
loadaddr=0x80007fc0
fdtaddr=0x80F80000
console=ttyO0,115200
mmcroot=/dev/mmcblk1p3
mmcrootfstype=ext4
loadfdt=fatload mmc 1:1 ${fdtaddr} ${fdtfile}
loaduimage=fatload mmc 1:1 ${loadaddr} ${bootfile}
mmc_args=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
uenvcmd=mmc rescan; run loaduimage; run loadfdt; run fdtboot
fdtboot=run mmc_args; run mmcargs; bootz ${loadaddr} - ${fdtaddr}
此外,这是启动的结果:
U-Boot SPL 2017.09 (Feb 15 2018 - 07:11:54)
Trying to boot from MMC2
reading u-boot.img
reading u-boot.img
U-Boot 2017.09 (Feb 15 2018 - 07:11:54 -0500)
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net: cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
Card did not respond to voltage select!
mmc_init: -95, time 12
Card did not respond to voltage select!
mmc_init: -95, time 12
Card did not respond to voltage select!
mmc_init: -95, time 13
Card did not respond to voltage select!
mmc_init: -95, time 13
Card did not respond to voltage select!
mmc_init: -95, time 12
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
reading /am335x-boneblack.dtb
36168 bytes read in 9 ms (3.8 MiB/s)
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
5768968 bytes read in 380 ms (14.5 MiB/s)
36168 bytes read in 22 ms (1.6 MiB/s)
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff4000, end 8ffffd47 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.12.12-yocto-standard (oe-user@oe-host) (gcc version 7.3.0 (GCC) ) #1 PREEMPT Thu Feb 15 07:09:00 EST 2018
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: TI AM335x BeagleBone Black
Memory policy: Data cache writeback
cma: Reserved 16 MiB at 0x9e800000
CPU: All CPU(s) started in SVC mode.
AM335X ES2.1 (sgx neon)
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129666
Kernel command line: console=ttyO0,115200n8 root=PARTUUID=b804e92a-02 rw rootfstype=ext4 rootwait
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 486888K/523264K available (8192K kernel code, 778K rwdata, 2600K rodata, 1024K init, 595K bss, 19992K reserved, 16384K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xe0000000 - 0xff800000 ( 504 MB)
lowmem : 0xc0000000 - 0xdff00000 ( 511 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0900000 (9184 kB)
.init : 0xc0d00000 - 0xc0e00000 (1024 kB)
.data : 0xc0e00000 - 0xc0ec29ec ( 779 kB)
.bss : 0xc0ecc6c4 - 0xc0f6134c ( 596 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
ftrace: allocating 30390 entries in 90 pages
Preemptible hierarchical RCU implementation.
NR_IRQS:16 nr_irqs:16 16
IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
OMAP clockevent source: timer2 at 24000000 Hz
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
OMAP clocksource: timer1 at 24000000 Hz
clocksource_probe: no matching clocksources found
Console: colour dummy device 80x30
Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x80100000 - 0x80100060
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
xor: measuring software checksum speed
arm4regs : 1201.600 MB/sec
8regs : 893.200 MB/sec
32regs : 1156.400 MB/sec
xor: using function: arm4regs (1201.600 MB/sec)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
omap_hwmod: debugss: _wait_target_disable failed
cpuidle: using governor ladder
cpuidle: using governor menu
OMAP GPIO hardware version 0.1
hw-breakpoint: debug architecture 0x4 unsupported.
raid6: int32x1 gen() 209 MB/s
raid6: int32x1 xor() 143 MB/s
raid6: int32x2 gen() 226 MB/s
raid6: int32x2 xor() 162 MB/s
raid6: int32x4 gen() 190 MB/s
raid6: int32x4 xor() 133 MB/s
raid6: int32x8 gen() 175 MB/s
raid6: int32x8 xor() 118 MB/s
raid6: using algorithm int32x2 gen() 226 MB/s
raid6: .... xor() 162 MB/s, rmw enabled
raid6: using intx1 recovery algorithm
edma 49000000.edma: TI EDMA DMA engine driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
omap_i2c 4802a000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c1_pins, deferring probe
omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
clocksource: Switched to clocksource timer1
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: no interrupt-affinity property for /pmu, guessing.
hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
workingset: timestamp_bits=14 max_order=17 bucket_order=3
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
omap_uart 44e09000.serial: no wakeirq for uart0
44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a OMAP UART0
console [ttyO0] enabled
omap_uart 48022000.serial: no wakeirq for uart1
48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a OMAP UART1
omap_uart 48024000.serial: no wakeirq for uart2
48024000.serial: ttyO2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a OMAP UART2
brd: module loaded
mtdoops: mtd device (mtddev=name/number) must be supplied
libphy: Fixed MDIO Bus: probed
davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
davinci_mdio 4a101000.mdio: detected phy mask fffffffe
random: fast init done
libphy: 4a101000.mdio: probed
davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
cpsw 4a100000.ethernet: Detected MACID = 68:9e:19:8f:7c:44
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap: OMAP-EHCI Host Controller driver
usbcore: registered new interface driver usb-storage
am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
irq: no irq domain found for /ocp/i2c@44e0b000/tps@24 !
am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
musb-hdrc musb-hdrc.1: Failed to request rx1.
omap_rtc 44e3e000.rtc: already running
omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
i2c /dev entries driver
omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
omap_hsmmc 48060000.mmc: Got CD GPIO
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
oprofile: using arm/armv7
u32 classifier
Actions configured
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
omap_voltage_late_init: Voltage driver support not added
ThumbEE CPU extension supported.
Btrfs loaded, crc32c=crc32c-generic
Key type encrypted registered
mmc1: new high speed MMC card at address 0001
mmcblk1: mmc1:0001 S10004 3.56 GiB
mmcblk1boot0: mmc1:0001 S10004 partition 1 4.00 MiB
mmcblk1boot1: mmc1:0001 S10004 partition 2 4.00 MiB
mmcblk1: p1 p2 p3 p4 < p5 p6 >
tps65217 0-0024: TPS65217 ID 0xe version 1.2
omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
omap_i2c 4802a000.i2c: bus 1 rev0.11 at 50 kHz
omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
musb-hdrc musb-hdrc.1: MUSB HDRC host driver
musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
console [netcon0] enabled
netconsole: network logging started
omap_rtc 44e3e000.rtc: setting system clock to 2018-02-15 12:46:24 UTC (1518698784)
EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
INIT: version 2.88 booting
Starting udev
udevd[111]: starting version 3.2.2
udevd[112]: starting eudev-3.2.2
EXT4-fs (mmcblk1p2): re-mounted. Opts: data=ordered
INIT: Entering runlevel: 5
Configuring network interfaces... net eth0: initializing cpsw version 1.12 (0)
cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
cpsw 4a100000.ethernet: ALE Table size 1024
SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1)
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc (v1.24.1) started
Sending discover...
cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sending discover...
Sending select for 10.1.1.73...
Lease of 10.1.1.73 obtained, lease time 7200
/etc/udhcpc.d/50default: Adding DNS 10.1.0.1
done.
Starting OpenBSD Secure Shell server: sshd
done.
Starting syslogd/klogd: done
Starting web server: apache2.
Poky (Yocto Project Reference Distro) 2.4.2 beaglebone /dev/ttyO0
beaglebone login:
您可以看到它以 root 身份挂载 /dev/mmcblk1p2。
我认为某些问题远远超出 uEnv.txt 的问题。 我可以从我的启动分区 (/dev/mmcblk1p1) 中删除 uEnv.txt,系统仍然可以正常启动。 不应该是这样的。事实上,我似乎可以将我的引导分区剥离为仅 MLO 和 u-boot.img,并且系统仍然可以引导。它似乎是从 /dev/mmcblk1p2 /boot 目录中拉出扁平设备树和 uEnv(如果我删除那里的文件,系统将无法启动)。
因此,就好像 /dev/mmcblk1p2 或分区 2 以某种方式被硬编码,尽管我找不到任何证据。有谁知道可能发生了什么以及如何使我的系统能够从我的任何一个根文件系统启动?
这是我的默认 u-boot 设置:
arch=arm
args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
baudrate=115200
board=am335x
board_name=A335BNLT
board_rev=00C0
board_serial=0816BBBK018E
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_fdt=try
boot_fit=0
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp
bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
bootcmd_legacy_mmc1=setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_nand=run nandboot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcount=1
bootdelay=2
bootdir=/boot
bootenvfile=uEnv.txt
bootfile=zImage
bootm_size=0x10000000
bootpart=0:2
bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
console=ttyO0,115200n8
cpu=armv7
dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 1 1;spl-os-image fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
eth1addr=68:9e:19:8f:7c:46
ethaddr=68:9e:19:8f:7c:44
fdt_addr_r=0x88000000
fdtaddr=0x88000000
fdtcontroladdr=9df219f8
fdtfile=undefined
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = BBBW; then setenv fdtfile am335x-boneblack-wireless.dtb; fi; if test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test $board_name = BBGW; then setenv fdtfile am335x-bonegreen-wireless.dtb; fi; if test $board_name = BBBL; then setenv fdtfile am335x-boneblue.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name = A335_ICE; then setenv fdtfile am335x-icev2.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
finduuid=part uuid mmc ${bootpart} uuid
fit_bootfile=fitImage
fit_loadaddr=0x87000000
importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
init_console=if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;else setenv console ttyO0,115200n8;fi;
kernel_addr_r=0x82000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x82000000
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
loadfit=run args_mmc; bootm ${loadaddr}#${fdtfile};
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
mmcdev=0
mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcrootfstype=ext4 rootwait
mtdids=nand0=nand.0
mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)
nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
nandrootfstype=ubifs rootwait=1
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
netloadfdt=tftp ${fdtaddr} ${fdtfile}
netloadimage=tftp ${loadaddr} ${bootfile}
nfsopts=nolock
partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
pxefile_addr_r=0x80100000
ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
ramdisk_addr_r=0x88080000
ramroot=/dev/ram0 rw
ramrootfstype=ext2
rdaddr=0x88080000
rootpath=/export/rootfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x80000000
soc=am33xx
spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
spibusno=0
spiimgsize=0x362000
spiroot=/dev/mtdblock4 rw
spirootfstype=jffs2
spisrcaddr=0xe0000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial@44e09000
stdin=serial@44e09000
stdout=serial@44e09000
update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
vendor=ti
ver=U-Boot 2018.01 (Feb 15 2018 - 13:50:14 -0500)
Environment size: 9701/131068 bytes
此外,以下是在 u-boot 中手动输入时会导致系统完美启动的命令列表:
setenv bootfile zImage
setenv fdtfile am335x-boneblack.dtb
setenv loadaddr 0x80007fc0
setenv fdtaddr 0x80F80000
setenv console ttyO0,115200
setenv mmcroot /dev/mmcblk1p3
setenv mmcrootfstype ext4
setenv loadfdt fatload mmc 1:1 ${fdtaddr} ${fdtfile}
setenv loaduimage fatload mmc 1:1 ${loadaddr} ${bootfile}
setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
mmc rescan
run loaduimage
run loadfdt
bootz ${loadaddr} - ${fdtaddr}