summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2013-05-03 15:24:33 +0200
committerJonathan Bauer2013-05-03 15:24:33 +0200
commit7701d2d8f525060c5e81a05196732e1c9071e8ba (patch)
tree91c2817aa3e92901056af1bb543f1f71a8ae2576
parentvesa support in kernel (diff)
downloadtm-scripts-7701d2d8f525060c5e81a05196732e1c9071e8ba.tar.gz
tm-scripts-7701d2d8f525060c5e81a05196732e1c9071e8ba.tar.xz
tm-scripts-7701d2d8f525060c5e81a05196732e1c9071e8ba.zip
minor
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/init54
1 files changed, 23 insertions, 31 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init
index a9c0435c..4754dced 100755
--- a/remote/rootfs/rootfs-stage31/data/init
+++ b/remote/rootfs/rootfs-stage31/data/init
@@ -57,10 +57,6 @@ if [ "x$SPLASH" == "x1" -a "x$DEBUG" != "x1" ]; then
plymouthd && plymouth show-splash
fi
-# still needed?
-#echo "modprobe -qa usbhid hid-bright" >/etc/modprobe.base
-#/bin/sh /etc/modprobe.base; mdev -s
-
# setup network
nwif="eth0"
# set up loopback networking
@@ -73,37 +69,32 @@ ip link set dev $nwif up 2>/dev/null || { echo "No link for $nwif, dropping to
# analyze ip information from the kernel command line and put parts
# of it into several variables
if [ -n "$ipinfo" ] ; then
- getip () {
- local val="$ipinfo:"; i=$(($1 - 1));
- while [ $i -gt 0 ] ; do
- val=${val#*:} ; i=$(($i - 1));
- done;
- echo $val|sed "s/:.*//"; }
- clientip=$(getip 1)
- serverip=$(getip 2)
- gateway=$(getip 3)
- subnet_mask=$(getip 4)
- broadcast_address=$(ipcalc -s -b $clientip $subnet_mask|sed s/.*=//)
- [ -z "$broadcast_address" ] && broadcast_address=255.255.255.255
- # we might have an idea of the dns server via preboot
- dns_srv=$(getip 5)
- [ -n "$dns_srv" ] && echo nameserver $dns_srv >/etc/resolv.conf;
- echo -e "# ip configuration written by $0 script:\nclientip=$clientip\n\
+ getip () {
+ local val="$ipinfo:"; i=$(($1 - 1));
+ while [ $i -gt 0 ] ; do
+ val=${val#*:} ; i=$(($i - 1));
+ done;
+ echo $val|sed "s/:.*//"; }
+ clientip=$(getip 1)
+ serverip=$(getip 2)
+ gateway=$(getip 3)
+ subnet_mask=$(getip 4)
+ broadcast_address=$(ipcalc -s -b $clientip $subnet_mask|sed s/.*=//)
+ [ -z "$broadcast_address" ] && broadcast_address=255.255.255.255
+ # we might have an idea of the dns server via preboot
+ dns_srv=$(getip 5)
+ [ -n "$dns_srv" ] && echo nameserver $dns_srv >/etc/resolv.conf;
+ echo -e "# ip configuration written by $0 script:\nclientip=$clientip\n\
subnet_mask=$subnet_mask\ngateway=$gateway\nserverip=$serverip\n\
broadcast_address=$broadcast_address" >>/etc/initramfs-setup
- # set static ip address
- ip addr add $clientip/$(ipcalc -s -p $clientip $subnet_mask|sed s/.*=//) \
- broadcast $broadcast_address dev $nwif 2>/dev/null
- ip route add default via $gateway 2>/dev/null
+ # set static ip address
+ ip addr add $clientip/$(ipcalc -s -p $clientip $subnet_mask|sed s/.*=//) \
+ broadcast $broadcast_address dev $nwif 2>/dev/null
+ ip route add default via $gateway 2>/dev/null
else
- noipyet="yes"
+ noipyet="yes"
fi
-
-# load local file systems - in kernel now! :-)
-#modprobe aufs
-#modprobe squashfs
-
mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs
mount -n -t tmpfs none /dev/shm/uniontmp
@@ -124,12 +115,13 @@ else
fi
echo "Building aufs..."
+#mount -t overlayfs -o lowerdir=/rorootfs,upperdir=/dev/shm/uniontmp overlayfs /mnt
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
# create udev rule for nic we booted from
-echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'$macaddr'", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"' > "/mnt/etc/udev/rules.d/70-net-boot-nic-name.rules"
+[ -e "/mnt/etc/udev/rules.d/70-net-boot-nic-name.rules" ] && echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'$macaddr'", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"' > "/mnt/etc/udev/rules.d/70-net-boot-nic-name.rules"
for mnt in proc sys run ; do
umount -n $mnt