File config.sh of Package cosmic-live-next

#!/bin/bash
#================
# FILE          : config.sh
#----------------
# PROJECT       : OpenSuSE KIWI Image System
# COPYRIGHT     : (c) 2006,2007,2008 SUSE LINUX Products GmbH. All rights reserved
#               :
# AUTHOR        : Marcus Schaefer <ms@suse.de>, Stephan Kulow <coolo@suse.de>
#               :
# LICENSE       : BSD
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile

#set -e
set -x

exec | tee /var/log/config.log
exec 2>&1

pl=`rpmqpack | grep package-lists-` || true
test -z "$pl" || rpm -e $pl

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

#--------------------------------------
# these two we want to disable for policy reasons
for i in sshd cron wicked purge-kernels; do
       systemctl -f disable $i
done

#ln -s '/etc/systemd/system/clicfs.service' '/etc/systemd/system/multi-user.target.wants/clicfs.service'
cd /

insserv

rm -rf /var/cache/zypp/raw/*

bash -x /var/lib/livecd/geturls.sh
rm /var/lib/livecd/geturls.sh

#======================================
# /etc/sudoers hack to fix #297695
# (Installation Live CD: no need to ask for password of root)
#--------------------------------------
sed -i -e "s/ALL ALL=(ALL) ALL/ALL ALL=(ALL) NOPASSWD: ALL/" /etc/sudoers
chmod 0440 /etc/sudoers

/usr/sbin/useradd -m -u 999 linux -c "Live-CD User" -p ""

# delete passwords
passwd -d root
passwd -d linux
# empty password is ok
pam-config -a --nullok

: > /var/log/zypper.log

mv /var/lib/livecd/*.pdf /home/linux || true
rmdir /var/lib/livecd || true

chown -R linux /home/linux
chown root:root /root

#======================================
# SuSEconfig
#--------------------------------------

for script in /usr/share/opensuse-kiwi/live_user_scripts/*.sh; do
  if test -f $script; then
     su - linux -c "/bin/bash $script"
  fi
done

rm -rf /var/cache/zypp/packages

# bug 890800
rm /etc/systemd/system/default.target.wants/YaST2-Firstboot.service
rm /etc/systemd/system/default.target.wants/YaST2-Second-Stage.service
rm /usr/lib/systemd/system/YaST2-Second-Stage.service
rm /usr/lib/systemd/system/YaST2-Firstboot.service

ln -s /usr/share/YaST2/theme/openSUSE /usr/share/YaST2/theme/current

# Add live-installer.desktop
mkdir -p /home/linux/Desktop
cp /usr/share/applications/YaST2/live-installer.desktop /home/linux/Desktop/
chown linux /home/linux -R
chmod +x /home/linux/Desktop/live-installer.desktop

echo '127.0.0.2       linux.site linux' >> /etc/hosts

/usr/bin/systemctl -f enable NetworkManager.service

# Enable NTP service
/usr/bin/systemctl -f enable chronyd.service

# enable autologin and  COSMIC-greeter
echo -e '[initial_session]\ncommand = "start-cosmic"\nuser = "linux"' >> /etc/greetd/cosmic-greeter.toml
/usr/bin/systemctl -f enable cosmic-greeter.service

#Disable journal write to disk in live mode, bug 950999
echo "Storage=volatile" >> /etc/systemd/journald.conf

#set default to graphical.target
/usr/bin/systemctl set-default graphical.target
openSUSE Build Service is sponsored by