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 /remote | |
| 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
Diffstat (limited to 'remote')
20 files changed, 272 insertions, 5 deletions
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" |
