2

I'm in the stage of optimizing Raspberry pi 4 startup time, supplied with a custom system image created by buildroot.

I'm just trying to build a default image like this:

git clone git://git.busybox.net/buildroot buildroot && cd buildroot && git checkout 2019.11.1
make raspberrypi4_defconfig BR2_JLEVEL="$(nproc)"

And here's the output image:

.
├── [ 40K]  bcm2711-rpi-4-b.dtb
├── [ 32M]  boot.vfat
├── [200M]  rootfs.ext2
├── [  11]  rootfs.ext4 -> rootfs.ext2
├── [3.0M]  rpi-firmware
│   ├── [  65]  cmdline.txt
│   ├── [ 745]  config.txt
│   ├── [5.9K]  fixup4.dat
│   ├── [335K]  overlays
│   │   ├── [ 569]  act-led.dtbo
│   │   ├── [1.0K]  adau1977-adc.dtbo
│   │   ├── [1.5K]  adau7002-simple.dtbo
│   │   ├── [2.4K]  ads1015.dtbo
│   │   ├── [2.4K]  ads1115.dtbo
│   │   ├── [2.3K]  ads7846.dtbo
│   │   ├── [1.9K]  adv7282m.dtbo
│   │   ├── [2.4K]  adv728x-m.dtbo
│   │   ├── [1.4K]  akkordion-iqdacplus.dtbo
│   │   ├── [1.4K]  allo-boss-dac-pcm512x-audio.dtbo
│   │   ├── [1.2K]  allo-digione.dtbo
│   │   ├── [1.6K]  allo-katana-dac-audio.dtbo
│   │   ├── [1011]  allo-piano-dac-pcm512x-audio.dtbo
│   │   ├── [1.5K]  allo-piano-dac-plus-pcm512x-audio.dtbo
│   │   ├── [1.4K]  applepi-dac.dtbo
│   │   ├── [1.6K]  at86rf233.dtbo
│   │   ├── [1.8K]  audioinjector-addons.dtbo
│   │   ├── [1.8K]  audioinjector-ultra.dtbo
│   │   ├── [ 787]  audioinjector-wm8731-audio.dtbo
│   │   ├── [2.1K]  audiosense-pi.dtbo
│   │   ├── [ 833]  audremap.dtbo
│   │   ├── [2.9K]  balena-fin.dtbo
│   │   ├── [ 449]  bmp085_i2c-sensor.dtbo
│   │   ├── [ 983]  dht11.dtbo
│   │   ├── [ 663]  dionaudio-loco.dtbo
│   │   ├── [1.0K]  dionaudio-loco-v2.dtbo
│   │   ├── [ 954]  disable-bt.dtbo
│   │   ├── [ 387]  disable-wifi.dtbo
│   │   ├── [ 951]  dpi18.dtbo
│   │   ├── [ 975]  dpi24.dtbo
│   │   ├── [5.7K]  draws.dtbo
│   │   ├── [ 801]  dwc2.dtbo
│   │   ├── [ 293]  dwc-otg.dtbo
│   │   ├── [1.4K]  enc28j60.dtbo
│   │   ├── [1.2K]  enc28j60-spi2.dtbo
│   │   ├── [1.5K]  exc3000.dtbo
│   │   ├── [1.9K]  fe-pi-audio.dtbo
│   │   ├── [1.4K]  goodix.dtbo
│   │   ├── [1.2K]  googlevoicehat-soundcard.dtbo
│   │   ├── [1.2K]  gpio-fan.dtbo
│   │   ├── [1.2K]  gpio-ir.dtbo
│   │   ├── [1.1K]  gpio-ir-tx.dtbo
│   │   ├── [1.3K]  gpio-key.dtbo
│   │   ├── [ 274]  gpio-no-bank0-irq.dtbo
│   │   ├── [ 258]  gpio-no-irq.dtbo
│   │   ├── [ 994]  gpio-poweroff.dtbo
│   │   ├── [1.2K]  gpio-shutdown.dtbo
│   │   ├── [1.6K]  hd44780-lcd.dtbo
│   │   ├── [ 779]  hifiberry-amp.dtbo
│   │   ├── [ 655]  hifiberry-dac.dtbo
│   │   ├── [1.9K]  hifiberry-dacplusadc.dtbo
│   │   ├── [1.8K]  hifiberry-dacplusadcpro.dtbo
│   │   ├── [1.7K]  hifiberry-dacplus.dtbo
│   │   ├── [ 959]  hifiberry-digi.dtbo
│   │   ├── [1.1K]  hifiberry-digi-pro.dtbo
│   │   ├── [2.4K]  hy28a.dtbo
│   │   ├── [2.8K]  hy28b-2017.dtbo
│   │   ├── [2.8K]  hy28b.dtbo
│   │   ├── [1.6K]  i2c0-bcm2708.dtbo
│   │   ├── [1.4K]  i2c0.dtbo
│   │   ├── [1.3K]  i2c1-bcm2708.dtbo
│   │   ├── [1004]  i2c1.dtbo
│   │   ├── [ 907]  i2c3.dtbo
│   │   ├── [ 907]  i2c4.dtbo
│   │   ├── [ 911]  i2c5.dtbo
│   │   ├── [ 909]  i2c6.dtbo
│   │   ├── [ 270]  i2c-bcm2708.dtbo
│   │   ├── [1.0K]  i2c-gpio.dtbo
│   │   ├── [2.1K]  i2c-mux.dtbo
│   │   ├── [ 644]  i2c-pwm-pca9685a.dtbo
│   │   ├── [4.4K]  i2c-rtc.dtbo
│   │   ├── [5.1K]  i2c-rtc-gpio.dtbo
│   │   ├── [4.6K]  i2c-sensor.dtbo
│   │   ├── [ 307]  i2s-gpio28-31.dtbo
│   │   ├── [1.3K]  ilitek251x.dtbo
│   │   ├── [ 895]  iqaudio-codec.dtbo
│   │   ├── [1.2K]  iqaudio-dac.dtbo
│   │   ├── [1.5K]  iqaudio-dacplus.dtbo
│   │   ├── [1.3K]  iqaudio-digi-wm8804-audio.dtbo
│   │   ├── [ 893]  i-sabre-q2m.dtbo
│   │   ├── [5.1K]  jedec-spi-nor.dtbo
│   │   ├── [1.2K]  justboom-dac.dtbo
│   │   ├── [ 955]  justboom-digi.dtbo
│   │   ├── [1.9K]  ltc294x.dtbo
│   │   ├── [1.9K]  max98357a.dtbo
│   │   ├── [1.6K]  mbed-dac.dtbo
│   │   ├── [1.4K]  mcp23017.dtbo
│   │   ├── [ 15K]  mcp23s17.dtbo
│   │   ├── [1.8K]  mcp2515-can0.dtbo
│   │   ├── [1.8K]  mcp2515-can1.dtbo
│   │   ├── [4.1K]  mcp3008.dtbo
│   │   ├── [4.1K]  mcp3202.dtbo
│   │   ├── [1.8K]  mcp342x.dtbo
│   │   ├── [3.3K]  media-center.dtbo
│   │   ├── [ 720]  midi-uart0.dtbo
│   │   ├── [ 857]  midi-uart1.dtbo
│   │   ├── [1.4K]  miniuart-bt.dtbo
│   │   ├── [1.2K]  mmc.dtbo
│   │   ├── [ 796]  mpu6050.dtbo
│   │   ├── [2.8K]  mz61581.dtbo
│   │   ├── [2.5K]  ov5647.dtbo
│   │   ├── [2.3K]  papirus.dtbo
│   │   ├── [ 569]  pi3-act-led.dtbo
│   │   ├── [ 954]  pi3-disable-bt.dtbo
│   │   ├── [ 387]  pi3-disable-wifi.dtbo
│   │   ├── [1.4K]  pi3-miniuart-bt.dtbo
│   │   ├── [2.3K]  pibell.dtbo
│   │   ├── [1.6K]  piglow.dtbo
│   │   ├── [2.5K]  piscreen2r.dtbo
│   │   ├── [2.6K]  piscreen.dtbo
│   │   ├── [2.4K]  pisound.dtbo
│   │   ├── [1.5K]  pitft22.dtbo
│   │   ├── [2.3K]  pitft28-capacitive.dtbo
│   │   ├── [2.7K]  pitft28-resistive.dtbo
│   │   ├── [2.7K]  pitft35-resistive.dtbo
│   │   ├── [1.1K]  pps-gpio.dtbo
│   │   ├── [1.0K]  pwm-2chan.dtbo
│   │   ├── [ 946]  pwm.dtbo
│   │   ├── [1.0K]  pwm-ir-tx.dtbo
│   │   ├── [1.4K]  qca7000.dtbo
│   │   ├── [1.9K]  rotary-encoder.dtbo
│   │   ├── [ 489]  rpi-backlight.dtbo
│   │   ├── [3.5K]  rpi-cirrus-wm5102.dtbo
│   │   ├── [ 643]  rpi-dac.dtbo
│   │   ├── [2.5K]  rpi-display.dtbo
│   │   ├── [1018]  rpi-ft5406.dtbo
│   │   ├── [1.9K]  rpi-poe.dtbo
│   │   ├── [ 771]  rpi-proto.dtbo
│   │   ├── [ 893]  rpi-sense.dtbo
│   │   ├── [ 567]  rpi-tv.dtbo
│   │   ├── [1.3K]  rra-digidac1-wm8741-audio.dtbo
│   │   ├── [1.2K]  sc16is750-i2c.dtbo
│   │   ├── [1.3K]  sc16is752-i2c.dtbo
│   │   ├── [1.8K]  sc16is752-spi1.dtbo
│   │   ├── [ 968]  sdhost.dtbo
│   │   ├── [1.8K]  sdio.dtbo
│   │   ├── [ 804]  sdtweak.dtbo
│   │   ├── [ 376]  smi-dev.dtbo
│   │   ├── [ 981]  smi.dtbo
│   │   ├── [1.4K]  smi-nand.dtbo
│   │   ├── [ 895]  spi0-cs.dtbo
│   │   ├── [ 456]  spi0-hw-cs.dtbo
│   │   ├── [1.5K]  spi1-1cs.dtbo
│   │   ├── [1.9K]  spi1-2cs.dtbo
│   │   ├── [2.2K]  spi1-3cs.dtbo
│   │   ├── [1.5K]  spi2-1cs.dtbo
│   │   ├── [1.9K]  spi2-2cs.dtbo
│   │   ├── [2.2K]  spi2-3cs.dtbo
│   │   ├── [1.3K]  spi3-1cs.dtbo
│   │   ├── [1.6K]  spi3-2cs.dtbo
│   │   ├── [1.3K]  spi4-1cs.dtbo
│   │   ├── [1.6K]  spi4-2cs.dtbo
│   │   ├── [1.3K]  spi5-1cs.dtbo
│   │   ├── [1.6K]  spi5-2cs.dtbo
│   │   ├── [1.3K]  spi6-1cs.dtbo
│   │   ├── [1.6K]  spi6-2cs.dtbo
│   │   ├── [ 630]  spi-gpio35-39.dtbo
│   │   ├── [ 795]  spi-gpio40-45.dtbo
│   │   ├── [ 635]  spi-rtc.dtbo
│   │   ├── [1.1K]  ssd1306.dtbo
│   │   ├── [1.9K]  superaudioboard.dtbo
│   │   ├── [ 35K]  sx150x.dtbo
│   │   ├── [1.5K]  tc358743-audio.dtbo
│   │   ├── [2.4K]  tc358743.dtbo
│   │   ├── [4.7K]  tinylcd35.dtbo
│   │   ├── [ 779]  tpm-slb9670.dtbo
│   │   ├── [ 988]  uart0.dtbo
│   │   ├── [ 980]  uart1.dtbo
│   │   ├── [ 589]  uart2.dtbo
│   │   ├── [ 589]  uart3.dtbo
│   │   ├── [ 589]  uart4.dtbo
│   │   ├── [ 589]  uart5.dtbo
│   │   ├── [3.4K]  udrc.dtbo
│   │   ├── [2.4K]  upstream.dtbo
│   │   ├── [1.2K]  vc4-fkms-v3d.dtbo
│   │   ├── [1.1K]  vc4-kms-kippah-7inch.dtbo
│   │   ├── [2.3K]  vc4-kms-v3d.dtbo
│   │   ├── [ 758]  vga666.dtbo
│   │   ├── [1.0K]  w1-gpio.dtbo
│   │   ├── [1.1K]  w1-gpio-pullup.dtbo
│   │   └── [1.0K]  wittypi.dtbo
│   └── [2.6M]  start4.elf
├── [232M]  sdcard.img
├── [462K]  u-boot.bin
└── [5.3M]  zImage

