SlideShare a Scribd company logo
BeagleBone Black
with upstream software
Viktoriia Taraniuk
BBB Overview
Open hardware:
● Technical Reference Manual (TRM)
● Schematic and PCB
Supported in upstream:
● Kernel
● U-boot
Cost: $55
Software components
● U-Boot
● Kernel
● Busybox
Building the software
Rules of the game
● Do all steps in one terminal
● Always check your path
● Don’t put / in the beginning of path because you can damage your rootfs
● Don’t work with root rights unless it was mentioned
● Each command should be verified (esp. export command)
Toolchains
● Main components:
○ Cross-compiler, linker, etc (gcc, ld, as, cpp)
○ libc (and other related libraries)
○ debugger (GDB), binary tools
● There are two kinds of toolchains:
○ Baremetal: for building programs being run without OS
○ Linux: for building user-space programs being run under Linux OS
Baremetal toolchain
● Download baremetal toolchain:
gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi.tar.xz
https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-eabi/
● Extract toolchain to /opt:
$ sudo tar xJvf gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi.tar.xz -C /opt/
Linux toolchain
● Download linux toolchain:
gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/
● Extract toolchain to /opt:
$ sudo tar xJvf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/
U-Boot: Obtain
● Obtain U-Boot source code:
$ git clone git://git.denx.de/u-boot.git
● Checkout to latest release tag:
$ git checkout v2018.03
U-Boot: Build
● Configure toolchain environment in shell:
$ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
$ export ARCH=arm
● Build U-Boot:
$ make am335x_boneblack_defconfig
$ make -j4
Linux kernel: Obtain
● Install host build dependencies:
$ sudo apt-get install ncurses-dev libssl-dev bc bison flex
● Obtain Linux kernel source code:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Linux kernel: Configure
● Configure toolchain environment in shell:
$ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
$ export ARCH=arm
● Generate .config:
$ make multi_v7_defconfig
Linux kernel: Build
● Build kernel image and device tree blob:
$ make -j4 zImage am335x-boneblack.dtb
Busybox: Obtain
● Obtain sources:
$ git clone git://busybox.net/busybox.git
● Setup build environment (use Linux toolchain):
$ export ARCH=arm
$ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin:$PATH
$ export CROSS_COMPILE=arm-linux-gnueabihf-
● Checkout to latest stable branch:
$ git checkout 1_28_stable
Linking: static vs dynamic
● Static linking: libc (.a) is compiled in your binary
○ Only “busybox” binary is needed in rootfs
○ Easier to build and minimal
○ Some networking functions won’t work (nslookup, see libnss)
● Dynamic linking: libc used as a shared library (.so)
○ Only one copy of libc is used (both in rootfs and in RAM)
○ Dynamic libraries must be copied in rootfs /lib
(libc and its dependencies)
Busybox: Build and install
● Configure BusyBox with all features:
$ make defconfig
$ make menuconfig
● Build BusyBox:
$ make -j4
● Install to _install/ dir:
$ make install
Creating rootfs
Populate root dir
● Create root directories:
$ mkdir -p _install/{boot,dev,etc/init.d,proc,root,sys,tmp}
● Make “init” link:
$ cd _install/
$ ln -s bin/busybox init
$ cd -
Init script
● Create init script (_install/etc/init.d/rcS):
#!/bin/sh
mount -t sysfs none /sys
mount -t proc none /proc
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
● Make script executable:
$ chmod +x _install/etc/init.d/rcS
Populate /boot
● Populate /boot dir with kernel files:
$ cd _install/boot
$ cp $WORK_DIR/linux/arch/arm/boot/zImage .
$ cp $WORK_DIR/linux/arch/arm/boot/dts/am335x-boneblack.dtb .
$ cd -
Resulting rootfs
/
├── bin
│ └── busybox
├── boot
│ ├── am335x-boneblack.dtb
│ └── zImage
├── dev
├── etc
│ └── init.d
│ └── rcS
├── init -> bin/busybox
├── linuxrc -> bin/busybox
├── proc
├── root
├── sbin
├── sys
├── tmp
└── usr
├── bin
└── sbin
Q&A
Thank you!

More Related Content

PDF
BeagleBone Black: Platform Bring-Up with Upstream Components
PDF
Introduction to Modern U-Boot
PDF
Jagan Teki - U-boot from scratch
PPTX
U-Boot presentation 2013
PPTX
Bootloaders (U-Boot)
PDF
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
PDF
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
PDF
Embedded_Linux_Booting
BeagleBone Black: Platform Bring-Up with Upstream Components
Introduction to Modern U-Boot
Jagan Teki - U-boot from scratch
U-Boot presentation 2013
Bootloaders (U-Boot)
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
Embedded_Linux_Booting

What's hot (20)

