• Stars
    star
    502
  • Rank 87,851 (Top 2 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Raspberry Pi and other ARM devices distribution builder

CustomPiOS

https://raw.githubusercontent.com/guysoft/CustomPiOS/devel/media/CustomPiOS.png

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.

Donate

CustomPiOS is 100% free and open source and maintained by Guy Sheffer. If its helping your life, your organisation or makes you happy, please consider making a donation. It means I can code more and worry less about my balance. Any amount counts. Also many thanks to people contributing code.

paypal

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 sudo ./<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.
  • Supports Raspberry Pi OS arm64 bit using the raspios_lite_arm64 variant.

Developing

Requirements

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

Known to work building configurations

  1. Using the CustomPiOS docker image
  2. Linux (Ubuntu / Debian / Gentoo etc)
  3. 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. e.g. 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 archive.

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

Build using CI/CD

You can build CustomPiOS images from a continuous integration system in the cloud. For an example on how to do this on github take a look at this github actions yaml

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

Community

discord

List of Distributions using CustomPiOS

  • OctoPi - The ready-to-go Raspberry Pi image with OctoPrint
  • FarmPi - An Ubuntu ARM 64bit Raspbery Pi image running OctoFarm
  • FullPageOS - A Raspberry Pi distro to display a full page browser on boot
  • Zynthian - Open Synth Platform
  • ElectricSheepPi - A Raspberry Pi distribution to run Electric Sheep digital art
  • AlarmPi - A Raspberry Pi distribution that turns a Raspberry Pi to an IOT telegram-controlled alarm clock
  • RealtimePi - An out-of-the-box Raspebrry Pi/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 Raspberry Pi start a hotspot, if no wifi was found to connect to
  • MtigOS - Distro that lets you receive, store and graph sensor information from ESP8266 chips. It uses and MTIG stack: Mosquitto, Telegraf, InfluxDB and Grafana which are all pre-configured to work together. They automatically update using Docker.
  • Tilti-Pi - Distro that lets you submit BLE data for the tilt hydrometer via the tilty package and a built in dashboard
  • MainsailOS - Distro that packages the Mainsail web UI, the Moonraker API, and the Klipper 3D printer firmware in an easy to package.
  • UbuntuDockerPi - Distro ships with Ubuntu ARM 64bit Docker and docker-compose ready to build stuff for arm64v8/aarch64 or host whatever you like.
  • FluiddPi - Distro that packages Fluidd, Moonraker, and Klipper into the ultimate 3D printer firmware package.
  • My Naturewatch Camera - A Python / OpenCV camera server to stream Pi camera content to a remote client through a website.
  • PiFireOS - Distro for pellet grill/smoker control, running PiFire.
  • MonsterPi - An Ubuntu ARM 64bit Raspbery Pi image running FDM Monster. This 3D Print server will help you connect 200+ OctoPrints together while providing a strong, professional workflow.

Code contribution would be appreciated!

More Repositories

1

FullPageOS

A raspberrypi distro to display a full page browser on boot
Shell
3,857
star
2

OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
Shell
2,461
star
3

MagicMirrorOS

MagicMirrorOS out-of-the-box distro
Shell
224
star
4

RealtimePi

An out-of-the-box raspebrrypi/raspbian distro with a realtime kernel
Shell
138
star
5

OctoKlipperPi

OctoPi klipper using the CustoPiZer distro builder
Shell
84
star
6

UbuntuDockerPi

Ready to use 64bit ARM Docker for Raspberry Pi running on Ubuntu
Shell
44
star
7

ElectricSheepPi

A Raspberry Pi distribution to to run Electric Sheep
Shell
37
star
8

PleromaPi

RaspberryPi / CustomPiOS distro that run Pleroma out of the box
Shell
35
star
9

HotSpotOS

Raspberry Pi OS that starts a hotspot, if no wifi was found to conenct to
Shell
34
star
10

PhotoPrismPi

An out of the box Raspberry distro based on Ubuntu with PhotoPrism installed
Shell
25
star
11

AlarmBot

A telegram bot that serves as an alarm clock, runs best on a RaspberryPi
Python
23
star
12

SMS-Twitter-Gate

SMS to twitter gate server, using only cheap phones and a computer
Python
21
star
13

ZynthianOS

Disto to build a Zynthian image ready to ship
Shell
19
star
14

MtigOS

Raspberry Pi distro that lets you receive, store and graph sensor information from ESP8266 chips
Shell
14
star
15

fedigroup

A federated simple group
Python
13
star
16

3arabi

A translator for arabic chat
10
star
17

BackupFriendPi

A raspsberrypi distro you can put in your friend's house, or anywhere else, and it will let you backup your computer with history
Shell
9
star
18

LibrePhotosOS

An out of the box Raspberry Pi distro with LibrePhotos installed.
Shell
9
star
19

AlarmPi

A Raspberry Pi distribution that turns your Pi in to an IOT telegram-controlled alarm clock
Shell
9
star
20

BackupFriend-docker

Docker for RaspberryPi distro that lets backup your stuff to a friend
Shell
8
star
21

backupfriend-client

Backupfriend wx widgets client
Python
8
star
22

Raspbian64

An out of the box Raspbian distro with a 64bit chroot with docker.
Shell
8
star
23

midistrum

An app to use android's native midi system to create an omnichord/auto harp-like strum instrument. It also made me port native midi to kivy
Python
7
star
24

mod-ui-docker

Docker container that attaches to jack and runs mod-ui
Dockerfile
6
star
25

Mqtt_Wifi_manager

End to end, working moisture sensor, no need to solder, no hardcoded stuff, can be configured by pressing the reset button sevral times
C++
6
star
26

aax_to_mp3_splitter

Take mp3 files created from AAX2MP2, and text created from AudibleChapters and split accordingly
Python
5
star
27

PowerBeatsVR_song_writer

Convert a beats saber song to a powerbeats vr song
Python
5
star
28

Twitter-Status

Set your pidgin status from your twitter feed
Perl
4
star
29

pytorch-docker-armv7

pytorch for RaspberryPi
Dockerfile
4
star
30

pi-imager-web

Serve the pi-imager images list
Python
4
star
31

thedoorks

Hackathon project to detect doors in construction plans
Python
4
star
32

OctoPi-Klipper-CustomPiOS

Scripts to build OctoPi-Klipper, a Raspberry PI distro for controlling 3D printers over the web using OctoPrint and the Klipper firmware
Shell
4
star
33

EnergySource

Energy Source Godot Jam project
GDScript
4
star
34

unofficialpi

unofficialpi CI/CD scripts
Python
3
star
35

DiagHam

Port form svn repo of DiagHam from http://www.nick-ux.org/diagham/
C++
3
star
36

GPageCache

A small simple webpage cacher for webservers
PHP
3
star
37

shapedo

3D diff engine
JavaScript
3
star
38

SvxLinkWrapper

Wrapper for SvxLink to provide additional functionally, which is easy to extend
Python
3
star
39

Chrome-Extension-Modifier

A program used to patch Chrome extensions. For now it patches TweetDeck to support Right-to-Left languages
Python
3
star
40

guysoft

2
star
41

ownphotos-proxy

Simple proxy to handle ownphotos backend and frontend
Dockerfile
2
star
42

pi-gen-nightly

Scripts to make nightly builds Raspbian-lite image
Shell
2
star
43

Group-SMS-Manager

A system to send and handle incoming SMS on a range of Israeli service suppliers, and also cheap hardware
2
star
44

kivy-external-storage-permission

test kivy new external storage permission
Python
2
star
45

CraftBeerPiOS

RaspberryPi distro that runs CraftBeerPi out of the box
Shell
2
star
46

pyTwitterBot

A twitter bot written in python
Python
2
star
47

recycle_app_israel

This is a simple app to view all the electronics recycle location in israel
Python
2
star
48

ownphotos-client

A python package to interact with ownphotos api backend
Python
2
star
49

cyborg_ear_trainer

A tool to train people to hear using a cochlear implant
Python
2
star
50

Ockle

An autumated extendable PDUs and servers management system
Python
2
star
51

pytorch-build-arm

Docker container ot build pytorch for arm used in LibrePhotos
Shell
1
star
52

picturfy

Turn HTML webpages to PNG images
Python
1
star
53

docker-mtig

MTIG - Docker compose stack for Mosquitto Telegraf Influxdb and Grafana
1
star
54

p4a-build-spaces

A script for build & test environments to be used for building python-for-android apps. Uses docker.
Python
1
star
55

stale_mount_checker

Shameless copy of python-spam-module example in python docs modified to check if a filesystem is stale
C++
1
star
56

wikipedia_read_bot

A telegram bot that lets you look up wikipedia articles
Python
1
star
57

Twitter-Hivemind

A source to build a hivemind twitter service, that retweets a single acocunt
Python
1
star
58

abusive-internet

An access point that abuses the user, uses a raspberry pi and geekcon magic
1
star