ARM陷入了#34;启动内核映像......"有时

时间:2016-03-20 22:34:40

标签: linux-kernel arm embedded-linux u-boot initrd

一开始,我想宣布这部分是一个成功的故事。 : - )

上下文:仅仅为了个人自我开发,我有一个想法来完成半LFS程序,为我的ARM Cubieboard2构建Linux。为何半?因为我的不耐烦使我想到从Fedora 23图像中获取已经构建的一些组件。

因此,程序或多或少如下:

阶段0

Crosstool-ng已用于构建交叉编译工具链。 (让我们跳过这一步的细节。老实说,当使用gcc-arm-linux-gnu,gcc-c ++-arm-linux-gnu和binutils-arm-linux-gnu包时,结果是一样的。)

第1阶段

MMC卡已配置如下

第1步

sudo dd if=/dev/zero of=${card} bs=1M count=1

第2步

sudo sfdisk ${card} < sdb.gpt.prt

其中sdb.gpt.prt内容为

label: gpt
device: /dev/sdb
size=256MiB,type=0FC63DAF-8483-4772-8E79-3D69D8477DE4,name=boot
size=2GiB,type=69dad710-2ce4-4e3c-b16c-21a1d49abed3,name=root
size=2GiB,type=0657fd6d-a4ab-43c4-84e5-0933c84b4f4f,name=swap
type=933ac7e1-2eb4-4f13-b844-0e14e2aef915,name=home

第3步

echo -e "x\ns\n56\nv\nw\ny" | sudo gdisk ${card}

第4步

sudo mkfs.ext4 -qF -L "boot" ${card}${p}1
sudo mkfs.ext4 -qF -L "root" ${card}${p}2
sudo mkswap        -L "swap" ${card}${p}3
sudo mkfs.ext4 -qF -L "home" ${card}${p}4

第5步

sudo mount ${card}${p}1 /mnt/cbxboot
sudo mount ${card}${p}2 /mnt/cbxroot

第6步

sudo sync
sudo blockdev --flushbufs ${card}${p}1
sudo blockdev --flushbufs ${card}${p}2

第2阶段

已编译U-Boot

第1步

最近的分支已经从git://git.denx.de/u-boot

检出

第2步

Bootloader + SPL的构建如下

export KBUILD_OUTPUT=/tmp/bld/arm/cbx/u-boot
mkdir -p $KBUILD_OUTPUT
export ARCH=arm
export CROSS_COMPILE=arm-unknown-linux-gnueabihf-
make Cubieboard2_defconfig
make all

因此产生了u-boot-sunxi-with-spl.bin。

警告: SEMI从下面开始。

第3阶段

已经下载并安装了Fedora 23映像

第1步

已下载原始图像文件

第2步

图像未压缩

unxz -v Fedora-Minimal-armhfp-23-10-sda.raw.xz

第3步

已挂载启动和根文件系统

sudo mkdir /mnt/loopfedboot && sudo mkdir /mnt/loopfedroot
sudo mount -o ro,loop,offset=1048576 Fedora-Minimal-armhfp-23-10-sda.raw /mnt/loopfedboot
sudo mount -o ro,loop,offset=556793856 Fedora-Minimal-armhfp-23-10-sda.raw /mnt/loopfedroot

第4阶段

Bootloader + SPL已记录在MMC上

sudo dd if=u-boot-sunxi-with-spl.bin of=${card} bs=1024 seek=8

第5阶段

Fedora启动分区已被复制和修改

第1步

cd /mnt && sudo cp -frT --preserve=all ./loopfedboot ./cbxboot

第2步

sudo sed --in-place=*.nboot.bak -e "\%root=UUID=[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}% s/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/$(sudo blkid -c /dev/null -s UUID -o value ${card}${p}2)/" /mnt/cbxboot/extlinux/extlinux.conf

第6阶段

Fedora根分区已被复制和修改

第1步

cd /mnt && sudo cp -frT --preserve=all ./loopfedroot ./cbxroot

第2步

sudo sed --in-place=*.nboot.bak -e "\%/boot% s%[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}%$(sudo blkid -c /dev/null -s UUID -o value ${card}${p}1)%" /mnt/cbxroot/etc/fstab
sudo sed --in-place=*.nroot.bak -e "\%[[:space:]]/[[:space:]]% s%[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}%$(sudo blkid -c /dev/null -s UUID -o value ${card}${p}2)%" /mnt/cbxroot/etc/fstab
sudo sed --in-place=*.nswap.bak -e "\%[[:space:]]swap[[:space:]]% s%[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}%$(sudo blkid -c /dev/null -s UUID -o value ${card}${p}3)%" /mnt/cbxroot/etc/fstab

