From 5c72a8acf94565c8c92e636a0f558682972993f8 Mon Sep 17 00:00:00 2001 From: Logan Gartner Date: Tue, 11 Aug 2020 03:18:14 -0600 Subject: [PATCH] Fixed NoDM and OctoPrint building --- stage1/01-sys-tweaks/00-run.sh | 4 +++- stage2/04-octoprint/01-run.sh | 6 ++++-- stage3/00-install-packages/01-run.sh | 2 +- stage3/00-install-packages/files/nodm.conf | 2 -- 4 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 stage3/00-install-packages/files/nodm.conf diff --git a/stage1/01-sys-tweaks/00-run.sh b/stage1/01-sys-tweaks/00-run.sh index 843408a..de17df8 100755 --- a/stage1/01-sys-tweaks/00-run.sh +++ b/stage1/01-sys-tweaks/00-run.sh @@ -11,7 +11,9 @@ on_chroot << EOF if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then adduser --disabled-password --gecos "" ${FIRST_USER_NAME} fi -adduser --disabled-password --gecos "" octoprint +if ! id -u octoprint >/dev/null 2>&1; then + adduser --disabled-password --gecos "" octoprint +fi echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd echo "octoprint:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c20)" | chpasswd echo "root:$(cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c20)" | chpasswd diff --git a/stage2/04-octoprint/01-run.sh b/stage2/04-octoprint/01-run.sh index bb4ea2f..1a8cc90 100755 --- a/stage2/04-octoprint/01-run.sh +++ b/stage2/04-octoprint/01-run.sh @@ -1,6 +1,7 @@ #!/bin/bash -e -if [ -d /home/octoprint ]; +on_chroot << EOF +if [ -d /home/octoprint ]; then cd /home/octoprint || exit 1 mkdir OctoPrint || exit 1 cd OctoPrint || exit 1 @@ -8,4 +9,5 @@ if [ -d /home/octoprint ]; source venv/bin/activate || exit 1 pip install pip --upgrade || exit 1 pip install octoprint || exit 1 -fi +fi +EOF diff --git a/stage3/00-install-packages/01-run.sh b/stage3/00-install-packages/01-run.sh index e3b6820..580ecfb 100755 --- a/stage3/00-install-packages/01-run.sh +++ b/stage3/00-install-packages/01-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -echo -n -e "NODM_USER=${FIRST_USER_NAME}\nNODM_XSESSION=/home/${FIRST_USER_NAME}/.xprofile" > /etc/nodm.conf +echo -n -e "NODM_USER=${FIRST_USER_NAME}\nNODM_XSESSION=/home/${FIRST_USER_NAME}/.xprofile" > ${ROOTFS_DIR}/etc/nodm.conf on_chroot << EOF update-alternatives --install /usr/bin/x-www-browser \ diff --git a/stage3/00-install-packages/files/nodm.conf b/stage3/00-install-packages/files/nodm.conf deleted file mode 100644 index 2c12a0f..0000000 --- a/stage3/00-install-packages/files/nodm.conf +++ /dev/null @@ -1,2 +0,0 @@ -NODM_USER=pi -NODM_XSESSION=/home/pi/.xprofile