summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorMichael Neves2013-02-27 18:28:53 +0100
committerMichael Neves2013-02-27 18:28:53 +0100
commit03b9076c3185c34601a1cc3e728483e98b8cddeb (patch)
tree1d383c9f9a276c8a19d6b50b2e8a865f3cd89d8f /data
parentupdate gitignore (diff)
downloadtm-scripts-03b9076c3185c34601a1cc3e728483e98b8cddeb.tar.gz
tm-scripts-03b9076c3185c34601a1cc3e728483e98b8cddeb.tar.xz
tm-scripts-03b9076c3185c34601a1cc3e728483e98b8cddeb.zip
add NFS capability
Diffstat (limited to 'data')
-rwxr-xr-xdata/stage3.1/init73
1 files changed, 39 insertions, 34 deletions
diff --git a/data/stage3.1/init b/data/stage3.1/init
index 14516a50..b8d0c56d 100755
--- a/data/stage3.1/init
+++ b/data/stage3.1/init
@@ -13,7 +13,6 @@
#############################################################################
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/openslx/bin:/openslx/sbin
-export LD_LIBRARY_PATH=/openslx/lib
mount -n -t tmpfs -o 'mode=755' run "/run"
@@ -21,36 +20,39 @@ mount -n -t tmpfs -o 'mode=755' run "/run"
[ ! -f /proc/cpuinfo ] && mount -n -t proc proc /proc
[ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys
-# read primary graphic adaptor configuration (without proprietary drivers yet)
+# read graphic and network adaptor configuration (without proprietary drivers yet)
( hwinfo --gfxcard > /etc/hwinfo ) &
+( hwinfo --netcard > /etc/netcard ) &
-# load local file systems
-insmod /lib/modules.0/aufs.ko
-insmod /lib/modules.0/squashfs.ko
-
-mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs
-mount -n /mnt/openslx.sqfs /rorootfs
-mount -n -t tmpfs none /dev/shm/uniontmp
-
-mount -n -t aufs -o br:/dev/shm/uniontmp:/rorootfs=ro none /mnt
-mkdir -p /mnt/uniontmp /mnt/tmp
-mount -n --move /dev/shm/uniontmp /mnt/uniontmp
-
-ln -sf /mnt/lib /
+# read kernel command line for debugging switch
+read KCL < /proc/cmdline
+export KCL
+for opts in ${KCL}; do
+ case ${opts} in
+ debug=*)
+ DEBUG=1;;
+ ip=*)
+ # process IP info
+ ipinfo=${opts#ip=};;
+ nfs=*)
+ nfs=${opts#nfs=}
+ nfspath=${nfs#*:}
+ nfsserver=${nfs%:/*}
+ ;;
+ esac
+done
-cat /proc/uptime >/mnt/tmp/runtime
+cat /proc/uptime > /mnt/tmp/runtime
-( hwinfo --netcard > /etc/netcard ) &
while ps | grep -v grep | grep -q " hwinfo --gfxcard" ; do usleep 10 ; done
-
case $(cat /etc/hwinfo) in
*i915*)
modprobe -a i915 2>/dev/null
;;
*intel*|*Intel*)
modprobe -a i810 i830 i915 2>/dev/null
- ;;
+ ;;
*nvidia*|*NVidia*|*nouveau*)
modprobe -q nouveau 2>/dev/null
;;
@@ -68,8 +70,6 @@ case $(cat /etc/hwinfo) in
esac
( modprobe -a drm fbcon; mdev -s ) &
-#ln -s /mnt/share /
-
# load required network and usb controller drivers, filter out wireless adaptors
while ps | grep -v grep | grep -q " hwinfo --netcard" ; do usleep 10 ; done
nwcardlist="forcedeth|e1000e|e1000|e100|tg3|via-rhine|r8169|pcnet32"
@@ -83,19 +83,6 @@ if [ $(grep -ic "virtio_pci" /etc/modprobe.base) -ge 1 ]; then
fi
/bin/sh /etc/modprobe.base; mdev -s
-# read kernel command line for debugging switch
-read KCL < /proc/cmdline
-export KCL
-for opts in ${KCL}; do
- case ${opts} in
- debug)
- DEBUG=1;;
- ip=*)
- # process IP info
- ipinfo=${opts#ip=};;
- esac
-done
-
# setup network
nwif="eth0"
# set up loopback networking
@@ -135,6 +122,24 @@ fi
cat /proc/uptime >>/mnt/tmp/runtime
+
+# load local file systems
+insmod /lib/modules/aufs.ko
+insmod /lib/modules/squashfs.ko
+
+mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs
+mount -n -t tmpfs none /dev/shm/uniontmp
+
+if [ -n "$nfs" ] ; then
+ mount -t nfs -o ro,async,nolock ${nfsserver}:${nfspath} /rorootfs || { echo "Problem mounting NFS-Directory from ${nfsserver}:${nfspath}. Dropping to DEBUG shell."; DEBUG=1; }
+else
+ mount -n /mnt/openslx.sqfs /rorootfs || { echo "Problem mounting Squashfs. Dropping to DEBUG shell."; DEBUG=1; }
+fi
+
+mount -n -t aufs -o br:/dev/shm/uniontmp:/rorootfs=ro none /mnt
+mkdir -p /mnt/uniontmp /mnt/tmp
+mount -n --move /dev/shm/uniontmp /mnt/uniontmp
+
if [ $DEBUG -ge 1 ]; then
echo "Starting debug shell, CTRL + D will start Stage 3.2."
setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'