Files
kiwi-live-lxde/config.sh

129 lines
3.9 KiB
Bash

#!/bin/bash
#================
# FILE : config.sh
#----------------
# PROJECT : OpenSuSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Andrea Florio <andrea@opensuse.org>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : STABLE
#----------------
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# 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
#======================================
# Setup baseproduct link
#--------------------------------------
#suseSetupProduct
#======================================
# Activate services
#--------------------------------------
#suseInsertService sshd
suseInsertService boot.device-mapper
#suseRemoveService avahi-dnsconfd
#suseRemoveService avahi-daemon
#==========================================
# remove unneeded packages
#------------------------------------------
#rpm -e --nodeps --noscripts \
# $(rpm -q `baseGetPackagesForDeletion` | grep -v "is not installed")
#==========================================
# remove package docs
#------------------------------------------
#rm -rf /usr/share/doc/packages/*
#rm -rf /usr/share/doc/manual/*
rm -rf /opt/kde* || echo "there's no /opt/kde* in the target system"
#======================================
# Add 11.4 repo
#--------------------------------------
baseRepo="http://download.opensuse.org/distribution/13.1/repo/oss"
baseName="openSUSE-11.4-Oss"
zypper ar $baseRepo $baseName
zypper ar -f "http://download.opensuse.org/repositories/X11:/lxde/openSUSE_13.1/" "LXDE"
zypper ar -f "http://download.opensuse.org/update/11.4/" "13.1_updates"
zypper ar -f "http://download.opensuse.org/distribution/13.1/repo/non-oss/" "openSUSE-13.1-NON-Oss"
#======================================
# Remove unneeded packages and services
#--------------------------------------
#rpm -qa | grep yast | xargs rpm -e --nodeps
/sbin/chkconfig sshd off
/sbin/chkconfig postfix off
# delete passwords
passwd -d root
passwd -d linux
# empty password is ok
pam-config -a --nullok
#======================================
# Setting up overlay files
#--------------------------------------
echo '** Setting up overlay files...'
echo mkdir -p "/"
mkdir -p "/"
true
#======================================
# SuSEconfig
#--------------------------------------
suseConfig
fdi=`ls -1 /usr/lib*/hal/hald-generate-fdi-cache || true`
if test -x $fdi; then
$fdi
fi
zypper addlock ksmolt || true
rm -rf /var/cache/zypp/packages
# bug 544314
sed -i -e 's,^\(.*pam_gnome_keyring.so.*\),#\1,' /etc/pam.d/common-auth-pc
echo '127.0.0.2 linux.site linux' >> /etc/hosts
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,pc
baseUpdateSysConfig /etc/sysconfig/yast2 WANTED_GUI gtk
baseUpdateSysConfig /etc/sysconfig/yast2 PKGMGR_ACTION_AT_EXIT summary
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER lxdm
baseUpdateSysConfig /etc/sysconfig/windowmanager DEFAULT_WM startlxde
baseUpdateSysConfig /etc/sysconfig/network/config NETWORKMANAGER yes
#======================================
# Umount kernel filesystems
#--------------------------------------
baseCleanMount
exit 0