Coder Social home page Coder Social logo

xraspios's Introduction

Xraspios

Extended Raspberry Pi OS Lite Image based on Raspios and packaged with Packer.

This operating system is installed on my Raspberry Pi 4 and serve as a home lab server. It mainly run IaaS and APIs with Docker.

Features

  • Docker
    • Portainer
  • Git
  • Tmux
  • Vim
  • Security
    • SSH
      • User / Password
      • Key

Requirements

Build Image

The image is built from the Raspios Lite Armhf 2022-09-07

See builder.pkr.hcl

Initialize the project, update dependencies

packer init config.pkr.hcl

Build the image

sudo packer build build.pkr.hcl

Once the build is finished, the image will be available in thes build folder as xraspios-lite.img

Docker

Build with the official Packer Docker image

Not tested !

Initialize

docker run \
    -v `pwd`:/workspace -w /workspace \
    -e PACKER_PLUGIN_PATH=/workspace/.packer.d/plugins \
    hashicorp/packer:latest \
    init .

Build

docker run \
    -v `pwd`:/workspace -w /workspace \
    -e PACKER_PLUGIN_PATH=/workspace/.packer.d/plugins \
    hashicorp/packer:latest \
    build .

Write Image

Write the image to and SD card

Raspberry Pi Imager

Use Raspberry Pi Imager to configure WiFi, users and more and write to image to the card.

Check how rpi-imager write config

https://github.com/raspberrypi/rpi-imager/blob/ce0b02b823a40ada3cd4a12a257da9506e46dda1/src/OptionsPopup.qml#L589

DD

When rpi-imager no more needed to configure the wifi and user. TODO: Keys and no user?!

sudo dd bs=4M if=/dev/zero of=/dev/sdb oflag=sync
sudo dd bs=4M if=/path/to/image of=/dev/sdb oflag=sync

References

xraspios's People

Contributors

alexandrelamberty avatar

Watchers

 avatar

xraspios's Issues

Actions Packer Build Artifact packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 error losetup

