CodeLabs
  • Introduction
  • Cities
    • Cover
    • Summary
    • Introduction
      • Getting Started
      • Resources
      • Naming Convention
    • Caracol
      • Architecture
        • Intel
        • Operating Systems
        • Hardware Platform
        • Field Requirements
        • Software Development
        • Video Conference Station
          • Applications
          • Entertainment System
            • Services
              • Graphics
              • Video
              • Camera
              • Text To Speech
              • Speech To Text
              • Photography
              • Gaming
                • Super Nintendo Emulators
                • Super Nintendo ROMs
              • Twitter
              • Keyboard
              • Google Drive
              • WiFi
            • Modules
            • Tbd
        • Functionality
        • Bill Of Materials
        • Open Questions
        • Future
    • Chacmultun
      • JHD1313M1
        • Background
          • Inter-Integrated Circuit
          • Linux I2C Subsystem
        • Device Drivers
          • User Space Library UPM
          • User Space Library MRAA
          • User Space I2C Library
          • Kernel Space I2C Driver
    • Chicanna
      • OpenCV
        • Face Recognition
        • Web Streaming
    • Chichen Itza
      • Audio
        • Advanced Linux Sound Architecture
        • PortAudio
        • PyAudio
          • Record
          • Play
      • Text To Speech
        • eSpeak
          • pyttsx
        • VoiceRss
          • VoiceRss Text To Speech Python SDK
      • Speech To Text
        • CMU Sphinx
          • Sphinx Knowledge Base Tool
          • PocketSphinx
          • PyAudio
        • SpeechRecognition
    • Coba
      • Linux Kernel Source Code
        • Git Source Code Management
      • Linux Kernel Development Process
        • A Guide To The Linux Kernel Development Process
        • Challenge
      • Linux Kernel Compilation
      • Linux Kernel Modules
      • Linux Kernel Build System
        • Compilation Kernel Object
        • Compilation Built-In
      • Linux Kernel Patch
        • Patchset
      • Linux Kernel Developer
      • Learn More
    • Dos Pilas
    • Dzibilchaltun
    • Edzna
      • MQ Telemetry Transport
        • MQTT Broker
      • Home Assistant
        • Setup
        • Default Configuration
        • Hello
      • Home Automation
        • Device
          • Light ESP8266
          • Intel Edison
        • Server
          • MQTT
            • Light
            • Sensor
            • Binary Sensor
            • Alarm
          • Dweet
          • Weather
          • Binary Sensor
          • Telegram
          • Camera
          • Automation
      • Shack Automation
        • Configuration Yaml
    • Ek Balam
      • Google Cloud Platform
        • Google API Keys
        • Google Application Default Credentials
      • Google Cloud Translation API
      • Google Cloud Vision API
      • Google Cloud Speech
    • Hochob
      • Introduction
      • Accounts
      • Areas
        • Naming Conventions
      • Digital Media Players
        • Chromecast
      • Keypads
      • Mobile Device
      • Amikoo
        • Architecture
          • Hardware Components
            • Intel® Edison Breakout Board
        • Amikoo
          • Setup
          • Git Repositories
          • Audio
          • Main Intel Edison
          • Main x86
        • Sandbox
          • Tbd
      • Server
        • Setup
          • Root
          • PulseAudio
        • Architecture
        • Media
        • Services
          • Automation
            • Home Assistant
              • Setup
          • Calendar
          • Camera
          • Communications
          • Games
            • Loteria Mexicana
            • Caras Y Gestos
            • Sopa De Letras
          • Image
          • Institution
          • Keypad
          • Messaging
          • Motion
          • Robot
          • Sound
            • Play
            • Speech Synthetizer
          • Stream
          • Usb
          • Survey
        • Applications
          • Captain Maya Lands
          • Southern Maya Highlands
          • Amikoo Maya Lands
          • Central Maya Lowlands
          • Northern Maya Lowlands
          • Console Maya Lands
          • Media Maya Lands
          • Calendar Maya Lands
          • Tradition Maya Lands
          • Techie Maya Lands
          • NohochTata Maya Lands
      • Stations
      • Architecture
      • Release Notes
        • v0.1
        • v0.2
    • Hormiguero
    • Kaminaljuyu
      • WRI Workshop
        • Environmental Protection Agency
      • Arquitecture
        • Bill Of Materials
      • Intel
    • Kanki
      • Device
      • Gateway
    • Kinich KaK Moo
    • Kohunlich
    • La Ruta Puuc
    • Mayapan
    • Mixco Viejo
    • Muyil
    • Palenque
    • Qumarkaj
      • Amazon
      • Amazon Echo
        • Lifx
        • IFTTT
      • Amazon Alexa
        • Alexa Skills Kit
          • Training: Developing Alexa Skills - Hello, Alexa!
          • Training: Alexa - A Free Introduction
          • Projects
            • Intel GDC Visitor Center
              • Cloudy
              • Geek
              • Trivia
              • Kit
            • Voice Control Intel Edison
        • Alexa Voice Service
          • Intel Edison
    • Seibal
    • Tabasqueno
    • Tikal
      • Mexican Red Cross
      • Emergency Medical Services
        • Prehospital Care Strategies
      • Intel
      • Bitalino
      • My Signals
      • Architecture
        • Objectives
    • Tulum
      • Introduction
      • Device
        • Development Board
        • Telegram Bot
        • Bootup
        • Text Editors
        • Setup
        • Main
        • IoT101 Inc
        • Mqtt Clients
        • Sensors
      • Server
        • Setup
        • Dashboard
        • Mqtt Broker
      • Challenge
    • Uxmal
    • Xcambo
    • Xpuhil
    • Xunantunich
    • Sandbox
      • Text To Speech
      • Face Recognition Web Streaming
      • Web Server Flask
      • Speech To Text
      • Image Webpage Flask
      • Audio Capture Playback
      • Image Capture OpenCV
    • Tbd
      • Tbd
      • Linux Kernel Architecture
      • Linux Kernel Device Drivers
      • Tbd
  • Gods
    • Acat
      • Node-RED
        • Installation
          • General
          • Base
          • Npm Packages
          • Node-RED Packages
        • Autostart
      • Projects
        • GPIO
        • MQTT
        • Intel GDC Visitor Center
      • Sandbox
    • Ah Puch
      • Recon Instruments
        • ReconJet
          • Get Started
        • ReconEngage
        • Uplink
        • Intel Developer Zone
          • Recon Dev Kit for Jet™
      • Bicycles
    • Akna
      • Hardware
        • Intel Edison
        • Sphero
        • Bluetooth Dongle
      • Software
        • Javascript
        • Cylon.js
          • Cylon.js Intel Edison
          • Cylon.js Intel Edison Sphero
            • Examples
        • Sphero Linux API
    • Alom
    • Bacab
      • Getting Started
        • Inventory
        • Accounts
        • Software
      • Proof Of Concepts
        • Doorbell
    • Bitol
      • Drone Software Development Environment
        • PX4
        • JMAVSim
        • Ardupilot
        • SITL Simulator
        • DroneKit
        • QGroundControl
        • MAVLink
        • OpenCV
        • Git Source Code Management
      • Drone Solution Architect
        • Companies
      • Dronecode Project
      • Base Drone Solution
        • Flight Controller Hardware
          • PixHawk
          • Intel® Aero Ready to Fly Drone
          • Emlid
          • Erle Brain
        • Flight Controller Operating System
        • Autopilot
          • Px4
            • Architecture
              • NuttX
              • DriverFramework
            • Shell
          • Ardupilot
          • Software In The Loop
            • jMAVSim
            • DroneKit SITL
        • Communications
          • Mavlink
            • PyMAVLink
        • Ground Control Station
          • QGroundControl
        • Developer APIs
      • Hybrid Drone Solution
      • Autonomous Drone Solution
      • Drone Solutions
        • Erle Robotics
        • Emlid
      • Training
        • Drone Solution Architect
          • Demos
            • Ka’an
            • Múuyal
            • lik’
            • Chak iik’
    • Chaac
    • Bolon Ts'akab
    • Buluc Chabtan
      • Challenge
    • Chaac Uayab Xoc
    • Cacoch
      • Background
        • Open Source
        • Do It Yourself Communities
      • The Project
        • History
        • Career Profile
        • Education Strategy
        • Courses
        • Infrastructure
