Monday, July 25, 2005

[I18N]environment variable priority

In which language will your application's interface will be displayed?
It depends on the following environment variables with decreasing priority:
  1. LANGUAGE
  2. LC_ALL
  3. LC_xxx
  4. LANG
PS: another environment variable related to I18N is "LINGUAS". Its value is a space separated list of language code, e.g. "en", "zh_CN". When building an application, this value determines which locale's mo file will be built.

Monday, July 04, 2005

[Kernel] Suspend2 add a member to struct kthread_create_info

As a consequence, all functions related to it now have a new parameter-freezer_flag, as shown in the source code(include header files)

I discovered this when emerging ipw2200 this morning. I failed to emerge it at first.

I am using 2.6.11-nitro0 which was patched with suspend2. However I don't have it compiled in the kernel.

In ipw2200.c, there is a conditional compilation. It will check whether your kernel configuration file has CONFIG_SOFTWARE_SUSPEND2 defined. If yes, it will use with-freezer_flag version of create_workqueue(). Otherwise, it use the vanilla version, ie. the one without freezer_flag.

Apparently, now my kernel configuration file don't have CONFIG_SOFTWARE_SUSPEND2 defined. So when compiling ipw2200.c, the vallia version of create_workqueue() will be used. However header file "include/linux/workqueue.h" is now patched, so gcc will not find the vanilla version of create_workqueue() in it. That's why the compilation would fail.

The solution is easy, just cheat gcc by defining CONFIG_SOFTWARE_SUSPEND2, no need to recompile the kernel.

In a patched kernel source, the struct kthread_create_info should look like:

struct kthread_create_info
{
/* Information passed to kthread() from keventd. */
int (*threadfn)(void *data);
void *data;
unsigned long freezer_flags;
struct completion started;

/* Result passed back to kthread_create() from keventd. */
struct task_struct *result;
struct completion done;
};

Sunday, July 03, 2005

[Apps] wget using http proxy


$ export http_proxy="http://61.150.115.245:8080"
$ wget whatever


the environment variable "http_proxy" should be in lower case