【TINY4412】LINUX移植笔记:(3)Initramfs文件系统

【TINY4412】LINUX移植笔记:(3)Initramfs文件系统

宿主机 : 虚拟机 Ubuntu 16.04 LTS / X64
目标板[底板]: Tiny4412SDK - 1506
目标板[核心板]: Tiny4412 - 1412
LINUX内核: 4.12.0
交叉编译器: gcc-arm-none-eabi-5_4-2016q3
日期: 2017-7-9 11:23:51
作者: SY

简介

  • Initramfs文件系统默认集成到Linux中,是一种内存文件系统

  • 制作Initramfs文件系统,首先需要制作最小文件系统,一般都是使用BusyBox

测试

  • 烧录

    >> 开发板
    >>   TINY4412 # 
    >>   TINY4412 # dfu 0 ram 0
    >>   USB PHY0 Enable
    
    >> 电脑
    >>   root@ubuntu:/opt/linux-4.12# dfu-util -D ./arch/arm/boot/uImage 
    >>   dfu-util 0.8
    
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2014 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to dfu-util@lists.gnumonks.org
    
    dfu-util: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util        release!!!
    Opening DFU capable USB device...
    ID 18d1:4e30
    Run-time device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Setting #0 ...
    Determining device status: state = dfuIDLE, status = 0
    dfuIDLE, continuing
    DFU mode device DFU version 0110
    Device returned transfer size 4096
    Copying data from PC to DFU device
    Download        [=========================] 100%      4792264 bytes
    Download done.
    state(7) = dfuMANIFEST, status(0) = No error condition is present
    state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    root@ubuntu:/opt/linux-4.12#
    
    >> 开发板
    >> TINY4412 # bootm 
    
    ## Booting kernel from Legacy Image at 40008000 ...
    
     Image Name:   Linux-4.12.0-g193655b
     Image Type:   ARM Linux Kernel Image (uncompressed)
     Data Size:    4792200 Bytes = 4.6 MiB
     Load Address: 40008000
     Entry Point:  40008000
     Verifying Checksum ... OK
    EHCI failed to shut down host controller.
     Loading Kernel Image ... OK
    
    Starting kernel ...
  • 开发板死机了,打开调试输出

    root@ubuntu:/opt/linux-4.12# make menuconfig
    |-- Kernel hacking
        |-- [*] Kernel low-level debugging functions (read help!) 
        |-- Kernel low-level debugging port (Use Samsung S3C UART 0 for low-level debug)
    |-- [*] Early printk
  • 烧录到开发板测试

    TINY4412 # bootm
    
    ## Booting kernel from Legacy Image at 40008000 ...
    
     Image Name:   Linux-4.12.0-g98c9281-dirty
     Image Type:   ARM Linux Kernel Image (uncompressed)
     Data Size:    4827896 Bytes = 4.6 MiB
     Load Address: 40008000
     Entry Point:  40008000
     Verifying Checksum ... OK
     Loading Kernel Image ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    
    Error: unrecognized/unsupported machine ID (r1 = 0x00001200).
    
    Available machine support:
    
    ID (hex)        NAME
    ffffffff        Generic DT based system
    ffffffff        SAMSUNG EXYNOS (Flattened Device Tree)
    
    Please check your kernel config and/or bootloader.
    • 查找资料,可能是linuxdts文件和Initramfs文件系统没有加载。
  • 配置 initramfs

    General setup  ---> 
        [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
    (/dev/rootfs)    Initramfs source file(s)
    Device Drivers  --->   
        [*] Block devices  --->
        <*>   RAM block device support
            (16)    Default number of RAM disks 
            (8192)  Default RAM disk size (kbytes)
  • 进入开发板

    TINY4412 # setenv dfu_alt_info uImage ram 0x41000000 0xA00000\;exynos4412-tiny4412.dtb ram 0x42000000 0x100000
    • U-BOOT加载Linux内核Ramdisk内核dts设备树是有一定的顺序的,查看bootm源码:
    /* we overload the cmd field with our state machine info instead of a
     * function pointer */
    static cmd_tbl_t cmd_bootm_sub[] = {
        U_BOOT_CMD_MKENT(start, 0, 1, (void *)BOOTM_STATE_START, "", ""),
        U_BOOT_CMD_MKENT(loados, 0, 1, (void *)BOOTM_STATE_LOADOS, "", ""),
    
    #ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
    
        U_BOOT_CMD_MKENT(ramdisk, 0, 1, (void *)BOOTM_STATE_RAMDISK, "", ""),
    
    #endif
    
    
    #ifdef CONFIG_OF_LIBFDT
    
        U_BOOT_CMD_MKENT(fdt, 0, 1, (void *)BOOTM_STATE_FDT, "", ""),
    
    #endif
    
        U_BOOT_CMD_MKENT(cmdline, 0, 1, (void *)BOOTM_STATE_OS_CMDLINE, "", ""),
        U_BOOT_CMD_MKENT(bdt, 0, 1, (void *)BOOTM_STATE_OS_BD_T, "", ""),
        U_BOOT_CMD_MKENT(prep, 0, 1, (void *)BOOTM_STATE_OS_PREP, "", ""),
        U_BOOT_CMD_MKENT(fake, 0, 1, (void *)BOOTM_STATE_OS_FAKE_GO, "", ""),
        U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""),
    };
    • 首先加载loados,也就是Linxu内核。然后加载ramdisk,也就是文件系统。最后加载fdt,也就是内核设备树文件。
  • 重新烧录

    TINY4412 # bootm 41000000 - 42000000
    
    ## Booting kernel from Legacy Image at 41000000 ...
    
     Image Name:   Linux-4.12.0-g98c9281-dirty
     Image Type:   ARM Linux Kernel Image (uncompressed)
     Data Size:    5958168 Bytes = 5.7 MiB
     Load Address: 40008000
     Entry Point:  40008000
     Verifying Checksum ... OK
    
    ## Flattened Device Tree blob at 42000000
    
     Booting using the fdt blob at 0x42000000
     Loading Kernel Image ... OK
     Loading Device Tree to 4fff1000, end 4ffff56c ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    • bootm中的-表示跳过 Ramdisk,又死机了!
  • 经过排除,应该是bootargs参数未设置

    setenv bootargs root=/dev/ram0 rw console=ttySAC0,115200 init=/linuxrc earlyprintk
  • 重新烧录

    TINY4412 # bootm 41000000 - 42000000
    
    ## Booting kernel from Legacy Image at 41000000 ...
    
     Image Name:   Linux-4.12.0-g98c9281-dirty
     Image Type:   ARM Linux Kernel Image (uncompressed)
     Data Size:    5958168 Bytes = 5.7 MiB
     Load Address: 40008000
     Entry Point:  40008000
     Verifying Checksum ... OK
    
    ## Flattened Device Tree blob at 42000000
    
     Booting using the fdt blob at 0x42000000
     Loading Kernel Image ... OK
     Loading Device Tree to 4fff1000, end 4ffff56c ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Booting Linux on physical CPU 0xa00
    [    0.000000] Linux version 4.12.0-g98c9281-dirty (root@ubuntu) (gcc version 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] (GNU Tools for ARM Embedded Processors) ) #4 SMP PREEMPT Sun Jul 9 10:00:46 CST 2017
    [    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt: Machine model: FriendlyARM TINY4412 board based on Exynos4412
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] Memory policy: Data cache writealloc
    [    0.000000] cma: Reserved 96 MiB at 0x7a000000
    [    0.000000] Samsung CPU ID: 0xe4412011
    [    0.000000] percpu: Embedded 16 pages/cpu @ef78f000 s34968 r8192 d22376 u65536
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608
    [    0.000000] Kernel command line: root=/dev/ram0 rw console=ttySAC0,115200 init=/linuxrc earlyprintk
    [    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: 927808K/1048576K available (7168K kernel code, 334K rwdata, 2448K rodata, 2048K init, 326K bss, 22464K reserved, 98304K cma-reserved, 163840K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0800000   (8160 kB)
    [    0.000000]       .init : 0xc0b00000 - 0xc0d00000   (2048 kB)
    [    0.000000]       .data : 0xc0d00000 - 0xc0d538d0   ( 335 kB)
    [    0.000000]        .bss : 0xc0d5b0e4 - 0xc0daca20   ( 327 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] L2C: platform modifies aux control register: 0x02070000 -> 0x3e470001
    [    0.000000] L2C: platform provided aux values permit register corruption.
    [    0.000000] L2C: DT/platform modifies aux control register: 0x02070000 -> 0x3e470001
    [    0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [    0.000000] L2C-310: enabling full line of zeros but not enabled in Cortex-A9
    [    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
    [    0.000000] L2C-310 cache controller enabled, 16 ways, 1024 kB
    [    0.000000] L2C-310: CACHE_ID 0x4100c4c8, AUX_CTRL 0x4e470001
    [    0.000000] Exynos4x12 clocks: sclk_apll = 700000000, sclk_mpll = 800000000
    [    0.000000]  sclk_epll = 96035156, sclk_vpll = 108035156, arm_clk = 1400000000
    [    0.000000] Switching to timer-based delay loop, resolution 41ns
    [    0.000000] clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.008061] Console: colour dummy device 80x30
    [    0.012419] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
    [    0.022835] pid_max: default: 32768 minimum: 301
    [    0.027578] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.034199] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.041626] CPU: Testing write buffer coherency: ok
    [    0.046603] CPU0: thread -1, cpu 0, socket 10, mpidr 80000a00
    [    0.084752] Setting up static identity map for 0x40100000 - 0x40100060
    [    0.144729] smp: Bringing up secondary CPUs ...
    [    0.204790] CPU1: thread -1, cpu 1, socket 10, mpidr 80000a01
    [    0.284781] CPU2: thread -1, cpu 2, socket 10, mpidr 80000a02
    [    0.364780] CPU3: thread -1, cpu 3, socket 10, mpidr 80000a03
    [    0.364825] smp: Brought up 1 node, 4 CPUs
    [    0.386283] SMP: Total of 4 processors activated (192.00 BogoMIPS).
    [    0.392612] CPU: All CPU(s) started in SVC mode.
    [    0.397892] devtmpfs: initialized
    [    0.407787] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [    0.415523] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.425273] futex hash table entries: 1024 (order: 4, 65536 bytes)
    [    0.434382] pinctrl core: initialized pinctrl subsystem
    [    0.440068] /lcd0-power-domain@10023C80 has as child subdomain: /tv-power-domain@10023C20.
    [    0.448811] NET: Registered protocol family 16
    [    0.454479] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.462304] cpuidle: using governor menu
    [    0.485066] SCSI subsystem initialized
    [    0.488871] usbcore: registered new interface driver usbfs
    [    0.494309] usbcore: registered new interface driver hub
    [    0.499717] usbcore: registered new device driver usb
    [    0.505315] Advanced Linux Sound Architecture Driver Initialized.
    [    0.511989] clocksource: Switched to clocksource mct-frc
    [    0.524402] missing cooling_device property
    [    0.528489] failed to build thermal zone cpu-thermal: -2
    [    0.533947] NET: Registered protocol family 2
    [    0.538640] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.545666] TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
    [    0.552320] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.558708] UDP hash table entries: 512 (order: 2, 24576 bytes)
    [    0.564647] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
    [    0.571150] NET: Registered protocol family 1
    [    0.575722] RPC: Registered named UNIX socket transport module.
    [    0.581549] RPC: Registered udp transport module.
    [    0.586342] RPC: Registered tcp transport module.
    [    0.591097] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.648336] audit: initializing netlink subsys (disabled)
    [    0.653932] audit: type=2000 audit(0.651:1): state=initialized audit_enabled=0 res=1
    [    0.654027] workingset: timestamp_bits=30 max_order=18 bucket_order=0
    [    0.658831] NFS: Registering the id_resolver key type
    [    0.658844] Key type id_resolver registered
    [    0.658846] Key type id_legacy registered
    [    0.658867] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
    [    0.662060] bounce: pool size: 64 pages
    [    0.662087] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
    [    0.662092] io scheduler noop registered
    [    0.662094] io scheduler deadline registered
    [    0.662109] io scheduler cfq registered (default)
    [    0.662112] io scheduler mq-deadline registered
    [    0.662114] io scheduler kyber registered
    [    0.672233] dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-141330
    [    0.672239] dma-pl330 12680000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
    [    0.674089] dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-141330
    [    0.674094] dma-pl330 12690000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
    [    0.674792] dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-141330
    [    0.674797] dma-pl330 12850000.mdma:         DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
    [    0.772781] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
    [    0.780286] 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 46, base_baud = 0) is a S3C6400/10
    [    0.789142] console [ttySAC0] enabled
    [    0.789142] console [ttySAC0] enabled
    [    0.796470] bootconsole [earlycon0] disabled
    [    0.796470] bootconsole [earlycon0] disabled
    [    0.805305] 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 47, base_baud = 0) is a S3C6400/10
    [    0.805628] 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 48, base_baud = 0) is a S3C6400/10
    [    0.805941] 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 49, base_baud = 0) is a S3C6400/10
    [    0.818642] brd: module loaded
    [    0.824203] loop: module loaded
    [    0.824920] libphy: Fixed MDIO Bus: probed
    [    0.825067] usbcore: registered new interface driver r8152
    [    0.825301] usbcore: registered new interface driver asix
    [    0.830687] usbcore: registered new interface driver ax88179_178a
    [    0.836791] usbcore: registered new interface driver cdc_ether
    [    0.842616] usbcore: registered new interface driver smsc75xx
    [    0.848311] usbcore: registered new interface driver smsc95xx
    [    0.854048] usbcore: registered new interface driver net1080
    [    0.859667] usbcore: registered new interface driver cdc_subset
    [    0.865596] usbcore: registered new interface driver zaurus
    [    0.871136] usbcore: registered new interface driver cdc_ncm
    [    0.877270] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    0.883280] ehci-exynos: EHCI EXYNOS driver
    [    0.887524] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    0.893608] ohci-exynos: OHCI EXYNOS driver
    [    0.898067] usbcore: registered new interface driver usb-storage
    [    0.904447] s3c-rtc 10070000.rtc: failed to find rtc source clock
    [    0.909833] s3c-rtc: probe of 10070000.rtc failed with error -2
    [    0.915897] i2c /dev entries driver
    [    0.920839] s3c2410-wdt 10060000.watchdog: watchdog inactive, reset disabled, irq disabled
    [    0.927835] device-mapper: ioctl: 4.35.0-ioctl (2016-06-23) initialised: dm-devel@redhat.com
    [    0.937359] sdhci: Secure Digital Host Controller Interface driver
    [    0.942039] sdhci: Copyright(c) Pierre Ossman
    [    0.946633] s3c-sdhci 12530000.sdhci: clock source 2: mmc_busclk.2 (20000000 Hz)
    [    1.012035] mmc0: SDHCI controller on samsung-hsmmc [12530000.sdhci] using ADMA
    [    1.012199] Synopsys Designware Multimedia Card Interface Driver
    [    1.016727] s5p-secss 10830000.sss: s5p-sss driver registered
    [    1.017187] usbcore: registered new interface driver usbhid
    [    1.017242] usbhid: USB HID core driver
    [    1.023542] NET: Registered protocol family 10
    [    1.024176] Segment Routing with IPv6
    [    1.026223] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.032452] NET: Registered protocol family 17
    [    1.036529] NET: Registered protocol family 15
    [    1.040987] Key type dns_resolver registered
    [    1.045363] Registering SWP/SWPB emulation handler
    [    1.061029] mmc0: new high speed SDHC card at address 0007
    [    1.061408] mmcblk0: mmc0:0007 SD16G 14.5 GiB 
    [    1.061730] hctosys: unable to open rtc device (rtc0)
    [    1.065527] ALSA device list:
    [    1.067854]   No soundcards found.
    [    1.072546] List of all partitions:
    [    1.074716] 0100            8192 ram0 
    [    1.074719]  (driver?)
    [    1.080790] 0101            8192 ram1 
    [    1.080793]  (driver?)
    [    1.086867] 0102            8192 ram2 
    [    1.086870]  (driver?)
    [    1.092958] 0103            8192 ram3 
    [    1.092961]  (driver?)
    [    1.099018] 0104            8192 ram4 
    [    1.099021]  (driver?)
    [    1.105095] 0105            8192 ram5 
    [    1.105097]  (driver?)
    [    1.111170] 0106            8192 ram6 
    [    1.111173]  (driver?)
    [    1.117247] 0107            8192 ram7 
    [    1.117249]  (driver?)
    [    1.123415] 0108            8192 ram8 
    [    1.123418]  (driver?)
    [    1.129398] 0109            8192 ram9 
    [    1.129400]  (driver?)
    [    1.135475] 010a            8192 ram10 
    [    1.135477]  (driver?)
    [    1.141637] 010b            8192 ram11 
    [    1.141639]  (driver?)
    [    1.147806] 010c            8192 ram12 
    [    1.147811]  (driver?)
    [    1.153993] 010d            8192 ram13 
    [    1.153998]  (driver?)
    [    1.160129] 010e            8192 ram14 
    [    1.160133]  (driver?)
    [    1.166293] 010f            8192 ram15 
    [    1.166299]  (driver?)
    [    1.172484] b300        15179776 mmcblk0 
    [    1.172490]  driver: mmcblk
    [    1.179221] No filesystem could mount root, tried: 
    [    1.179225]  ext3
    [    1.184109]  ext4
    [    1.185990]  ext2
    [    1.187900]  cramfs
    [    1.189809]  vfat
    [    1.191893]  msdos
    [    1.193823]  romfs
    [    1.195799] 
    [    1.199276] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
    [    1.207523] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.12.0-g98c9281-dirty #4
    [    1.214722] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.220835] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.228538] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.235746] [<c034b068>] (dump_stack) from [<c01a7f88>] (panic+0xe8/0x268)
    [    1.242603] [<c01a7f88>] (panic) from [<c0b012dc>] (mount_block_root+0x220/0x268)
    [    1.250060] [<c0b012dc>] (mount_block_root) from [<c0b01524>] (mount_root+0x114/0x11c)
    [    1.257957] [<c0b01524>] (mount_root) from [<c0b016c8>] (prepare_namespace+0x19c/0x1e0)
    [    1.265944] [<c0b016c8>] (prepare_namespace) from [<c0b00e8c>] (kernel_init_freeable+0x1f4/0x200)
    [    1.274804] [<c0b00e8c>] (kernel_init_freeable) from [<c0744b30>] (kernel_init+0x8/0x110)
    [    1.282958] [<c0744b30>] (kernel_init) from [<c0108578>] (ret_from_fork+0x14/0x3c)
    [    1.290513] CPU3: stopping
    [    1.293193] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.12.0-g98c9281-dirty #4
    [    1.300393] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.306486] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.314206] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.321408] [<c034b068>] (dump_stack) from [<c010e2b8>] (handle_IPI+0x1a0/0x1b0)
    [    1.328785] [<c010e2b8>] (handle_IPI) from [<c01014e8>] (gic_handle_irq+0x94/0x98)
    [    1.336336] [<c01014e8>] (gic_handle_irq) from [<c010c78c>] (__irq_svc+0x6c/0xa8)
    [    1.343795] Exception stack(0xef0a1f78 to 0xef0a1fc0)
    [    1.348830] 1f60:                                                       00000001 00000000
    [    1.356994] 1f80: 00000000 c0115740 ef0a0000 c0d054c0 c0d05464 c0c7b138 ef0a1fd0 00000000
    [    1.365153] 1fa0: 00000000 00000000 f081b640 ef0a1fc8 c0108fd4 c0108fd8 60000013 ffffffff
    [    1.373314] [<c010c78c>] (__irq_svc) from [<c0108fd8>] (arch_cpu_idle+0x38/0x3c)
    [    1.380701] [<c0108fd8>] (arch_cpu_idle) from [<c015175c>] (do_idle+0x16c/0x200)
    [    1.388072] [<c015175c>] (do_idle) from [<c0151aa8>] (cpu_startup_entry+0x18/0x1c)
    [    1.395621] [<c0151aa8>] (cpu_startup_entry) from [<4010158c>] (0x4010158c)
    [    1.402559] CPU0: stopping
    [    1.405253] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-g98c9281-dirty #4
    [    1.412453] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.418545] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.426264] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.433466] [<c034b068>] (dump_stack) from [<c010e2b8>] (handle_IPI+0x1a0/0x1b0)
    [    1.440844] [<c010e2b8>] (handle_IPI) from [<c01014e8>] (gic_handle_irq+0x94/0x98)
    [    1.448393] [<c01014e8>] (gic_handle_irq) from [<c010c78c>] (__irq_svc+0x6c/0xa8)
    [    1.455853] Exception stack(0xc0d01f40 to 0xc0d01f88)
    [    1.460894] 1f40: 00000001 00000000 00000000 c0115740 c0d00000 c0d054c0 c0d05464 c0c7b138
    [    1.469053] 1f60: c0d01f98 00000000 00000000 00000000 000000e6 c0d01f90 c0108fd4 c0108fd8
    [    1.477207] 1f80: 60000013 ffffffff
    [    1.480685] [<c010c78c>] (__irq_svc) from [<c0108fd8>] (arch_cpu_idle+0x38/0x3c)
    [    1.488067] [<c0108fd8>] (arch_cpu_idle) from [<c015175c>] (do_idle+0x16c/0x200)
    [    1.495443] [<c015175c>] (do_idle) from [<c0151aa8>] (cpu_startup_entry+0x18/0x1c)
    [    1.502995] [<c0151aa8>] (cpu_startup_entry) from [<c0b00c90>] (start_kernel+0x38c/0x394)
    [    1.511151] [<c0b00c90>] (start_kernel) from [<4000807c>] (0x4000807c)
    [    1.517656] CPU1: stopping
    [    1.520349] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.12.0-g98c9281-dirty #4
    [    1.527549] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.533640] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.541361] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.548563] [<c034b068>] (dump_stack) from [<c010e2b8>] (handle_IPI+0x1a0/0x1b0)
    [    1.555940] [<c010e2b8>] (handle_IPI) from [<c01014e8>] (gic_handle_irq+0x94/0x98)
    [    1.563491] [<c01014e8>] (gic_handle_irq) from [<c010c78c>] (__irq_svc+0x6c/0xa8)
    [    1.570950] Exception stack(0xef09df78 to 0xef09dfc0)
    [    1.575986] df60:                                                       00000001 00000000
    [    1.584150] df80: 00000000 c0115740 ef09c000 c0d054c0 c0d05464 c0c7b138 ef09dfd0 00000000
    [    1.592309] dfa0: 00000000 00000000 ef7a48dc ef09dfc8 c0108fd4 c0108fd8 60000013 ffffffff
    [    1.600469] [<c010c78c>] (__irq_svc) from [<c0108fd8>] (arch_cpu_idle+0x38/0x3c)
    [    1.607851] [<c0108fd8>] (arch_cpu_idle) from [<c015175c>] (do_idle+0x16c/0x200)
    [    1.615227] [<c015175c>] (do_idle) from [<c0151aa8>] (cpu_startup_entry+0x18/0x1c)
    [    1.622776] [<c0151aa8>] (cpu_startup_entry) from [<4010158c>] (0x4010158c)
    [    1.629727] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
  • 估计是设置bootargs参数设置问题。

    TINY4412 # setenv bootargs root=/dev/ram0 rw rootfstype=ramfs console=ttySAC0,115200 init=/linuxrc earlyprintk
  • 重新烧录

    TINY4412 # bootm 41000000 - 42000000
    
    ## Booting kernel from Legacy Image at 41000000 ...
    
     Image Name:   Linux-4.12.0-g98c9281-dirty
     Image Type:   ARM Linux Kernel Image (uncompressed)
     Data Size:    5957944 Bytes = 5.7 MiB
     Load Address: 40008000
     Entry Point:  40008000
     Verifying Checksum ... OK
    
    ## Flattened Device Tree blob at 42000000
    
     Booting using the fdt blob at 0x42000000
     Loading Kernel Image ... OK
     Loading Device Tree to 4fff1000, end 4ffff56c ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Booting Linux on physical CPU 0xa00
    [    0.000000] Linux version 4.12.0-g98c9281-dirty (root@ubuntu) (gcc version 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] (GNU Tools for ARM Embedded Processors) ) #7 SMP PREEMPT Sun Jul 9 17:02:43 CST 2017
    [    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt: Machine model: FriendlyARM TINY4412 board based on Exynos4412
    [    0.000000] Memory policy: Data cache writealloc
    [    0.000000] cma: Reserved 96 MiB at 0x7a000000
    [    0.000000] Samsung CPU ID: 0xe4412011
    [    0.000000] percpu: Embedded 16 pages/cpu @ef78f000 s34968 r8192 d22376 u65536
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608
    [    0.000000] Kernel command line: root=/dev/ram0 rw console=ttySAC0,115200 init=/linuxrc rootfstype=ramfs
    [    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: 927808K/1048576K available (7168K kernel code, 334K rwdata, 2448K rodata, 2048K init, 326K bss, 22464K reserved, 98304K cma-reserved, 163840K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0800000   (8160 kB)
    [    0.000000]       .init : 0xc0b00000 - 0xc0d00000   (2048 kB)
    [    0.000000]       .data : 0xc0d00000 - 0xc0d538d0   ( 335 kB)
    [    0.000000]        .bss : 0xc0d5b0e4 - 0xc0daca20   ( 327 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] L2C: platform modifies aux control register: 0x02070000 -> 0x3e470001
    [    0.000000] L2C: platform provided aux values permit register corruption.
    [    0.000000] L2C: DT/platform modifies aux control register: 0x02070000 -> 0x3e470001
    [    0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [    0.000000] L2C-310: enabling full line of zeros but not enabled in Cortex-A9
    [    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
    [    0.000000] L2C-310 cache controller enabled, 16 ways, 1024 kB
    [    0.000000] L2C-310: CACHE_ID 0x4100c4c8, AUX_CTRL 0x4e470001
    [    0.000000] Exynos4x12 clocks: sclk_apll = 700000000, sclk_mpll = 800000000
    [    0.000000]  sclk_epll = 96035156, sclk_vpll = 108035156, arm_clk = 1400000000
    [    0.000000] Switching to timer-based delay loop, resolution 41ns
    [    0.000000] clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.000151] Console: colour dummy device 80x30
    [    0.000164] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
    [    0.000174] pid_max: default: 32768 minimum: 301
    [    0.000238] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000245] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000551] CPU: Testing write buffer coherency: ok
    [    0.000744] CPU0: thread -1, cpu 0, socket 10, mpidr 80000a00
    [    0.040017] Setting up static identity map for 0x40100000 - 0x40100060
    [    0.119995] smp: Bringing up secondary CPUs ...
    [    0.200065] CPU1: thread -1, cpu 1, socket 10, mpidr 80000a01
    [    0.280048] CPU2: thread -1, cpu 2, socket 10, mpidr 80000a02
    [    0.360047] CPU3: thread -1, cpu 3, socket 10, mpidr 80000a03
    [    0.360092] smp: Brought up 1 node, 4 CPUs
    [    0.360105] SMP: Total of 4 processors activated (192.00 BogoMIPS).
    [    0.360110] CPU: All CPU(s) started in SVC mode.
    [    0.360647] devtmpfs: initialized
    [    0.367318] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [    0.367481] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.367493] futex hash table entries: 1024 (order: 4, 65536 bytes)
    [    0.370429] pinctrl core: initialized pinctrl subsystem
    [    0.370971] /lcd0-power-domain@10023C80 has as child subdomain: /tv-power-domain@10023C20.
    [    0.371547] NET: Registered protocol family 16
    [    0.372959] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.374004] cpuidle: using governor menu
    [    0.392782] SCSI subsystem initialized
    [    0.392929] usbcore: registered new interface driver usbfs
    [    0.392964] usbcore: registered new interface driver hub
    [    0.393014] usbcore: registered new device driver usb
    [    0.393524] Advanced Linux Sound Architecture Driver Initialized.
    [    0.394210] clocksource: Switched to clocksource mct-frc
    [    0.399822] missing cooling_device property
    [    0.399831] failed to build thermal zone cpu-thermal: -2
    [    0.399897] NET: Registered protocol family 2
    [    0.400286] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.400346] TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
    [    0.400463] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.400553] UDP hash table entries: 512 (order: 2, 24576 bytes)
    [    0.400581] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
    [    0.400701] NET: Registered protocol family 1
    [    0.400966] RPC: Registered named UNIX socket transport module.
    [    0.400973] RPC: Registered udp transport module.
    [    0.400977] RPC: Registered tcp transport module.
    [    0.400982] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.451667] audit: initializing netlink subsys (disabled)
    [    0.451821] audit: type=2000 audit(0.447:1): state=initialized audit_enabled=0 res=1
    [    0.451899] workingset: timestamp_bits=30 max_order=18 bucket_order=0
    [    0.456880] NFS: Registering the id_resolver key type
    [    0.456901] Key type id_resolver registered
    [    0.456906] Key type id_legacy registered
    [    0.456930] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
    [    0.457505] bounce: pool size: 64 pages
    [    0.457534] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
    [    0.457541] io scheduler noop registered
    [    0.457546] io scheduler deadline registered
    [    0.457563] io scheduler cfq registered (default)
    [    0.457569] io scheduler mq-deadline registered
    [    0.457574] io scheduler kyber registered
    [    0.461557] dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-141330
    [    0.461568] dma-pl330 12680000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
    [    0.463254] dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-141330
    [    0.463263] dma-pl330 12690000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
    [    0.463827] dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-141330
    [    0.463836] dma-pl330 12850000.mdma:         DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
    [    0.498875] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
    [    0.500052] 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 46, base_baud = 0) is a S3C6400/10
    [    1.151210] console [ttySAC0] enabled
    [    1.155115] 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 47, base_baud = 0) is a S3C6400/10
    [    1.163901] 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 48, base_baud = 0) is a S3C6400/10
    [    1.172773] 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 49, base_baud = 0) is a S3C6400/10
    [    1.230362] brd: module loaded
    [    1.265840] loop: module loaded
    [    1.266545] libphy: Fixed MDIO Bus: probed
    [    1.266698] usbcore: registered new interface driver r8152
    [    1.266780] usbcore: registered new interface driver asix
    [    1.266868] usbcore: registered new interface driver ax88179_178a
    [    1.267690] usbcore: registered new interface driver cdc_ether
    [    1.273513] usbcore: registered new interface driver smsc75xx
    [    1.279305] usbcore: registered new interface driver smsc95xx
    [    1.284988] usbcore: registered new interface driver net1080
    [    1.290605] usbcore: registered new interface driver cdc_subset
    [    1.296523] usbcore: registered new interface driver zaurus
    [    1.302085] usbcore: registered new interface driver cdc_ncm
    [    1.308212] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    1.314220] ehci-exynos: EHCI EXYNOS driver
    [    1.318465] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    1.324544] ohci-exynos: OHCI EXYNOS driver
    [    1.329009] usbcore: registered new interface driver usb-storage
    [    1.335387] s3c-rtc 10070000.rtc: failed to find rtc source clock
    [    1.340773] s3c-rtc: probe of 10070000.rtc failed with error -2
    [    1.346836] i2c /dev entries driver
    [    1.351755] s3c2410-wdt 10060000.watchdog: watchdog inactive, reset disabled, irq disabled
    [    1.358759] device-mapper: ioctl: 4.35.0-ioctl (2016-06-23) initialised: dm-devel@redhat.com
    [    1.368326] sdhci: Secure Digital Host Controller Interface driver
    [    1.372959] sdhci: Copyright(c) Pierre Ossman
    [    1.377611] s3c-sdhci 12530000.sdhci: clock source 2: mmc_busclk.2 (20000000 Hz)
    [    1.444256] mmc0: SDHCI controller on samsung-hsmmc [12530000.sdhci] using ADMA
    [    1.444419] Synopsys Designware Multimedia Card Interface Driver
    [    1.448951] s5p-secss 10830000.sss: s5p-sss driver registered
    [    1.449415] usbcore: registered new interface driver usbhid
    [    1.449472] usbhid: USB HID core driver
    [    1.455757] NET: Registered protocol family 10
    [    1.456371] Segment Routing with IPv6
    [    1.458446] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.464686] NET: Registered protocol family 17
    [    1.468752] NET: Registered protocol family 15
    [    1.473214] Key type dns_resolver registered
    [    1.477612] Registering SWP/SWPB emulation handler
    [    1.493259] mmc0: new high speed SDHC card at address 0007
    [    1.493641] mmcblk0: mmc0:0007 SD16G 14.5 GiB 
    [    1.494133] hctosys: unable to open rtc device (rtc0)
    [    1.497747] ALSA device list:
    [    1.500078]   No soundcards found.
    [    1.504066] VFS: Mounted root (ramfs filesystem) on device 0:13.
    [    1.509486] devtmpfs: error mounting -2
    [    1.514563] Freeing unused kernel memory: 2048K
    [    1.517957] Kernel panic - not syncing: Requested init /linuxrc failed (error -2).
    [    1.525341] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.12.0-g98c9281-dirty #7
    [    1.532541] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.538647] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.546352] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.553560] [<c034b068>] (dump_stack) from [<c01a7f88>] (panic+0xe8/0x268)
    [    1.560417] [<c01a7f88>] (panic) from [<c0744bcc>] (kernel_init+0xa4/0x110)
    [    1.567355] [<c0744bcc>] (kernel_init) from [<c0108578>] (ret_from_fork+0x14/0x3c)
    [    1.574907] CPU2: stopping
    [    1.577593] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.12.0-g98c9281-dirty #7
    [    1.584795] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.590879] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.598601] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.605804] [<c034b068>] (dump_stack) from [<c010e2b8>] (handle_IPI+0x1a0/0x1b0)
    [    1.613182] [<c010e2b8>] (handle_IPI) from [<c01014e8>] (gic_handle_irq+0x94/0x98)
    [    1.620733] [<c01014e8>] (gic_handle_irq) from [<c010c78c>] (__irq_svc+0x6c/0xa8)
    [    1.628195] Exception stack(0xef09ff78 to 0xef09ffc0)
    [    1.633231] ff60:                                                       00000001 00000000
    [    1.641392] ff80: 00000000 c0115740 ef09e000 c0d054c0 c0d05464 c0c7b138 ef09ffd0 00000000
    [    1.649551] ffa0: 00000000 00000000 00000126 ef09ffc8 c0108fd4 c0108fd8 60000013 ffffffff
    [    1.657711] [<c010c78c>] (__irq_svc) from [<c0108fd8>] (arch_cpu_idle+0x38/0x3c)
    [    1.665097] [<c0108fd8>] (arch_cpu_idle) from [<c015175c>] (do_idle+0x16c/0x200)
    [    1.672469] [<c015175c>] (do_idle) from [<c0151aa8>] (cpu_startup_entry+0x18/0x1c)
    [    1.680019] [<c0151aa8>] (cpu_startup_entry) from [<4010158c>] (0x4010158c)
    [    1.686959] CPU0: stopping
    [    1.689652] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-g98c9281-dirty #7
    [    1.696853] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.702938] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.710660] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.717863] [<c034b068>] (dump_stack) from [<c010e2b8>] (handle_IPI+0x1a0/0x1b0)
    [    1.725240] [<c010e2b8>] (handle_IPI) from [<c01014e8>] (gic_handle_irq+0x94/0x98)
    [    1.732792] [<c01014e8>] (gic_handle_irq) from [<c010c78c>] (__irq_svc+0x6c/0xa8)
    [    1.740254] Exception stack(0xc0d01f40 to 0xc0d01f88)
    [    1.745292] 1f40: 00000001 00000000 00000000 c0115740 c0d00000 c0d054c0 c0d05464 c0c7b138
    [    1.753450] 1f60: c0d01f98 00000000 00000000 00000000 00000130 c0d01f90 c0108fd4 c0108fd8
    [    1.761607] 1f80: 60000113 ffffffff
    [    1.765082] [<c010c78c>] (__irq_svc) from [<c0108fd8>] (arch_cpu_idle+0x38/0x3c)
    [    1.772462] [<c0108fd8>] (arch_cpu_idle) from [<c015175c>] (do_idle+0x16c/0x200)
    [    1.779839] [<c015175c>] (do_idle) from [<c0151aa8>] (cpu_startup_entry+0x18/0x1c)
    [    1.787396] [<c0151aa8>] (cpu_startup_entry) from [<c0b00c90>] (start_kernel+0x38c/0x394)
    [    1.795546] CPU1: stopping
    [    1.798239] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.12.0-g98c9281-dirty #7
    [    1.805440] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [    1.811524] [<c010f268>] (unwind_backtrace) from [<c010bcb0>] (show_stack+0x10/0x14)
    [    1.819247] [<c010bcb0>] (show_stack) from [<c034b068>] (dump_stack+0x88/0x9c)
    [    1.826450] [<c034b068>] (dump_stack) from [<c010e2b8>] (handle_IPI+0x1a0/0x1b0)
    [    1.833827] [<c010e2b8>] (handle_IPI) from [<c01014e8>] (gic_handle_irq+0x94/0x98)
    [    1.841379] [<c01014e8>] (gic_handle_irq) from [<c010c78c>] (__irq_svc+0x6c/0xa8)
    [    1.848841] Exception stack(0xef09df78 to 0xef09dfc0)
    [    1.853876] df60:                                                       00000001 00000000
    [    1.862037] df80: 00000000 c0115740 ef09c000 c0d054c0 c0d05464 c0c7b138 ef09dfd0 00000000
    [    1.870196] dfa0: 00000000 00000000 f081b440 ef09dfc8 c0108fd4 c0108fd8 60000013 ffffffff
    [    1.878356] [<c010c78c>] (__irq_svc) from [<c0108fd8>] (arch_cpu_idle+0x38/0x3c)
    [    1.885736] [<c0108fd8>] (arch_cpu_idle) from [<c015175c>] (do_idle+0x16c/0x200)
    [    1.893113] [<c015175c>] (do_idle) from [<c0151aa8>] (cpu_startup_entry+0x18/0x1c)
    [    1.900663] [<c0151aa8>] (cpu_startup_entry) from [<4010158c>] (0x4010158c)
    [    1.907612] ---[ end Kernel panic - not syncing: Requested init /linuxrc failed (error -2).
    • 提示linuxrc有问题,看有人说过initramfs默认第一个程序是/init,无论U-BOOT的命令行设置init=/linuxrc还是其他什么。
  • 修改linuxrcinit

    root@ubuntu:/opt# cp -a rootfs/ initramfs
    root@ubuntu:/opt/initramfs# mv linuxrc init
    root@ubuntu:/opt/initramfs# ls
    bin  dev  etc  init  mnt  proc  root  sbin  sys  tmp
  • 修改linux

    General setup  ---> 
        [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
    (/dev/initramfs)    Initramfs source file(s)
  • 重新编译内核,烧录

    TINY4412 # bootm 41000000 - 42000000
    
    ## Booting kernel from Legacy Image at 41000000 ...
    
     Image Name:   Linux-4.12.0-g98c9281-dirty
     Image Type:   ARM Linux Kernel Image (uncompressed)
     Data Size:    5957952 Bytes = 5.7 MiB
     Load Address: 40008000
     Entry Point:  40008000
     Verifying Checksum ... OK
    
    ## Flattened Device Tree blob at 42000000
    
     Booting using the fdt blob at 0x42000000
     Loading Kernel Image ... OK
     Loading Device Tree to 4fff1000, end 4ffff56c ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Booting Linux on physical CPU 0xa00
    [    0.000000] Linux version 4.12.0-g98c9281-dirty (root@ubuntu) (gcc version 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496] (GNU Tools for ARM Embedded Processors) ) #9 SMP PREEMPT Sun Jul 9 17:59:59 CST 2017
    [    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt: Machine model: FriendlyARM TINY4412 board based on Exynos4412
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] Memory policy: Data cache writealloc
    [    0.000000] cma: Reserved 96 MiB at 0x7a000000
    [    0.000000] Samsung CPU ID: 0xe4412011
    [    0.000000] percpu: Embedded 16 pages/cpu @ef78f000 s34968 r8192 d22376 u65536
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608
    [    0.000000] Kernel command line: root=/dev/ram0 rw rootfstype=ramfs console=ttySAC0,115200 init=/linuxrc earlyprintk
    [    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: 927808K/1048576K available (7168K kernel code, 334K rwdata, 2448K rodata, 2048K init, 326K bss, 22464K reserved, 98304K cma-reserved, 163840K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0800000   (8160 kB)
    [    0.000000]       .init : 0xc0b00000 - 0xc0d00000   (2048 kB)
    [    0.000000]       .data : 0xc0d00000 - 0xc0d538d0   ( 335 kB)
    [    0.000000]        .bss : 0xc0d5b0e4 - 0xc0daca20   ( 327 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] L2C: platform modifies aux control register: 0x02070000 -> 0x3e470001
    [    0.000000] L2C: platform provided aux values permit register corruption.
    [    0.000000] L2C: DT/platform modifies aux control register: 0x02070000 -> 0x3e470001
    [    0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [    0.000000] L2C-310: enabling full line of zeros but not enabled in Cortex-A9
    [    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
    [    0.000000] L2C-310 cache controller enabled, 16 ways, 1024 kB
    [    0.000000] L2C-310: CACHE_ID 0x4100c4c8, AUX_CTRL 0x4e470001
    [    0.000000] Exynos4x12 clocks: sclk_apll = 700000000, sclk_mpll = 800000000
    [    0.000000]  sclk_epll = 96035156, sclk_vpll = 108035156, arm_clk = 1400000000
    [    0.000000] Switching to timer-based delay loop, resolution 41ns
    [    0.000000] clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000003] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.008063] Console: colour dummy device 80x30
    [    0.012419] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
    [    0.022834] pid_max: default: 32768 minimum: 301
    [    0.027578] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.034199] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.041624] CPU: Testing write buffer coherency: ok
    [    0.046602] CPU0: thread -1, cpu 0, socket 10, mpidr 80000a00
    [    0.084745] Setting up static identity map for 0x40100000 - 0x40100060
    [    0.144723] smp: Bringing up secondary CPUs ...
    [    0.204783] CPU1: thread -1, cpu 1, socket 10, mpidr 80000a01
    [    0.284776] CPU2: thread -1, cpu 2, socket 10, mpidr 80000a02
    [    0.364775] CPU3: thread -1, cpu 3, socket 10, mpidr 80000a03
    [    0.364819] smp: Brought up 1 node, 4 CPUs
    [    0.386275] SMP: Total of 4 processors activated (192.00 BogoMIPS).
    [    0.392603] CPU: All CPU(s) started in SVC mode.
    [    0.397885] devtmpfs: initialized
    [    0.407825] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [    0.415557] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.425308] futex hash table entries: 1024 (order: 4, 65536 bytes)
    [    0.434429] pinctrl core: initialized pinctrl subsystem
    [    0.440106] /lcd0-power-domain@10023C80 has as child subdomain: /tv-power-domain@10023C20.
    [    0.448857] NET: Registered protocol family 16
    [    0.454552] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.462368] cpuidle: using governor menu
    [    0.485163] SCSI subsystem initialized
    [    0.488968] usbcore: registered new interface driver usbfs
    [    0.494404] usbcore: registered new interface driver hub
    [    0.499814] usbcore: registered new device driver usb
    [    0.505403] Advanced Linux Sound Architecture Driver Initialized.
    [    0.512080] clocksource: Switched to clocksource mct-frc
    [    0.524574] missing cooling_device property
    [    0.528663] failed to build thermal zone cpu-thermal: -2
    [    0.534120] NET: Registered protocol family 2
    [    0.538811] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.545832] TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
    [    0.552487] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.558870] UDP hash table entries: 512 (order: 2, 24576 bytes)
    [    0.564813] UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
    [    0.571313] NET: Registered protocol family 1
    [    0.575886] RPC: Registered named UNIX socket transport module.
    [    0.581714] RPC: Registered udp transport module.
    [    0.586507] RPC: Registered tcp transport module.
    [    0.591262] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.648438] audit: initializing netlink subsys (disabled)
    [    0.654044] audit: type=2000 audit(0.651:1): state=initialized audit_enabled=0 res=1
    [    0.654127] workingset: timestamp_bits=30 max_order=18 bucket_order=0
    [    0.658920] NFS: Registering the id_resolver key type
    [    0.658937] Key type id_resolver registered
    [    0.658939] Key type id_legacy registered
    [    0.658961] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
    [    0.662169] bounce: pool size: 64 pages
    [    0.662195] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
    [    0.662200] io scheduler noop registered
    [    0.662202] io scheduler deadline registered
    [    0.662217] io scheduler cfq registered (default)
    [    0.662220] io scheduler mq-deadline registered
    [    0.662223] io scheduler kyber registered
    [    0.672363] dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-141330
    [    0.672369] dma-pl330 12680000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
    [    0.674201] dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-141330
    [    0.674207] dma-pl330 12690000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
    [    0.674916] dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-141330
    [    0.674921] dma-pl330 12850000.mdma:         DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
    [    0.797667] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
    [    0.805210] 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 46, base_baud = 0) is a S3C6400/10
    [    0.814062] console [ttySAC0] enabled
    [    0.814062] console [ttySAC0] enabled
    [    0.821362] bootconsole [earlycon0] disabled
    [    0.821362] bootconsole [earlycon0] disabled
    [    0.830224] 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 47, base_baud = 0) is a S3C6400/10
    [    0.830552] 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 48, base_baud = 0) is a S3C6400/10
    [    0.830873] 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 49, base_baud = 0) is a S3C6400/10
    [    0.843623] brd: module loaded
    [    0.849065] loop: module loaded
    [    0.849786] libphy: Fixed MDIO Bus: probed
    [    0.849935] usbcore: registered new interface driver r8152
    [    0.850220] usbcore: registered new interface driver asix
    [    0.855651] usbcore: registered new interface driver ax88179_178a
    [    0.861672] usbcore: registered new interface driver cdc_ether
    [    0.867537] usbcore: registered new interface driver smsc75xx
    [    0.873251] usbcore: registered new interface driver smsc95xx
    [    0.878945] usbcore: registered new interface driver net1080
    [    0.884616] usbcore: registered new interface driver cdc_subset
    [    0.890489] usbcore: registered new interface driver zaurus
    [    0.896075] usbcore: registered new interface driver cdc_ncm
    [    0.902206] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    0.908186] ehci-exynos: EHCI EXYNOS driver
    [    0.912460] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    0.918515] ohci-exynos: OHCI EXYNOS driver
    [    0.923005] usbcore: registered new interface driver usb-storage
    [    0.929353] s3c-rtc 10070000.rtc: failed to find rtc source clock
    [    0.934774] s3c-rtc: probe of 10070000.rtc failed with error -2
    [    0.940797] i2c /dev entries driver
    [    0.945780] s3c2410-wdt 10060000.watchdog: watchdog inactive, reset disabled, irq disabled
    [    0.952757] device-mapper: ioctl: 4.35.0-ioctl (2016-06-23) initialised: dm-devel@redhat.com
    [    0.962328] sdhci: Secure Digital Host Controller Interface driver
    [    0.966941] sdhci: Copyright(c) Pierre Ossman
    [    0.971543] s3c-sdhci 12530000.sdhci: clock source 2: mmc_busclk.2 (20000000 Hz)
    [    1.032128] mmc0: SDHCI controller on samsung-hsmmc [12530000.sdhci] using ADMA
    [    1.032293] Synopsys Designware Multimedia Card Interface Driver
    [    1.036846] s5p-secss 10830000.sss: s5p-sss driver registered
    [    1.037301] usbcore: registered new interface driver usbhid
    [    1.037358] usbhid: USB HID core driver
    [    1.043633] NET: Registered protocol family 10
    [    1.044269] Segment Routing with IPv6
    [    1.046316] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.052550] NET: Registered protocol family 17
    [    1.056623] NET: Registered protocol family 15
    [    1.061078] Key type dns_resolver registered
    [    1.065487] Registering SWP/SWPB emulation handler
    [    1.081124] mmc0: new high speed SDHC card at address 0007
    [    1.081518] mmcblk0: mmc0:0007 SD16G 14.5 GiB 
    [    1.082121] hctosys: unable to open rtc device (rtc0)
    [    1.085838] ALSA device list:
    [    1.087948]   No soundcards found.
    [    1.093015] Freeing unused kernel memory: 2048K
    
    Processing /etc/profile... Done
    
    / # 
    / # 
    / # 
    • 进入我们的最小文件系统了,喜大普奔!!! : -)

总结

  • 使用initramfs文件系统,只需要使用Busybox制作最小文件系统,重命名为initramfs

  • 将根目录的linuxrc改为init

  • 在内核的menuconfig中,配置Initramfs source file(s)initramfs所在的路径

  • 配置好U-BOOT的环境变量setenv bootargs root=/dev/ram0 rw rootfstype=ramfs console=ttySAC0,115200 init=/linuxrc earlyprintk

  • 我们传递给内核文件系统的目录/dev/initramfs ,内核会在适当的时候调用脚本/scripts/gen_initramfs_list.sh ,生成文件usr/initramfs_data.cpio.gz,这个就是压缩后的文件系统

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值