2 # Copyright (C) 2006-2011 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
8 determine_root_device
() {
9 root_device
="$(mount | grep ' / ' | cut -f1 -d\ | grep -v rootfs )"
13 jffs
="$(awk '/jffs2/ {print $2}' /proc/mounts)"
17 mkdir
-p /tmp
/extroot_modules
/modules.d
18 mkdir
-p /tmp
/extroot_modules
/modules
19 cp -L /etc
/modules-boot.d
/* /tmp
/overlay
/etc
/modules-boot.d
/* /tmp
/extroot_modules
/modules.d
20 ln -sf /lib
/modules
/*/* /tmp
/overlay
/lib
/modules
/*/* /tmp
/extroot_modules
/modules
21 local modules
="$(cat /tmp/extroot_modules/modules.d/* 2>/dev/null)"
22 cd /tmp
/extroot_modules
/modules
&& [ -n "$modules" ] && {
23 echo "$modules" |
sed -e 's/^\([^#].*\)/insmod \.\/\1.ko/'| sh
2>&- ||
:
25 rm -rf /tmp
/extroot_modules
28 pivot_rom
() { # <new_root> <old_root>
29 mount
-o move
/proc
$1/proc
&& \
30 pivot_root
$1 $1$2 && {
31 mount
-o move
$2/dev
/dev
32 mount
-o move
$2/tmp
/tmp
33 mount
-o move
$2/sys
/sys
2>&-
This page took 0.061482 seconds and 5 git commands to generate.