60_pivot_usb_root 802 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. # Copyright (C) 2010 Vertical Communications
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. # Determine if we are requested to mount external root
  6. external_root_pivot() {
  7. check_skip || [ "$pi_extroot_mount_success" != "true" ] || {
  8. echo "switching to external rootfs"
  9. if [ "$ER_OVERLAY_ROM" = "/overlay" ]; then
  10. if [ "$ER_IS_SQUASHFS" = "true" ]; then
  11. umount /tmp/overlay
  12. fi
  13. mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true
  14. elif [ "$ER_OVERLAY_ROM" = "/rom" ]; then
  15. if [ "$ER_IS_SQUASHFS" = "true" ]; then
  16. umount /tmp/overlay
  17. fi
  18. mount -o remount,ro / && pivot_rom /rom /rom && pi_mount_skip_next=true
  19. fi
  20. }
  21. }
  22. boot_hook_add preinit_mount_root external_root_pivot