Skip to contentSkip to conversation

terminal is not set back to console

PATCH In review Robert Millan 3 participants 8 messages May 3, 2007 – May 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 terminal is not set back to console

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.

2007-05-03 Robert Millan <[email protected]>

* term/i386/pc/console.c (grub_console_fini): Call grub_term_set_current() before grub_term_unregister().

Index: term/i386/pc/console.c
===================================================================
RCS file: /sources/grub/grub2/term/i386/pc/console.c,v retrieving revision 1.7

i386/pc/console.c +1 -0
diff -u -r1.7 console.c
@@ -148,5 +148,6 @@
 void
 grub_console_fini (void)
 {
+  grub_term_set_current (&grub_console_term);
   grub_term_unregister (&grub_console_term);
 }
#1 lore raw
Quoted 7 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Btw, should other platforms do the same?

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#2 lore raw
Quoted 9 lines · Robert Millan
Quoted 6 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Btw, should other platforms do the same?

Do you mean other terminals? Generally, yes. If you don' have any good reason, it is always nice to reset states to the original.

Okuji

#3 lore raw
Quoted 6 lines · Yoshinori K. Okuji
Quoted 5 lines · Robert Millan
Quoted 4 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Btw, should other platforms do the same?

Do you mean other terminals? Generally, yes. If you don' have any good reason, it is always nice to reset states to the original.

No, I really mean other platforms (i386/efi, etc). My patch sets console as the default terminal when unloading it. It doesn't set state back to what it was before loading console. If other terminals did the same, results would be undefined.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#4 lore raw
In reply to Robert Millan
Quoted 6 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Yes, this is good.

Thanks,
Okuji

#5 lore raw
In reply to Robert Millan
Quoted 6 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Feel free to apply this patch.

--
Marco

#6 lore raw
Quoted 10 lines · Marco Gerards
Quoted 6 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Feel free to apply this patch.

Ok, if you insist..

Committed. I've left the other platforms untouched since I'm not familiar about them. Maybe that needs to be reviewed.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
#7 lore raw
Quoted 10 lines · Robert Millan
Quoted 9 lines · Marco Gerards
Quoted 6 lines · Robert Millan

When using gfxterm, and booting a kernel in this mode, Linux won't be able to print anything to the console. This patch fixes it so that terminal is set back to normal console during deinitialisation.

Tested and known to work, although I'm not 1:1 sure if this is the right place to do it.

Quoted 6 lines
Quoted 1 line

Feel free to apply this patch.

Ok, if you insist..

Committed. I've left the other platforms untouched since I'm not familiar about them. Maybe that needs to be reviewed.

If you want to fix those, please do. But it is not that important. The other platforms don't have multiple terminals so can't trigger this problem. Yet...

--
Marco