Files
klipper-linux/setup.sh
Sergey 'Jin' Bostandzhyan 250fe23a59 First buildable version
This is by no means complete, there's a lot to be done on the setup and
configuration side and klipper MCU firmware builds are missing as well.

The rootfs itself should be device independent (although you'd probably
have to pull in machine specific layers), the image recipe is specific
to the ASUS TinkerBoard S.

Overall goal is to be able to build this distro for any target that is
supported by Yocto. The distro should be "single purpose", i.e. no
desktop like Armbian etc, but just provide a minimalistic setup for
printing with a possibility to select and upload your klipper config.

OctoPrint is included but should be optional (i.e. I'd like to be able
to turn it off and just "print from SD" via the local LCD menu.

TODOs of the top of my head:
* add MCU firmware builds (probably via a multiconfig setup)
* add lighttpd with a central entry page and a minimalistic web UI

For the web UI:
* add a possibility to select existing klipper configs and to upload custom
  klipper configs
* add an option to enable/disable OctoPrint
* backup/restore configuration

To build for the tinker board:

$ source setup.sh targets/tinker-board-s/
$ bitbake klipper-image-tinker-board-s

Flashable wic/wic.bmap (use bmaptool) will be located in:

klipper-linux-build/build/deploy/images/tinker-board-s
2020-05-27 00:34:02 +02:00

29 lines
1004 B
Bash
Executable File

#!/bin/sh
unset BBPATH BBLAYERS BB_ENV_EXTRAWHITE DL_DIR YOCTO_TOPDIR BUILDDIR
unset LD_LIBRARY_PATH
export YOCTO_TOPDIR=`pwd`
# get rid of trailing and leading slashes
TARGET_CONFIG="$(echo $1 | sed -e 's|^/||' -e 's|/$||')"
export BBPATH=${YOCTO_TOPDIR}/${TARGET_CONFIG}
export BUILDDIR=${YOCTO_TOPDIR}/${TARGET_CONFIG}
export DL_DIR=${YOCTO_TOPDIR}/downloads
export BB_ENV_EXTRAWHITE="YOCTO_TOPDIR DL_DIR BUILDDIR PYTHONPATH"
export PATH=${YOCTO_TOPDIR}/yocto/poky/scripts:${YOCTO_TOPDIR}/yocto/poky/bitbake/bin:${PATH}
export PYTHONPATH=${YOCTO_TOPDIR}/yocto/poky/bitbake/lib
if [ ! -d /opt/poky/3.0 ]; then
echo "Please install http://downloads.yoctoproject.org/releases/yocto/yocto-3.0/buildtools/x86_64-buildtools-nativesdk-standalone-3.0.sh"
else
source /opt/poky/3.0/environment-setup-x86_64-pokysdk-linux
export PYTHONPATH=$PYTHONPATH:/opt/poky/3.0/sysroots/x86_64-pokysdk-linux/usr/lib/python3.7/site-packages/
fi
echo "Setup complete for $TARGET_CONFIG"
cd $TARGET_CONFIG