WIP Script

This commit is contained in:
Elizabeth Cray 2024-04-08 00:50:36 -04:00
parent 73a53f1b12
commit b87a39c376
6 changed files with 1365 additions and 5 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,7 @@
[submodule "dirs/klipper"] [submodule "dirs/klipper"]
path = dirs/klipper path = dirs/klipper
url = https://github.com/Klipper3d/klipper url = https://github.com/Klipper3d/klipper
[submodule "dirs/moonraker"]
path = dirs/moonraker
url = https://github.com/Arksine/moonraker

View File

@ -4,10 +4,9 @@ Huge WIP FYI
## TODO ## TODO
* Install prerequisites * ~~Select Klipper config and copy to ./dirs/klipper~~
* Select Klipper config and copy to ./dirs/klipper * ~~Compile Klipper in ./dirs/klipper~~
* Compile Klipper in ./dirs/klipper * ~~Install Klipper onto USB device (TUI picker, save device path for later)~~
* Install Klipper onto USB device (TUI picker, save device path for later)
* Edit config files accordingly * Edit config files accordingly
* Recursive Copy dirs into `~/<printername>/` * Recursive Copy dirs into `~/<printername>/`
* Install System services * Install System services

17
config/apt-packages Normal file
View File

@ -0,0 +1,17 @@
git
virtualenv
python-dev
libffi-dev
build-essential
libncurses-dev
libusb-dev
avrdude
gcc-avr
binutils-avr
avr-libc
stm32flash
dfu-util
libnewlib-arm-none-eabi
gcc-arm-none-eabi
binutils-arm-none-eabi
libusb-1.0

1294
config/drwho-packages Normal file

File diff suppressed because it is too large Load Diff

@ -1 +0,0 @@
Subproject commit 0a1c82a144b2c68ecb37030cfd08493b9f2b1b23

View File

@ -0,0 +1,47 @@
#!/bin/bash
ROOT_DIR="$(dirname "$0")"
cd $ROOT_DIR
# TODO: add CMD line args
# - skip makeconfig
# Pull Klipper
git submodule update --init --recursive
# Select Klipper Config
cd dirs/klipper
make menuconfig
CONFIG_FILES=(`ls config`)
let i=0
C=()
for f in ${CONFIG_FILES[@]}; do
C+=($i $f)
let i+=1
done
CONFIG_INDEX=$(dialog --backtitle "drwho@hackers.town" --title "Printer Selection" --menu "Select Printer Config" --output-fd 1 40 0 1 ${C[@]})
CONFIG_FILE=${CONFIG_FILES[$CONFIG_INDEX]}
# Select Serial Device
DEVICES=(`ls /dev/serial/by-id/`)
let i=0
C=()
for f in ${DEVICES[@]}; do
C+=($i $f)
let i+=1
done
DEVICE_INDEX=$(dialog --backtitle "drwho@hackers.town" --title "USB Device Selection" --menu "Select USB Device" --output-fd 1 40 0 1 ${C[@]})
DEVICE=${DEVICES[$DEVICE_INDEX]}
# Build Klipper
cat ./config/$CONFIG_FILE | sed -e "s/^serial: .\+$/serial: \/dev\/serial\/by-id\/${DEVICE}/" > ./printer.cfg
make -j$(nproc)
# Flash Firmware
make flash FLASH_DEVICE=/dev/serial/by-id/$DEVICE
# Copy over printer config file
cd $ROOT_DIR
cp dirs/klipper/printer.cfg dirs/printer_data/config/printer.cfg
# Apply Edits to Configs