{"id":17271991,"url":"https://github.com/pndurette/pi-packer","last_synced_at":"2025-04-14T08:41:55.522Z","repository":{"id":43907457,"uuid":"383003611","full_name":"pndurette/pi-packer","owner":"pndurette","description":"An opinionated HashiCorp Packer template with integrated cloud-init to build 'cloud instances-like' images for Raspberry Pi","archived":false,"fork":false,"pushed_at":"2023-05-25T16:29:28.000Z","size":37,"stargazers_count":25,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T08:11:18.331Z","etag":null,"topics":["cloud","cloud-init","packer","packer-template","raspberry-pi","raspberrypi"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pndurette.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}},"created_at":"2021-07-05T03:33:17.000Z","updated_at":"2024-11-24T22:23:09.000Z","dependencies_parsed_at":"2023-01-19T01:45:44.248Z","dependency_job_id":null,"html_url":"https://github.com/pndurette/pi-packer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpi-packer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpi-packer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpi-packer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpi-packer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pndurette","download_url":"https://codeload.github.com/pndurette/pi-packer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248849189,"owners_count":21171539,"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":["cloud","cloud-init","packer","packer-template","raspberry-pi","raspberrypi"],"created_at":"2024-10-15T08:47:31.417Z","updated_at":"2025-04-14T08:41:55.503Z","avatar_url":"https://github.com/pndurette.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# pi-packer\n\nAn opinionated [HashiCorp Packer](https://www.packer.io) template for Raspberry Pi images, built around the [`packer-builder-arm`](https://github.com/mkaczanowski/packer-builder-arm) ARM Packer builder plugin. It implements [cloud-init](https://cloudinit.readthedocs.io/en/latest/index.html) for last-mile OS configuration and management.\n\nSee [`pi.pkr.hcl`](pi.pkr.hcl).\n\n## Usage\n\n### 1. Configuration values\n\nCopy [`example.pkrvars.hcl`](example.pkrvars.hcl) and edit.\n\n*(See [Packer docs](https://www.packer.io/docs/templates/hcl_templates/variables#assigning-values-to-build-variables) for more ways to set input variables)*\n\n### 2. Build\n\n(e.g. using [`usb-gadget/usb_gadget.pkrvars.hcl`](usb-gadget/usb\\_gadget.pkrvars.hcl))\n```bash\ndocker run --rm --privileged \\\n    -v /dev:/dev \\\n    -v ${PWD}:/build \\\n    mkaczanowski/packer-builder-arm \\\n        build \\\n        -var-file=usb-gadget/usb_gadget.pkrvars.hcl \\\n        -var \"git_repo=$(git remote get-url origin)\" \\\n        -var \"git_commit=$(git rev-parse HEAD)\" \\\n        pi.pkr.hcl\n```\n*(Using the above Docker image and run command is the easiest way to build cross-platform ARM images. See [`packer-builder-arm`](https://github.com/mkaczanowski/packer-builder-arm#quick-start) for alternative ways to run Packer with the `packer-builder-arm` plugin)*\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_boot_cmdline\"\u003e\u003c/a\u003e [boot\\_cmdline](#input\\_boot\\_cmdline) | [`/boot/cmdline.txt`](https://www.raspberrypi.org/documentation/configuration/cmdline-txt.md) config.\u003cbr\u003e    \u003cbr\u003eLinux kernel boot parameters, as a list. Will be joined as a space-delimited string.\u003cbr\u003e\u003cbr\u003ee.g.:\u003cpre\u003eboot_cmdline = [\u003cbr\u003e    \"abc\",\u003cbr\u003e    \"def\"\u003cbr\u003e]\u003c/pre\u003eWill create `/boot/cmdline.txt` as\u003cpre\u003eabc def\u003c/pre\u003e | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"console=serial0,115200\",\u003cbr\u003e  \"console=tty1\",\u003cbr\u003e  \"root=/dev/mmcblk0p2\",\u003cbr\u003e  \"rootfstype=ext4\",\u003cbr\u003e  \"elevator=deadline\",\u003cbr\u003e  \"fsck.repair=yes\",\u003cbr\u003e  \"rootwait\",\u003cbr\u003e  \"quiet\",\u003cbr\u003e  \"init=/usr/lib/raspi-config/init_resize.sh\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_boot_config\"\u003e\u003c/a\u003e [boot\\_config](#input\\_boot\\_config) | [`/boot/config.txt`](https://www.raspberrypi.org/documentation/configuration/config-txt/README.md)\u003cbr\u003e\u003cbr\u003eRaspberry Pi system configuration, as a list. Will be joined by newlines.\u003cbr\u003e\u003cbr\u003ee.g.:\u003cpre\u003eboot_cmdline = [\u003cbr\u003e    \"abc=123\",\u003cbr\u003e    \"def=456\"\u003cbr\u003e]\u003c/pre\u003eWill begin `/boot/config.txt` with:\u003cpre\u003eabc=123\u003cbr\u003edef=456\u003c/pre\u003e | `list(string)` | `[]` | no |\n| \u003ca name=\"input_boot_config_filters\"\u003e\u003c/a\u003e [boot\\_config\\_filters](#input\\_boot\\_config\\_filters) | [`/boot/config.txt`](ttps://www.raspberrypi.org/documentation/configuration/config-txt/conditional.md)\u003cbr\u003e\u003cbr\u003eRaspberry Pi system *conditional filters* configuration, as a list.\u003cbr\u003e\u003cbr\u003ee.g.:\u003cpre\u003eboot_config_filters = [\u003cbr\u003e    [\u003cbr\u003e        \"[pi0]\",\u003cbr\u003e        \"jhi=123\",\u003cbr\u003e        \"klm=456\"\u003cbr\u003e    ],\u003cbr\u003e    [\u003cbr\u003e        \"[pi0w]\",\u003cbr\u003e        \"xzy\",\u003cbr\u003e        \"123\"\u003cbr\u003e    ],\u003cbr\u003e]\u003c/pre\u003eWill end `/boot/config.txt` with:\u003cpre\u003e[pi0]\u003cbr\u003ejhi=123\u003cbr\u003eklm=456\u003cbr\u003e[pi0w]\u003cbr\u003exyz\u003cbr\u003e123\u003c/pre\u003e | `list(list(string))` | \u003cpre\u003e[\u003cbr\u003e  [\u003cbr\u003e    \"[pi4]\",\u003cbr\u003e    \"dtoverlay=vc4-fkms-v3d\",\u003cbr\u003e    \"max_framebuffers=2\"\u003cbr\u003e  ]\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_cloudinit_metadata_file\"\u003e\u003c/a\u003e [cloudinit\\_metadata\\_file](#input\\_cloudinit\\_metadata\\_file) | The local path to a cloud-init metadata file.\u003cbr\u003e    \u003cbr\u003eSee the `cloud-init` [`NoCloud` datasource](https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html) | `string` | n/a | yes |\n| \u003ca name=\"input_cloudinit_userdata_file\"\u003e\u003c/a\u003e [cloudinit\\_userdata\\_file](#input\\_cloudinit\\_userdata\\_file) | The local path to a cloud-init userdata file.\u003cbr\u003e    \u003cbr\u003eSee the `cloud-init` [`NoCloud` datasource](https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html) | `string` | n/a | yes |\n| \u003ca name=\"input_file_checksum\"\u003e\u003c/a\u003e [file\\_checksum](#input\\_file\\_checksum) | The checksum value of `file_url`.\u003cbr\u003e\u003cbr\u003eSee [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm#remote-file). | `string` | `\"\"` | no |\n| \u003ca name=\"input_file_checksum_type\"\u003e\u003c/a\u003e [file\\_checksum\\_type](#input\\_file\\_checksum\\_type) | The checksum type of `file_checksum_url`.\u003cbr\u003e    \u003cbr\u003eSee [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm#remote-file). | `string` | `\"sha256\"` | no |\n| \u003ca name=\"input_file_checksum_url\"\u003e\u003c/a\u003e [file\\_checksum\\_url](#input\\_file\\_checksum\\_url) | The checksum file URL of `file_url`.\u003cbr\u003e    \u003cbr\u003eSee [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm#remote-file). | `string` | `\"\"` | no |\n| \u003ca name=\"input_file_target_extension\"\u003e\u003c/a\u003e [file\\_target\\_extension](#input\\_file\\_target\\_extension) | The file extension of `file_url`.\u003cbr\u003e    \u003cbr\u003eSee [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm#remote-file). | `string` | `\"zip\"` | no |\n| \u003ca name=\"input_file_url\"\u003e\u003c/a\u003e [file\\_url](#input\\_file\\_url) | The URL of the OS image file.\u003cbr\u003e    \u003cbr\u003eSee [packer-builder-arm](https://github.com/mkaczanowski/packer-builder-arm#remote-file). | `string` | n/a | yes |\n| \u003ca name=\"input_git_commit\"\u003e\u003c/a\u003e [git\\_commit](#input\\_git\\_commit) | The current git commit to pass to the build. It will be prepended to `/boot/config.txt`\u003cbr\u003e\u003cbr\u003eUse on the command-line, i.e. `-var \"git_commit=$(git rev-parse HEAD)\"` | `string` | `\"\"` | no |\n| \u003ca name=\"input_git_repo\"\u003e\u003c/a\u003e [git\\_repo](#input\\_git\\_repo) | The current git remote to pass to the build. It will be prepended to `/boot/config.txt`\u003cbr\u003e\u003cbr\u003eUse on the command-line, i.e. `-var \"git_repo=$(git remote get-url origin)\" ` | `string` | `\"\"` | no |\n| \u003ca name=\"input_image_path\"\u003e\u003c/a\u003e [image\\_path](#input\\_image\\_path) | The file path the new OS image to create. | `string` | n/a | yes |\n| \u003ca name=\"input_kernel_modules\"\u003e\u003c/a\u003e [kernel\\_modules](#input\\_kernel\\_modules) | List of Linux kernel modules to enable, as seen in `/etc/modules` | `list(string)` | `[]` | no |\n| \u003ca name=\"input_locales\"\u003e\u003c/a\u003e [locales](#input\\_locales) | List of locales to generate, as seen in `/etc/locale.gen`. | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"en_CA.UTF-8 UTF-8\",\u003cbr\u003e  \"en_US.UTF-8 UTF-8\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_wpa_supplicant_country\"\u003e\u003c/a\u003e [wpa\\_supplicant\\_country](#input\\_wpa\\_supplicant\\_country) | The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code in which the device is operating.\u003cbr\u003e    \u003cbr\u003eRequired by the wpa\\_supplicant. | `string` | `\"CA\"` | no |\n| \u003ca name=\"input_wpa_supplicant_enabled\"\u003e\u003c/a\u003e [wpa\\_supplicant\\_enabled](#input\\_wpa\\_supplicant\\_enabled) | Create a [`wpa_supplicant.conf` file](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md) on the image.\u003cbr\u003e    \u003cbr\u003eIf `wpa_supplicant_path` exists, it will be copied to the OS image, otherwise a basic `wpa_supplicant.conf` file will be created using `wpa_supplicant_ssid`, `wpa_supplicant_pass` and `wpa_supplicant_country`. | `bool` | `true` | no |\n| \u003ca name=\"input_wpa_supplicant_pass\"\u003e\u003c/a\u003e [wpa\\_supplicant\\_pass](#input\\_wpa\\_supplicant\\_pass) | The WiFi password. | `string` | `\"\"` | no |\n| \u003ca name=\"input_wpa_supplicant_path\"\u003e\u003c/a\u003e [wpa\\_supplicant\\_path](#input\\_wpa\\_supplicant\\_path) | The local path to existing `wpa_supplicant.conf` to copy to the image. | `string` | `\"/tmp/dummy\"` | no |\n| \u003ca name=\"input_wpa_supplicant_ssid\"\u003e\u003c/a\u003e [wpa\\_supplicant\\_ssid](#input\\_wpa\\_supplicant\\_ssid) | The WiFi SSID. | `string` | `\"\"` | no |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpndurette%2Fpi-packer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpndurette%2Fpi-packer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpndurette%2Fpi-packer/lists"}