|
@@ -12,18 +12,17 @@ echo "USERNAME=$USERNAME" >> ${NEWROOT}/etc/default/live.conf
|
|
|
chmod 644 ${NEWROOT}/etc/default/live.conf
|
|
|
|
|
|
# Create new user and remove password. We'll use autologin by default.
|
|
|
-chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G systemd-journal,wheel -s /bin/bash
|
|
|
-chroot ${NEWROOT} passwd -d $USERNAME 2>&1 >/dev/null
|
|
|
+chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G \
|
|
|
+ systemd-journal,wheel -s /bin/bash
|
|
|
+chroot ${NEWROOT} passwd -d $USERNAME >/dev/null 2>&1
|
|
|
|
|
|
# Enable sudo permission by default.
|
|
|
if [ -f ${NEWROOT}/etc/sudoers ]; then
|
|
|
- echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> ${NEWROOT}/etc/sudoers
|
|
|
+ echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> ${NEWROOT}/etc/sudoers
|
|
|
fi
|
|
|
|
|
|
# Enable autologin for agetty(8).
|
|
|
-if [ -f ${NEWROOT}/usr/lib/systemd/system/[email protected] ]; then
|
|
|
- rm -f "${NEWROOT}/etc/systemd/system/getty.target.wants/[email protected]"
|
|
|
- sed -e "s|/sbin/agetty --noclear|& -a ${USERNAME}|g" \
|
|
|
- "${NEWROOT}/usr/lib/systemd/system/[email protected]" > \
|
|
|
- "${NEWROOT}/etc/systemd/system/getty.target.wants/[email protected]"
|
|
|
-fi
|
|
|
+rm -f "${NEWROOT}/etc/systemd/system/getty.target.wants/[email protected]"
|
|
|
+sed -e "s|/sbin/agetty --noclear|& -a ${USERNAME}|g" \
|
|
|
+ "${NEWROOT}/usr/lib/systemd/system/[email protected]" > \
|
|
|
+ "${NEWROOT}/etc/systemd/system/getty.target.wants/[email protected]"
|