From 9e1a592de4e8336ed41c4adcfc728224c375b93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=B6hmke?= Date: Mon, 4 Nov 2019 20:23:45 +0100 Subject: [PATCH] moved root password to data partition --- resources/build.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/build.sh b/resources/build.sh index 8103f55..ac4c1da 100755 --- a/resources/build.sh +++ b/resources/build.sh @@ -9,7 +9,7 @@ set -e : ${DEFAULT_TIMEZONE:="Etc/UTC"} : ${DEFAULT_HOSTNAME:="alpine"} -: ${ROOT_PASSWORD:="alpine"} +: ${DEFAULT_ROOT_PASSWORD:="alpine"} : ${SIZE_BOOT:="100M"} : ${SIZE_ROOT_FS:="150M"} @@ -80,12 +80,6 @@ echo "nameserver 8.8.8.8" > ${ROOTFS_PATH}/etc/resolv.conf # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # echo ">> Configure root FS" -# set root password -chroot_exec passwd << EOF -${ROOT_PASSWORD} -${ROOT_PASSWORD} -EOF - # Set time zone ln -fs /data/etc/timezone ${ROOTFS_PATH}/etc/timezone ln -fs /data/etc/localtime ${ROOTFS_PATH}/etc/localtime @@ -186,7 +180,6 @@ ln -s /data/etc/dropbear/ ${ROOTFS_PATH}/etc/dropbear mv ${ROOTFS_PATH}/etc/conf.d/dropbear ${ROOTFS_PATH}/etc/conf.d/dropbear_org ln -s /data/etc/dropbear/dropbear.conf ${ROOTFS_PATH}/etc/conf.d/dropbear - # cleanup rm -rf ${ROOTFS_PATH}/var/cache/apk/* @@ -210,6 +203,11 @@ if [ ! -f /data/etc/hostname ]; then echo "${DEFAULT_HOSTNAME}" > /data/etc/hostname fi +# root password +root_pw=\$(mkpasswd -m sha-512 -s "${DEFAULT_ROOT_PASSWORD}") +echo "root:\${root_pw}:0:0:::::" > /data/etc/shadow + +# interface if [ ! -f /data/etc/interfaces ]; then cat > /data/etc/interfaces <> Prepare kernel for uboot"