summaryrefslogtreecommitdiffstats
path: root/remote/tools/base
diff options
context:
space:
mode:
authorJonathan Bauer2012-12-20 15:33:34 +0100
committerJonathan Bauer2012-12-20 15:33:34 +0100
commitf6dad6269ab3228ead055291b846d2a9edb04564 (patch)
tree30096a5fbd037fe4f9f0a0ef2b68d04317883c8e /remote/tools/base
parentstatic unit files for dbus, cleanup (diff)
downloadtm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.tar.gz
tm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.tar.xz
tm-scripts-f6dad6269ab3228ead055291b846d2a9edb04564.zip
mltk basic script :)
Diffstat (limited to 'remote/tools/base')
-rw-r--r--remote/tools/base/base.build4
-rw-r--r--remote/tools/base/data/README3
-rw-r--r--remote/tools/base/data/etc/profile (renamed from remote/tools/base/data/profile)4
-rw-r--r--remote/tools/base/data/etc/systemd/system/network-fast.service8
-rwxr-xr-xremote/tools/base/data/etc/udhcpc.default.script64
5 files changed, 76 insertions, 7 deletions
diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build
index fb7b7294..a56982fa 100644
--- a/remote/tools/base/base.build
+++ b/remote/tools/base/base.build
@@ -52,8 +52,8 @@ post_copy() {
echo "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/openslx/sbin:/openslx/bin\"" \
> ${INIT_DIR}/etc/environment
- # copy static bash profile
- cp ${TOOL_DIR}/${TOOL}/data/profile ${INIT_DIR}/etc
+ # copy static files
+ cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR}
# copy pam modules, TODO: better way to find arch-dependant interfix...
tar -cpv $(dirname $(locate pam_unix.so|grep ^/lib/)) | tar -xpv -C ${INIT_DIR} &>/dev/null
diff --git a/remote/tools/base/data/README b/remote/tools/base/data/README
deleted file mode 100644
index 48aab378..00000000
--- a/remote/tools/base/data/README
+++ /dev/null
@@ -1,3 +0,0 @@
-Static files to customized the basic system
-
-Here comes things like bash config, pam config, etc
diff --git a/remote/tools/base/data/profile b/remote/tools/base/data/etc/profile
index 12e75661..3784e784 100644
--- a/remote/tools/base/data/profile
+++ b/remote/tools/base/data/etc/profile
@@ -15,8 +15,8 @@ if [ "$PS1" ]; then
if [ "$BASH" ]; then
export PS1="[\u@\h \W]\\$ "
- alias ll='ls -laFh'
- alias ls='ls -F'
+ alias ll='ls --color=auto -laFh'
+ alias ls='ls --color=auto -F'
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
else
if [ "`id -u`" -eq 0 ]; then
diff --git a/remote/tools/base/data/etc/systemd/system/network-fast.service b/remote/tools/base/data/etc/systemd/system/network-fast.service
new file mode 100644
index 00000000..6656b189
--- /dev/null
+++ b/remote/tools/base/data/etc/systemd/system/network-fast.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Setup Network Connection
+After=udev.service
+
+[Service]
+ExecPre=/openslx/bin/ip link set dev eth0 up
+ExecStart=/openslx/sbin/udhcpc -O domain -O nissrv -O nisdomain -t 8 -s /etc/udhcpc.default.script -i eth0
+
diff --git a/remote/tools/base/data/etc/udhcpc.default.script b/remote/tools/base/data/etc/udhcpc.default.script
new file mode 100755
index 00000000..09442a5e
--- /dev/null
+++ b/remote/tools/base/data/etc/udhcpc.default.script
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Busybox udhcpc dispatcher script. Copyright (C) 2009 by Axel Beckert.
+#
+# Based on the busybox example scripts and the old udhcp source
+# package default.* scripts.
+
+RESOLV_CONF="/etc/resolv.conf"
+
+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
+
+ # read filename from fbgui.conf where ip config should be saved.
+ ipconf=$(cat /etc/fbgui.conf | grep ip_config | cut -d '=' -f2)
+
+ echo "ip=$ip" > $ipconf
+ echo "subnet=$subnet" >> $ipconf
+ echo "broadcast=$broadcast" >> $ipconf
+ echo "gateway=$router" >> $ipconf
+ echo "$ip:132.230.4.3:$router:$subnet" > /tmp/ip_config_fbgui
+
+ # 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
+ trigger=$(cat /etc/fbgui.conf | grep file_trigger | cut -d '=' -f2)
+
+ echo "gogo" >> $trigger
+ ;;
+
+ deconfig)
+
+ ;;
+
+ leasefail)
+ echo "$0: Lease failed: $message"
+ ;;
+
+ nak)
+ echo "$0: Received a NAK: $message"
+ ;;
+
+ *)
+ echo "$0: Unknown udhcpc command: $1";
+ exit 1;
+ ;;
+esac