From this Question, seeing an splash-screen means that we're on stage 3 bootloader and the device's GPU firmware(start.elf) has been loaded.

Up to this point, it took approximately 4-5 seconds! without even entering the kernel load phase!

Is this normal? or something's wrong or should be optimized out?

6
  • What does the output image mean?
    – Ingo
    Feb 3 '20 at 19:00
  • @Ingo Just the build process outputs layout from buildroot.
    – IMAN4K
    Feb 4 '20 at 14:42
  • Were you able to find out? I'm very interested too.
    – Dakatine
    Jan 22 at 7:17
  • @Dakatine. If you mean the output, it's simply the tree command on buildroot output.
    – IMAN4K
    Jan 22 at 10:57
  • 1
    @Dakatine. It takes time to reduce the image size, you should go through the configuration especially the kernel, remove unused file systems, drivers, etc. if you have limited functionality you can blow down kernel size to ~3-3.5MB with x11-enabled
    – IMAN4K
    Jan 23 at 15:00
2

Not direct an answer to your question but maybe a help to examine what's going on with the bootloader. The Raspberry Pi 4B has an EEPROM now where you can set a debug flag BOOT_UART=1 as described at Pi4 Bootloader Configuration. Then the boot loader will output low level debug information to the serial debug console on pins GPIO 14 and 15 so you need a USB to TTL (RS232) serial adapter. An example of an output you can find at Serial output in case of no OS.

3
  • Were you able to find out? I'm very interested too. Also, why did you switch to version 2019 of buildroot? Thank for your help!
    – Dakatine
    Jan 22 at 7:17
  • @Dakatine Sorry, I haven't tried buildroot and I haven't used any version of it. As written, the answer is only a suggestion to get debug information about the boot loader.
    – Ingo
    Jan 22 at 9:39
  • Thanks @Ingo. I actually wanted to ask that to the OP, my bad :P
    – Dakatine
    Jan 22 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.