Search
j0ke.net Open Build Service
>
Projects
>
J0KE.NET
:
Tools
:
images
>
OBS-WorkerOnly-pxe-xen_openSUSE_42.3
> config.sh
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File config.sh of Package OBS-WorkerOnly-pxe-xen_openSUSE_42.3
#!/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 suseInsertService ntp suseInsertService sshd # OBS worker suseInsertService obsworker #suseInsertService obsstoragesetup #====================================== # SuSEconfig #-------------------------------------- suseConfig # no gfx boot menu, no error message please sed -i /^gfxmenu/d /boot/grub/menu.lst # Remove all documentation docfiles=`find /usr/share/doc/packages -type f |grep -iv "copying\|license\|copyright"` rm -f $docfiles rm -rf /usr/share/info rm -rf /usr/share/man # setup initrd for XEN workers # a longer list to have them also available for qemu cross builds where x86_64 kernel runs in eg. arm env. # this list of modules where available on build workers of build.opensuse.org, so we stay compatible. export KERNEL_MODULES="loop dm-mod dm-snapshot binfmt-misc fuse kqemu squashfs ext2 ext3 ext4 xfs mptctl reiserfs nf_conntrack_ipv6 binfmt_misc virtio_pci virtio_mmio virtio_blk virtio-rng fat vfat nls_cp437 nls_iso8859-1 ibmvscsi ibmvscsic" echo "force_drivers+=\"$KERNEL_MODULES\"" >/etc/dracut.conf.d/03-my-obs.conf echo "options loop max_loop=64 lbs=0" > /etc/modprobe.d/50-obs.conf for MOD in $KERNEL_MODULES ; do echo $MOD >> /etc/modules-load.d/obs.conf done sed -i -e 's/^DOMU_INITRD_MODULES="/DOMU_INITRD_MODULES="loop dm-mod dm-snapshot binfmt_misc fuse kqemu squashfs ext2 ext3 ext4 xfs mptctl reiserfs btrfs vfat nf_conntrack_ipv6 /' /etc/sysconfig/kernel sed -i -e 's/^NO_KMS_IN_INITRD=.*/NO_KMS_IN_INITRD="yes"/' /etc/sysconfig/kernel # For save booting, there is some race between blogd and console setup in 11.4 atm sed -i -e 's/^RUN_PARALLEL=.*/RUN_PARALLEL="no"/' /etc/sysconfig/boot # 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 chmod +x /etc/sysconfig/network/scripts/logserver-up.sh ln -s /etc/sysconfig/network/scripts/logserver-up.sh /etc/sysconfig/network/if-up.d/logserver # 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-* sed -i 's,OBS_SETUP_WORKER_PARTITIONS=.*,OBS_SETUP_WORKER_PARTITIONS="use_obs_vg",' /etc/sysconfig/obs-* # hardwired ntp server config, in case dhcp distribution of ntp config is not working echo "" >> /etc/ntp.conf echo "server ptbtime1.ptb.de" >> /etc/ntp.conf echo "server ptbtime2.ptb.de" >> /etc/ntp.conf echo "server ptbtime3.ptb.de" >> /etc/ntp.conf echo "restrict 127.0.0.1" >> /etc/ntp.conf echo "restrict -6 ::1" >> /etc/ntp.conf echo "restrict ptbtime1.ptb.de nomodify notrap nopeer noquery" >> /etc/ntp.conf echo "restrict ptbtime2.ptb.de nomodify notrap nopeer noquery" >> /etc/ntp.conf echo "restrict ptbtime3.ptb.de nomodify notrap nopeer noquery" >> /etc/ntp.conf echo "disable monitor" >> /etc/ntp.conf #echo "multicastclient" >> /etc/ntp.conf # enable initial time sync on startup sed -i 's,NTPD_FORCE_SYNC_ON_STARTUP=.*,NTPD_FORCE_SYNC_ON_STARTUP="yes",' /etc/sysconfig/ntp # set our timezone if [ -f /usr/share/zoneinfo/Europe/Berlin ] ; then cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime fi # allow root login via serial console for debugging #echo "" >> /etc/securetty #echo "# for debugging purposes" >> /etc/securetty #echo ttyS0 >> /etc/securetty #echo ttyS1 >> /etc/securetty #echo "" >> /etc/inittab #echo "S0:12345:respawn:/sbin/agetty -L 19200 ttyS0 vt102" >> /etc/inittab #echo "S1:12345:respawn:/sbin/agetty -L 57600 ttyS1 vt102" >> /etc/inittab systemctl enable getty@ttyS0.service systemctl enable getty@ttyS1.service # bug ? chown root.root /var/lib/empty #====================================== # 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 #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 # 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 # configure monitoring sed -i s@"127.0.0.1$"@"127.0.0.1 85.236.33.9 83.141.20.191"@g /etc/xinetd.d/nrpe echo 'command[check_updates]=/usr/lib/nagios/plugins/check_zypper' > /etc/nagios/nrpe.d/updates.cfg #echo 'allow ^83\.141\.20\.189$' >> /etc/munin/munin-node.conf #echo 'allow ^85\.236\.33\.9$' >> /etc/munin/munin-node.conf echo 'cidr_allow 85.236.33.9/32' >> /etc/munin/munin-node.conf echo 'cidr_allow 83.141.20.0/24' >> /etc/munin/munin-node.conf /usr/sbin/munin-node-configure --shell | sh suseInsertService xinetd suseInsertService munin-node suseRemoveService rpcbind # allow unsupported modules on sles if [ -f /etc/modprobe.d/unsupported-modules ] ; then sed -i -r 's@^allow_unsupported_modules 0@allow_unsupported_modules 1@' /etc/modprobe.d/unsupported-modules fi # default runlevel baseSetRunlevel 3 #====================================== # Add Default Repositories #-------------------------------------- zypper --gpg-auto-import-keys ar -f http://download.opensuse.org/distribution/leap/42.3/repo/oss/ openSUSE_42.3_oss zypper --gpg-auto-import-keys ar -f http://download.opensuse.org/distribution/leap/42.3/repo/non-oss/ openSUSE_42.3_non-oss zypper --gpg-auto-import-keys ar -f http://download.opensuse.org/update/leap/42.3/oss/ openSUSE_42.3_Update_oss zypper --gpg-auto-import-keys ar -f http://download.opensuse.org/update/leap/42.3/non-oss/ openSUSE_42.3_Update_non-oss zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/J0KE.NET:/Tools/openSUSE_42.3/ J0KE.NET:Tools zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/home:/netmax:/tools/openSUSE_42.3/ home:netmax:tools zypper --gpg-auto-import-keys ar -f http://download.obs.j0ke.net/server:/monitoring/openSUSE_42.3/ server:monitoring #====================================== # Umount kernel filesystems #-------------------------------------- baseCleanMount exit 0