Logoj0ke.net Open Build Service > Projects > J0KE.NET:Tools:images > OBS-WorkerOnly-pxe-xen_SLE_11_SP3 > config.sh
Sign Up | Log In

File config.sh of Package OBS-WorkerOnly-pxe-xen_SLE_11_SP3 (Revision abdcc1cbf9f54c939cb57dc0edb06250)

Currently displaying revision abdcc1cbf9f54c939cb57dc0edb06250, show latest

 
1
#!/bin/bash
2
#======================================
3
# Functions...
4
#--------------------------------------
5
test -f /.kconfig && . /.kconfig
6
test -f /.profile && . /.profile
7
8
#======================================
9
# Greeting...
10
#--------------------------------------
11
echo "Configure image: [$kiwi_iname]..."
12
#======================================
13
# Activate services
14
#--------------------------------------
15
ifup lo
16
suseActivateDefaultServices
17
suseInsertService boot.device-mapper
18
suseInsertService slpd
19
suseInsertService ntp
20
# OBS worker
21
suseInsertService obsworker
22
suseInsertService obsstoragesetup
23
24
#======================================
25
# SuSEconfig
26
#--------------------------------------
27
suseConfig
28
29
# no gfx boot menu, no error message please
30
sed -i /^gfxmenu/d /boot/grub/menu.lst
31
32
# setup initrd for XEN workers
33
sed -i -e 's/^DOMU_INITRD_MODULES="/DOMU_INITRD_MODULES="loop dm-mod dm-snapshot binfmt_misc fuse kqemu squashfs ext2 ext3 ext4 reiserfs btrfs vfat nf_conntrack_ipv6 /' /etc/sysconfig/kernel
34
sed -i -e 's/^NO_KMS_IN_INITRD=.*/NO_KMS_IN_INITRD="yes"/' /etc/sysconfig/kernel
35
36
# For save booting, there is some race between blogd and console setup in 11.4 atm
37
sed -i -e 's/^RUN_PARALLEL=.*/RUN_PARALLEL="no"/' /etc/sysconfig/boot
38
39
# configure network
40
cat >> /etc/sysconfig/network/config <<EOF
41
42
NETCONFIG_MODULES_ORDER="dns-resolver dns-bind ntp-runtime"
43
NETCONFIG_DNS_POLICY="auto"
44
NETCONFIG_DNS_FORWARDER="resolver"
45
NETCONFIG_NIS_SETDOMAINNAME="yes"
46
NETCONFIG_NTP_POLICY="auto"
47
EOF
48
49
chmod +x /etc/sysconfig/network/scripts/logserver-up.sh
50
ln -s /etc/sysconfig/network/scripts/logserver-up.sh /etc/sysconfig/network/if-up.d/logserver
51
52
# runlevel 3 as default
53
sed -i 's/^id:5:initdefault:/id:3:initdefault:/' /etc/inittab
54
55
# enable autosetup
56
sed -i 's,OBS_API_AUTOSETUP=.*,OBS_API_AUTOSETUP="yes",' /etc/sysconfig/obs-server
57
sed -i 's,OBS_STORAGE_AUTOSETUP=.*,OBS_STORAGE_AUTOSETUP="yes",' /etc/sysconfig/obs-*
58
sed -i 's,OBS_SETUP_WORKER_PARTITIONS=.*,OBS_SETUP_WORKER_PARTITIONS="use_obs_vg",' /etc/sysconfig/obs-*
59
60
# hardwired ntp server config, in case dhcp distribution of ntp config is not working
61
echo "" >> /etc/ntp.conf
62
echo "server ptbtime1.ptb.de" >> /etc/ntp.conf
63
echo "server ptbtime2.ptb.de" >> /etc/ntp.conf
64
echo "server ptbtime3.ptb.de" >> /etc/ntp.conf
65
echo "multicastclient" >> /etc/ntp.conf
66
67
# enable initial time sync on startup
68
sed -i 's,NTPD_FORCE_SYNC_ON_STARTUP=.*,NTPD_FORCE_SYNC_ON_STARTUP="yes",' /etc/sysconfig/ntp
69
# set our timezone
70
if [ -f /usr/share/zoneinfo/Europe/Berlin ] ; then
71
        cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
