public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Boldi <a1426z@gawab.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com
Subject: Re: [PATCH] init: Introduce rootdir bootparm to select which dir to sys_chroot
Date: Fri, 9 Nov 2007 07:57:10 +0300	[thread overview]
Message-ID: <200711090757.10190.a1426z@gawab.com> (raw)
In-Reply-To: <20071108203618.99741428.akpm@linux-foundation.org>

Andrew Morton wrote:
> > On Tue, 6 Nov 2007 13:40:26 +0300 Al Boldi <a1426z@gawab.com> wrote:
> >
> > This patch introduces a rootdir kernel boot parameter, which specifies
> > the path to the kernel sys_chroot boot dir.
> >
> > This is useful for systems that have more than one distribution
> > installed on the same fs/partition.
> >
> >
> > Cc: H. Peter Anvin <hpa@zytor.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Al Boldi <a1426z@gawab.com>
> >
> > ---
> >
> > --- a/init/do_mounts.c
> > +++ b/init/do_mounts.c
> > @@ -252,6 +252,15 @@ __setup("rootflags=", root_data_setup);
> >  __setup("rootfstype=", fs_names_setup);
> >  __setup("rootdelay=", root_delay_setup);
> >
> > +static char * __initdata root_dir;
> > +static int __init root_dir_setup(char *str)
> > +{
> > +	root_dir = strcat("./",str);
> > +	return 1;
> > +}
> > +
> > +__setup("rootdir=", root_dir_setup);
>
> Please update Documentation/kernel-parameters.txt when adding __setup
> options.

Sure.

If you think this feature is useful, which I think it is, then I probably 
need to resend with a doc update.  But bare in mind, this patch needs 
something like small hack to allow remounting root, which currently isn't 
possible.  I'm sure hpa is probably the genius to help out here.

>
> >  static void __init get_fs_names(char *page)
> >  {
> >  	char *s = page;
> > @@ -469,6 +478,10 @@ void __init prepare_namespace(void)
> >  	mount_root();
> >  out:
> >  	sys_mount(".", "/", NULL, MS_MOVE, NULL);
> > +
> > +	if(root_dir)
> > +		sys_chdir(root_dir);
> > +
>
> Please run scripts/checkpatch.pl across all patches before sending them to
> anyone.

Ok.


Thanks!

--
Al


      reply	other threads:[~2007-11-09  4:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 10:40 [PATCH] init: Introduce rootdir bootparm to select which dir to sys_chroot Al Boldi
2007-11-07 20:10 ` Al Boldi
2007-11-06 20:13   ` H. Peter Anvin
2007-11-07 21:13     ` Al Boldi
2007-11-06 21:25       ` H. Peter Anvin
2007-11-09  4:36 ` Andrew Morton
2007-11-09  4:57   ` Al Boldi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711090757.10190.a1426z@gawab.com \
    --to=a1426z@gawab.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox