mirror of
https://github.com/dimalo/klipper-web-control-docker.git
synced 2026-05-06 20:45:38 +02:00
add linux mcu
add firmware build script (WIP)
This commit is contained in:
16
build_firmware.sh
Executable file
16
build_firmware.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!zsh
|
||||
|
||||
BASE=$(pwd)
|
||||
echo $BASE
|
||||
TARGET=linux
|
||||
CONFIG_NAME=".config_${TARGET}"
|
||||
CONFIG_PATH=${BASE}/${CONFIG_NAME}
|
||||
touch ${CONFIG_PATH}
|
||||
BUILD_DIR=${BASE}/klipper_build_${TARGET}
|
||||
mkdir -p ${BUILD_DIR}
|
||||
CONTAINER=$(docker run -d -v ${CONFIG_PATH}:/home/klippy/klipper/.config -v ${BUILD_DIR}:/home/klippy/klipper/out klipper-builder sleep infinity)
|
||||
docker exec -it ${CONTAINER} make menuconfig
|
||||
docker exec ${CONTAINER} make
|
||||
docker exec ${CONTAINER} make flash
|
||||
docker stop ${CONTAINER}
|
||||
docker rm ${CONTAINER}
|
||||
23
klipper/.config_linux
Normal file
23
klipper/.config_linux
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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 is not set
|
||||
# CONFIG_MACH_RP2040 is not set
|
||||
# CONFIG_MACH_PRU is not set
|
||||
CONFIG_MACH_LINUX=y
|
||||
# CONFIG_MACH_SIMU is not set
|
||||
CONFIG_BOARD_DIRECTORY="linux"
|
||||
CONFIG_CLOCK_FREQ=50000000
|
||||
CONFIG_LINUX_SELECT=y
|
||||
CONFIG_USB_VENDOR_ID=0x1d50
|
||||
CONFIG_USB_DEVICE_ID=0x614e
|
||||
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_HARD_PWM=y
|
||||
CONFIG_HAVE_GPIO_BITBANGING=y
|
||||
CONFIG_INLINE_STEPPER_HACK=y
|
||||
@@ -30,6 +30,10 @@ RUN ${KLIPPER_VENV_DIR}/bin/python -m pip install pip -U
|
||||
RUN ${KLIPPER_VENV_DIR}/bin/pip install wheel
|
||||
RUN ${KLIPPER_VENV_DIR}/bin/pip install -r klipper/scripts/klippy-requirements.txt
|
||||
|
||||
COPY klipper/.config_linux /home/klippy/klipper/.config
|
||||
|
||||
RUN cd ${HOME}/klipper && make
|
||||
|
||||
# Install moonraker
|
||||
RUN git clone --single-branch --branch ${MOONRAKER_BRANCH} https://github.com/Arksine/moonraker.git moonraker
|
||||
RUN [ ! -d ${MOONRAKER_VENV_DIR} ] && python3 -m venv ${MOONRAKER_VENV_DIR}
|
||||
@@ -105,12 +109,13 @@ EXPOSE 7125
|
||||
|
||||
USER root
|
||||
|
||||
COPY --chown=${USER}:${USER} --from=builder ${HOME}/klipper/out/klipper.elf /usr/local/bin/klipper_mcu
|
||||
COPY --chown=${USER}:${USER} --from=builder ${HOME}/klipper ${HOME}/klipper
|
||||
COPY --chown=${USER}:${USER} --from=builder ${KLIPPER_VENV_DIR} ${KLIPPER_VENV_DIR}
|
||||
COPY --chown=${USER}:${USER} --from=builder ${HOME}/moonraker ${HOME}/moonraker
|
||||
COPY --chown=${USER}:${USER} --from=builder ${MOONRAKER_VENV_DIR} ${MOONRAKER_VENV_DIR}
|
||||
COPY --chown=${USER}:${USER} config ${CONFIG_DIR}
|
||||
|
||||
COPY klipper/supervisord.conf /etc/supervisord/conf.d/supervisord.conf
|
||||
COPY klipper/*.ini /etc/supervisord/
|
||||
CMD ["supervisord", "-c", "/etc/supervisord/conf.d/supervisord.conf"]
|
||||
COPY klipper/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY klipper/*.ini /etc/supervisor/
|
||||
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||
|
||||
10
klipper/klipper_mcu.ini
Normal file
10
klipper/klipper_mcu.ini
Normal file
@@ -0,0 +1,10 @@
|
||||
[program:klipper_mcu]
|
||||
user=root
|
||||
command=/usr/local/bin/klipper_mcu -r
|
||||
stdout_logfile=/dev/fd/1
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile=/dev/fd/2
|
||||
stderr_logfile_maxbytes = 0
|
||||
autorestart=true
|
||||
autostart=false
|
||||
dependent_startup=true
|
||||
Reference in New Issue
Block a user