From c9f920513f083e9694fa5c00b38566ea22c5ca9f Mon Sep 17 00:00:00 2001 From: Mikkel Schmidt Date: Mon, 3 May 2021 12:42:58 +0200 Subject: [PATCH] Swap mansail for fluidd --- src/config | 6 +- src/modules/fluidd/config | 1 + .../filesystem/home/pi/gcode_files/.ignoreme | 0 .../home/pi/klipper_config/client.cfg | 16 +++++ .../home/pi/klipper_config/client_macros.cfg | 54 ++++++++++++++++ .../filesystem/root/etc/logrotate.d/rsyslog | 39 ++++++++++++ .../root/etc/nginx/conf.d/common_vars.conf | 4 ++ .../root/etc/nginx/conf.d/upstreams.conf | 9 +++ .../root/etc/nginx/sites-available/fluidd | 63 +++++++++++++++++++ src/modules/fluidd/start_chroot_script | 31 +++++++++ .../home/pi/klipper_config/moonraker.conf | 25 +++++--- .../boot/{mainsail.txt => vcoreos.txt} | 2 +- .../filesystem/home/root/bin/webcamd | 10 +-- .../root/etc/systemd/system/webcamd.service | 2 +- .../ratrig/filesystem/home/pi/klipper/.config | 55 ++++++++++++++++ .../home/pi/klipper_config/printer.cfg | 46 ++++++++------ .../ratrig/filesystem/root/etc/init.d/vcore3 | 32 ++++++++++ src/modules/ratrig/start_chroot_script | 6 +- 18 files changed, 362 insertions(+), 39 deletions(-) create mode 100644 src/modules/fluidd/config create mode 100644 src/modules/fluidd/filesystem/home/pi/gcode_files/.ignoreme create mode 100644 src/modules/fluidd/filesystem/home/pi/klipper_config/client.cfg create mode 100644 src/modules/fluidd/filesystem/home/pi/klipper_config/client_macros.cfg create mode 100644 src/modules/fluidd/filesystem/root/etc/logrotate.d/rsyslog create mode 100644 src/modules/fluidd/filesystem/root/etc/nginx/conf.d/common_vars.conf create mode 100644 src/modules/fluidd/filesystem/root/etc/nginx/conf.d/upstreams.conf create mode 100644 src/modules/fluidd/filesystem/root/etc/nginx/sites-available/fluidd create mode 100644 src/modules/fluidd/start_chroot_script rename src/modules/mjpgstreamer/filesystem/boot/{mainsail.txt => vcoreos.txt} (98%) create mode 100644 src/modules/ratrig/filesystem/home/pi/klipper/.config create mode 100755 src/modules/ratrig/filesystem/root/etc/init.d/vcore3 diff --git a/src/config b/src/config index 5d364a240..505322d75 100644 --- a/src/config +++ b/src/config @@ -1,5 +1,7 @@ export DIST_NAME=VCoreOS -export DIST_VERSION=0.5.0 +export DIST_VERSION=0.7.0 export BASE_IMAGE_ENLARGEROOT=4000 export BASE_IMAGE_RESIZEROOT=500 -export MODULES="base(network,raspicam,klipper_moonraker,mainsail,mjpgstreamer,ratrig,password-for-sudo)" +export BASE_RELEASE_IMG_NAME=vcoreos-raspios-lite-latest.img +export BASE_IMG_NAME=vcoreos-raspios-lite-latest.img +export MODULES="base(network,raspicam,klipper_moonraker,fluidd,mjpgstreamer,ratrig,password-for-sudo)" diff --git a/src/modules/fluidd/config b/src/modules/fluidd/config new file mode 100644 index 000000000..be16a03c9 --- /dev/null +++ b/src/modules/fluidd/config @@ -0,0 +1 @@ +FLUIDD_VAR="This is a module variable" \ No newline at end of file diff --git a/src/modules/fluidd/filesystem/home/pi/gcode_files/.ignoreme b/src/modules/fluidd/filesystem/home/pi/gcode_files/.ignoreme new file mode 100644 index 000000000..e69de29bb diff --git a/src/modules/fluidd/filesystem/home/pi/klipper_config/client.cfg b/src/modules/fluidd/filesystem/home/pi/klipper_config/client.cfg new file mode 100644 index 000000000..f36549758 --- /dev/null +++ b/src/modules/fluidd/filesystem/home/pi/klipper_config/client.cfg @@ -0,0 +1,16 @@ +# These are required for Fluidd to correctly function. +# You can copy these entries into your printer.cfg. +# +# Alternatively, import this file by adding +# this line into your printer.cfg; +# +# [include client.cfg] + +# Virtual SD Card +[virtual_sdcard] +path: ~/gcode_files + +# Pause/Resume Functionality +[pause_resume] + +[display_status] diff --git a/src/modules/fluidd/filesystem/home/pi/klipper_config/client_macros.cfg b/src/modules/fluidd/filesystem/home/pi/klipper_config/client_macros.cfg new file mode 100644 index 000000000..d046b1851 --- /dev/null +++ b/src/modules/fluidd/filesystem/home/pi/klipper_config/client_macros.cfg @@ -0,0 +1,54 @@ +# These macros are required for Fluidd to correctly function. +# You can copy these entries into your printer.cfg. +# +# Alternatively, import this file by adding +# this line into your printer.cfg; +# +# [include client_macros.cfg] + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + TURN_OFF_HEATERS + CLEAR_PAUSE + SDCARD_RESET_FILE + BASE_CANCEL_PRINT + +[gcode_macro PAUSE] +rename_existing: BASE_PAUSE +# change this if you need more or less extrusion +variable_extrude: 1.0 +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} + {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + SAVE_GCODE_STATE NAME=PAUSE_state + BASE_PAUSE + G91 + G1 E-{E} F2100 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + +[gcode_macro RESUME] +rename_existing: BASE_RESUME +gcode: + ##### read E from pause macro ##### + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + ##### end of definitions ##### + G91 + G1 E{E} F2100 + RESTORE_GCODE_STATE NAME=PAUSE_state + BASE_RESUME diff --git a/src/modules/fluidd/filesystem/root/etc/logrotate.d/rsyslog b/src/modules/fluidd/filesystem/root/etc/logrotate.d/rsyslog new file mode 100644 index 000000000..af824897e --- /dev/null +++ b/src/modules/fluidd/filesystem/root/etc/logrotate.d/rsyslog @@ -0,0 +1,39 @@ +/var/log/syslog +{ + rotate 4 + daily + maxsize 256M + missingok + notifempty + delaycompress + compress + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + maxsize 256M + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +} diff --git a/src/modules/fluidd/filesystem/root/etc/nginx/conf.d/common_vars.conf b/src/modules/fluidd/filesystem/root/etc/nginx/conf.d/common_vars.conf new file mode 100644 index 000000000..0cc431c4f --- /dev/null +++ b/src/modules/fluidd/filesystem/root/etc/nginx/conf.d/common_vars.conf @@ -0,0 +1,4 @@ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} diff --git a/src/modules/fluidd/filesystem/root/etc/nginx/conf.d/upstreams.conf b/src/modules/fluidd/filesystem/root/etc/nginx/conf.d/upstreams.conf new file mode 100644 index 000000000..195e95fa0 --- /dev/null +++ b/src/modules/fluidd/filesystem/root/etc/nginx/conf.d/upstreams.conf @@ -0,0 +1,9 @@ +upstream apiserver { + ip_hash; + server 127.0.0.1:7125; +} + +upstream mjpgstreamer { + ip_hash; + server 127.0.0.1:8080; +} diff --git a/src/modules/fluidd/filesystem/root/etc/nginx/sites-available/fluidd b/src/modules/fluidd/filesystem/root/etc/nginx/sites-available/fluidd new file mode 100644 index 000000000..b3ce74d54 --- /dev/null +++ b/src/modules/fluidd/filesystem/root/etc/nginx/sites-available/fluidd @@ -0,0 +1,63 @@ +server { + listen 80 default_server; + + access_log /var/log/nginx/fluidd-access.log; + error_log /var/log/nginx/fluidd-error.log; + + # disable this section on smaller hardware like a pi zero + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_proxied expired no-cache no-store private auth; + gzip_comp_level 4; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml; + + # web_path from fluidd static files + root /home/pi/fluidd; + + index index.html; + server_name _; + + # disable max upload size checks + client_max_body_size 0; + + # disable proxy request buffering + proxy_request_buffering off; + + location / { + try_files $uri $uri/ /index.html; + } + + location = /index.html { + add_header Cache-Control "no-store, no-cache, must-revalidate"; + } + + location /websocket { + proxy_pass http://apiserver/websocket; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 86400; + } + + location ~ ^/(printer|api|access|machine|server)/ { + proxy_pass http://apiserver$request_uri; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + } + + location /webcam/ { + proxy_pass http://mjpgstreamer/; + } + + location = /vcore.log { + alias "/var/log/vcore.log"; + } +} diff --git a/src/modules/fluidd/start_chroot_script b/src/modules/fluidd/start_chroot_script new file mode 100644 index 000000000..1b6aada1e --- /dev/null +++ b/src/modules/fluidd/start_chroot_script @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Fluidd installation script +# Installs Fluidd and nginx +# Written by Craig Bassett +# Thanks to Raymond Himle +# GPL V3 +######## + + +# Source error handling, leave this in place +set -x +set -e + +source /common.sh +install_cleanup_trap + +unpack /filesystem/home/pi /home/pi pi + +echo "Installing nginx and Fluidd" + +apt update +apt install nginx -y +rm /etc/nginx/sites-enabled/default +ln -s /etc/nginx/sites-available/fluidd /etc/nginx/sites-enabled/ +cd /home/pi/ +sudo -u pi mkdir /home/pi/fluidd +sudo -u pi wget -q -O fluidd.zip https://github.com/cadriel/fluidd/releases/latest/download/fluidd.zip && sudo -u pi unzip fluidd.zip -d /home/pi/fluidd && rm fluidd.zip +# Run installation steps defined above + +# Unpack root at the end, so files are modified before +unpack /filesystem/root / diff --git a/src/modules/klipper_moonraker/filesystem/home/pi/klipper_config/moonraker.conf b/src/modules/klipper_moonraker/filesystem/home/pi/klipper_config/moonraker.conf index a09803e71..2492e8d48 100644 --- a/src/modules/klipper_moonraker/filesystem/home/pi/klipper_config/moonraker.conf +++ b/src/modules/klipper_moonraker/filesystem/home/pi/klipper_config/moonraker.conf @@ -6,6 +6,7 @@ config_path: ~/klipper_config [authorization] cors_domains: + *://app.fluidd.xyz https://my.mainsail.xyz http://my.mainsail.xyz http://*.local @@ -28,18 +29,24 @@ trusted_clients: # this enables moonraker's update manager [update_manager] -[update_manager client mainsail] -type: web -repo: meteyou/mainsail -path: ~/mainsail +# [update_manager client mainsail] +# type: web +# repo: meteyou/mainsail +# path: ~/mainsail -[update_manager client ratrig-theme] -type: git_repo -path: /home/pi/klipper_config/.theme -origin: https://github.com/Rat-Rig/mainsail-theme.git +# [update_manager client ratrig-theme] +# type: git_repo +# path: /home/pi/klipper_config/.theme +# origin: https://github.com/Rat-Rig/mainsail-theme.git [update_manager client vcore3] type: git_repo path: /home/pi/klipper_config/v-core-3 origin: https://github.com/Rat-Rig/v-core-3-klipper-config.git -install_script: /home/pi/klipper_config/v-core-3/scripts/vcore-install.sh \ No newline at end of file +install_script: /home/pi/klipper_config/v-core-3/scripts/vcore-install.sh + +# enables fluidd updates +[update_manager client fluidd] +type: web +repo: cadriel/fluidd +path: ~/fluidd \ No newline at end of file diff --git a/src/modules/mjpgstreamer/filesystem/boot/mainsail.txt b/src/modules/mjpgstreamer/filesystem/boot/vcoreos.txt similarity index 98% rename from src/modules/mjpgstreamer/filesystem/boot/mainsail.txt rename to src/modules/mjpgstreamer/filesystem/boot/vcoreos.txt index e8bd44c72..bc83704e8 100644 --- a/src/modules/mjpgstreamer/filesystem/boot/mainsail.txt +++ b/src/modules/mjpgstreamer/filesystem/boot/vcoreos.txt @@ -68,7 +68,7 @@ # # Current working directory is the mjpg-streamer base directory. # -#camera_http_webroot="./www-mainsail" +#camera_http_webroot="./www-vcoreos" #camera_http_options="-n" ### EXPERIMENTAL diff --git a/src/modules/mjpgstreamer/filesystem/home/root/bin/webcamd b/src/modules/mjpgstreamer/filesystem/home/root/bin/webcamd index 410209913..7f28f0137 100755 --- a/src/modules/mjpgstreamer/filesystem/home/root/bin/webcamd +++ b/src/modules/mjpgstreamer/filesystem/home/root/bin/webcamd @@ -5,7 +5,7 @@ ### ---------------------------------------------------------------- ### ### There is no need to edit this file for changing resolution, ### ### frame rates or any other mjpg-streamer parameters. Please edit ### -### /boot/mainsail.txt instead - that's what it's there for! You can ### +### /boot/vcoreos.txt instead - that's what it's there for! You can ### ### even do this with your Pi powered down by directly accessing the ### ### file when using the SD card as thumb drive in your regular ### ### computer. ### @@ -17,13 +17,13 @@ MJPGSTREAMER_INPUT_RASPICAM="input_raspicam.so" brokenfps_usb_devices=("046d:082b" "1908:2310" "0458:708c" "1e4e:0102" "0471:0311" "038f:6001" "046d:0804" "046d:0825" "046d:0994" "0ac8:3450") -config_dir="/boot/mainsail.conf.d" +config_dir="/boot/vcoreos.conf.d" echo "Starting up webcamDaemon..." echo "" cfg_files=() -cfg_files+=/boot/mainsail.txt +cfg_files+=/boot/vcoreos.txt if [[ -d ${config_dir} ]]; then cfg_files+=( `ls ${config_dir}/*.txt` ) fi @@ -41,7 +41,7 @@ array_assigned_device=() echo "--- Configuration: ----------------------------" for cfg_file in ${cfg_files[@]}; do - # init configuration - DO NOT EDIT, USE /boot/mainsail.conf.d/*.txt INSTEAD! + # init configuration - DO NOT EDIT, USE /boot/vcoreos.conf.d/*.txt INSTEAD! camera="auto" camera_usb_options="-r 640x480 -f 10" camera_raspi_options="-fps 10" @@ -54,7 +54,7 @@ for cfg_file in ${cfg_files[@]}; do fi usb_options="$camera_usb_options" - # if webcam device is explicitly given in /boot/mainsail.txt, save the path of the device + # if webcam device is explicitly given in /boot/vcoreos.txt, save the path of the device # to a variable and remove its parameter from usb_options extracted_device=`echo $usb_options | sed 's@.*-d \(/dev/\(video[0-9]\+\|v4l/[^ ]*\)\).*@\1@'` if [ "$extracted_device" != "$usb_options" ] diff --git a/src/modules/mjpgstreamer/filesystem/root/etc/systemd/system/webcamd.service b/src/modules/mjpgstreamer/filesystem/root/etc/systemd/system/webcamd.service index 8cd7b773b..49e6db7c1 100644 --- a/src/modules/mjpgstreamer/filesystem/root/etc/systemd/system/webcamd.service +++ b/src/modules/mjpgstreamer/filesystem/root/etc/systemd/system/webcamd.service @@ -1,6 +1,6 @@ [Unit] -Description=the OctoPi webcam daemon with the user specified config +Description=the VCoreOS webcam daemon with the user specified config [Service] WorkingDirectory=/root/bin diff --git a/src/modules/ratrig/filesystem/home/pi/klipper/.config b/src/modules/ratrig/filesystem/home/pi/klipper/.config new file mode 100644 index 000000000..7879cb4a1 --- /dev/null +++ b/src/modules/ratrig/filesystem/home/pi/klipper/.config @@ -0,0 +1,55 @@ +# CONFIG_LOW_LEVEL_OPTIONS is not set +# CONFIG_MACH_AVR is not set +# CONFIG_MACH_ATSAM is not set +# CONFIG_MACH_ATSAMD is not set +# CONFIG_MACH_LPC176X is not set +CONFIG_MACH_STM32=y +# CONFIG_MACH_PRU is not set +# CONFIG_MACH_LINUX is not set +# CONFIG_MACH_SIMU is not set +CONFIG_STEP_DELAY=2 +CONFIG_BOARD_DIRECTORY="stm32" +CONFIG_MCU="stm32f407xx" +CONFIG_CLOCK_FREQ=168000000 +CONFIG_USBSERIAL=y +CONFIG_FLASH_START=0x8008000 +CONFIG_FLASH_SIZE=0x80000 +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=0x20000 +CONFIG_STACK_SIZE=512 +CONFIG_STM32_SELECT=y +# CONFIG_MACH_STM32F103 is not set +# CONFIG_MACH_STM32F207 is not set +# CONFIG_MACH_STM32F401 is not set +# CONFIG_MACH_STM32F405 is not set +CONFIG_MACH_STM32F407=y +# CONFIG_MACH_STM32F429 is not set +# CONFIG_MACH_STM32F446 is not set +# CONFIG_MACH_STM32F031 is not set +# CONFIG_MACH_STM32F042 is not set +# CONFIG_MACH_STM32F070 is not set +CONFIG_MACH_STM32F4=y +CONFIG_HAVE_STM32_USBOTG=y +CONFIG_HAVE_STM32_CANBUS=y +# CONFIG_STM32_FLASH_START_C000 is not set +CONFIG_STM32_FLASH_START_8000=y +# CONFIG_STM32_FLASH_START_4000 is not set +# CONFIG_STM32_FLASH_START_0000 is not set +CONFIG_CLOCK_REF_FREQ=8000000 +CONFIG_STM32F0_TRIM=16 +CONFIG_STM32_USB_PA11_PA12=y +# CONFIG_STM32_SERIAL_USART1 is not set +# CONFIG_STM32_CANBUS_PA11_PA12 is not set +CONFIG_CANBUS_FREQUENCY=500000 +CONFIG_USB_VENDOR_ID=0x1d50 +CONFIG_USB_DEVICE_ID=0x614e +CONFIG_USB_SERIAL_NUMBER_CHIPID=y +CONFIG_USB_SERIAL_NUMBER="12345" +CONFIG_HAVE_GPIO=y +CONFIG_HAVE_GPIO_ADC=y +CONFIG_HAVE_GPIO_SPI=y +CONFIG_HAVE_GPIO_I2C=y +CONFIG_HAVE_GPIO_BITBANGING=y +CONFIG_HAVE_STRICT_TIMING=y +CONFIG_HAVE_CHIPID=y +CONFIG_INLINE_STEPPER_HACK=y diff --git a/src/modules/ratrig/filesystem/home/pi/klipper_config/printer.cfg b/src/modules/ratrig/filesystem/home/pi/klipper_config/printer.cfg index 7e807ccc0..d613167ad 100644 --- a/src/modules/ratrig/filesystem/home/pi/klipper_config/printer.cfg +++ b/src/modules/ratrig/filesystem/home/pi/klipper_config/printer.cfg @@ -3,12 +3,20 @@ # In case of another board / printer, you can overwrite this file # with your own config. -### BASE SETIP +# You'll be able to print just fine with this config as it is, but it is recommended +# that you follow these steps to properly calibrate your printer: +# 0) Sanity check and PID Tuning: https://www.klipper3d.org/Config_checks.html +# 1) Pressure Advance: https://www.klipper3d.org/Pressure_Advance.html +# 2) Skew Correction: https://www.klipper3d.org/skew_correction.html +# 3) Resonance Compensation: https://www.klipper3d.org/Resonance_Compensation.html + +# Read more about klipper here: https://www.klipper3d.org/Overview.html + +### BASE SETUP [include v-core-3/v-core-3.cfg] [include v-core-3/steppers.cfg] - -### MACROS -[include v-core-3/macros.cfg] +# Uncomment this next line if you have an ADXL345 connected to the SKR PRO +#[include v-core-3/adxl345.cfg] ### HOMING # Z-Probe @@ -23,15 +31,13 @@ home_xy_position: 150,150 # 300 #home_xy_position: 200,200 # 400 #home_xy_position: 250,250 # 500 -# Sensorless homing -#[include v-core-3/sensorless-homing.cfg] - # Endstop position -[stepper_x] -position_endstop: 0 # Adjust this to your setup - [stepper_y] -position_endstop: 0 # Adjust this to your setup +position_endstop: 300 # Adjust this to your setup + +# Sensorless homing (Beware: this requires tinkering and does not work if your x/y stepper drivers +# have clipped DIAG pins). +#[include v-core-3/sensorless-homing.cfg] ### PHYSICAL DIMENSIONS # Remove the # from your printer size below. @@ -43,12 +49,10 @@ position_endstop: 0 # Adjust this to your setup ### SPEED & ACCEL # Acceleration # Check https://www.klipper3d.org/Resonance_Compensation.html for input shaper calibration. -[printer] -max_velocity: 300 -max_accel: 1500 -max_accel_to_decel: 750 -max_z_velocity: 15 -max_z_accel: 20 +[include v-core-3/speed-limits-basic.cfg] +# Do not enable this next line without actively cooled steppers. +#[include v-core-3/speed-limits-performance.cfg] + ### EXTRUSION [include v-core-3/bmg.cfg] @@ -59,14 +63,14 @@ max_z_accel: 20 [extruder] pressure_advance: 0.06 -# Hotend heating +### HOTEND HEATING # PID Tuning (Remember to run PID tuning before printing) control: pid pid_kp: 28.413 pid_ki: 1.334 pid_kd: 151.300 -# Bed heating +### BED HEATING # BED PID Tuning (Remember to run PID tuning before printing) [heater_bed] control: pid @@ -74,6 +78,10 @@ pid_Kp: 22.2 pid_Ki: 1.08 pid_Kd: 114 + +### MACROS +[include v-core-3/macros.cfg] + # Print macros. Call these from your slicer (custom g-code). # You can Modify these to your liking. # Prusa Slicer Example: diff --git a/src/modules/ratrig/filesystem/root/etc/init.d/vcore3 b/src/modules/ratrig/filesystem/root/etc/init.d/vcore3 new file mode 100755 index 000000000..891c55b5a --- /dev/null +++ b/src/modules/ratrig/filesystem/root/etc/init.d/vcore3 @@ -0,0 +1,32 @@ +#!/bin/sh +# System startup script vcore3 + +### BEGIN INIT INFO +# Provides: vcore3 +# Required-Start: $local_fs +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: vcore3 dummy service +# Description: Does nothing at this point. +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +logfile="/var/log/vcore.log" + +case "$1" in +start) + echo "$(date +"%Y-%m-%d %T"): Updating vcore3" >> "$logfile" + echo "RESTART" > /tmp/klipper + ;; +stop) + echo "$(date +"%Y-%m-%d %T"): Stopping vcore3" >> "$logfile" + ;; +restart) + echo "$(date +"%Y-%m-%d %T"): Updating vcore3" >> "$logfile" + ;; +*) + exit 2 + ;; +esac +exit 0 diff --git a/src/modules/ratrig/start_chroot_script b/src/modules/ratrig/start_chroot_script index b84fb14b5..e73e37fcb 100644 --- a/src/modules/ratrig/start_chroot_script +++ b/src/modules/ratrig/start_chroot_script @@ -18,9 +18,11 @@ echo "Rat Rig V-Core 3" cd /home/pi/klipper_config gitclone RATRIG_VCORE_KLIPPER_CONFIG v-core-3 -gitclone RATRIG_MAINSAIL_THEME .theme +# gitclone RATRIG_MAINSAIL_THEME .theme # Run install script sudo -u pi bash /home/pi/klipper_config/v-core-3/scripts/vcore-install.sh -unpack /filesystem/root / \ No newline at end of file +unpack /filesystem/root / + +sudo update-rc.d vcore3 defaults \ No newline at end of file