mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
773 B

  1. # read root parameter from cmdline
  2. root=$(sed 's/.*\<root=\([^ ]*\).*/\1/' /proc/cmdline)
  3. # set $(< /proc/cmdline ) ; for arg ; do [[ ${arg} == root=* ]] && root=${arg#root=}
  4. if [ ! -e "$root" ]
  5. then
  6. echo "your root <$root> does not exist."
  7. else
  8. # FIXME mount ro if /proc/cmdline says so...
  9. mount $root /real-root
  10. fi
  11. # thanks udevd. you did a great job.
  12. # now go away and let the real system do its work.
  13. echo "terminating udevd..."
  14. killall udevd
  15. sleep 1
  16. rm -rf /dev/.udev
  17. if [ -e /real-root/dev ]
  18. then
  19. mount --move /dev /real-root/dev
  20. mount --move /sys /real-root/sys
  21. mount --move /proc /real-root/proc
  22. else
  23. echo "outch. /real-root/dev does not exist."
  24. fi
  25. echo "going real..."
  26. if [ -x /real-root/sbin/init ]
  27. then
  28. exec /sbin/run_init /real-root /sbin/init
  29. fi