PPT
U Boot or Universal Bootloader
PPTX
Linux Kernel Booting Process (1) - For NLKB
PDF
A Journey to Boot Linux on Raspberry Pi
PPTX
U-Boot Porting on New Hardware
PDF
Unix Ramblings
PDF
Linux-without-a-bootloader
PDF
Building
PPT
Embedding Linux On The Encore Simputer
PDF
Let's trace Linux Lernel with KGDB @ COSCUP 2021
PDF
Android on Intel Architecture: ROM Cooking Tutorial
PPT
Bootstrap process of u boot (NDS32 RISC CPU)
PDF
Getting started with BeagleBone Black - Embedded Linux
PDF
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
ODP
Grub and dracut ii
PDF
Linux Porting
ODP
Description of GRUB 2
PPTX
Terminals and Shells
PDF
File systems for Embedded Linux
PDF
Davide Berardi - Linux hardening and security measures against Memory corruption
PPT
Linux Kernel Image
U Boot or Universal Bootloader
Linux Kernel Booting Process (1) - For NLKB
A Journey to Boot Linux on Raspberry Pi
U-Boot Porting on New Hardware
Unix Ramblings
Linux-without-a-bootloader
Building
Embedding Linux On The Encore Simputer
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Android on Intel Architecture: ROM Cooking Tutorial
Bootstrap process of u boot (NDS32 RISC CPU)
Getting started with BeagleBone Black - Embedded Linux
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Grub and dracut ii
Linux Porting
Description of GRUB 2
Terminals and Shells
File systems for Embedded Linux
Davide Berardi - Linux hardening and security measures against Memory corruption
Linux Kernel Image
Ad

Similar to BeagleBone Black with Upstream Software (20)

PDF
Android Variants, Hacks, Tricks and Resources
PDF
Leveraging Android's Linux Heritage at AnDevCon V
PDF
Leveraging Android's Linux Heritage at AnDevCon VI
PPT
From gcc to the autotools
PDF
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
PDF
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
PDF
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
PDF
Golang execution modes
PDF
Porting Android
PDF
LMG Lightning Talks - SFO17-205
PDF
Masters porting linux
PDF
01 linux-quick-start
PDF
Leveraging Android's Linux Heritage at AnDevCon IV
PDF
Whirlwind tour of the Runtime Dynamic Linker
PPTX
Autotools pratical training
PDF
Embedded Linux primer
PDF
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
PDF
Buildroot easy embedded system
PPTX
Crafting GNU/ linux distributions for embedded target using Builroot
PDF
Porting Android
Android Variants, Hacks, Tricks and Resources
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VI
From gcc to the autotools
Eclipse Con US 2013 - Buildroot Eclipse Bundle : A powerful IDE for Embedded ...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Golang execution modes
Porting Android
LMG Lightning Talks - SFO17-205
Masters porting linux
01 linux-quick-start
Leveraging Android's Linux Heritage at AnDevCon IV
Whirlwind tour of the Runtime Dynamic Linker
Autotools pratical training
Embedded Linux primer
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
Buildroot easy embedded system
Crafting GNU/ linux distributions for embedded target using Builroot
Porting Android
Ad

More from GlobalLogic Ukraine (20)

PDF
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
PPTX
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
PDF
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
PDF
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
PDF
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
PDF
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
PPTX
Штучний інтелект як допомога в навчанні, а не замінник.pptx
PPTX
Задачі AI-розробника як застосовується штучний інтелект.pptx
PPTX
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
PDF
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
PDF
JavaScript Community Webinar #14 "Why Is Git Rebase?"
PDF
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
PPTX
Страх і сила помилок - IT Inside від GlobalLogic Education
PDF
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
PDF
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
PDF
“How to Secure Your Applications With a Keycloak?
PDF
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
PPTX
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
PDF
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
PDF
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
GlobalLogic JavaScript Community Webinar #21 “Інтерв’ю без заспокійливих”
Deadlocks in SQL - Turning Fear Into Understanding (by Sergii Stets)
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Embedded Community x ROS Ukraine Webinar "Surgical Robots"
GlobalLogic Java Community Webinar #17 “SpringJDBC vs JDBC. Is Spring a Hero?”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
Штучний інтелект як допомога в навчанні, а не замінник.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
Страх і сила помилок - IT Inside від GlobalLogic Education
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
“How to Secure Your Applications With a Keycloak?
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"

Recently uploaded (20)

PPTX
Artificial Intelligence
PPT
Total quality management ppt for engineering students
PDF
PPT on Performance Review to get promotions
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPT
Occupational Health and Safety Management System
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPT
introduction to datamining and warehousing
PPTX
UNIT - 3 Total quality Management .pptx
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
communication and presentation skills 01
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
introduction to high performance computing
Artificial Intelligence
Total quality management ppt for engineering students
PPT on Performance Review to get promotions
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Occupational Health and Safety Management System
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
introduction to datamining and warehousing
UNIT - 3 Total quality Management .pptx
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
R24 SURVEYING LAB MANUAL for civil enggi
communication and presentation skills 01
Automation-in-Manufacturing-Chapter-Introduction.pdf
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Visual Aids for Exploratory Data Analysis.pdf
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
introduction to high performance computing

