]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/grub.erb
Don't check disks in SLEEP or STANDBY mode
[chef.git] / cookbooks / hardware / templates / default / grub.erb
index 49343e9b02c46c691de7bf5a8137b4f3132ceac2..305a5b0b0bdda433ceac4f6c20904687d082cac6 100644 (file)
@@ -1,7 +1,8 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
-# Boot the first entry by default
-GRUB_DEFAULT="0"
+# Boot the first entry by default, unless we have configured
+# it to boot a specific version.
+GRUB_DEFAULT="<%= @entry %>"
 
 # Wait two seconds before booting the default entry
 GRUB_TIMEOUT="2"
@@ -14,27 +15,25 @@ GRUB_HIDDEN_TIMEOUT_QUIET="true"
 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
 
 # Arguments to add to the kernel command line (all entries)
-<% if @unit.nil? -%>
-GRUB_CMDLINE_LINUX="nomodeset"
+<% if @units.nil? -%>
+GRUB_CMDLINE_LINUX="<%= node[:hardware][:grub][:cmdline].join(" ") %>"
 <% else -%>
-GRUB_CMDLINE_LINUX="console=tty0 console=ttyS<%= @unit %>,115200n8 nomodeset"
+GRUB_CMDLINE_LINUX="console=tty0 <%= @units.sort.uniq.collect { |unit| "console=ttyS#{unit},115200n8" }.join(" ") %> <%= node[:hardware][:grub][:cmdline].join(" ") %>"
 <% end -%>
 
 # Arguments to add to the kernel command line (except recovery entries)
-GRUB_CMDLINE_LINUX_DEFAULT=""
+GRUB_CMDLINE_LINUX_DEFAULT="panic=30"
 
-<% if @unit.nil? -%>
+# Do not wait for infinite time on a failed boot
+GRUB_RECORDFAIL_TIMEOUT=2
+
+<% if @units.nil? -%>
 # Send console output to the screen
 GRUB_TERMINAL="console"
 <% else -%>
-<% if node[:lsb][:release].to_f >= 12.04 -%>
 # Send console output to the screen and serial port
 GRUB_TERMINAL="console serial"
-<% else -%>
-# Send console output to the serial port
-GRUB_TERMINAL="serial"
-<% end -%>
 
 # Configure the serial console
-GRUB_SERIAL_COMMAND="serial --speed=<%= @speed %> --unit=<%= @unit %> --word=8 --parity=no --stop=1"
+GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=<%= @units.first %> --word=8 --parity=no --stop=1"
 <% end -%>