summaryrefslogtreecommitdiffstats
path: root/data/stage3.1/init
diff options
context:
space:
mode:
Diffstat (limited to 'data/stage3.1/init')
-rwxr-xr-xdata/stage3.1/init90
1 files changed, 47 insertions, 43 deletions
diff --git a/data/stage3.1/init b/data/stage3.1/init
index affae622..c51abbea 100755
--- a/data/stage3.1/init
+++ b/data/stage3.1/init
@@ -21,40 +21,64 @@ mount -n -t tmpfs -o 'mode=755' run "/run"
[ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys
# read primary graphic adaptor configuration (without proprietary drivers yet)
-( hwinfo --gfxcard >/etc/hwinfo.gfxcard
- case $(cat /etc/hwinfo.gfxcard) in
- *i915*)
- modprobe -a i915 2>/dev/null
- ;;
+( hwinfo --gfxcard --usb-ctrl > /etc/hwinfo ) &
+
+# 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 -s /mnt/lib/modules /lib/
+
+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
- ;;
+ modprobe -a i810 i830 i915 2>/dev/null
+ ;;
*nvidia*|*NVidia*|*nouveau*)
- modprobe -q nouveau 2>/dev/null
- ;;
+ modprobe -q nouveau 2>/dev/null
+ ;;
*radeon*|*Radeon*)
- modprobe -q radeon 2>/dev/null
- ;;
+ modprobe -q radeon 2>/dev/null
+ ;;
*mga*|*matrox*|*Matrox*)
- modprobe -q mga 2>/dev/null
- ;;
+ modprobe -q mga 2>/dev/null
+ ;;
+ *VMWARE*)
+ ;;
*)
- modprobe -qa r128 savage sis tdfx ttm via viafb
- ;;
- esac
- modprobe -a drm fbcon; mdev -s ) &
+ modprobe -qa r128 savage sis tdfx ttm via viafb
+ ;;
+esac
+( modprobe -a drm fbcon; mdev -s ) &
# load required network and usb controller drivers, filter out wireless adaptors
-nwcardlist="forcedeth e1000e e1000 e100 tg3 via-rhine r8169 pcnet32"
+while ps | grep -v grep | grep -q " hwinfo --netcard" ; do usleep 10 ; done
+nwcardlist="forcedeth|e1000e|e1000|e100|tg3|via-rhine|r8169|pcnet32"
echo "modprobe -qa usbhid hid-bright" >/etc/modprobe.base
-grep modprobe /etc/hwinfo.netcard-usbctrl | grep -E "$nwcardlist|hcd" \
- | grep -v ehci | sed 's/.* Cmd: "//;s/"//;s/modprobe/modprobe -qb/' \
+grep modprobe /etc/netcard | grep -E "$nwcardlist" \
+ | sed 's/.* Cmd: "//;s/"//;s/modprobe/modprobe -qb/' \
| sort -u >>/etc/modprobe.base
# virtio hack
if [ $(grep -ic "virtio_pci" /etc/modprobe.base) -ge 1 ]; then
echo "modprobe -q virtio_net" >>/etc/modprobe.base
fi
-sh /etc/modprobe.base; mdev -s
+/bin/sh /etc/modprobe.base; mdev -s
# read kernel command line for debugging switch
read KCL < /proc/cmdline
@@ -69,11 +93,8 @@ for opts in ${KCL}; do
esac
done
-
-modprobe usbhid
-modprobe pcnet32
+# setup network
nwif="eth0"
-
# set up loopback networking
[ $DEBUGLEVEL -eq 20 ] && echo "** starting ip config at $(sysup)"
ip link set dev lo up 2>/dev/null
@@ -109,24 +130,7 @@ else
noipyet="yes"
fi
-for MOD in aufs squashfs sunrpc lockd fscache auth_rpcgss nfs_acl nfs; do
- insmod /lib/modules/${MOD}.ko
-done
-
-# load basic filesystem modules
-#modprobe -qa aufs squashfs nfs
-
-
-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
-mount -n --move /dev/shm/uniontmp /mnt/uniontmp
-
-
-
+cat /proc/uptime >>/mnt/tmp/runtime
if [ $DEBUG -ge 1 ]; then
echo "Starting debug shell, CTRL + D will start Stage 3.2."