Added OctoPrint service, made NoDM actually work
Changed the NoDM config so that it evaluated variables Added OctoPrint service file Started work on custom config tools Browser now checks to see if OctoPrint is running before launching browser
This commit is contained in:
parent
99c4fbb46d
commit
76200d1b89
8 changed files with 42 additions and 10 deletions
|
@ -4,6 +4,7 @@ install -d "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d"
|
|||
install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf"
|
||||
install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab"
|
||||
install -m 755 files/.xprofile "${ROOTFS_DIR}/etc/skel/.xprofile"
|
||||
install -m 755 files/.browser.sh "${ROOTFS_DIR}/etc/skel/.browser.sh"
|
||||
mkdir -p "${ROOTFS_DIR}/etc/skel/.config/openbox"
|
||||
install -m 644 files/autostart "${ROOTFS_DIR}/etc/skel/.config/openbox/autostart"
|
||||
|
||||
|
|
8
stage1/01-sys-tweaks/files/.browser.sh
Normal file
8
stage1/01-sys-tweaks/files/.browser.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Wait until OctoPrint comes up
|
||||
while ! curl localhost:5000 2>&1 >/dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
surf -d -F -g -K -n -p localhost:5000
|
|
@ -1 +1 @@
|
|||
surf -d -F -g -K -n -p google.com &
|
||||
bash ~/.browser.sh &
|
||||
|
|
4
stage1/03-install-packages/01-run.sh
Executable file
4
stage1/03-install-packages/01-run.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
mkdir -p "${ROOTFS_DIR}/usr/local/bin/"
|
||||
install -m 755 files/octo-config "${ROOTFS_DIR}/usr/local/bin/octo-config"
|
3
stage1/03-install-packages/files/octo-config
Executable file
3
stage1/03-install-packages/files/octo-config
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
|
@ -1,13 +1,17 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
install -m 644 files/octoprint.service ${ROOTFS_DIR}/etc/systemd/system/octoprint.service
|
||||
|
||||
on_chroot << EOF
|
||||
if [ -d /home/octoprint ]; then
|
||||
cd /home/octoprint || exit 1
|
||||
mkdir OctoPrint || exit 1
|
||||
cd OctoPrint || exit 1
|
||||
virtualenv venv || exit 1
|
||||
source venv/bin/activate || exit 1
|
||||
pip install pip --upgrade || exit 1
|
||||
pip install octoprint || exit 1
|
||||
if ! pip list | grep -F octoprint; then
|
||||
if [ -d /home/octoprint ]; then
|
||||
cd /home/octoprint || exit 1
|
||||
if [[ ! -d OctoPrint ]]; then mkdir OctoPrint; fi || exit 1
|
||||
cd OctoPrint || exit 1
|
||||
virtualenv venv || exit 1
|
||||
source venv/bin/activate || exit 1
|
||||
pip install pip --upgrade || exit 1
|
||||
pip install octoprint || exit 1
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
|
|
12
stage2/04-octoprint/files/octoprint.service
Normal file
12
stage2/04-octoprint/files/octoprint.service
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=OctoPrint Daemon
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=octoprint
|
||||
Group=octoprint
|
||||
ExecStart=/home/octoprint/OctoPrint/venv/bin/octoprint serve
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#echo -n -e "NODM_USER=${FIRST_USER_NAME}\nNODM_XSESSION=/home/${FIRST_USER_NAME}/.xprofile" > ${ROOTFS_DIR}/etc/nodm.conf
|
||||
|
||||
cat > /etc/default/nodm << 'EOF'
|
||||
cat > ${ROOTFS_DIR}/etc/default/nodm << EOF
|
||||
# nodm configuration
|
||||
|
||||
# Set NODM_ENABLED to something different than 'false' to enable nodm
|
||||
|
|
Loading…
Reference in a new issue