Run hashicorp/packer-github-actions@master
/usr/bin/docker run --name f70f[9](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:10)59c6348ac04a3cb3efc22711111f64_d2b3e4 --label 817f70 --workdir /github/workspace --rm -e "PACKER_LOG" -e "INPUT_COMMAND" -e "INPUT_ARGUMENTS" -e "INPUT_TARGET" -e "INPUT_WORKING_DIRECTORY" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/prometheus-os/prometheus-os":"/github/workspace" 817f70:f959c6348ac04a3cb3efc22711111f64
2022/09/21 13:20:09 [INFO] Packer version: 1.8.2 [go1.17.11 linux amd64]
2022/09/21 13:20:09 [TRACE] discovering plugins in /bin
2022/09/21 13:20:09 [TRACE] discovering plugins in /github/home/.config/packer/plugins
2022/09/21 13:20:09 [DEBUG] Discovered plugin: arm-image = /github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64
2022/09/21 13:20:09 [INFO] found external [-packer-default-plugin-name-] builders from arm-image plugin
2022/09/21 13:20:09 [INFO] found external [-packer-default-plugin-name-] post-processors from arm-image plugin
2022/09/21 13:20:09 [TRACE] discovering plugins in .
2022/09/21 13:20:09 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/09/21 13:20:09 [INFO] PACKER_CONFIG env var set; attempting to open config file: /github/home/.packerconfig
2022/09/21 13:20:09 [WARN] Config file doesn't exist: /github/home/.packerconfig
2022/09/21 13:20:09 [INFO] Setting cache directory: /github/home/.cache/packer
e: Running in background, not using a TTY
2022/09/21 13:20:09 [TRACE] listing potential installations for "github.com/solo-io/arm-image" that match ">= 0.2.6". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/bin/packer", ".", "/github/home/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc00021ce00)}}}}
2022/09/21 13:20:09 [TRACE] Found the following "github.com/solo-io/arm-image" installations: [{/github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 v0.2.6}]
2022/09/21 13:20:09 [INFO] found external [-packer-default-plugin-name-] builders from arm-image plugin
2022/09/21 13:20:09 [INFO] found external [-packer-default-plugin-name-] post-processors from arm-image plugin
2022/09/21 13:20:09 [TRACE] Starting external plugin /github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2022/09/21 13:20:09 Starting plugin: /github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 []string{"/github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2022/09/21 13:20:09 Waiting for RPC address for: /github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64
2022/09/21 13:20:09 Received unix RPC address for /github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64: addr is /tmp/packer-plugin1986538479
2022/09/21 13:20:09 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:09 Plugin address: unix /tmp/packer-plugin1986538479
2022/09/21 13:20:09 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:09 Waiting for connection...
2022/09/21 13:20:09 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:09 Serving a plugin connection...
2022/09/21 13:20:09 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:09 [TRACE] starting builder -packer-default-plugin-name-
2022/09/21 13:20:[10](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:11) packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:10 qemu path /github/home/.cache/packer/qemu-arm-static
2022/09/21 13:20:10 Build debug mode: false
2022/09/21 13:20:10 Force build: false
2022/09/21 13:20:10 On error: abort
2022/09/21 13:20:10 Waiting on builds to complete...
2022/09/21 13:20:10 Starting build run: arm-image.raspberry-pi-os-lite
2022/09/21 13:20:10 Running builder: 
2022/09/21 13:20:10 [INFO] (telemetry) Starting builder arm-image.raspberry-pi-os-lite
==> arm-image.raspberry-pi-os-lite: Image type: raspberrypi
==> arm-image.raspberry-pi-os-lite: Retrieving Image
==> arm-image.raspberry-pi-os-lite: Trying https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip
2022/09/21 13:20:10 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:10 Acquiring lock for: https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip?checksum=sha256%3Aea92412af99ec145438ddec3c955aa65e72ef88d84f3307cea474da005669d39 (/github/home/.cache/packer/b58b320fb927a83f1f[11](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:12)afcec8fc103237c7c576.iso.lock)
==> arm-image.raspberry-pi-os-lite: Trying https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip?checksum=sha256%3Aea924[12](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:13)af99ec145438ddec3c955aa65e72ef88d84f3307cea474da005669d39
2022/09/21 [13](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:14):20:29 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:29 closing
2022/09/21 13:20:30 packer-plugin-arm-image_v0.2.6_x5.0_linux_amd64 plugin: 2022/09/21 13:20:30 Leaving retrieve loop for Image
==> arm-image.raspberry-pi-os-lite: https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip?checksum=sha256%3Aea92412af99ec[14](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:15)5438ddec3c955aa65e72ef88d84f3307cea474da005669d39 => /github/home/.cache/packer/b58b320fb927a83f1f11afcec8fc103237c7c576.iso
==> arm-image.raspberry-pi-os-lite: Copying source image.
==> arm-image.raspberry-pi-os-lite: Image is a zip file.
==> arm-image.raspberry-pi-os-lite: Unzipping 2021-03-04-raspios-buster-armhf-lite.img
    arm-image.raspberry-pi-os-lite: Speed:  [17](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:18)5.80 MB/s
    arm-image.raspberry-pi-os-lite: Progress: 47.10%
    arm-image.raspberry-pi-os-lite: Speed:  147.48 MB/s
    arm-image.raspberry-pi-os-lite: Progress: 86.61%
    arm-image.raspberry-pi-os-lite: mapping output-raspberry-pi-os-lite/image
==> arm-image.raspberry-pi-os-lite: losetup --show -f -P output-raspberry-pi-os-lite/image
==> arm-image.raspberry-pi-os-lite: error losetup --show -f -P exit status 1: losetup: unrecognized option: show
==> arm-image.raspberry-pi-os-lite: BusyBox v1.35.0 ([20](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:21)22-05-09 17:27:12 UTC) multi-call binary.
==> arm-image.raspberry-pi-os-lite: 
==> arm-image.raspberry-pi-os-lite: Usage: losetup [-rP] [-o OFS] {-f|LOOPDEV} FILE: associate loop devices
==> arm-image.raspberry-pi-os-lite: 	losetup -c LOOPDEV: reread file size
==> arm-image.raspberry-pi-os-lite: 	losetup -d LOOPDEV: disassociate
==> arm-image.raspberry-pi-os-lite: 	losetup -a: show status
==> arm-image.raspberry-pi-os-lite: 	losetup -f: show next free loop device
==> arm-image.raspberry-pi-os-lite: 
==> arm-image.raspberry-pi-os-lite: 	-o OFS	Start OFS bytes into FILE
==> arm-image.raspberry-pi-os-lite: 	-P	Scan for partitions
==> arm-image.raspberry-pi-os-lite: 	-r	Read-only
==> arm-image.raspberry-pi-os-lite: 	-f	Show/use next free loop device
==> arm-image.raspberry-pi-os-lite:
2022/09/[21](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:22) 13:20:41 [INFO] (telemetry) ending arm-image.raspberry-pi-os-lite
==> Wait completed after 31 seconds 643 milliseconds
20[22](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:23)/09/21 13:20:41 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/09/21 13:20:41 machine readable: arm-image.raspberry-pi-os-lite,error []string{"step canceled or halted"}
==> Builds finished but no artifacts were created.
2022/09/21 13:20:41 [INFO] (telemetry) Finalizing.
==> arm-image.raspberry-pi-os-lite: BusyBox v1.35.0 (2022-05-09 17:[27](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:28):12 UTC) multi-call binary.
==> arm-image.raspberry-pi-os-lite: 
==> arm-image.raspberry-pi-os-lite: Usage: losetup [-rP] [-o OFS] {-f|LOOPDEV} FILE: associate loop devices
==> arm-image.raspberry-pi-os-lite: 	losetup -c LOOPDEV: reread file size
==> arm-image.raspberry-pi-os-lite: 	losetup -d LOOPDEV: disassociate
==> arm-image.raspberry-pi-os-lite: 	losetup -a: show status
==> arm-image.raspberry-pi-os-lite: 	losetup -f: show next free loop device
==> arm-image.raspberry-pi-os-lite: 
==> arm-image.raspberry-pi-os-lite: 	-o OFS	Start OFS bytes into FILE
==> arm-image.raspberry-pi-os-lite: 	-P	Scan for partitions
==> arm-image.raspberry-pi-os-lite: 	-r	Read-only
==> arm-image.raspberry-pi-os-lite: 	-f	Show/use next free loop device
==> arm-image.raspberry-pi-os-lite:
Build 'arm-image.raspberry-pi-os-lite' errored after [31](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:32) seconds 643 milliseconds: step canceled or halted

==> Wait completed after 31 seconds 643 milliseconds

==> Some builds didn't complete successfully and had errors:
--> arm-image.raspberry-pi-os-lite: step canceled or halted

==> Builds finished but no artifacts were created.
2022/09/21 13:20:[42](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:43) waiting for all plugin processes to complete...
2022/09/21 13:20:42 /github/home/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.6_x5.0_linux_amd[64](https://github.com/alexandrelamberty/prometheus-os/actions/runs/3098135097/jobs/5015662454#step:6:65): plugin process exited

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.