我正在开发一个运行基于 Yocto 的 Linux 发行版的嵌入式设备。
其他人似乎也面临过这个问题在不同的条件下,但似乎没有找到解决方案。
我已经采用了现有的 OpenSTLinux 发行版,并开始一层一层地删除层(例如 X11),并在此过程中破坏了一些导致串行登录控制台消失的东西。
奇怪的是,写入 SD 卡映像后第一次启动设备时出现登录提示。但是,在随后的引导中,登录提示不再存在。
串行端口的启动消息(通过打印)表明:
- 控制台参数传递给内核
- 有问题的串行端口已正确初始化
- 串行 Getty 实例已启动,但立即停止
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.10.61 (oe-user@oe-host) (arm-ostl-linux-gnueabi-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP PREEMPT Thu Aug 26 12:51:21 1
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: STMicroelectronics STM32MP157F-DK2 Discovery Board
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created DMA memory pool at 0x10000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram2@10000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10040000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring0@10040000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10041000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring1@10041000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10042000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0buffer@10042000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10048000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcu_rsc_table@10048000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x30000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram@30000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x38000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node retram@38000000, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 128 MiB at 0xc7800000
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000c0000000-0x00000000dfffffff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000c0000000-0x00000000d3ffffff]
[ 0.000000] node 0: [mem 0x00000000d4000000-0x00000000d7ffffff]
[ 0.000000] node 0: [mem 0x00000000d8000000-0x00000000dfcfffff]
[ 0.000000] node 0: [mem 0x00000000dfd00000-0x00000000dffeffff]
[ 0.000000] node 0: [mem 0x00000000dfff0000-0x00000000dfffffff]
[ 0.000000] Initmem setup node 0 [mem 0x00000000c0000000-0x00000000dfffffff]
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.2
[ 0.000000] percpu: Embedded 20 pages/cpu s51788 r8192 d21940 u81920
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 129920
[ 0.000000] Kernel command line: root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=ttySTM0,115200
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 297404K/524288K available (11264K kernel code, 1207K rwdata, 3308K rodata, 1024K init, 239K bss, 95812K reserved, 131072K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x388/0x560 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000024] Switching to timer-based delay loop, resolution 41ns
[ 0.001420] Console: colour dummy device 80x30
[ 0.001477] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.001503] pid_max: default: 32768 minimum: 301
[ 0.001721] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.001743] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.002888] CPU: Testing write buffer coherency: ok
[ 0.003300] /cpus/cpu@0 missing clock-frequency property
[ 0.003342] /cpus/cpu@1 missing clock-frequency property
[ 0.003359] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004407] Setting up static identity map for 0xc0100000 - 0xc0100060
[ 0.004588] rcu: Hierarchical SRCU implementation.
[ 0.005816] smp: Bringing up secondary CPUs ...
[ 0.006874] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.007094] smp: Brought up 1 node, 2 CPUs
[ 0.007120] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.007132] CPU: All CPU(s) started in SVC mode.
[ 0.007882] devtmpfs: initialized
[ 0.037995] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.038325] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.038358] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[ 0.044500] pinctrl core: initialized pinctrl subsystem
[ 0.046193] NET: Registered protocol family 16
[ 0.049095] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.050729] thermal_sys: Registered thermal governor 'step_wise'
[ 0.051131] cpuidle: using governor menu
[ 0.051484] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.051503] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.051847] Serial: AMBA PL011 UART driver
[ 0.095434] stm32-pm-domain pm_domain: domain core-ret-power-domain registered
[ 0.095479] stm32-pm-domain pm_domain: subdomain core-power-domain registered
[ 0.095494] stm32-pm-domain pm_domain: domains probed
[ 0.118494] SCSI subsystem initialized
[ 0.119253] usbcore: registered new interface driver usbfs
[ 0.119330] usbcore: registered new interface driver hub
[ 0.119409] usbcore: registered new device driver usb
[ 0.119669] pps_core: LinuxPPS API ver. 1 registered
[ 0.119684] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[ 0.119716] PTP clock support registered
[ 0.120538] arm-scmi firmware:scmi0: SCMI Notifications - Core Enabled.
[ 0.120621] arm-scmi firmware:scmi0: SCMI Protocol v2.0 'ST:' Firmware version 0x0
[ 0.123567] clocksource: Switched to clocksource arch_sys_counter
[ 1.235280] simple-framebuffer dfd00000.framebuffer: framebuffer at 0xdfd00000, 0xbb800 bytes, mapped to 0x(ptrval)
[ 1.235313] simple-framebuffer dfd00000.framebuffer: format=r5g6b5, mode=480x800x16, linelength=960
[ 1.235745] simple-framebuffer dfd00000.framebuffer: fb0: simplefb registered!
[ 1.247748] NET: Registered protocol family 2
[ 1.248000] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 1.249208] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 1.249362] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 1.249423] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 1.249502] TCP: Hash tables configured (established 4096 bind 4096)
[ 1.249666] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 1.249714] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 1.250289] NET: Registered protocol family 1
[ 1.251232] RPC: Registered named UNIX socket transport module.
[ 1.251258] RPC: Registered udp transport module.
[ 1.251269] RPC: Registered tcp transport module.
[ 1.251280] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.251624] Trying to unpack rootfs image as initramfs...
[ 1.547733] Freeing initrd memory: 3548K
[ 1.548702] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 1.550424] Initialise system trusted keyrings
[ 1.550811] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 1.559823] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 1.561119] NFS: Registering the id_resolver key type
[ 1.561177] Key type id_resolver registered
[ 1.561189] Key type id_legacy registered
[ 1.561340] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 1.561356] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[ 1.561538] ntfs: driver 2.1.32 [Flags: R/O].
[ 1.561806] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[ 1.562580] fuse: init (API version 7.32)
[ 1.563491] NET: Registered protocol family 38
[ 1.563518] Key type asymmetric registered
[ 1.563531] Asymmetric key parser 'x509' registered
[ 1.563687] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[ 1.563705] io scheduler mq-deadline registered
[ 1.563717] io scheduler kyber registered
[ 1.575020] STM32 USART driver initialized
[ 1.594625] brd: module loaded
[ 1.599100] random: fast init done
[ 1.603858] random: crng init done
[ 1.606905] loop: module loaded
[ 1.611950] libphy: Fixed MDIO Bus: probed
[ 1.613824] CAN device driver interface
[ 1.615651] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[ 1.615738] usbcore: registered new interface driver pegasus
[ 1.615812] usbcore: registered new interface driver asix
[ 1.615866] usbcore: registered new interface driver ax88179_178a
[ 1.615917] usbcore: registered new interface driver cdc_ether
[ 1.615984] usbcore: registered new interface driver smsc75xx
[ 1.616061] usbcore: registered new interface driver smsc95xx
[ 1.616114] usbcore: registered new interface driver net1080
[ 1.616166] usbcore: registered new interface driver cdc_subset
[ 1.616216] usbcore: registered new interface driver zaurus
[ 1.616292] usbcore: registered new interface driver cdc_ncm
[ 1.617608] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.617668] ehci-platform: EHCI generic platform driver
[ 1.618061] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.618100] ohci-platform: OHCI generic platform driver
[ 1.618735] usbcore: registered new interface driver usb-storage
[ 1.622124] i2c /dev entries driver
[ 1.626527] stm32-cpufreq stm32-cpufreq: Failed to get chip info: -517
[ 1.627688] sdhci: Secure Digital Host Controller Interface driver
[ 1.627708] sdhci: Copyright(c) Pierre Ossman
[ 1.627718] Synopsys Designware Multimedia Card Interface Driver
[ 1.628129] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.629272] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.629504] SMCCC: SOC_ID: ID = jep106:0020:0500 Revision = 0x00002001
[ 1.629917] usbcore: registered new interface driver usbhid
[ 1.629933] usbhid: USB HID core driver
[ 1.631216] remoteproc remoteproc0: releasing m4
[ 1.633687] NET: Registered protocol family 17
[ 1.633733] can: controller area network core
[ 1.633848] NET: Registered protocol family 29
[ 1.633862] can: raw protocol
[ 1.633877] can: broadcast manager protocol
[ 1.633897] can: netlink gateway - max_hops=1
[ 1.634634] Key type dns_resolver registered
[ 1.634797] ThumbEE CPU extension supported.
[ 1.634826] Registering SWP/SWPB emulation handler
[ 1.635245] registered taskstats version 1
[ 1.635271] Loading compiled-in X.509 certificates
[ 1.671331] stm32-mdma 58000000.dma-controller: STM32 MDMA driver registered
[ 1.674576] stm32-dma 48000000.dma-controller: STM32 DMA driver registered
[ 1.676863] stm32-dma 48001000.dma-controller: STM32 DMA driver registered
[ 1.685886] stm_thermal 50028000.thermal: stm_thermal_probe: Driver initialized successfully
[ 1.692265] remoteproc remoteproc0: releasing m4
[ 1.693045] /soc/interrupt-controller@5000d000: bank0
[ 1.693069] /soc/interrupt-controller@5000d000: bank1
[ 1.693085] /soc/interrupt-controller@5000d000: bank2
[ 1.697079] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOA bank added
[ 1.698997] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOB bank added
[ 1.700879] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOC bank added
[ 1.702782] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOD bank added
[ 1.704755] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOE bank added
[ 1.706924] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOF bank added
[ 1.708740] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOG bank added
[ 1.710511] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOH bank added
[ 1.712226] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOI bank added
[ 1.712535] stm32mp157-pinctrl soc:pin-controller@50002000: Pinctrl STM32 initialized
[ 1.715425] stm32mp157-pinctrl soc:pin-controller-z@54004000: GPIOZ bank added
[ 1.715464] stm32mp157-pinctrl soc:pin-controller-z@54004000: Pinctrl STM32 initialized
[ 1.718602] 4000e000.serial: ttySTM3 at MMIO 0x4000e000 (irq = 61, base_baud = 4000000) is a stm32-usart
[ 1.718929] serial serial0: tty port ttySTM3 registered
[ 1.720797] stm32-usart 40010000.serial: interrupt mode for rx (no dma)
[ 1.720823] stm32-usart 40010000.serial: interrupt mode for tx (no dma)
[ 1.720858] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 62, base_baud = 4000000) is a stm32-usart
[ 2.965639] printk: console [ttySTM0] enabled
...
Welcome to ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 3.1.11-snapshot-20211216 (dunfell)!
[ 5.867882] systemd[1]: Set hostname to <stm32mp1>.
[ 5.882917] systemd[1]: Hardware watchdog 'STM32 Independent Watchdog', version 0
[ 5.890326] systemd[1]: Set hardware watchdog to 32s.
[ 6.505443] systemd[1]: Unnecessary job for /dev/ttySTM0 was removed.
[ 6.517357] systemd[1]: Created slice system-getty.slice.
[ OK ] Created slice system-getty.slice.
[ 6.557278] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ OK ] Created slice system-serial\x2dgetty.slice.
[ 6.597028] systemd[1]: Created slice User and Session Slice.
[ OK ] Created slice User and Session Slice.
[ 6.634855] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Started Dispatch Password �…ts to Console Directory Watch.
[ 6.674597] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ OK ] Started Forward Password R�…uests to Wall Directory Watch.
[ 6.714486] systemd[1]: Reached target Paths.
[ OK ] Reached target Paths.
[ 6.744085] systemd[1]: Reached target Remote File Systems.
[ OK ] Reached target Remote File Systems.
[ 6.784102] systemd[1]: Reached target Slices.
[ OK ] Reached target Slices.
[ 6.814158] systemd[1]: Reached target Swap.
[ OK ] Reached target Swap.
[ 6.884002] systemd[1]: Listening on RPCbind Server Activation Socket.
[ OK ] Listening on RPCbind Server Activation Socket.
[ 6.924179] systemd[1]: Reached target RPC Port Mapper.
[ OK ] Reached target RPC Port Mapper.
[ 6.965725] systemd[1]: Listening on Syslog Socket.
[ OK ] Listening on Syslog Socket.
[ 7.026252] systemd[1]: Listening on Process Core Dump Socket.
[ OK ] Listening on Process Core Dump Socket.
[ 7.064801] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ 7.113194] systemd[1]: Condition check resulted in Journal Audit Socket being skipped.
[ 7.121650] systemd[1]: Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket (/dev/log).
[ 7.155508] systemd[1]: Listening on Journal Socket.
[ OK ] Listening on Journal Socket.
[ 7.195987] systemd[1]: Listening on Network Service Netlink Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ 7.235479] systemd[1]: Listening on udev Control Socket.
[ OK ] Listening on udev Control Socket.
[ 7.274985] systemd[1]: Listening on udev Kernel Socket.
[ OK ] Listening on udev Kernel Socket.
[ 7.315694] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[ 7.333008] systemd[1]: Mounting POSIX Message Queue File System...
Mounting POSIX Message Queue File System...
[ 7.384647] systemd[1]: Mounting Kernel Debug File System...
Mounting Kernel Debug File System...
[ 7.437495] systemd[1]: Mounting Temporary Directory (/tmp)...
Mounting Temporary Directory (/tmp)...
[ 7.485149] systemd[1]: Starting Create list of static device nodes for the current kernel...
Starting Create list of st�…odes for the current kernel...
[ 7.545605] systemd[1]: Starting RPC Bind...
Starting RPC Bind...
[ 7.574602] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[ 7.592953] systemd[1]: Starting Journal Service...
Starting Journal Service...
[ 7.627247] systemd[1]: Condition check resulted in Load Kernel Modules being skipped.
[ 7.640351] systemd[1]: Mounting FUSE Control File System...
Mounting FUSE Control File System...
[ 7.660372] systemd[1]: Mounting Kernel Configuration File System...
Mounting Kernel Configuration File System...
[ 7.684598] systemd[1]: Starting Remount Root and Kernel File Systems...
Starting Remount Root and Kernel File Systems...
[ 7.732844] EXT4-fs (mmcblk0p6): re-mounted. Opts: (null)
[ 7.744149] systemd[1]: Starting Apply Kernel Variables...
Starting Apply Kernel Variables...
[ 7.775175] systemd[1]: Starting udev Coldplug all Devices...
Starting udev Coldplug all Devices...
[ 7.846450] systemd[1]: Started RPC Bind.
[ OK ] Started RPC Bind.
[ 7.884892] systemd[1]: Started Journal Service.
[ OK ] Started Journal Service.
[ OK ] Mounted POSIX Message Queue File System.
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Temporary Directory (/tmp).
[ OK ] Started Create list of sta�… nodes for the current kernel.
[ OK ] Mounted FUSE Control File System.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Started Remount Root and Kernel File Systems.
[ OK ] Started Apply Kernel Variables.
Starting Flush Journal to Persistent Storage...
[ 8.261556] systemd-journald[257]: Received client request to flush runtime journal.
Starting Create Static Device Nodes in /dev...
[ OK ] Started Flush Journal to Persistent Storage.
[ OK ] Started Create Static Device Nodes in /dev.
[ OK ] Reached target Local File Systems (Pre).
Mounting /var/volatile...
Starting udev Kernel Device Manager...
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems.
Starting Create Volatile Files and Directories...
[ OK ] Started Load/Save Random Seed.
[ OK ] Started udev Kernel Device Manager.
[ OK ] Started udev Coldplug all Devices.
[ OK ] Started Create Volatile Files and Directories.
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Initialization.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target System Time Set.
[ OK ] Reached target System Time Synchronized.
[ OK ] Reached target Timers.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on dropbear.socket.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
[ 9.739841] Bluetooth: Core ver 2.22
[ 9.742261] NET: Registered protocol family 31
[ 9.771239] st,stm32-i2s 4000b000.audio-controller: No cache defaults, reading back from HW
[ OK ] Started D-Bus System Message Bus.
[ 9.808251] stm32-cryp 54001000.cryp: will run requests pump with realtime priority
[ 9.816453] Bluetooth: HCI device and connection manager initialized
[ 9.821463] Bluetooth: HCI socket layer initialized
[ 9.834299] stm32-hash 54002000.hash: will run requests pump with realtime priority
[ OK ] Started Gett[ 9.899739] stm32-cryp 54001000.cryp: Initialized
y on tty1.
[ 9.914298] Bluetooth: L2CAP socket layer initialized
[ 9.918052] Bluetooth: SCO socket layer initialized
Starting IPv6 Packet Filtering Framework...
Starting IPv4 Packet Filtering Framework...
[ OK ] Started Serial Getty on ttySTM0.
[ 10.030315] Bluetooth: HCI UART driver ver 2.3
[ 10.043752] stm32-hash 54002000.hash: Init HASH done HW ver 23 DMA mode 1
[ 10.051633] stm32-crc32 58009000.crc: Initialized
Stopping Serial Getty on ttySTM0...
Starting Login Service...
[ 10.129884] Bluetooth: HCI UART protocol H4 registered
[ 10.144424] galcore: loading out-of-tree module taints kernel.
[ OK ] Started TEE Supplicant.
[ 10.171541] Bluetooth: HCI UART protocol Broadcom registered
[ OK ] Started IPv6 Packet Filtering Framework.
[ OK ] Started IPv4 Packet Filtering Framework.
[ 10.351280] Galcore version 6.4.3.279124
[ 10.363263] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ OK ] Stopped Serial Getty on ttySTM0.
[ 10.480989] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 10.551612] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 10.564325] cfg80211: failed to load regulatory.db
[ 10.567851] Bluetooth: hci0: BCM: chip id 94
[ 10.572661] Bluetooth: hci0: BCM: features 0x2e
[ 10.579068] Bluetooth: hci0: BCM43430A1
[ 10.581554] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 10.593980] Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.hcd' Patch
[ 10.719466] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 10.944323] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 11.034191] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Feb 16 2020 22:39:24 version 7.45.98.97 (r724416 CY) FWID 01-bf41ed64
[ 11.246819] Bluetooth: hci0: BCM4343WA1 37.4MHz Murata Type-1DX BT4.2-0093
[ 11.252320] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0395
[ 11.337201] cs42l51 0-004a: Cirrus Logic CS42L51, Revision: 01
[ OK ] Started Login Service.
[ OK ] Created slice system-systemd\x2dbacklight.slice.
[ OK ] Reached target Bluetooth.
[ OK ] Reached target Login Prompts.
[ OK ] Reached target Network (Pre).
[ OK ] Reached target Sound Card.
[ OK ] Reached target Hardware activated USB gadget.
Starting Load/Save Screen �…of backlight:5a000000.dsi.0...
Starting Network Service...
[FAILED] Failed to start Load/Save �…s of backlight:5a000000.dsi.0.
See 'systemctl status systemd-backlight�…ht:5a000000.dsi.0.service' for details.
[ OK ] Started Network Service.
Starting Network Name Resolutio[ 12.423795] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
n...
[ 12.438978] dwmac4: Master AXI performs any burst length
[ 12.442981] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 12.451037] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 12.460125] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[ 12.468558] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[ OK ] Started Network Name Resolution.
[ OK ] Reached target Network.
[ OK ] Reached target Host and Network Name Lookups.
Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ OK ] Reached target Multi-User System.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.
[ 16.716957] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 16.724237] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 33.753839] usb33: supplied by vdd_usb
[ 33.756433] vref: supplied by vdd
[ 33.759707] vref: disabling
[ 33.762296] vdda: disabling
Getty 服务的状态表明由于串行设备不活动而已停止:
$ systemctl status [email protected]
● [email protected] - Serial Getty on ttySTM0
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2021-12-22 20:15:56 UTC; 3min 35s ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Process: 321 ExecStart=/sbin/agetty -8 --autologin root -L ttySTM0 115200 $TERM (code=killed, signal=HUP)
Main PID: 321 (code=killed, signal=HUP)
Dec 22 20:15:56 stm32mp1 systemd[1]: Started Serial Getty on ttySTM0.
Dec 22 20:15:56 stm32mp1 systemd[1]: [email protected]: Unit is bound to inactive unit dev-ttySTM0.device. Stopping, too.
Dec 22 20:15:56 stm32mp1 systemd[1]: Stopping Serial Getty on ttySTM0...
Dec 22 20:15:56 stm32mp1 systemd[1]: [email protected]: Succeeded.
Dec 22 20:15:56 stm32mp1 systemd[1]: Stopped Serial Getty on ttySTM0.
但是,设备列表表明它可用且处于活动状态:
$ systemctl --all --full -t device
UNIT LOAD ACTIVE SUB DESCRIPTION
...
dev-ttySTM0.device loaded active plugged /dev/ttySTM0
...
谁能建议问题可能是什么?
或者你能建议我还能做些什么来找到问题的根源吗?
谢谢。
答案1
我最终弄清楚了问题所在。
供应商提供了一个方法来覆盖文件的内容。/lib/systemd/system/[email protected]
因此,虽然上游源包含以下行:
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
最终位于 rootfs 上的服务文件将该行修改为:
After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
最终结果是竞争条件,有时会导致串行 getty 服务因设备尚不可用而失败。
我必须侵入 systemd 源代码来添加一些调试消息才能查看事件的确切顺序。