Embedded Linux – Buildroot

This is the continuation of series of blogs about cross compiling, loading bootloader, linux kernel and filesystem into an embedded development platform. Pls check the previous blog for the target hardware and setup that is needed.

So far we have compiled U-Boot, linux kernel and then loaded the builded images into the target hardware. We need a filesystem which provides the needed utilities to access the target and carry out the intended functionality as per our wish. At the end of the linux kernel bootup we need hand over the control the init process. Init in *nix based machines is the parent of all the processes except the kernel threads.

Basically to solve this issue we need a filesystem which provides us the init binary.

Buildroot

Buildroot is free and open-source software, maintained by Peter Korsgaard and licensed under version 2 or later of the GNU General Public License (GPL). It is a group of Makefiles and build script files which simplifies and automates the process of building a complete embedded linux environment. For cross compiling to different target processor it can automatically build the required cross compilation toolchain. It has the support to create bootloader, linux kernel and a root filesystem. It build these independently also depending upon the user input.

It is primarily intended to be used with small or embedded systems based on various computer architectures including x86, ARM, MIPS and PowerPC.Numerous architectures and their variants are also supported. It also comes with default configurations for several development platforms such as Raspberry Pi, Cubieboard and etc. It is used as the basis for many third party projects and by many product development teams as it makes the process simple.It is organized as automatically downloaded packages which contain the source code of various userspace applications, libraries and system utilities. Root file system images, which are the final results, may be built using various file systems, including cramfs, JFFS2, romfs, SquashFS and UBIFS.

Get the source code

Vostro bpro # git clone git://git.buildroot.net/buildroot
Cloning into ‘buildroot’…
remote: Counting objects: 233793, done.
remote: Compressing objects: 100% (77713/77713), done.
remote: Total 233793 (delta 162321), reused 223842 (delta 155036)
Receiving objects: 100% (233793/233793), 49.03 MiB | 408.00 KiB/s, done.
Resolving deltas: 100% (162321/162321), done.
Checking connectivity… done.

Configure the Buildroot

Vostro bpro # cd buildroot
The execute the below command shows the list of files that is provided by buildroot.

Vostro buildroot # ls -l
total 536
drwxr-xr-x 2 root root 4096 Feb 25 12:17 arch
drwxr-xr-x 46 root root 4096 Feb 25 12:17 board
drwxr-xr-x 20 root root 4096 Feb 25 12:17 boot
-rw-r–r– 1 root root 220836 Feb 25 12:17 CHANGES
-rw-r–r– 1 root root 23260 Feb 25 12:17 Config.in
-rw-r–r– 1 root root 85529 Feb 25 12:17 Config.in.legacy
drwxr-xr-x 2 root root 12288 Feb 25 12:17 configs
-rw-r–r– 1 root root 18767 Feb 25 12:17 COPYING
-rw-r–r– 1 root root 38544 Feb 25 12:17 DEVELOPERS
drwxr-xr-x 5 root root 4096 Feb 25 12:17 docs
drwxr-xr-x 15 root root 4096 Feb 25 12:17 fs
drwxr-xr-x 2 root root 4096 Feb 25 12:17 linux
-rw-r–r– 1 root root 40129 Feb 25 12:17 Makefile
-rw-r–r– 1 root root 2292 Feb 25 12:17 Makefile.legacy
drwxr-xr-x 1754 root root 57344 Feb 25 12:17 package
-rw-r–r– 1 root root 1079 Feb 25 12:17 README
drwxr-xr-x 10 root root 4096 Feb 25 12:17 support
drwxr-xr-x 3 root root 4096 Feb 25 12:17 system
drwxr-xr-x 5 root root 4096 Feb 25 12:17 toolchain
Vostro buildroot #

Now execute the below command.

Vostro buildroot # make menuconfig

build_1

Figure 1. Initial menu when menuconfig is executed.

We need to select “Target options” and then ARM little endian as in the below image

build_2

Figure 2. Target Architecture selection — ARM processor is selected.

Next we need to move to the Target Architecture variant option. After choosing target architecture we can see that the Target Architecture variant is set to arm926t.

Bananapro is actually based on Cortex-A7 variant and it is exactly what we need to choose.

build_3

