File config.sh of Package openSUSE-PromoDVD

#!/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
exec | tee /var/log/config.log
exec 2>&1

#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$name]..."
if test -n "$use_special_hacks"; then
#======================================
# Load sound drivers by default
#--------------------------------------
perl -ni -e 'm,^blacklist snd-, || print;' \
	/etc/modprobe.d/50-blacklist.conf

# and unmute their mixers.
perl -pi -e 's,/sbin/alsactl -F restore,/bin/set_default_volume -f,;' \
	/etc/udev/rules.d/40-alsa.rules
fi

#--------------------------------------
# these two we want to disable for policy reasons
rm /etc/init.d/rc4.d/* || true
chkconfig cron off || true
chkconfig boot.apparmor off || true
chkconfig boot.ldconfig off || true
ln -snf '/usr/lib/systemd/system/langset.service' '/usr/lib/systemd/system/sysinit.target.wants/langset.service'
systemctl disable purge-kernels || true
cd /

patch -p0 < /etc/YaST2/liveinstall.patch || true

if test -f /etc/YaST2/firstboot.xml -a -f /var/lib/livecd/config-firstboot.patch; then
   patch -f /etc/YaST2/firstboot.xml /var/lib/livecd/config-firstboot.patch || true
fi

for i in /rpmkeys/gpg*.asc; do 
   # the import fails if kiwi already had this key
   rpm --import $i || true
   rm $i || true
done
rmdir /rpmkeys || true

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

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

#======================================
#disabled in live session
#--------------------------------------
mkdir /livedisabled  || true
mv /usr/lib/packagekitd /livedisabled/ || true
mv /etc/xdg/autostart/hplip-systray.desktop /livedisabled/ || true
mv /etc/xdg/autostart/tracker-miner-fs.desktop /livedisabled/ || true
mv /etc/xdg/autostart/tracker-store.desktop /livedisabled/ || true
mv /etc/xdg/autostart/zeitgeist-datahub.desktop /livedisabled/ || true
mv /var/log/journal /var/log/journal-disabled || true
mv /etc/systemd/journald.conf /etc/systemd/journald.conf.original || true
cp /etc/systemd/journald.conf.disabled /etc/systemd/journald.conf
#======================================
# /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
# delete passwords
passwd -d root || true
passwd -d linux || true
# empty password is ok
pam-config -a --nullok || true

: > /var/log/zypper.log

mv /var/lib/livecd/*.pdf /home/linux || true
rmdir /var/lib/livecd || true
chown -R linux:users /home/linux || true

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

#rm -rf /var/cache/zypp/packages

# bug 544314
sed -i -e 's,^\(.*pam_gnome_keyring.so.*\),#\1,'  /etc/pam.d/common-auth-pc

#USB /usr/bin/correct_live_for_reboot usb
#USB /usr/bin/correct_live_install usb

echo '127.0.0.2       linux.site linux' >> /etc/hosts
chkstat --system --set || true

ln -s /usr/lib/systemd/system/runlevel5.target /etc/systemd/system/default.target || true
#disable autologin so users can try out different DE from login screen
#baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER_AUTOLOGIN linux
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER_SHUTDOWN "all"
baseUpdateSysConfig /etc/sysconfig/keyboard KEYTABLE us.map.gz
baseUpdateSysConfig /etc/sysconfig/keyboard YAST_KEYBOARD english-us,pc104
baseUpdateSysConfig /etc/sysconfig/language RC_LANG en_US.UTF-8
baseUpdateSysConfig /etc/sysconfig/clock HWCLOCK "-u"
baseUpdateSysConfig /etc/sysconfig/yast2 WANTED_GUI qt
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER sddm
baseUpdateSysConfig /etc/sysconfig/windowmanager DEFAULT_WM plasma5 
/usr/bin/systemctl -f enable NetworkManager.service || true

openSUSE Build Service is sponsored by