72
fi
73
74
# allow root login via serial console for debugging
75
echo "" >> /etc/securetty
76
echo "# for debugging purposes" >> /etc/securetty
77
echo ttyS0 >> /etc/securetty
78
echo ttyS1 >> /etc/securetty
79
echo "" >> /etc/inittab
80
echo "S0:12345:respawn:/sbin/agetty -L 19200 ttyS0 vt102" >> /etc/inittab
81
echo "S1:12345:respawn:/sbin/agetty -L 57600 ttyS1 vt102" >> /etc/inittab
82
 
83
# bug ?
84
chown root.root /var/lib/empty
85
86
#======================================
87
# Configure OBS to use /obs by default
88
#--------------------------------------
89
#sed -i 's,/srv/obs,/obs,g' /usr/lib/obs/server/BSConfig.pm
90
#sed -i 's,.*our $serviceserve.*,our $serviceserver = "http://$hostname:5152";,' /usr/lib/obs/server/BSConfig.pm
91
#sed -i 's,^our $repodownload.*,our $repodownload = "http://$hostname:82/";,' /usr/lib/obs/server/BSConfig.pm
92
sed -i 's,^OBS_RUN_DIR=.*,OBS_RUN_DIR="/obs/run",' /etc/sysconfig/obs-server
93
sed -i 's,^OBS_LOG_DIR=.*,OBS_LOG_DIR="/obs/log",' /etc/sysconfig/obs-server
94
#sed -i 's,^datadir.=.*,datadir = /obs/MySQL,' /etc/my.cnf
95
#sed -i '/^\[mysqld_multi\]/adatadir = /obs/MySQL' /etc/my.cnf # config of openSUSE 11.4 does not come with a default dir for its default mode
96
# signing setup
97
#sed -i 's,.*our $gpg_standard_key.*,our $gpg_standard_key = "/obs/obs-default-gpg.asc";,' /usr/lib/obs/server/BSConfig.pm
98
#sed -i 's,.*our $keyfile.*,our $keyfile = "/obs/obs-default-gpg.asc";,' /usr/lib/obs/server/BSConfig.pm
99
#sed -i 's,.*our $sign = .*,our $sign = "/usr/bin/sign";,' /usr/lib/obs/server/BSConfig.pm
100
#sed -i 's,.*our $forceprojectkeys.*,our $forceprojectkeys = 1;,' /usr/lib/obs/server/BSConfig.pm
101
#chmod 4755 /usr/bin/sign
102
# configure monitoring
103
sed -i s@"127.0.0.1$"@"127.0.0.1 85.236.33.9 83.141.20.191"@g /etc/xinetd.d/nrpe
104
echo 'command[check_updates]=/usr/lib/nagios/plugins/check_zypper' > /etc/nagios/nrpe.d/updates.cfg
105
#echo 'allow ^83\.141\.20\.189$' >> /etc/munin/munin-node.conf
106
#echo 'allow ^85\.236\.33\.9$' >> /etc/munin/munin-node.conf
107
echo 'cidr_allow 85.236.33.9/32' >> /etc/munin/munin-node.conf
108
echo 'cidr_allow 83.141.20.0/24' >> /etc/munin/munin-node.conf
109
/usr/sbin/munin-node-configure --shell | sh
110
chkconfig xinetd on
111
chkconfig munin-node on
112
113
# allow unsupported modules on sles
114
sed -i -r 's@^allow_unsupported_modules 0@allow_unsupported_modules 1@' /etc/modprobe.d/unsupported-modules
115
116
#======================================
117
# Add Default Repositories
118
#--------------------------------------
119
#zypper ar http://download.opensuse.org/update/11.4/                                       openSUSE:11.4:Update
120
#zypper ar http://download.opensuse.org/repositories/openSUSE:11.4/standard                openSUSE:11.4
121
#zypper ar http://download.opensuse.org/repositories/openSUSE:Tools/SLE_11_SP2          openSUSE:Tools
122
zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/J0KE.NET:/Tools/SLE_11_SP3/ J0KE.NET:Tools
123
zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/home:/netmax:/tools/SLE_11_SP3/ home:netmax:tools
124
zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/server:/monitoring/SLE_11_SP3/ server:monitoring
125
#======================================
126
# Umount kernel filesystems
127
#--------------------------------------
128
baseCleanMount
129
130
exit 0
131