On Friday 04 March 2005 03:11, Rob Landley wrote:
> On Thursday 03 March 2005 01:43 pm, Jeff Dike wrote:
> > [EMAIL PROTECTED] 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 via email to