extmount.sh 841 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. # Copyright 2010 Vertical Communications
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. determine_root_device() {
  6. root_device="$(mount | grep ' / ' | cut -f1 -d\ | grep -v rootfs )"
  7. }
  8. set_jffs_mp() {
  9. jffs="$(awk '/jffs2/ {print $2}' /proc/mounts)"
  10. }
  11. er_load_modules() {
  12. mkdir -p /tmp/extroot_modules/modules.d
  13. mkdir -p /tmp/extroot_modules/modules
  14. ln -sf /etc/modules.d/* /tmp/overlay/etc/modules.d/* /tmp/extroot_modules/modules.d
  15. ln -sf /lib/modules/*/* /tmp/overlay/lib/modules/*/* /tmp/extroot_modules/modules
  16. local modules="$(grep -l '# May be required for rootfs' /tmp/extroot_modules/modules.d/*)"
  17. cd /tmp/extroot_modules/modules && {
  18. cat $modules | sed -e 's/^\([^#].*\)/insmod \.\/\1.ko/'| sh 2>&- || :
  19. }
  20. rm -rf /tmp/extroot_modules
  21. }