linux-um archives
 help / color / mirror / Atom feed
* Re: [uml-devel] The sickest thing that's been done with UML yet.
  2005-04-13 10:05 [uml-devel] The sickest thing that's been done with UML yet Rob Landley
@ 2005-04-13  7:55 ` Jason Clark
  2005-04-13 15:27 ` jdike
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Clark @ 2005-04-13  7:55 UTC (permalink / raw)
  To: Rob Landley; +Cc: uml-devel

slick


-- 

Jason
When pigs fly, they fly first class.

On Wed, 13 Apr 2005, Rob Landley wrote:

> Remember when I talked about making UML and its root filesystem be one file
> you can just run?  Well, I made one as a proof of concept...
>
> http://www.landley.net/code/firmware/notes.html
>
> You have been warned...
>
> Rob
>
>
> -------------------------------------------------------
> 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
>


-------------------------------------------------------
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

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

* [uml-devel] The sickest thing that's been done with UML yet.
@ 2005-04-13 10:05 Rob Landley
  2005-04-13  7:55 ` Jason Clark
  2005-04-13 15:27 ` jdike
  0 siblings, 2 replies; 4+ messages in thread
From: Rob Landley @ 2005-04-13 10:05 UTC (permalink / raw)
  To: uml-devel

Remember when I talked about making UML and its root filesystem be one file 
you can just run?  Well, I made one as a proof of concept...

http://www.landley.net/code/firmware/notes.html

You have been warned...

Rob


-------------------------------------------------------
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

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

* Re: [uml-devel] The sickest thing that's been done with UML yet.
  2005-04-13 10:05 [uml-devel] The sickest thing that's been done with UML yet Rob Landley
  2005-04-13  7:55 ` Jason Clark
@ 2005-04-13 15:27 ` jdike
  2005-04-13 22:32   ` Rob Landley
  1 sibling, 1 reply; 4+ messages in thread
From: jdike @ 2005-04-13 15:27 UTC (permalink / raw)
  To: Rob Landley; +Cc: uml-devel

On Wed, Apr 13, 2005 at 06:05:43AM -0400, Rob Landley wrote:
> Remember when I talked about making UML and its root filesystem be one file 
> you can just run?  Well, I made one as a proof of concept...
> 
> http://www.landley.net/code/firmware/notes.html

Hehe, nice.  I've been considering doing this with an initramfs.  It sounds
like you're doing something different (I couldn't find a one-or-two line
here's-how-it-works on your page :-).

				Jeff


-------------------------------------------------------
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

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

* Re: [uml-devel] The sickest thing that's been done with UML yet.
  2005-04-13 15:27 ` jdike
@ 2005-04-13 22:32   ` Rob Landley
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Landley @ 2005-04-13 22:32 UTC (permalink / raw)
  To: jdike; +Cc: uml-devel

On Wednesday 13 April 2005 11:27 am, jdike@addtoit.com wrote:
> On Wed, Apr 13, 2005 at 06:05:43AM -0400, Rob Landley wrote:
> > Remember when I talked about making UML and its root filesystem be one
> > file you can just run?  Well, I made one as a proof of concept...
> >
> > http://www.landley.net/code/firmware/notes.html
>
> Hehe, nice.  I've been considering doing this with an initramfs.  It sounds
> like you're doing something different (I couldn't find a one-or-two line
> here's-how-it-works on your page :-).

I _really_ need to update that page.  I've been busy getting the build script 
and source tarball cleaned up for release (possibly even tonight, but don't 
hold your breath)...

How it works: 

It's a squashfs root partition (over 11 of the 13.7 megs), where the initramfs 
script does "mount -t hostfs -o / / /sub", examines sub/proc/self/exe to find 
the running executable, reads bytes 12-15 of that (where I wrote the length 
of the original UML exe; note that the 16 byte elf header ends with 6 bytes 
of padding, I grabbed the last four), and then does an "losetup -o 
$OFFSET /dev/loop0 sub/proc/self/exe", mounts that, pivot_root, and 
exec /bin/sh or /sbin/init or whatever you want...

The reality is slightly more complicated due to details like /proc/self/exe 
being a symlink to an absolute path while hostfs is mounted in a 
subdirectory.  And I had to patch busybox losetup to have a readonly option 
because if losetup tries to open a running executable file read-write it dies 
with a "text file busy" error.  But they weren't too hard to fix.  (Just time 
consuming.)

The main advantage of doing this rather than a huge initramfs is that we don't 
eat so much memory.  The squashfs naturally uses the host file as backing 
store.

P.S.  Hang the UML kernel!  When it comes up, try "mount 
--move /mnt/proc /proc".  Apparently, when rootfs moves and afterwards you 
try to relocate a mount point that's bound under it, something gets very, 
very confused.

Here's the UML options I used:

> make ARCH=um allnoconfig &&
> cat >> .config << EOF &&
> CONFIG_MODE_TT=y
> CONFIG_LD_SCRIPT_STATIC=y
> CONFIG_BINFMT_ELF=y
> CONFIG_HOSTFS=y
> CONFIG_SYSCTL=y
> CONFIG_STDERR_CONSOLE=y
> CONFIG_UNIX98_PTYS=y
> CONFIG_BLK_DEV_LOOP=y
> CONFIG_INITRAMFS_SOURCE="initramfs/initramfs.txt"
> CONFIG_LBD=y
> CONFIG_EXT2_FS=y
> CONFIG_PROC_FS=y
> CONFIG_SQUASHFS=y
> CONFIG_ZLIB_INFLATE=y
> EOF
> yes "" | make ARCH=um oldconfig &&
> make ARCH=um &&
> mv linux .. &&
> cd ..

Yes, tt.  It's portable.

Hopefully this weekend I can get this up and running on my server upstairs, 
and thus get my website moved onto my spiffy 3 megabit (symmetrical!) cable 
modem.  Then it should be a much much faster download.  Right now it's on a 
friend's DSL connection...

Of course to do that, I have to learn about UML network bridging... :)

> 				Jeff

Rob


-------------------------------------------------------
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

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

end of thread, other threads:[~2005-04-13 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-13 10:05 [uml-devel] The sickest thing that's been done with UML yet Rob Landley
2005-04-13  7:55 ` Jason Clark
2005-04-13 15:27 ` jdike
2005-04-13 22:32   ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox