Want more features on Pastebin? Sign Up, it's FREE!
Guest

Neufbox4 3.1.10 /etc/preinit

By: a guest on Mar 1st, 2012  |  syntax: Bash  |  size: 0.73 KB  |  views: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. tmpfs_union () {
  4.         echo "tmp union..."
  5.         mount tmpfs /tmp -t tmpfs -o size=10M,nosuid,nodev,mode=1777
  6. }
  7.  
  8. usbfs_union () {
  9.         echo "usb union..."
  10.         for module in usbcore uhci ohci_hcd ehci_hcd scsi_mod sd_mod usb-storage jbd ext3 ext2; do {
  11.                 insmod $module
  12.         }; done
  13.  
  14.         sleep 10
  15.         mount /dev/sda1 /tmp || tmpfs_union
  16. }
  17.  
  18. mount proc /proc -t proc
  19. mount sysfs /sys -t sysfs
  20.  
  21. echo "- pre init -"
  22.  
  23. usb-boot && usbfs_union || tmpfs_union
  24.  
  25. mkdir -p /tmp/sto
  26. mount -t mini_fo -o base=/,sto=/tmp/sto / /root
  27. cd /root
  28. pivot_root . rom
  29. mount -o move /rom/proc /proc 2>&-
  30. mount -o move /rom/sys /sys 2>&-
  31. [ -n "`grep "/dev/sda1" /proc/mounts`" ] && mount tmpfs /tmp -t tmpfs
  32.  
  33. echo "- init -"
  34. exec /usr/sbin/chroot . /sbin/init
clone this paste RAW Paste Data