[Yaird-devel] Overriding some probing

Erik van Konijnenburg ekonijn at xs4all.nl
Mon Dec 12 22:20:59 UTC 2005


On Mon, Dec 12, 2005 at 08:24:24PM +0100, Sven Luther wrote:
> On Mon, Dec 12, 2005 at 07:23:22PM +0100, Jonas Smedegaard wrote:
> > I am wondering if it would make sense to implement options to yaird
> > making it possible to override some steps.
> > 
> > I want to produce a complete system in a chroot destined to run on
> > different hardware (USB flashdisk and different mainboard) than the
> > current machine.
> > 
> > I imagine yaird supporting --rootdev=/dev/sda and --rootfs=ext3 to
> > avoid /dev/hda from the host system being ananylzed and used, and
> > - --modules=uhci,uhci-hcd,ehci-hcd,usb-storage to add and load (in that
> > order) the modules (and their dependands sd_mod, scsi_mod and usbcore)
> > required for that device to show up in sysfs when booting.
> > 
> > If possible to "disable" probling like this, then perhaps even the
> > problem of no upgrade path from a running 2.4-based system could be
> > solved: A helper tool could use lsmod to produce a bloated but possibly
> > working ramdisk image from a non-sysfs host.
> > 
> > Does it make any sense?
> 
> I think yes. What about a :
> 
>   --sysfs=path/to/copied/sys/tree --proc=path/to/copied/proc/tree

When debugging remotely, I've often wished for a tarball of the target
system to be able to reproduce the issue.   A feature such as this would
also make it possible to set up a decent test suite.

So I'm not opposed to the idea, but there's a lot of places that the
system retrieves information from: /sys and /proc obviously, but also
fstab, crypttab, the output of mdadm and friends.  Doing it right
is not trivial.  Don't hold your breath for this feature unless your
insurance has really good health coverage ...

In the mean time, you should be able to build an image without that feature,
as follows:

* copy Default.cfg and Templates.cfg
* modify Default.cfg to point to your Template.cfg copy.
* add MODULE "uhci", MODULE "uhci-hcd", etc to your Default.cfg.
  this loads the requested modules in order, plus their dependencies,
  plus their modprobe options (if any)
* drop the INPUT and MOUNTDIR: they examine hardware, you don't want that.
* but you still want the new root mounted on /mnt before the POSTLUDE
  template does the switchroot.
  Quickest way to achieve that is to hack the POSTLUDE template
  to start with an extra bit of shell:

  	!mkbdev /dev/sda sda
	!mount -r /dev/sda /mnt

* now do yaird -v -c myDefault.cfg -o test.img
  perhaps add --format=directory to get quick access to the image,
  otherwise just read the output of -v.

Setting up this stuff is perhaps ten minutes work.  The bonus
over manually making an initramfs is that yaird will handle the module
and shared library dependencies for you.

Perhaps this exercise could be made a bit simpler by allowing pieces
of shell script in the Default.cfg file?

Regards,
Erik





More information about the Yaird-devel mailing list