File config.sh of Package JeOS
#!/bin/bash
#================
# FILE : config.sh
#----------------
# PROJECT : OpenSuSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Marcus Schaefer <ms@suse.de>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : BETA
#----------------
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# Setup baseproduct link
#--------------------------------------
suseSetupProduct
#======================================
# Activate services
#--------------------------------------
suseInsertService sshd
suseInsertService boot.device-mapper
suseInsertService ntp
suseRemoveService avahi-dnsconfd
suseRemoveService avahi-daemon
#==========================================
# remove unneeded packages
#------------------------------------------
suseRemovePackagesMarkedForDeletion
#==========================================
# remove package docs
#------------------------------------------
rm -rf /usr/share/doc/packages/*
rm -rf /usr/share/doc/manual/*
rm -rf /opt/kde*
#======================================
# only basic version of vim is
# installed; no syntax highlighting
#--------------------------------------
sed -i -e's/^syntax on/" syntax on/' /etc/vimrc
#======================================
# SuSEconfig
#--------------------------------------
suseConfig
#======================================
# Add base repository
#--------------------------------------
baseRepo="http://download.opensuse.org/ports/armv7hl/distribution/12.2/repo/oss/"
baseName="openSUSE-12.2-ARM-Repo-OSS"
zypper ar $baseRepo $baseName
zypper ar -f "http://download.opensuse.org/ports/armv7hl/update/12.2/" "openSUSE-12.2-ARM-Updates"
#======================================
# Add xorg config with fbdev
#--------------------------------------
mkdir -p /etc/X11/xorg.conf.d/
cat > /etc/X11/xorg.conf.d/20-fbdev.conf <<EOF
Section "Device"
Identifier "fb gfx"
Driver "fbdev"
Option "fb" "/dev/fb0"
EndSection
EOF
#======================================
# Configure system for XFCE usage
#--------------------------------------
# XXX only do for XFCE image types
if [ -e /etc/sysconfig/displaymanager ]; then
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER lightdm
cat >> /etc/sysconfig/windowmanager <<EOF
## Path: Desktop/Window manager
## Description:
## Type: string(gnome,kde4,kde,lxde,xfce,twm,icewm)
## Default: xfce
## Config: profiles,kde,susewm
#
# Here you can set the default window manager (kde, fvwm, ...)
# changes here require at least a re-login
DEFAULT_WM="xfce"
EOF
# We want to start in gfx mode
baseSetRunlevel 5
suseConfig
fi
#======================================
# Add tty devices to securetty
#--------------------------------------
# XXX should be target specific
cat >> /etc/securetty <<EOF
ttyO0
ttyO2
ttyAMA2
ttymxc0
EOF
#======================================
# Bring up eth0 device automatically
#--------------------------------------
# XXX should be board specific
mkdir -p /etc/sysconfig/network/
cat > /etc/sysconfig/network/ifcfg-eth0 <<EOF
BOOTPROTO='dhcp'
MTU=''
REMOTE_IPADDR=''
STARTMODE='onboot'
EOF
#======================================
# Configure ntp
#--------------------------------------
# tell e2fsck to ignore the time differences
cat > /etc/e2fsck.conf <<EOF
[options]
broken_system_clock=true
EOF
for i in 0 1 2 3; do
echo "server $i.opensuse.pool.ntp.org iburst" >> /etc/ntp.conf
done
#======================================
# Trigger yast2-firstboot on first boot
#--------------------------------------
touch /var/lib/YaST2/reconfig_system
#======================================
# Import trusted keys
#--------------------------------------
for i in /usr/lib/rpm/gnupg/keys/gpg-pubkey*asc; do
# importing can fail if it already exists
rpm --import $i || true
done
#======================================
# Umount kernel filesystems
#--------------------------------------
baseCleanMount
exit 0