Merge pigen to master
This commit is contained in:
parent
87ebff5bca
commit
d88367000b
3 changed files with 21 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
<<<<<<< HEAD
|
||||||
# TouchPrint
|
# TouchPrint
|
||||||
TouchPrint is a lightweight fork of Raspberry Pi OS whos purpose is to host OctoPrint and to display it on a connected screen.
|
TouchPrint is a lightweight fork of Raspberry Pi OS whos purpose is to host OctoPrint and to display it on a connected screen.
|
||||||
TouchPrint is very customizable, and both the GUI and/or OctoPrint can be disabled if you already have an existing setup to perform those tasks.
|
TouchPrint is very customizable, and both the GUI and/or OctoPrint can be disabled if you already have an existing setup to perform those tasks.
|
||||||
|
|
8
build.sh
8
build.sh
|
@ -172,6 +172,7 @@ export WPA_ESSID
|
||||||
export WPA_PASSWORD
|
export WPA_PASSWORD
|
||||||
export WPA_COUNTRY
|
export WPA_COUNTRY
|
||||||
export ENABLE_SSH="${ENABLE_SSH:-0}"
|
export ENABLE_SSH="${ENABLE_SSH:-0}"
|
||||||
|
export PUBKEY_ONLY_SSH="${PUBKEY_ONLY_SSH:-0}"
|
||||||
|
|
||||||
export LOCALE_DEFAULT="${LOCALE_DEFAULT:-en_US.UTF-8}"
|
export LOCALE_DEFAULT="${LOCALE_DEFAULT:-en_US.UTF-8}"
|
||||||
|
|
||||||
|
@ -182,6 +183,8 @@ export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-UTC}"
|
||||||
|
|
||||||
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
||||||
|
|
||||||
|
export PUBKEY_SSH_FIRST_USER
|
||||||
|
|
||||||
export CLEAN
|
export CLEAN
|
||||||
export IMG_NAME
|
export IMG_NAME
|
||||||
export APT_PROXY
|
export APT_PROXY
|
||||||
|
@ -227,6 +230,11 @@ if [[ -n "${WPA_PASSWORD}" && ${#WPA_PASSWORD} -lt 8 || ${#WPA_PASSWORD} -gt 63
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${PUBKEY_ONLY_SSH}" = "1" && -z "${PUBKEY_SSH_FIRST_USER}" ]]; then
|
||||||
|
echo "Must set 'PUBKEY_SSH_FIRST_USER' to a valid SSH public key if using PUBKEY_ONLY_SSH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "${WORK_DIR}"
|
mkdir -p "${WORK_DIR}"
|
||||||
log "Begin ${BASE_DIR}"
|
log "Begin ${BASE_DIR}"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,18 @@ install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/"
|
||||||
|
|
||||||
install -m 755 files/rc.local "${ROOTFS_DIR}/etc/"
|
install -m 755 files/rc.local "${ROOTFS_DIR}/etc/"
|
||||||
|
|
||||||
|
if [ -n "${PUBKEY_SSH_FIRST_USER}" ]; then
|
||||||
|
install -v -m 0700 -o 1000 -g 1000 -d "${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh
|
||||||
|
echo "${PUBKEY_SSH_FIRST_USER}" >"${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh/authorized_keys
|
||||||
|
chown 1000:1000 "${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh/authorized_keys
|
||||||
|
chmod 0600 "${ROOTFS_DIR}"/home/"${FIRST_USER_NAME}"/.ssh/authorized_keys
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${PUBKEY_ONLY_SSH}" = "1" ]; then
|
||||||
|
sed -i -Ee 's/^#?[[:blank:]]*PubkeyAuthentication[[:blank:]]*no[[:blank:]]*$/PubkeyAuthentication yes/
|
||||||
|
s/^#?[[:blank:]]*PasswordAuthentication[[:blank:]]*yes[[:blank:]]*$/PasswordAuthentication no/' "${ROOTFS_DIR}"/etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
|
|
||||||
on_chroot << EOF
|
on_chroot << EOF
|
||||||
systemctl disable hwclock.sh
|
systemctl disable hwclock.sh
|
||||||
systemctl disable nfs-common
|
systemctl disable nfs-common
|
||||||
|
|
Loading…
Reference in a new issue