Figure 3. Target Architecture variantCortex-A7 is selected.

Just to confirm that we are using the filesystem which we are building we shall add a few details.

In the System configuation menu

build_4.png

Figure 4. System configuration Menu

Choose the System banner entry

build_5

Figure 5. System Banner menu

and edit the string as you like below.

build_6

Figure 6. Edit the System Banner.

After choosing these parameters we need to save this config file and start the build. There are a lot of other options like choosing which C library to use and various packages selection options, For the moment let us save the config file as below.

build_7

Figure 7. Save the config file.

Build

As with other blogs we now need to give make command to start the compilation process.

Vostro buildroot # make

We need to wait for 15 to 20 mins depending upon the build machine hardware specs and network bandwidth available for the build to complete.

Final steps

>>> Generating root filesystem image rootfs.tar
rm -f /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
rm -f /Sourcefiles/bpro/buildroot/output/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
rm -f /Sourcefiles/bpro/buildroot/output/build/_users_table.txt
echo ‘#!/bin/sh’ > /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
echo “set -e” >> /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
echo “chown -h -R 0:0 /Sourcefiles/bpro/buildroot/output/target” >> /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
printf ‘ \n’ >> /Sourcefiles/bpro/buildroot/output/build/_users_table.txt
PATH=”/Sourcefiles/bpro/buildroot/output/host/bin:/Sourcefiles/bpro/buildroot/output/host/sbin:/Sourcefiles/bpro/buildroot/output/host/usr/bin:/Sourcefiles/bpro/buildroot/output/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin” /Sourcefiles/bpro/buildroot/support/scripts/mkusers /Sourcefiles/bpro/buildroot/output/build/_users_table.txt /Sourcefiles/bpro/buildroot/output/target >> /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
cat system/device_table.txt > /Sourcefiles/bpro/buildroot/output/build/_device_table.txt
printf ‘ /bin/busybox f 4755 0 0 – – – – -\n /dev/console c 622 0 0 5 1 – – -\n\n’ >> /Sourcefiles/bpro/buildroot/output/build/_device_table.txt
echo “/Sourcefiles/bpro/buildroot/output/host/usr/bin/makedevs -d /Sourcefiles/bpro/buildroot/output/build/_device_table.txt /Sourcefiles/bpro/buildroot/output/target” >> /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
printf ‘ (cd /Sourcefiles/bpro/buildroot/output/target; find -print0 | LC_ALL=C sort -z | tar -cf /Sourcefiles/bpro/buildroot/output/images/rootfs.tar –null –no-recursion -T – –numeric-owner)\n’ >> /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
chmod a+x /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
PATH=”/Sourcefiles/bpro/buildroot/output/host/bin:/Sourcefiles/bpro/buildroot/output/host/sbin:/Sourcefiles/bpro/buildroot/output/host/usr/bin:/Sourcefiles/bpro/buildroot/output/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin” /Sourcefiles/bpro/buildroot/output/host/usr/bin/fakeroot — /Sourcefiles/bpro/buildroot/output/build/_fakeroot.fs
rootdir=/Sourcefiles/bpro/buildroot/output/target
table=’/Sourcefiles/bpro/buildroot/output/build/_device_table.txt’
/usr/bin/install -m 0644 support/misc/target-dir-warning.txt /Sourcefiles/bpro/buildroot/output/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
Vostro buildroot #

The build is completed and the zipped file system is available in the below location.

Vostro buildroot # ls output/images/ -l
total 1432
-rw-r–r– 1 root root 1464320 Feb 25 13:06 rootfs.tar
Vostro buildroot #

We can copy this tar file into the Micro SD card’s root partition (ext4 partition) and then untar it there. When the Micro SD Card was inserted into the build machine it was mounted at the below location.

Vostro buildroot # mount

/dev/mmcblk0p2 on /media/kasi/root type ext4 (rw,nosuid,nodev,relatime,block_validity,delalloc,barrier,user_xattr,acl,uhelper=udisks2)

Vostro buildroot # cp output/images/rootfs.tar /media/kasi/root
Vostro buildroot # cd /media/kasi/root
Vostro root # tar xf rootfs.tar

It is a better idea to copy the zip file into the Micro SD card’s root partition and unzip it there.

