linux-um archives
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Rob Landley <rob@landley.net>, Jeff Dike <jdike@addtoit.com>
Subject: Re: [uml-devel] Triage on the pending patches
Date: Sat, 5 Mar 2005 16:57:59 +0100	[thread overview]
Message-ID: <200503051657.59188.blaisorblade@yahoo.it> (raw)
In-Reply-To: <200503032111.43966.rob@landley.net>

On Friday 04 March 2005 03:11, Rob Landley wrote:
> On Thursday 03 March 2005 01:43 pm, Jeff Dike wrote:
> > rob@landley.net said:
> > > Well, just in case your job was too easy, here's one more.  Using the
> > > "quiet" option shows a couple of lines being printed out by printf
> > > that should be printed out by printk (so they'll _shut_up_ when you
> > > ask it to).
> >
> > Those are printfs for a reason.  Early boot mesages (before the kernel is
> > actually running) won't be seen if they are printk-d and the thing
> > crashes before the console is initialized.  The messages will be stuck in
> > the printk buffer, and you will be none the wiser.
>
> I suspected there was a reason, nice to know what it is.  It would be nice
> if they could be made quiet, because I'm in the process of doing a gross
> hack to run an independent process wrapped in UML.

> Basically, my nefarious scheme is to add the squashfs patch to UML, append
> a squashfs image to the end of the  UML executable, and have a cpio ramfs
> init script search through /proc/self/exe for the 32 bytes that were at the
> start of the squashfs (which includes a 4 byte magic signature thingy) to
> determine offset to pass to "losetup -o $OFFSET /dev/loop0 /proc/self/exe",
> and then mount /dev/loop0 / and run the executable I want out of that
> filesystem.
First, compliments.... we need such stuff going.

Please note that unless I'm mistaken the above scheme does not work 
since /proc/self/exe contains what you want on the host, not on the guest. If 
you use hostfs then it's ok, otherwise you'll have to pack the squashfs 
within the cpio image (if it's possible, the cpio image could not be ready to 
cope with so much data). Also, made sure adding stuff at the end of an exec. 
file is accepted without problems? Seems reasonable but not obvious.

No experience with such stuff, but isn't it a bit risky this way (a signature 
being there by mistake)? If you still go for grepping the exec. image, I 
would add a header in the end giving the size of the squashfs image, and 
parse it. With the -s option to losetup you can cut at the end the area 
seeing by the loop device.
> And there's a cheap and dirty way to get a self contained program running
> under UML.  (I hope to actually have an example working this evening using
> 2.6.11.)

> >
> > So, they can be made quiet if you really want, but that's not the way.
> The down side is that UML (even with the quiet option) just won't shut up
> about its init stuff.  Hence me looking into cleaning that up...
Add early_printk which is a printf but shuts down when the quiet option is 
used.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2005-03-05 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-03  8:22 [uml-devel] Triage on the pending patches Jeff Dike
2005-03-03  5:08 ` Rob Landley
2005-03-03 18:43   ` Jeff Dike
2005-03-04  2:11     ` Rob Landley
2005-03-05 15:57       ` Blaisorblade [this message]
2005-03-06 19:59         ` Rob Landley

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=200503051657.59188.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=jdike@addtoit.com \
    --cc=rob@landley.net \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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