diff options
author | Daniel Dickinson <daniel@cshore.neomailbox.net> | 2011-03-27 06:40:51 +0000 |
---|---|---|
committer | Daniel Dickinson <daniel@cshore.neomailbox.net> | 2011-03-27 06:40:51 +0000 |
commit | 012ea4a5a39c8d59c599e7753727950fa5f83809 (patch) | |
tree | d29172975565825b660caeecebf697d1404fac1e /package/block-mount/files/60_pivot_usb_root | |
parent | 116c7cd9bea08f3b6695f7855e04eec2d6c34083 (diff) | |
download | master-187ad058-012ea4a5a39c8d59c599e7753727950fa5f83809.tar.gz master-187ad058-012ea4a5a39c8d59c599e7753727950fa5f83809.tar.bz2 master-187ad058-012ea4a5a39c8d59c599e7753727950fa5f83809.zip |
[package] block-mount: Merged block-mount, block-extroot, and block-hotplug into a single binary package called block-mount.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26314 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/block-mount/files/60_pivot_usb_root')
-rw-r--r-- | package/block-mount/files/60_pivot_usb_root | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/package/block-mount/files/60_pivot_usb_root b/package/block-mount/files/60_pivot_usb_root new file mode 100644 index 0000000000..b610a4ade1 --- /dev/null +++ b/package/block-mount/files/60_pivot_usb_root @@ -0,0 +1,27 @@ +#!/bin/sh +# Copyright (C) 2010 Vertical Communications + +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +# Determine if we are requested to mount external root + +external_root_pivot() { + check_skip || [ "$pi_extroot_mount_success" != "true" ] || { + echo "switching to external rootfs" + if [ "$ER_OVERLAY_ROM" = "/overlay" ]; then + if [ "$ER_IS_SQUASHFS" = "true" ]; then + umount /tmp/overlay + fi + mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true + elif [ "$ER_OVERLAY_ROM" = "/rom" ]; then + if [ "$ER_IS_SQUASHFS" = "true" ]; then + umount /tmp/overlay + fi + mount -o remount,ro / && pivot_rom /rom /rom && pi_mount_skip_next=true + fi + } +} + +boot_hook_add preinit_mount_root external_root_pivot + |