Vostro root # ls -l
total 1492
drwxr-xr-x 2 root root 4096 Feb 25 13:06 bin
drwxr-xr-x 4 root root 4096 Feb 25 13:06 dev
drwxr-xr-x 5 root root 4096 Feb 25 13:06 etc
drwxr-xr-x 2 root root 4096 Feb 25 13:06 lib
lrwxrwxrwx 1 root root 3 Feb 25 12:47 lib32 -> lib
lrwxrwxrwx 1 root root 11 Feb 25 13:06 linuxrc -> bin/busybox
drwxr-xr-x 2 root root 4096 Feb 25 12:17 media
drwxr-xr-x 2 root root 4096 Feb 25 12:17 mnt
drwxr-xr-x 2 root root 4096 Feb 25 12:17 opt
drwxr-xr-x 2 root root 4096 Feb 25 12:17 proc
drwx—— 2 root root 4096 Feb 25 12:17 root
-rw-r–r– 1 root root 1464320 Feb 25 13:19 rootfs.tar
drwxr-xr-x 2 root root 4096 Feb 25 12:17 run
drwxr-xr-x 2 root root 4096 Feb 25 13:06 sbin
drwxr-xr-x 2 root root 4096 Feb 25 12:17 sys
drwxrwxrwt 2 root root 4096 Feb 25 12:17 tmp
drwxr-xr-x 6 root root 4096 Feb 25 13:06 usr
drwxr-xr-x 4 root root 4096 Feb 25 13:06 var
Vostro root #

The Micro SD card now contains all the needed images/binaries to boot up a complete embedded linux machine. Remove the Micro SD card from the build machine and boot using Micro SD card. We should now be able to get to the shell prompt where we can execute the user space utilities.

Sample log from target

##########################
#### Lets get Started ####
##########################

U-Boot SPL 2016.11-00138-g136179b-dirty (Feb 11 2017 – 19:25:04)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1
U-Boot 2016.11-00138-g136179b-dirty (Feb 11 2017 – 19:25:04 +0530) Allwinner Technology

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

Setting up a 720x576i composite-pal console (overscan 32×20)
In: serial
Out: vga
Err: vga
SCSI: 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
scanning bus 1 for devices… 1 USB Device(s) found
scanning bus 3 for devices… 2 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 U-Boot script /boot.scr
reading /boot.scr
286 bytes read in 18 ms (14.6 KiB/s)
## Executing script at 43100000
reading sun7i-a20-bananapro.dtb
34451 bytes read in 30 ms (1.1 MiB/s)
reading uImage-next
4600176 bytes read in 310 ms (14.2 MiB/s)
## Booting kernel from Legacy Image at 46000000 …
Image Name: Linux-4.9.10
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4600112 Bytes = 4.4 MiB
Load Address: 40000000
Entry Point: 40000000
Verifying Checksum … OK
## Flattened Device Tree blob at 49000000
Booting using the fdt blob at 0x49000000
Loading Kernel Image … OK
Loading Device Tree to 49ff4000, end 49fff692 … OK

Starting kernel …

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.10 (root@Vostro) (gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-24) ) #2 SMP Fri Feb 17 19:18:58 IST 2017
[ 0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt:Machine model: LeMaker Banana Pro
[ 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 14 pages/cpu @ef7c3000 s24704 r8192 d24448 u57344
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260202
[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[ 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: 1025792K/1046952K available (7168K kernel code, 336K rwdata, 1952K rodata, 1024K init, 277K bss, 21160K reserved, 0K cma-reserved, 260520K 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 – 0xc0c00000 (1024 kB)
[ 0.000000] .data : 0xc0c00000 – 0xc0c54040 ( 337 kB)
[ 0.000000] .bss : 0xc0c56000 – 0xc0c9b5ec ( 278 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] arm_arch_timer: 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.000019] Switching to timer-based delay loop, resolution 41ns
[ 0.000527] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000753] clocksource: hstimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[ 0.000965] Console: colour dummy device 80×30
[ 0.001002] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.001017] pid_max: default: 32768 minimum: 301
[ 0.001131] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001143] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001855] CPU: Testing write buffer coherency: ok
[ 0.002205] /cpus/cpu@0 missing clock-frequency property
[ 0.002225] /cpus/cpu@1 missing clock-frequency property
[ 0.002239] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002276] Setting up static identity map for 0x40100000 – 0x40100058
[ 0.014038] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.014146] Brought up 2 CPUs
[ 0.014168] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[ 0.014175] CPU: All CPU(s) started in HYP mode.
[ 0.014180] CPU: Virtualization extensions available.
[ 0.015064] devtmpfs: initialized
[ 0.025230] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[ 0.025557] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.025638] pinctrl core: initialized pinctrl subsystem
[ 0.026685] NET: Registered protocol family 16
[ 0.027073] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.028509] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.028522] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.046143] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[ 0.046203] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[ 0.046933] reg-fixed-voltage gmac-3v3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gmac_power_pin@0, deferring probe
[ 0.046974] reg-fixed-voltage vmmc3: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/vmmc3_pin@0, deferring probe
[ 0.047454] SCSI subsystem initialized
[ 0.047990] usbcore: registered new interface driver usbfs
[ 0.048053] usbcore: registered new interface driver hub
[ 0.048116] usbcore: registered new device driver usb
[ 0.048369] pps_core: LinuxPPS API ver. 1 registered
[ 0.048378] pps_core: Software ver. 5.3.6 – Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.048408] PTP clock support registered
[ 0.048636] Advanced Linux Sound Architecture Driver Initialized.
[ 0.049232] Bluetooth: Core ver 2.22
[ 0.049290] NET: Registered protocol family 31
[ 0.049299] Bluetooth: HCI device and connection manager initialized
[ 0.049317] Bluetooth: HCI socket layer initialized
[ 0.049329] Bluetooth: L2CAP socket layer initialized
[ 0.049360] Bluetooth: SCO socket layer initialized
[ 0.050332] clocksource: Switched to clocksource arch_sys_counter
[ 0.051249] simple-framebuffer 7fe79000.framebuffer: framebuffer at 0x7fe79000, 0x178e00 bytes, mapped to 0xf0900000
[ 0.051269] simple-framebuffer 7fe79000.framebuffer: format=x8r8g8b8, mode=656x536x32, linelength=2880
[ 0.058055] Console: switching to colour frame buffer device 82×33
[ 0.064119] simple-framebuffer 7fe79000.framebuffer: fb0: simplefb registered!
[ 0.073972] NET: Registered protocol family 2
[ 0.074573] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.074656] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.074784] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.074868] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.074930] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.075138] NET: Registered protocol family 1
[ 0.075671] RPC: Registered named UNIX socket transport module.
[ 0.075691] RPC: Registered udp transport module.
[ 0.075698] RPC: Registered tcp transport module.
[ 0.075704] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.076528] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 0.077667] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.078640] workingset: timestamp_bits=30 max_order=18 bucket_order=0
[ 0.088221] NFS: Registering the id_resolver key type
[ 0.088267] Key type id_resolver registered
[ 0.088275] Key type id_legacy registered
[ 0.092144] bounce: pool size: 64 pages
[ 0.092423] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.092435] io scheduler noop registered
[ 0.092443] io scheduler deadline registered (default)
[ 0.092637] io scheduler cfq registered
[ 0.098066] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.165015] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.168257] console [ttyS0] disabled
[ 0.188500] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 44, base_baud = 1500000) is a U6_16550A
[ 0.894337] console [ttyS0] enabled
[ 0.921384] 1c29000.serial: ttyS1 at MMIO 0x1c29000 (irq = 45, base_baud = 1500000) is a U6_16550A
[ 0.953801] 1c29c00.serial: ttyS2 at MMIO 0x1c29c00 (irq = 46, base_baud = 1500000) is a U6_16550A
[ 0.963583] [drm] Initialized
[ 1.060399] ahci-sunxi 1c18000.sata: controller can’t do PMP, turning off CAP_PMP
[ 1.067920] ahci-sunxi 1c18000.sata: SSS flag set, parallel bus scan disabled
[ 1.075107] ahci-sunxi 1c18000.sata: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[ 1.084082] ahci-sunxi 1c18000.sata: flags: ncq sntf stag pm led clo only pio slum part ccc
[ 1.093592] scsi host0: ahci-sunxi
[ 1.097373] ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c18fff] port 0x100 irq 33
[ 1.107243] libphy: Fixed MDIO Bus: probed
[ 1.111423] CAN device driver interface
[ 1.116397] usbcore: registered new interface driver ath9k_htc
[ 1.122408] Broadcom 43xx driver loaded [ Features: NLS ]
[ 1.127907] ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
[ 1.134471] ehci-platform: EHCI generic platform driver
[ 1.140070] ohci_hcd: USB 1.1 ‘Open’ Host Controller (OHCI) Driver
[ 1.146350] ohci-platform: OHCI generic platform driver
[ 1.153418] usbcore: registered new interface driver brcmfmac
[ 1.153426] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[ 1.153437] sunxi-rtc 1c20d00.rtc: RTC enabled
[ 1.153553] i2c /dev entries driver
[ 1.154638] axp20x-i2c 0-0034: AXP20x variant AXP209 found
[ 1.192425] input: axp20x-pek as /devices/platform/soc@01c00000/1c2ac00.i2c/i2c-0/0-0034/axp20x-pek/input/input0
[ 1.203122] axp20x-regulator axp20x-regulator: regulators node not found
[ 1.213608] axp20x-i2c 0-0034: AXP20X driver loaded
[ 1.219591] IR NEC protocol handler initialized
[ 1.224216] IR RC5(x/sz) protocol handler initialized
[ 1.229263] IR RC6 protocol handler initialized
[ 1.233819] IR JVC protocol handler initialized
[ 1.238343] IR Sony protocol handler initialized
[ 1.242975] IR SANYO protocol handler initialized
[ 1.247672] IR Sharp protocol handler initialized
[ 1.252384] IR MCE Keyboard/mouse protocol handler initialized
[ 1.258210] IR XMP protocol handler initialized
[ 1.263207] Registered IR keymap rc-empty
[ 1.267592] input: sunxi-ir as /devices/platform/soc@01c00000/1c21800.ir/rc/rc0/input1
[ 1.275810] rc rc0: sunxi-ir as /devices/platform/soc@01c00000/1c21800.ir/rc/rc0
[ 1.283930] input: MCE IR Keyboard/Mouse (sunxi-ir) as /devices/virtual/input/input2
[ 1.292076] sunxi-ir 1c21800.ir: initialized sunXi IR driver
[ 1.298586] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.306729] Bluetooth: HCI UART driver ver 2.3
[ 1.311200] Bluetooth: HCI UART protocol H4 registered
[ 1.316333] Bluetooth: HCI UART protocol BCSP registered
[ 1.321648] Bluetooth: HCI UART protocol LL registered
[ 1.326779] Bluetooth: HCI UART protocol ATH3K registered
[ 1.332178] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 1.338532] Bluetooth: HCI UART protocol Intel registered
[ 1.344009] Bluetooth: HCI UART protocol Broadcom registered
[ 1.349663] Bluetooth: HCI UART protocol QCA registered
[ 1.354901] Bluetooth: HCI UART protocol AG6XX registered
[ 1.360292] Bluetooth: HCI UART protocol Marvell registered
[ 1.365952] usbcore: registered new interface driver bcm203x
[ 1.371683] usbcore: registered new interface driver bpa10x
[ 1.377309] usbcore: registered new interface driver btusb
[ 1.382800] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[ 1.388562] usbcore: registered new interface driver ath3k
[ 1.406272] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 1.470546] sunxi-mmc 1c0f000.mmc: base:0xf08f7000 irq:28
[ 1.471834] ata1: SATA link down (SStatus 0 SControl 300)
[ 1.482799] sun4i-ss 1c15000.crypto-engine: no reset control found
[ 1.490637] sun4i-ss 1c15000.crypto-engine: Die ID 0
[ 1.497145] usbcore: registered new interface driver usbhid
[ 1.502759] usbhid: USB HID core driver
[ 1.508238] NET: Registered protocol family 17
[ 1.512758] can: controller area network core (rev 20120528 abi 9)
[ 1.519024] NET: Registered protocol family 29
[ 1.523496] can: raw protocol (rev 20120528)
[ 1.527764] can: broadcast manager protocol (rev 20161123 t)
[ 1.533437] can: netlink gateway (rev 20130117) max_hops=1
[ 1.540370] Bluetooth: RFCOMM TTY layer initialized
[ 1.545275] Bluetooth: RFCOMM socket layer initialized
[ 1.550475] Bluetooth: RFCOMM ver 1.11
[ 1.554230] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.559533] Bluetooth: BNEP filters: protocol multicast
[ 1.564774] Bluetooth: BNEP socket layer initialized
[ 1.569733] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1.575658] Bluetooth: HIDP socket layer initialized
[ 1.580707] Key type dns_resolver registered
[ 1.585138] Registering SWP/SWPB emulation handler
[ 1.637360] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.648007] mmc0: new high speed SDHC card at address 59b4
[ 1.654179] mmcblk0: mmc0:59b4 MS 14.7 GiB
[ 1.660280] mmcblk0: p1 p2
[ 1.720429] sun7i-dwmac 1c50000.ethernet: no reset control found
[ 1.726442] Ring mode enabled
[ 1.729494] DMA HW capability register supported[ 1.734043] Normal descriptors
[ 1.740878] libphy: stmmac: probed
[ 1.744290] eth%d: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[ 1.750737] eth%d: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[ 1.757688] ehci-platform 1c14000.usb: EHCI Host Controller
[ 1.763336] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 1.771265] ehci-platform 1c14000.usb: irq 30, io mem 0x01c14000
[ 1.800334] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 1.807387] hub 1-0:1.0: USB hub found
[ 1.811211] hub 1-0:1.0: 1 port detected
[ 1.815948] ehci-platform 1c1c000.usb: EHCI Host Controller
[ 1.821609] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[ 1.829483] ehci-platform 1c1c000.usb: irq 34, io mem 0x01c1c000
[ 1.860344] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 1.867377] hub 2-0:1.0: USB hub found
[ 1.871204] hub 2-0:1.0: 1 port detected
[ 1.875922] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[ 1.882593] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[ 1.890500] ohci-platform 1c14400.usb: irq 31, io mem 0x01c14400
[ 1.965249] hub 3-0:1.0: USB hub found
[ 1.969049] hub 3-0:1.0: 1 port detected
[ 1.973778] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[ 1.980469] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[ 1.988366] ohci-platform 1c1c400.usb: irq 35, io mem 0x01c1c400
[ 2.065200] hub 4-0:1.0: USB hub found
[ 2.068995] hub 4-0:1.0: 1 port detected
[ 2.074399] random: fast init done
[ 2.130346] sunxi-mmc 1c12000.mmc: base:0xf0ac3000 irq:29
[ 2.135832] sunxi-rtc 1c20d00.rtc: setting system clock to 1970-01-01 00:01:28 UTC (88)
[ 2.144262] vcc3v0: disabling
[ 2.147235] vcc5v0: disabling
[ 2.150211] ALSA device list:
[ 2.153201] No soundcards found.
[ 2.163034] sunxi-mmc 1c12000.mmc: smc 1 err, cmd 8, RTO !!
[ 2.175664] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[ 2.183268] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 2.190993] devtmpfs: mounted
[ 2.195143] Freeing unused kernel memory: 1024K (c0b00000 – c0c00000)
[ 2.203017] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 2.210040] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.217092] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.225414] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 2.246658] mmc1: new high speed SDIO card at address 0001
[ 2.303847] EXT4-fs (mmcblk0p2): warning: mounting unchecked fs, running e2fsck is recommended
[ 2.406027] EXT4-fs (mmcblk0p2): re-mounted. Opts: 
Starting logging: OK
Initializing random number generator… done.
Starting network: OK
Starting dropbear sshd:

Welcome to Buildroot — Kasi
buildroot login:

# mount
/dev/root on / type ext4 (rw,relatime,block_validity,delalloc,barrier,user_xattr)
devtmpfs on /dev type devtmpfs (rw,relatime,size=512896k,nr_inodes=128224,mode=755)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /tmp type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
sysfs on /sys type sysfs (rw,relatime

We are able reach the shell prompt with the file system we have just created.

Hope this series of blogs helps you to bring up an embedded device based on linux.

Advertisements