{"id":20819359,"url":"https://github.com/heeplr/rpi-cookstrap","last_synced_at":"2025-05-07T15:23:29.588Z","repository":{"id":190383441,"uuid":"359259420","full_name":"heeplr/rpi-cookstrap","owner":"heeplr","description":"bake customized raspberry pi sdcard images automatically","archived":false,"fork":false,"pushed_at":"2023-09-02T16:29:39.000Z","size":366,"stargazers_count":15,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T11:21:56.931Z","etag":null,"topics":["bake","bakery","bash","bootstrap","bootstrapping","deploy","deploy-tool","deployment","deployment-automation","disk-image","provisioning","raspberry","raspberry-pi","raspberrypi","raspbian","rpi","rpi-cookstrap"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heeplr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-18T21:47:16.000Z","updated_at":"2025-03-19T09:56:20.000Z","dependencies_parsed_at":"2024-01-02T22:29:57.802Z","dependency_job_id":"82d7aac5-06a4-4b4c-839b-f3bac9384970","html_url":"https://github.com/heeplr/rpi-cookstrap","commit_stats":null,"previous_names":["heeplr/rpi-cookstrap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heeplr%2Frpi-cookstrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heeplr%2Frpi-cookstrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heeplr%2Frpi-cookstrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heeplr%2Frpi-cookstrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heeplr","download_url":"https://codeload.github.com/heeplr/rpi-cookstrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252903281,"owners_count":21822414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bake","bakery","bash","bootstrap","bootstrapping","deploy","deploy-tool","deployment","deployment-automation","disk-image","provisioning","raspberry","raspberry-pi","raspberrypi","raspbian","rpi","rpi-cookstrap"],"created_at":"2024-11-17T22:06:09.982Z","updated_at":"2025-05-07T15:23:29.552Z","avatar_url":"https://github.com/heeplr.png","language":"Shell","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"## RPi CookStrap - [![CI](https://github.com/heeplr/rpi-cookstrap/actions/workflows/main.yml/badge.svg)](https://github.com/heeplr/rpi-cookstrap/actions/workflows/blank.yml)\n\nA shell script to bake raspberry pi OS disk images\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Features\n\n* **versatile** - use plugins to download \u0026 mount image to copy/configure things to do on the first boot/login\n* **lightweight** - written in bash, should run on any POSIX compatible system, no additional installation needed on the pi, configure with any text editor, will delete itself to leave no traces\n* **single shot** - just generate the image on the host and everything else will happen automatically on the first boot (or first login if you choose so)\n* **dynamic** - since the config is a bash script, you can create different images with the same configuration by setting config-values programmatically.\n* **customizable** - do your personal customizations in ~ and use them with every project (e.g. your personal wifi credentials will override wifi credentials that are configured in a project)\n* **interoperable** - uses shellscripts and standard tools\n* **reusable** - [plugins](../../wiki/Doc-Plugins) + [bootstrap.cfg](../../wiki/Doc-Config) are building blocks to bake raspberry pi images\n* **extendable** - plugins can use other [plugins](../../wiki/Doc-Plugins) and can be written easily\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://asciinema.org/a/LMhf6fXg7pGo9J3B51Mgn2GE4?speed=2\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://asciinema.org/a/LMhf6fXg7pGo9J3B51Mgn2GE4.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\nComplete demo of image download, bootstrap, flash and setup on pi login. \n\n(2x speed, most of it is output from apt on the pi, use pause if it's too fast)\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Why?\nIf you work a lot with raspberry pi's, you find yourself repeatedly\ndownloading OS images, customize settings like changing /config.txt,\nset the password, setup network, install packages, copy files etc.\n\nWith rpi-cookstrap you can create \u0026 use building blocks to build your\nfinal image by just running *bootstrap.sh*. When booting or\nlogging in, the image can setup everything by itself non-interactively\n(default) or interactively.\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Quickstart\n\n```\n$ RPI_BOOTSTRAP_PLUGINS=raspbian,password RPI_PASSWORD_PW=secret ./bootstrap.sh\n```\n\nis a minimal example and will download the latest raspbian lite and set the password of the *pi* user to \"secret\".\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Basic usage by example\n\nThe *wifi+upgrade* example will create a working raspbian-lite image without any personal customizations.\nWifi will be configured (with the preset SSID and PSK) and a full upgrade will be perfomed:\n\nThe following will:\n* ...clone rpi-cookstrap\n* ...load the project's *bootstrap.cfg* and download/modify the image accordingly.\n* ...write the freshly baked image to your SD card (replace /dev/sdX with you sdcard)\n\n```\n$ git clone https://github.com/heeplr/rpi-cookstrap\n$ cd rpi-cookstrap/examples/wifi+upgrade\n$ ./bootstrap.sh\n$ dd if=.bootstrap-work/raspbian-lite.img of=/dev/sdX conv=fsync status=progress\n```\n* Then boot raspberry pi with image\n* login as \"pi\" like normal and wait until setup has finished\n   (a line into */home/pi/.bashrc* has been added. It executes the\n   setup script which deletes itself after successful execution)\n\nNow you got a fresh and fully upgraded image. But the wifi is setup with wrong\ncredentials, since *examples/wifi+upgrade/bootstrap.cfg* doesn't\ncontain your wifi's name and password (hopefully).\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Integration into your project\nYou can add rpi-cookstrap into your raspberry project simply by using symbolic links.\ne.g. with a git submodule:\n```\n$ cd my-raspberry-project-image\n$ git submodule add https://github.com/heeplr/rpi-cookstrap bootstrap\n$ ln -s bootstrap/bootstrap.sh bootstrap.sh\n$ ln -s bootstrap/bootstrap-plugins bootstrap-plugins\n```\nThen create bootstrap *bootstrap.cfg* and *bootstrap-dist* in your project directory (s. below).\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Permanent customization\nYou can create a customized config that will always override a project's *bootstrap.cfg*:\nCreate *~/.bootstrap.cfg* and modify according to your needs, for example (comment out to disable):\n```\n# setup WIFI\nRPI_BOOTSTRAP_PLUGINS+=( \"wifi\" )\nRPI_WIFI_SSID=\"yourwifiname\"\nRPI_WIFI_PSK=\"your-secret-password\"\n\n# authorize SSH public key\nRPI_BOOTSTRAP_PLUGINS+=( \"ssh\" )\nRPI_SSH_AUTHORIZE=( \"ssh-ed25519 AAAA... you@host\" )\n\n# set random 24 char PASSWORD for pi user\nRPI_BOOTSTRAP_PLUGINS+=( \"password\" )\nRPI_PASSWORD_PW=( \"$(\u003c /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c24;echo;)\" )\n```\n\nNow if you run ```./bootstrap.sh``` for any project, the image is created with\nyour personal settings.\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Documentation\n\nTry running ```./bootstrap.sh -h``` to list commandline arguments and\n```./bootstrap.sh -p``` to list [plugins](../../wiki/plugins).\n\nFurther documentation [can be found in the wiki](../../wiki/).\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Plugins\nThe wiki has a [list of available plugins](../../wiki/plugins).\nThere's also more [documentation on the general plugin concept](../../wiki/Doc-Plugins).\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# More Examples\nsee [examples/](examples/) for \"complete\" examples and [plugin's](../../wiki/plugins) documentation for plugin specific examples.\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# Troubleshooting\n\nEverything should be straight forward \u0026 verbose. You can always ```rm -rf .bootstrap-work``` to clean up and start over.\nFeel free to file an [issue](https://github.com/heeplr/rpi-cookstrap/issues/new) or even submit a pull request.\n\n\n\u003cdiv style=\"font-size:larger;\"\u003e\u0026#160;\u003c/div\u003e\n\n\n# ToDo\n* lots of stuff still missing (plugins, plugin features)\n* better documentation\n* more examples\n* dry-run mode (output all actions without performing them)\n* more [tests](test/)\n\nContributions welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheeplr%2Frpi-cookstrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheeplr%2Frpi-cookstrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheeplr%2Frpi-cookstrap/lists"}