We don't want a first user

This commit is contained in:
Alexandre Aubin 2020-06-09 19:52:01 +02:00
parent 65d031a68c
commit f6e24df737
5 changed files with 0 additions and 27 deletions

View file

@ -114,14 +114,6 @@ The following environment variables are supported:
To get the current value from a running system, look in
`/etc/timezone`.
* `FIRST_USER_NAME` (Default: "pi" )
Username for the first user
* `FIRST_USER_PASS` (Default: "raspberry")
Password for the first user
* `WPA_ESSID`, `WPA_PASSWORD` and `WPA_COUNTRY` (Default: unset)
If these are set, they are use to configure `wpa_supplicant.conf`, so that the Raspberry Pi can automatically connect to a wifi network on first boot. If `WPA_ESSID` is set and `WPA_PASSWORD` is unset an unprotected wifi network will be configured. If set, `WPA_PASSWORD` must be between 8 and 63 characters.

View file

@ -164,8 +164,6 @@ export LOG_FILE="${WORK_DIR}/build.log"
export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi}
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
export FIRST_USER_PASS=${FIRST_USER_PASS:-raspberry}
export RELEASE=${RELEASE:-buster}
export WPA_ESSID
export WPA_PASSWORD
@ -210,12 +208,6 @@ source "${SCRIPT_DIR}/dependencies_check"
dependencies_check "${BASE_DIR}/depends"
#check username is valid
if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then
echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME"
exit 1
fi
if [[ -n "${APT_PROXY}" ]] && ! curl --silent "${APT_PROXY}" >/dev/null ; then
echo "Could not reach APT_PROXY server: ${APT_PROXY}"
exit 1

View file

@ -12,10 +12,6 @@ if hash hardlink 2>/dev/null; then
fi
EOF
if [ -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" ]; then
chmod 700 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config"
fi
rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache"
rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static"

View file

@ -5,10 +5,6 @@ install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.s
install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab"
on_chroot << EOF
if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then
adduser --disabled-password --gecos "" ${FIRST_USER_NAME}
fi
echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd
echo "root:root" | chpasswd
EOF

View file

@ -40,9 +40,6 @@ on_chroot <<EOF
for GRP in input spi i2c gpio; do
groupadd -f -r "\$GRP"
done
for GRP in adm dialout cdrom audio users sudo video games plugdev input gpio spi i2c netdev; do
adduser $FIRST_USER_NAME \$GRP
done
EOF
on_chroot << EOF