diff options
author | Sam Tygier <[email protected]> | 2018-12-09 22:52:03 +0000 |
---|---|---|
committer | XECDesign <[email protected]> | 2018-12-21 04:09:47 +0000 |
commit | d07096ebb565bc9ac97974895c57d88b0e82ce23 (patch) | |
tree | 98a718a8d82717f850136f44aa61f9492472562f /stage1 | |
parent | d1b747747c81d34c6779c2ac9bb86fcbfac79c6c (diff) |
Allow setting user name and password from config
Add FIRST_USER_NAME and FIRST_USER_PASS variables that can be set
in the config (or enviroment). Defaults to the standard pi and
raspberry.
Diffstat (limited to 'stage1')
-rwxr-xr-x | stage1/01-sys-tweaks/00-run.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stage1/01-sys-tweaks/00-run.sh b/stage1/01-sys-tweaks/00-run.sh index 61ba51b..9c380ec 100755 --- a/stage1/01-sys-tweaks/00-run.sh +++ b/stage1/01-sys-tweaks/00-run.sh @@ -5,10 +5,10 @@ install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/[email protected] install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab" on_chroot << EOF -if ! id -u pi >/dev/null 2>&1; then - adduser --disabled-password --gecos "" pi +if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then + adduser --disabled-password --gecos "" ${FIRST_USER_NAME} fi -echo "pi:raspberry" | chpasswd +echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd echo "root:root" | chpasswd EOF |