File config.sh of Package SaMaxi-Base-Image

#!/bin/bash
# Copyright (c) 2021 SUSE LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# 
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile

set -euxo pipefail

#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..."

#======================================
# add missing fonts
#--------------------------------------
# Systemd controls the console font now
echo FONT="eurlatgr.psfu" >> /etc/vconsole.conf

#======================================
# prepare for setting root pw, timezone
#--------------------------------------
echo "** reset machine settings"
rm -f /etc/machine-id \
      /var/lib/zypp/AnonymousUniqueId \
      /var/lib/systemd/random-seed

# empty file required by dbus-broker
echo -n > /etc/machine-id

#======================================
# Specify default systemd target
#--------------------------------------
baseSetRunlevel multi-user.target

#======================================
# Import trusted rpm keys
#--------------------------------------
suseImportBuildKey

# Enable jeos-firstboot
#mkdir -p /var/lib/YaST2
#touch /var/lib/YaST2/reconfig_system
#
systemctl --no-reload disable --now --no-warn  systemd-firstboot.service || /bin/true
systemctl --no-reload disable --now --no-warn  jeos-firstboot.service || /bin/true


#======================================
# Disable recommends on virtual images (keep hardware supplements, see bsc#1089498)
#--------------------------------------
sed -i 's/.*solver.onlyRequires.*/solver.onlyRequires = true/g' /etc/zypp/zypp.conf

#======================================
# Disable installing documentation
#--------------------------------------
sed -i 's/.*rpm.install.excludedocs.*/rpm.install.excludedocs = yes/g' /etc/zypp/zypp.conf

echo '** Update sysconfig entries...'
echo "LANG=C.UTF-8" > /etc/locale.conf
baseUpdateSysConfig /etc/sysconfig/keyboard KEYTABLE us.map.gz
baseUpdateSysConfig /etc/sysconfig/network/config LINKLOCAL_INTERFACES ''
baseUpdateSysConfig /etc/sysconfig/console CONSOLE_FONT lat9w-16.psfu

suseInsertService haveged
suseInsertService sshd
suseInsertService chronyd

ARCH=$(uname -m)
case $ARCH in
  aarch64)
    zypper ar http://download.opensuse.org/ports/aarch64/tumbleweed/repo/oss/       openSUSE:Tumbleweed
    zypper ar http://download.opensuse.org/ports/aarch64/update/tumbleweed/ openSUSE:Tumbleweed:Update
    zypper ar http://download.opensuse.org/repositories/home:/M0ses:/infra/openSUSE_Tumbleweed/ home:M0ses:infra
    ;;
  *)
    zypper ar https://download.opensuse.org/tumbleweed/repo/oss/ openSUSE:Tumbleweed
    zypper ar https://download.opensuse.org/update/tumbleweed/ openSUSE:Tumbleweed:Update
    zypper ar http://download.opensuse.org/repositories/home:/M0ses:/infra/openSUSE_Tumbleweed/ home:M0ses:infra
    ;;
esac
openSUSE Build Service is sponsored by