#!/bin/bash #================ # FILE : config.sh #---------------- # PROJECT : OpenSuSE KIWI Image System # COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved # : # AUTHOR : Marcus Schaefer # : # BELONGS TO : Operating System images # : # DESCRIPTION : configuration script for SUSE based # : operating systems # : # : # STATUS : BETA #---------------- #====================================== # Functions... #-------------------------------------- test -f /.kconfig && . /.kconfig test -f /.profile && . /.profile # kiwi doesn't copy /.kconfig from source to build dir test -f /kconfig && . /kconfig set -e exec | tee /var/log/config.log exec 2>&1 #pl=`rpmqpack | grep package-lists-` #rpm -e $pl #====================================== # Greeting... #-------------------------------------- echo "Configure image: [$name]..." #===================================== # setting gdm theme to #------------------------------------- #echo '** Setting gdm background theme...' #gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.vendor --type string -s /desktop/gnome/background/picture_filename '/usr/share/themes/Adwaita/backgrounds/stripes.jpg' if [ -e /etc/icewm/preferences ] then sed -i 's#DesktopBackgroundImage=.*#DesktopBackgroundImage="/etc/X11/xdm/BackGround.xpm"#' /etc/icewm/preferences fi sed --in-place -e 's/icewm/icewm-session/' /usr/bin/wmlist # run custom build_script after build 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 chkconfig sshd off chkconfig cron off chown root:root /etc/init.d/boot.langset chkconfig boot.langset on chkconfig boot.ldconfig off chkconfig boot.apparmor off chkconfig earlyxdm off chkconfig earlysyslog off chkconfig auditd off if [ -e /etc/init.d/postfix ]; then chkconfig postfix off fi chkconfig stoppreload 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/* #====================================== # /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 tux -c "Live-CD User" -p "" su -c "tar -C /home/tux -xf /gnome3-promodvd-home.tar" tux rm -f /gnome3-promodvd-home.tar # delete passwords passwd -d root passwd -d tux # empty password is ok pam-config -a --nullok : > /var/log/zypper.log #====================================== # SuSEconfig #-------------------------------------- suseConfig SuSEconfig --module permissions 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 baseSetRunlevel 5 baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER_AUTOLOGIN tux baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER gdm baseUpdateSysConfig /etc/sysconfig/network/config NETWORKMANAGER yes baseUpdateSysConfig /etc/sysconfig/windowmanager DEFAULT_WM gnome baseUpdateSysConfig /etc/sysconfig/keyboard KEYTABLE us.map.gz baseUpdateSysConfig /etc/sysconfig/keyboard YAST_KEYBOARD english-us,pc104 baseUpdateSysConfig /etc/sysconfig/clock HWCLOCK "-u" true