LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File config.sh of Package JeOS (Project openSUSE:12.2:ARM)

#!/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/repositories/openSUSE:/12.2:/ARM/standard"
baseName="openSUSE-12.2-ARM"
zypper ar -f $baseRepo $baseName

#======================================
# 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
	sed -i 's/^DISPLAYMANAGER=.*/DISPLAYMANAGER="lightdm"' /etc/sysconfig/displaymanager
	sed -i 's/^DEFAULT_WM=.*/DEFAULT_WM="xfce"' /etc/sysconfig/windowmanager
fi

#======================================
# Add tty devices to securetty
#--------------------------------------
# XXX should be target specific
cat >> /etc/securetty <<EOF
ttyO0
ttyO2
ttyAMA2
ttymxc0
EOF

#======================================
# Configure motd correctly
#--------------------------------------
# XXX adjust for JeOS/XFCE
cat > /etc/motd <<EOF
This is the Lime-JeOS 12.2 SuSE Linux System.
To upgrade your system call:

    zypper refresh
    zypper install -t product openSUSE-12.2

Have a lot of fun...
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

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