中间结果

现在,在插槽中使用MMC卡启动Cubieboard后,系统会挂起着名的&#34;启动内核映像......&#34;消息。

但是,这不是故事的结局。正如我在开始时提到的,一个实验证明是成功的。也就是说,我尝试使用随Fedora 23提供的救援initramfs图像。带有

的extlinux.conf
label Fedora-Minimal-armhfp-23-10 (Initramfs Rescue only)"
    kernel /vmlinuz-4.2.3-300.fc23.armv7hl
    append ...
    fdtdir /dtb-4.2.3-300.fc23.armv7hl/
    initrd /initramfs-0-rescue-afe50178a2e84c8daa250c0980bfe6f8.img

取得了成功!

我试图分析有希望的结果的根本原因。我问自己的问题是&#34;这两个图像之间有什么区别?&#34;

sudo zcat initramfs-4.2.3-300.fc23-armv7hl.img | cpio -it > /tmp/normal.txt
sudo zcat initramfs-0-rescue-afe50178a2e84c8daa250c0980bfe6f8.img | cpio -it > /tmp/rescue.txt
diff -ay --suppress-common rescue.txt normal.txt | sed -s "s/[[:space:]]<//"

产生以下输出:

usr/bin/free                             
usr/bin/more                             
usr/bin/scp                          
usr/bin/ssh                          
usr/lib/libcrypt-2.22.so                     
usr/lib/libcrypt.so.1                        
usr/lib/libfipscheck.so.1                    
usr/lib/libfipscheck.so.1.2.1                    
usr/lib/libfreebl3.so                        
usr/lib/liblber-2.4.so.2                     
usr/lib/liblber-2.4.so.2.10.3                    
usr/lib/libldap-2.4.so.2                     
usr/lib/libldap-2.4.so.2.10.3                    
usr/lib/libnspr4.so                      
usr/lib/libnss3.so                       
usr/lib/libnssutil3.so                       
usr/lib/libplc4.so                       
usr/lib/libplds4.so                      
usr/lib/libsasl2.so.3                        
usr/lib/libsasl2.so.3.0.0                    
usr/lib/libsmime3.so                         
usr/lib/libssl3.so                       
usr/lib/libutil-2.22.so                      
usr/lib/libutil.so.1    

此外

mkdir /tmp/cbxinitramfs_normal  && cd /tmp/cbxinitramfs_normal
zcat /mnt/cbxboot/initramfs-4.2.3-300.fc23-armv7hl.img | cpio -i -d -H newc --no-absolute-filenames
mkdir /tmp/cbxinitramfs_rescue  && cd /tmp/cbxinitramfs_rescue
zcat /mnt/cbxboot/initramfs-0-rescue-afe50178a2e84c8daa250c0980bfe6f8.img | cpio -i -d -H newc --no-absolute-filenames
diff -r /tmp/cbxinitramfs_rescue /tmp/cbxinitramfs_normal

产生以下结果:

