GithubHelp home page GithubHelp logo

tgerring / custompios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guysoft/custompios

0.0 1.0 0.0 633 KB

A Raspberry Pi and other ARM devices distribution builder

License: GNU General Public License v3.0

Dockerfile 0.82% Shell 93.67% Ruby 1.26% Python 4.25%

custompios's Introduction

CustomPiOS

A Raspberry Pi and other ARM devices distribution builder. CustomPiOS opens an already existing image, modifies it and repackages the image ready to ship.

This repository contains the source script to generate a distribution out of an existing Raspbian distro image, or Armbian devices.

Where to get it?

Clone this repo. Then follow instructions either to build an existing distro or create your own.

How to use it?

  1. Clone this image git clone https://github.com/guysoft/CustomPiOS.git
  2. Run src/make_custom_pi_os -g <distro folder> in the repo, distro folder should not exist and contain no spaces. This will both create a folder to build a new distro from, and also download the latest raspbian lite image. The initial distro has a module that has the name of your distro, and you can find it under <distro folder>/src/modules/<distro name> (there should be only one module in the modules folder).
  3. cd to <distro folder>/src
  4. Edit your <distro folder>/src/config, you can also edit the starting module, which is named as your distro at modules/<dstro name>. More on that in the Developing section.
  5. Run <distro folder>/src/build_dist to build an image. If this fails use the method described in the vagrant build section (which makes sure sfdisk and other things work right).

Features

  • Modules - write one module and use it for multiple distros
  • Write only the code you need for your distro - no need to maintain complicated stuff like building kernels unless its actually want to do it
  • Standard modules give extra functionality out of the box
  • Supports over 40 embedded devices using Armbian and Raspbian.

Developing

Requirements

  1. qemu-arm-static
  2. Downloaded Raspbian image.
  3. root privileges for chroot
  4. Bash
  5. git
  6. realpath
  7. sudo (the script itself calls it, running as root without sudo won't work)
  8. p7zip-full
  9. Python 3.2+

Known to work building configurations

  1. Linux (Ubuntu / Debian etc)
  2. OS X - See this thread for information

Modules

See Modules entry in wiki

chroot_script

This is where the stuff you want to execute inside the distro is written.

In start_chroot_script write the main code, you can use end_chroot_script to write cleanup functions, that are run at the end of the module namespace.

Useful commands from common.sh

CustomPiOS comes with a script common.sh that has useful functions you can use inside your chroot_script. To use it you can add to your script source /common.sh.

unpack [from_filesystem] [destination] [owner] - Lets you unpack files from the filesystem folder to a given destination. [owner] lets you set which user is going to be the owner. eg. unpack /filesystem/home/pi /home/pi pi

gitclone <MODULE_NAME>_<REPO_NAME>_REPO destination - Lets you clone a git repo, and have the settings preset in the config file. Example usage in OCTOPI module.

In chroot_script:

gitclone OCTOPI_OCTOPRINT_REPO OctoPrint

In config:

[ -n "$OCTOPI_OCTOPRINT_REPO_SHIP" ] || OCTOPI_OCTOPRINT_REPO_SHIP=https://github.com/foosel/OctoPrint.git 

Export files from image

CustomPiOS has a feature to export files created in the chroot to archives you can ship as a tar.gz arcive.

To export run inside of a chroot_script: custompios_export [name of archive] [file path in chroot]

You can also use: copy_and_export [name of archive] [source] [destination]

and: copy_and_export_folder [name of archive] [folder] [destination]

The results would be saved in the workspace folder.

filesystem

Lets you add files to your distro, and save them to the repo. The files can be unpacked using the unpack command that is in common.sh.

config

This is where you can create module-specific settings. They can then be overwritten in a distro or variant. The naming convention is the module name in

Build a Distro From within Raspbian / Debian / Ubuntu / CustomPiOS Distros

See building entry in wiki

Building Distro Variants

See building entry in wiki

Building Using Docker

See Building with docker entry in wiki

Building Using Vagrant

See Building with Vagrant entry in wiki

Usage

  1. If needed, override existing config settings by creating a new file src/config.local. You can override all settings found in src/config. If you need to override the path to the Raspbian image to use for building your distro, override the path to be used in BASE_ZIP_IMG, which is part of the base module. By default the most recent file matching *-raspbian.zip found in src/image will be used.
  2. Run src/build as root.
  3. The final image will be created at the src/workspace

List of Distributions using CustomPiOS

  • OctoPi - The ready-to-go Raspberry Pi image with OctoPrint
  • FullPageOS - A raspberrypi distro to display a full page browser on boot
  • ElectricSheepPi - A Raspberry Pi distribution to run Electric Sheep digital art
  • AlarmPi - A Raspberry Pi distribution that turns a raspberrypi to an IOT telegram-controlled alarm clock
  • RealtimePi - An out-of-the-box raspebrrypi/raspbian distro with a realtime kernel
  • RMS Pi - Raspberry Pi Distro for Winlink RMS
  • V1PI - Use your raspberry pi to control your V1Engineering machine
  • HotSpotOS - Makes a Raspberrypi start a hotspot, if no wifi was found to conenct to

Code contribution would be appreciated!

custompios's People

Contributors

alan707 avatar arekm avatar brad avatar dcousens avatar deviousfusion avatar foosel avatar guillaumemolter avatar guysoft avatar hroncok avatar inthecloud247 avatar jeffeb3 avatar jofemodo avatar jonaslorander avatar kennethjiang avatar magicmad avatar maitredede avatar make-ing avatar mariogrip avatar nosyjoe avatar nurgak avatar pantsmanuk avatar theassassin avatar thelastproject avatar vivekanand1101 avatar zarya avatar

Watchers

 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.