Map PTEs for MAP_SHARED | MAP_LOCKED files on fork
[akaros.git] / kern / kfs / ifconfig
index 1a3f574..ff964d7 100755 (executable)
@@ -1,17 +1,5 @@
 #!/bin/ash
 
-# known good.
-hossinMAC=00241d1054e1
-c89MAC=001e67652333
-c99MAC=001e67c2f479
-altdraMAC=525400b0c2ec
-qemuMAC=525400123456
-tower1MAC=00032d196d88
-tower2MAC=00032d196ddd
-tower3MAC=00032d196d46
-tower4MAC=00032d196db0
-tower5MAC=00032d196daa
-
 MAC=`cat '#ether/ether0/addr'`
 
 #bind -a '#ip' /net
@@ -38,86 +26,30 @@ NIC="0"
 # (me network server server-addr
 # wrong addresses.
 
-# qemu is the default
-me=10.0.2.15
-mask=255.255.255.0
-# brho: i don't know what exactly 'remote' is supposed to be, but that is
-# the third argument processed by adding to an ipifc.  if we pass nothing,
-# it'll build 'remote' by masking me & mask.
-remote=10.0.2.0
-route=10.0.2.2
-
-if [ "$MAC" = "$qemuMAC" ]
-then
-    echo "Welcome to QEMU!"
-fi
-
-# the tower of ... tower
-# all defaults are fine.
-if [ "$MAC" = "$tower1MAC" ]
-then
-    me=10.0.2.15
-fi
-if [ "$MAC" = "$tower2MAC" ]
-then
-    me=10.0.2.16
-fi
-if [ "$MAC" = "$tower3MAC" ]
-then
-    me=10.0.2.17
-fi
-if [ "$MAC" = "$tower4MAC" ]
-then
-    me=10.0.2.18
-fi
-if [ "$MAC" = "$tower5MAC" ]
-then
-    me=10.0.2.19
-fi
-
-if [ "$MAC" = "$c89MAC" ]
+if [ -f '/etc/network/default' ]
 then
-       # c89's config.  use c96 for eth0 (.196).
-       # $ cat /9/net/ipifc/clone (get e.g. 2)
-       # $ echo "add 169.229.49.196 255.255.255.0" > /9/net/ipifc/2/ctl
-       me=169.229.49.196
-       mask=255.255.255.0
-       remote=169.229.49.0
-       route=169.229.49.1
-       # the i350 NIC that is plugged in is the first NIC
-       NIC="0"
+       source /etc/network/default
+else
+       echo '/etc/network/default not found'
 fi
 
-if [ "$MAC" = "$c99MAC" ]
+if [ -f '/etc/network/local' ]
 then
-       # c99's config.  use c95 for eth0 (.195).
-       # $ cat /9/net/ipifc/clone (get e.g. 2)
-       # $ echo "add 169.229.49.195 255.255.255.0" > /9/net/ipifc/2/ctl
-       me=169.229.49.195
-       mask=255.255.255.0
-       remote=169.229.49.0
-       route=169.229.49.1
-       # the i350 NIC that is plugged in is the first NIC
-       NIC="0"
+       source /etc/network/local
+else
+       echo '/etc/network/local not found'
 fi
 
-if [ "$MAC" = "$altdraMAC" ]
+if [ -d '/etc/network/local.d' ]
 then
-       # yuzhu's soda hall bridged vm
-       me=128.32.37.37
-       mask=255.255.255.0
-       remote=128.32.37.0
-       route=128.32.37.1
+       for cfg in /etc/network/local.d/*
+       do
+               source $cfg
+       done
+else
+       echo '/etc/network/local.d not found'
 fi
 
-if [ "$MAC" = "$hossinMAC" ]
-then
-       # brho's soda hall desktop
-       me=128.32.37.46
-       mask=255.255.255.0
-       remote=128.32.37.0
-       route=128.32.37.1
-fi
 #
 # Post the read-only filesystem in #s/$beetroot
 # and mount it on /boot so the commands in /boot/$cputype/bin
@@ -132,6 +64,7 @@ fi
 #/boot/paqfs -p -S $beetroot -m /boot -q /boot/$beetroot
 #cd /boot/$cputype/bin
 bind -b '#cons' /dev
+bind -b '#random' /dev
 #bind '#d' /fd
 #bind -c '#e' /env
 bind -b '#proc' /proc