关于内核版本,设备树和buildroot的困惑

问题描述 投票:0回答:1

我获得了3.0.35 linux内核,用于使用较旧的“板文件”格式的arm i.mx6板,以及用于生成正确图像和rootfs的旧版(2013.02)buildroot repo。

我的目标是使用最新的buildroot public repo commit,以便将来更容易保持包更新。目前,我必须手动编辑包文件(OpenSSL,lighttpd等)以通过buildroot提供最新版本。

我尝试在最新的buildroot(2016.05之后)中复制我的电路板配置。除了工具链必须改变以支持更新的systemd(Linaro 2013.01 - > CodeBench ARM 2014.05)之外,一切都或多或少保持不变。结果:

  • Buildroot:构建成功
  • U-boot:图像有效
  • 内核:图像导致内核恐慌

我的问题确实是:

  1. 我可以将较旧的内核与较新的buildroot / toolchain一起使用,还是不兼容?某些工具链是否不支持较旧的内核?
  2. 如果它是不兼容的,是否有更简单的方法来保持我的旧buildroot包最新?
  3. 如果以上两个都不是选项,是否有任何工具可以帮助从板文件迁移到设备树?是否很容易转换为dts,或者这是一个长项目?

编辑:改为Linaro 2014.09工具链。我以前使用systemd 202作为我的init系统。由于较新的buildroot需要针对systemd针对内核头文件> = 3.10构建的工具链,因此我不得不将我的init系统切换到systemv。这是我收到的崩溃:

Starting kernel ...

