summaryrefslogtreecommitdiffstats
path: root/remote/rootfs
diff options
context:
space:
mode:
Diffstat (limited to 'remote/rootfs')
-rw-r--r--remote/rootfs/rootfs-stage32/data/etc/issue11
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx53
2 files changed, 42 insertions, 22 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/etc/issue b/remote/rootfs/rootfs-stage32/data/etc/issue
deleted file mode 100644
index 11c0452c..00000000
--- a/remote/rootfs/rootfs-stage32/data/etc/issue
+++ /dev/null
@@ -1,11 +0,0 @@
-
- WELCOME TO \n (\l)
- _____ ______ ______ __ __ ______ __ __ __ __ __ ______
- / _ | _ | ___| | | || ___| | | | | | | | | | ____
-| | | | |_| | |_ | | || |__ | | / / __ | | | |
-| | | | ___/| _| | | ___ | | | | |__| | | | ___
-| |_| | | | |___| | | | ___| | |___ / / | | | | |__ |
- _____/|__| |______|__| |__||______|______|__| |__| |__| |__| _____/
-
- (c) <OpenSLX.ORG>
-
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx
index 1bbf6e80..b49e2207 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/udhcpc-openslx
@@ -68,25 +68,56 @@ case "$1" in
# Things that should only happen for the main interface that was used for booting
if [ "$interface" == "br0" ]; then
- #update ip
+ # Update IP
sed -i "s/^\(SLX_PXE_CLIENT_IP=\).*$/\1'$ip'/" /opt/openslx/config
- #update hostname
+ # Update hostname
dns_host=$(rdns "$ip")
if [ -z "$dns_host" ]; then
# fallback to what the dhcp told us
dns_host="$hostname"
fi
- if [ -n "$dns_host" ]; then
- echo "$dns_host" > "/proc/sys/kernel/hostname"
- echo "$dns_host" > "/etc/hostname"
- if grep '^SLX_HOSTNAME=' /opt/openslx/config 2>/dev/null; then
- sed -i "s/^\(SLX_HOSTNAME=\).*$/\1'$dns_host'/" /opt/openslx/config
- else
- echo "# Config written by openslx-dhcp-script (1)" >> /opt/openslx/config
- echo "SLX_HOSTNAME='$dns_host'" >> /opt/openslx/config
- fi
+ # Avoid empty hostnames
+ [ -z "$dns_host" ] && dns_host="slx-client"
+ echo "$dns_host" > "/proc/sys/kernel/hostname"
+ echo "$dns_host" > "/etc/hostname"
+ if grep '^SLX_HOSTNAME=' /opt/openslx/config 2>/dev/null; then
+ sed -i "s/^\(SLX_HOSTNAME=\).*$/\1'$dns_host'/" /opt/openslx/config
+ else
+ echo "# Config written by openslx-dhcp-script (1)" >> /opt/openslx/config
+ echo "SLX_HOSTNAME='$dns_host'" >> /opt/openslx/config
fi
+ # Set greeting and add information on booted system
+ # Fixme (add version string and distro name)
+ version="bwLehrpools/<distro-name>-<version>"
+ len=$(expr length ${version})
+ if [ $len -le 28 ] ; then
+ vdstr="Stateless Workstation (${version})"
+ smax=52
+ else
+ vdstr="${version}"
+ smax=76
+ fi
+ while [ $len -le $smax ] ; do
+ vdstr="$vdstr "
+ len=$(($len + 1))
+ done
+ len=$(expr length ${dns_host})
+ while [ $len -le 52 ] ; do
+ space="$space "
+ len=$(($len + 1))
+ done
+ echo "
+ WELCOME TO $space \n (\l)
+ _____ ______ ______ __ __ _______ __ __ __ __ __ ______
+ / _ | _ | ___| | | | | ____| | | | | | | | | |/ ____|
+ | | | | |_| | |_ | | | | |___ | | / / __ | | | | | ___
+ | | | | ___/| _| | | ____ | | | | |__| | | | |_ |
+ | |_| | | | |___| | | | ____| | |___ / / | | | | |___ |
+ _____/|__| |______|__| |__| |_______|______|__| |__| |__| |__| ______/
+
+ $vdstr (c) <OpenSLX.ORG>
+" > /etc/issue
fi
# Hostname in /etc/hosts