Commit 217b4acd authored by Mike Hibler's avatar Mike Hibler

MFS stuff: fix console setting for grub2, spell bootdisk_bios_id correctly.

parent c9789904
...@@ -995,22 +995,26 @@ dolinux() { ...@@ -995,22 +995,26 @@ dolinux() {
# grub1 # grub1
if grep -q '^[^#].*root (hd[0-9],[0-9])' $tgconf 2>/dev/null; then if grep -q '^[^#].*root (hd[0-9],[0-9])' $tgconf 2>/dev/null; then
echo " fixing grub1 root" echo " setting grub1 root to (hd${gdisk},${gpart})"
sed -i '' -e "s;root (hd[0-9],[0-9]);root (hd${gdisk},${gpart});" $tgconf sed -i '' -e "s;root (hd[0-9],[0-9]);root (hd${gdisk},${gpart});" $tgconf
fi fi
# grub2 (note 'part' and not 'gpart'; no -1 in grub2) # grub2 (note 'part' and not 'gpart'; no -1 in grub2)
if grep -q "^[^#].*set root='(hd[0-9],[^)]*)'" $tgconf 2>/dev/null; then if grep -q "^[^#].*set root='(hd[0-9],[^)]*)'" $tgconf 2>/dev/null; then
echo " fixing grub2 root" echo " setting grub2 root to (hd${gdisk},${part})"
sed -i '' -e "s;set root='(hd[0-9],[^)]*)';set root='(hd${gdisk},${part})';" $tgconf sed -i '' -e "s;set root='(hd[0-9],[^)]*)';set root='(hd${gdisk},${part})';" $tgconf
fi fi
# #
# Console. # Console.
# For vid or null, comment out terminal/serial lines. # For vid or null, comment out terminal/serial lines and
# fix up any terminal_{input,output} lines (for grub2).
#
# For sio[1-3], add: # For sio[1-3], add:
# terminal --dumb --timeout=0 serial console
# serial --unit=N --speed=S # serial --unit=N --speed=S
# terminal --dumb --timeout=0 serial console # grub1
# terminal_input serial # grub2
# terminal_output serial # grub2
# #
echo " setting console to $CONSOLE" echo " setting console to $CONSOLE"
case $CONSOLE in case $CONSOLE in
...@@ -1020,10 +1024,19 @@ dolinux() { ...@@ -1020,10 +1024,19 @@ dolinux() {
sed -i '' -e 's;^serial;#serial;' $tgconf sed -i '' -e 's;^serial;#serial;' $tgconf
fi fi
# make sure the "terminal" line is correct # make sure the "terminal" line is correct
if grep -q '^terminal' $tgconf 2>/dev/null; then if grep -q '^terminal ' $tgconf 2>/dev/null; then
tstr="terminal --timeout=5 console" tstr="terminal --timeout=5 console"
sed -i '' -e "s;^terminal.*;$tstr;" $tgconf sed -i '' -e "s;^terminal.*;$tstr;" $tgconf
fi fi
# or terminal_{input,output} for grub2
if grep -q '^terminal_input' $tgconf 2>/dev/null; then
tstr="terminal_input console"
sed -i '' -e "s;^terminal_input.*;$tstr;" $tgconf
fi
if grep -q '^terminal_output' $tgconf 2>/dev/null; then
tstr="terminal_output console"
sed -i '' -e "s;^terminal_output.*;$tstr;" $tgconf
fi
# and fixup kernel/initrd command lines # and fixup kernel/initrd command lines
if grep -q 'console=tty0 ' $tgconf 2>/dev/null; then if grep -q 'console=tty0 ' $tgconf 2>/dev/null; then
# already have console=tty0, get rid of any console=ttyS? clauses # already have console=tty0, get rid of any console=ttyS? clauses
...@@ -1058,10 +1071,19 @@ dolinux() { ...@@ -1058,10 +1071,19 @@ dolinux() {
sed -E -i '' -e "s;^#?serial.*;$sstr;" $tgconf sed -E -i '' -e "s;^#?serial.*;$sstr;" $tgconf
fi fi
# make sure the "terminal" line is correct # make sure the "terminal" line is correct
if grep -q '^terminal' $tgconf 2>/dev/null; then if grep -q '^terminal ' $tgconf 2>/dev/null; then
tstr="terminal --dumb --timeout=0 serial console" tstr="terminal --dumb --timeout=0 serial console"
sed -i '' -e "s;^terminal.*;$tstr;" $tgconf sed -i '' -e "s;^terminal.*;$tstr;" $tgconf
fi fi
# or terminal_{input,output} for grub2
if grep -q '^terminal_input' $tgconf 2>/dev/null; then
tstr="terminal_input serial"
sed -i '' -e "s;^terminal_input.*;$tstr;" $tgconf
fi
if grep -q '^terminal_output' $tgconf 2>/dev/null; then
tstr="terminal_output serial"
sed -i '' -e "s;^terminal_output.*;$tstr;" $tgconf
fi
# and fixup kernel/initrd command lines # and fixup kernel/initrd command lines
if grep -q "console=ttyS[^ ]" $tgconf 2>/dev/null; then if grep -q "console=ttyS[^ ]" $tgconf 2>/dev/null; then
# already have console=ttyS?, make sure it is correct # already have console=ttyS?, make sure it is correct
......
...@@ -5150,7 +5150,7 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -5150,7 +5150,7 @@ COMMAND_PROTOTYPE(doloadinfo)
if (strcmp(row2[0], "bootdisk_unit") == 0) { if (strcmp(row2[0], "bootdisk_unit") == 0) {
disknum = atoi(attrstr); disknum = atoi(attrstr);
} }
if (strcmp(row2[0], "bootdisk_biod_id") == 0) { if (strcmp(row2[0], "bootdisk_bios_id") == 0) {
biosdisknum = strtol(attrstr, 0, 0); biosdisknum = strtol(attrstr, 0, 0);
} }
else if (strcmp(row2[0], "disktype") == 0) { else if (strcmp(row2[0], "disktype") == 0) {
...@@ -10880,5 +10880,3 @@ COMMAND_PROTOTYPE(dodisks) ...@@ -10880,5 +10880,3 @@ COMMAND_PROTOTYPE(dodisks)
} }
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment