add block-extroot, a package for using an external filesystem as rootfs (patch by...
[openwrt/svn-archive/archive.git] / package / block-extroot / files / 60_pivot_usb_root
1 #!/bin/sh
2 # Copyright (C) 2010 Vertical Communications
3
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 # Determine if we are requested to mount external root
8
9 external_root_pivot() {
10 check_skip || [ "$pi_extroot_mount_success" != "true" ] || {
11 echo "switching to external rootfs"
12 if [ "$ER_IS_SQUASHFS" = "true" ]; then
13 umount /jffs
14 fi
15 mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true
16 }
17 }
18
19 boot_hook_add preinit_mount_root external_root_pivot
20