Linux version 3.0.35 (eschumacher@ubuntu) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #1 SMP PREEMPT Tue Jun 21 11:01:40 PDT 2016
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: i.MX 6Quad/DualLite/Solo SMARC CPU Board
Memory policy: ECC disabled, Data cache writealloc
CPU identified as i.MX6DL/SOLO, silicon rev 1.1
PERCPU: Embedded 7 pages/cpu @8bc06000 s5440 r8192 d15040 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 84992
Kernel command line: console=ttymxc3,115200 root=/dev/mmcblk0p2 rootwait rw
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: 336MB = 336MB total
Memory: 327580k/327580k available, 196708k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xf4600000 - 0xffe00000   ( 184 MB)
    vmalloc : 0xa0800000 - 0xf2000000   (1304 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .init : 0x80008000 - 0x80039000   ( 196 kB)
      .text : 0x80039000 - 0x80af9538   (11010 kB)
      .data : 0x80afa000 - 0x80b53be0   ( 359 kB)
       .bss : 0x80b53c04 - 0x80ba775c   ( 335 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:624
MXC GPIO hardware
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms
Set periph_clk's parent to pll2_pfd_400M!
arm_max_freq=800MHz
MXC_Early serial console at MMIO 0x21f0000 (options '115200')
bootconsole [ttymxc3] enabled
Console: colour dummy device 80x30
Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
Brought up 1 CPUs
SMP: Total of 1 processors activated (1581.05 BogoMIPS).
devtmpfs: initialized
print_constraints: dummy:
NET: Registered protocol family 16
print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal
print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal
print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal
print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal
print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal
print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal
hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
hw-breakpoint: 1 breakpoint(s) reserved for watchpoint single-step.
hw-breakpoint: maximum watchpoint size is 4 bytes.
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x02050000, Cache size: 524288 B
bio: create slab <bio-0> at 0
mxs-dma mxs-dma-apbh: initialized
print_constraints: vmmc: 3300 mV
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Freescale USB OTG Driver loaded, $Revision: 1.55 $
imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
MIPI CSI2 driver module loaded
Advanced Linux Sound Architecture Driver Version 1.0.24.
Bluetooth: Core ver 2.16
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
i2c-core: driver [max17135] using legacy suspend method
i2c-core: driver [max17135] using legacy resume method
Switching to clocksource mxc_timer1
cfg80211: Calling CRDA to update world regulatory domain
Unable to handle kernel NULL pointer dereference at virtual address 00000040
pgd = 80004000
[00000040] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.0.35 #1)
PC is at kmem_cache_alloc+0xa4/0x108
LR is at con_insert_unipair+0xb8/0x104
pc : [<800f40c0>]    lr : [<80299574>]    psr: 60000093
sp : 9202fef0  ip : 9202e000  fp : 00000001
r10: 00000000  r9 : 0bbcf000  r8 : 20000013
r7 : 000000d0  r6 : 92002300  r5 : 00000040  r4 : 80b0fcc8
r3 : 8003a5a0  r2 : 80b0fcc8  r1 : 000024ac  r0 : 00000001
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 1000404a  DAC: 00000015
Process swapper (pid: 1, stack limit = 0x9202e2f0)
Stack: (0x9202fef0 to 0x92030000)
fee0:                                     00002665 921bcee4 920f4900 00000003
ff00: 80b2fee8 80b2fee6 00000003 80299574 00000000 00000001 920f4900 00000003
ff20: 80b2fee8 8029a1a4 00000000 80b30143 92003000 80b729d8 00000136 00000001
ff40: 00000014 80b72bfc 00000001 00000002 00000004 00000000 8001fce4 8001f214
ff60: 00000000 80b72ad8 00000001 8001f714 80a695d4 00000000 80b725d4 00000000
ff80: 8003fb04 00000013 00000000 00000000 00000000 8001eb68 80a37670 00000000
ffa0: 80b53c20 80b53c20 9202e030 800395c0 000001df 00000013 00000000 00000000
ffc0: 00000039 00000000 00000270 8002fb14 8002ffa0 8003fb04 00000013 00000000
ffe0: 00000000 00000000 00000000 8000898c 00000000 8003fb04 c38ac389 c38dc38b
[<800f40c0>] (kmem_cache_alloc+0xa4/0x108) from [<80299574>] (con_insert_unipair+0xb8/0x104)
[<80299574>] (con_insert_unipair+0xb8/0x104) from [<8029a1a4>] (con_set_default_unimap+0xe8/0x178)
[<8029a1a4>] (con_set_default_unimap+0xe8/0x178) from [<8001f214>] (console_map_init+0x44/0x50)
[<8001f214>] (console_map_init+0x44/0x50) from [<8001f714>] (vty_init+0x18c/0x19c)
[<8001f714>] (vty_init+0x18c/0x19c) from [<8001eb68>] (tty_init+0x12c/0x144)
[<8001eb68>] (tty_init+0x12c/0x144) from [<800395c0>] (do_one_initcall+0x114/0x16c)
[<800395c0>] (do_one_initcall+0x114/0x16c) from [<8000898c>] (kernel_init+0xc0/0x144)
[<8000898c>] (kernel_init+0xc0/0x144) from [<8003fb04>] (kernel_thread_exit+0x0/0x8)
Code: 1afffff3 e596a014 e2811004 e3a00001 (e795a00a)
---[ end trace 1b75b31a2719ed1c ]---
Kernel panic - not syncing: Attempted to kill init!
[<8004631c>] (unwind_backtrace+0x0/0xec) from [<80569100>] (panic+0x80/0x19c)
[<80569100>] (panic+0x80/0x19c) from [<80075934>] (complete_and_exit+0x0/0x1c)
[<80075934>] (complete_and_exit+0x0/0x1c) from [<00000001>] (0x1)

编辑2:

我更改了buildroot配置,使用我的内核头文件构建我自己的工具链。我仍然收到类似的内核恐慌。输出:

Starting kernel ...

Linux version 3.0.35 (eschumacher@ubuntu) (gcc version 4.9.3 (Buildroot 2016.08-           git-00508-geba9c44-dirty) ) #1 SMP PREEMPT Tue Jun 21 16:41:35 PDT 2016
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: i.MX 6Quad/DualLite/Solo SMARC CPU Board
Memory policy: ECC disabled, Data cache writealloc
CPU identified as i.MX6DL/SOLO, silicon rev 1.1
PERCPU: Embedded 7 pages/cpu @8bc06000 s5440 r8192 d15040 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 84992
Kernel command line: console=ttymxc3,115200 root=/dev/mmcblk0p2 rootwait rw
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: 336MB = 336MB total
Memory: 327564k/327564k available, 196724k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xf4600000 - 0xffe00000   ( 184 MB)
    vmalloc : 0xa0800000 - 0xf2000000   (1304 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .init : 0x80008000 - 0x80039000   ( 196 kB)
      .text : 0x80039000 - 0x80afd458   (11026 kB)
      .data : 0x80afe000 - 0x80b57bc0   ( 359 kB)
       .bss : 0x80b57be4 - 0x80bab73c   ( 335 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:624
MXC GPIO hardware
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms
Set periph_clk's parent to pll2_pfd_400M!
arm_max_freq=800MHz
MXC_Early serial console at MMIO 0x21f0000 (options '115200')
bootconsole [ttymxc3] enabled
Console: colour dummy device 80x30
Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
Brought up 1 CPUs
SMP: Total of 1 processors activated (1581.05 BogoMIPS).
devtmpfs: initialized
print_constraints: dummy:
NET: Registered protocol family 16
print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal
print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal
print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal
print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal
print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal
print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal
hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
hw-breakpoint: 1 breakpoint(s) reserved for watchpoint single-step.
hw-breakpoint: maximum watchpoint size is 4 bytes.
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x02050000, Cache size: 524288 B
bio: create slab <bio-0> at 0
mxs-dma mxs-dma-apbh: initialized
print_constraints: vmmc: 3300 mV
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Freescale USB OTG Driver loaded, $Revision: 1.55 $
imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
MIPI CSI2 driver module loaded
Advanced Linux Sound Architecture Driver Version 1.0.24.
Bluetooth: Core ver 2.16
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
i2c-core: driver [max17135] using legacy suspend method
i2c-core: driver [max17135] using legacy resume method
Switching to clocksource mxc_timer1
cfg80211: Calling CRDA to update world regulatory domain
Unable to handle kernel NULL pointer dereference at virtual address 00000040
pgd = 80004000
[00000040] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.0.35 #1)
PC is at kmem_cache_alloc+0xa4/0x108
LR is at con_insert_unipair+0xb8/0x104
pc : [<800f3bbc>]    lr : [<80298a88>]    psr: 60000093
sp : 9202fef8  ip : 9202e000  fp : 00000001
r10: 00000000  r9 : 0bbcf000  r8 : 20000013
r7 : 000000d0  r6 : 92002300  r5 : 00000040  r4 : 80b13cc8
r3 : 8003a5a0  r2 : 80b13cc8  r1 : 000024ac  r0 : 00000001
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 1000404a  DAC: 00000015
Process swapper (pid: 1, stack limit = 0x9202e2f0)
Stack: (0x9202fef8 to 0x92030000)
fee0:                                                       00002665 921bcee4
ff00: 920f4900 00000003 80b33ec8 80b33ec6 00000003 80298a88 80b34123 00000000
ff20: 00000001 920f4900 00000003 802996b8 00000001 80b34123 92003000 80b769b8
ff40: 8001fc40 00000001 00000014 80b76bdc 00000002 00000004 00000000 00000000
ff60: 8001fc40 8001f168 00000000 80b76ab8 00000001 8001f668 80a684a4 8014768c
ff80: 80b765b4 00000000 8003fac4 00000013 00000000 8001eac4 80a36540 00000000
ffa0: 80b57c00 80b57c00 9202e030 800395b8 000001df 00000013 00000000 00000000
ffc0: 00000039 00000000 00000270 8002fa74 8002ff00 8003fac4 00000013 00000000
ffe0: 00000000 00000000 00000000 8000898c 00000000 8003fac4 e345c1eb e0c32c90
[<800f3bbc>] (kmem_cache_alloc+0xa4/0x108) from [<80298a88>] (con_insert_unipair           +0xb8/0x104)
[<80298a88>] (con_insert_unipair+0xb8/0x104) from [<802996b8>] (con_set_default_           unimap+0xe8/0x178)
[<802996b8>] (con_set_default_unimap+0xe8/0x178) from [<8001f168>] (console_map_           init+0x44/0x50)
[<8001f168>] (console_map_init+0x44/0x50) from [<8001f668>] (vty_init+0x18c/0x19           c)
[<8001f668>] (vty_init+0x18c/0x19c) from [<8001eac4>] (tty_init+0x12c/0x144)
[<8001eac4>] (tty_init+0x12c/0x144) from [<800395b8>] (do_one_initcall+0x114/0x1           6c)
[<800395b8>] (do_one_initcall+0x114/0x16c) from [<8000898c>] (kernel_init+0xc0/0           x144)
[<8000898c>] (kernel_init+0xc0/0x144) from [<8003fac4>] (kernel_thread_exit+0x0/           0x8)
Code: 1afffff3 e596a014 e2811004 e3a00001 (e795a00a)
---[ end trace 1b75b31a2719ed1c ]---
Kernel panic - not syncing: Attempted to kill init!
[<800462c8>] (unwind_backtrace+0x0/0xec) from [<80567fcc>] (panic+0x80/0x19c)
[<80567fcc>] (panic+0x80/0x19c) from [<800757e0>] (complete_and_exit+0x0/0x1c)
[<800757e0>] (complete_and_exit+0x0/0x1c) from [<00000001>] (0x1)
linux buildroot device-tree imx6
1个回答
1
投票

正如我在评论中所说,崩溃看起来非常类似于Freescale 3.0.35 kernel crash。如果是这样,崩溃发生在memset.S。在memset.S in upstream kernel中,前两个提交的SHA1分别以c2459d31bd4678开头,应该解决这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.