|
|
8f60b5 |
#!/bin/bash
|
|
|
8f60b5 |
|
|
|
8f60b5 |
set -euxo pipefail
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Functions...
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
test -f /.kconfig && . /.kconfig
|
|
|
8f60b5 |
test -f /.profile && . /.profile
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Greeting...
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..."
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Turn on sticky vendors
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
echo "allow_vendor_change=True" >> /etc/dnf/dnf.conf
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Clear machine specific configuration
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
## Force generic hostname
|
|
|
8f60b5 |
echo "localhost" > /etc/hostname
|
|
|
8f60b5 |
## Clear machine-id on pre generated images
|
|
|
8f60b5 |
truncate -s 0 /etc/machine-id
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Delete & lock the root user password
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
if [[ "$kiwi_profiles" == *"AWS"* ]] || [[ "$kiwi_profiles" == *"Azure"* ]] || [[ "$kiwi_profiles" == *"OpenStack"* ]] || [[ "$kiwi_profiles" == *"Live"* ]]; then
|
|
|
8f60b5 |
passwd -d root
|
|
|
8f60b5 |
passwd -l root
|
|
|
8f60b5 |
fi
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Setup default services
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
|
|
|
8f60b5 |
if [[ "$kiwi_profiles" == *"AWS"* ]] || [[ "$kiwi_profiles" == *"Azure"* ]] || [[ "$kiwi_profiles" == *"OpenStack"* ]]; then
|
|
|
8f60b5 |
## Enable cloud-init
|
|
|
8f60b5 |
systemctl enable cloud-config.service cloud-final.service cloud-init.service cloud-init-local.service cloud-init.target
|
|
|
8f60b5 |
fi
|
|
|
8f60b5 |
|
|
|
8f60b5 |
if [[ "$kiwi_profiles" == *"Azure"* ]]; then
|
|
|
8f60b5 |
## Enable WALinuxAgent
|
|
|
8f60b5 |
systemctl enable waagent.service
|
|
|
8f60b5 |
fi
|
|
|
8f60b5 |
|
|
|
8f60b5 |
## Enable chrony
|
|
|
8f60b5 |
systemctl enable chronyd.service
|
|
|
8f60b5 |
## Enable oomd
|
|
|
0d0608 |
##systemctl enable systemd-oomd.service
|
|
|
8f60b5 |
## Enable resolved
|
|
|
0d0608 |
##systemctl enable systemd-resolved.service
|
|
|
8f60b5 |
## Enable persistent journal
|
|
|
8f60b5 |
mkdir -p /var/log/journal
|
|
|
8f60b5 |
|
|
|
8f60b5 |
#======================================
|
|
|
8f60b5 |
# Setup default target
|
|
|
8f60b5 |
#--------------------------------------
|
|
|
8f60b5 |
systemctl set-default multi-user.target
|
|
|
8f60b5 |
|
|
|
8f60b5 |
exit 0
|