Only in initramfs_rescue/bin: free
Only in initramfs_rescue/bin: more
Only in initramfs_rescue/bin: scp
Only in initramfs_rescue/bin: ssh
Binary files initramfs_rescue/etc/ld.so.cache and initramfs_normal/etc/ld.so.cache differs
diff -r initramfs_rescue/lib/dracut/build-parameter.txt initramfs_normal/lib/dracut/build-parameter.txt
1c1
< --no-hostonly -a 'rescue'
---
> -f
diff -r initramfs_rescue/lib/dracut/modules.txt initramfs_normal/lib/dracut/modules.txt
4d3
< rescue
Only in initramfs_rescue/lib: libcrypt-2.22.so
Only in initramfs_rescue/lib: libcrypt.so.1
Only in initramfs_rescue/lib: libfipscheck.so.1
Only in initramfs_rescue/lib: libfipscheck.so.1.2.1
Only in initramfs_rescue/lib: libfreebl3.so
Only in initramfs_rescue/lib: liblber-2.4.so.2
Only in initramfs_rescue/lib: liblber-2.4.so.2.10.3
Only in initramfs_rescue/lib: libldap-2.4.so.2
Only in initramfs_rescue/lib: libldap-2.4.so.2.10.3
Only in initramfs_rescue/lib: libnspr4.so
Only in initramfs_rescue/lib: libnss3.so
Only in initramfs_rescue/lib: libnssutil3.so
Only in initramfs_rescue/lib: libplc4.so
Only in initramfs_rescue/lib: libplds4.so
Only in initramfs_rescue/lib: libsasl2.so.3
Only in initramfs_rescue/lib: libsasl2.so.3.0.0
Only in initramfs_rescue/lib: libsmime3.so
Only in initramfs_rescue/lib: libssl3.so
Only in initramfs_rescue/lib: libutil-2.22.so
Only in initramfs_rescue/lib: libutil.so.1
Only in initramfs_rescue/usr/bin: free
Only in initramfs_rescue/usr/bin: more
Only in initramfs_rescue/usr/bin: scp
Only in initramfs_rescue/usr/bin: ssh
diff -r initramfs_rescue/usr/lib/dracut/build-parameter.txt initramfs_normal/usr/lib/dracut/build-parameter.txt
1c1
< --no-hostonly -a 'rescue'
---
> -f
diff -r initramfs_rescue/usr/lib/dracut/modules.txt initramfs_normal/usr/lib/dracut/modules.txt
4d3
< rescue
Only in initramfs_rescue/usr/lib: libcrypt-2.22.so
Only in initramfs_rescue/usr/lib: libcrypt.so.1
Only in initramfs_rescue/usr/lib: libfipscheck.so.1
Only in initramfs_rescue/usr/lib: libfipscheck.so.1.2.1
Only in initramfs_rescue/usr/lib: libfreebl3.so
Only in initramfs_rescue/usr/lib: liblber-2.4.so.2
Only in initramfs_rescue/usr/lib: liblber-2.4.so.2.10.3
Only in initramfs_rescue/usr/lib: libldap-2.4.so.2
Only in initramfs_rescue/usr/lib: libldap-2.4.so.2.10.3
Only in initramfs_rescue/usr/lib: libnspr4.so
Only in initramfs_rescue/usr/lib: libnss3.so
Only in initramfs_rescue/usr/lib: libnssutil3.so
Only in initramfs_rescue/usr/lib: libplc4.so
Only in initramfs_rescue/usr/lib: libplds4.so
Only in initramfs_rescue/usr/lib: libsasl2.so.3
Only in initramfs_rescue/usr/lib: libsasl2.so.3.0.0
Only in initramfs_rescue/usr/lib: libsmime3.so
Only in initramfs_rescue/usr/lib: libssl3.so
Only in initramfs_rescue/usr/lib: libutil-2.22.so
Only in initramfs_rescue/usr/lib: libutil.so.1

所以,只有&#34;只有&#34;一些额外的二进制文件没有特殊的配置文件。

当然,我知道上面的检查方法是微不足道的。但在深入挖掘之前,我决定要求一些提示。

我的问题是:

救援initramfs图像成功的根本原因在哪里?

附录

extlinux.conf条目

label Fedora-Minimal-armhfp-23-10 (4.2.3-300.fc23.armv7hl)
    kernel /vmlinuz-4.2.3-300.fc23.armv7hl
    append ro root=UUID=3dc1e3c9-b443-41ab-8583-698ce7df6bd0 
    fdtdir /dtb-4.2.3-300.fc23.armv7hl/
    initrd /initramfs-4.2.3-300.fc23.armv7hl.img

无法启动。这是启动日志:

U-Boot SPL 2016.01 (Mar 16 2016 - 14:25:13)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC


U-Boot 2016.01 (Mar 16 2016 - 14:25:13 +0100) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SCSI:  SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst 
Net:   eth0: ethernet@01c50000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
371 bytes read in 272 ms (1000 Bytes/s)
Fedora-Minimal-armhfp-23-10 Boot Options.
1:  Fedora-Minimal-armhfp-23-10 (4.2.3-300.fc23.armv7hl)
2:  Fedora-Minimal-armhfp-23-10 (Rescue)
Enter choice: 1
1:  Fedora-Minimal-armhfp-23-10 (4.2.3-300.fc23.armv7hl)
Retrieving file: /initramfs-4.2.3-300.fc23.armv7hl.img
38958034 bytes read in 25124 ms (1.5 MiB/s)
Retrieving file: /vmlinuz-4.2.3-300.fc23.armv7hl
5811776 bytes read in 1761 ms (3.1 MiB/s)
append: ro root=UUID=41bff98f-0fa0-4a4c-95cd-b81a4900f4fc 
Retrieving file: /dtb-4.2.3-300.fc23.armv7hl/sun7i-a20-cubieboard2.dtb
27039 bytes read in 2290 ms (10.7 KiB/s)
Kernel image @ 0x42000000 [ 0x000000 - 0x58ae40 ]
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Ramdisk to 47ad8000, end 49fff3d2 ... OK
   Loading Device Tree to 47ace000, end 47ad799e ... OK

