Added Service to generate SSH Key. Pretty banners. Language fix.
This commit is contained in:
parent
498e893c16
commit
81ffb7197b
|
@ -5,6 +5,7 @@ source $(dirname $0)/functions.sh
|
|||
|
||||
echo "Build live"
|
||||
|
||||
BUILD_TIME=$(date +%Y-%m-%dT%H:%M)
|
||||
CHROOT=${WORKDIR}/chroot
|
||||
|
||||
startstage bootstrap
|
||||
|
@ -31,11 +32,16 @@ chroot $CHROOT apt -y install systemd
|
|||
#install live-boot
|
||||
chroot $CHROOT apt-get -y install live-boot
|
||||
|
||||
DEFAULT_PACKAGES=console-setup
|
||||
|
||||
#install additional packages
|
||||
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
|
||||
|
||||
echo "LANG=de_DE.UTF-8" >> $CHROOT/etc/default/locale
|
||||
|
||||
|
||||
if [ "${LIVE_AUTOLOGIN}" == "true" ]; then
|
||||
requiredir "$CHROOT/etc/systemd/system/getty@tty1.service.d/"
|
||||
|
@ -68,7 +74,32 @@ umount $CHROOT/proc/
|
|||
umount $CHROOT/sys/
|
||||
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
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue