Added Service to generate SSH Key. Pretty banners. Language fix.

This commit is contained in:
nospoonuser 2018-05-27 10:42:07 +02:00
parent 498e893c16
commit 81ffb7197b
1 changed files with 32 additions and 1 deletions

View File

@ -5,6 +5,7 @@ source $(dirname $0)/functions.sh
echo "Build live" echo "Build live"
BUILD_TIME=$(date +%Y-%m-%dT%H:%M)
CHROOT=${WORKDIR}/chroot CHROOT=${WORKDIR}/chroot
startstage bootstrap startstage bootstrap
@ -31,11 +32,16 @@ chroot $CHROOT apt -y install systemd
#install live-boot #install live-boot
chroot $CHROOT apt-get -y install live-boot chroot $CHROOT apt-get -y install live-boot
DEFAULT_PACKAGES=console-setup
#install additional packages #install additional packages
if [ -n "${PACKAGES}" ]; then if [ -n "${PACKAGES}" ]; then
chroot $CHROOT apt-get -y install ${PACKAGES} DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
LC_ALL=C LANGUAGE=C LANG=C chroot $CHROOT apt-get -y install ${DEFAULT_PACKAGES} ${PACKAGES}
fi fi
echo "LANG=de_DE.UTF-8" >> $CHROOT/etc/default/locale
if [ "${LIVE_AUTOLOGIN}" == "true" ]; then if [ "${LIVE_AUTOLOGIN}" == "true" ]; then
requiredir "$CHROOT/etc/systemd/system/getty@tty1.service.d/" requiredir "$CHROOT/etc/systemd/system/getty@tty1.service.d/"
@ -68,7 +74,32 @@ umount $CHROOT/proc/
umount $CHROOT/sys/ umount $CHROOT/sys/
umount $CHROOT/dev/ umount $CHROOT/dev/
if [ -x $CHROOT/usr/sbin/sshd ];then
cat > $CHROOT/etc/systemd/system/regenerate_ssh_host_keys.service << EOF
[Unit]
Description=Regenerate SSH host keys
Before=ssh.service
[Service]
Type=oneshot
ExecStartPre=-/bin/sh -c "/bin/rm -f -v /etc/ssh/ssh_host_*_key*"
ExecStart=/usr/bin/ssh-keygen -A -v
ExecStartPost=/bin/systemctl disable regenerate_ssh_host_keys
[Install]
WantedBy=multi-user.target
EOF
[ -e ${CHROOT}/etc/systemd/system/multi-user.target.wants/regenerate_ssh_host_keys.service ] || ln -s ../regenerate_ssh_host_keys.service ${CHROOT}/etc/systemd/system/multi-user.target.wants/regenerate_ssh_host_keys.service
fi
#final changes #final changes
echo "${LIVE_HOSTNAME}" > $CHROOT/etc/hostname echo "${LIVE_HOSTNAME}" > $CHROOT/etc/hostname
echo "${LIVE_NAME} Build@${BUILD_TIME} \\l" > $CHROOT/etc/issue
echo "${LIVE_NAME} Build@${BUILD_TIME}" > $CHROOT/etc/issue.net
echo "" >> $CHROOT/etc/legal
endstage bootstrap endstage bootstrap