Starting kernel ...

但是extlinux.conf条目

label Fedora-Minimal-armhfp-23-10 (Rescue)
    kernel /vmlinuz-4.2.3-300.fc23.armv7hl
    append ro root=UUID=3dc1e3c9-b443-41ab-8583-698ce7df6bd0 
    fdtdir /dtb-4.2.3-300.fc23.armv7hl/
    initrd /initramfs-0-rescue-afe50178a2e84c8daa250c0980bfe6f8.img

成功启动。这是启动日志:

U-Boot SPL 2016.01 (Mar 19 2016 - 08:36:05)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC


U-Boot 2016.01 (Mar 19 2016 - 08:36:05 +0100) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
SCSI:  SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst 
Net:   eth0: ethernet@01c50000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  2  1  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
1979 bytes read in 277 ms (6.8 KiB/s)
Fedora-Minimal-armhfp-23-10 Boot Options.
1:  Fedora-Minimal-armhfp-23-10 (4.2.3-300.fc23.armv7hl)
2:  Fedora-Minimal-armhfp-23-10 (Rescue)
Enter choice: 2
2:  Fedora-Minimal-armhfp-23-10 (Rescue)
Retrieving file: /initramfs-0-rescue-afe50178a2e84c8daa250c0980bfe6f8.img
40557822 bytes read in 12080 ms (3.2 MiB/s)
Retrieving file: /vmlinuz-4.2.3-300.fc23.armv7hl
5811776 bytes read in 1774 ms (3.1 MiB/s)
append: ro root=UUID=3dc1e3c9-b443-41ab-8583-698ce7df6bd0
Retrieving file: /dtb-4.2.3-300.fc23.armv7hl/sun7i-a20-cubieboard2.dtb
27039 bytes read in 671 ms (39.1 KiB/s)
Kernel image @ 0x42000000 [ 0x000000 - 0x58ae40 ]
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Ramdisk to 47952000, end 49fffcfe ... OK
   Loading Device Tree to 47948000, end 4795199e ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.2.3-300.fc23.armv7hl (mockbuild@arm04-builder03.arm.fedoraproject.org) (gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC) ) #1 SMP Mon Oct 5 16:45:59 UTC 2015
