Root File-System for Raspberry Pi Bastian Arjun Shajit Department of Electrical Engineering Aalto University P.O

Root File-System for Raspberry Pi Bastian Arjun Shajit Department of Electrical Engineering Aalto University P.O

Root File-System for Raspberry Pi Bastian Arjun Shajit Department of Electrical Engineering Aalto University P.O. Box 11000, FI-00076 AALTO [email protected] ABSTRACT providing a small set of primitive and distinct APIs, the complex In terms of file system, Linux is often referred to as the Swiss file system logic is implemented. This simple but powerful Army knife among operating systems, particularly supporting a abstraction is known as the VFS [12] (Virtual File System) layer large number of exotic file systems for a pot-pourri of platforms in the Linux kernel architecture. When referring to a file system, it with different architectures. The purpose of this article is not to is safe to assume that both the kernel and the root file system capture the internal mechanics of file system nor does it provide a encompass one another in a loosely bound manner. Both the definitive and a complete reference to the file system properties kernel and the root file system work hand-in-hand to drive the but is aimed at exploring the possibilities of creating a system to a state where it can function properly and provide an minimalistic root file system for the SD-card used in Raspberry Pi environment where further file systems (if any) can be loaded. In platform and reviews some the existing *NIX based file systems reality, there are more file systems available at a user’s discretion and attempts to provide a comparative analysis of the performance than there are operating systems. *NIX systems have their fair aspects of different user-space, kernel and RAM based file system. share of file systems in acronym fashion: EXT2fs, UBIfs, JFFS2[13] etc and each of these file systems cater to different needs of the users. These file systems can be broadly classified General Terms into the categories discussed below. The list of categories is not Theory, Documentation, Performance, Design, Experimentation meant to be exhaustive but simply tries to show the different file systems that are available. Keywords 1. Block-device File Systems: File system, Buildroot, crosstool-ng, cross-compiler. Those devices whose logical and physical addresses are organized and addressed in terms of blocks are called block 1. INTRODUCTION devices. Most of the file systems are designed for such devices At the core of any operating system, it is apparent that any wherein these devices are treated as a simple linear collection of data is stored as series of 1s & 0s easily conceivable by the blocks irrespective of the underlying disk geometry. Some file machine. With gargantuan amount of data present, file system was systems which fall under this category are variations of the EXT designed as a novel way to organize such data. A file system can FS, VFAT, etc. be defined as a methodology wherein an operating system establishes a set of protocols for keeping track of data and 2. Flash Friendly File Systems: metadata of files on any storage media. In simpler terms, it can be Flash Memory, available in different technological referred to as a directory tree that is used to organize files which variations, is a type of non-volatile memory storage. The two Linux users refer to as the root file system. The term file system most common type of flash devices are the raw flash device can be defined in two different ways (NAND or NOR) and the FTL devices (eMMC, SD, SSD, etc). It can refer to the abstract structure in which files are FTL (Flash Translation Layer) is a software module that emulates named and logically stored in a storage media i.e., it a block device on a raw flash device. The basic difference represents the hierarchical structure in which the between the two device is that an FTL device contains a built-in important system files are organized, also known as the controller that runs a firmware and one or more NAND/NOR root file system (or) chips. Though FTL devices are common these days, most embedded device still use bare flashes without an FTL controller It can refer to the core driver such as UBIfs[10], due to its cost effectiveness and such devices have many special ext2[11] etc which provides the core support for requirements/features such as wear-leveling; erase blocks, garbage implementing the abstraction defined above in the collection etc, which further heightens the need for some sort of operating system/kernel. special file translation layer. The memory technology device The Linux file system architecture can be defined as one of (MTD) subsystem of the Linux provides such a generic interface the perfect epitome of abstracting complexity; in short by for these devices by providing read, write and erase access. File systems such as UBIFS, JFFS2 etc are meant for use on MTDs. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are 3. In-Memory File Systems: not made or distributed for profit or commercial advantage and that copies These file systems can allocate a part of the physical memory to bear this notice and the full citation on the first page. To copy otherwise, be used as a partition. It’s a known fact that the read/write or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. performance on RAM is high compared to other storage devices. Conference’10, Month 1–2, 2010, City, State, Country. There are a number of ways to create a file system in-memory, e.g, Copyright 2010 ACM 1-58113-000-0/00/0010 …$15.00. ramfs, tmpfs, ramdisks etc. 4. User Space File Systems: be used on a different architecture/platform by compiling in the native machine. So the question arises, Why not develop and Such file systems are able to completely reside in the user-space compile natively in Raspberry Pi? The main reason for such a and do not have a compelling need to belong to the kernel. preference is due to the limited RAM and slow speed compared to However these file systems will likely have to interact with the an average PC. In addition, an average PC usually has various kernel VFS and this is made possible by the FUSE (File system in development tools that can ease and speed up the process of USErspace) modules, which does all the transactions on behalf of creating binaries for the target machine (Raspberry Pi). the user applications. Hence any user-space file system has both the kernel and the user space libraries. NTFS-3g is one such user With a myriad of cross compiling tools available, the easiest and space file system. One of the distinct advantages of having a file quickest is to use pre existing compiler tool-chain available [6] or system in user space is that even if the file system were to crash, it to use a custom built toolchain which will be discussed in the might lead to an application crash and prevents any damage to the following section. system as a whole. 2.1 Custom Toolchain Figure 1, illustrates the structure of the file system architecture in A simple toolchain can be set-up using the crosstool-ng available the Linux Kernel. from the project website [3]. This section assumes that the user already knows the HOWTO of setting up a toolchain and provides an overview of the RPi specific configuration. To get the configuration menu for crosstool-ng toolchain run, ct-ng menuconfig. It is highly essential to have the following packages installed for ensuring a smooth cross compiler build process: texinfo, subversion, libtool, automake, g++, flex, gperf, bison, gawk, git, rsync, cmake, ia32-libs. RPi is a 32bit device and hence these libraries help compile binaries as a 32-bit executable, since the native machine used for RPi development could be a 64bit Debian distro. There is a wealth of information available online on how to compile Crosstool-NG toolchain from the project website. The following config options are specific to Raspberry Pi and can be provided in the config menu of the cross-ng toolchain: Target Architecture : arm Endianness : Little Endian Bitness : 32 bit Figure 1: Linux Kernel File System Architecture Target OS : Linux With a variety of file system at hand, the assessment required to Floating Point : Hardware choose one from the list is purely based on the requirements and Select ‘Use EABI’ the system. This document primarily deals with Raspberry Pi platform; an ARM based embedded device. To keep the decision- o Select ‘append ‘hf’ to the tuple’ making process simple for the user, some factors that need Prefix Directory : </your/custom/path/for/install > consideration are Most other configuration can be left to their default values and The type of operating system on the device. run ct-ng build, to create the required binaries. Now all that remains is to export the cross compiler directory to the Linux The type of data and I/O access that the system will environment variable. predominantly encounter. export PATH=$PATH:</your/custom/path/for/bin> The types and the size of storage media. With the cross compiler now set-up, any development code can be A variety of storage media are available, each with its own compiled with the new cross compiled toolchain. characteristics (such as accessibility, volatility, capacity, performance, energy usage, life) and these characteristics form an 3. BUILDROOT important factor in selecting the type of file system to be mounted on the device. 3.1 General Overview Buildroot is a simple tool for automating the process of building a In the following sections will slowly progress step by step by cross compiled Linux system for embedded devices.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us