├── .VERSION
├── .github
├── dependabot.yml
├── dependencies
│ ├── .admin-version
│ ├── .backitup-version
│ ├── .discovery-version
│ └── .js-controller-version
└── workflows
│ ├── check_iobroker_versions.yml
│ ├── old
│ ├── build_image.yml
│ ├── build_image_test.yml
│ ├── trigger_external_build_dev.yml
│ └── trigger_external_build_main.yml
│ └── update_rpi-imager_repo.yml
├── LICENSE.md
├── README.md
├── build-iobrokerpi.sh
├── cleanup.sh
├── config
├── docs
└── img
│ ├── iobroker_logo.png
│ ├── iobroker_logo_small.png
│ └── pp_logo.png
├── rpi-imager
├── iob-icon.png
├── rpi-imager-category.json
└── rpi-imager.json
└── stage-iobroker
├── 00-system-tweaks
├── 00-packages
├── 00-run.sh
└── files
│ ├── firstboot.sh
│ └── rc.local
├── 01-install-iobroker
└── 00-run.sh
├── EXPORT_IMAGE
├── EXPORT_NOOBS
└── prerun.sh
/.VERSION:
--------------------------------------------------------------------------------
1 | v1.3.0
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Maintain dependencies for GitHub Actions
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "daily"
8 | target-branch: "main"
9 |
--------------------------------------------------------------------------------
/.github/dependencies/.admin-version:
--------------------------------------------------------------------------------
1 | 6.10.1
2 |
--------------------------------------------------------------------------------
/.github/dependencies/.backitup-version:
--------------------------------------------------------------------------------
1 | 2.8.1
2 |
--------------------------------------------------------------------------------
/.github/dependencies/.discovery-version:
--------------------------------------------------------------------------------
1 | 3.1.0
2 |
--------------------------------------------------------------------------------
/.github/dependencies/.js-controller-version:
--------------------------------------------------------------------------------
1 | 5.0.12
2 |
--------------------------------------------------------------------------------
/.github/workflows/check_iobroker_versions.yml:
--------------------------------------------------------------------------------
1 | name: Version Checks
2 |
3 | on:
4 | schedule:
5 | - cron: '42 23 * * *'
6 | workflow_dispatch:
7 |
8 | jobs:
9 | check-and-trigger:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout repo
13 | uses: actions/checkout@v4.1.0
14 | with:
15 | repository: 'buanet/ioBroker.raspberry-os'
16 | token: ${{ secrets.ACTIONS_PAT }}
17 |
18 | - name: Fetch ioBroker versions
19 | run: |
20 | curl -sL https://repo.iobroker.live/sources-dist.json | \
21 | jq -r '."js-controller".version' > .github/dependencies/.js-controller-version
22 | echo "[LOG] Fetched js-controller version is $(cat .github/dependencies/.js-controller-version)"
23 | curl -sL https://repo.iobroker.live/sources-dist.json | \
24 | jq -r '."admin".version' > .github/dependencies/.admin-version
25 | echo "[LOG] Fetched admin version is $(cat .github/dependencies/.admin-version)"
26 | curl -sL https://repo.iobroker.live/sources-dist.json | \
27 | jq -r '."backitup".version' > .github/dependencies/.backitup-version
28 | echo "[LOG] Fetched backitup version is $(cat .github/dependencies/.backitup-version)"
29 | curl -sL https://repo.iobroker.live/sources-dist.json | \
30 | jq -r '."discovery".version' > .github/dependencies/.discovery-version
31 | echo "[LOG] Fetched discovery version is $(cat .github/dependencies/.discovery-version)"
32 | curl -sL "https://deb.nodesource.com/node_18.x/dists/bullseye/main/binary-amd64/Packages" | \
33 | awk -F ': ' '/^Version:/ {split($2,a,"-"); print a[1]}' > .github/dependencies/.nodejs-version
34 | echo "[LOG] Fetched nodejs version is $(cat .github/dependencies/.nodejs-version)"
35 |
36 | - name: Check for modified files
37 | id: git-check
38 | run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")
39 |
40 | - name: Commit latest release version
41 | if: steps.git-check.outputs.modified == 'true'
42 | run: |
43 | git config --global user.name 'buanet'
44 | git config --global user.email 'info@buanet.de'
45 | git commit -am "new ioBroker versions"
46 | git push
47 |
48 | - name: Trigger image build
49 | if: steps.git-check.outputs.modified == 'true'
50 | uses: benc-uk/workflow-dispatch@v1.2
51 | with:
52 | workflow: Build image
53 | repo: buanet/ioBroker.raspberry-os
54 | token: ${{ secrets.ACTIONS_PAT }}
55 |
56 |
--------------------------------------------------------------------------------
/.github/workflows/old/build_image.yml:
--------------------------------------------------------------------------------
1 | # Github action to build Raspberry Pi image from main branch
2 |
3 | name: Build image
4 |
5 | on:
6 | workflow_dispatch:
7 |
8 | jobs:
9 | build_main_image:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Fetch latest release tag
13 | run: |
14 | LATEST_RELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.raspberry-os/releases/latest | jq -r '.tag_name')"
15 | echo "Latest release tag: $LATEST_RELEASE"
16 | echo "RELEASE_TAG=$LATEST_RELEASE" >> $GITHUB_ENV
17 |
18 | - name: Checkout ioBroker.raspberry-os latest stable
19 | uses: actions/checkout@v4
20 | with:
21 | repository: 'buanet/ioBroker.raspberry-os'
22 | ref: ${{ env.RELEASE_TAG }}
23 | path: ioBroker.raspberry-os
24 |
25 | - name: Prepare build
26 | run: |
27 | echo 'Install prerequisites'
28 | sudo apt-get update
29 | sudo apt-get install binfmt-support qemu-user-static qemu-utils nbd-server nbd-client
30 | modprobe binfmt_misc
31 | sudo update-binfmts --enable
32 | echo 'Lock build date...'
33 | DATE=$(date '+%Y-%m-%d')
34 | echo "Build date: $DATE"
35 | echo "DATE=$DATE" >> $GITHUB_ENV
36 | echo 'Done.'
37 | echo ''
38 | echo 'Clone pi-gen build tool...'
39 | git clone https://github.com/RPi-Distro/pi-gen
40 | echo 'Done.'
41 | echo ''
42 | echo 'Prepare config file and iobroker stage...'
43 | cp ./ioBroker.raspberry-os/config ./pi-gen/config
44 | cp -R ./ioBroker.raspberry-os/stage-iobroker ./pi-gen/stage-iobroker
45 | chmod -R +x pi-gen
46 | echo 'Done.'
47 | echo ''
48 | echo 'Change work dir...'
49 | cd ./pi-gen
50 | echo 'Done.'
51 | echo ''
52 | echo 'Add skip files for unused stages...'
53 | touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP
54 | touch ./stage4/SKIP_IMAGES ./stage5/SKIP_IMAGES
55 | rm ./stage4/EXPORT* ./stage5/EXPORT*
56 | echo 'Done.'
57 | echo ''
58 | echo 'Manipulate build script...'
59 | sed -i 's/-e "GIT_HASH=${GIT_HASH}"/-e "GIT_HASH=${GIT_HASH}" --hostname iobroker-pi/' ./build-docker.sh
60 | ## temp fix for issues with debian bullseye
61 | sed -i 's/:bullseye/:buster/' ./build-docker.sh
62 | sed -i 's/:bullseye/:buster/' ./Dockerfile
63 | ## temp fix for missing gpg command
64 | # sed -i 's/fdisk/fdisk gnupg2/' ./Dockerfile
65 | echo 'Done.'
66 | echo ''
67 |
68 | - name: Build image
69 | timeout-minutes: 90
70 | run: |
71 | cd ./pi-gen
72 | ./build-docker.sh
73 |
74 | - name: Get publishing info
75 | run: |
76 | IMAGE_PATH=$(find ./pi-gen/deploy/ -name '*.zip')
77 | echo "Image path: $IMAGE_PATH"
78 | echo "IMAGE_PATH=$IMAGE_PATH" >> $GITHUB_ENV
79 | IMAGE_NAME=$(echo $IMAGE_PATH | cut -d'/' -f4-)
80 | echo "Image name: $IMAGE_NAME"
81 | echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
82 |
83 | - name: Prepare deploy for upload
84 | run: |
85 | echo 'Generate deploy.zip...'
86 | cd ./pi-gen/deploy && zip -r ../../deploy.zip ./*
87 | echo 'Done.'
88 | echo ''
89 |
90 | # - name: Publish image to Github release
91 | # uses: svenstaro/upload-release-action@v2
92 | # with:
93 | # repo_name: buanet/ioBroker.raspberry-os
94 | # repo_token: ${{ secrets.ACTIONS_PAT }}
95 | # tag: ${{ env.RELEASE_TAG }}
96 | # file: ${{ env.IMAGE_PATH }}
97 | # asset_name: ${{ env.DATE }}_RaspberryOS_ioBroker_Image_${{ env.RELEASE_TAG }}.zip
98 | # overwrite: true
99 |
100 | # - name: Trigger update rpi-imager
101 | # uses: benc-uk/workflow-dispatch@v1.2
102 | # with:
103 | # workflow: Update rpi-imager repo
104 | # repo: buanet/ioBroker.raspberry-os
105 | # token: ${{ secrets.ACTIONS_PAT }}
106 |
107 | # retry_when_failed:
108 | # name: Retry workflow when failed
109 | # runs-on: ubuntu-latest
110 | # if: failure()
111 | # needs: [build_main_image]
112 | # steps:
113 | # - name: Trigger build
114 | # uses: benc-uk/workflow-dispatch@v1.2
115 | # with:
116 | # workflow: Build image
117 | # repo: buanet/ioBroker.raspberry-os
118 | # token: ${{ secrets.ACTIONS_PAT }}
119 |
--------------------------------------------------------------------------------
/.github/workflows/old/build_image_test.yml:
--------------------------------------------------------------------------------
1 | # Github action to build Raspberry Pi image from main branch
2 |
3 | name: Build image test
4 |
5 | on:
6 | workflow_dispatch:
7 |
8 | jobs:
9 | build_main_image:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Fetch latest release tag
13 | run: |
14 | LATEST_RELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.raspberry-os/releases/latest | jq -r '.tag_name')"
15 | echo "Latest release tag: $LATEST_RELEASE"
16 | echo "RELEASE_TAG=$LATEST_RELEASE" >> $GITHUB_ENV
17 |
18 | - name: Checkout ioBroker.raspberry-os latest stable
19 | uses: actions/checkout@v4
20 | with:
21 | repository: 'buanet/ioBroker.raspberry-os'
22 | ref: ${{ env.RELEASE_TAG }}
23 | path: ioBroker.raspberry-os
24 |
25 | - uses: usimd/pi-gen-action@v1
26 | with:
27 | compression: zip
28 | compression-level: 6
29 | disable-first-boot-user-rename: 0
30 |
31 | # Additional options to include in PIGEN_DOCKER_OPTS
32 | docker-opts: ''
33 |
34 | enable-noobs: false
35 | enable-ssh: 1
36 | export-last-stage-only: true
37 |
38 | # Comma or whitespace separated list of additional packages to install on host
39 | # before running pi-gen. Use this list to add any packages your custom stages may
40 | # require. Note that this is not affecting the final image. In order to add
41 | # additional packages, you need to add a respective 'XX-packages' file in your
42 | # custom stage.
43 | extra-host-dependencies: ''
44 |
45 | # Comma or whitespace separated list of additional modules to load on host before
46 | # running pi-gen. If your custom stage requires additional software or kernel
47 | # modules to be loaded, add them here. Note that this is not meant to configure
48 | # modules to be loaded in the target image.
49 | extra-host-modules: ''
50 |
51 | # Token to use for checking out pi-gen repo.
52 | github-token: ${{ github.token }}
53 |
54 | hostname: iobroker-pi
55 | image-name: ioBrokerPi
56 | keyboard-keymap: gb
57 | keyboard-layout: English (UK)
58 | locale: en_GB.UTF-8
59 |
60 | username: pi
61 | password: raspberry
62 |
63 | # Path where selected pi-gen ref will be checked out to. If the path does not yet
64 | # exist, it will be created (including its parents).
65 | pi-gen-dir: pi-gen
66 |
67 | # GitHub repository to fetch pi-gen from, must be a fork from RPi-Distro/pi-gen.
68 | pi-gen-repository: RPi-Distro/pi-gen
69 |
70 | # Release version of pi-gen to use. This can both be a branch or tag name known in
71 | # the pi-gen repository.
72 | pi-gen-version: arm64
73 |
74 | # The release version to build images against. Valid values are jessie, stretch,
75 | # buster, bullseye, bookworm, and testing.
76 | release: bullseye
77 |
78 | # Setting to `1` will prevent pi-gen from dropping the "capabilities" feature.
79 | # Generating the root filesystem with capabilities enabled and running it from a
80 | # filesystem that does not support capabilities (like NFS) can cause issues. Only
81 | # enable this if you understand what it is.
82 | setfcap: ''
83 |
84 | # List of stage name to execute in given order. Relative and absolute paths to
85 | # custom stage directories are allowed here. Note that by default pi-gen exports
86 | # images in stage2 (lite), stage4 and stage5. You probably want to hook in custom
87 | # stages before one of the exported stages. Otherwise, the action will make sure
88 | # any custom stage will include an image export directive.
89 | stage-list: stage0 stage1 stage2 ./ioBroker.raspberry-os/stage-iobroker
90 |
91 | # System timezone.
92 | timezone: Europe/London
93 |
94 | # Use qcow2 images to reduce space and runtime requirements.
95 | use-qcow2: 1
96 |
97 | # Print all output from pi-gen.
98 | verbose-output: true
99 |
100 | - uses: actions/upload-artifact@v3
101 | with:
102 | name: pi-gen-image
103 | path: ${{ steps.build.outputs.image-path }}
104 |
--------------------------------------------------------------------------------
/.github/workflows/old/trigger_external_build_dev.yml:
--------------------------------------------------------------------------------
1 | # Due to some issues with Github action runners the build process will run on an external runner.
2 | # This workflow will trigger this external build process.
3 | name: Trigger external build (dev)
4 |
5 | on:
6 | workflow_dispatch:
7 |
8 | jobs:
9 | trigger_dev_build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Trigger build (dev)
13 | uses: benc-uk/workflow-dispatch@v1.2
14 | with:
15 | workflow: iob.raspberry-os - Build Raspberry OS image (dev)
16 | repo: buanet/private.actionsrunner
17 | token: ${{ secrets.ACTIONS_PAT }}
18 |
--------------------------------------------------------------------------------
/.github/workflows/old/trigger_external_build_main.yml:
--------------------------------------------------------------------------------
1 | # Due to some issues with Github action runners the build process will run on an external runner.
2 | # This workflow will trigger this external build process.
3 | name: Trigger external build (main)
4 |
5 | on:
6 | workflow_dispatch:
7 | # release:
8 | # types:
9 | # - published
10 | # schedule:
11 | # - cron: '0 10 1 * *'
12 |
13 | jobs:
14 | trigger_main_build:
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: Trigger build (main)
18 | uses: benc-uk/workflow-dispatch@v1.2
19 | with:
20 | workflow: iob.raspberry-os - Build Raspberry OS image (main)
21 | repo: buanet/private.actionsrunner
22 | token: ${{ secrets.ACTIONS_PAT }}
23 |
--------------------------------------------------------------------------------
/.github/workflows/update_rpi-imager_repo.yml:
--------------------------------------------------------------------------------
1 | # Github action to build Raspberry Pi image from main branch
2 |
3 | name: Update rpi-imager repo
4 |
5 | on:
6 | workflow_dispatch:
7 |
8 | jobs:
9 | update_rpi-imager:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout ioBroker.raspberry-os
13 | uses: actions/checkout@v4
14 | with:
15 | repository: 'buanet/ioBroker.raspberry-os'
16 | ref: main
17 |
18 | - name: Update rpi-imager.json
19 | run: |
20 | echo 'Fetch latest release tag...'
21 | RELEASE_TAG="$(curl -sL https://api.github.com/repos/buanet/ioBroker.raspberry-os/releases/latest | jq -r '.tag_name')"
22 | echo "Latest release tag: $RELEASE TAG"
23 | echo 'Done.'
24 | echo ' '
25 | echo 'Download latest ioBroker Raspberry Pi image...'
26 | URL=$(curl -sL https://api.github.com/repos/buanet/ioBroker.raspberry-os/releases/latest | jq -r '.assets[].browser_download_url' | tail -n1)
27 | echo "Download URL: $URL"
28 | wget -q $URL
29 | FILE_NAME_ZIP=$(find ./ -name '*.zip')
30 | echo "ZIP File name: $FILE_NAME_ZIP"
31 | DATE=$(find *.zip | cut -c 1-10)
32 | echo "Date: $DATE"
33 | echo 'Done.'
34 | echo ' '
35 | echo 'Fetch information for download file...'
36 | DL_SIZE=$(ls -l $FILE_NAME_ZIP | awk '{print $5;}')
37 | echo "Download size: $DL_SIZE"
38 | DL_CHKS=$(sha256sum $FILE_NAME_ZIP | awk '{print $1;}')
39 | echo "Download checksum: $DL_CHKS"
40 | echo 'Done.'
41 | echo ' '
42 | echo 'Fetch information for image file...'
43 | unzip $FILE_NAME_ZIP -d ./
44 | FILE_NAME_IMG=$(find ./ -name '*.img')
45 | echo "IMG File name: $FILE_NAME_IMG"
46 | IMG_SIZE=$(ls -l $FILE_NAME_IMG | awk '{print $5;}')
47 | echo "Image size: $IMG_SIZE"
48 | IMG_CHKS=$(sha256sum $FILE_NAME_IMG | awk '{print $1;}')
49 | echo "Image checksum: $IMG_CHKS"
50 | echo 'Done.'
51 | echo ' '
52 | echo 'Update rpi-imager.json...'
53 | jq ".os_list[].name = \"ioBroker Raspberry Pi OS ${RELEASE_TAG} (32bit)\" | \
54 | .os_list[].url = \"${URL}\" | \
55 | .os_list[].release_date = \"${DATE}\" | \
56 | .os_list[].extract_size = ${IMG_SIZE} | \
57 | .os_list[].extract_sha256 = \"${IMG_CHKS}\" | \
58 | .os_list[].image_download_size = ${DL_SIZE} | \
59 | .os_list[].image_download_sha256 = \"${DL_CHKS}\"" ./rpi-imager/rpi-imager.json > ./rpi-imager-tmp.json
60 | mv ./rpi-imager-tmp.json ./rpi-imager/rpi-imager.json
61 | echo 'Done.'
62 | echo ' '
63 | echo 'Remove downloaded files...'
64 | rm $FILE_NAME_ZIP
65 | rm $FILE_NAME_IMG
66 | echo 'Done.'
67 |
68 | - name: Check for modified files
69 | id: git-check
70 | run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")
71 |
72 | - name: Commit latest release version
73 | if: steps.git-check.outputs.modified == 'true'
74 | run: |
75 | echo 'Publish rpi-imager.json...'
76 | git config --global user.name 'buanet'
77 | git config --global user.email 'info@buanet.de'
78 | git commit -am "update information for rpi-imager"
79 | git push
80 | echo 'Done.'
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 André Germann
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Official Raspberry OS image for ioBroker
2 |
3 |
4 |
5 | [](https://github.com/buanet/ioBroker.raspberry-os/releases)
6 | [](https://github.com/buanet/ioBroker.raspberry-os/issues)
7 | [](https://github.com/buanet/ioBroker.raspberry-os/blob/master/LICENSE.md)
8 | [](https://paypal.me/buanet)
9 |
10 | This project is used to auto generate pre configured Raspberry OS images for ioBroker IoT platform. For more details about ioBroker see: [iobroker.net](https://www.iobroker.net/).
11 |
12 | ## :rocket: Quick links
13 |
14 | Don't know what's ioBroker? :arrow_right: [iobroker.net](https://www.iobroker.net)
15 | Don't know what's a Raspberry Pi? :arrow_right: [raspberrypi.org](https://www.raspberrypi.org/)
16 | Looking for the image to download? :arrow_right: [see latest release](https://github.com/buanet/ioBroker.raspberry-os/releases/latest)
17 |
18 |
19 | This build uses the official Raspberry Pi OS build script from https://github.com/RPi-Distro/pi-gen. It takes the stages for the default lite image and adds a custom stage for setting up ioBroker.
20 |
21 | ## Build your own Raspberry OS image
22 | Of course you can use this code to locally build your ioBroker RaspberryPi OS image from scratch.
23 | This is how it works.
24 |
25 | ### Prerequisites
26 | This script is made for running on a Linux Platform like Debian or Ubuntu.
27 | As this build script is using Docker, make sure you have it up and running on your machine.
28 |
29 | Clone the code to your local system:
30 |
31 | ```
32 | git clone https://github.com/buanet/ioBroker.raspberry-os
33 | ```
34 |
35 | ### Starting build
36 | Start the build process (from inside the cloned ioBroker.raspberry-os folder):
37 | ```
38 | sudo ./build-iobrokerpi.sh
39 | ```
40 | The script will download pi-gen source and start building automatically.
41 |
42 | Depending on your environment, the process can take some (more) time.
43 |
44 | After success you will find your Image in ```./pi-gen/deploy/```.
45 |
46 | ### Cleanup
47 | Cleanup your workspace with the included cleanup script. It will delete the pi-gen source and the used docker container.
48 | ```
49 | sudo ./cleanup.sh
50 | ```
51 |
52 | ### Configuration
53 | You can configure settings like locales, default User and more by editing the ```config``` file. For more details see the original [pi-gen readme.md](https://github.com/RPi-Distro/pi-gen/blob/master/README.md).
54 |
55 | ## Changelog
56 |
57 | ### v1.3.0 (2022-02-20)
58 | * add rpi-imager support
59 | * add new ci
60 |
61 | ### v1.2.0 (2021-08-08)
62 | * add uuid reset procedure for iobroker
63 | * update default config_de
64 |
65 | ### v1.1.0 (2021-07-27)
66 | * add automated build process with github actions
67 | * default user is now "pi"
68 |
69 | ### v1.0.0 (2021-03-08)
70 | * add some documentation
71 | * v0.0.2 (2021-02-01)
72 | * change memory split
73 | * change boot target
74 | * v0.0.1 (2021-01-27)
75 | * project started / initial release
76 |
77 | ## License
78 |
79 | MIT License
80 |
81 | Copyright (c) 2022 André Germann
82 |
83 | Permission is hereby granted, free of charge, to any person obtaining a copy
84 | of this software and associated documentation files (the "Software"), to deal
85 | in the Software without restriction, including without limitation the rights
86 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
87 | copies of the Software, and to permit persons to whom the Software is
88 | furnished to do so, subject to the following conditions:
89 |
90 | The above copyright notice and this permission notice shall be included in all
91 | copies or substantial portions of the Software.
92 |
93 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
96 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
97 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
98 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
99 | SOFTWARE.
100 |
101 | ## Credits
102 |
103 | This project uses the [official RPi-Distro/pi-gen](https://github.com/RPi-Distro/pi-gen) and is inspired by the [Honey-Pi project](https://github.com/Honey-Pi/HoneyPi-Build-Raspbian).
104 |
--------------------------------------------------------------------------------
/build-iobrokerpi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # get pi-gen sources from github
4 | git clone https://github.com/RPi-Distro/pi-gen
5 |
6 | # copy config file and iobrokerpi stage
7 | cp config pi-gen/config
8 | cp -R stage-iobroker pi-gen/stage-iobroker
9 |
10 | # change working directory
11 | cd pi-gen
12 |
13 | # add skip files for skipped steps / delete not used export files
14 | touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP
15 | touch ./stage4/SKIP_IMAGES ./stage5/SKIP_IMAGES
16 | rm ./stage4/EXPORT* ./stage5/EXPORT*
17 |
18 | # add hostname for docker container in build-docker.sh
19 | sed -i 's/-e "GIT_HASH=${GIT_HASH}"/-e "GIT_HASH=${GIT_HASH}" --hostname iobroker-pi/' ./build-docker.sh
20 |
21 | # starting build
22 | echo "Start build process..."
23 | #./build.sh | tee build.log
24 | ./build-docker.sh | tee build.log
25 |
--------------------------------------------------------------------------------
/cleanup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # cleanup for new build
4 | echo "Cleaning the mess up..."
5 | rm -R pi-gen
6 | docker rm -v pigen_work
7 | echo "Done."
8 |
9 | exit 0
10 |
--------------------------------------------------------------------------------
/config:
--------------------------------------------------------------------------------
1 | # build settings
2 | IMG_NAME='ioBrokerPi'
3 | PI_GEN_RELEASE='ioBroker Pi'
4 | RELEASE='bookworm'
5 | STAGE_LIST='stage0 stage1 stage2 stage-iobroker'
6 | DEPLOY_COMPRESSION='zip'
7 |
8 | # system default settings
9 | TARGET_HOSTNAME='iobroker-pi'
10 | # FIRST_USER_NAME='pi'
11 | # FIRST_USER_PASS='raspberry'
12 | ENABLE_SSH=1
13 | LOCALE_DEFAULT='en_GB.UTF-8'
14 | TIMEZONE_DEFAULT='Europe/London'
15 | KEYBOARD_KEYMAP='gb'
16 | KEYBOARD_LAYOUT='English (UK)'
--------------------------------------------------------------------------------
/docs/img/iobroker_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/docs/img/iobroker_logo.png
--------------------------------------------------------------------------------
/docs/img/iobroker_logo_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/docs/img/iobroker_logo_small.png
--------------------------------------------------------------------------------
/docs/img/pp_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/docs/img/pp_logo.png
--------------------------------------------------------------------------------
/rpi-imager/iob-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/rpi-imager/iob-icon.png
--------------------------------------------------------------------------------
/rpi-imager/rpi-imager-category.json:
--------------------------------------------------------------------------------
1 | // Snippet to include ioBroker Image in Raspberry Pi Imager uder "Other specific-purpose OS" > "Home assistants and home automation"
2 |
3 | {
4 | "name": "ioBroker",
5 | "description": "Official Raspberry Pi OS Image for ioBroker open-source IoT platform.",
6 | "icon": "https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/master/rpi-imager/iob-icon.png",
7 | "subitems_url": "https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/master/rpi-imager/rpi-imager.json"
8 | },
9 |
--------------------------------------------------------------------------------
/rpi-imager/rpi-imager.json:
--------------------------------------------------------------------------------
1 | {
2 | "os_list": [
3 | {
4 | "name": "ioBroker Raspberry Pi OS v1.3.0 (32bit)",
5 | "description": "Image for ioBroker open-source IoT platform based on Raspberry Pi OS lite (32bit).",
6 | "url": "https://github.com/buanet/ioBroker.raspberry-os/releases/download/v1.3.0/2023-03-21_RaspberryOS_ioBroker_Image_v1.3.0.zip",
7 | "icon": "https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/main/rpi-imager/iob-icon.png",
8 | "release_date": "2023-03-21",
9 | "extract_size": 2680160256,
10 | "extract_sha256": "41781b60657da1d16a109b4316d85cdff5b31cac9b349a953dce6faeb996ffd0",
11 | "image_download_size": 783473183,
12 | "image_download_sha256": "ec5bf89e38ca47f39eb119a5be65e866fac3ce19492aec3ef0235f8be4b6da66",
13 | "website": "https://www.iobroker.net/"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/stage-iobroker/00-system-tweaks/00-packages:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/stage-iobroker/00-system-tweaks/00-packages
--------------------------------------------------------------------------------
/stage-iobroker/00-system-tweaks/00-run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # configure firstboot options
4 | echo "[LOG] Configuring firstboot"
5 | install -m 775 files/rc.local "${ROOTFS_DIR}/etc/rc.local"
6 | install -m 775 files/firstboot.sh "${ROOTFS_DIR}/root/firstboot.sh"
7 |
8 | on_chroot << EOF
9 | systemctl enable rc-local
10 | EOF
11 |
12 | # change boot target
13 | echo "[LOG] Changing boot target"
14 | on_chroot << EOF
15 | systemctl set-default multi-user.target
16 | EOF
17 |
18 | # set memory split
19 | echo "[LOG] Setting memory split"
20 | on_chroot << EOF
21 | echo >> /boot/config.txt
22 | echo "gpu_mem=16" >> /boot/config.txt
23 | EOF
24 |
--------------------------------------------------------------------------------
/stage-iobroker/00-system-tweaks/files/firstboot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # this script will run the first time the raspberry pi boots.
3 | # it runs as root.
4 |
5 | echo '>>> Starting firstboot.sh'
6 |
7 | # resize root partion to possible maximum
8 | echo -n 'Resizing root partition... '
9 | raspi-config nonint do_expand_rootfs
10 | echo 'Done.'
11 |
12 | # get current date from debian time server
13 | echo -n 'Updating date and time... '
14 | ntpdate 0.debian.pool.ntp.org
15 | echo 'Done.'
16 |
17 | # check/ correct hostname in iobroker
18 | if [[ $(iob object get "system.adapter.admin.0" --pretty | grep -oP '(?<="host": ")[^"]*') =! $(hostname) ]]; then
19 | echo -n 'Changing hostname in ioBroker... '
20 | sudo -u iobroker iobroker stop
21 | sudo -u iobroker iobroker host this
22 | echo 'Done.'
23 | fi
24 |
25 | # Reboot
26 | echo 'Rebooting...'
27 | reboot
28 |
--------------------------------------------------------------------------------
/stage-iobroker/00-system-tweaks/files/rc.local:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 | #
3 | # rc.local
4 | #
5 | # this script is executed at the end of each multiuser runlevel
6 | # make sure that the script will "exit 0" on success or any other value on error
7 | #
8 | # in order to enable or disable this script just change the execution bits
9 |
10 | # print the ip address on startup
11 | _IP=$(hostname -I) || true
12 | if [ "$_IP" ]; then
13 | printf "My IP address is %s\n" "$_IP"
14 | fi
15 |
16 | # check if iobroker uuid needs to be changed
17 | #if [ -e /root/iob_uuid_not_changed ]; then
18 | # sleep 10
19 | # # remove check file
20 | # rm /root/iob_uuid_not_changed
21 | # # run fix script
22 | # if [ -e /root/fix_iob_uuid.sh ]; then
23 | # /root/fix_iob_uuid.sh > /root/fix_iob_uuid.log 2>&1
24 | # fi
25 | #fi
26 |
27 | # runs firstboot.sh only on verty first boot
28 | if [ ! -e /root/firstboot_done ]; then
29 | touch /root/firstboot_done
30 | #touch /root/iob_uuid_not_changed
31 | if [ -e /root/firstboot.sh ]; then
32 | /root/firstboot.sh
33 | fi
34 | fi
35 |
36 | exit 0
37 |
--------------------------------------------------------------------------------
/stage-iobroker/01-install-iobroker/00-run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # run iobroker install script
4 | echo "[LOG] Installing ioBroker"
5 | on_chroot << EOF
6 | curl -sLf https://iobroker.net/install.sh | bash -
7 | EOF
8 |
9 | # enable iobroker autostart
10 | echo "[LOG] Enabling autostart"
11 | on_chroot << EOF
12 | update-rc.d iobroker.sh defaults
13 | EOF
14 |
15 | # temp logging to check uuid behavior
16 | on_chroot << EOF
17 | cd /opt/iobroker
18 | echo "[LOG] This is the build UUID: $(iobroker uuid)"
19 | EOF
20 |
21 | # resetting ioBroker UUID
22 | echo "[LOG] Resetting ioBroker UUID"
23 | on_chroot << EOF
24 | cd /opt/iobroker
25 | iobroker stop
26 | iobroker unsetup -y
27 | EOF
28 |
--------------------------------------------------------------------------------
/stage-iobroker/EXPORT_IMAGE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/stage-iobroker/EXPORT_IMAGE
--------------------------------------------------------------------------------
/stage-iobroker/EXPORT_NOOBS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/buanet/ioBroker.raspberry-os/6220fdfee4a86b1eb31d6fee50a5b0f27cda6a00/stage-iobroker/EXPORT_NOOBS
--------------------------------------------------------------------------------
/stage-iobroker/prerun.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | if [ ! -d "${ROOTFS_DIR}" ]; then
4 | copy_previous
5 | fi
6 |
7 | sleep 20
8 |
--------------------------------------------------------------------------------