BeagleBone Black with Upstream Software

  • 1. BeagleBone Black with upstream software Viktoriia Taraniuk
  • 2. BBB Overview Open hardware: ● Technical Reference Manual (TRM) ● Schematic and PCB Supported in upstream: ● Kernel ● U-boot Cost: $55
  • 5. Rules of the game ● Do all steps in one terminal ● Always check your path ● Don’t put / in the beginning of path because you can damage your rootfs ● Don’t work with root rights unless it was mentioned ● Each command should be verified (esp. export command)
  • 6. Toolchains ● Main components: ○ Cross-compiler, linker, etc (gcc, ld, as, cpp) ○ libc (and other related libraries) ○ debugger (GDB), binary tools ● There are two kinds of toolchains: ○ Baremetal: for building programs being run without OS ○ Linux: for building user-space programs being run under Linux OS
  • 7. Baremetal toolchain ● Download baremetal toolchain: gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi.tar.xz https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-eabi/ ● Extract toolchain to /opt: $ sudo tar xJvf gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi.tar.xz -C /opt/
  • 8. Linux toolchain ● Download linux toolchain: gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/ ● Extract toolchain to /opt: $ sudo tar xJvf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/
  • 9. U-Boot: Obtain ● Obtain U-Boot source code: $ git clone git://git.denx.de/u-boot.git ● Checkout to latest release tag: $ git checkout v2018.03
  • 10. U-Boot: Build ● Configure toolchain environment in shell: $ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH $ export CROSS_COMPILE=arm-eabi- $ export ARCH=arm ● Build U-Boot: $ make am335x_boneblack_defconfig $ make -j4
  • 11. Linux kernel: Obtain ● Install host build dependencies: $ sudo apt-get install ncurses-dev libssl-dev bc bison flex ● Obtain Linux kernel source code: $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  • 12. Linux kernel: Configure ● Configure toolchain environment in shell: $ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH $ export CROSS_COMPILE=arm-eabi- $ export ARCH=arm ● Generate .config: $ make multi_v7_defconfig
  • 13. Linux kernel: Build ● Build kernel image and device tree blob: $ make -j4 zImage am335x-boneblack.dtb
  • 14. Busybox: Obtain ● Obtain sources: $ git clone git://busybox.net/busybox.git ● Setup build environment (use Linux toolchain): $ export ARCH=arm $ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin:$PATH $ export CROSS_COMPILE=arm-linux-gnueabihf- ● Checkout to latest stable branch: $ git checkout 1_28_stable
  • 15. Linking: static vs dynamic ● Static linking: libc (.a) is compiled in your binary ○ Only “busybox” binary is needed in rootfs ○ Easier to build and minimal ○ Some networking functions won’t work (nslookup, see libnss) ● Dynamic linking: libc used as a shared library (.so) ○ Only one copy of libc is used (both in rootfs and in RAM) ○ Dynamic libraries must be copied in rootfs /lib (libc and its dependencies)
  • 16. Busybox: Build and install ● Configure BusyBox with all features: $ make defconfig $ make menuconfig ● Build BusyBox: $ make -j4 ● Install to _install/ dir: $ make install
  • 18. Populate root dir ● Create root directories: $ mkdir -p _install/{boot,dev,etc/init.d,proc,root,sys,tmp} ● Make “init” link: $ cd _install/ $ ln -s bin/busybox init $ cd -
  • 19. Init script ● Create init script (_install/etc/init.d/rcS): #!/bin/sh mount -t sysfs none /sys mount -t proc none /proc echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s ● Make script executable: $ chmod +x _install/etc/init.d/rcS
  • 20. Populate /boot ● Populate /boot dir with kernel files: $ cd _install/boot $ cp $WORK_DIR/linux/arch/arm/boot/zImage . $ cp $WORK_DIR/linux/arch/arm/boot/dts/am335x-boneblack.dtb . $ cd -
  • 21. Resulting rootfs / ├── bin │ └── busybox ├── boot │ ├── am335x-boneblack.dtb │ └── zImage ├── dev ├── etc │ └── init.d │ └── rcS ├── init -> bin/busybox ├── linuxrc -> bin/busybox ├── proc ├── root ├── sbin ├── sys ├── tmp └── usr ├── bin └── sbin

Editor's Notes

  • #11: Output files: MLO (first-stage bootloader) u-boot.img (second-stage bootloader)
  • #14: Output files: arch/arm/boot/zImage arch/arm/boot/dts/am335x-boneblack.dtb