[Yaird-devel] Overriding some probing

Jonas Smedegaard dr at jones.dk
Mon Dec 12 23:22:15 UTC 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[sendt again - to the list this time...]

On Mon, 12 Dec 2005 23:20:59 +0100
Erik van Konijnenburg <ekonijn at xs4all.nl> wrote:

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

My suggestion is about providing hadcoded info to bypass asking the
host system about the world (which is the _wrong_ world for me).

My target system has not yet been brought to life!


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

This sounds related but a different scenario: You want to be able to
take (or for a test suite: design) a snapshot of target probing
material.


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

I know I am entering deadly ground: The very safety belts I am so fond
of with yaird is what I request be possible to take off...

I expect such abuse of yaird to work only for simple stuff like plain
devices. What needs consulting fstab besides rootfs and rootdev?


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

I would say that being able to pass custom arguments would make it
simpler:

  yaird --arg-template="usbstick" --arg-rootdev="/dev/sda"

The following somewhere at the top of the default Default.cfg would
define the default of the arguments (ARG-ROOTDEV is undefined by
default):

  ARG-TEMPLATE Templates

And I'd then be able to hack Default.cfg to behave exactly as usual for
my host machine, but _also_ be able to redirect to using a custom
template (which honours additional weird arguments specific to that
setup).

Whattayasay?


 - Jonas

- - -- 
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDngYnn7DbMsAkQLgRAplHAKCotYFOQh0IfyoFTMY4LYESqIcX/ACaAjU4
A2AUuYz15uXWR4pkIJdmrss=
=8Hmu
-----END PGP SIGNATURE-----



More information about the Yaird-devel mailing list