LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File config.sh of Package OBS-Appliance-vmdk (Project openSUSE:Tools:2.1)

#!/bin/bash
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile

#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# Activate services
#--------------------------------------
ifup lo
suseActivateDefaultServices
suseInsertService boot.device-mapper
suseInsertService slpd
# OBS webui and api
suseInsertService memcached
suseInsertService lighttpd
suseInsertService mysql
suseInsertService obsapidelayed
suseInsertService obswebuidelayed
# OBS backend
suseInsertService obsdispatcher
suseInsertService obspublisher
suseInsertService obsrepserver
suseInsertService obsscheduler
suseInsertService obssrcserver
suseInsertService obsservice
suseInsertService obssignd
suseInsertService obssigner
suseInsertService obswarden
# OBS worker
suseInsertService obsworker
# For OBS Appliance only:
suseInsertService obsapisetup
suseInsertService obsstoragesetup
suseInsertService haveged

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

#======================================
# /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 obs -c "OBS Appliance User" -p ""

# delete passwords
passwd -d root
passwd -d obs
# empty password is ok
pam-config -a --nullok

chown -R root.root /root
chown -R 999.users /home/obs

# to be removed for 2.3 appliance
chown obsrun.obsrun /srv/obs

# no gfx boot menu, no error message please
sed -i /^gfxmenu/d /boot/grub/menu.lst

# configure network
cat >> /etc/sysconfig/network/config <<EOF

NETCONFIG_MODULES_ORDER="dns-resolver dns-bind ntp-runtime"
NETCONFIG_DNS_POLICY="auto"
NETCONFIG_DNS_FORWARDER="resolver"
NETCONFIG_NIS_SETDOMAINNAME="yes"
NETCONFIG_NTP_POLICY="auto"
EOF

# runlevel 3 as default
sed -i 's/^id:5:initdefault:/id:3:initdefault:/' /etc/inittab

# enable autosetup
sed -i 's,OBS_API_AUTOSETUP=.*,OBS_API_AUTOSETUP="yes",' /etc/sysconfig/obs-server
sed -i 's,OBS_STORAGE_AUTOSETUP=.*,OBS_STORAGE_AUTOSETUP="yes",' /etc/sysconfig/obs-server


#======================================
# Configure OBS to use /obs by default
#--------------------------------------
sed -i 's,/srv/obs,/obs,g' /usr/lib/obs/server/BSConfig.pm
sed -i 's,.*our $serviceserve.*,our $serviceserver = "http://$hostname:5152";,' /usr/lib/obs/server/BSConfig.pm
sed -i 's,^our $repodownload.*,our $repodownload = "http://$hostname:82/";,' /usr/lib/obs/server/BSConfig.pm
sed -i 's,^OBS_RUN_DIR=.*,OBS_RUN_DIR="/obs/run",' /etc/sysconfig/obs-server
sed -i 's,^OBS_LOG_DIR=.*,OBS_LOG_DIR="/obs/log",' /etc/sysconfig/obs-server
sed -i 's,^datadir.=.*,datadir = /obs/MySQL,' /etc/my.cnf
# signing setup
sed -i 's,.*our $gpg_standard_key.*,our $gpg_standard_key = "/obs/obs-default-gpg.asc";,' /usr/lib/obs/server/BSConfig.pm
sed -i 's,.*our $keyfile.*,our $keyfile = "/obs/obs-default-gpg.asc";,' /usr/lib/obs/server/BSConfig.pm
sed -i 's,.*our $sign = .*,our $sign = "/usr/bin/sign";,' /usr/lib/obs/server/BSConfig.pm
sed -i 's,.*our $forceprojectkeys.*,our $forceprojectkeys = 1;,' /usr/lib/obs/server/BSConfig.pm
chmod 4755 /usr/bin/sign

#======================================
# Add Default Repositories
#--------------------------------------
zypper ar http://download.opensuse.org/update/11.3/                                       openSUSE:11.3:Update
zypper ar http://download.opensuse.org/repositories/openSUSE:11.3/standard                openSUSE:11.3
zypper ar http://download.opensuse.org/repositories/openSUSE:Tools:2.1/openSUSE_11.3          openSUSE:Tools:2.1

#======================================
# Umount kernel filesystems
#--------------------------------------
baseCleanMount

exit 0