50-firstboot.sh
39 lines
| 1.2 KiB
| application/x-sh
|
BashLexer
/ bootstrap.d / 50-firstboot.sh
Filip Pytloun
|
r56 | # | ||
# First boot actions | ||||
# | ||||
Jan Wagner
|
r67 | # Load utility functions | ||
Filip Pytloun
|
r56 | . ./functions.sh | ||
Jan Wagner
|
r67 | # Prepare rc.firstboot script | ||
Jan Wagner
|
r82 | cat files/firstboot/10-begin.sh > "${ETCDIR}/rc.firstboot" | ||
Filip Pytloun
|
r56 | |||
# Ensure openssh server host keys are regenerated on first boot | ||||
Jan Wagner
|
r77 | if [ "$ENABLE_SSHD" = true ] ; then | ||
Jan Wagner
|
r82 | cat files/firstboot/21-generate-ssh-keys.sh >> "${ETCDIR}/rc.firstboot" | ||
Filip Pytloun
|
r56 | fi | ||
Jan Wagner
|
r67 | # Prepare filesystem auto expand | ||
Filip Pytloun
|
r56 | if [ "$EXPANDROOT" = true ] ; then | ||
Jan Wagner
|
r82 | if [ "$ENABLE_CRYPTFS" = false ] ; then | ||
cat files/firstboot/22-expandroot.sh >> "${ETCDIR}/rc.firstboot" | ||||
else | ||||
# Regenerate initramfs to remove encrypted root partition auto expand | ||||
cat files/firstboot/23-regenerate-initramfs.sh >> "${ETCDIR}/rc.firstboot" | ||||
fi | ||||
Filip Pytloun
|
r56 | fi | ||
Jan Wagner
|
r73 | # Ensure that dbus machine-id exists | ||
Jan Wagner
|
r82 | cat files/firstboot/24-generate-machineid.sh >> "${ETCDIR}/rc.firstboot" | ||
Jan Wagner
|
r73 | |||
# Create /etc/resolv.conf symlink | ||||
Jan Wagner
|
r82 | cat files/firstboot/25-create-resolv-symlink.sh >> "${ETCDIR}/rc.firstboot" | ||
Jan Wagner
|
r73 | |||
Jan Wagner
|
r67 | # Finalize rc.firstboot script | ||
Jan Wagner
|
r82 | cat files/firstboot/99-finish.sh >> "${ETCDIR}/rc.firstboot" | ||
chmod +x "${ETCDIR}/rc.firstboot" | ||||
Filip Pytloun
|
r56 | |||
Jan Wagner
|
r67 | # Add rc.firstboot script to rc.local | ||
Jan Wagner
|
r82 | sed -i '/exit 0/d' "${ETCDIR}/rc.local" | ||
echo /etc/rc.firstboot >> "${ETCDIR}/rc.local" | ||||
echo exit 0 >> "${ETCDIR}/rc.local" | ||||