linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2.6.24] chroot= as a new kernel parameter
@ 2008-03-08 14:10 Al Boldi
  2008-03-08 14:28 ` Christian Kujau
  0 siblings, 1 reply; 31+ messages in thread
From: Al Boldi @ 2008-03-08 14:10 UTC (permalink / raw)
  To: linux-kernel

Christian Kujau wrote:
>   On Fri, 7 Mar 2008, devzero@web.de wrote:
> >> * H. Peter Anvin <hpa@zytor.com> wrote:
> >>>       init=/path/to/any/sbin/chroot /newroot /sbin/init
>
> Great, I was looking for something like this myself some time ago!
>
> > wouldn`t it be useful to add a hint to kernel-parameters.txt ?
>
> How about:
>
>         init=           [KNL]
> -                       Format: <full_path>
> +                       Format: <full_path> <options>
>                         Run specified binary instead of /sbin/init as init
> -                       process.
> +                       process. init= is able to take more than one option
> +                       allowing us to do:
> +                       init=/path/to/any/sbin/chroot /newroot /sbin/init
> +                       ...and thus booting into /newroot.

Nice try, but this only works on the surface.  Try remounting root to see what I mean.

Now, for a patch that actually does what we want, try this:

[PATCH][retry-2] init: Introduce rootdir bootparm to select which dir to sys_chroot


Thanks!

--
Al


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: [PATCH 2.6.24] chroot= as a new kernel parameter
@ 2008-03-07 21:04 devzero
  2008-03-07 22:32 ` Christian Kujau
  0 siblings, 1 reply; 31+ messages in thread
From: devzero @ 2008-03-07 21:04 UTC (permalink / raw)
  To: ingo; +Cc: linux-kernel

>* H. Peter Anvin <hpa@zytor.com> wrote:
>
>> It's useless because it's exactly and trivially replaceable with:
>>
>>       init=/path/to/any/sbin/chroot /newroot /sbin/init
>
>ok, i didnt realize that this was possible. Ah ... i see, 
>init/main.c:init_setup() is special and picks the whole boot parameter 
>string up to the end, right? So init= is the only multi-parameter 
>init-parameter.
>
>        Ingo

wouldn`t it be useful to add a hint to kernel-parameters.txt ?


for now it just reads:

        init=           [KNL]
                        Format: <full_path>
                        Run specified binary instead of /sbin/init as init
                        process.

so, if there is no hint about that specialty (i.e. passing params to init, using for chroot etc..), no user will ever now.....

roland
_____________________________________________________________________
Unbegrenzter Speicherplatz für Ihr E-Mail Postfach? Jetzt aktivieren!
http://freemail.web.de/club/landingpage.htm/?mc=025555


^ permalink raw reply	[flat|nested] 31+ messages in thread
* [PATCH 2.6.24] chroot= as a new kernel parameter
@ 2008-03-06  5:01 Pawel Plociennik
  2008-03-06  4:58 ` H. Peter Anvin
  2008-03-06 10:34 ` Chris Wedgwood
  0 siblings, 2 replies; 31+ messages in thread
From: Pawel Plociennik @ 2008-03-06  5:01 UTC (permalink / raw)
  To: Pavel Machek, linux-kernel

Hi Andrew and other *real* hackers,
I have sent a *last* version of a patch which it has added a new kernel parameter chroot=It were discusioned a *long time* on a lkml so I hope that it will has been applied.
Thanks,Pawel 
Acked-by: Pavel Machek <pavel@suse.cz>Signed-off-by: Pawel Plociennik <paplociennik@gmail.com>
---diff -urp linux-2.6.24-orig/Documentation/kernel-parameters.txt linux-2.6.24/Documentation/kernel-parameters.txt--- linux-2.6.24-orig/Documentation/kernel-parameters.txt       2008-02-25 20:53:26.000000000 -0500+++ linux-2.6.24/Documentation/kernel-parameters.txt    2008-03-04 09:51:52.000000000 -0500@@ -381,6 +381,8 @@ and is between 256 and 4096 characters.                         Value can be changed at runtime via                                /selinux/checkreqprot.        +       chroot=         [KNL] change a root for init process.+        clock=          [BUGS=X86-32, HW] gettimeofday clocksource override.                        [Deprecated]                        Forces specified clocksource (if available) to be useddiff -urp linux-2.6.24-orig/init/main.c linux-2.6.24/init/main.c--- linux-2.6.24-orig/init/main.c       2008-03-01 12:58:37.000000000 -0500+++ linux-2.6.24/init/main.c    2008-03-05 15:08:20.000000000 -0500@@ -755,8 +755,20 @@ static void __init do_pre_smp_initcalls(                spawn_softlockup_task(); } +static void *chroot_str;+static int __init chroot_setup(char *str)+{+       chroot_str = str;+       return 1;+}+__setup("chroot=", chroot_setup);+ static void run_init_process(char *init_filename) {+       if (chroot_str)+               if (sys_chroot(chroot_str) < 0)+                       panic("chroot=%s failed\n", chroot_str);+        argv_init[0] = init_filename;        kernel_execve(init_filename, argv_init, envp_init); }ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2008-03-08 16:34 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-08 14:10 [PATCH 2.6.24] chroot= as a new kernel parameter Al Boldi
2008-03-08 14:28 ` Christian Kujau
2008-03-08 16:34   ` Al Boldi
  -- strict thread matches above, loose matches on Subject: below --
2008-03-07 21:04 devzero
2008-03-07 22:32 ` Christian Kujau
2008-03-06  5:01 Pawel Plociennik
2008-03-06  4:58 ` H. Peter Anvin
2008-03-06 10:27   ` Ingo Molnar
2008-03-06 15:17     ` H. Peter Anvin
2008-03-06 20:57       ` Ingo Molnar
2008-03-06 21:05         ` H. Peter Anvin
2008-03-06 21:20       ` Pavel Machek
2008-03-06 21:30         ` H. Peter Anvin
2008-03-06 22:05           ` Matthias Schniedermeyer
2008-03-07 10:36           ` Bernd Petrovitsch
2008-03-07 12:28             ` H. Peter Anvin
2008-03-06 21:42         ` Ingo Molnar
2008-03-06 21:50           ` H. Peter Anvin
2008-03-06 22:22             ` Ingo Molnar
2008-03-07  4:53         ` Greg Schafer
2008-03-07  9:27         ` Måns Rullgård
2008-03-06 16:54     ` Pawel Plociennik
2008-03-06 15:47   ` Pawel Plociennik
2008-03-06 10:34 ` Chris Wedgwood
2008-03-06 10:44   ` Ingo Molnar
2008-03-06 11:22     ` Chris Wedgwood
2008-03-06 11:37       ` Ingo Molnar
2008-03-06 11:53         ` Pavel Machek
2008-03-06 19:46           ` Peter Zijlstra
2008-03-06 20:57             ` Willy Tarreau
2008-03-07  8:23         ` Chris Wedgwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).