[    0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Cubietech Cubieboard2
[    0.000000] cma: Reserved 16 MiB at 0x7f000000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] PERCPU: Embedded 12 pages/cpu @eeec6000 s19840 r8192 d21120 u49152
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260434
[    0.000000] Kernel command line: ro root=UUID=3dc1e3c9-b443-41ab-8583-698ce7df6bd0
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 968832K/1048576K available (7232K kernel code, 1075K rwdata, 3288K rodata, 1036K init, 843K bss, 63360K reserved, 16384K cma-reserved, 253952K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0208000 - 0xc0c4e5bc   (10522 kB)
[    0.000000]       .init : 0xc0c4f000 - 0xc0d52000   (1036 kB)
[    0.000000]       .data : 0xc0d52000 - 0xc0e5ed88   (1076 kB)
[    0.000000]        .bss : 0xc0e5ed88 - 0xc0f31b10   ( 844 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000]  Offload RCU callbacks from all CPUs
[    0.000000]  Offload RCU callbacks from CPUs: 0-1.
[    0.000000] Architected cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000021] Switching to timer-based delay loop, resolution 41ns
[    0.002217] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.003022] clocksource: hstimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[    0.003461] Console: colour dummy device 80x30
[    0.004393] console [tty0] enabled
[    0.004434] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=120000)
[    0.004487] pid_max: default: 32768 minimum: 301
[    0.004661] Security Framework initialized
[    0.004694] SELinux:  Initializing.
[    0.004769] Yama: becoming mindful.
[    0.005085] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.005126] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.006033] Initializing cgroup subsys blkio
[    0.006088] Initializing cgroup subsys memory
[    0.006153] Initializing cgroup subsys devices
[    0.006189] Initializing cgroup subsys freezer
[    0.006223] Initializing cgroup subsys net_cls
[    0.006254] Initializing cgroup subsys perf_event
[    0.006287] Initializing cgroup subsys net_prio
[    0.006380] CPU: Testing write buffer coherency: ok
[    0.006457] ftrace: allocating 30500 entries in 60 pages
[    0.049935] /cpus/cpu@0 missing clock-frequency property
[    0.049997] /cpus/cpu@1 missing clock-frequency property
[    0.050027] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.050124] Setting up static identity map for 0x40208280 - 0x40208318
[    0.056842] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.056971] Brought up 2 CPUs
[    0.057034] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[    0.057057] CPU: All CPU(s) started in HYP mode.
[    0.057076] CPU: Virtualization extensions available.
[    0.058124] devtmpfs: initialized
[    0.066807] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[    0.067750] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
[    0.069015] atomic64_test: passed
[    0.069177] pinctrl core: initialized pinctrl subsystem
[    0.071343] NET: Registered protocol family 16
[    0.073498] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.084662] No ATAGs?
[    0.084773] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.084828] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.086614] Serial: AMBA PL011 UART driver
[    0.103227] reg-fixed-voltage ahci-5v: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/ahci_pwr_pin@0, deferring probe
[    0.103326] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[    0.103391] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[    0.107154] vgaarb: loaded
[    0.108463] SCSI subsystem initialized
[    0.109200] usbcore: registered new interface driver usbfs
[    0.109323] usbcore: registered new interface driver hub
[    0.109462] usbcore: registered new device driver usb
[    0.111650] NetLabel: Initializing
[    0.111689] NetLabel:  domain hash size = 128
[    0.111709] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.111800] NetLabel:  unlabeled traffic allowed by default
[    0.112360] clocksource: Switched to clocksource arch_sys_counter
[    0.191181] NET: Registered protocol family 2
[    0.192244] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.192448] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.192595] TCP: Hash tables configured (established 8192 bind 8192)
[    0.192714] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.192791] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.193137] NET: Registered protocol family 1
[    0.193997] RPC: Registered named UNIX socket transport module.
[    0.194038] RPC: Registered udp transport module.
[    0.194059] RPC: Registered tcp transport module.
[    0.194080] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.194748] Unpacking initramfs...
[    3.872008] Freeing initrd memory: 39608K (c7952000 - ca000000)
[    3.872535] hw perfevents: Failed to parse /pmu/interrupt-affinity[0]
[    3.872639] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    3.874864] futex hash table entries: 512 (order: 3, 32768 bytes)
[    3.875065] audit: initializing netlink subsys (disabled)
[    3.875169] audit: type=2000 audit(3.855:1): initialized
[    3.887973] zpool: loaded
[    3.888021] zbud: loaded
[    3.888887] VFS: Disk quotas dquot_6.6.0
[    3.889217] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    3.891644] NFS: Registering the id_resolver key type
[    3.891754] Key type id_resolver registered
[    3.891778] Key type id_legacy registered
[    3.891820] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    3.892816] Key type big_key registered
[    3.923092] NET: Registered protocol family 38
[    3.923286] bounce: pool size: 64 pages
[    3.923657] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    3.923925] io scheduler noop registered
[    3.923965] io scheduler deadline registered
[    3.924253] io scheduler cfq registered (default)
[    3.929693] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    3.933870] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    3.956642] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 40, base_baud = 1500000) is a U6_16550A
[    4.713388] console [ttyS0] enabled
[    4.717529] Serial: AMBA driver
[    4.721480] msm_serial: driver initialized
[    4.729079] libphy: Fixed MDIO Bus: probed
[    4.733975] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.740589] ehci-pci: EHCI PCI platform driver
[    4.745157] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    4.751390] ohci-pci: OHCI PCI platform driver
[    4.755925] uhci_hcd: USB Universal Host Controller Interface driver
[    4.762640] usbcore: registered new interface driver usbserial
[    4.768562] usbcore: registered new interface driver usbserial_generic
[    4.775174] usbserial: USB Serial support registered for generic
[    4.781573] mousedev: PS/2 mouse device common for all mice
[    4.790300] device-mapper: uevent: version 1.0.3
[    4.795666] device-mapper: ioctl: 4.33.0-ioctl (2015-8-18) initialised: dm-devel@redhat.com
[    4.804776] ledtrig-cpu: registered to indicate activity on CPUs
[    4.810966] hidraw: raw HID events driver (C) Jiri Kosina
[    4.816746] usbcore: registered new interface driver usbhid
[    4.822364] usbhid: USB HID core driver
[    4.828032] drop_monitor: Initializing network drop monitor service
[    4.834676] ip_tables: (C) 2000-2006 Netfilter Core Team
[    4.840195] Initializing XFRM netlink socket
[    4.845639] NET: Registered protocol family 10
[    4.851611] mip6: Mobile IPv6
[    4.854696] NET: Registered protocol family 17
[    4.859357] Key type dns_resolver registered
[    4.864243] ThumbEE CPU extension supported.
[    4.868611] Registering SWP/SWPB emulation handler
[    4.874627] registered taskstats version 1
[    4.878900] zswap: loading zswap
[    4.882148] zswap: using zbud pool
[    4.885654] zswap: using lzo compressor
[    4.892076] hctosys: unable to open rtc device (rtc0)
[    4.897706] sr_init: No PMIC hook to init smartreflex
[    4.902948] sr_init: platform driver register failed for SR
[    4.915436] usb2-vbus: disabling
[    4.918773] usb1-vbus: disabling
[    4.922015] ahci-5v: disabling
[    4.925104] vcc5v0: disabling
[    4.928101] vcc3v3: disabling
[    4.931080] vcc3v0: disabling
[    4.936859] Freeing unused kernel memory: 1036K (c0c4f000 - c0d52000)
[    4.967562] random: systemd urandom read with 0 bits of entropy available
[    4.980714] systemd[1]: systemd 222 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    4.999674] systemd[1]: Detected architecture arm.
[    5.004599] systemd[1]: Running in initial RAM disk.

