-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add KlipperScreen module (#284)
* feat: add klipperscreen module Signed-off-by: Stephan Wendel <[email protected]> * test: build test with new module This commit will be reverted if finished Signed-off-by: Stephan Wendel <[email protected]> * fix: fix typo in config Signed-off-by: Stephan Wendel <[email protected]> * fix: fix typo in install message Signed-off-by: Stephan Wendel <[email protected]> * chore: KlipperScreen to postrename script Signed-off-by: Stephan Wendel <[email protected]> * fix: replace moonraker comments Signed-off-by: Stephan Wendel <[email protected]> * chore: change date Signed-off-by: Stephan Wendel <[email protected]> * chore: change date in config Signed-off-by: Stephan Wendel <[email protected]> --------- Signed-off-by: Stephan Wendel <[email protected]>
- Loading branch information
Showing
6 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# Shebang for better file detection | ||
|
||
# Declare Variables before exporting. | ||
# See https://www.shellcheck.net/wiki/SC2155 | ||
|
||
BASE_ARCH="arm64" | ||
|
||
# Keep for Bookworm template | ||
# DOWNLOAD_URL_CHECKSUM="https://downloads.raspberrypi.org/raspios_lite_arm64_latest.sha256" | ||
# DOWNLOAD_URL_IMAGE="https://downloads.raspberrypi.org/raspios_lite_arm64_latest.torrent" | ||
|
||
# New locations after Bullseye turned into 'oldstable' | ||
DOWNLOAD_URL_CHECKSUM="https://downloads.raspberrypi.com/raspios_oldstable_lite_arm64/images/raspios_oldstable_lite_arm64-2023-10-10/2023-05-03-raspios-bullseye-arm64-lite.img.xz.sha256" | ||
DOWNLOAD_URL_IMAGE="https://downloads.raspberrypi.com/raspios_oldstable_lite_arm64/images/raspios_oldstable_lite_arm64-2023-10-10/2023-05-03-raspios-bullseye-arm64-lite.img.xz.torrent" | ||
|
||
|
||
# Changed modules | ||
# shellcheck disable=SC2034 | ||
MODULES="base,pkgupgrade,udev_fix,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,klipperscreen,crowsnest,sonar,password-for-sudo),postrename" | ||
|
||
|
||
# export variables | ||
export BASE_ARCH | ||
export DOWNLOAD_URL_CHECKSUM | ||
export DOWNLOAD_URL_IMAGE | ||
|
||
### JSON sniplet Setup | ||
### NOTE: Please see all config files for setup variables!!! | ||
# shellcheck disable=SC2034 | ||
JSON_SUPPORTED_SBC="pi3-64bit pi4-64bit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
#Shebang for better file detection | ||
#### KlipperScreen install module | ||
#### | ||
#### Written by Stephan Wendel aka KwadFan <[email protected]> | ||
#### Copyright 2024 - till today | ||
#### https://github.com/mainsail-crew/MainsailOS | ||
#### | ||
#### This File is distributed under GPLv3 | ||
#### | ||
|
||
[ -n "$KLIPPERSCREEN_REPO_SHIP" ] || KLIPPERSCREEN_REPO_SHIP=https://github.com/KlipperScreen/KlipperScreen.git | ||
[ -n "$KLIPPERSCREEN_REPO_BRANCH" ] || KLIPPERSCREEN_REPO_BRANCH=master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
[update_manager KlipperScreen] | ||
type: git_repo | ||
path: ~/KlipperScreen | ||
origin: https://github.com/KlipperScreen/KlipperScreen.git | ||
virtualenv: ~/.KlipperScreen-env | ||
requirements: scripts/KlipperScreen-requirements.txt | ||
system_dependencies: scripts/system-dependencies.json | ||
managed_services: KlipperScreen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
#### KlipperScreen install module | ||
#### | ||
#### Written by Stephan Wendel aka KwadFan <[email protected]> | ||
#### Copyright 2024 - till today | ||
#### https://github.com/mainsail-crew/MainsailOS | ||
#### | ||
#### This File is distributed under GPLv3 | ||
#### | ||
# shellcheck enable=require-variable-braces | ||
|
||
# Source error handling, leave this in place | ||
set -Ee | ||
|
||
# Source CustomPIOS common.sh | ||
# shellcheck disable=SC1091 | ||
source /common.sh | ||
install_cleanup_trap | ||
|
||
# Module only Variables | ||
KS_BUILD_INSTALL_SH="/home/${BASE_USER}/KlipperScreen/scripts/KlipperScreen-install.sh" | ||
KS_MOONRAKER_CONF_PATH="/home/${BASE_USER}/printer_data/config/moonraker.conf" | ||
|
||
echo_green "Installing KlipperScreen and enable KlipperScreen Service ..." | ||
|
||
## Force apt update | ||
apt-get update | ||
## Make sure 'git' is installed! | ||
check_install_pkgs git | ||
|
||
## Step 1: Move to Home Dir as WorkingDirectoy | ||
pushd "/home/${BASE_USER}" &> /dev/null || exit 1 | ||
|
||
## Step 2: clone KlipperScreen repo | ||
gitclone KLIPPERSCREEN_REPO KlipperScreen | ||
|
||
## Step 3: Move to KlipperScreen as working directory | ||
pushd "/home/${BASE_USER}/KlipperScreen" &> /dev/null || exit 1 | ||
|
||
## Step 4: Run KlipperScreen install routine | ||
echo_green "Launch KlipperScreen install routine ..." | ||
sudo -u "${BASE_USER}" "${KS_BUILD_INSTALL_SH}" | ||
|
||
## Step 5: Update moonraker.conf | ||
if [[ -f "${KS_MOONRAKER_CONF_PATH}" ]]; then | ||
echo_green "Copying temporary file ..." | ||
unpack /filesystem/tmp /tmp root | ||
cat /tmp/ks_update_entry.txt >> "${KS_MOONRAKER_CONF_PATH}" | ||
else | ||
echo_red "File moonraker.conf not found ... [SKIPPED]" | ||
fi | ||
|
||
## Step 6: Leave KlipperScreen | ||
popd &> /dev/null || exit 1 | ||
|
||
## Step 7: leave home dir | ||
popd &> /dev/null || exit 1 | ||
|
||
## Step 8: Enable service | ||
echo_green "Enable KlipperScreen.service ..." | ||
systemctl_if_exists enable KlipperScreen.service | ||
|
||
## Finish | ||
echo_green "Installing KlipperScreen and enable KlipperScreen Service ... DONE!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters