diff options
| author | michael | 2013-02-20 19:05:33 +0100 |
|---|---|---|
| committer | michael | 2013-02-20 19:05:33 +0100 |
| commit | 56768840998ed7b98e3b412fae004ba375a64f93 (patch) | |
| tree | 1e963106f0d402f58e1d4c3dbd117969644f33d3 | |
| parent | install libkmod from source (diff) | |
| parent | init auto hw config (diff) | |
| download | tm-scripts-56768840998ed7b98e3b412fae004ba375a64f93.tar.gz tm-scripts-56768840998ed7b98e3b412fae004ba375a64f93.tar.xz tm-scripts-56768840998ed7b98e3b412fae004ba375a64f93.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
50 files changed, 1424 insertions, 26 deletions
diff --git a/data/activate-swap b/data/activate-swap new file mode 100644 index 00000000..10cb42e9 --- /dev/null +++ b/data/activate-swap @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Initialize swap for OpenSLX linux stateless clients, both for swap on local +# disk partitions as well as compressed ramzswap or similar + +############################################################################# + +# depends on mount-disk.sh +# depends on availability of the appropriate kernel module/functionality + +# try to enable compressed RAM SWAP / ZRAM +if modprobe ${MODPRV} ramzswap 2>/dev/null && [ -f /usr/bin/rzscontrol ] ; then + rzscontrol /dev/ramzswap0 --init + swapon /dev/ramzswap0 2>/dev/null + #hdswap="# disk swap disabled because of enabled compressed ramswap" +elif modprobe ${MODPRV} zram 2>/dev/null ; then + # assign a quarter of total mem to zram + echo $(( $(free -k | awk '/^Mem:/ { print $2 }') * 256 )) > /sys/block/zram0/disksize + mkswap /dev/zram0 2>/dev/null + swapon /dev/zram0 2>/dev/null +fi diff --git a/data/analyse-disk.sh b/data/analyse-disk.sh new file mode 100644 index 00000000..0c152dbf --- /dev/null +++ b/data/analyse-disk.sh @@ -0,0 +1,120 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Local hard disk autoconfiguration script for OpenSLX linux stateless +# clients, detecting swap and special partitions + +############################################################################# + +# Todo: +# * This script should be run just once per boot! +# * The activation of swap could/should be handled in separate script!? +# * The mounting of /tmp could/should be done separately? +# * Same for other partitions, use information of /etc/fstab for that? +# * Should we just install xfs in the source system and boil down everything +# onto that? + +# General formatter for the /tmp partition on a local harddisk +diskfm () { +local target=$1 +local mntpnt=$2 +local fs +local path +for fs in xfs reiserfs ext2 ; do + if strinfile "$fs" /proc/filesystems || modprobe ${MODPRV} $fs ; then + unset $found + for path in /sbin /bin /usr/sbin /usr/bin ; do + if test -x /mnt/$path/mkfs.$fs ; then + found=yes + case mkfs.$fs in + mkfs.xfs) + fopt="-f" + mopt="-o noexec" + ;; + mkfs.ext2) + fopt="-Fq" + mopt="-o nocheck,noexec" + ;; + mkfs.reiserfs) + fopt="-f" + mopt="-o noexec" + ;; + esac + mkfs.$fs $fopt $target >/dev/null 2>&1 #|| error + if [ -z $mntpnt ] ; then + umount /tmp 2>/dev/null + if mount -t $fs -n $mopt $target /tmp 2>/dev/null; then + return 0 + else + mount -n -t tmpfs none /tmp + fi + else + mkdir -p $mntpnt + mount -t $fs -n -o loop $target $mntpnt 2>/dev/null + return 0 + fi + fi + done + [ -z $found ] && continue + else break + fi +done +} + +# Check for local harddisks and appropriate partitions +fdisk -l /dev/$hd|sed -n "/^\/dev\//p" >/etc/disk.partition + +# Check for standard swap partitions and make them available to the system +for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ 82 /p"|sed -e "s/[[:space:]].*//") ; do + echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >>/etc/fstab +done + +# We use special non assigned partition type (id44) for harddisk scratch +# space, thus no normal filesystem will be incidentally deleted or +# corrupted +for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do + # check for supported filesystem and formatter + ( if diskfm $hdpartnr ; then + echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" >/tmp/tmpready + echo -e "$hdpartnr\t/tmp\t\tauto\t\tdefaults\t 0 0" >>/etc/fstab + else + echo "formatting failed for some reason ($(sysup))" >/tmp/tmpready + fi ) & + break +done + +# Put detected linux partitions (83) into /etc/fstab with "noauto", special +# partition 45 (persistent scratch) to /var/scratch and 46 to /var/openslx +for partid in 83 45 46 ; do + for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ ${partid} /p"|sed -e "s/[[:space:]].*//") ; do + mkdir -p /media/${hdpartnr#/dev/*} 2>/dev/null + if [ ${partid} -eq 83 ] ; then + echo -e "$hdpartnr\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,\ +noexec\t 0 0" >>/tmp/fstab + elif [ ${partid} -eq 45 ] ; then + #mount -t auto ${hdpartnr} /media/${hdpartnr#/dev/*} + #ln -sf /media/${hdpartnr#/dev/*} /var/scratch + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\ +\t\t 0 0" >>/tmp/fstab + elif [ ${partid} -eq 46 ] ; then + # Mount a home directory to (/mnt)/var/home + #mount -t auto ${hdpartnr} /mnt/media/${hdpartnr#/dev/*} \n\ + #test -d /mnt/media/${hdpartnr#/dev/*}/home && \ + # ln -sf /media/${hdpartnr#/dev/*} /var/home + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\ +\t\t 0 0" >>/tmp/fstab + fi + done +done + diff --git a/data/fetch-config b/data/fetch-config new file mode 100644 index 00000000..556f0f41 --- /dev/null +++ b/data/fetch-config @@ -0,0 +1,178 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Fetch configuration from server ... + +############################################################################# + +# Depends on configured networking, provides configuration + + +# Todo: rewrite for next-gen system - principle would be the same ... + +# Function for retrieving configuration file (machine-setup) via tftp from a +# predefined server or given source (file=tftp-server:/path via kernel +# command line) +unpack () { +# $1 is config file name to get, $2 IP of server to get file from +local dst=$1 +if [ -s $dst ] ; then + # fixme: handle different types of packaging (gzip/bzip2)?? + if ! tar -xpzf $dst 2> /tmp/ConfTGZ-tar-error ; then + cat /tmp/ConfTGZ-tar-error + error "$unpack_ConfTGZ" nonfatal + rm /tmp/ConfTGZ-tar-error + fi + [ "$DEBUGLEVEL" -le 2 -o "$DEBUGLEVEL" -eq 8 ] && rm $dst + return 0 +else + return 1 +fi +} + +# tftp wrapper +# usage tftp_get <path> <tftpdserver> [count] +# count is optional - default is 3 - use -1 for indefinit +tftp_get () { + local file="$1" + local file_server="$2" + local download_successful=0 + local countdown="$3" + + if [ -z "$1" -o -z "$2" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[tftp_get] Usage: tftp_get <path> <server> [count]" + return 1; + fi + + [ "$countdown" = "" ] && countdown=3 + + until [ $download_successful -eq 1 ] + do + if [ "$countdown" = "0" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[tftp_get] download of \"$file\" from \"$file_server\" ... failed" + return 0; + fi + tftp -g -r "/$file" -l /tmp/$(basename $file) $file_server + [ -s /tmp/$(basename $file) ] && download_successful=1 + countdown=$(expr $countdown - 1) + usleep 200000 + done + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[tftp_get] download of \"$file\" from \"$file_server\" ... successful" + return 0; +} + + +# wget wrapper +# usage wget_get <path> <ftp/httpserver> [count] +# count is optional - default is 3 - use -1 for indefinit +wget_get () { + local file="$1" + local file_server="$2" + local download_successful=0 + local countdown="$3" + + if [ -z "$1" -o -z "$2" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[wget_get] Usage: wget_get <path> <server> [count]" + return 1; + fi + + [ "$countdown" = "" ] && countdown=3 + + until [ $download_successful -eq 1 ] + do + if [ "$countdown" = "0" ]; then + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[wget_get] download of \"$file\" from \"$file_server\" ... failed" + return 0; + fi + wget -q $file_server$file -O /tmp/$(basename $file) + [ -s /tmp/$(basename $file) ] && download_successful=1 + countdown=$(expr $countdown - 1) + usleep 200000 + done + [ $DEBUGLEVEL -ge 1 ] && \ + echo "[wget_get] download of \"$file\" from \"$file_server\" ... successful" + return 0; +} + + +fileget () { +# normally tftp would be used, alternatively use wget for ftp or http +# if local device file is specified - mount and unmount after copying +local cfgfile +[ "x$fileprot" = "x" ] && fileprot=tftp +if [ "x$filepath" != "x" ] ; then + cfgfile=${filepath} + [ "x$fileserv" = "x" ] && fileserv=$(checkip ${serverip}) + # wait for dns if "fileserv" is a name and not lbd device + [ "$fileprot" != "lbd" ] && \ + echo ${fileserv} | grep -qi [a-z] + [ $DEBUGLEVEL -ge 1 ] && echo "fileget - fileprot:$fileprot, filepath:\ +$filepath, fileserv:$fileserv" >>$LOGFILE + case "$fileprot" in + ftp|http) + wget_get $cfgfile $fileprot://$fileserv \ + && { unpack /tmp/$(basename $cfgfile) && break; } 2>>$LOGFILE + ;; + lbd) + local ldev=$fileserv + echo "Waiting for configuration file ${cfgfile} ...." + [ $DEBUGLEVEL -ge 1 ] && echo "fileget - fileprot:$fileprot, filepath:\ +$filepath, fileserv:$fileserv" >>$LOGFILE + waitfor /mnt/${cfgfile} 10000 + if [ -f /mnt/${cfgfile} ]; then + unpack /mnt/$cfgfile + else + error "$init_errlfg" + fi + ;; + *) + tftp_get $cfgfile $fileserv \ + && unpack /tmp/$(basename $cfgfile) 2>>$LOGFILE + ;; + esac +else + # predefined value for OpenSLX environment; it is expected that this + # directory is just below the tftpboot (path to which the daemon is + # restricted to) + filepath="client-config" + [ "x$fileserv" = "x" ] && fileserv=$(checkip ${serverip}) + [ $DEBUGLEVEL -ge 1 ] && echo "fileget - fileprot:$fileprot, filepath:\ +$filepath, fileserv:$fileserv" >>$LOGFILE + # try to get configuration files successively; start with distro client + # and try last distro default ... + mac=$(echo $macaddr|sed "s/:/-/g") + for cfgfile in ${filepath}/${SYSTEM_NAME}/01-$mac.tgz \ + ${filepath}/${SYSTEM_NAME}/default.tgz ; do + case "$fileprot" in + ftp|http) + wget $fileprot://$fileserv/$cfgfile -O /tmp/$(basename $cfgfile) \ + 2>>$LOGFILE && { unpack /tmp/$(basename $cfgfile) && break; } + ;; + tftp) + tftp_get $cfgfile $fileserv \ + 2>>$LOGFILE && { unpack /tmp/$(basename $cfgfile) && break; } + ;; + esac + done + echo -e "\n## Configuration via fileget from ${fileprot}://${fileserv}/\ +${cfgfile}\n# Hierarchy is distro client and as last distro/default" \ + >>/tmp/confviafile +fi +cat /initramfs/machine-setup >>/tmp/confviafile 2>/dev/null || \ + error "$nomachsetup" +echo "fileget via $fileprot from $fileserv/$cfgfile finished" >/tmp/file-done +[ $DEBUGLEVEL -ge 1 ] && echo "fileget from $cfgfile finished" >>$LOGFILE +} diff --git a/data/ip-dns-conf b/data/ip-dns-conf new file mode 100644 index 00000000..f14ecd88 --- /dev/null +++ b/data/ip-dns-conf @@ -0,0 +1,86 @@ +#!/bin/sh +# Copyright (c) 2013 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Set IP and DNS configuration ... + +############################################################################# + +# Depends on running network interface, provides IP and DNS configuration + +# Dns and ip configuration, hostname of the machine --> to be merged with udhcpc.default.script!! +echo "$host_name" >/proc/sys/kernel/hostname +echo -e "# /etc/hosts - file generated by $0 during OpenSLX stage3\ +\n#\n# IP-Address Full-Qualified-Hostname Short-Hostname\n#\n\ +127.0.0.1\tlocalhost\n::1\t\tlocalhost ipv6-localhost ipv6-loopback\n\ +fe00::0\t\tipv6-localnet\nff00::0\t\tipv6-mcastprefix\nff02::1\ +\t\tipv6-allnodes\nff02::2\t\tipv6-allrouters\nff02::3\t\t\ +ipv6-allhosts\n" >/etc/hosts +if [ -n "${domain_name}" ]; then + echo -en "${clientip}\t" >>/etc/hosts + for name in ${domain_name}; do + echo -en "${host_name}.${name} " >>/etc/hosts + done + echo -e "${host_name}" >>/etc/hosts +else + echo -e "${clientip}\t${host_name}" >>/etc/hosts +fi +# set up domainname and resolving +#rm -rf /etc/resolv.conf + +out=/etc/resolv.conf +echo -e "# /etc/resolv.conf - file generated by\n#\t$0:\n\ +#\t${date}\n#options timeout:1 attempts:1 rotate" > $out + +[ "x${domain_name}" != "x" ] && echo -e "domain ${domain_name}" >> $out +[ "x${domain_search}" != "x" ] && echo -e "search ${domain_search}" >> $out +# fallback +[ "x${domain_search}" == "x" ] && [ "x${domain_name}" != "x" ] && \ + echo -e "search ${domain_name}" >> $out + +[ -n "${domain_name_servers}" ] && { + for name in ${domain_name_servers}; do + echo nameserver ${name} >> $out; + done; } + +# Create hostname file +[ -n ${host_name} ] && [ -n ${domain_name} ] && \ + echo "${host_name}.${domain_name}" > /etc/hostname + + +# Set greeting and add information on booted system +len=$(expr length ${SLXVERSION}${SYSTEM_NAME}) +if [ $len -le 28 ] ; then + vdstr="Stateless Workstation (V${SLXVERSION}/${SYSTEM_NAME})" + smax=28 +else + vdstr="V${SLXVERSION}/${SYSTEM_NAME}" + smax=52 +fi +while [ $len -le $smax ] ; do + vdstr="$vdstr " + len=$(($len + 1)) +done +len=$(expr length ${host_name}) +while [ $len -le 30 ] ; do + space="$space " + len=$(($len + 1)) +done +echo " + WELCOME TO $space \n (\l) + _____ ______ ______ __ __ _______ __ __ __ + / _ | _ | ___| | | | | ____| | | | | | + | | | | |_| | |_ | | | | |___ | | / / + | | | | ___/| _| | | ____ | | | | + | |_| | | | |___| | | | ____| | |___ / / + _____/|__| |______|__| |__| |_______|______|__| |__| + + $vdstr (c) <OpenSLX.ORG> +" >/etc/issue diff --git a/data/stage3.1/etc/netconfig b/data/stage3.1/etc/netconfig new file mode 100644 index 00000000..effc67eb --- /dev/null +++ b/data/stage3.1/etc/netconfig @@ -0,0 +1,19 @@ +# +# The network configuration file. This file is currently only used in +# conjunction with the TI-RPC code in the libtirpc library. +# +# Entries consist of: +# +# <network_id> <semantics> <flags> <protofamily> <protoname> \ +# <device> <nametoaddr_libs> +# +# The <device> and <nametoaddr_libs> fields are always empty in this +# implementation. +# +udp tpi_clts v inet udp - - +tcp tpi_cots_ord v inet tcp - - +udp6 tpi_clts v inet6 udp - - +tcp6 tpi_cots_ord v inet6 tcp - - +rawip tpi_raw - inet - - - +local tpi_cots_ord - loopback - - - +unix tpi_cots_ord - loopback - - - diff --git a/data/stage3.1/etc/networks b/data/stage3.1/etc/networks new file mode 100644 index 00000000..c0608214 --- /dev/null +++ b/data/stage3.1/etc/networks @@ -0,0 +1 @@ +link-local 169.254.0.0 diff --git a/data/stage3.1/etc/protocols b/data/stage3.1/etc/protocols new file mode 100644 index 00000000..1eac5963 --- /dev/null +++ b/data/stage3.1/etc/protocols @@ -0,0 +1,54 @@ +ip 0 IP +icmp 1 ICMP +igmp 2 IGMP +ggp 3 GGP +ipencap 4 IP-ENCAP +st 5 ST +tcp 6 TCP +egp 8 EGP +igp 9 IGP +pup 12 PUP +udp 17 UDP +hmp 20 HMP +xns-idp 22 XNS-IDP +rdp 27 RDP +iso-tp4 29 ISO-TP4 +dccp 33 DCCP +xtp 36 XTP +ddp 37 DDP +idpr-cmtp 38 IDPR-CMTP +ipv6 41 IPv6 +ipv6-route 43 IPv6-Route +ipv6-frag 44 IPv6-Frag +idrp 45 IDRP +rsvp 46 RSVP +gre 47 GRE +esp 50 IPSEC-ESP +ah 51 IPSEC-AH +skip 57 SKIP +ipv6-icmp 58 IPv6-ICMP +ipv6-nonxt 59 IPv6-NoNxt +ipv6-opts 60 IPv6-Opts +rspf 73 RSPF CPHB +vmtp 81 VMTP +eigrp 88 EIGRP +ospf 89 OSPFIGP +ax.25 93 AX.25 +ipip 94 IPIP +etherip 97 ETHERIP +encap 98 ENCAP +pim 103 PIM +ipcomp 108 IPCOMP +vrrp 112 VRRP +l2tp 115 L2TP +isis 124 ISIS +sctp 132 SCTP +fc 133 FC +mobility-header 135 Mobility-Header +udplite 136 UDPLite +mpls-in-ip 137 MPLS-in-IP +manet 138 +hip 139 HIP +shim6 140 Shim6 +wesp 141 WESP +rohc 142 ROHC diff --git a/data/stage3.1/etc/services b/data/stage3.1/etc/services new file mode 100644 index 00000000..65869e99 --- /dev/null +++ b/data/stage3.1/etc/services @@ -0,0 +1,550 @@ +tcpmux 1/tcp +echo 7/tcp +echo 7/udp +discard 9/tcp sink null +discard 9/udp sink null +systat 11/tcp users +daytime 13/tcp +daytime 13/udp +netstat 15/tcp +qotd 17/tcp quote +msp 18/tcp +msp 18/udp +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp-data 20/tcp +ftp 21/tcp +fsp 21/udp fspd +ssh 22/tcp +ssh 22/udp +telnet 23/tcp +smtp 25/tcp mail +time 37/tcp timserver +time 37/udp timserver +rlp 39/udp resource +nameserver 42/tcp name +whois 43/tcp nicname +tacacs 49/tcp +tacacs 49/udp +re-mail-ck 50/tcp +re-mail-ck 50/udp +domain 53/tcp +domain 53/udp +mtp 57/tcp +tacacs-ds 65/tcp +tacacs-ds 65/udp +bootps 67/tcp +bootps 67/udp +bootpc 68/tcp +bootpc 68/udp +tftp 69/udp +gopher 70/tcp +gopher 70/udp +rje 77/tcp netrjs +finger 79/tcp +http 80/tcp www +http 80/udp +link 87/tcp ttylink +kerberos 88/tcp kerberos5 krb5 kerberos-sec +kerberos 88/udp kerberos5 krb5 kerberos-sec +supdup 95/tcp +hostnames 101/tcp hostname +iso-tsap 102/tcp tsap +acr-nema 104/tcp dicom +acr-nema 104/udp dicom +csnet-ns 105/tcp cso-ns +csnet-ns 105/udp cso-ns +rtelnet 107/tcp +rtelnet 107/udp +pop2 109/tcp postoffice pop-2 +pop2 109/udp pop-2 +pop3 110/tcp pop-3 +pop3 110/udp pop-3 +sunrpc 111/tcp portmapper +sunrpc 111/udp portmapper +auth 113/tcp authentication tap ident +sftp 115/tcp +uucp-path 117/tcp +nntp 119/tcp readnews untp +ntp 123/tcp +ntp 123/udp +pwdgen 129/tcp +pwdgen 129/udp +loc-srv 135/tcp epmap +loc-srv 135/udp epmap +netbios-ns 137/tcp +netbios-ns 137/udp +netbios-dgm 138/tcp +netbios-dgm 138/udp +netbios-ssn 139/tcp +netbios-ssn 139/udp +imap2 143/tcp imap +imap2 143/udp imap +snmp 161/tcp +snmp 161/udp +snmp-trap 162/tcp snmptrap +snmp-trap 162/udp snmptrap +cmip-man 163/tcp +cmip-man 163/udp +cmip-agent 164/tcp +cmip-agent 164/udp +mailq 174/tcp +mailq 174/udp +xdmcp 177/tcp +xdmcp 177/udp +nextstep 178/tcp NeXTStep NextStep +nextstep 178/udp NeXTStep NextStep +bgp 179/tcp +bgp 179/udp +prospero 191/tcp +prospero 191/udp +irc 194/tcp +irc 194/udp +smux 199/tcp +smux 199/udp +at-rtmp 201/tcp +at-rtmp 201/udp +at-nbp 202/tcp +at-nbp 202/udp +at-echo 204/tcp +at-echo 204/udp +at-zis 206/tcp +at-zis 206/udp +qmtp 209/tcp +qmtp 209/udp +z3950 210/tcp wais +z3950 210/udp wais +ipx 213/tcp +ipx 213/udp +imap3 220/tcp +imap3 220/udp +pawserv 345/tcp +pawserv 345/udp +zserv 346/tcp +zserv 346/udp +fatserv 347/tcp +fatserv 347/udp +rpc2portmap 369/tcp +rpc2portmap 369/udp +codaauth2 370/tcp +codaauth2 370/udp +clearcase 371/tcp Clearcase +clearcase 371/udp Clearcase +ulistserv 372/tcp +ulistserv 372/udp +ldap 389/tcp +ldap 389/udp +imsp 406/tcp +imsp 406/udp +svrloc 427/tcp +svrloc 427/udp +https 443/tcp +https 443/udp +snpp 444/tcp +snpp 444/udp +microsoft-ds 445/tcp +microsoft-ds 445/udp +kpasswd 464/tcp +kpasswd 464/udp +saft 487/tcp +saft 487/udp +isakmp 500/tcp +isakmp 500/udp +rtsp 554/tcp +rtsp 554/udp +nqs 607/tcp +nqs 607/udp +npmp-local 610/tcp dqs313_qmaster +npmp-local 610/udp dqs313_qmaster +npmp-gui 611/tcp dqs313_execd +npmp-gui 611/udp dqs313_execd +hmmp-ind 612/tcp dqs313_intercell +hmmp-ind 612/udp dqs313_intercell +qmqp 628/tcp +qmqp 628/udp +ipp 631/tcp +ipp 631/udp +exec 512/tcp +biff 512/udp comsat +login 513/tcp +who 513/udp whod +shell 514/tcp cmd +syslog 514/udp +printer 515/tcp spooler +talk 517/udp +ntalk 518/udp +route 520/udp router routed +timed 525/udp timeserver +tempo 526/tcp newdate +courier 530/tcp rpc +conference 531/tcp chat +netnews 532/tcp readnews +netwall 533/udp +gdomap 538/tcp +gdomap 538/udp +uucp 540/tcp uucpd +klogin 543/tcp +kshell 544/tcp krcmd +dhcpv6-client 546/tcp +dhcpv6-client 546/udp +dhcpv6-server 547/tcp +dhcpv6-server 547/udp +afpovertcp 548/tcp +afpovertcp 548/udp +idfp 549/tcp +idfp 549/udp +remotefs 556/tcp rfs_server rfs +nntps 563/tcp snntp +nntps 563/udp snntp +submission 587/tcp +submission 587/udp +ldaps 636/tcp +ldaps 636/udp +tinc 655/tcp +tinc 655/udp +silc 706/tcp +silc 706/udp +kerberos-adm 749/tcp +webster 765/tcp +webster 765/udp +rsync 873/tcp +rsync 873/udp +ftps-data 989/tcp +ftps 990/tcp +telnets 992/tcp +telnets 992/udp +imaps 993/tcp +imaps 993/udp +ircs 994/tcp +ircs 994/udp +pop3s 995/tcp +pop3s 995/udp +socks 1080/tcp +socks 1080/udp +proofd 1093/tcp +proofd 1093/udp +rootd 1094/tcp +rootd 1094/udp +openvpn 1194/tcp +openvpn 1194/udp +rmiregistry 1099/tcp +rmiregistry 1099/udp +kazaa 1214/tcp +kazaa 1214/udp +nessus 1241/tcp +nessus 1241/udp +lotusnote 1352/tcp lotusnotes +lotusnote 1352/udp lotusnotes +ms-sql-s 1433/tcp +ms-sql-s 1433/udp +ms-sql-m 1434/tcp +ms-sql-m 1434/udp +ingreslock 1524/tcp +ingreslock 1524/udp +prospero-np 1525/tcp +prospero-np 1525/udp +datametrics 1645/tcp old-radius +datametrics 1645/udp old-radius +sa-msg-port 1646/tcp old-radacct +sa-msg-port 1646/udp old-radacct +kermit 1649/tcp +kermit 1649/udp +groupwise 1677/tcp +groupwise 1677/udp +l2f 1701/tcp l2tp +l2f 1701/udp l2tp +radius 1812/tcp +radius 1812/udp +radius-acct 1813/tcp radacct +radius-acct 1813/udp radacct +msnp 1863/tcp +msnp 1863/udp +unix-status 1957/tcp +log-server 1958/tcp +remoteping 1959/tcp +cisco-sccp 2000/tcp +cisco-sccp 2000/udp +search 2010/tcp ndtp +pipe-server 2010/tcp pipe_server +nfs 2049/tcp +nfs 2049/udp +gnunet 2086/tcp +gnunet 2086/udp +rtcm-sc104 2101/tcp +rtcm-sc104 2101/udp +gsigatekeeper 2119/tcp +gsigatekeeper 2119/udp +gris 2135/tcp +gris 2135/udp +cvspserver 2401/tcp +cvspserver 2401/udp +venus 2430/tcp +venus 2430/udp +venus-se 2431/tcp +venus-se 2431/udp +codasrv 2432/tcp +codasrv 2432/udp +codasrv-se 2433/tcp +codasrv-se 2433/udp +mon 2583/tcp +mon 2583/udp +dict 2628/tcp +dict 2628/udp +f5-globalsite 2792/tcp +f5-globalsite 2792/udp +gsiftp 2811/tcp +gsiftp 2811/udp +gpsd 2947/tcp +gpsd 2947/udp +gds-db 3050/tcp gds_db +gds-db 3050/udp gds_db +icpv2 3130/tcp icp +icpv2 3130/udp icp +mysql 3306/tcp +mysql 3306/udp +nut 3493/tcp +nut 3493/udp +distcc 3632/tcp +distcc 3632/udp +daap 3689/tcp +daap 3689/udp +svn 3690/tcp subversion +svn 3690/udp subversion +suucp 4031/tcp +suucp 4031/udp +sysrqd 4094/tcp +sysrqd 4094/udp +sieve 4190/tcp +epmd 4369/tcp +epmd 4369/udp +remctl 4373/tcp +remctl 4373/udp +f5-iquery 4353/tcp +f5-iquery 4353/udp +iax 4569/tcp +iax 4569/udp +mtn 4691/tcp +mtn 4691/udp +radmin-port 4899/tcp +radmin-port 4899/udp +rfe 5002/udp +rfe 5002/tcp +mmcc 5050/tcp +mmcc 5050/udp +sip 5060/tcp +sip 5060/udp +sip-tls 5061/tcp +sip-tls 5061/udp +aol 5190/tcp +aol 5190/udp +xmpp-client 5222/tcp jabber-client +xmpp-client 5222/udp jabber-client +xmpp-server 5269/tcp jabber-server +xmpp-server 5269/udp jabber-server +cfengine 5308/tcp +cfengine 5308/udp +mdns 5353/tcp +mdns 5353/udp +postgresql 5432/tcp postgres +postgresql 5432/udp postgres +freeciv 5556/tcp rptp +freeciv 5556/udp +amqp 5672/tcp +amqp 5672/udp +amqp 5672/sctp +ggz 5688/tcp +ggz 5688/udp +x11 6000/tcp x11-0 +x11 6000/udp x11-0 +x11-1 6001/tcp +x11-1 6001/udp +x11-2 6002/tcp +x11-2 6002/udp +x11-3 6003/tcp +x11-3 6003/udp +x11-4 6004/tcp +x11-4 6004/udp +x11-5 6005/tcp +x11-5 6005/udp +x11-6 6006/tcp +x11-6 6006/udp +x11-7 6007/tcp +x11-7 6007/udp +gnutella-svc 6346/tcp +gnutella-svc 6346/udp +gnutella-rtr 6347/tcp +gnutella-rtr 6347/udp +sge-qmaster 6444/tcp sge_qmaster +sge-qmaster 6444/udp sge_qmaster +sge-execd 6445/tcp sge_execd +sge-execd 6445/udp sge_execd +mysql-proxy 6446/tcp +mysql-proxy 6446/udp +afs3-fileserver 7000/tcp bbs +afs3-fileserver 7000/udp bbs +afs3-callback 7001/tcp +afs3-callback 7001/udp +afs3-prserver 7002/tcp +afs3-prserver 7002/udp +afs3-vlserver 7003/tcp +afs3-vlserver 7003/udp +afs3-kaserver 7004/tcp +afs3-kaserver 7004/udp +afs3-volser 7005/tcp +afs3-volser 7005/udp +afs3-errors 7006/tcp +afs3-errors 7006/udp +afs3-bos 7007/tcp +afs3-bos 7007/udp +afs3-update 7008/tcp +afs3-update 7008/udp +afs3-rmtsys 7009/tcp +afs3-rmtsys 7009/udp +font-service 7100/tcp xfs +font-service 7100/udp xfs +http-alt 8080/tcp webcache +http-alt 8080/udp +bacula-dir 9101/tcp +bacula-dir 9101/udp +bacula-fd 9102/tcp +bacula-fd 9102/udp +bacula-sd 9103/tcp +bacula-sd 9103/udp +xmms2 9667/tcp +xmms2 9667/udp +nbd 10809/tcp +zabbix-agent 10050/tcp +zabbix-agent 10050/udp +zabbix-trapper 10051/tcp +zabbix-trapper 10051/udp +amanda 10080/tcp +amanda 10080/udp +hkp 11371/tcp +hkp 11371/udp +bprd 13720/tcp +bprd 13720/udp +bpdbm 13721/tcp +bpdbm 13721/udp +bpjava-msvc 13722/tcp +bpjava-msvc 13722/udp +vnetd 13724/tcp +vnetd 13724/udp +bpcd 13782/tcp +bpcd 13782/udp +vopied 13783/tcp +vopied 13783/udp +dcap 22125/tcp +gsidcap 22128/tcp +wnn6 22273/tcp +wnn6 22273/udp +rtmp 1/ddp +nbp 2/ddp +echo 4/ddp +zip 6/ddp +kerberos4 750/udp kerberos-iv kdc +kerberos4 750/tcp kerberos-iv kdc +kerberos-master 751/udp kerberos_master +kerberos-master 751/tcp +passwd-server 752/udp passwd_server +krb-prop 754/tcp krb_prop krb5_prop hprop +krbupdate 760/tcp kreg +swat 901/tcp +kpop 1109/tcp +knetd 2053/tcp +zephyr-srv 2102/udp +zephyr-clt 2103/udp +zephyr-hm 2104/udp +eklogin 2105/tcp +kx 2111/tcp +iprop 2121/tcp +supfilesrv 871/tcp +supfiledbg 1127/tcp +linuxconf 98/tcp +poppassd 106/tcp +poppassd 106/udp +ssmtp 465/tcp smtps +moira-db 775/tcp moira_db +moira-update 777/tcp moira_update +moira-ureg 779/udp moira_ureg +spamd 783/tcp +omirr 808/tcp omirrd +omirr 808/udp omirrd +customs 1001/tcp +customs 1001/udp +skkserv 1178/tcp +predict 1210/udp +rmtcfg 1236/tcp +wipld 1300/tcp +xtel 1313/tcp +xtelw 1314/tcp +support 1529/tcp +cfinger 2003/tcp +frox 2121/tcp +ninstall 2150/tcp +ninstall 2150/udp +zebrasrv 2600/tcp +zebra 2601/tcp +ripd 2602/tcp +ripngd 2603/tcp +ospfd 2604/tcp +bgpd 2605/tcp +ospf6d 2606/tcp +ospfapi 2607/tcp +isisd 2608/tcp +afbackup 2988/tcp +afbackup 2988/udp +afmbackup 2989/tcp +afmbackup 2989/udp +xtell 4224/tcp +fax 4557/tcp +hylafax 4559/tcp +distmp3 4600/tcp +munin 4949/tcp lrrd +enbd-cstatd 5051/tcp +enbd-sstatd 5052/tcp +pcrd 5151/tcp +noclog 5354/tcp +noclog 5354/udp +hostmon 5355/tcp +hostmon 5355/udp +rplay 5555/udp +nrpe 5666/tcp +nsca 5667/tcp +mrtd 5674/tcp +bgpsim 5675/tcp +canna 5680/tcp +sane-port 6566/tcp sane saned +ircd 6667/tcp +zope-ftp 8021/tcp +tproxy 8081/tcp +omniorb 8088/tcp +omniorb 8088/udp +clc-build-daemon 8990/tcp +xinetd 9098/tcp +mandelspawn 9359/udp mandelbrot +git 9418/tcp +zope 9673/tcp +webmin 10000/tcp +kamanda 10081/tcp +kamanda 10081/udp +amandaidx 10082/tcp +amidxtape 10083/tcp +smsqp 11201/tcp +smsqp 11201/udp +xpilot 15345/tcp +xpilot 15345/udp +sgi-cmsd 17001/udp +sgi-crsd 17002/udp +sgi-gcd 17003/udp +sgi-cad 17004/tcp +isdnlog 20011/tcp +isdnlog 20011/udp +vboxd 20012/tcp +vboxd 20012/udp +binkp 24554/tcp +asp 27374/tcp +asp 27374/udp +csync2 30865/tcp +dircproxy 57000/tcp +tfido 60177/tcp +fido 60179/tcp diff --git a/data/stage3.1/init b/data/stage3.1/init index 15b6c947..bc3ce113 100755 --- a/data/stage3.1/init +++ b/data/stage3.1/init @@ -20,28 +20,119 @@ mount -n -t tmpfs -o 'mode=755' run "/run" [ ! -f /proc/cpuinfo ] && mount -n -t proc proc /proc [ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys -#modprobe -a squashfs aufs 2>/dev/null +# read primary graphic adaptor configuration (without proprietary drivers yet) +hwinfo --gfxcard --netcard --usb-ctrl >/etc/hwinfo & -insmod /lib/modules/aufs.ko -insmod /lib/modules/squashfs.ko +# load local file systems +insmod /lib/modules.0/aufs.ko +insmod /lib/modules.0/squashfs.ko mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs mount -n /mnt/openslx.sqfs /rorootfs - mount -n -t tmpfs none /dev/shm/uniontmp mount -n -t aufs -o br:/dev/shm/uniontmp:/rorootfs=ro none /mnt mkdir -p /mnt/uniontmp mount -n --move /dev/shm/uniontmp /mnt/uniontmp +ln -s /mnt/lib/modules /lib/ + +while ps | grep -v grep | grep -q " hwinfo" ; do usleep 10 ; done + +case $(cat /etc/hwinfo) in + *i915*) + modprobe -a i915 2>/dev/null + ;; + *intel*|*Intel*) + modprobe -a i810 i830 i915 2>/dev/null + ;; + *nvidia*|*NVidia*|*nouveau*) + modprobe -q nouveau 2>/dev/null + ;; + *radeon*|*Radeon*) + modprobe -q radeon 2>/dev/null + ;; + *mga*|*matrox*|*Matrox*) + modprobe -q mga 2>/dev/null + ;; + *) + modprobe -qa r128 savage sis tdfx ttm via viafb + ;; +esac +( modprobe -a drm fbcon; mdev -s ) & + +# load required network and usb controller drivers, filter out wireless adaptors +nwcardlist="forcedeth e1000e e1000 e100 tg3 via-rhine r8169 pcnet32" +echo "modprobe -qa usbhid hid-bright" >/etc/modprobe.base +grep modprobe /etc/hwinfo | grep -E "$nwcardlist|hcd" \ + | grep -v ehci | sed 's/.* Cmd: "//;s/"//;s/modprobe/modprobe -qb/' \ + | sort -u >>/etc/modprobe.base +# virtio hack +if [ $(grep -ic "virtio_pci" /etc/modprobe.base) -ge 1 ]; then + echo "modprobe -q virtio_net" >>/etc/modprobe.base +fi +/bin/sh /etc/modprobe.base; mdev -s + +# read kernel command line for debugging switch +read KCL < /proc/cmdline +export KCL +for opts in ${KCL}; do + case ${opts} in + debug) + DEBUG=1;; + ip=*) + # process IP info + ipinfo=${opts#ip=};; + esac +done + +# setup network +nwif="eth0" +# set up loopback networking +[ $DEBUGLEVEL -eq 20 ] && echo "** starting ip config at $(sysup)" +ip link set dev lo up 2>/dev/null +ip addr add 127.0.0.1/8 dev lo 2>/dev/null +ip link set dev $nwif up 2>/dev/null || error "$init_noeth" + +# analyze ip information from the kernel command line and put parts +# of it into several variables +if [ -n "$ipinfo" ] ; then + getip () { + local val="$ipinfo:"; i=$(($1 - 1)); + while [ $i -gt 0 ] ; do + val=${val#*:} ; i=$(($i - 1)); + done; + echo $val|sed "s/:.*//"; } + clientip=$(getip 1) + serverip=$(getip 2) + gateway=$(getip 3) + subnet_mask=$(getip 4) + broadcast_address=$(ipcalc -s -b $clientip $subnet_mask|sed s/.*=//) + [ -z "$broadcast_address" ] && broadcast_address=255.255.255.255 + # we might have an idea of the dns server via preboot + dns_srv=$(getip 5) + [ -n "$dns_srv" ] && echo nameserver $dns_srv >/etc/resolv.conf; + echo -e "# ip configuration written by $0 script:\nclientip=$clientip\n\ +subnet_mask=$subnet_mask\ngateway=$gateway\nserverip=$serverip\n\ +broadcast_address=$broadcast_address" >>/etc/initramfs-setup + # set static ip address + ip addr add $clientip/$(ipcalc -s -p $clientip $subnet_mask|sed s/.*=//) \ + broadcast $broadcast_address dev $nwif 2>/dev/null + ip route add default via $gateway 2>/dev/null +else + noipyet="yes" +fi + + +if [ $DEBUG -ge 1 ]; then + echo "Starting debug shell, CTRL + D will start Stage 3.2." + setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1' +fi for mnt in proc sys run ; do - #mount -n --move $mnt /mnt/$mnt umount -n $mnt done -#/bin/sh unset BOOT_IMAGE initrd # new style of pivoting (switch_root or run-init) exec /sbin/switch_root -c /dev/console /mnt /usr/lib/systemd/systemd -setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1' diff --git a/data/stage3.1/lib/i386-linux-gnu/ld-2.15.so b/data/stage3.1/lib/i386-linux-gnu/ld-2.15.so Binary files differnew file mode 100755 index 00000000..d2306d9b --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/ld-2.15.so diff --git a/data/stage3.1/lib/i386-linux-gnu/libc-2.15.so b/data/stage3.1/lib/i386-linux-gnu/libc-2.15.so Binary files differnew file mode 100755 index 00000000..8c11121e --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/libc-2.15.so diff --git a/data/stage3.1/lib/i386-linux-gnu/libc.so.6 b/data/stage3.1/lib/i386-linux-gnu/libc.so.6 new file mode 120000 index 00000000..a8f42ce3 --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/libc.so.6 @@ -0,0 +1 @@ +libc-2.15.so
\ No newline at end of file diff --git a/data/stage3.1/lib/i386-linux-gnu/libdbus-1.so.3 b/data/stage3.1/lib/i386-linux-gnu/libdbus-1.so.3 Binary files differnew file mode 100644 index 00000000..14354c09 --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/libdbus-1.so.3 diff --git a/data/stage3.1/lib/i386-linux-gnu/libdl.so.2 b/data/stage3.1/lib/i386-linux-gnu/libdl.so.2 Binary files differnew file mode 100644 index 00000000..01235729 --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/libdl.so.2 diff --git a/data/stage3.1/lib/i386-linux-gnu/libpthread.so.0 b/data/stage3.1/lib/i386-linux-gnu/libpthread.so.0 Binary files differnew file mode 100755 index 00000000..a4bfc228 --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/libpthread.so.0 diff --git a/data/stage3.1/lib/i386-linux-gnu/librt.so.1 b/data/stage3.1/lib/i386-linux-gnu/librt.so.1 Binary files differnew file mode 100644 index 00000000..4d3d88ad --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/librt.so.1 diff --git a/data/stage3.1/lib/i386-linux-gnu/libtirpc.so.1 b/data/stage3.1/lib/i386-linux-gnu/libtirpc.so.1 Binary files differnew file mode 100644 index 00000000..a1590656 --- /dev/null +++ b/data/stage3.1/lib/i386-linux-gnu/libtirpc.so.1 diff --git a/data/stage3.1/lib/ld-linux.so.2 b/data/stage3.1/lib/ld-linux.so.2 new file mode 120000 index 00000000..2e367466 --- /dev/null +++ b/data/stage3.1/lib/ld-linux.so.2 @@ -0,0 +1 @@ +i386-linux-gnu/ld-2.15.so
\ No newline at end of file diff --git a/data/stage3.1/lib/libgssglue.so.1 b/data/stage3.1/lib/libgssglue.so.1 Binary files differnew file mode 100644 index 00000000..6bdfe13a --- /dev/null +++ b/data/stage3.1/lib/libgssglue.so.1 diff --git a/data/stage3.1/lib/libhal.so.1 b/data/stage3.1/lib/libhal.so.1 Binary files differnew file mode 100644 index 00000000..a4a4a9f9 --- /dev/null +++ b/data/stage3.1/lib/libhal.so.1 diff --git a/data/stage3.1/lib/libhd.so.16 b/data/stage3.1/lib/libhd.so.16 Binary files differnew file mode 100644 index 00000000..c7764846 --- /dev/null +++ b/data/stage3.1/lib/libhd.so.16 diff --git a/data/stage3.1/lib/modules.0/aufs.ko b/data/stage3.1/lib/modules.0/aufs.ko Binary files differnew file mode 100644 index 00000000..eb364a10 --- /dev/null +++ b/data/stage3.1/lib/modules.0/aufs.ko diff --git a/data/stage3.1/lib/modules.0/squashfs.ko b/data/stage3.1/lib/modules.0/squashfs.ko Binary files differnew file mode 100644 index 00000000..2a861c78 --- /dev/null +++ b/data/stage3.1/lib/modules.0/squashfs.ko diff --git a/data/stage3.1/sbin/hwinfo b/data/stage3.1/sbin/hwinfo Binary files differnew file mode 100755 index 00000000..cd3cc22f --- /dev/null +++ b/data/stage3.1/sbin/hwinfo diff --git a/data/stage3.1/sbin/mount.nfs b/data/stage3.1/sbin/mount.nfs Binary files differnew file mode 100755 index 00000000..c764652e --- /dev/null +++ b/data/stage3.1/sbin/mount.nfs diff --git a/data/stage3.1/sbin/mount.nfs4 b/data/stage3.1/sbin/mount.nfs4 Binary files differnew file mode 100755 index 00000000..c764652e --- /dev/null +++ b/data/stage3.1/sbin/mount.nfs4 diff --git a/data/stage3.1/sbin/umount.nfs b/data/stage3.1/sbin/umount.nfs Binary files differnew file mode 100755 index 00000000..c764652e --- /dev/null +++ b/data/stage3.1/sbin/umount.nfs diff --git a/data/stage3.1/sbin/umount.nfs4 b/data/stage3.1/sbin/umount.nfs4 Binary files differnew file mode 100755 index 00000000..c764652e --- /dev/null +++ b/data/stage3.1/sbin/umount.nfs4 @@ -22,14 +22,14 @@ ROOT_DIR=$(dirname ${SELF}) . ${ROOT_DIR}/helper/functions.common.sh banner () { - echo -e "\t __ __ __ " - echo -e "\t.--------.| | | |_| |--." - echo -e "\t| || |_| _| < " - echo -e "\t|__|__|__||____|____|__|__|" - echo -e "\t " - echo -e "\t ** OpenSLX Project // 2013 **" - echo -e "\t http://lab.openslx.org/" - echo -e "" + echo -e "\033[38;5;202m\t __ __ __ " + echo -e "\033[38;5;202m\t.--------.| | | |_| |--." + echo -e "\033[38;5;208m\t| || |_| _| < " + echo -e "\033[38;5;214m\t|__|__|__||____|____|__|__|" + echo -e "\033[38;5;214m\t " + echo -e "\033[38;5;220m\t ** OpenSLX Project // 2013 **" + echo -e "\033[38;5;226m\t http://lab.openslx.org/" + echo -e "\033[0m" } print_usage() { diff --git a/remote/setup_tools b/remote/setup_tools index 64aef3b1..aaa7a23b 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -224,6 +224,8 @@ generate_stage32 () { install_dependencies fetch_source build + # remove *.la files as they might confuse libtool/linker of other tool packages + find "${TOOL_DIR}/${TOOL}/build" -name '*.la' -exec rm -f {} \; copyfileswithdependencies post_copy cd ${TOOL_DIR} diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf index 302904c9..c03579b0 100644 --- a/remote/tools/base/base.conf +++ b/remote/tools/base/base.conf @@ -19,7 +19,6 @@ REQUIRED_BINARIES=" bash modprobe rsyslogd ps - sshd scp ssh" REQUIRED_LIBRARIES=" libcap diff --git a/remote/tools/base/data/etc/systemd/system/basic.target.wants/rsyslog.service b/remote/tools/base/data/etc/systemd/system/basic.target.wants/rsyslog.service new file mode 100644 index 00000000..8e253ee1 --- /dev/null +++ b/remote/tools/base/data/etc/systemd/system/basic.target.wants/rsyslog.service @@ -0,0 +1,12 @@ +[Unit] +Description=System Logging Service +Before=udev.service + +[Service] +ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service +ExecStart=/usr/sbin/rsyslogd -n -c5 +Sockets=syslog.socket +StandardOutput=null + +[Install] +WantedBy=multi-user.target diff --git a/remote/tools/base/data/etc/udhcpc.openslx.script b/remote/tools/base/data/etc/udhcpc.openslx.script new file mode 100755 index 00000000..bff430ef --- /dev/null +++ b/remote/tools/base/data/etc/udhcpc.openslx.script @@ -0,0 +1,78 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# +# Copyright (c) 2011 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +# ----------------------------------------------------------------------------- +# +# Mini-Linux Toolkit +# +# ----------------------------------------------------------------------------- + + +RESOLV_CONF="/etc/resolv.conf" +IP_CONF="/tmp/udhcpc_ip_config" + +export PATH=$PATH:/openslx/sbin:/openslx/bin + +case $1 in + bound|renew) + + [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" + [ -n "$subnet" ] && NETMASK="netmask $subnet" + + ip addr add $ip/$(ipcalc -s -p $ip $subnet|sed s/.*=//) dev $interface + ip route add default via $router + + echo "ip=$ip" > $IP_CONF + echo "subnet=$subnet" >> $IP_CONF + echo "broadcast=$broadcast" >> $IP_CONF + echo "gateway=$router" >> $IP_CONF + + # Update resolver configuration file + R="" + [ -n "$domain" ] && R="domain $domain +" + count=1; + for i in $dns; do + echo "$0: Adding DNS $i" + R="${R}nameserver $i +" + count=$((count+1)); + done + + if [ -x /sbin/resolvconf ]; then + echo -n "$R" | resolvconf -a "${interface}.udhcpc" + else + echo -n "$R" > "$RESOLV_CONF" + fi + + # TODO i.e. event trigger + systemctl start nfs-mount.service + + ;; + + deconfig) + + ;; + + leasefail) + echo "$0: Lease failed: $message" + ;; + + nak) + echo "$0: Received a NAK: $message" + ;; + + *) + echo "$0: Unknown udhcpc command: $1"; + exit 1; + ;; +esac diff --git a/remote/tools/sshd/data/etc/issue.net b/remote/tools/sshd/data/etc/issue.net new file mode 100644 index 00000000..7dfbddb5 --- /dev/null +++ b/remote/tools/sshd/data/etc/issue.net @@ -0,0 +1,6 @@ +++++++++++++++++++++++++++++++++++++++ ++ + ++ MiniLinux SSH Session + ++ + +++++++++++++++++++++++++++++++++++++++ + diff --git a/remote/tools/sshd/data/etc/ssh/ssh_host_dsa_key b/remote/tools/sshd/data/etc/ssh/ssh_host_dsa_key new file mode 100644 index 00000000..0132fe84 --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/ssh_host_dsa_key @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBugIBAAKBgQDu6vk2uFnUyKt9/In9Rtkq+2zqwd8slm90NUt6JBXyjYsIJwRp +hxRG1sFDho3ogog5hlt+y+UuNPc5QchT/e3O71zt2XbrfK2irr4XBJILuup95AGe +iW/gzMIUD4an8I58yYM9rXhTzvIMwri7jM6EKlCUytafVTdMICVH78Y97QIVAJ9a +Cs8Gxy91XMoHK3zcHutQcIF3AoGAV6p2ISW0pAE+2GbeKUDvraCNXDG37JaMCjZr +S+NB3cN/vJwjy0fPI6CB5o6GcgFhB0cxdgCb60lV8Qz76clx4ZJId8PVxeKp4vSw +kHdSbcRlBpRbe/YJY8ja/ITkvmeiEMncTQByo1t2VXDqHbvgQsllIqbbRWl0B2yV +WO4Uw4gCgYAFCgiy2Ncal0KhsHAJV5dP4imeyd49lONI488RO18wiODhCzGtkbvV +pL/saDZWkm3pUhJ9J0qalIZaJGG0WO6GHiQC5CzH21GF9RgsoNjrMl3gzuZB9FxB +4cg8UyZ2QCqXlRusOCIiZhBdIZzDkK6HlQMMtFGEGg/c9yNgxkPAzQIULLxfDTNh +8Ouz5BhfKWJrZ0XGUsA= +-----END DSA PRIVATE KEY----- diff --git a/remote/tools/sshd/data/etc/ssh/ssh_host_dsa_key.pub b/remote/tools/sshd/data/etc/ssh/ssh_host_dsa_key.pub new file mode 100644 index 00000000..97af5cb0 --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/ssh_host_dsa_key.pub @@ -0,0 +1 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBAO7q+Ta4WdTIq338if1G2Sr7bOrB3yyWb3Q1S3okFfKNiwgnBGmHFEbWwUOGjeiCiDmGW37L5S409zlByFP97c7vXO3Zdut8raKuvhcEkgu66n3kAZ6Jb+DMwhQPhqfwjnzJgz2teFPO8gzCuLuMzoQqUJTK1p9VN0wgJUfvxj3tAAAAFQCfWgrPBscvdVzKByt83B7rUHCBdwAAAIBXqnYhJbSkAT7YZt4pQO+toI1cMbfslowKNmtL40Hdw3+8nCPLR88joIHmjoZyAWEHRzF2AJvrSVXxDPvpyXHhkkh3w9XF4qni9LCQd1JtxGUGlFt79gljyNr8hOS+Z6IQydxNAHKjW3ZVcOodu+BCyWUipttFaXQHbJVY7hTDiAAAAIAFCgiy2Ncal0KhsHAJV5dP4imeyd49lONI488RO18wiODhCzGtkbvVpL/saDZWkm3pUhJ9J0qalIZaJGG0WO6GHiQC5CzH21GF9RgsoNjrMl3gzuZB9FxB4cg8UyZ2QCqXlRusOCIiZhBdIZzDkK6HlQMMtFGEGg/c9yNgxkPAzQ== root@stp diff --git a/remote/tools/sshd/data/etc/ssh/ssh_host_ecdsa_key b/remote/tools/sshd/data/etc/ssh/ssh_host_ecdsa_key new file mode 100644 index 00000000..1fea2717 --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/ssh_host_ecdsa_key @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDDwyXBE0s5I7Cci/by2EInEyHyIvfC6IB5U8XF5eZUDlVMxkgBYK0sm +r3Lyuy4XR3CgBwYFK4EEACKhZANiAATwyn0SyUKavp9CfPiv9IRSu8ICK1HekDMf +lB4AIOObT1CMEROVfwh6ur1w980426YSZW+j+bQN5RQVDF7njcsD0eiSeJj8HVrR +3PDpreZJMZVV2mLNYZxuE0kx9ILK12I= +-----END EC PRIVATE KEY----- diff --git a/remote/tools/sshd/data/etc/ssh/ssh_host_ecdsa_key.pub b/remote/tools/sshd/data/etc/ssh/ssh_host_ecdsa_key.pub new file mode 100644 index 00000000..0ef413ba --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/ssh_host_ecdsa_key.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBPDKfRLJQpq+n0J8+K/0hFK7wgIrUd6QMx+UHgAg45tPUIwRE5V/CHq6vXD3zTjbphJlb6P5tA3lFBUMXueNywPR6JJ4mPwdWtHc8Omt5kkxlVXaYs1hnG4TSTH0gsrXYg== root@stp diff --git a/remote/tools/sshd/data/etc/ssh/ssh_host_rsa_key b/remote/tools/sshd/data/etc/ssh/ssh_host_rsa_key new file mode 100644 index 00000000..b37b5a74 --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/ssh_host_rsa_key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQC4QG0lNN4NewU8nTxNr/dpF4FGRrVifIDOgTVcfJluYt3c1mfJ +tA2/ujwJ9jUV196P7UJ4QsAlpwd6SlKlxQ/tCTF2Zi2tjNtypIuSwBysxBM0BTRr +L/ntwET2vqdA1wRRRVDMl+l3B3YI1aJBUYqyM72v/yK/jbJiS5hZLp9TXwIDAQAB +AoGAXEGuJPYexWM20Q3t9vxIBrAFQ9n90o2CtWPPAztEXBhW/M/CciWcyMaIb3h/ +RiurvidPpAXQTkofHWV/ko9klDLDAOTsJE+mir61izvdPHqZH13ZJyI+GUN4bQ0a +1hV415OPsiks1jBL+J5sD1dvFZU4nOOeFbIZcmCf/Z5DIlECQQDke7DdNiiy2zls +C1GrCbj0R85h1ZmwZ4GytVkxlik+Ids2aeskxDba5wlEUZutVyGlQuUe6Zm4r2eI +Vq7/47VnAkEAznELdXCd6zYynGz8RYY4zMtLvu+oWePLKX/6P/egkfkloaB13Ohr +yEd//V+cnobL9g5ed5Ggt4WF4AhcvKn/SQJBAJDO1AlfievRhVM02U3Nm6s211aq +Sf3DnC/nP+BtizYVvxl9h8qFkT6rrvPdxQzXbDuRaiVtaD/k63k9dyw25YECQBfF +GGarUuOUV/t+6QUwUTXzaoNPoPjIq8nZfH0FDC4Cm/yiNy/6av6ijPAlpCj0qGNq +gCIQWIsJCsMi81qd0FECQQCfu6wSDszVseas0CAcxjP4MU5lVr6/L8//ZUn9TDJM +WSQelziGbnbsIXq7owCVDxROJ770IqOL4OQZDw5R8Swd +-----END RSA PRIVATE KEY----- diff --git a/remote/tools/sshd/data/etc/ssh/ssh_host_rsa_key.pub b/remote/tools/sshd/data/etc/ssh/ssh_host_rsa_key.pub new file mode 100644 index 00000000..e6fd0588 --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/ssh_host_rsa_key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC4QG0lNN4NewU8nTxNr/dpF4FGRrVifIDOgTVcfJluYt3c1mfJtA2/ujwJ9jUV196P7UJ4QsAlpwd6SlKlxQ/tCTF2Zi2tjNtypIuSwBysxBM0BTRrL/ntwET2vqdA1wRRRVDMl+l3B3YI1aJBUYqyM72v/yK/jbJiS5hZLp9TXw== root@stp diff --git a/remote/tools/sshd/data/etc/ssh/sshd_config b/remote/tools/sshd/data/etc/ssh/sshd_config new file mode 100644 index 00000000..da9e5e01 --- /dev/null +++ b/remote/tools/sshd/data/etc/ssh/sshd_config @@ -0,0 +1,87 @@ +# Package generated configuration file +# See the sshd_config(5) manpage for details + +# What ports, IPs and protocols we listen for +Port 22 +# Use these options to restrict which interfaces/protocols sshd will bind to +#ListenAddress :: +#ListenAddress 0.0.0.0 +Protocol 2 +# HostKeys for protocol version 2 +HostKey /etc/ssh/ssh_host_rsa_key +HostKey /etc/ssh/ssh_host_dsa_key +HostKey /etc/ssh/ssh_host_ecdsa_key +#Privilege Separation is turned on for security +UsePrivilegeSeparation yes + +# Lifetime and size of ephemeral version 1 server key +KeyRegenerationInterval 3600 +ServerKeyBits 768 + +# Logging +SyslogFacility AUTH +LogLevel INFO + +# Authentication: +LoginGraceTime 30 +PermitRootLogin yes +StrictModes yes + +RSAAuthentication yes +PubkeyAuthentication yes +AuthorizedKeysFile %h/.ssh/authorized_keys + +# Don't read the user's ~/.rhosts and ~/.shosts files +IgnoreRhosts yes +# For this to work you will also need host keys in /etc/ssh_known_hosts +RhostsRSAAuthentication no +# similar for protocol version 2 +HostbasedAuthentication no +# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication +#IgnoreUserKnownHosts yes + +# To enable empty passwords, change to yes (NOT RECOMMENDED) +PermitEmptyPasswords no + +# Change to yes to enable challenge-response passwords (beware issues with +# some PAM modules and threads) +ChallengeResponseAuthentication no + +# Change to no to disable tunnelled clear text passwords +#PasswordAuthentication yes + +# Kerberos options +#KerberosAuthentication no +#KerberosGetAFSToken no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +X11Forwarding yes +X11DisplayOffset 10 +PrintMotd no +PrintLastLog yes +TCPKeepAlive yes +#UseLogin no + +#MaxStartups 10:30:60 +Banner /etc/issue.net + +# Allow client to pass locale environment variables +AcceptEnv LANG LC_* + +Subsystem sftp /usr/lib/openssh/sftp-server + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +UsePAM yes diff --git a/remote/tools/sshd/data/etc/systemd/system/sshd.service b/remote/tools/sshd/data/etc/systemd/system/sshd.service new file mode 100644 index 00000000..fc711808 --- /dev/null +++ b/remote/tools/sshd/data/etc/systemd/system/sshd.service @@ -0,0 +1,8 @@ +[Unit] +Description=OpenSSH Daemon + +[Service] +ExecStart=/usr/sbin/sshd -D +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=always diff --git a/remote/tools/sshd/sshd.build b/remote/tools/sshd/sshd.build new file mode 100644 index 00000000..82dc8a54 --- /dev/null +++ b/remote/tools/sshd/sshd.build @@ -0,0 +1,29 @@ +install_dependencies() { + : +} + +fetch_source() { + : +} + +build() { + + BUILDDIR=${TOOL_DIR}/${TOOL}/build/usr/sbin + mkdir -p "${BUILDDIR}" + + BIN_LOCATION=$(which sshd) + [ ! -z ${BIN_LOCATION} ] && BIN_LOCATION=$(readlink -f "$BIN_LOCATION") + if [ ! -z ${BIN_LOCATION} -a -e ${BIN_LOCATION} ]; + then + cp "${BIN_LOCATION}" "${BUILDDIR}/" + else + echo "[$TOOL] ${BIN} not found on the system! Please install it." + exit 1 + fi + +} + +post_copy() { + mkdir -p "${INIT_DIR}/var/run/sshd" + cp -r "${TOOL_DIR}"/${TOOL}/data/* "${INIT_DIR}/" +} diff --git a/remote/tools/sshd/sshd.conf b/remote/tools/sshd/sshd.conf new file mode 100644 index 00000000..25793c72 --- /dev/null +++ b/remote/tools/sshd/sshd.conf @@ -0,0 +1,3 @@ +REQUIRED_BINARIES="sshd" +REQUIRED_LIBRARIES="" +REQUIRED_DIRECTORIES="" diff --git a/remote/tools/systemd/data/etc/systemd/system/network-interface@.service b/remote/tools/systemd/data/etc/systemd/system/network-interface@.service index b3c67d09..137b3af6 100644 --- a/remote/tools/systemd/data/etc/systemd/system/network-interface@.service +++ b/remote/tools/systemd/data/etc/systemd/system/network-interface@.service @@ -1,6 +1,6 @@ [Unit] Description=Brings interface %i up -Wants=udhcpc@%i.service +Wants=udhcpc@%i.service sshd.service Before=udhcpc@%i.service [Service] diff --git a/remote/tools/systemd/data/etc/systemd/system/nfs-mount.service b/remote/tools/systemd/data/etc/systemd/system/nfs-mount.service new file mode 100644 index 00000000..727ff2ed --- /dev/null +++ b/remote/tools/systemd/data/etc/systemd/system/nfs-mount.service @@ -0,0 +1,7 @@ +[Unit] +Description=Mount NFS Share [TEST] + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/mount -t nfs -o ro,async,nolock 132.230.4.6:/srv/openslx/export/nfs/ubuntu-12.04-test /openslx/mnt diff --git a/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service index 6c5c289b..e7d4d170 100644 --- a/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service +++ b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service @@ -3,7 +3,7 @@ Description=DHCP Client [Service] Type=simple -ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.default.script -i %I +ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.openslx.script -i %I [Install] WantedBy=multi-user.target diff --git a/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount b/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount deleted file mode 120000 index 70ba668d..00000000 --- a/remote/tools/systemd/data/etc/systemd/system/udhcpc@.service.wants/openslx-mnt.mount +++ /dev/null @@ -1 +0,0 @@ -../openslx-mnt.mount
\ No newline at end of file diff --git a/remote/tools/systemd/systemd.conf b/remote/tools/systemd/systemd.conf index fde09254..98cd8ba9 100644 --- a/remote/tools/systemd/systemd.conf +++ b/remote/tools/systemd/systemd.conf @@ -76,6 +76,7 @@ REQUIRED_DIRECTORIES=" /etc /usr/share/dbus-1 /usr/share/polkit-1 /usr/lib/udev/rules.d" -REQUIRED_FILES=" /usr/share/systemd/kbd-model-map +REQUIRED_FILES=" /usr/bin/systemd-analyze + /usr/share/systemd/kbd-model-map /usr/lib/udev/findkeyboards /usr/lib/udev/keyboard-force-release.sh" diff --git a/server/build_core b/server/build_core index e212294c..423279e7 100755 --- a/server/build_core +++ b/server/build_core @@ -62,7 +62,7 @@ generate_rootfs() { [ ! -d ${STAGE31_DIR} ] && mkdir -p ${STAGE31_DIR} # create basic directory structure - mkdir -p ${STAGE31_DIR}/{bin,dev,proc,run,lib/modules,etc,mnt,sys} + mkdir -p ${STAGE31_DIR}/{bin,dev,proc,run,lib,etc,mnt,sys} # copy device files from running system cp -a /dev/{console,kmsg,mem,null,tty,tty0,tty1,tty9,urandom,zero} \ @@ -72,8 +72,8 @@ generate_rootfs() { cp -r ${STAGE32_DIR}/openslx/* ${STAGE31_STATIC_DIR}/* ${STAGE31_DIR} # fix for aufs & squashfs modules needed for stage 3.1 - cp /lib/modules/$(uname -r)/kernel/fs/squashfs/squashfs.ko ${STAGE31_DIR}/lib/modules/ - cp /lib/modules/$(uname -r)/kernel/ubuntu/aufs/aufs.ko ${STAGE31_DIR}/lib/modules/ + #cp /lib/modules/$(uname -r)/kernel/fs/squashfs/squashfs.ko ${STAGE31_DIR}/lib/modules/ + #cp /lib/modules/$(uname -r)/kernel/ubuntu/aufs/aufs.ko ${STAGE31_DIR}/lib/modules/ # fetch the libraries needed for busybox BASICLIBS="" @@ -86,11 +86,10 @@ generate_rootfs() { fi done (tar cpv $BASICLIBS | tar xpv -C ${STAGE31_DIR}) &>/dev/null - + } generate_squashfs() { - # finalize the initramfs target [ -e ${STAGE31_DIR}/mnt/openslx.sqfs ] && rm ${STAGE31_DIR}/mnt/openslx.sqfs @@ -99,10 +98,10 @@ generate_squashfs() { } generate_initramfs() { - cd ${STAGE31_DIR} find . | cpio --format="newc" --create | gzip -9 > ${MODULE_DIR}/initramfs cd - &>/dev/null + pinfo "[core] initramfs created at ${MODULE_DIR}/initramfs" } generate_stage31() { @@ -113,6 +112,7 @@ generate_stage31() { # TODO better kernel copy cp /boot/vmlinuz-$(uname -r) ${MODULE_DIR}/kernel + pinfo "[core] kernel $(uname -r) copied to ${MODULE_DIR}/kernel" } clean_core() { |
