Contents
Download PDF
pdf Download XML
710 Views
256 Downloads
Share this article
Research Article | Volume 2 Issue 1 (Jan-June, 2021) | Pages 1 - 4
Building an Embedded Linux System for Raspberry Pi
 ,
 ,
 ,
 ,
 ,
 ,
1
Department of Science Laboratory Technology (Physics Unit), Adeseun Ogundoyin Polytechnic, Eruwa, Oyo State, Nigeria
2
Department of Computer Science, Adeseun Ogundoyin Polytechnic, Eruwa, Oyo State, Nigeria
3
Department of Electrical/Electronic Engineering, Yaba College of Technology, Lagos State State, Nigeria
4
Department of Civil Engineering, Adeseun Ogundoyin Polytechnic, Eruwa, Oyo State, Nigeria
5
Augustine University, Epe, Lagos State, Nigeria
Under a Creative Commons license
Open Access
Received
Dec. 22, 2020
Revised
Jan. 4, 2021
Accepted
Feb. 28, 2021
Published
March 30, 2021
Abstract

This project work was carried out using LINUX to build an operating system for Raspberry pi which is a small sized computer system with a lot of benefits such as: strong processing power in a compact board, several interfaces (HDMI, multiple USB, ONBOARD Wi-Fi and Bluetooth), support for many languages (e.g. LINUX and python) among others.

Keywords
INTRODUCTION

Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV and is capable of using a standard keyboard and mouse. It enables people that are zealous in computing to explore how to use different languages to develop operating system and application programs for it.

 

It has very limited resources, so development and compilation of SDK on it will be very slow. For this reason cross-compilation was implored in this coursework to rescue the situation. Buildroot was the compilation tool that was implored to build the BSQUASK SDK development environment for Raspberry Pi.

 

For any application to run on any system, it must be compiled. This is done by the use of a compiler. However, a compiler is not sufficient but can only work in conjunction with some other tools (such as: Libraries, an assembler, a linker, with some other tools). The compiler with all these tools are called a development tool chain.

 

When using the system compiler and other development machines that are of the same architecture and operating system are used so that generated object files are not used on another platform, the development tools used are called native toolchain.

 

But in a situation where an executable code generated can be run on a platform that is currently not the resident platform for the compiler, a cross-platform development tool chain is needed.

 

Like the case of embedded system which is the target system with a processor that is different from the processor of a host system, a cross-compilation toolchain that runs on the host system but generates codes for target processor (or system) is needed.

 

Buildroot is a type of tool that can make use of a compilation toolchain in a particular host system to build a cross-compilation toolchain and other tools that can run on the development host. This means buildroot can be used in this type of situation.

 

Buildroot is a tool that consists of a set of makefiles and patches that make it easy to generate a complete Linux system. It is able to generate any or all of cross-compilation toolchain, a root file system, a kernel image and a bootloader image.

 

Buildroot uses existing cross-compilation toolchain or provides different solutions to build:

 

  • The internal tool toolchain backend (called Buildroot toolchain in the configuration interface)

  • The external toolchain backend (called external toolchain in the configuration interface)

  • The crosstool-NG toolchain backend (crosstool-NG toolchain in the configuration interface)

 

Buildroot needs some software to be already installed on the host system before cross-compilation can take place. They are called mandatory and optional packages.

 

Mandatory Packages 

 

  • Build tools =>e.g. which, sed, make, binutils, build-essential, gcc, g++, bash, patch, gzip, tar, bzip2, perl, cpio, python,unzip, rsync

  • Source fectching tools =>e.gwget

 

Optional Packages 

 

  • Source fectching tools=>e.g. bazaar, git, cvs, mercurial, rsync, subversion, etc.

  • Configuration interfave dependencies=>e.gncurses, glib2, gtk2, glade2

  • Java-related packages=>e.g. jar tool, java compiler

  • Documentation orientation tools=>e.gasciidoc

 

Importance of Cross-Platform Development Tool Chain

 

  • Speed=> target platforms are usually much slower than host platforms

  • Capability=> compiling is resource intensive. Because target platform might not have enough memory it makes use of the host memory

  • Convenience => cross-compilatin is necessary where native compilation is not convenient or practiceable

  • Flexibility=> it gives room for interrelated execution of components on a system

  • Availability=> since cross-compiled programs are meant for many targeted systems, many systems are available for inter-usability

  • Reduction in overall cost=> since cross-compiled programs are meant for many targeted systems, overall cost effectiveness on production is reduced

MATERIALS AND METHODS

Buildroot is a set of makefiles and patches that makes it easy to generate a complete embedded linux system.

 

Ubuntu as an easy-to-use desktop Linux distribution was downloaded and installed on the laptop. The laptop was connected to the internet before the task commenced.

 

Terminal of Ubuntu operating system was entered into and a local Code directory was created for raspberryPi-Buildroot to be cloned into. This was done with the command:

 

  • “mkdir Code”

 

And the RaspberryPi-BuildRoot package was cloned into the created directory using the command below:

 

  • “git clone git://github.com/nezticle/RaspberryPi-BuildRoot.git BuildRoot”

 

A directory was also created for the SDK to be built into. The command below made SDK available from the buildroot:

 

  • “export BSQUASK_DIR=/opt/bsquask”

 

And another directory was created to build SDK into with the following command:

 

  • “mkdir -p $BSQUASK_DIR”

 

BuildRootdirectory was then changed to using the folloeing command:

 

  • “cdBuildRoot”

 

