Revision 91767b54 example/instance-image.d/grub
b/example/instance-image.d/grub | ||
---|---|---|
74 | 74 |
quit |
75 | 75 |
EOF |
76 | 76 |
|
77 |
# setup serial console |
|
78 |
if [ "${INSTANCE_HV_serial_console}" = "True" ] ; then |
|
79 |
boot_dir="${TARGET}/boot/grub" |
|
80 |
if [ -e "${boot_dir}/menu.lst" ] ; then |
|
81 |
# Grub 0.x |
|
82 |
sed -ie 's/^default.*/default 0\n\nserial --unit=0\nterminal --timeout=3 console serial/' \ |
|
83 |
${boot_dir}/menu.lst |
|
84 |
elif [ -e "${boot_dir}/grub.cfg" ] ; then |
|
85 |
# Grub 2.x |
|
86 |
sed -ie 's/.*GRUB_TERMINAL.*/GRUB_TERMINAL=serial/' ${boot_dir}/grub.cfg |
|
87 |
echo "GRUB_SERIAL_COMMAND=\"serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\"" \ |
|
88 |
>> ${boot_dir}/grub.cfg |
|
89 |
else |
|
90 |
echo "No grub bootloader found, skipping..." |
|
91 |
fi |
|
92 |
fi |
|
93 |
|
|
77 | 94 |
# execute cleanups |
78 | 95 |
cleanup |
79 | 96 |
trap - EXIT |
Also available in: Unified diff