Code Monkey home page Code Monkey logo

raspberry-packer_scripts's Introduction

Packer-RaspberryPi

Untended system preparation using Packer and Qemu

A pre-configured .img and .raw system image of a raspbian system (debian for raspberry pi forkor a tpibunti - self-made version of ubuntu) created using an automatic packer builder software solution.

Requirements

Technical

The software uses an virtualization/emulation interpreter, which requires a real machine or a virtualbox/vmware machine with graphical desktop. Command line dockerized systems won't work for computations.

Software

  • qemu - QuickEmulat- vagrant - ion software that support various processor architectures, including the ARM on which the RPI (Raspberry PI) is build - http://wiki.qemu.org/Main_Page
  • alsa-utils - A Linux library for sound drivers which are required for the RPI, as diodes and buzzers are the low-level debug elements
  • xorg-dev - Development pack or Xorg graphic, allows to launc the emulator in the SDL (Simple DirectMedia Layer - https://www.libsdl.org/)
  • packer - Autonomous software for building system images - https://www.packer.io/intro
  • kernel - A micro linux kernel which serves the Qemu as the acceleration device. It is preconfigured and added to the stash. Tinkering with it is not advised.
  • initrd - Initial RAM Dump that is read into the emulated system.

Usage

The solutions was created with both automatic and manual purpose in mind, therefore it is possible to launch it locally, without downloading the base image. This is possible due to a flexible command line parameters:

	"variables": {
                    "password_acc": "hybris",
                    "sum_local": "temporary",
                    "url_local": "temporary",
                    "user_acc": "hybris",
                    "display" : "none",
                    "kernel" : "kernelfile",
                    "initrd": "initrdfile"
                }

Access to the parameters is possible due the variableFileBuilder script which creates the variables.json file used to read the attribtues

	./variableFileBuilder.sh /path/to/Image /path/to/kernel /path/to/initrd display
	packer build -var-file=variables.json Buildfile.json

Variables generation

The most important variables (system image location, system image checksum, kernel location) are generated by the variableFileBuilder script, which takes the information : image, kernel and creates a json file with the needed data. The script outputs the json file accordingly:

	cat << EOF > variables.json
	{
		"url_local": "$image",
		"sum_local": "$sum",
		"kernel": "$kernel",
		"display": "$display",
		"initrd": "$initrd"
	}
	EOF

Jenkins integration

The solutions is used within an Jenkins integration server (https://jenkins-ci.org/) which build downloads the original, clean raspbian image, then opens it using the qemu, tinkers applying the scripts from the scripts folder as well as substitutes files from the files directory. After this is done the changes are saved to the downloaded image (.img file) as well as a backup is created (.raw file). Both are valid for use as virtual systems as well as installation on real hardware.

raspberry-packer_scripts's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.