diff options
author | Sebastian | 2016-04-25 12:01:08 +0200 |
---|---|---|
committer | Sebastian | 2016-04-25 12:01:08 +0200 |
commit | 5acda3eaeabae9045609539303a8c12c4ce401f1 (patch) | |
tree | 7e71975f8570b05aafe2ea6ec0e242a8912387bb /core/rootfs/rootfs-stage32/data | |
parent | initial commit (diff) | |
download | mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.gz mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.xz mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.zip |
merge with latest dev version
Diffstat (limited to 'core/rootfs/rootfs-stage32/data')
47 files changed, 838 insertions, 0 deletions
diff --git a/core/rootfs/rootfs-stage32/data/bin/ash b/core/rootfs/rootfs-stage32/data/bin/ash new file mode 120000 index 00000000..8f88d64e --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/bin/ash @@ -0,0 +1 @@ +/opt/openslx/bin/busybox
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/bin/sh b/core/rootfs/rootfs-stage32/data/bin/sh new file mode 120000 index 00000000..5d4150d0 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/bin/sh @@ -0,0 +1 @@ +/bin/bash
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/conf.d/nfs-common.conf b/core/rootfs/rootfs-stage32/data/etc/conf.d/nfs-common.conf new file mode 100644 index 00000000..c12705b9 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/conf.d/nfs-common.conf @@ -0,0 +1,7 @@ +# Common configuration file for rpc-services. + +# Options for rpcbind +BIND_OPTS="-w" + +# Options for rpc.statd +STATD_OPTS="-L" diff --git a/core/rootfs/rootfs-stage32/data/etc/hosts b/core/rootfs/rootfs-stage32/data/etc/hosts new file mode 100644 index 00000000..631cf753 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/hosts @@ -0,0 +1,8 @@ +127.0.0.1 localhost + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/core/rootfs/rootfs-stage32/data/etc/keymaps/de_DE b/core/rootfs/rootfs-stage32/data/etc/keymaps/de_DE Binary files differnew file mode 100644 index 00000000..375c2012 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/keymaps/de_DE diff --git a/core/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf b/core/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf new file mode 100644 index 00000000..00be09ca --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf @@ -0,0 +1,11 @@ +# Blacklist for mltk related modules + +# Intel corporation 82Q35 Express MEI controller spams syslog under +# some 3.0 kernels +blacklist mei + +# pcspeaker device driver +blacklist pcspkr + +# Strange device driver for alsa via pcspeaker +blacklist snd-pcsp diff --git a/core/rootfs/rootfs-stage32/data/etc/nsswitch.conf b/core/rootfs/rootfs-stage32/data/etc/nsswitch.conf new file mode 100644 index 00000000..6886def9 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/nsswitch.conf @@ -0,0 +1,19 @@ +# /etc/nsswitch.conf +# +# Example configuration of GNU Name Service Switch functionality. +# If you have the `glibc-doc-reference' and `info' packages installed, try: +# `info libc "Name Service Switch"' for information about this file. + +passwd: compat +group: compat +shadow: compat + +hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 +networks: files + +protocols: db files +services: db files +ethers: db files +rpc: db files + +netgroup: nis diff --git a/core/rootfs/rootfs-stage32/data/etc/profile b/core/rootfs/rootfs-stage32/data/etc/profile new file mode 100644 index 00000000..cbc5dba2 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/profile @@ -0,0 +1,56 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). +# XXX: Use `backticks` here instead of $(this stuff) as we don't know which shell is running... + +export UID=`id -u` 2> /dev/null + +# If running interactively, then: +if [ "$PS1" ]; then + + if [ "$BASH" ]; then + export PS1="[\u@\h \W]\\$ " + else + if [ "$UID" -eq 0 ]; then + export PS1='# ' + else + export PS1='$ ' + fi + fi + + export HISTSIZE=1000 + export HISTFILESIZE=1000 + export PAGER='/bin/less' + export EDITOR='/bin/vi' + export INPUTRC=/etc/inputrc + #export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile + export TERMINFO='/lib/terminfo' + +fi + +# Stuff we might wanna know +PWENT=`getent passwd $USER` +export USER=`echo "$PWENT" | awk -F ':' '{print $1}'` +export GID=`echo "$PWENT" | awk -F ':' '{print $4}'` +export HOME=`echo "$PWENT" | awk -F ':' '{print $6}'` +export GROUP=`id -gn` +export LOGNAME=$USER +export HOSTNAME=`hostname` + +# set TERM to xterm on SSH sessions +[ -n "$SSH_TTY" ] && export TERM=xterm + +# Source configuration files from /etc/profile.d +for i in /etc/profile.d/*.sh ; do + if [ -r "$i" ]; then + . $i + fi +done + +# Sourcing /etc/profile.local - please add custom stuff to profile.local +# as /etc/profile may be overwritten by system updates +test -s /etc/profile.local && . /etc/profile.local + +if [ -s "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" +fi + diff --git a/core/rootfs/rootfs-stage32/data/etc/resolv.conf b/core/rootfs/rootfs-stage32/data/etc/resolv.conf new file mode 120000 index 00000000..c6430d61 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/resolv.conf @@ -0,0 +1 @@ +/opt/openslx/resolv.conf
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service new file mode 100644 index 00000000..2c5d7769 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/early-network-triggers.service @@ -0,0 +1,13 @@ +# This will trigger network.target etc. at an early point, +# if network setup happened in stage31 (dhcp...) +[Unit] +Description=Trigger network targets early +DefaultDependencies=no +Wants=systemd-tmpfiles-setup.service +Before=sysinit.target +After=systemd-tmpfiles-setup.service + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/systemd-early_network_triggers +RemainAfterExit=yes diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service new file mode 120000 index 00000000..40a962d5 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/graphical.target.wants/killsplash.service @@ -0,0 +1 @@ +../killsplash.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/load-gfx-driver.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/load-gfx-driver.service new file mode 100644 index 00000000..0534f45c --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/load-gfx-driver.service @@ -0,0 +1,9 @@ +[Unit] +Description=Load DRM GFX driver and 3D +Before=sysinit.target shutdown.target +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/systemd-load_gfx_driver +RemainAfterExit=yes diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service new file mode 100644 index 00000000..7f8b54a8 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service @@ -0,0 +1,11 @@ +[Unit] +Description=Mount Openslx Stage 4 +DefaultDependencies=no +Wants=setup-dnbd3.service stage4.target +After=setup-dnbd3.service +Before=stage4.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/opt/openslx/scripts/systemd-mount_stage4 diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target b/core/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target new file mode 100644 index 00000000..bc12cd1b --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/network-dns.target @@ -0,0 +1,4 @@ +[Unit] +Description=DNS Server available +ConditionPathExists=/run/network/dns-ready + diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target b/core/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target new file mode 100644 index 00000000..770eb697 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/network-gateway.target @@ -0,0 +1,4 @@ +[Unit] +Description=Default route configured +ConditionPathExists=/run/network/gateway-ready + diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service new file mode 120000 index 00000000..c1792e42 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service @@ -0,0 +1 @@ +mount-stage4.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/rpc-statd.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/rpc-statd.service new file mode 100644 index 00000000..903a3b1a --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/rpc-statd.service @@ -0,0 +1,9 @@ +[Unit] +Description=NFSv2/3 Network Status Monitor Daemon +After=rpcbind.service +Requires=rpcbind.service + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/sbin/rpc.statd $STATD_OPTS diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/rpcbind.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/rpcbind.service new file mode 100644 index 00000000..7dc4dcc2 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/rpcbind.service @@ -0,0 +1,11 @@ +[Unit] +Description=RPC Bind +After=network.target +Wants=rpcbind.target +Before=rpcbind.target + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/sbin/rpcbind $BIND_OPTS +Restart=always diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-partitions.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-partitions.service new file mode 100644 index 00000000..6bb3a986 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-partitions.service @@ -0,0 +1,11 @@ +[Unit] +Description=Setup local disk partitions (tmp, swap) +DefaultDependencies=no +Before=basic.target +After=systemd-udev-settle.service +Wants=tmp.target + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/systemd-setup_partitions +RemainAfterExit=yes diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service new file mode 100644 index 00000000..88f38dbb --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addon@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Setup SLX addon %i +DefaultDependencies=no +Wants=tmp.target +After=tmp.target + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/systemd-setup_slx_addons %I +RemainAfterExit=yes diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addons.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addons.service new file mode 100644 index 00000000..71a81d3f --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/setup-slx-addons.service @@ -0,0 +1,11 @@ +[Unit] +Description=Download, mount and append SLX addons +After=tmp.target +Wants=tmp.target +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/systemd-setup_slx_addons +RemainAfterExit=yes + diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target b/core/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target new file mode 100644 index 00000000..9b2e9e94 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target @@ -0,0 +1,5 @@ +[Unit] +Requires=mount-stage4.service +After=mount-stage4.service +Description=OpenSLX Stage 4 +RefuseManualStart=yes diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/early-network-triggers.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/early-network-triggers.service new file mode 120000 index 00000000..8aec0a6d --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/early-network-triggers.service @@ -0,0 +1 @@ +../early-network-triggers.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/load-gfx-driver.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/load-gfx-driver.service new file mode 120000 index 00000000..b72d0453 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/load-gfx-driver.service @@ -0,0 +1 @@ +../load-gfx-driver.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/setup-partitions.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/setup-partitions.service new file mode 120000 index 00000000..af2957f8 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/setup-partitions.service @@ -0,0 +1 @@ +../setup-partitions.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/setup-slx-addons.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/setup-slx-addons.service new file mode 120000 index 00000000..415050b5 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/setup-slx-addons.service @@ -0,0 +1 @@ +../setup-slx-addons.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service new file mode 120000 index 00000000..4540789e --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/update-etc_issue.service @@ -0,0 +1 @@ +../update-etc_issue.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/zram-swap.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/zram-swap.service new file mode 120000 index 00000000..c1754b11 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/sysinit.target.wants/zram-swap.service @@ -0,0 +1 @@ +../zram-swap.service
\ No newline at end of file diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target b/core/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target new file mode 100644 index 00000000..a8c3eab2 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/tmp.target @@ -0,0 +1,5 @@ +[Unit] +Description=/tmp has been mounted +Wants=setup-partitions.service +After=setup-partitions.service + diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service new file mode 100644 index 00000000..21a09b7c --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/update-etc_issue.service @@ -0,0 +1,9 @@ +[Unit] +Description=Update /etc/issue +Before=getty.target shutdown.target +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/openslx-create_issue +RemainAfterExit=no diff --git a/core/rootfs/rootfs-stage32/data/etc/systemd/system/zram-swap.service b/core/rootfs/rootfs-stage32/data/etc/systemd/system/zram-swap.service new file mode 100644 index 00000000..a458b380 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/systemd/system/zram-swap.service @@ -0,0 +1,10 @@ +[Unit] +Description=Setup zram swap partitions +DefaultDependencies=no +Wants=swap.target +Before=swap.target + +[Service] +Type=oneshot +ExecStart=/opt/openslx/scripts/systemd-zram_swap +RemainAfterExit=yes diff --git a/core/rootfs/rootfs-stage32/data/etc/terminfo/l/linux b/core/rootfs/rootfs-stage32/data/etc/terminfo/l/linux Binary files differnew file mode 100644 index 00000000..48d722f8 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/terminfo/l/linux diff --git a/core/rootfs/rootfs-stage32/data/etc/terminfo/x/xterm b/core/rootfs/rootfs-stage32/data/etc/terminfo/x/xterm Binary files differnew file mode 100644 index 00000000..438b1581 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/terminfo/x/xterm diff --git a/core/rootfs/rootfs-stage32/data/etc/terminfo/x/xterm-256color b/core/rootfs/rootfs-stage32/data/etc/terminfo/x/xterm-256color Binary files differnew file mode 100644 index 00000000..b934be06 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/terminfo/x/xterm-256color diff --git a/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/network.conf b/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/network.conf new file mode 100644 index 00000000..346ecf7e --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/network.conf @@ -0,0 +1 @@ +d /run/network 0755 root root diff --git a/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/openslx-log.conf b/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/openslx-log.conf new file mode 100644 index 00000000..4d93fb9c --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/openslx-log.conf @@ -0,0 +1 @@ +d /var/log/openslx 0777 root root diff --git a/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/run-lock.conf b/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/run-lock.conf new file mode 100644 index 00000000..a20cf5ce --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/etc/tmpfiles.d/run-lock.conf @@ -0,0 +1,2 @@ +d /run/lock 1777 root root + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/bin/penv b/core/rootfs/rootfs-stage32/data/opt/openslx/bin/penv new file mode 100755 index 00000000..5d0c8dc7 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/bin/penv @@ -0,0 +1,7 @@ +#!/bin/ash + +[ "$#" -ne "1" ] && echo "Usage: $0 PID" && exit 1 +[ ! -e "/proc/$1/environ" ] && echo "No such process: $1" && exit 1 +[ ! -r "/proc/$1/environ" ] && echo "Cannot open process: $1" && exit 1 +sed 's/\x0/\n/g' "/proc/$1/environ" | grep -E --color=auto '^[^=]*' + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog b/core/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog new file mode 100755 index 00000000..52320c1a --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog @@ -0,0 +1,76 @@ +#!/bin/ash + +################## +# Remote logging # +################## +# +# Usage: slxlog [-e | --echo] "logtype" "Human readable string" ["file name which's contents should be sent too"] +# -e or --echo will echo message to stdout too +# + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin" + +. /opt/openslx/config +[ -z "$SLX_REMOTE_LOG" ] && exit 3 + +LOGCHECK="/tmp/remote_log_check" +NOW=$(date +%s) + +if [ "x$1" = "x-e" -o "x$1" = "x--echo" ]; then + shift + echo "$@" +fi + +[ $# -eq 0 ] && exit 0 + +TYPE="$1" + +# Simple spamcheck. Not very tamper-proof, but if you'd want to spam the server +# you could do it anyways. This is to protect from accidental loops calling this. +if [ -r "$LOGCHECK" ]; then + # Allow max 150 messages in total + LINES=$(cat "$LOGCHECK" | wc -l) + [ "$LINES" -gt "150" ] && exit 1 + # Allow max 5 of same type messages in 30 seconds + LINES=$(grep "$TYPE" "$LOGCHECK" | wc -l) + if [ "$LINES" -ge "5" ]; then + LAST=$(grep "$TYPE" "$LOGCHECK" | tail -n 5 | head -n 1 | awk '{print $1}') + if [ -n "$LAST" ]; then + DIFF="$(( $NOW - $LAST ))" + [ "$DIFF" -lt "30" ] && exit 2 + fi + fi +fi +echo "$NOW $TYPE" >> "$LOGCHECK" +chmod 0666 "$LOGCHECK" 2>/dev/null + +if [ $# -lt 2 ]; then + MSG="Missing text for $@" +else + MSG="$2" +fi +USER=$(whoami) +MSG="[$USER] $MSG" + +if [ $# -gt 2 ]; then + EXTRA="$3" +fi + +if [ -n "$SLX_DEBUG" ]; then + CURLLOG="/tmp/slxlog.$USER" +else + CURLLOG="/dev/null" +fi + +if [ -n "$EXTRA" ] && [ -r "$EXTRA" -a -s "$EXTRA" ] && [ "$(stat -c %s "$EXTRA")" -lt "10000" ]; then # valid file attachment + curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc@$EXTRA" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 & +elif [ -z "$EXTRA" ]; then # no attachment + curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 & +elif [ -s "$EXTRA" ]; then # empty attachment file (or missing) + curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc=Attachment too large: $EXTRA" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 & +else # attachment file to big (more than 10k) + curl --data-urlencode "type=$TYPE" --data-urlencode "description=$MSG" --data-urlencode "longdesc=Attachment missing/empty: $EXTRA" "$SLX_REMOTE_LOG" >> "$CURLLOG" 2>&1 & +fi + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue new file mode 100755 index 00000000..879463cd --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/openslx-create_issue @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright (c) 2013, 2014 - bwLehrpool Projekt +# Copyright (c) 2012 - 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 at http://openslx.org +# +# First script for initial ramfs for OpenSLX linux stateless clients +############################################################################# +PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin + +# Set greeting and add information about the booted system +len=$(expr length "$(cat /etc/hostname)") +while [ $len -le 56 ] ; do + space="$space " + len=$(($len + 1)) +done + +sed "s/%space%/$space/g" /opt/openslx/etc/issue.template > /etc/issue + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers new file mode 100755 index 00000000..1e999da6 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers @@ -0,0 +1,29 @@ +#!/bin/ash + +# This script will trigger several network targets if +# applicable at an early point. +# This happens if dhcp/network setup was successful in stage31 + +# Main interface +BRIDGE="br0" + +if [ ! -e "/sys/class/net/${BRIDGE}/operstate" -o "x$(cat "/sys/class/net/${BRIDGE}/operstate")" == "xup" ] && [ -e "/opt/openslx/uniontmp/etc/hostname" -o -e "/etc/resolv.conf" ]; then + echo "Triggering network.target" + touch "/run/network/network-ready" + systemctl start network.target & +fi + +if [ -s "/etc/resolv.conf" ] && grep -q "^nameserver" "/etc/resolv.conf"; then + echo "Triggering network-dns.target" + touch "/run/network/dns-ready" + systemctl start network-dns.target & +fi + +if route -n | grep -q -E '^0\.0\.0\.0.*U.*G'; then + echo "Triggering network-gateway.target" + touch "/run/network/gateway-ready" + systemctl start network-gateway.target & +fi + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver new file mode 100755 index 00000000..7bc310fc --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-load_gfx_driver @@ -0,0 +1,22 @@ +#!/bin/bash +PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin +PCIFILE=/tmp/lspci-output + +if ! lspci -n > "$PCIFILE"; then + echo "lspci -n failed..." + exit 1 +fi + +if grep -E ' (8086:0152|8086:0412|8086:0416|1002:6779)( |$)' "$PCIFILE" > /dev/null; then + echo "i915 - enable 3D" + echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config" +fi + +if lsmod | grep -q '^nvidia\s'; then + # nvidia kernel module was loaded in stage31 - download libs + systemctl start setup-slx-addon@nvidia_libs & + echo -e "# Written by load-gfx-driver\nSLX_VMWARE_3D=yes" >> "/opt/openslx/config" +fi + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 new file mode 100755 index 00000000..10cfca5f --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 @@ -0,0 +1,71 @@ +#!/bin/bash +# Needs full bash + +. /opt/openslx/config +PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin + +[ -z "${SLX_STAGE4}" ] && { echo "SLX_STAGE4 is not set in /opt/openslx/config." && exit 1; } + +MOUNTPOINT="/opt/openslx/mnt/stage4" +mkdir -p "$MOUNTPOINT" + +if [[ "$SLX_STAGE4" == dnbd3* ]]; then + # dnbd3 it is + if [ -z "${SLX_DNBD3_SERVERS}${SLX_DNBD3_PRIO_SERVERS}" ]; then + slxlog --echo "mount-stage4" "dnbd3 stage4 configured, but SLX_DNBD3(_PRIO)_SERVERS empty or not set in /opt/openslx/config." + exit 1 + fi + # Determine revision + if [ -z "$SLX_STAGE4_RID" ] || echo "$SLX_STAGE4_RID" | grep -v -q -E "^[0-9]+$"; then + SLX_STAGE4_RID="0" + fi + # Randomize list + SERVERS=$(for SERVER in $SLX_DNBD3_SERVERS; do echo "$RANDOM $SERVER"; done | sort -u | sed -r 's/^[0-9]+ //') + IMAGE=$(echo $SLX_STAGE4 | awk '{printf $2}') + [ -e /var/run/dnbd3.socket ] || sleep 2 # Ugly, service should only start when dnbd3 daemon is up and running + RET=1337 + for SRV in $SLX_DNBD3_PRIO_SERVERS $SERVERS; do + echo "Requesting $IMAGE from $SRV" + dnbd3=$(dnbd3-client -h "$SRV" -i "$IMAGE" -r "$SLX_STAGE4_RID") + RET=$? + [ "$RET" -eq "0" ] && break + echo "... didn't work ($RET)" + sleep 1 + done + if [ "$RET" -ne "0" ]; then + slxlog --echo "mount-stage4" "Could not get stage4 via dnbd3 ($IMAGE : $SLX_STAGE4_RID) ($SLX_DNBD3_PRIO_SERVERS / $SERVERS)" + exit $RET + fi + echo "Mounting $dnbd3 to $MOUNTPOINT" + if ! mount -t squashfs -o ro "$dnbd3" "$MOUNTPOINT"; then + slxlog --echo "mount-stage4" "Could not mount stage4 from '$dnbd3' to '$MOUNTPOINT' ($SRV, $IMAGE)" + exit 1 + fi +else + # Try nfs + echo "Mounting ${SLX_STAGE4} to $MOUNTPOINT" + if ! mount -t nfs -o ro,async,nolock,vers=3 "$SLX_STAGE4" "$MOUNTPOINT"; then + slxlog --echo "mount-stage4" "Could not mount stage4 from '$SLX_STAGE4' to '$MOUNTPOINT'" + exit 1 + fi +fi + +echo "Appending $MOUNTPOINT to /" +if mount -o "remount,append:$MOUNTPOINT=ro" /; then + + # addons can trigger ldconfig, hence + # make sure no ldconfig is running before copying the real ld cache + while ps aux|grep -v grep|grep -q ldconfig; do + sleep 1 + done + cp -r "${MOUNTPOINT}/"etc/ld.* /etc/ || echo "Could not really copy full blown ldconfig from stage4 to live system" +else + slxlog --echo "mount-stage4" "Could not append mounted stage4 at '$MOUNTPOINT' to aufs at /" + exit 1 +fi + +# dbus reload needed eg. for gnome etc. and perhaps other service files which stage4 needs: +systemctl reload dbus.service + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions new file mode 100755 index 00000000..0c352241 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions @@ -0,0 +1,168 @@ +#!/bin/ash +# 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 + +############################################################################# + +# Mount point for persistent scratch partition (type 45) +PERSISTENT="/opt/openslx/persistent" + +# General formatter for the /tmp partition on a local harddisk +diskfm () { + mopt="" # Global var! + local target="$1" + local fslist="xfs jfs ext3 ext2 ext4" + local fs + local path + [ $# -ge 2 ] && fslist="$2" + for fs in $fslist ; do + unset available + case $(cat /proc/filesystems) in + *${fs}*) available=yes;; + *) modprobe "${fs}" && available=yes;; + esac + if [ -n "${available}" ]; then + unset found + if which "mkfs.$fs" ; then + found=yes + case "mkfs.$fs" in + mkfs.xfs) + fopt="-f -b size=4k -s size=4k -l size=512b" # fastest formatting possible :) + mopt="-o noexec" + ;; + mkfs.ext2) + fopt="-Fq" + mopt="-o nocheck,noexec" + ;; + mkfs.ext3|mkfs.ext4) + fopt="-Fq" + mopt="-o noexec" + ;; + mkfs.reiserfs) + fopt="-f" + mopt="-o noexec" + ;; + mkfs.jfs) + fopt="-q" + mopt="-o noexec" + ;; + esac + mkfs.$fs ${fopt} "${target}" + fi + [ -n "$found" ] && break + fi + done +} + +mount_temp () { + local PRE=$(pwd) + if ! cd /tmp; then + mount_temp_fallback $@ + return $? + fi + mount $@ /tmp || return 1 + chmod a+rwxt /tmp + # Move stuff from working directory, which is old /tmp, to new /tmp just mounted + mv ./* ./.[!.]* ./..?* /tmp/ 2> /dev/null + local OLD=$(LANG=C ls -alh | grep -v -E ' \.\.?$' | grep -v '^total') + [ -n "$OLD" ] && echo -- "Leftovers:" && echo -- "$OLD" + cd "$PRE" +} + +mount_temp_fallback () { + mkdir -p /tmptmp + mv /tmp/* /tmp/.* /tmptmp/ 2> /dev/null + mount $@ /tmp || return 1 + chmod a+rwxt /tmp + mv /tmptmp/* /tmptmp/.* /tmp/ + rmdir /tmptmp + return 0 +} + +fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition" + +if [ ! -s "/etc/disk.partition" ]; then + sleep 3 + fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition" +fi + +echo "Partitions:" +cat "/etc/disk.partition" + +# Check for standard swap partitions and make them available to the system +HAVE_SWAP=no +for hdpartnr in $(sed -n -e "/ 82 /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do + echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab" + swapon "$hdpartnr" -p 10 && HAVE_SWAP=yes # low priority, in case we have zram swap, prefer that) +done + +# We use special non assigned partition type (id44) for harddisk scratch +# space, thus no normal filesystem will be incidentally deleted or +# corrupted +HAVE_TEMP=no +for hdpartnr in $(sed -n -e "/ 44 /p" "/etc/disk.partition" | 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 + mount_temp "$mopt" "$hdpartnr" || continue + echo -e "${hdpartnr}\t/tmp\t\tauto\t\tnoexec\t 0 0" >> "/etc/fstab" + HAVE_TEMP=yes + break + else + echo "formatting failed for some reason" + fi # Made this non-forking, systemd should handle it - 2013-05-28 +done + +# Put detected linux partitions (83) into /etc/fstab with "noauto", special +# partition 45 (persistent scratch) to /var/scratch and 46 to /var/openslx +HAVE_PERSISTENT=no +for partid in 83 45 46 ; do + for hdpartnr in $(sed -n -e "/ ${partid} /p" "/etc/disk.partition" | sed -e "s/[[:space:]].*//"); do + if [ "${partid}" -eq 83 ]; then + mkdir -p "/media/${hdpartnr#/dev/*}" + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,noexec\t 0 0" >> "/etc/fstab" + elif [ "${partid}" -eq 45 -a "$HAVE_PERSISTENT" = "no" ]; then + mkdir -p "$PERSISTENT" + if ! mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT"; then + diskfm "$hdpartnr" "jfs xfs ext3" || continue + mount -t auto -o noexec "${hdpartnr}" "$PERSISTENT" || continue + fi + HAVE_PERSISTENT=yes + echo -e "${hdpartnr}\t${PERSISTENT}\tauto\t\tnoauto,noexec\t\t 0 0" >> "/etc/fstab" + elif [ "${partid}" -eq 46 ]; then + mkdir -p "/media/${hdpartnr#/dev/*}" + #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" >> "/etc/fstab" + fi + done +done +[ "$HAVE_PERSISTENT" = "no" -a -d "$PERSISTENT" ] && rm -f "$PERSISTENT" + +mount -a + +# Make huge tmpfs if nothing could be mounted for /tmp +if [ "$HAVE_TEMP" = "no" ]; then + mount_temp -t tmpfs -o size=60G none + slxlog "partition-temp" "Running /tmp on tmpfs only!" "/etc/disk.partition" +fi +if [ "$HAVE_SWAP" = "no" ]; then + TOTAL_RAM=$(grep ^MemTotal /proc/meminfo | awk '{print $2}') + if [ -n "$TOTAL_RAM" ] && [ "$TOTAL_RAM" -lt "3000000" ]; then + slxlog "partition-swap" "Have no (formatted) swap partition, using zram swap only!" "/etc/disk.partition" + fi +fi + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons new file mode 100755 index 00000000..8fb2579a --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons @@ -0,0 +1,94 @@ +#!/bin/bash +# Needs full bash +# +# Script to be called by systemd +# +# Downloads and appends addons per sqfs/aufs. +# +###################################################################################### +# +# Two modes for this script: +# - without any arguments, it will just go through the list of addons to +# setup as given through the OpenSLX configuration file +# - with an argument, it will setup the addon given as $1 +# +# +###################################################################################### + +export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin + +# read global OpenSLX config +. /opt/openslx/config || { echo "Could not source config!"; exit 23; } + +# source functions.inc for the download function +. /opt/openslx/inc/functions || { echo "/opt/openslx/inc/functions not found!"; exit 1337; } + +# quick fix for the missing FUTURE_ROOT needed by /opt/openslx/etc/functions.inc +export FUTURE_ROOT="/" + +# read openslx config, especially servers given by SLX_KCL_SERVERS and SLX_CONFIG_SERVERS +if [ -z "${SLX_CONFIG_SERVERS}" ]; then + echo "SLX_CONFIG_SERVERS is not set in /opt/openslx/config. Will only try the base servers from the cmdline." + #[ -z "${SLX_KCL_SERVERS}" ] && SLX_KCL_SERVERS=$(read_from_cmdline "slxsrv") +fi + +# read base slx servers from cmdline +BASE_MOUNT_POINT="/opt/openslx/mnt" +DOWNLOAD_DEST="/tmp/addons" +mkdir -p "$DOWNLOAD_DEST" || { echo "Failed to create $DOWNLOAD_DEST"; exit 1; } + +###################################################################################### +# +# NO ARGUMENTS -> LOOP OVER ALL ADDONS +# + +if [ $# -eq 0 ]; then + [ -z "${SLX_ADDONS}" ] && { echo "No addons configured. Nothing to do :-)."; exit 0; } + for ADDON in ${SLX_ADDONS}; do + systemctl start "setup-slx-addon@$ADDON" & + done +fi + +###################################################################################### +# +# WITH ARGUMENTS -> SETUP ADDON +# + +if [ $# -eq 1 ]; then + ADDON="$1" + + # download the addon from the given URL + ADDON_TARGET_PATH="${DOWNLOAD_DEST}/$(basename "$ADDON").sqfs" + if ! download "${SLX_BASE_PATH}/${ADDON}.sqfs" "${ADDON_TARGET_PATH}"; then + slxlog --echo "addon-download" "Download of '${HTTP_BASE_PATH}/${ADDON}.sqfs' failed." + exit 1 + fi + + # now mount it to $BASE_MOUNT_POINT/<addon-name> + ADDON_MOUNT_POINT="${BASE_MOUNT_POINT}/$(basename "$ADDON")" + mkdir -p "$ADDON_MOUNT_POINT" + mount -t squashfs -o ro "$ADDON_TARGET_PATH" "$ADDON_MOUNT_POINT" || \ + { slxlog --echo "addon-mount" "Failed to mount $ADDON_TARGET_PATH."; exit 1; } + + # now append it to / + echo "Appending ${ADDON_MOUNT_POINT} to /" + if ! mount -o "remount,ins:1:${ADDON_MOUNT_POINT}=rr" / ; then # ins:2 makes sure the addon is after tmpfs and stage32, but before stage4 + slxlog --echo "addon-aufs" "Failed to append ${ADDON_MOUNT_POINT} to the aufs. Cleaning up..." + umount -l ${ADDON_MOUNT_POINT} || echo "Could not unmount ${ADDON_MOUNT_POINT}!" + exit 1 + fi + + # Run post-hook if available + if [ -x "$ADDON_MOUNT_POINT/addon-init" ]; then + "$ADDON_MOUNT_POINT/addon-init" || \ + slxlog --echo "addon-init" "Warning: Could not execute addon-init of $ADDON" + fi + if ! grep -q '/opt/openslx/mnt/stage4' "/proc/mounts"; then + ldconfig 2> /dev/null || ldconfig.real 2> /dev/null + fi +fi + +[ $# -gt 1 ] && { echo "Error - $0 only takes no or one argument. $# given." && exit 1; } + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-zram_swap b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-zram_swap new file mode 100755 index 00000000..f8bd5682 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-zram_swap @@ -0,0 +1,60 @@ +#!/bin/ash +# 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 + +############################################################################# + + +# Add zram swap +# Some older ubuntu kernels had a problem here, see https://bugs.launchpad.net/ubuntu/+source/linux-lts-raring/+bug/1217189 +# So make sure you're up to date + +make_swap () { + [ $# -ne 2 ] && echo "make_swap: Wrong parameter count $#" && exit 1 + local USE="$1" + local DEV="$2" + echo "$USE" > "/sys/block/zram${DEV}/disksize" + mkswap "/dev/zram${DEV}" + swapon "/dev/zram${DEV}" -p 1000 # high priority (in case we have hdd swap 0x82, prefer zram) +} + +CPUS=$(grep -c -E "^processor.*[0-9]+$" "/proc/cpuinfo") +if [ -z "$CPUS" ]; then + echo "ERROR: Could not determine CPU core count" + exit 1 +fi + +[ "$CPUS" -gt "16" ] && CPUS=16 # zram can only handle up to 32 devices, the system can apparently even just handle 29 swap partitions, so use a reasonable upper limit +if ! modprobe zram "num_devices=$CPUS"; then + echo "ERROR: Could not load zram module" + exit 1 +fi + +TOTAL=$(grep ^MemTotal /proc/meminfo | awk '{print $2}') +USE=$(( $TOTAL / ( 2 * $CPUS ) )) +echo "Have $CPUS cores, $TOTAL kb mem, use $USE kb zram swap per core" +USE=$(( $USE * 1024 )) +DEV=0 +while [ "$DEV" -lt "$CPUS" ]; do + make_swap "$USE" "$DEV" & + LAST=$! + DEV=$(( $DEV + 1 )) +done + +# Wait, so we don't trigger swap.target too early +while kill -0 "$LAST"; do + usleep 100000 +done + +exit 0 + diff --git a/core/rootfs/rootfs-stage32/data/root/.bashrc b/core/rootfs/rootfs-stage32/data/root/.bashrc new file mode 100644 index 00000000..6266b0f4 --- /dev/null +++ b/core/rootfs/rootfs-stage32/data/root/.bashrc @@ -0,0 +1,48 @@ +[ -z "$PS1" ] && return +HISTCONTROL=ignoredups:ignorespace +shopt -s histappend +HISTSIZE=1000 +HISTFILESIZE=2000 +shopt -s checkwinsize +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi +case "$TERM" in + xterm-color) color_prompt=yes;; +esac +force_color_prompt=yes +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + color_prompt=yes + else + color_prompt= + fi +fi +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi +alias ll='ls -alFh' +alias la='ls -A' +alias l='ls -CF' +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi +export PATH=/root/bin:$PATH |