added autologin

This commit is contained in:
nospoonuser 2018-05-22 21:39:33 +02:00
parent 6fc423d658
commit 60cb8274a0
1 changed files with 17 additions and 0 deletions

View File

@ -36,12 +36,29 @@ if [ -n "${PACKAGES}" ]; then
chroot $CHROOT apt-get -y install ${PACKAGES} chroot $CHROOT apt-get -y install ${PACKAGES}
fi fi
if [ "${LIVE_AUTOLOGIN}" == "true" ]; then
requiredir "$CHROOT/etc/systemd/system/getty@tty1.service.d/"
cat > "$CHROOT/etc/systemd/system/getty@tty1.service.d/override.conf" << EOF
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I \$TERM
EOF
fi
#set the rootpw #set the rootpw
chpasswd -R $(readlink -f $CHROOT) <<< "root:${LIVE_ROOTPW}" chpasswd -R $(readlink -f $CHROOT) <<< "root:${LIVE_ROOTPW}"
#change to a full busybox - for tftp support #change to a full busybox - for tftp support
sed -i -r 's/=.+(\/bin\/busybox)/=\1/' chroot/usr/share/initramfs-tools/hooks/zz-busybox-initramfs sed -i -r 's/=.+(\/bin\/busybox)/=\1/' chroot/usr/share/initramfs-tools/hooks/zz-busybox-initramfs
#remove ubuntu ads
for f in 00-header 10-help-text 50-motd-news
do
[ -f ${CHROOT}/etc/update-motd.d/$f ] && rm ${CHROOT}/etc/update-motd.d/$f
done
#install kernel #install kernel
chroot $CHROOT apt -y -o "APT::Install-Recommends=false" install ${KERNEL_PACKAGE} chroot $CHROOT apt -y -o "APT::Install-Recommends=false" install ${KERNEL_PACKAGE}