UNICODE ioctls on background console

From: Andrey Borzenkov
Date: Fri Jan 02 2004 - 14:47:05 EST


Why are those ioctls forcibly applied to foreground console only? This makes
--tty option for consolechars non-functional and prevents console
initialization (for non-ASCII charsets) as part of system startup (or as part
of getty) because it works only when called on currently active console.

I'm running with the following patch without any ill effects nor can I see any
harm looking in code.

Any reason it cannot be applied?

regards

-andrey
--- ../tmp/linux-2.6.0/drivers/char/vt_ioctl.c 2003-12-18 05:59:06.000000000 +0300
+++ linux-2.6.0/drivers/char/vt_ioctl.c 2004-01-02 18:38:38.000000000 +0300
@@ -332,7 +332,7 @@ do_fontx_ioctl(int cmd, struct consolefo
}

static inline int
-do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm)
+do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm, unsigned int console)
{
struct unimapdesc tmp;
int i = 0;
@@ -348,9 +348,9 @@ do_unimap_ioctl(int cmd, struct unimapde
case PIO_UNIMAP:
if (!perm)
return -EPERM;
- return con_set_unimap(fg_console, tmp.entry_ct, tmp.entries);
+ return con_set_unimap(console, tmp.entry_ct, tmp.entries);
case GIO_UNIMAP:
- return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries);
+ return con_get_unimap(console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries);
}
return 0;
}
@@ -966,13 +966,13 @@ int vt_ioctl(struct tty_struct *tty, str
return -EPERM;
i = copy_from_user(&ui, (void *)arg, sizeof(struct unimapinit));
if (i) return -EFAULT;
- con_clear_unimap(fg_console, &ui);
+ con_clear_unimap(console, &ui);
return 0;
}

case PIO_UNIMAP:
case GIO_UNIMAP:
- return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm);
+ return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm, console);

case VT_LOCKSWITCH:
if (!capable(CAP_SYS_TTY_CONFIG))