]> git.ipfire.org Git - thirdparty/dracut.git/commit
99base/init: honor env. vars provided by kernel (PATH, HOME and TERM)
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Sat, 25 Sep 2010 22:06:54 +0000 (00:06 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 1 Oct 2010 09:38:14 +0000 (11:38 +0200)
commit4bacdf2811fc80cb8f7f6344dedc9d41a7523f73
tree2891613f7e5f747883f0de1d4900ec0bb4da015c
parent94388aaffa5ddfb65b6fa5832dc96e0c3681ab32
99base/init: honor env. vars provided by kernel (PATH, HOME and TERM)

Let take a look at Linux sources, /usr/src/linux-2.6.35/init/main.c:

  204: char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };

  857: run_init_process("/sbin/init");

  817: static void run_init_process(char *init_filename)
  818: {
  819:        argv_init[0] = init_filename;
  820:        kernel_execve(init_filename, argv_init, envp_init);
  821: }

As we can see HOME=/ and TERM=linux are provided for init and this might be
expected on some systems (Gentoo comes to my mind, here ;-)).  That's why we
should give to init the same set of env. vars as Linux kernel does.
modules.d/99base/init