File config.sh of Package monitoring-kiwi-live

#!/bin/bash
#================
# FILE          : config.sh
#----------------
# PROJECT       : OpenSuSE KIWI Image System
# COPYRIGHT     : (c) 2012 
#               :
# AUTHOR        : Marcus Schaefer <ms@suse.de>, Stephan Kulow <coolo@suse.de>
#               :
# LICENSE       : BSD
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile

set -e

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

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

#======================================
# 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

#sshd is not required for LTSP to work
#chkconfig sshd on
#rcsshd start || true
#rcsshd stop
# we start with a running icinga and apache config
chkconfig apache2 on
chkconfig icinga on
rcapache2 on
rcicinga on
#--------------------------------------
# these two we want to disable for policy reasons
chkconfig cron off

# enable create_xconf
chkconfig boot.braille on
chkconfig boot.langset on
# disable for now chkconfig boot.compcache on
chkconfig boot.ldconfig off

cd /

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

if test -f /etc/YaST2/firstboot.xml -a -f /tmp/config-firstboot.patch; then
   patch -f /etc/YaST2/firstboot.xml /tmp/config-firstboot.patch
fi

# disabled for now - if you reenable, don't forget correct_live_install
# bnc#382158
# patch -p0 < /etc/YaST2/policy.patch

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

insserv

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

bash -x /tmp/geturls.sh
rm /tmp/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 "" -G users
#/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 /tmp/*.pdf /home/linux || true
chown -R 999.users /home/linux

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

fdi=`ls -1 /usr/lib*/hal/hald-generate-fdi-cache || true`
if test -x $fdi; then
  $fdi
fi
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

rpm -e beagle --nodeps || true
zypper addlock beagle || true
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
ln -sf /usr/share/icons/oxygen/32x32/apps/k3b.png /usr/share/pixmaps/k3b.png || true
baseSetRunlevel 5
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER_AUTOLOGIN linux
baseUpdateSysConfig /etc/sysconfig/keyboard KEYTABLE us.map.gz
baseUpdateSysConfig /etc/sysconfig/keyboard YAST_KEYBOARD english-us,pc104
baseUpdateSysConfig /etc/sysconfig/clock HWCLOCK "-u"
baseUpdateSysConfig /etc/sysconfig/yast2 WANTED_GUI qt
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER gdm
baseUpdateSysConfig /etc/sysconfig/windowmanager DEFAULT_WM gnome
baseUpdateSysConfig /etc/sysconfig/network/config NETWORKMANAGER yes
#baseUpdateSysConfig /etc/sysconfig/ica ICA_ENABLE yes
openSUSE Build Service is sponsored by