In this directory, a Makefile was generated for the SDK using the command below:

 

  • “make raspberrypi_defconfig 0=$BSQUASK_DIR”

 

Some build dependency packages had been earlier installed for the makefile to be generated using the following command:

 

  • “sudo apt-get install build-essential, flex, bison,tex, git, cvs, subversion, unzip, bc, whois, ncurses-dev, mercurial, textinfo, git-core, gettext, gparted, mesa-common-dev, libgl1-mesa-dev”

 

This ‘make’ process took about seven minutes to complete. After this ‘make’ stage, SDK directory was changed to with the command below:

 

  • “cd $BSQUASK_DIR”

 

And SDK was built using the command given below:

 

  • “make”

 

 

This process took three hours forty five minutes for the image to be built.

 

After this stage, embedded Linux operating system has been built and the generated image was now installed on an SD card with the procedure described below:

 

Table 1: The Folders of ~/Buildroot/ have the Following Subfolders

Folder

Subfolders

Files

Buildroot

  1. arch

  2. board

  3. configs

  4. docs

  5. package

  6. system

  7. support

  8. boot

  9. linux

  10. output

  11. fs

  12. toolchain

  1. CHANGES

  2. Makefile

  3. Makefile.legacy

  4. README.md

  5. COPYING

  6. config.in

 

 

Figure1: Connection of Raspberry pi to the System on which Operating System was Built

 

Using the Generated Image on the raspberry Pi 

SD card was inserted into the card reader of the system on which operating system was being built and in the ‘gparted’ environment in the Ubuntu O.S. it was formatted and put in the following partitions:

 

  • 75MB fat32 partition

  • 3.6GB ext4 partition

 

After this, I entered into the directory of the images generated with the use of the command:

 

  • “cd /opt/bsquask/images”

 

The two partitions created were: /dev/mmcblk0p1 and /dev/mmcblk0p1 respectively. These two partitions were mounted using the command below:

 

  • “sudo mount /dev/mmcblk0p1 /media/BOOT”

  • “sudo mount /dev/mmcblk0p2 /media/rootfs”

 

Then the following commands were used to install the rootfs on the SD card:

 

  • “sudoumount /dev/mmcblk0p1”

  • “sudoumount /dev/mmcblk0p2”

 

The SD card was then removed from the card reader and inserted into the raspberry pi.

 

The raspberrypi was then ready for use with its own embedded Linux operating system.

 

The folders of ~/Buildroot/ have the following subfolders and files as shown in Table 1.

 

Testing the raspberry pi with the embedded Linux operating system built

 

Apparatus:

 

  • Raspberry pi (with power cord)

  • SD card

  • VDU (monitor)

  • Mouse (USB type)

  • Keyboard (USB type)

  • VGA cord

  • piView (HDMI to VGA converter)

 

All the apparatus mentioned above were connected together appropriately and the raspberry pi was powered on.

 

The Figure1 below shows how piView, SD card and power cord were connected to the raspberry pi. The piView, as shown below was connected to the VGA cord and the VGA cord conncted to the monitor. Other ports are still available to connect other devices to. Examples are the mouse and keyboard which were connected to the USB ports.

 

The Figure 2 was the image shown on the monitor. “root” is the raspberry login and also the password.

 

 

Figure 2: Image shown on the monitor as displayed by the Raspberry pi with a new operating system

REFERENCE
  1. Raspberry Pi. “Raspberry Pi.” Raspberry Pi Foundation, www.raspberrypi.org. Accessed October 2013.

  2. Nichols, A. “Bsquask SDK.” Bsquask Blog, 21 December 2012, www.bsquask.com/blog/2012/12/21/bsquask-sdk/. Accessed October 2013.

  3. Ibanez, L., and Maclean, A. “Cross-Compiling for Raspberry Pi.” Kitware Blog, www.kitware.com/blog/home/post/426. Accessed October 2013.

  4. Buildroot. The Buildroot User Manual., buildroot.uclibc.org/ downloads/manual/manual.pdf. Accessed October 2013.

  5. Robert, S. “How to Create a Buildroot Environment for Raspberry Pi.” XApp Software Blog, 6 June 2013, www.xappsoftware.com/wordpress/2013/06/06/how-to -create-a-buildroot-environment-for-raspberry-pi/. Accessed 2013.

Recommended Articles
Research Article
Event Detection in Wireless Sensor Networks Using Machine Learning and Deep Learning: A Comparative Analysis for Smart Environments
Published: 31/12/2025
Download PDF
Research Article
OBSERVATIONS ON THE HOMOGENEOUS TERNARY QUADRATIC DIOPHANTINE EQUATION x2 + 4xy + 9y2 = 21z2
Download PDF
Research Article
Design and Implementation of a GSM-Based SMS Controlled DC Motor Speed Regulation System
...
Published: 31/12/2025
Download PDF
Research Article
Computer Driven Library Management and Service Rendering System: Mobile Library Landscape
...
Published: 10/06/2020
Download PDF
Chat on WhatsApp
Flowbite Logo
PO Box 101, Nakuru
Kenya.
Email: office@iarconsortium.org

Editorial Office:
J.L Bhavan, Near Radison Blu Hotel,
Jalukbari, Guwahati-India
Useful Links
Order Hard Copy
Privacy policy
Terms and Conditions
Refund Policy
Shipping Policy
Others
About Us
Team Members
Contact Us
Online Payments
Join as Editor
Join as Reviewer
Subscribe to our Newsletter
+91 60029-93949
Follow us
MOST SEARCHED KEYWORDS
Copyright © iARCON International LLP . All Rights Reserved.