Idunn is an small system aiming to give an early rescue/install environment with ssh support, making life easier when one doesn't have physical access to machine.
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.

128 lines
2.7 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: target/idunn/initramfs/etc_rc.d_rc.sysinit.sh
  6. # Copyright (C) 2008 The OpenSDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. . /etc/rc.d/functions.in
  16. banner "I am Idunn, take an apple and live forever."
  17. # keep the console clean
  18. if [ -x /bin/dmesg ]; then
  19. dmesg -n 3
  20. dmesg > /var/log/boot.log
  21. fi
  22. title "Mounting special filesystems"
  23. check mount -n -t proc proc /proc
  24. check mount -n -t sysfs sysfs /sys
  25. check mount -n -t tmpfs tmp /tmp
  26. status
  27. title "Preparing /dev"
  28. check mount -n -t tmpfs udev /dev
  29. check mkdir /dev/pts
  30. check mount -n -t devpts devpts /dev/pts
  31. check cp -a /lib/udev/devices/* /dev
  32. status
  33. title "Starting supervisor"
  34. check start-stop-daemon -S -b -x /usr/bin/runsvdir -- /var/service/
  35. status
  36. # assuming the network module is built-in, start it earlier
  37. for x in $(unet pending); do
  38. title "Starting network (interface:$x)"
  39. check unet $x up
  40. status
  41. done
  42. # wait for udev
  43. while [ ! -d /dev/.udev/ ]; do
  44. sleep 1;
  45. done
  46. # load/blacklist modules
  47. if [ -x /sbin/modprobe -a -n "$modules" ]; then
  48. title "Preloading requested kernel modules"
  49. for x in $(echo "$modules" | tr ':' ' '); do
  50. if expr "$x" : - > /dev/null; then
  51. echo "blacklist ${x#-}" >> /etc/modprobe.conf
  52. else
  53. check modprobe $(echo "$x" | tr ',' ' ')
  54. fi
  55. done
  56. status
  57. fi
  58. force_shell=
  59. use_lvm=
  60. use_mdadm=
  61. if [ -n "$idunn" ]; then
  62. for x in $(echo "$idunn" | tr ':' ' '); do
  63. case "$x" in
  64. *=*) y="${x#*=}"
  65. x="${x%%=*}"
  66. ;;
  67. no*) x="${x#no}"
  68. y="no"
  69. ;;
  70. *) y="yes"
  71. ;;
  72. esac
  73. case "$x" in
  74. shell) force_shell=$y ;;
  75. lvm|mdadm) eval use_${x}=$y ;;
  76. esac
  77. done
  78. fi
  79. title "Triggering coldplug"
  80. check udevtrigger
  81. check udevsettle
  82. status
  83. # and for those which appeared after udevtrigger
  84. for x in $(unet pending); do
  85. title "Starting network (interface:$x)"
  86. check unet $x up
  87. status
  88. done
  89. if [ "$use_mdadm" = "yes" ]; then
  90. title "Detecting RAID volumes"
  91. check mdadm -Esv > /etc/mdadm.conf
  92. status
  93. fi
  94. if [ -s /etc/mdadm.conf ]; then
  95. title "Starting RAID volumes"
  96. check mdadm -As
  97. sleep 1
  98. status
  99. fi
  100. if [ "$use_lvm" = "yes" ]; then
  101. title "Detecting LVM volumes"
  102. check vgscan
  103. status
  104. fi
  105. if [ -n "$(ls -1 /etc/lvm/archive/*.vg 2> /dev/null)" ]; then
  106. title "Starting LVM volumes"
  107. modprobe dm-mod
  108. check vgchange -ay
  109. status
  110. fi