Powered by GitBook
On this page
  • Shell Scripting
  • Script Arguments
  • Processing
  • Pre Processing
  • Post Processing
  • Results
  1. Cities
  2. Coba
  3. Linux Kernel Development Process

Challenge

Shell Scripting

Objective: Shell scripting is a basic skill every Linux developer has Proficiency Level: Advanced

We require a script to do some "processing" for every kernel released:

  • First, make it work

  • Second, optimize it

We need the following working directory structure

    ...
    |- LinuxKernelDevelopmentProcessChallenge
      |- kernelimages  (directory)
      |- preworkspace  (directory)
      |- postworksapce (directory)
      |- main.sh (our script)
      |- stats.pre (text file)
      |- stats.post (text file)
      |- intel.contributors (text file)

Script Arguments

The script will receive 3 arguments: the file location, version of the kernel and the file type

user $ myscript.sh <internet/local> <x.x.xx> <xz|gz>

If file location is the internet then use this repository to grab the kernel tar file:

  • and download it to kernelimages directory.

If file location is local then use kernelimages directory to grab the kernel tar file

Processing

We will gather statistics and do some work in 2 phases, right after we have decompressed the kernel file under the preworkspace directory and after we make some changes to its directory structure under postworkspace, statistics will be populated in 2 different files under our top working directory, their names will be:

  1. stats.pre

  2. stats.post

