From a739e818320423fb997eabeb0cbf921f691e4ba6 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 5 Sep 2012 11:09:31 +0200 Subject: reset repo --- .gitignore | 15 ++++ LINKS | 13 +++ README | 36 ++++++++ sync_centos.sh | 17 ++++ tftproot/README | 2 + tftproot/images/centos/6.3/i386/README | 1 + tftproot/images/centos/6.3/x86_64/README | 1 + tftproot/pxelinux.cfg/01-52-54-00-12-34-56 | 16 ++++ tftproot/pxelinux.cfg/default | 16 ++++ var/www/html/CentOS-Base.repo | 52 ++++++++++++ var/www/html/cfengine/failsafe.cf | 22 +++++ var/www/html/cfengine/update.cf | 132 +++++++++++++++++++++++++++++ var/www/html/kickstart.cfg | 55 ++++++++++++ 13 files changed, 378 insertions(+) create mode 100644 .gitignore create mode 100644 LINKS create mode 100644 README create mode 100755 sync_centos.sh create mode 100644 tftproot/README create mode 100644 tftproot/images/centos/6.3/i386/README create mode 100644 tftproot/images/centos/6.3/x86_64/README create mode 100644 tftproot/pxelinux.cfg/01-52-54-00-12-34-56 create mode 100644 tftproot/pxelinux.cfg/default create mode 100644 var/www/html/CentOS-Base.repo create mode 100644 var/www/html/cfengine/failsafe.cf create mode 100644 var/www/html/cfengine/update.cf create mode 100644 var/www/html/kickstart.cfg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485fe04 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +src/ +pkg/ +*.pkg.tar.gz +*.tar.bz2 +*.tar.gz +*.tgz +*.rar +patch*.bz2 +adapted_packages/vdr/vdr-1.6.0-1.diff +adapted_packages/vdr/vdr-1.6.0-2.diff +adapted_packages/vdr/vdr-1.6.0-2/ +adapted_packages/vdr-mplayer/vdr-plugin-mp3_0.10.1-12.diff +adapted_packages/vdr-osdteletext/attachment.php?attachmentid=13339 +adapted_packages/vdr-osdteletext/man/ +installed_packages diff --git a/LINKS b/LINKS new file mode 100644 index 0000000..1d8aa08 --- /dev/null +++ b/LINKS @@ -0,0 +1,13 @@ +QEMU +- http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Netzwerkoptionen/_Netzwerkdienste +PXE +- https://wiki.archlinux.de/title/Preboot_eXecution_Environment +- http://www.darryl.cain.com.au/pxe/pxe.php +- http://www.linuxjournal.com/magazine/pxe-magic-flexible-network-booting-menus?page=0,1 +Redhat Kickstart +- http://www.centos.org/docs/2/rhl-cg-en-7.2/s1-kickstart2-options.html +- http://wiki.centos.org/TipsAndTricks/KickStart +- http://fedoraproject.org/wiki/Anaconda/Kickstart +- http://wiki.centos.org/HowTos/CreateLocalMirror +- https://nazar.karan.org/cgit/bluecain/tree/ +- http://blog.mozilla.com/jv/2011/01/31/redirecting-kickstart-prepost-over-serial-console/ diff --git a/README b/README new file mode 100644 index 0000000..87cb4c3 --- /dev/null +++ b/README @@ -0,0 +1,36 @@ +cp /usr/lib/syslinux/pxelinux.0 $PWD/tftproot +cp /usr/lib/syslinux/menu.c32 $PWD/tftproot +cp /usr/lib/syslinux/memdisk $PWD/tftproot +cp /usr/lib/syslinux/mboot.c32 $PWD/tftproot +cp /usr/lib/syslinux/chain.c32 $PWD/tftproot +mkdir $PWD/tftproot/pxelinux.cfg + +cp -av var/www/html/* /var/www/html/. + +mkdir -p /var/www/html/Centos/6.3/ + +wget -O tftproot/images/centos/6.3/i386/vmlinuz \ + http://swissmirror.silyus.net/centos/6.3/os/i386/images/pxeboot/vmlinuz +wget -O tftproot/images/centos/6.3/i386/initrd.img \ + http://swissmirror.silyus.net/centos/6.3/os/i386/images/pxeboot/initrd.img + +qemu-img create centos6.img 32G + +/usr/local/qemu-1.0.1/bin/qemu-system-x86_64 -hda centos6.img -net nic \ + -net user,tftp=$PWD/tftproot,bootfile=pxelinux.0 -m 1024 -nographic \ + -machine accel=kvm -redir tcp:2222::22 + +#local mirror of Centos files (HTTP): +wget 'http://swissmirror.silyus.net/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-bin-DVD1.iso' +wget 'http://swissmirror.silyus.net/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-bin-DVD2.iso' +mount -ro loop CentOS-6.3-x86_64-bin-DVD1.iso /mnt +mkdir -p /var/www/html/Centos/6.3/{os,updates,extras,centosplus,contrib}/x86_64 +rsync -avHPS /mnt/* /var/www/html/Centos/6.3/os/x86_64/ +umount /mnt +mount -ro loop CentOS-6.3-x86_64-bin-DVD2.iso /mnt +rsync -avHPS /mnt/* /var/www/html/Centos/6.3/os/x86_64/ +umount /mnt +./sync_centos.sh +ln -s 6.3 /var/www/html/Centos/6 + +copy cfengine rpms to /var/www/html/cfengine diff --git a/sync_centos.sh b/sync_centos.sh new file mode 100755 index 0000000..bd6dece --- /dev/null +++ b/sync_centos.sh @@ -0,0 +1,17 @@ +#!/bin/bash +if [ -f /var/lock/subsys/rsync_updates ]; then + echo "Updates via rsync already running." + exit 0 +fi +# i386 +if [ -d /var/www/html/Centos/6.3 ] ; then + touch /var/lock/subsys/rsync_updates + for a in x86_64; do + for i in os updates extras centosplus contrib; do + rsync -avSHP --delete --exclude "local*" --exclude "isos" centos.intergenia.de::centos-linux/6.3/$i/$a/ /var/www/html/Centos/6.3/$i/$a/ + done + done + /bin/rm -f /var/lock/subsys/rsync_updates +else + echo "Target directory /share/CentOS/6.3 not present." +fi diff --git a/tftproot/README b/tftproot/README new file mode 100644 index 0000000..adf0c7a --- /dev/null +++ b/tftproot/README @@ -0,0 +1,2 @@ +menu.c32 +pxelinux.0 diff --git a/tftproot/images/centos/6.3/i386/README b/tftproot/images/centos/6.3/i386/README new file mode 100644 index 0000000..12f6040 --- /dev/null +++ b/tftproot/images/centos/6.3/i386/README @@ -0,0 +1 @@ +PXE boot image i386 diff --git a/tftproot/images/centos/6.3/x86_64/README b/tftproot/images/centos/6.3/x86_64/README new file mode 100644 index 0000000..566e206 --- /dev/null +++ b/tftproot/images/centos/6.3/x86_64/README @@ -0,0 +1 @@ +PXE boot image x86_64 diff --git a/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 b/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 new file mode 100644 index 0000000..bc1d419 --- /dev/null +++ b/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 @@ -0,0 +1,16 @@ +SAY Cfengine automatic installation.. + +DEFAULT menu.c32 +SERIAL 0 9600 0x303 +TIMEOUT 20 +PROMPT 1 + +LABEL Centos 6.0 x86_64 + MENU LABEL Centos 6.3 64-bit + KERNEL images/centos/6.3/x86_64/vmlinuz + APPEND initrd=images/centos/6.3/x86_64/initrd.img ksdevice=eth0 ks=http://192.168.0.159/kickstart.cfg console=ttyS0,9600n81 + +LABEL Centos 6.0 i386 + MENU LABEL Centos 6.3 32-bit + KERNEL images/centos/6.3/i386/vmlinuz + APPEND initrd=images/centos/6.3/i386/initrd.img ksdevice=eth0 ks=http://192.168.0.159/kickstart.cff console=ttyS0,9600n81 diff --git a/tftproot/pxelinux.cfg/default b/tftproot/pxelinux.cfg/default new file mode 100644 index 0000000..bc1d419 --- /dev/null +++ b/tftproot/pxelinux.cfg/default @@ -0,0 +1,16 @@ +SAY Cfengine automatic installation.. + +DEFAULT menu.c32 +SERIAL 0 9600 0x303 +TIMEOUT 20 +PROMPT 1 + +LABEL Centos 6.0 x86_64 + MENU LABEL Centos 6.3 64-bit + KERNEL images/centos/6.3/x86_64/vmlinuz + APPEND initrd=images/centos/6.3/x86_64/initrd.img ksdevice=eth0 ks=http://192.168.0.159/kickstart.cfg console=ttyS0,9600n81 + +LABEL Centos 6.0 i386 + MENU LABEL Centos 6.3 32-bit + KERNEL images/centos/6.3/i386/vmlinuz + APPEND initrd=images/centos/6.3/i386/initrd.img ksdevice=eth0 ks=http://192.168.0.159/kickstart.cff console=ttyS0,9600n81 diff --git a/var/www/html/CentOS-Base.repo b/var/www/html/CentOS-Base.repo new file mode 100644 index 0000000..449198b --- /dev/null +++ b/var/www/html/CentOS-Base.repo @@ -0,0 +1,52 @@ +# CentOS-Base.repo +# +# The mirror system uses the connecting IP address of the client and the +# update status of each mirror to pick mirrors that are updated to and +# geographically close to the client. You should use this for CentOS updates +# unless you are manually picking other mirrors. +# +# If the baseurl= does not work for you, as a fall back you can try the +# remarked out baseurl= line instead. +# +# + +[base] +name=CentOS-$releasever - Base +baseurl=http://192.168.0.159/Centos/$releasever/os/$basearch/ +#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#released updates +[updates] +name=CentOS-$releasever - Updates +baseurl=http://192.168.0.159/Centos/$releasever/updates/$basearch/ +#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +baseurl=http://192.168.0.159/Centos/$releasever/extras/$basearch/ +#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +baseurl=http://192.168.0.159/Centos/$releasever/centosplus/$basearch/ +#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#contrib - packages by Centos Users +[contrib] +name=CentOS-$releasever - Contrib +baseurl=http://192.168.0.159/Centos/$releasever/contrib/$basearch +#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 diff --git a/var/www/html/cfengine/failsafe.cf b/var/www/html/cfengine/failsafe.cf new file mode 100644 index 0000000..52215b9 --- /dev/null +++ b/var/www/html/cfengine/failsafe.cf @@ -0,0 +1,22 @@ +# failsafe file, do not change! + +body common control +{ + bundlesequence => { "update" }; + + inputs => { "update.cf" }; +} + +############################################ + +body depth_search recurse(d) +{ + depth => "$(d)"; +} + +body depth_search recurse_ignore(d,list) +{ + depth => "$(d)"; + exclude_dirs => { @(list) }; +} + diff --git a/var/www/html/cfengine/update.cf b/var/www/html/cfengine/update.cf new file mode 100644 index 0000000..039636c --- /dev/null +++ b/var/www/html/cfengine/update.cf @@ -0,0 +1,132 @@ +# update promises + +bundle agent update +{ + vars: + + any:: + + "master_server" string => "phost1.eurospider.com"; + + "master_location" string => "/var/cfengine/masterfiles"; + + "ignore_list" slist => { "\.svn", ".*~" }; + + redhat|freebsd:: + + "inputs_location" string => "$(sys.workdir)/inputs/."; + + debian:: + + "inputs_location" string => "/etc/cfengine3/."; + + files: + + any:: + + "$(sys.workdir)/." + + create => "true", + perms => u_p( "0700" ), + action => uimmediate; + + redhat|freebsd:: + + "$(sys.workdir)/bin/." + + create => "true", + perms => u_p( "0700" ), + action => uimmediate; + + debian:: + + "$(sys.workdir)/bin/." + + link_from => u_ln_s( "/usr/sbin" ), + action => uimmediate; + + any:: + + "$(sys.workdir)/ppkeys/." + + perms => u_p( "0700" ), + action => uimmediate; + + redhat|freebsd:: + + "$(sys.workdir)/bin" + + comment => "copy binaries from RPM location", + perms => u_p( "700" ), + copy_from => mycopy( "/usr/local/sbin", "localhost" ), + depth_search => recurse( "inf" ), + action => uimmediate; + + bunsen:: + + "$(inputs_location)" + + comment => "copy from local masterfiles on master policy server", + perms => u_p( "600" ), + copy_from => mycopy("$(master_location)","localhost"), + depth_search => recurse_ignore( "inf", "$(ignore_list)" ), + action => uimmediate; + + !bunsen:: + + "$(inputs_location)" + + comment => "all others fetch the promises from the policy master (also the slave)", + perms => u_p( "600" ), + copy_from => remote_copy( "$(master_location)", "$(master_server)" ), + depth_search => recurse_ignore( "inf", "$(ignore_list)" ), + action => uimmediate; + + commands: + + bunsen:: + + "/bin/sh -c 'cd $(master_location) && svn up >/dev/null 2>&1'" + + comment => "update the master policy files from SVN"; +} + +# self-contained functions, must work even if libaries have bugs + +# Set permissions +body perms u_p( p ) +{ + mode => "$(p)"; +} + +# Basic copy function (for local file copies) +body copy_from mycopy( from, server ) +{ + source => "$(from)"; + compare => "digest"; +} + +# Remote copy function, secure +body copy_from remote_copy( sourcedir, sourceserver ) +{ + source => "$(sourcedir)"; + servers => { "$(sourceserver)" }; + compare => "digest"; + encrypt => "true"; + verify => "true"; + trustkey => "true"; + preserve => "true"; +} + +# Copy if at least 1 minute has elapsed +body action uimmediate +{ + ifelapsed => "1"; +} + +body link_from u_ln_s(x) +{ + link_type => "symlink"; + source => "$(x)"; + when_no_source => "force"; +} diff --git a/var/www/html/kickstart.cfg b/var/www/html/kickstart.cfg new file mode 100644 index 0000000..cfbfca4 --- /dev/null +++ b/var/www/html/kickstart.cfg @@ -0,0 +1,55 @@ +# Kickstart file automatically generated by anaconda. + +#version=DEVEL +install +url --url=http://192.168.0.159/Centos/6.3/os/x86_64 +lang en_US.UTF-8 +keyboard us +network --onboot yes --device eth0 --bootproto dhcp --noipv6 +rootpw --iscrypted $6$M0aOpoXkLRTRzKcS$RPTbAk5YjUZR/JO1ClO9BWZU4KNkXXGOO/9yu2lrHMsfjgehv1Sg02dvhLQ3OzLBfIGggcZ7.2JRle4TJbdAU/ +firewall --service=ssh --port=5308:tcp +authconfig --enableshadow --passalgo=sha512 +selinux --enforcing +timezone --utc Europe/Zurich +bootloader --location=mbr --driveorder=sda --append=" rhgb crashkernel=auto console=ttyS0,9600n81" + +zerombr +clearpart --all --drives=sda --initlabel + +part / --label=ROOT --fstype=ext4 --size=8192 +part swap --label=SWAP --size=4096 +part /data --label=DATA --size=8192 --grow + +skipx +cmdline + +repo --name="CentOS" --baseurl=http://192.168.0.159/Centos/6.3/os/x86_64 --cost=100 + +reboot + +%packages --excludedocs --nobase +@core +wget +%end + +%post +exec < /dev/console > /dev/console +#!/bin/bash +cd /root +wget -O /etc/yum.repos.d/CentOS-Base.repo http://192.168.0.159/CentOS-Base.repo +rpm --import /etc/pki/rpm-gpg/* +yum clean all +yum update -y + +mkdir /root/cfengine +cd /root/cfengine +wget -nd -r http://192.168.0.159/cfengine +yum localinstall -y cfengine-community-3.2.1-1.el6.x86_64.rpm +cp -v {failsafe,update}.cf /var/cfengine/inputs/. +cd /root + +/usr/local/sbin/cf-agent -B + +/usr/local/sbin/cf-agent + +%end -- cgit v1.2.3-54-g00ecf