Welcome to Fedora 23 (Twenty Three) dracut-043-60.git20150811.fc23 (Initramfs)

... (30 000 characters Stackoverflow limits)

Welcome to Fedora 23 (Twenty Three)

... (30 000 characters Stackoverflow limits)

Fedora 23 (Twenty Three)
Kernel 4.2.3-300.fc23.armv7hl on an armv7l (ttyS0)

localhost login:

1 个答案:

答案 0 :(得分:3)

  

救援initramfs图像成功的根本原因在哪里?

initramfs的内容不会影响早期启动(即在内核启动序列的后期访问initramfs)。
在启动的早期阶段唯一突出的属性是它的内存占用 显然较小的 initramfs可以成功启动,而较大的 initramfs无法启动。
这意味着在U-Boot启动阶段存在不正确的内存布局(例如,内核映像可能会在解压缩时覆盖自身)。

但是,您没有提供失败启动的任何显着输出(除了最终消息) 内核映像(和dtb)在内存中加载了什么? 这些图片的尺寸有多大?

BTW你的方法来确定&#34;这两个图像之间的区别&#34; 是假的。您只是比较文件名列表;文件的内容可能不同(并且与您构建的内核不兼容)。通常,您不应期望内核和rootfs的任意配对都能正常工作。

ADDENDUM

根据启动日志,U-Boot使用名为 vmlinuz-4.2.3-300.fc23.armv7hl 的文件作为内核映像。
这可能不是用于在ARM上启动的有效内核映像 &#34; vmlinux的&#34;文件通常是带有ELF标头的可执行文件。 ELF头不是可执行代码,因此在引导期间ELF头本身执行时将导致不可预测的结果(以及可能的引导失败)。

要在ARM上启动,您需要使用内核映像文件(例如 arch / arm / boot / zImage uImage )。

ADDENDUM 2

  

...只更改一个启动配置参数和最终效果之间存在严格的关联。

这是一个错误的主张 现在您已经提供了两个启动日志,现在显而易见的是,您使用了两个不同的U-Boot版本(&#34; 3月16日&#34;构建与#34; 3月19日& #34; build),因此可能是两个完全不同的环境!

此外,即使存在相关性,&#34;相关性也不是因果关系&#34;。

  

也许我一开始并没有清楚地表达过这种情况。

是的,你没有。
您已经省略了使用两个U-Boot构建的重要信息。 (假设我只涉及一个U-Boot,我很愚蠢!)

U-Boot环境变量通常执行内核(+ initramfs)和dtb映像的加载,并且是内存布局至关重要的一个步骤。这是我的第一个问题所要求的信息(仍然没有答复)。

请为 每个 版本/版本(即printenv命令输出)提供U-Boot环境。

甚至更好,至少通过使用相同版本/版本的U-Boot和公共环境进行引导来证明U-Boot(及其环境变量)不是一个因素。