summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/README.data9
-rw-r--r--data/activate-swap.sh35
-rwxr-xr-xdata/analyse-disk.sh105
-rw-r--r--data/basic.nocopy32
-rwxr-xr-xdata/disk-tmp.sh24
-rw-r--r--data/ip-dns-conf86
-rw-r--r--data/kernel.wanted.config2
-rwxr-xr-xdata/nvidia-driver-extraction-experiments.sh123
-rw-r--r--data/printk.service6
9 files changed, 125 insertions, 297 deletions
diff --git a/data/README.data b/data/README.data
deleted file mode 100644
index fdf10a47..00000000
--- a/data/README.data
+++ /dev/null
@@ -1,9 +0,0 @@
-This directory contains the config and share-able stuff for the InitRamFS. The
-following structure applies
-
-~/data/base - distro-independent fall-back files
-~/data/<distroname>/base - distro-dependent version-independent files
-~/data/<distroname>/<distro_ver> - distro-dependenent version-dependent files
-
-The principle should be pretty simple - copy all from very generic to very
-specific overwriting the generic files.
diff --git a/data/activate-swap.sh b/data/activate-swap.sh
deleted file mode 100644
index edaad1f2..00000000
--- a/data/activate-swap.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/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, first for swap as
-# compressed RAM (zram) and then on local disk partitions, if detected by
-# disk-analyse.sh script
-
-#############################################################################
-
-# Depends on analyse-disk.sh and on availability of the appropriate kernel
-# module/functionality
-
-# try to enable compressed RAM SWAP / ZRAM
-if modprobe -q 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 1>/dev/null 2>/dev/null
-fi
-
-# add on-disk swap if available
-for hdpartnr in $(cat /etc/fstab | sed -n -e "/swap.*swap/p"| \
- sed -e "s/[[:space:]].*//") ; do
- mkswap ${hdpartnr} 2>/dev/null
- swapon ${hdpartnr} 1>/dev/null 2>/dev/null
-done
-
diff --git a/data/analyse-disk.sh b/data/analyse-disk.sh
deleted file mode 100755
index 27c3f306..00000000
--- a/data/analyse-disk.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/bash
-# 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 autodetection script for OpenSLX linux stateless clients,
-# detecting swap and special partitions
-
-#############################################################################
-
-# General formatter for the /tmp partition on a local harddisk
-diskfm () {
-local target=$1
-local fs
-local path
-for fs in xfs ext3 ext2 ; do
- unset available
- case $(cat /proc/filesystems) in
- *${fs}*) available=yes;;
- *) modprobe -q ${fs} 2>/dev/null && available=yes;;
- esac
- if [ -n ${available} ]; then
- unset found
- for path in /sbin /bin /usr/sbin /usr/bin /openslx/sbin /openslx/bin; do
- if test -x /$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
- mkdir -p /run/mount/tmp
- mount -t ${fs} ${target} /run/mount/tmp
- fi
- done
- [ -n "$found" ] && break
- fi
-done
-}
-
-# Check for local harddisks and appropriate partitions
-fdisk -l |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\tnoauto\t\tdefaults\t 0 0" >>/etc/fstab
- else
- echo "formatting failed for some reason " >/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/basic.nocopy b/data/basic.nocopy
deleted file mode 100644
index b81a32c4..00000000
--- a/data/basic.nocopy
+++ /dev/null
@@ -1,32 +0,0 @@
-/boot
-/cdrom
-/dev
-/export
-/home
-/lib/modules
-/lost+found
-/media
-/mnt
-/opt/openslx
-/proc
-/root
-/run
-/srv
-/sys
-/tmp
-/usr/src
-/var/log
-/var/run
-/var/www
-/var/cache/nscd
-/etc/resolv.conf
-/etc/resolvconf
-*~
-*.bak
-*.pid
-*.tmp
-*tm-scripts*
-/initrd.img
-/initrd.img.old
-/vmlinuz
-/vmlinuz.old
diff --git a/data/disk-tmp.sh b/data/disk-tmp.sh
deleted file mode 100755
index 4378c45c..00000000
--- a/data/disk-tmp.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/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
-#
-# Mount local ID44 partition to /tmp after all existing stuff is preserved
-
-#############################################################################
-
-# Check if ID44 is available by analysing /etc/fstab for appropriate entry
-if cat /proc/mounts | grep -qe "/dev/.*/tmp" ; then
- mkdir -p /run/tmp
- mv /tmp/* /run/tmp
- mount --bind /run/mount/tmp /tmp
- umount /run/mount/tmp
- mv /run/tmp/* /tmp
- rmdir /run/tmp
-fi
diff --git a/data/ip-dns-conf b/data/ip-dns-conf
deleted file mode 100644
index f14ecd88..00000000
--- a/data/ip-dns-conf
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/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/kernel.wanted.config b/data/kernel.wanted.config
index 62dc3b37..ee41a80b 100644
--- a/data/kernel.wanted.config
+++ b/data/kernel.wanted.config
@@ -238,4 +238,6 @@ CONFIG_IP_PNP_DHCP=n
CONFIG_IP_PNP_BOOTP=n
CONFIG_IP_PNP_RARP=n
CONFIG_RD_XZ=y
+CONFIG_OPENVSWITCH=m
+CONFIG_OPENVSWITCH_GRE=n
diff --git a/data/nvidia-driver-extraction-experiments.sh b/data/nvidia-driver-extraction-experiments.sh
new file mode 100755
index 00000000..85617f04
--- /dev/null
+++ b/data/nvidia-driver-extraction-experiments.sh
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# This is the first working nvidia extractor.
+
+BASEDIR=/root/temp/
+TMSCRIPTS=/root/tm-scripts/
+MODULE_DIR="$TMSCRIPTS/remote/modules/kernel/"
+KERNELSRCDIR="$MODULE_DIR/ksrc"
+ROOTLOWERDIR="/"
+ROOTUPPERDIR="$BASEDIR/rootupper"
+ROOTBINDDIR="$BASEDIR/rootbind"
+ROOTMOUNTDIR="$BASEDIR/rootmount"
+BINDMOUNTS="/dev /proc /run /sys"
+
+NVIDIA="$BASEDIR/NVIDIA-Linux-x86_64-331.38.run"
+NVIDIAEXTRACTDIR="$ROOTMOUNTDIR/NVIDIA"
+NVEXTRACTDIR="/NVIDIA" # this one relative to chroot"
+STARTDM="false"
+
+
+# This is just an experiment to look whether the annoying message "could not insert kernel module"
+# by the nvidia installer when compiling on a computer lacking a nvidia gpu card could be killed.
+# It does not work, as the nvidia-installer uses a self-brewed module loader.
+dump_modprobe () {
+ [ -d "$ROOTMOUNTDIR/sbin" ] || mkdir "$ROOTMOUNTDIR/sbin"
+ for FILE in insmod modprobe; do
+ cat>"$ROOTMOUNTDIR/sbin/$FILE"<<-EOF
+ #/bin/sh
+ exit 0
+ EOF
+ chmod +x "$ROOTMOUNTDIR/sbin/$FILE"
+ done
+}
+
+stop_display_managers () {
+ for DM in kdm gdm lightdm; do
+ ps a|grep -v grep|grep "$DM"
+ ERR=$?
+ if [ "$ERR" -eq 0 ]; then
+ /etc/init.d/"$DM" stop
+ killall "$DM" # line above leaves a residue sometimes...
+ STARTDM="$DM"
+ echo "Stopped $DM."
+ break
+ fi
+ done
+}
+
+# Several directories for bind mount and overlay mounts.
+make_dirs () {
+ mkdir "$ROOTUPPERDIR"
+ mkdir "$ROOTBINDDIR"
+ mkdir "$ROOTMOUNTDIR"
+}
+
+mount_dirs () {
+ mount -o bind "$ROOTLOWERDIR" "$ROOTBINDDIR"
+ mount -o remount,ro "$ROOTBINDDIR"
+ mount -t overlayfs overlayfs -o lowerdir="$ROOTBINDDIR",upperdir="$ROOTUPPERDIR" "$ROOTMOUNTDIR"
+ for MOUNT in $BINDMOUNTS; do
+ echo "Erzeuge bind-mount $MOUNT ..."
+ mount -o bind "$MOUNT" "$ROOTMOUNTDIR/$MOUNT" || echo "Bind mount auf $MOUNT schlug fehl."
+ done
+}
+
+# We inject a bashrc to be executed within the chroot.
+gen_bashrc () {
+ echo "chroot erfolgreich."
+ COMMON_OPTIONS=' --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent '
+ cat >"$ROOTMOUNTDIR/$HOME/.bashrc"<<-EOF
+ alias ll='ls -alF'
+ PS1='\[\e[1;33m\]chroot@\h:\w\$ \[\e[1;32m\]'
+ cd "$NVEXTRACTDIR"
+ echo "First pass... compiling kernel module."
+ ./nvidia-installer $COMMON_OPTIONS --kernel-source-path /"$KERNELSRCDIR" # compiles .ko, but not always the rest.
+ echo "Second pass... compiling everything else."
+ ./nvidia-installer $COMMON_OPTIONS --no-kernel-module # compiles the rest - hopefully.
+ exit
+EOF
+}
+
+unpack_nvidia () {
+ [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR"
+ echo "Entpacke $NVIDIA ..."
+ sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR"
+}
+
+umount_dirs () {
+ for MOUNT in $BINDMOUNTS; do
+ umount "$ROOTMOUNTDIR/$MOUNT"
+ done
+ umount "$ROOTMOUNTDIR"
+ umount "$ROOTBINDDIR"
+}
+
+start_display_manager () {
+ [ "$STARTDM" != "false" ] && echo /etc/init.d/"$DM" start
+}
+
+
+# stop_display_managers
+
+make_dirs
+echo "Mounte Verzeichnisse ..."
+mount_dirs
+
+echo "Lege .bashrc ab ..."
+gen_bashrc
+
+echo "Entpacke NVidia-Installer ..."
+unpack_nvidia
+
+echo "Dumpe modprobe / insmod ..."
+# dump_modprobe
+
+echo "Fertig für chroot."
+chroot "$ROOTMOUNTDIR"
+echo "chroot durch."
+
+echo "Unmounte Verzeichnisse."
+umount_dirs
+
+# start_display_manager
diff --git a/data/printk.service b/data/printk.service
deleted file mode 100644
index 97fe8055..00000000
--- a/data/printk.service
+++ /dev/null
@@ -1,6 +0,0 @@
-[Unit]
-Description=shuts up kernel
-
-[Service]
-Type=simple
-ExecStart=/openslx/bin/echo "0" > /proc/sys/kernel/printk