Pre Processing

Take kernel image from kernelimages directory and decompress under the preworkspace directory. We will require the following information under stats.pre files:

File Names

# of README* (files as README.Locking also count)
# of Kconfig
# of Kbuild
# of Makefiles
# of .c files
# of .h files
# of .pl files
# of others files
Total number of files

File Content

# of ocurrences for Linus
# of directories found under arch/
# of ocurrences for kernel_start
# of ocurrences for __init
# of files in its filename containing the word gpio
# of ocurrences for #include <linux/module.h>

Some Tasks To Do

Sort in alphabetical order all the inclusion of libraries using this format #include only under drivers/i2c/ directory, please make sure you identify all files you have modified, you will need their identity in the post processing phase

Let's populate our file called intel.contributors under our top level working directory directory, search for all Intel contributors matching @intel.com and identify the file where their name was located, then write one line per contributor, cannot be repeated e.g.

Path/to/file.c | Sara Sharp
Path/to/file.c | Darren Hart

Post Processing

Create 3 directories under postworkspace and move all files from preworkspace where kernel was decompressed according to the file extensions:

files_c, all .c files
files_h, all .h files
files_others, all other files

In all 3 directories, if we have files with the same name, add a number as identifier that will increase by 1 as required, e.g.

README_1
README_2

Some Tasks To Do

  1. Add your name to the beginning, middle and end of every .c file

  2. In all files substitute #include for every #include found

  3. Fix your #include's order for the files coming from driver/i2c

We will need the following information under stats.post files:

File Names

# of READMEs
# of Kconfig
# of Kbuild
# of Makefiles
# of .c files
# of .h files
# of .pl files
# of others files
Total number of files

File Content

# of ocurrences having "Linus" string
# of ocurrences having "kernel_start" string
# of ocurrences having "__init" string
# of files in its filename containing the word "gpio"
# of ocurrences having "#include <linux/module.h>"
# of ocurrences having "#include <linux/learningscripting.h>"

Results

A message of Pass / Fail should be printed to stdout for each of the following:

  • Our Total number of files is the same in both stats.pre and stats.post

PreviousA Guide To The Linux Kernel Development ProcessNextLinux Kernel Compilation

Last updated 7 years ago

https://www.kernel.org/pub/linux/kernel/v4.x/