Skip to content

Commit

Permalink
Created KlipperLCD module
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil Azrael committed Aug 6, 2024
1 parent 6a9f365 commit bcb77da
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 86 deletions.
2 changes: 1 addition & 1 deletion config/armbian/artillery3d-x4
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ JSON_SUPPORTED_SBC="artillery3d-x4"
KLIPPER_REPO_SHIP="https://github.com/eazrael/klipper.git"
KLIPPER_REPO_BRANCH="artilleryx4"

MODULES="base(dnsfix(pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar,kiauh,artilleryx4config,vocore)))"
MODULES="base(dnsfix(pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar,kiauh,artilleryx4config)))"


# export Variables
Expand Down
2 changes: 1 addition & 1 deletion config/armbian/artillery3d-x4-emmc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ JSON_SUPPORTED_SBC="artillery3d-x4-emmc"
KLIPPER_REPO_SHIP="https://github.com/eazrael/klipper.git"
KLIPPER_REPO_BRANCH="artilleryx4"

MODULES="base(dnsfix(pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar,kiauh,artilleryx4config,vocore)))"
MODULES="base(dnsfix(pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar,kiauh,artilleryx4config)))"

BASE_IMAGE_ENLARGEROOT=0
BASE_IMAGE_RESIZEROOT=0
Expand Down
38 changes: 38 additions & 0 deletions config/armbian/artillery3d-x4-emmc-eazrael
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Shebang for better file detection
# shellcheck enable=require-variable-braces
ARTILLERY_X4_MODEL="plus"
BASE_ARCH="arm64"

# Image source
#DOWNLOAD_BASE_URL="https://evilazrael.net/tmp/armbian"
#DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/Armbian_24.5.0-trunk_Artilleryx4_bookworm_current_6.6.31.img.xz.sha"
#DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/Armbian_24.5.0-trunk_Artilleryx4_bookworm_current_6.6.31.img.xz"

### JSON sniplet Setup
### NOTE: Please see all config files for setup variables!!!
# shellcheck disable=SC2034
JSON_PRETTY_SBC_NAME="Artillery3D X4 EMMC eazrael"
# shellcheck disable=SC2034
JSON_SUPPORTED_SBC="artillery3d-x4-emmc-eazrael"

KLIPPER_REPO_SHIP="https://github.com/eazrael/klipper.git"
KLIPPER_REPO_BRANCH="artilleryx4"

MODULES="base(dnsfix(pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar,kiauh,artilleryx4config,vocore,klipper_lcd)))"

BASE_IMAGE_ENLARGEROOT=0
BASE_IMAGE_RESIZEROOT=0

# export Variables
export ARTILLERY_X4_MODEL
export BASE_ARCH
export BASE_IMAGE_ENLARGEROOT
export BASE_IMAGE_RESIZEROOT
export DOWNLOAD_URL_CHECKSUM
export DOWNLOAD_URL_IMAGE
export KLIPPER_REPO_BRANCH
export KLIPPER_REPO_SHIP
export MAKEFLAGS
export MODULES

This file was deleted.

12 changes: 0 additions & 12 deletions src/modules/artilleryx4config/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ ln -s "/home/${BASE_USER}/klipper/config/printer-artillery-sidewinder-x4-macros.
"/home/${BASE_USER}/printer_data/config/macros.cfg"
chown -h "${BASE_USER}:${BASE_USER}" "/home/${BASE_USER}/printer_data/config/"*.cfg

if [ -n "${ARTILLERY_X4_PKGS}" ] ; then
echo_green "Install additional requirements"
# shellcheck disable=SC1091
check_install_pkgs ${ARTILLERY_X4_PKGS}
fi

# TODO: push this to klipperLCD module
# echo_green "Install KlipperLCD"
# pushd /home/"${BASE_USER}"/klipper &> /dev/null || exit 1
# gitclone KLIPPERLCD_REPO klipperlcd
# popd &> /dev/null || exit 1

echo_green "Enable linux kernel verbose logging"
sed -i 's/^kernel.printk/#&/' /etc/sysctl.conf
sed -i 's/^verbosity=1$/verbosity=8/' "${ARMBIAN_CONFIG_TXT_FILE}"
Expand Down
21 changes: 21 additions & 0 deletions src/modules/klipper_lcd/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Shebang for better file detection
#### mainsail module config
####
#### Based on work of:
#### Raymond Himle and meteyou
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2021 - 2022
#### https://github.com/mainsail-crew/MainsailOS
####
#### This File is distributed under GPLv3
####

[[ -n "${KLIPPERLCD_PKGS}" ]] || KLIPPERLCD_PKGS="python3-serial python3-requests"

# Support for the stock display computer
#[[ -n "$KLIPPERLCD_REPO_SHIP" ]] || KLIPPERLCD_REPO_SHIP="https://github.com/joakimtoe/KlipperLCD.git"
#[[ -n "$KLIPPERLCD_REPO_BRANCH" ]] || KLIPPERLCD_REPO_BRANCH="master"

export KLIPPERLCD_PKGS
41 changes: 41 additions & 0 deletions src/modules/klipper_lcd/start_chroot_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
#### artillery x4 config module
####
#### Based on work of:
#### Raymond Himle and meteyou
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2021 - 2022
#### 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

# Set LC_ALL to prevent errors
export LC_ALL=C

# Source CustomPIOS common.sh
# shellcheck disable=SC1091
source /common.sh
install_cleanup_trap

# echo_green "Install KlipperLCD"

if [ -n "${KLIPPERLCD_PKGS}" ] ; then
echo_green "Install additional requirements"
# shellcheck disable=SC2086
check_install_pkgs ${KLIPPERLCD_PKGS}
fi

echo_green "Install KlipperLCD"
pushd "/home/${BASE_USER}/klipper" &> /dev/null || exit 1
gitclone KLIPPERLCD_REPO klipperlcd
# TODO: missing installation code
popd &> /dev/null || exit 1

echo_green "Finished KlipperLCD installation"
2 changes: 1 addition & 1 deletion src/modules/vocore/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cd vocore2/utils/fbusb/src &>/dev/null || exit 1
# patch fbusb for newer kernels
sed -i 's/ FBINFO_DEFAULT | //' fbusb.c

make -C "/usr/src/${linux_header_dir}/" M=$(pwd) modules # compile
make -C "/usr/src/${linux_header_dir}/" M="$(pwd)" modules # compile
sudo mkdir -p "/lib/modules/${kernel_version}/extra"
sudo cp fbusb.ko "/lib/modules/${kernel_version}/extra/" # install module
sudo depmod -v -a "${kernel_version}" 1>&2 # for autoloading
Expand Down

0 comments on commit bcb77da

Please sign in to comment.