/bin/sh: 1: bison: not found scripts/Makefile.lib:226: recipe for target 'scripts/kconfig/zconf.tab.c' failed make[1]: *** [scripts/kconfig/zconf.tab.c] Error 127 Makefile:539: recipe for target 'vexpress_ca9x4_defconfig' failed make: *** [vexpress_ca9x4_defconfig] Error 2
1
# sudo apt-get install bison
1 2 3 4 5
/bin/sh: 1: flex: not found scripts/Makefile.lib:218: recipe for target 'scripts/kconfig/zconf.lex.c' failed make[1]: *** [scripts/kconfig/zconf.lex.c] Error 127 Makefile:539: recipe for target 'vexpress_ca9x4_defconfig' failed make: *** [vexpress_ca9x4_defconfig] Error 2
1
# sudo apt-get install flex
1 2 3 4 5 6 7 8 9 10
# make vexpress_ca9x4_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=./object # make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=./object -j4 scripts/kconfig/conf --syncconfig Kconfig CHK include/config.h GEN include/autoconf.mk.dep CFG u-boot.cfg GEN include/autoconf.mk *** Your GCC is older than 6.0 and is not supported arch/arm/config.mk:66: recipe for target 'checkgcc6' failed make: *** [checkgcc6] Error 1
# vim arch/arm/config.mk ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y) #archprepare: checkthumb checkgcc6 archprepare: checkthumb checkthumb: @if test "$(call cc-name)" = "gcc" -a \ "$(call cc-version)" -lt "0404"; then \ echo -n '*** Your GCC does not produce working '; \ echo 'binaries in THUMB mode.'; \ echo '*** Your board is configured for THUMB mode.'; \ false; \ fi #else #archprepare: checkgcc6 endif
#checkgcc6: # @iftest"$(call cc-name)" = "gcc" -a \ #"$(call cc-version)" -lt "0600"; then \ #echo'*** Your GCC is older than 6.0 and is not supported'; \ #false; \ #fi
2.3.2 生成配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13
# make vexpress_ca9x4_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=./object make[1]: Entering directory '/home/xiami/tool/u-boot-2020.01/object' HOSTCC scripts/basic/fixdep GEN ./Makefile HOSTCC scripts/kconfig/conf.o YACC scripts/kconfig/zconf.tab.c LEX scripts/kconfig/zconf.lex.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf # # configuration written to .config # make[1]: Leaving directory '/home/xiami/tool/u-boot-2020.01/object'
./configs/vexpress_ca9x4_defconfig
1 2
# ls object/.config -l -rw-r--r-- 1 xiami xiami 22698 Mar 17 23:20 object/.config
如果需要修改配置文件中的一些选项,可以通过以下界面操作选择:
1
# make menuconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=./object
2.3.3 编译
1
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 O=./object
# ./boot-uboot-tftp.sh Booting qemu vexpress-ca9 WARNING: Image format was not specified for 'rootfs.ext3' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. sudo tunctl -u root -t tap0 TUNSETIFF: Device or resource busy sudo ifconfig tap0 0.0.0.0 promisc up sudo brctl addif br0 tap0 brctl show bridge name bridge id STP enabled interfaces br0 8000.0021ccd65a96 no enp0s25 tap0
U-Boot 2020.01 (Mar 22 2020 - 16:51:32 +0800)
DRAM: 512 MiB WARNING: Caches not enabled Flash: 128 MiB MMC: MMC: 0 *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: smc911x-0 Hit any key to stop autoboot: 0 smc911x: MAC 52:54:00:12:34:56 smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC 52:54:00:12:34:56 Using smc911x-0 device TFTP from server 192.168.1.102; our IP address is 192.168.1.110 Filename 'uImage'. Load address: 0x60003000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ########### 8.7 MiB/s done Bytes transferred = 3971576 (3c99f8 hex) smc911x: MAC 52:54:00:12:34:56 smc911x: MAC 52:54:00:12:34:56 smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC 52:54:00:12:34:56 Using smc911x-0 device TFTP from server 192.168.1.102; our IP address is 192.168.1.110 Filename 'vexpress-v2p-ca9.dtb'. Load address: 0x60500000 Loading: ## 4.7 MiB/s done Bytes transferred = 14692 (3964 hex) smc911x: MAC 52:54:00:12:34:56 ## Booting kernel from Legacy Image at 60003000 ... Image Name: Linux-4.14.172 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3971512 Bytes = 3.8 MiB Load Address: 60003000 Entry Point: 60003000 Verifying Checksum ... OK ## Flattened Device Tree blob at 60500000 Booting using the fdt blob at 0x60500000 Loading Kernel Image Loading Device Tree to 7fe81000, end 7fe87963 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0 Linux version 4.14.172 (xiami@xiami) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #1 SMP Sun Mar 15 12:27:54 CST 2020 CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache OF: fdt: Machine model: V2P-CA9 Memory policy: Data cache writeback CPU: All CPU(s) started in SVC mode. percpu: Embedded 15 pages/cpu s32396 r8192 d20852 u61440 Built 1 zonelists, mobility grouping on. Total pages: 130048 Kernel command line: root=/dev/mmcblk0 rw init=/linuxrc ip=192.168.1.110 console=ttyAMA0 log_buf_len individual max cpu contribution: 4096 bytes log_buf_len total cpu_extra contributions: 12288 bytes log_buf_len min size: 16384 bytes log_buf_len: 32768 bytes early log buf free: 14980(91%) 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: 509616K/524288K available (6144K kernel code, 403K rwdata, 1372K rodata, 1024K init, 161K bss, 14672K reserved, 0K cma-reserved) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xa0800000 - 0xff800000 (1520 MB) lowmem : 0x80000000 - 0xa0000000 ( 512 MB) modules : 0x7f000000 - 0x80000000 ( 16 MB) .text : 0x80008000 - 0x80700000 (7136 kB) .init : 0x80900000 - 0x80a00000 (1024 kB) .data : 0x80a00000 - 0x80a64f90 ( 404 kB) .bss : 0x80a6bd00 - 0x80a94468 ( 162 kB) SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 Hierarchical RCU implementation. RCU event tracing is enabled. RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
......
IP-Config: Guessing netmask 255.255.255.0 IP-Config: Complete: device=eth0, hwaddr=52:54:00:12:34:56, ipaddr=192.168.1.110, mask=255.255.255.0, gw=255.255.255.255 host=192.168.1.110, domain=, nis-domain=(none) bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath= ALSA device list: #0: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 30 EXT4-fs (mmcblk0): mounting ext3 file system using the ext4 subsystem random: fast init done EXT4-fs (mmcblk0): recovery complete EXT4-fs (mmcblk0): mounted filesystem with ordered data mode. Opts: (null) VFS: Mounted root (ext3 filesystem) on device 179:0. Freeing unused kernel memory: 1024K random: crng init done Hello Linux Qemu!
DRAM: 512 MiB WARNING: Caches not enabled Flash: 128 MiB MMC: MMC: 0 *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: smc911x-0 Hit any key to stop autoboot: 0 smc911x: MAC 52:54:00:12:34:56 smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC 52:54:00:12:34:56 Using smc911x-0 device TFTP from server 192.168.1.104; our IP address is 192.168.1.110 Filename 'uImage'. Load address: 0x60003000 Loading: ################################################################# ################################################################# ################################################################# ################################################## 1.3 MiB/s done Bytes transferred = 3581920 (36a7e0 hex) smc911x: MAC 52:54:00:12:34:56 smc911x: MAC 52:54:00:12:34:56 smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC 52:54:00:12:34:56 Using smc911x-0 device TFTP from server 192.168.1.104; our IP address is 192.168.1.110 Filename 'vexpress-v2p-ca9.dtb'. Load address: 0x60500000 Loading: # 250 KiB/s done Bytes transferred = 14360 (3818 hex) smc911x: MAC 52:54:00:12:34:56 ## Booting kernel from Legacy Image at 60003000 ... Image Name: Linux-4.4.157 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3581856 Bytes = 3.4 MiB Load Address: 60003000 Entry Point: 60003000 Verifying Checksum ... OK ## Flattened Device Tree blob at 60500000 Booting using the fdt blob at 0x60500000 Loading Kernel Image ... OK Loading Device Tree to 7fed4000, end 7feda817 ... OK