wok-current view busybox/stuff/init @ rev 1770
busybox udhcpc/zcip: call /etc/ip*.d scripts
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Nov 26 18:02:56 2008 +0000 (2008-11-26) |
parents | 8c3c67c64f26 |
children | 497da1516e30 |
line source
1 #!/bin/sh
3 echo -n "switching / to tmpfs..."
4 mount -t proc proc /proc
5 size="$(grep rootfssize= < /proc/cmdline | \
6 sed 's/.*rootfssize=\([0-9]*[kmg%]\).*/-o size=\1/')"
7 umount /proc
8 mount -t tmpfs $size tmpfs /mnt
9 for i in $(ls -a /); do
10 case "$i" in
11 .|..) ;;
12 mnt) mkdir /mnt/mnt;;
13 *) if ! cp -a /$i /mnt 2> /dev/null; then
14 echo -e "\\033[70G[ \\033[1;31mFailed\\033[0;39m ]"
15 umount /mnt
16 exec /sbin/init
17 fi;;
18 esac
19 done
20 echo -e "\\033[70G[ \\033[1;33mOK\\033[0;39m ]"
21 exec /sbin/switch_root mnt /sbin/init