r4472 - in dists/trunk/utils: . yaird yaird/debian yaird/debian/cdbs yaird/debian/cdbs/1 yaird/debian/cdbs/1/rules yaird/debian/patches yaird/doc yaird/doc/figures yaird/exec yaird/exec/ipconfig yaird/exec/nfsmount yaird/include yaird/man yaird/perl yaird/templates

Sven Luther luther at costa.debian.org
Sun Oct 16 09:42:04 UTC 2005


Author: luther
Date: 2005-10-16 09:41:17 +0000 (Sun, 16 Oct 2005)
New Revision: 4472

Added:
   dists/trunk/utils/yaird/
   dists/trunk/utils/yaird/AUTHORS
   dists/trunk/utils/yaird/COPYING
   dists/trunk/utils/yaird/ChangeLog
   dists/trunk/utils/yaird/INSTALL
   dists/trunk/utils/yaird/LICENCE.KLIBC
   dists/trunk/utils/yaird/Makefile.am
   dists/trunk/utils/yaird/Makefile.in
   dists/trunk/utils/yaird/Makefile.incl
   dists/trunk/utils/yaird/NEWS
   dists/trunk/utils/yaird/README
   dists/trunk/utils/yaird/TODO
   dists/trunk/utils/yaird/aclocal.m4
   dists/trunk/utils/yaird/bootstrap.sh
   dists/trunk/utils/yaird/configure
   dists/trunk/utils/yaird/configure.in
   dists/trunk/utils/yaird/debian/
   dists/trunk/utils/yaird/debian/cdbs/
   dists/trunk/utils/yaird/debian/cdbs/1/
   dists/trunk/utils/yaird/debian/cdbs/1/rules/
   dists/trunk/utils/yaird/debian/cdbs/1/rules/buildinfo.mk
   dists/trunk/utils/yaird/debian/changelog
   dists/trunk/utils/yaird/debian/compat
   dists/trunk/utils/yaird/debian/control
   dists/trunk/utils/yaird/debian/control.in
   dists/trunk/utils/yaird/debian/copyright
   dists/trunk/utils/yaird/debian/docs
   dists/trunk/utils/yaird/debian/mkinitrd.yaird
   dists/trunk/utils/yaird/debian/mkinitrd.yaird.8
   dists/trunk/utils/yaird/debian/patches/
   dists/trunk/utils/yaird/debian/patches/hotplug-typo.patch
   dists/trunk/utils/yaird/debian/patches/kconf-check.patch
   dists/trunk/utils/yaird/debian/patches/mdadm.patch
   dists/trunk/utils/yaird/debian/patches/module-loading_with_digit_or_dash.patch
   dists/trunk/utils/yaird/debian/patches/series
   dists/trunk/utils/yaird/debian/rules
   dists/trunk/utils/yaird/debian/watch
   dists/trunk/utils/yaird/debian/yaird.doc-base
   dists/trunk/utils/yaird/debian/yaird.install
   dists/trunk/utils/yaird/debian/yaird.manpages
   dists/trunk/utils/yaird/depcomp
   dists/trunk/utils/yaird/doc/
   dists/trunk/utils/yaird/doc/Makefile.am
   dists/trunk/utils/yaird/doc/Makefile.in
   dists/trunk/utils/yaird/doc/authors.xml
   dists/trunk/utils/yaird/doc/concepts.xml
   dists/trunk/utils/yaird/doc/crypto.xml
   dists/trunk/utils/yaird/doc/figures/
   dists/trunk/utils/yaird/doc/figures/console.dia
   dists/trunk/utils/yaird/doc/figures/console.png
   dists/trunk/utils/yaird/doc/input.xml
   dists/trunk/utils/yaird/doc/intro.xml
   dists/trunk/utils/yaird/doc/kernel.xml
   dists/trunk/utils/yaird/doc/license.xml
   dists/trunk/utils/yaird/doc/nfs.xml
   dists/trunk/utils/yaird/doc/raid.xml
   dists/trunk/utils/yaird/doc/security.xml
   dists/trunk/utils/yaird/doc/shlibs.xml
   dists/trunk/utils/yaird/doc/spec.xml
   dists/trunk/utils/yaird/doc/tools.xml
   dists/trunk/utils/yaird/doc/yaird.xml.in
   dists/trunk/utils/yaird/exec/
   dists/trunk/utils/yaird/exec/Makefile.am
   dists/trunk/utils/yaird/exec/Makefile.in
   dists/trunk/utils/yaird/exec/findlibs.c
   dists/trunk/utils/yaird/exec/ipconfig/
   dists/trunk/utils/yaird/exec/ipconfig/Makefile.am
   dists/trunk/utils/yaird/exec/ipconfig/Makefile.in
   dists/trunk/utils/yaird/exec/ipconfig/README
   dists/trunk/utils/yaird/exec/ipconfig/bootp_packet.h
   dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.c
   dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.h
   dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.c
   dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.h
   dists/trunk/utils/yaird/exec/ipconfig/ipconfig.h
   dists/trunk/utils/yaird/exec/ipconfig/main.c
   dists/trunk/utils/yaird/exec/ipconfig/netdev.c
   dists/trunk/utils/yaird/exec/ipconfig/netdev.h
   dists/trunk/utils/yaird/exec/ipconfig/packet.c
   dists/trunk/utils/yaird/exec/ipconfig/packet.h
   dists/trunk/utils/yaird/exec/nfsmount/
   dists/trunk/utils/yaird/exec/nfsmount/Makefile.am
   dists/trunk/utils/yaird/exec/nfsmount/Makefile.in
   dists/trunk/utils/yaird/exec/nfsmount/dummypmap.c
   dists/trunk/utils/yaird/exec/nfsmount/dummypmap.h
   dists/trunk/utils/yaird/exec/nfsmount/main.c
   dists/trunk/utils/yaird/exec/nfsmount/mount.c
   dists/trunk/utils/yaird/exec/nfsmount/nfsmount.h
   dists/trunk/utils/yaird/exec/nfsmount/portmap.c
   dists/trunk/utils/yaird/exec/nfsmount/sunrpc.c
   dists/trunk/utils/yaird/exec/nfsmount/sunrpc.h
   dists/trunk/utils/yaird/exec/run_init.c
   dists/trunk/utils/yaird/exec/trynfs.c
   dists/trunk/utils/yaird/include/
   dists/trunk/utils/yaird/include/config.h.in
   dists/trunk/utils/yaird/install-sh
   dists/trunk/utils/yaird/man/
   dists/trunk/utils/yaird/man/Makefile.am
   dists/trunk/utils/yaird/man/Makefile.in
   dists/trunk/utils/yaird/man/yaird.8
   dists/trunk/utils/yaird/missing
   dists/trunk/utils/yaird/perl/
   dists/trunk/utils/yaird/perl/ActionList.pm
   dists/trunk/utils/yaird/perl/ActiveBlockDev.pm
   dists/trunk/utils/yaird/perl/ActiveBlockDevTab.pm
   dists/trunk/utils/yaird/perl/Base.pm
   dists/trunk/utils/yaird/perl/Blacklist.pm
   dists/trunk/utils/yaird/perl/BlockSpecialFileTab.pm
   dists/trunk/utils/yaird/perl/Conf.pm.in
   dists/trunk/utils/yaird/perl/CryptEntry.pm
   dists/trunk/utils/yaird/perl/CryptTab.pm
   dists/trunk/utils/yaird/perl/FsEntry.pm
   dists/trunk/utils/yaird/perl/FsOpts.pm
   dists/trunk/utils/yaird/perl/FsTab.pm
   dists/trunk/utils/yaird/perl/Hardware.pm
   dists/trunk/utils/yaird/perl/IdeDev.pm
   dists/trunk/utils/yaird/perl/Image.pm
   dists/trunk/utils/yaird/perl/Input.pm
   dists/trunk/utils/yaird/perl/InputTab.pm
   dists/trunk/utils/yaird/perl/KConfig.pm
   dists/trunk/utils/yaird/perl/LabeledPartition.pm
   dists/trunk/utils/yaird/perl/LabeledPartitionTab.pm
   dists/trunk/utils/yaird/perl/LogicalVolume.pm
   dists/trunk/utils/yaird/perl/LvmTab.pm
   dists/trunk/utils/yaird/perl/Makefile.am
   dists/trunk/utils/yaird/perl/Makefile.in
   dists/trunk/utils/yaird/perl/ModProbe.pm
   dists/trunk/utils/yaird/perl/NetDev.pm
   dists/trunk/utils/yaird/perl/NetDevTab.pm
   dists/trunk/utils/yaird/perl/Obj.pm
   dists/trunk/utils/yaird/perl/Opts.pm
   dists/trunk/utils/yaird/perl/Pack.pm
   dists/trunk/utils/yaird/perl/Parser.pm
   dists/trunk/utils/yaird/perl/PciDev.pm
   dists/trunk/utils/yaird/perl/PciMapEntry.pm
   dists/trunk/utils/yaird/perl/PciTab.pm
   dists/trunk/utils/yaird/perl/PhysicalVolume.pm
   dists/trunk/utils/yaird/perl/Plan.pm
   dists/trunk/utils/yaird/perl/RaidDev.pm
   dists/trunk/utils/yaird/perl/RaidTab.pm
   dists/trunk/utils/yaird/perl/ScsiDev.pm
   dists/trunk/utils/yaird/perl/SharedLibraries.pm
   dists/trunk/utils/yaird/perl/TestSet.pm
   dists/trunk/utils/yaird/perl/UsbDev.pm
   dists/trunk/utils/yaird/perl/UsbMapEntry.pm
   dists/trunk/utils/yaird/perl/UsbTab.pm
   dists/trunk/utils/yaird/perl/VolumeGroup.pm
   dists/trunk/utils/yaird/perl/main.pl
   dists/trunk/utils/yaird/templates/
   dists/trunk/utils/yaird/templates/Debian-initrd.cfg
   dists/trunk/utils/yaird/templates/Debian.cfg
   dists/trunk/utils/yaird/templates/Default.cfg.in
   dists/trunk/utils/yaird/templates/Fedora.cfg
   dists/trunk/utils/yaird/templates/Makefile.am
   dists/trunk/utils/yaird/templates/Makefile.in
Log:
Added yaird to the svn repo, in order to build ramdisk fixed packages with erik's patch.
Jonas, i hope i did this well, and that this helped you out :)


Added: dists/trunk/utils/yaird/AUTHORS
===================================================================
--- dists/trunk/utils/yaird/AUTHORS	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/AUTHORS	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,2 @@
+Sun Feb 13 21:41:02 CET 2005
+	GNU Autoconf wants this.

Added: dists/trunk/utils/yaird/COPYING
===================================================================
--- dists/trunk/utils/yaird/COPYING	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/COPYING	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

Added: dists/trunk/utils/yaird/ChangeLog
===================================================================
--- dists/trunk/utils/yaird/ChangeLog	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/ChangeLog	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,1541 @@
+# do not edit -- automatically generated by arch changelog
+# arch-tag: automatic-ChangeLog--ekonijn at xs4all.nl--debian/yaird--devo--0.1
+#
+
+2005-08-07 19:40:20 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-63
+
+    Summary:
+      0.0.11
+    Revision:
+      yaird--devo--0.1--patch-63
+
+        * Fedora template typo
+        * bug: psmouse module is known by yaird, so corresponding kernel
+          module should be known as well.  Ditto for evdev.
+        * bug: did not handle aliases: /dev/hda1 and /dev/root can be same device.
+
+    modified files:
+     ChangeLog perl/FsTab.pm perl/KConfig.pm templates/Fedora.cfg
+
+
+2005-08-07 17:42:30 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-62
+
+    Summary:
+      0.0.11
+    Revision:
+      yaird--devo--0.1--patch-62
+
+         * Write NEWS
+         * Bump version to 0.0.11
+
+    modified files:
+     ChangeLog NEWS configure.in
+
+
+2005-08-07 16:26:47 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-61
+
+    Summary:
+      0.0.11
+    Revision:
+      yaird--devo--0.1--patch-61
+
+        * Merge configuration parser.
+
+    new files:
+     perl/.arch-ids/Parser.pm.id perl/Parser.pm
+     templates/.arch-ids/Default.cfg.in.id templates/Default.cfg.in
+
+    modified files:
+     ChangeLog Makefile.am Makefile.incl README TODO configure.in
+     doc/concepts.xml doc/nfs.xml doc/security.xml doc/spec.xml
+     doc/tools.xml man/yaird.8 perl/ActionList.pm perl/Conf.pm.in
+     perl/Image.pm perl/Makefile.am perl/Plan.pm perl/TestSet.pm
+     perl/main.pl templates/Debian-initrd.cfg templates/Debian.cfg
+     templates/Fedora.cfg templates/Makefile.am
+
+    renamed files:
+     templates/.arch-ids/Debian-initrd.pm.id
+       ==> templates/.arch-ids/Debian-initrd.cfg.id
+     templates/.arch-ids/Debian.pm.id
+       ==> templates/.arch-ids/Debian.cfg.id
+     templates/.arch-ids/Fedora.pm.id
+       ==> templates/.arch-ids/Fedora.cfg.id
+     templates/Debian-initrd.pm
+       ==> templates/Debian-initrd.cfg
+     templates/Debian.pm
+       ==> templates/Debian.cfg
+     templates/Fedora.pm
+       ==> templates/Fedora.cfg
+
+    new patches:
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--base-0
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-1
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-2
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-3
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-4
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-5
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-6
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-7
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-8
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-9
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-10
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-11
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-12
+     ekonijn at xs4all.nl--debian/yaird--parser--0.1--patch-13
+
+
+2005-08-07 16:16:52 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-60
+
+    Summary:
+      0.0.11
+    Revision:
+      yaird--devo--0.1--patch-60
+
+         * The file /etc/hotplug/blacklist does not have to exist:
+           this can be a machine without hotplug, or with a future
+           version, where blacklisting is delegated to module-init-tools.
+           Based on patch by Marian Andre <Marian.Andre at sq.sk>
+
+    modified files:
+     ChangeLog perl/Blacklist.pm
+
+
+2005-07-17 13:08:21 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-59
+
+    Summary:
+      0.0.11
+    Revision:
+      yaird--devo--0.1--patch-59
+
+         * Bugfix: expect A-Z, in kernel config entries.
+         * survive missing ide-generic in kernel
+           yaird error: error running modprobe ide-generic (fatal)
+           solution is in IdeDev.pm: if IDE_GENERIC is
+           modular according to kernel config, as opposed to compiled in
+           or omitted, probe for it.  If the probe fails after that,
+           it's a bone fide error.
+
+    modified files:
+     ChangeLog perl/IdeDev.pm perl/KConfig.pm
+
+
+2005-06-28 21:28:40 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-58
+
+    Summary:
+      really bump version to 0.0.10
+    Revision:
+      yaird--devo--0.1--patch-58
+
+    really bump version to 0.0.10
+    
+
+    modified files:
+     ChangeLog configure.in
+
+
+2005-06-28 21:19:52 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-57
+
+    Summary:
+      0.0.10
+    Revision:
+      yaird--devo--0.1--patch-57
+
+         * Allow '+' in output file name; some Debian packages use this.
+         * 2.6.12 has better hardware links for /sys/class/input
+           and for /sys/block/floppy; use them.  This should make it
+           possible to have modular PS/2 keyboard.  Add some heuristics
+           to achieve the same for older kernels.
+         * Unrecognised path in /sys/devices upgraded from warning to error.
+           This differs from "no module found": the latter is probably some
+           module compiled into the kernel, but in the former case we have
+           no idea what we're dealing with, so it's unlikely we would generate
+           a working image.
+         * Know about kernel config options for mousedev and atkbd;
+           these are often compiled into the kernel.
+         * On failing modprobe, note which module failed.
+         * If it's a /lib/modules/**.ko file, even if executable,
+           never look for shared libraries.  In FC4 such modules cause
+           ld-linux.so, called via ldd, to segfault.
+         * Unconditionally load evdev and mousedev as part of the
+           image.  These are not required to get a working keyboard,
+           but at least in FC4, nobody probes for them if atkbd and
+           psmouse are loaded from initramfs.  Mousedev is needed to
+           get a working X environment, evdev is needed to do proper
+           hardware detection by yaird.
+         * Drop debian packaging from todo list.
+         * Bump version number
+
+    modified files:
+     ChangeLog NEWS TODO perl/Hardware.pm perl/KConfig.pm
+     perl/ModProbe.pm perl/Plan.pm perl/SharedLibraries.pm
+     perl/main.pl
+
+
+2005-06-25 14:06:47 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-56
+
+    Summary:
+      oops forgot one addres; drop licence at front, there is one at the back already
+    Revision:
+      yaird--devo--0.1--patch-56
+
+    oops forgot one addres; drop licence at front, there is one at the back already
+    
+
+    modified files:
+     ChangeLog doc/license.xml doc/yaird.xml.in
+
+
+2005-06-25 13:57:33 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-55
+
+    Summary:
+      markup cleanup
+    Revision:
+      yaird--devo--0.1--patch-55
+
+    markup cleanup
+    
+
+    modified files:
+     ChangeLog doc/yaird.xml.in
+
+
+2005-06-25 13:53:41 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-54
+
+    Summary:
+      more 0.0.9
+    Revision:
+      yaird--devo--0.1--patch-54
+
+        * Adapt README: refer to native Debian package,
+          don't bother spelling out the shell script.
+
+    modified files:
+     ChangeLog README
+
+
+2005-06-25 13:47:06 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-53
+
+    Summary:
+      0.0.9
+    Revision:
+      yaird--devo--0.1--patch-53
+
+        * Change of address in all GPL notices
+        * Place the html under GPL instead of GFDL;
+          using a program licence for docs is perhaps silly,
+          but workable as long as there is something that can be
+          considered source (the docbook in this case),
+          and using GPL rather than GFDL makes the package easier
+          to handle for Debian.
+        * Update todo: look at blkid, ext2/ext3 issue.
+        * bump version
+
+    modified files:
+     COPYING ChangeLog Makefile.am Makefile.incl NEWS README TODO
+     bootstrap.sh configure.in doc/Makefile.am doc/yaird.xml.in
+     exec/Makefile.am exec/findlibs.c exec/ipconfig/Makefile.am
+     exec/nfsmount/Makefile.am exec/trynfs.c man/Makefile.am
+     perl/ActionList.pm perl/ActiveBlockDev.pm
+     perl/ActiveBlockDevTab.pm perl/Base.pm perl/Blacklist.pm
+     perl/BlockSpecialFileTab.pm perl/Conf.pm.in perl/CryptEntry.pm
+     perl/CryptTab.pm perl/FsEntry.pm perl/FsOpts.pm perl/FsTab.pm
+     perl/Hardware.pm perl/IdeDev.pm perl/Image.pm perl/Input.pm
+     perl/InputTab.pm perl/KConfig.pm perl/LabeledPartition.pm
+     perl/LabeledPartitionTab.pm perl/LogicalVolume.pm
+     perl/LvmTab.pm perl/Makefile.am perl/ModProbe.pm
+     perl/NetDev.pm perl/NetDevTab.pm perl/Obj.pm perl/Opts.pm
+     perl/Pack.pm perl/PciDev.pm perl/PciMapEntry.pm perl/PciTab.pm
+     perl/PhysicalVolume.pm perl/Plan.pm perl/RaidDev.pm
+     perl/RaidTab.pm perl/ScsiDev.pm perl/SharedLibraries.pm
+     perl/TestSet.pm perl/UsbDev.pm perl/UsbMapEntry.pm
+     perl/UsbTab.pm perl/VolumeGroup.pm perl/main.pl
+     templates/Debian-initrd.pm templates/Debian.pm
+     templates/Fedora.pm templates/Makefile.am
+
+
+2005-06-11 17:36:19 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-52
+
+    Summary:
+      yaird -N needs a default, and notes manapge in news.  onward to 0.0.8 ...
+    Revision:
+      yaird--devo--0.1--patch-52
+
+    yaird -N needs a default, and notes manapge in news.  onward to 0.0.8 ...
+    
+
+    modified files:
+     ChangeLog NEWS perl/main.pl
+
+
+2005-06-11 12:39:56 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-51
+
+    Summary:
+      0.0.8 - for real this time?
+    Revision:
+      yaird--devo--0.1--patch-51
+
+        * Klibc licence was dropped from tarball.
+        * remvoe ridiculous.h in make clean.
+
+    modified files:
+     ChangeLog Makefile.am exec/nfsmount/Makefile.am
+
+
+2005-06-08 21:40:21 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-50
+
+    Summary:
+      0.0.8
+    Revision:
+      yaird--devo--0.1--patch-50
+
+         * In HTML doc, note that potential problems are not only Kerberos.
+         * Similar warning in manpage.
+         * do NEWS.
+         * shorten todo.
+         * Bump version to 0.0.8
+
+    modified files:
+     ChangeLog NEWS TODO configure.in doc/nfs.xml man/yaird.8
+
+
+2005-06-05 12:19:32 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-49
+
+    Summary:
+      post-0.0.7
+    Revision:
+      yaird--devo--0.1--patch-49
+
+         * Avoid spurious error message 'incomplete reply'
+           after failing mount(2) in nfsmount.
+         * Fancy hex_dump() for easier debugging in nfsmount.
+         * Revert config check for struct nfs_fh.
+           This turns out to by a system call structure
+           definition, where the application expects
+           definition for on the wire protocol.
+         * above patches submitted to klibc mailing list.
+
+    modified files:
+     ChangeLog configure.in exec/nfsmount/mount.c
+
+
+2005-06-04 09:31:32 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-48
+
+    Summary:
+      post-0.0.7 nfs
+    Revision:
+      yaird--devo--0.1--patch-48
+
+         * add section on NFSv4 to HTML doc.
+         * bugfix: af_packet compiled into kernel not
+           recognised properly.
+         * need explicit dist_ prefix in Makefile.am
+           to include it in the tarball.
+         * add configure check for struct nfs_fs.size,
+           since this is available in glibc_kernelheaders
+           as distributed in FC4-rc2, in that case don't
+           have the struct definition in application code.
+         * drop reference to copyright of inlined code
+           in nfsmount.h; we no longer do that inlining.
+         * need to mention include files in blabla_SOURCES
+           for automake to include them in tarball.
+         * don't put yaird.xml in tarball; its generated
+         * Add nfs support to initrd template.
+         * In html doc, move NFS from todo to features.
+         * bugfix: Plan.pm: wrong signature for makePlan.
+         * Note klibc version requirement in readme.
+         * Add NFS support to Fedora template.
+
+    modified files:
+     ChangeLog README TODO configure.in doc/Makefile.am doc/nfs.xml
+     doc/spec.xml exec/ipconfig/Makefile.am
+     exec/nfsmount/Makefile.am exec/nfsmount/main.c
+     exec/nfsmount/mount.c exec/nfsmount/nfsmount.h man/Makefile.am
+     man/yaird.8 perl/KConfig.pm perl/Plan.pm
+     templates/Debian-initrd.pm templates/Debian.pm
+     templates/Fedora.pm
+
+
+2005-05-29 20:13:06 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-47
+
+    Summary:
+      post-0.0.7 - more nfs
+    Revision:
+      yaird--devo--0.1--patch-47
+
+         * Make ipconfig return as soon as the first interface
+           has a working configuration.
+         * trynfs.c: print message before attempting mount.
+         * yaird.8: document NFS mount user interface.
+         * Plan.pm, main.pl: implement user interface (none|option|only)
+         * main.pl: untaint vars *before* use
+         * template/Debian.pm: move switchroot code to a function
+           in prelude, to share it between nfsstart and postlude.
+         * template/Debian.pm: add nfsstart to mount NFS root.
+         * To do: adapt Debian.initrd, Fedora for NFS root.
+
+    modified files:
+     ChangeLog TODO exec/ipconfig/main.c exec/trynfs.c man/yaird.8
+     perl/Plan.pm perl/main.pl templates/Debian.pm
+
+
+2005-05-29 12:33:23 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-46
+
+    Summary:
+      post-0.0.7
+    Revision:
+      yaird--devo--0.1--patch-46
+
+         * Copyright compliance.
+           nfsmount needs <linux/nfs_mount.h>, but that breaks with glibc
+           because of a redundant include <linux/in.h>.
+           So we cannot use it, but we also cannot inline it,
+           since it's GPL, and the GPL condition of 'no extra
+           restrictions on redistribution' conflicts with nfsmount's
+           condition of 'include this licence and disclaimer notice'.
+           The workaround is to make our own copy of nfs_mount.h
+           at build time by grepping away the offending include.
+
+    modified files:
+     ChangeLog exec/nfsmount/Makefile.am exec/nfsmount/nfsmount.h
+
+
+2005-05-29 11:43:48 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-45
+
+    Summary:
+      post-0.0.7
+    Revision:
+      yaird--devo--0.1--patch-45
+
+         * Added HPA's copyright notice to ipconfig and nfsmount.
+         * Write-up NFS support in the HTML doc;
+           manual page still todo.
+         * Merge in klibc-1.0.12:  Glibc compatibility patches
+           from yaird for ipconfig and nfsmount included upstream
+           after cleanup.
+
+    new files:
+     doc/.arch-ids/nfs.xml.id doc/nfs.xml
+
+    modified files:
+     ChangeLog doc/Makefile.am doc/kernel.xml doc/yaird.xml.in
+     exec/ipconfig/README exec/ipconfig/main.c
+     exec/ipconfig/netdev.h exec/ipconfig/packet.c
+     exec/nfsmount/main.c exec/nfsmount/mount.c
+     exec/nfsmount/portmap.c exec/nfsmount/sunrpc.c
+
+
+2005-05-23 21:29:38 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-44
+
+    Summary:
+      post-0.0.7 nfsroot
+    Revision:
+      yaird--devo--0.1--patch-44
+
+         * Patch to make ipconfig and nfsroot compatible with glibc.
+           Forwarded to upstream.
+         * At this point netdev.c still breaks gcc
+
+    modified files:
+     ChangeLog configure.in exec/Makefile.am
+     exec/ipconfig/Makefile.am exec/ipconfig/bootp_proto.c
+     exec/ipconfig/dhcp_proto.c exec/ipconfig/ipconfig.h
+     exec/ipconfig/main.c exec/ipconfig/netdev.c
+     exec/ipconfig/packet.c exec/nfsmount/Makefile.am
+     exec/nfsmount/main.c exec/nfsmount/mount.c
+     exec/nfsmount/nfsmount.h exec/nfsmount/portmap.c
+     exec/nfsmount/sunrpc.c exec/nfsmount/sunrpc.h exec/trynfs.c
+
+
+2005-05-23 19:55:16 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-43
+
+    Summary:
+      post-0.0.7
+    Revision:
+      yaird--devo--0.1--patch-43
+
+         * Add network devices, unconditionally generated for now.
+         * Add ipconfig, nfsmount unchanged from klibc 1.0.8.
+           Still need to port to glibc,
+           Still need to invoke them.
+
+    new files:
+     exec/.arch-ids/trynfs.c.id exec/ipconfig/.arch-ids/=id
+     exec/ipconfig/.arch-ids/Makefile.am.id
+     exec/ipconfig/.arch-ids/README.id
+     exec/ipconfig/.arch-ids/bootp_packet.h.id
+     exec/ipconfig/.arch-ids/bootp_proto.c.id
+     exec/ipconfig/.arch-ids/bootp_proto.h.id
+     exec/ipconfig/.arch-ids/dhcp_proto.c.id
+     exec/ipconfig/.arch-ids/dhcp_proto.h.id
+     exec/ipconfig/.arch-ids/ipconfig.h.id
+     exec/ipconfig/.arch-ids/main.c.id
+     exec/ipconfig/.arch-ids/netdev.c.id
+     exec/ipconfig/.arch-ids/netdev.h.id
+     exec/ipconfig/.arch-ids/packet.c.id
+     exec/ipconfig/.arch-ids/packet.h.id exec/ipconfig/Makefile.am
+     exec/ipconfig/README exec/ipconfig/bootp_packet.h
+     exec/ipconfig/bootp_proto.c exec/ipconfig/bootp_proto.h
+     exec/ipconfig/dhcp_proto.c exec/ipconfig/dhcp_proto.h
+     exec/ipconfig/ipconfig.h exec/ipconfig/main.c
+     exec/ipconfig/netdev.c exec/ipconfig/netdev.h
+     exec/ipconfig/packet.c exec/ipconfig/packet.h
+     exec/nfsmount/.arch-ids/=id
+     exec/nfsmount/.arch-ids/Makefile.am.id
+     exec/nfsmount/.arch-ids/README.locking.id
+     exec/nfsmount/.arch-ids/dummypmap.c.id
+     exec/nfsmount/.arch-ids/dummypmap.h.id
+     exec/nfsmount/.arch-ids/main.c.id
+     exec/nfsmount/.arch-ids/mount.c.id
+     exec/nfsmount/.arch-ids/nfsmount.h.id
+     exec/nfsmount/.arch-ids/portmap.c.id
+     exec/nfsmount/.arch-ids/sunrpc.c.id
+     exec/nfsmount/.arch-ids/sunrpc.h.id exec/nfsmount/Makefile.am
+     exec/nfsmount/README.locking exec/nfsmount/dummypmap.c
+     exec/nfsmount/dummypmap.h exec/nfsmount/main.c
+     exec/nfsmount/mount.c exec/nfsmount/nfsmount.h
+     exec/nfsmount/portmap.c exec/nfsmount/sunrpc.c
+     exec/nfsmount/sunrpc.h exec/trynfs.c
+     perl/.arch-ids/NetDev.pm.id perl/.arch-ids/NetDevTab.pm.id
+     perl/NetDev.pm perl/NetDevTab.pm
+
+    modified files:
+     ChangeLog configure.in exec/Makefile.am perl/Conf.pm.in
+     perl/Hardware.pm perl/KConfig.pm perl/Makefile.am perl/Plan.pm
+
+    new directories:
+     exec/ipconfig exec/ipconfig/.arch-ids exec/nfsmount
+     exec/nfsmount/.arch-ids
+
+
+2005-05-16 20:25:33 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-42
+
+    Summary:
+      post-0.0.7 debugging
+    Revision:
+      yaird--devo--0.1--patch-42
+
+         * Make debugging code optional, and enable it
+           via kernel command line argument 'ydebug'
+           for all templates.
+         * Document ydebug in manpage and html doc.
+         * Drop superfluous mount of /etc and /var for Fedora.
+           (untested for now)
+
+    modified files:
+     ChangeLog doc/kernel.xml man/yaird.8
+     templates/Debian-initrd.pm templates/Debian.pm
+     templates/Fedora.pm
+
+
+2005-05-12 16:03:42 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-41
+
+    Summary:
+      post-0.0.7
+    Revision:
+      yaird--devo--0.1--patch-41
+
+         * Simplify Debian Template: since we use initramfs rather
+           than initrd we have a writable root, so there's no need
+           to mess about with mounting and unmounting /etc, /var, /dev.
+         * Write manual page, make it installable.
+
+    new files:
+     man/.arch-ids/=id man/.arch-ids/Makefile.am.id
+     man/.arch-ids/yaird.8.id man/Makefile.am man/yaird.8
+
+    modified files:
+     ChangeLog Makefile.am README TODO configure.in
+     templates/Debian.pm
+
+    new directories:
+     man man/.arch-ids
+
+
+2005-05-08 11:39:46 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-40
+
+    Summary:
+      0.0.7 - merging cryptsetup-luks
+    Revision:
+      yaird--devo--0.1--patch-40
+
+         * Bump version to 0.0.7
+         * Merge shared code for luks and plain cryptsetup
+         * avoid luksDump, since prior call to cryptsetup
+           status provides sufficient info.
+         * clean up parser for dmcrypt using luks example
+         * recognise that some ciphers need hashing kernel module
+         * Plan.pm: recognise that crypted disk may have multiple hardlinks
+         * Note luks in html docs, readme
+         * Bugfixes
+           - recognise keyword 'none' in /etc/crypttab
+           - keyfile check now for both luks and plain
+           - Fedora template: dash was used instead of ash
+
+    modified files:
+     ChangeLog NEWS README TODO configure.in doc/crypto.xml
+     doc/spec.xml perl/CryptTab.pm perl/KConfig.pm perl/Plan.pm
+     templates/Debian-initrd.pm templates/Debian.pm
+     templates/Fedora.pm
+
+
+2005-05-06 16:37:21 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-39
+
+    Summary:
+      post-0.0.6 - cryptsetup-luks
+    Revision:
+      yaird--devo--0.1--patch-39
+
+       * Import cryptsetup-luks patches from Dick Middleton.
+         To do: fedora template, testing, docs.
+
+    modified files:
+     ChangeLog perl/Plan.pm templates/Debian.pm
+
+
+2005-05-03 22:00:46 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-38
+
+    Summary:
+      0.0.6 finalising
+    Revision:
+      yaird--devo--0.1--patch-38
+
+        * Update 'features' section in HTML docs.
+
+    modified files:
+     ChangeLog doc/spec.xml
+
+
+2005-05-02 21:09:40 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-37
+
+    Summary:
+      0.0.6 finalising
+    Revision:
+      yaird--devo--0.1--patch-37
+
+        * Add cryptsetup to templates  fedora and debian-initrd variant
+        * Add crypto chapter to HTML docs
+        * Bump version number
+        * Deemphasise cramfs in readme, add notes on mdadm, cryptsetup.
+
+    new files:
+     doc/.arch-ids/crypto.xml.id doc/crypto.xml
+
+    modified files:
+     ChangeLog NEWS README TODO configure.in doc/Makefile.am
+     doc/yaird.xml.in templates/Debian-initrd.pm
+     templates/Debian.pm templates/Fedora.pm
+
+
+2005-05-01 19:21:10 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-36
+
+    Summary:
+      post-0.0.5 - prepare dm-crypt
+    Revision:
+      yaird--devo--0.1--patch-36
+
+     * Support cryptsetup, requires a Debian style /etc/crypttab
+     * Keep track of line numbers in configuration files
+     * refactor: addDevicePlan to a set of procedures, each tried in turn:
+       with LVM and crypt both using dm-x, no longer can switch on name.
+     * refactor: options as used in /etc/fstab are same as in /etc/crypttab;
+       share the implementation.
+     * bugfix: trick in debian rootfs:/init script to not have unreachable /dev
+       show up as tmpfs in /proc/mounts, thus avoiding silly
+       interaction with /etc/init.d/udev.
+     * bugfix: Debian-initrd template was dropped from when rolling the tar-ball.
+     * bugfix: Multiple files in /dev/ refering to same raid device caused an error,
+       adapt BlockSpecialFileTab.pm, ActiveBlockDev.pm to avoid preferential treatment
+       for one of the files with same devno.
+     * bugfix: ActionList.pm - avoid use of uninitialised value in verbose msg
+    
+
+    new files:
+     perl/.arch-ids/CryptEntry.pm.id perl/.arch-ids/CryptTab.pm.id
+     perl/.arch-ids/Opts.pm.id perl/CryptEntry.pm perl/CryptTab.pm
+     perl/Opts.pm
+
+    removed files:
+     perl/.arch-ids/BlockSpecialFile.pm.id perl/BlockSpecialFile.pm
+
+    modified files:
+     ChangeLog README TODO perl/ActionList.pm
+     perl/ActiveBlockDev.pm perl/BlockSpecialFileTab.pm
+     perl/Conf.pm.in perl/FsEntry.pm perl/FsOpts.pm perl/FsTab.pm
+     perl/LabeledPartitionTab.pm perl/Makefile.am perl/Obj.pm
+     perl/Plan.pm perl/RaidDev.pm perl/RaidTab.pm perl/TestSet.pm
+     templates/Debian.pm templates/Makefile.am
+
+
+2005-03-30 12:47:38 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-35
+
+    Summary:
+      post 0.0.5
+    Revision:
+      yaird--devo--0.1--patch-35
+
+     * Document use of uclibc.
+
+    modified files:
+     ChangeLog NEWS README TODO doc/shlibs.xml
+
+
+2005-03-30 11:45:20 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-34
+
+    Summary:
+      post-0.0.5 lvm fix
+    Revision:
+      yaird--devo--0.1--patch-34
+
+     * It is not an error for LVM to be unavailable.
+     * Replace interpretation of modules.dep with
+       invocation of /sbin/modprobe.  This enables
+       option processing, recognises modules that
+       have an install command (that's an error:
+       unsupported), and alias support.
+       Note that aliases are needed for dm-crypt:
+       aes is an alias for aes-i586 on some machines.
+     * Note modprobe changes in doc, todo, news.
+
+    new files:
+     perl/.arch-ids/ModProbe.pm.id perl/ModProbe.pm
+
+    removed files:
+     perl/.arch-ids/ModDep.pm.id perl/.arch-ids/ModDepTab.pm.id
+     perl/ModDep.pm perl/ModDepTab.pm
+
+    modified files:
+     ChangeLog NEWS TODO doc/concepts.xml doc/spec.xml
+     doc/tools.xml perl/LvmTab.pm perl/Makefile.am perl/Plan.pm
+     perl/TestSet.pm templates/Debian-initrd.pm templates/Debian.pm
+     templates/Fedora.pm
+
+
+2005-03-20 22:08:17 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-33
+
+    Summary:
+      0.0.5 - finalise
+    Revision:
+      yaird--devo--0.1--patch-33
+
+     * clean up NEWS, README, docs
+
+    modified files:
+     ChangeLog NEWS README TODO configure.in doc/concepts.xml
+     doc/shlibs.xml doc/tools.xml
+
+
+2005-03-19 23:44:53 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-32
+
+    Summary:
+      pre-0.0.5 add klibc shared libraries
+    Revision:
+      yaird--devo--0.1--patch-32
+
+     * Add executable findlibs, to determine dynamic loader and
+       basename of shared libraries, independent of which C library
+       is used.  Since we don't know what path the loader will use
+       we cannot resolve shared libraries given as relative paths.
+     * factor out the finding of shared libraries from building
+       the image.
+     * Writeup on shared libraries and klibc.
+
+    new files:
+     doc/.arch-ids/shlibs.xml.id doc/shlibs.xml
+     exec/.arch-ids/findlibs.c.id exec/findlibs.c
+     perl/.arch-ids/SharedLibraries.pm.id perl/SharedLibraries.pm
+
+    modified files:
+     ChangeLog NEWS README TODO doc/Makefile.am doc/concepts.xml
+     doc/raid.xml doc/spec.xml doc/tools.xml doc/yaird.xml.in
+     exec/Makefile.am perl/Image.pm perl/Makefile.am perl/Plan.pm
+     perl/TestSet.pm
+
+
+2005-03-06 17:50:32 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-31
+
+    Summary:
+      pre-0.0.5 debian to initramfs
+    Revision:
+      yaird--devo--0.1--patch-31
+
+     * Document building with klibc in the README file.
+     * Adapt the Debian template to use initramfs instead of initrd.
+       The old template is available as Debian-initrd.
+     * Adapt Fedora template to use run_init.
+     * correct dependencies in doc makefile.
+     * doc: writup on initramfs and run_init; de-emphasize initrd.
+
+    new files:
+     templates/.arch-ids/Debian-initrd.pm.id
+     templates/Debian-initrd.pm
+
+    modified files:
+     ChangeLog NEWS README TODO doc/Makefile.am doc/concepts.xml
+     doc/input.xml doc/intro.xml doc/kernel.xml doc/raid.xml
+     doc/security.xml doc/spec.xml doc/yaird.xml.in
+     templates/Debian.pm templates/Fedora.pm
+
+
+2005-03-01 22:29:08 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-30
+
+    Summary:
+      post-0.0.4 - add run_init
+    Revision:
+      yaird--devo--0.1--patch-30
+
+     * rename directory src to perl
+     * add directory exec for stuff intended to go onto the image
+     * add exec/run_init, based on klibc;
+       not compiled with klibc in standard configuration.
+     * wrap the nuking of rootfs in ifdefs; these may go away once tested.
+       add --enable-nuke config flag to set the ifdef.
+     * automake mods to support C compilation
+     * let all templates know about location of exec, about yaird version.
+     * generate Conf.pm based on exec dir, yaird version.
+     * change install directory: lib not share since there's object code now.
+     * note the klibc licence in documentation.
+
+    new files:
+     .arch-ids/LICENCE.KLIBC.id .arch-ids/Makefile.incl.id
+     LICENCE.KLIBC Makefile.incl exec/.arch-ids/=id
+     exec/.arch-ids/Makefile.am.id exec/.arch-ids/run_init.c.id
+     exec/Makefile.am exec/run_init.c include/.arch-ids/=id
+     include/.arch-ids/config.h.in.id include/config.h.in
+
+    modified files:
+     ChangeLog Makefile.am NEWS TODO bootstrap.sh configure.in
+     doc/license.xml perl/ActionList.pm perl/Conf.pm.in
+     perl/Makefile.am perl/main.pl templates/Debian.pm
+     templates/Fedora.pm templates/Makefile.am
+
+    renamed files:
+     src/.arch-ids/=id
+       ==> perl/.arch-ids/=id
+     src/.arch-ids/ActionList.pm.id
+       ==> perl/.arch-ids/ActionList.pm.id
+     src/.arch-ids/ActiveBlockDev.pm.id
+       ==> perl/.arch-ids/ActiveBlockDev.pm.id
+     src/.arch-ids/ActiveBlockDevTab.pm.id
+       ==> perl/.arch-ids/ActiveBlockDevTab.pm.id
+     src/.arch-ids/Base.pm.id
+       ==> perl/.arch-ids/Base.pm.id
+     src/.arch-ids/Blacklist.pm.id
+       ==> perl/.arch-ids/Blacklist.pm.id
+     src/.arch-ids/BlockSpecialFile.pm.id
+       ==> perl/.arch-ids/BlockSpecialFile.pm.id
+     src/.arch-ids/BlockSpecialFileTab.pm.id
+       ==> perl/.arch-ids/BlockSpecialFileTab.pm.id
+     src/.arch-ids/Conf.pm.id
+       ==> perl/.arch-ids/Conf.pm.in.id
+     src/.arch-ids/FsEntry.pm.id
+       ==> perl/.arch-ids/FsEntry.pm.id
+     src/.arch-ids/FsOpts.pm.id
+       ==> perl/.arch-ids/FsOpts.pm.id
+     src/.arch-ids/FsTab.pm.id
+       ==> perl/.arch-ids/FsTab.pm.id
+     src/.arch-ids/Hardware.pm.id
+       ==> perl/.arch-ids/Hardware.pm.id
+     src/.arch-ids/IdeDev.pm.id
+       ==> perl/.arch-ids/IdeDev.pm.id
+     src/.arch-ids/Image.pm.id
+       ==> perl/.arch-ids/Image.pm.id
+     src/.arch-ids/Input.pm.id
+       ==> perl/.arch-ids/Input.pm.id
+     src/.arch-ids/InputTab.pm.id
+       ==> perl/.arch-ids/InputTab.pm.id
+     src/.arch-ids/KConfig.pm.id
+       ==> perl/.arch-ids/KConfig.pm.id
+     src/.arch-ids/LabeledPartition.pm.id
+       ==> perl/.arch-ids/LabeledPartition.pm.id
+     src/.arch-ids/LabeledPartitionTab.pm.id
+       ==> perl/.arch-ids/LabeledPartitionTab.pm.id
+     src/.arch-ids/LogicalVolume.pm.id
+       ==> perl/.arch-ids/LogicalVolume.pm.id
+     src/.arch-ids/LvmTab.pm.id
+       ==> perl/.arch-ids/LvmTab.pm.id
+     src/.arch-ids/Makefile.am.id
+       ==> perl/.arch-ids/Makefile.am.id
+     src/.arch-ids/ModDep.pm.id
+       ==> perl/.arch-ids/ModDep.pm.id
+     src/.arch-ids/ModDepTab.pm.id
+       ==> perl/.arch-ids/ModDepTab.pm.id
+     src/.arch-ids/Obj.pm.id
+       ==> perl/.arch-ids/Obj.pm.id
+     src/.arch-ids/Pack.pm.id
+       ==> perl/.arch-ids/Pack.pm.id
+     src/.arch-ids/PciDev.pm.id
+       ==> perl/.arch-ids/PciDev.pm.id
+     src/.arch-ids/PciMapEntry.pm.id
+       ==> perl/.arch-ids/PciMapEntry.pm.id
+     src/.arch-ids/PciTab.pm.id
+       ==> perl/.arch-ids/PciTab.pm.id
+     src/.arch-ids/PhysicalVolume.pm.id
+       ==> perl/.arch-ids/PhysicalVolume.pm.id
+     src/.arch-ids/Plan.pm.id
+       ==> perl/.arch-ids/Plan.pm.id
+     src/.arch-ids/RaidDev.pm.id
+       ==> perl/.arch-ids/RaidDev.pm.id
+     src/.arch-ids/RaidTab.pm.id
+       ==> perl/.arch-ids/RaidTab.pm.id
+     src/.arch-ids/ScsiDev.pm.id
+       ==> perl/.arch-ids/ScsiDev.pm.id
+     src/.arch-ids/TestSet.pm.id
+       ==> perl/.arch-ids/TestSet.pm.id
+     src/.arch-ids/UsbDev.pm.id
+       ==> perl/.arch-ids/UsbDev.pm.id
+     src/.arch-ids/UsbMapEntry.pm.id
+       ==> perl/.arch-ids/UsbMapEntry.pm.id
+     src/.arch-ids/UsbTab.pm.id
+       ==> perl/.arch-ids/UsbTab.pm.id
+     src/.arch-ids/VolumeGroup.pm.id
+       ==> perl/.arch-ids/VolumeGroup.pm.id
+     src/.arch-ids/main.pl.id
+       ==> perl/.arch-ids/main.pl.id
+     src/Conf.pm
+       ==> perl/Conf.pm.in
+
+    new directories:
+     exec exec/.arch-ids include include/.arch-ids perl/.arch-ids
+
+    removed directories:
+     src/.arch-ids
+
+    renamed directories:
+     src
+       ==> perl
+
+
+2005-02-24 23:13:31 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-29
+
+    Summary:
+      post-0.0.4 add tree copying
+    Revision:
+      yaird--devo--0.1--patch-29
+
+     * Add tree copy code to templates, to actionlist
+       processing, to image generation.
+     * Canonise filenames in templates to avoid
+       problems with eg /lib/modules/2.6.10-smp/kernel//./.
+     * In ActionList, add kernel version to every hash;
+       this allows template to refer to /lib/modules/version/kernel.
+
+    modified files:
+     ChangeLog NEWS TODO doc/concepts.xml src/ActionList.pm
+     src/Image.pm templates/Debian.pm templates/Fedora.pm
+
+
+2005-02-23 22:17:56 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-28
+
+    Summary:
+      post-0.0.4
+    Revision:
+      yaird--devo--0.1--patch-28
+
+     * Add --root=/dev/hdb option.
+       Since this needs to be in fstab, it's odd to
+       use a device name rather than a mount point,
+       but it's the conventional thing to do, so should
+       give rise to less confusion than changing it.
+
+    modified files:
+     ChangeLog NEWS README TODO src/FsTab.pm src/Plan.pm
+     src/main.pl
+
+
+2005-02-23 14:26:44 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-27
+
+    Summary:
+      0.0.4
+    Revision:
+      yaird--devo--0.1--patch-27
+
+     * doc corrections: kernel command line no longer unsupported.
+     * bring fedora and debian templates to same level.
+
+    modified files:
+     ChangeLog NEWS doc/spec.xml templates/Debian.pm
+     templates/Fedora.pm
+
+
+2005-02-23 11:42:32 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-26
+
+    Summary:
+      pre-0.0.4 - kernel args
+    Revision:
+      yaird--devo--0.1--patch-26
+
+     * enough features for this week, time for some testing.
+       bump version number to 0.0.4
+     * Process kernel args, for now only init, ro, rw.
+     * as a consequence, single user mode boot now works.
+     * Ro/rw requires a new action attribute for mount: isRoot.
+     * options now only is fstab options, not the extra -n -t
+       stuff you may want to provide.
+     * new action attribute for mount: fsType.
+     * Document kernel args that may need support.
+    
+
+    modified files:
+     ChangeLog TODO configure.in doc/kernel.xml src/Plan.pm
+     templates/Debian.pm
+
+
+2005-02-20 15:57:02 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-25
+
+    Summary:
+      post 0.0.3 - oops
+    Revision:
+      yaird--devo--0.1--patch-25
+
+     * oops, add src/ModDep.pm to version control
+
+    new files:
+     src/.arch-ids/ModDep.pm.id src/ModDep.pm
+
+    modified files:
+     ChangeLog
+
+
+2005-02-20 15:55:10 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-24
+
+    Summary:
+      post 0.0.3
+    Revision:
+      yaird--devo--0.1--patch-24
+
+     * Find module files based on listing in modules.dep,
+       not on scanning /lib/modules.
+     * Like modprobe, accept *any* suffix for a module
+     * But warn if the suffix is not .ko or .ko.gz,
+       and thus not likely to be generated by depmod.
+     * Remove ModDir; this is now redundant.
+     * Add ModDep.pm to encapsulate filename and
+       dependencies in a modules.dep line.
+     * Check against duplicate module names
+     * Add line numbers to module.dep parsing.
+     * Bugfix: ModDepTab::all returned hash not array.
+     * Stay closer to modprobe syntax regarding comment conventions
+     * In Debian template, verify existence of device
+       before making a node for it.
+
+    removed files:
+     src/.arch-ids/ModDir.pm.id src/ModDir.pm
+
+    modified files:
+     ChangeLog TODO src/Conf.pm src/Makefile.am src/ModDepTab.pm
+     src/Plan.pm src/TestSet.pm templates/Debian.pm
+
+
+2005-02-19 12:41:23 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-23
+
+    Summary:
+      post 0.0.3
+    Revision:
+      yaird--devo--0.1--patch-23
+
+     * In Hardware, recognise target\d+:\d+:\d+
+       as a new SCSI grouping, introduced in 2.6.10.
+     * In Hardware, warn about any unrecognised path component
+     * In TestSet, clean up harmless typo uncovered by warning.
+
+    modified files:
+     ChangeLog TODO src/Hardware.pm src/TestSet.pm
+
+
+2005-02-19 00:45:15 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-22
+
+    Summary:
+      post-0.0.3 patches
+    Revision:
+      yaird--devo--0.1--patch-22
+
+     * Empty lines in /etc/fstab are valid.
+       (Patch Goffredo Baroncelli)
+
+    modified files:
+     ChangeLog TODO src/FsTab.pm
+
+
+2005-02-16 15:51:52 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-21
+
+    Summary:
+      implement formats
+    Revision:
+      yaird--devo--0.1--patch-21
+
+     * implement --format options: directory, cramfs, cpio
+     * use 3rd open arg to avoid filename interpretation.
+     * adapt readme, concepts and security doc accordingly.
+
+    modified files:
+     ChangeLog README doc/concepts.xml doc/security.xml src/Base.pm
+     src/Blacklist.pm src/FsTab.pm src/Image.pm src/InputTab.pm
+     src/KConfig.pm src/LabeledPartition.pm src/LvmTab.pm
+     src/ModDepTab.pm src/Pack.pm src/PciTab.pm src/RaidTab.pm
+     src/UsbTab.pm
+
+
+2005-02-16 12:30:41 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-20
+
+    Summary:
+      recognise amd64 linux-gate
+    Revision:
+      yaird--devo--0.1--patch-20
+
+     * New ldd output pattern, cf debian Bug#295412.
+       Untested, I don't have 64bit.
+     * add framework for output formats.
+
+    new files:
+     src/.arch-ids/Pack.pm.id src/Pack.pm
+
+    modified files:
+     ChangeLog src/Image.pm src/Makefile.am src/main.pl
+
+
+2005-02-16 09:54:08 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-19
+
+    Summary:
+      gnu automake
+    Revision:
+      yaird--devo--0.1--patch-19
+
+     * factor out template/Makefile
+     * note automake in doc.
+     * add command line processing in main.
+     * add support for -v, -q, -d in Base.pm.
+     * correpsonding change in doc/spec, doc/security
+     * rewritten the README
+     * TODO now included
+
+    new files:
+     .arch-ids/TODO.id TODO templates/.arch-ids/Makefile.am.id
+     templates/Makefile.am
+
+    modified files:
+     ChangeLog Makefile.am README configure.in doc/security.xml
+     doc/spec.xml doc/tools.xml src/Base.pm src/main.pl
+
+
+2005-02-13 23:38:48 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-18
+
+    Summary:
+      oops in src/Makefile
+    Revision:
+      yaird--devo--0.1--patch-18
+
+     * Add to configure.in, or Makefile.in is not built from Makefile.am
+
+    modified files:
+     ChangeLog configure.in
+
+
+2005-02-13 23:36:27 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-17
+
+    Summary:
+      changelog misery, factoring makefile
+    Revision:
+      yaird--devo--0.1--patch-17
+
+     * remove, re-add changelog.  Now it should get the log for this branch.
+       Is this what we want?
+     * Factor out src/Makefile.am
+
+    new files:
+     .arch-ids/ChangeLog.id ChangeLog src/.arch-ids/Makefile.am.id
+     src/Makefile.am
+
+    removed files:
+     .arch-ids/ChangeLog.id ChangeLog
+
+    modified files:
+     Makefile.am
+
+
+2005-02-13 23:27:22 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-16
+
+    Summary:
+      oops, wrong changelog.
+    Revision:
+      yaird--devo--0.1--patch-16
+
+     * Sigh, changelog from branch is copied unchanged.
+       It may be necessary to get rid of automatic tag.
+
+    modified files:
+     ChangeLog
+
+
+2005-02-13 23:23:33 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-15
+
+    Summary:
+      convert to automake
+    Revision:
+      yaird--devo--0.1--patch-15
+
+     * Bump to 0.0.3, use GNU automake
+    
+    Patches applied:
+    
+     * ekonijn at xs4all.nl--debian/yaird--gnu--0.1--base-0
+       tag of ekonijn at xs4all.nl--debian/yaird--devo--0.1--patch-14
+    
+     * ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-1
+       add GNU autoconf support
+    
+     * ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-2
+       add required files
+    
+     * ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-3
+       debug gnu automake
+    
+     * ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-4
+       tuning automake
+    
+
+    new files:
+     .arch-ids/AUTHORS.id .arch-ids/ChangeLog.id
+     .arch-ids/Makefile.am.id .arch-ids/NEWS.id
+     .arch-ids/bootstrap.sh.id .arch-ids/configure.in.id AUTHORS
+     ChangeLog Makefile.am NEWS bootstrap.sh configure.in
+     doc/.arch-ids/Makefile.am.id doc/Makefile.am
+     templates/.arch-ids/=id
+
+    removed files:
+     doc/.arch-ids/Makefile.id doc/Makefile
+
+    modified files:
+     doc/yaird.xml.in src/main.pl
+
+    renamed files:
+     doc/.arch-ids/yaird.xml.id
+       ==> doc/.arch-ids/yaird.xml.in.id
+     doc/yaird.xml
+       ==> doc/yaird.xml.in
+     src/.arch-ids/Template.pm-Fedora.id
+       ==> templates/.arch-ids/Fedora.pm.id
+     src/.arch-ids/Template.pm.id
+       ==> templates/.arch-ids/Debian.pm.id
+     src/Template.pm
+       ==> templates/Debian.pm
+     src/Template.pm-Fedora
+       ==> templates/Fedora.pm
+
+    new directories:
+     templates templates/.arch-ids
+
+    new patches:
+     ekonijn at xs4all.nl--debian/yaird--gnu--0.1--base-0
+     ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-1
+     ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-2
+     ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-3
+     ekonijn at xs4all.nl--debian/yaird--gnu--0.1--patch-4
+
+
+2005-02-12 01:48:49 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-14
+
+    Summary:
+      beware of last minute cleanup
+    Revision:
+      yaird--devo--0.1--patch-14
+
+     * Fedora template: removing ls caused a shared library
+       for /mnt/bin/cp to go missing.  Fix.
+
+    modified files:
+     src/Template.pm-Fedora
+
+
+2005-02-09 23:40:12 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-13
+
+    Summary:
+      finalise before shipping.
+    Revision:
+      yaird--devo--0.1--patch-13
+
+     * Warning against ill advised use in README.
+     * Sample output in README.
+     * more detailed planner output.
+     * String method for actionList.
+     * typo prolog -> prologue.
+     * adapt TestSet to templating introduced in previous version.
+     * doc/intro: remove ref to non-existent manual page.
+
+    modified files:
+     README doc/intro.xml src/ActionList.pm src/Plan.pm
+     src/Template.pm src/Template.pm-Fedora src/TestSet.pm
+
+
+2005-02-09 22:04:21 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-12
+
+    Summary:
+      docs and finishing fedora
+    Revision:
+      yaird--devo--0.1--patch-12
+
+     * More info on initramfs found in Fedora port;
+     * Drop ls and more from the templates.
+     * Include Fedora sample template.
+     * Confess odd scripting for initramfs.
+     * Rename LICENSE to COPYING
+     * TestPlan has bugs, introduced while adding templating.
+
+    new files:
+     src/.arch-ids/Template.pm-Fedora.id src/Template.pm-Fedora
+
+    modified files:
+     README doc/kernel.xml doc/spec.xml src/Template.pm
+
+    renamed files:
+     .arch-ids/LICENSE.id
+       ==> .arch-ids/COPYING.id
+     LICENSE
+       ==> COPYING
+
+
+2005-02-09 16:16:35 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-11
+
+    Summary:
+      avoid error message on non-shared executable ldd
+    Revision:
+      yaird--devo--0.1--patch-11
+
+     * avoid error message on non-shared executable ldd,
+       needed because of strange file modes in FC3.
+
+    modified files:
+     src/Image.pm
+
+
+2005-02-09 16:05:04 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-10
+
+    Summary:
+      oops
+    Revision:
+      yaird--devo--0.1--patch-10
+
+     * Inverted pattern in previous fix to ldd.
+
+    modified files:
+     src/Image.pm
+
+
+2005-02-09 16:00:50 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-9
+
+    Summary:
+      other ldd output format
+    Revision:
+      yaird--devo--0.1--patch-9
+
+     * In FC3 ldd (v2.3.3), the => is omitted
+       if names on both sides are identical.
+       
+
+    modified files:
+     src/Image.pm
+
+
+2005-02-09 13:14:52 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-8
+
+    Summary:
+      document templating
+    Revision:
+      yaird--devo--0.1--patch-8
+
+     * Discusse templating infrastructure under toolchain
+     * More logical ordering in concepts chapter,
+       discuss use of templates.
+     * Minor cleanup in security and licence chapters.
+
+    removed files:
+     doc/.arch-ids/templating.xml.id doc/templating.xml
+
+    modified files:
+     doc/concepts.xml doc/license.xml doc/security.xml doc/spec.xml
+     doc/tools.xml doc/yaird.xml
+
+
+2005-02-09 10:37:39 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-7
+
+    Summary:
+      implement template system
+    Revision:
+      yaird--devo--0.1--patch-7
+
+    Patches applied:
+    
+     * ekonijn at xs4all.nl--debian/yaird--templ--0.1--base-0
+       tag of ekonijn at xs4all.nl--debian/yaird--devo--0.1--patch-6
+    
+     * ekonijn at xs4all.nl--debian/yaird--templ--0.1--patch-1
+       implement template system:
+    	 * Note initramfs in FC3.
+    	 * Add chapter on templating to doc; unsatisfactory.
+    	   Specs chapter unchanged.
+    	 * Add debug, assert functions to Base.
+    	 * Add debug calls to Image.
+    	 * Fix bug in addDevicePlan for loop and duplicate detection: eq vs ==.
+    	 * Add templating infrastructure, based on HTML::Template.
+    	 * Ad Debian specific template.
+    	 * Adapt Plan to use templating infrastructure.
+    	 * Drop ad hoc plan expansion code.
+
+    new files:
+     doc/.arch-ids/templating.xml.id doc/templating.xml
+     src/.arch-ids/ActionList.pm.id src/.arch-ids/Template.pm.id
+     src/ActionList.pm src/Template.pm
+
+    modified files:
+     doc/kernel.xml doc/yaird.xml src/Base.pm src/Conf.pm
+     src/Image.pm src/Obj.pm src/Plan.pm src/main.pl
+
+    new patches:
+     ekonijn at xs4all.nl--debian/yaird--templ--0.1--base-0
+     ekonijn at xs4all.nl--debian/yaird--templ--0.1--patch-1
+
+
+2005-02-06 11:47:03 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-6
+
+    Summary:
+      oops, add KConfig.pm
+    Revision:
+      yaird--devo--0.1--patch-6
+
+     * oops, KConfig.pm needs to be added to tla archive.
+       previous version non-functional for this reason.
+
+    new files:
+     src/.arch-ids/KConfig.pm.id src/KConfig.pm
+
+
+2005-02-05 22:46:13 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-5
+
+    Summary:
+      preparations for Fedora port
+    Revision:
+      yaird--devo--0.1--patch-5
+
+     * divide concept.xml into simplesect's.
+     * correct USB_HID remark in input.xml
+     * add kernel config file reader
+     * add mapping module name to kernel config var.
+     * document kernel config interpretation.
+     * added test case for kernel config interpretation
+     * when resolving module names, drop the modules
+       that are built into the kernel.
+     * /etc/hotplug/blacklist.d does not have to exist.
+     * swap in /etc/fstab can have mount point 'swap'
+       as well as 'none'.
+     * No absolute path when using LVM tools: Debian
+       has them in /sbin, Fedora in /usr/sbin;
+       Including /sbin,/usr/sbin in $PATH solves this.
+     * Don't load modules for swap partitions,
+       since we don't do software suspend yet.
+     * Known issue: Fedora does not have dash, does
+       not have /etc/lvm-200.  We'll need templating
+       to configure that away.
+
+    modified files:
+     doc/concepts.xml doc/input.xml doc/security.xml doc/spec.xml
+     src/Blacklist.pm src/Conf.pm src/FsTab.pm src/LvmTab.pm
+     src/ModDepTab.pm src/Plan.pm src/TestSet.pm src/main.pl
+
+
+2005-02-05 11:12:27 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-4
+
+    Summary:
+      reiser tested, limit PCI sibling awakening
+    Revision:
+      yaird--devo--0.1--patch-4
+
+     * Drop the todo item "test reiser"; completed succesfully.
+     * Drop 'redundant action' messages.
+     * Reduce PCI sibling awakening to USB functions only;
+       Note in doc.
+
+    modified files:
+     doc/concepts.xml doc/spec.xml src/Hardware.pm src/Plan.pm
+
+
+2005-02-05 00:11:33 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-3
+
+    Summary:
+      document UHCI/EHCI, fix LVM mknod
+    Revision:
+      yaird--devo--0.1--patch-3
+
+     * add a paragraph on EHCI/UHCI and load a module for
+       every function of a PCI slot to the concepts chapter.
+     * fix bug in generated mknod calls.  Devices cannot always
+       be called /dev/hda, with hda the kernel name: the counter
+       example is /dev/vg0/root, device nodes generated by LVM.
+       Add function yspecial to activeBlockDev, to generate
+       a name appropriate for the block device.
+     * known bug: the PCI alternate function code is too generous.
+       Consider a chipset that has sound, ide and USB all as one
+       PCI slot.  to be done.
+
+    modified files:
+     doc/concepts.xml src/ActiveBlockDev.pm src/LvmTab.pm
+     src/Plan.pm src/TestSet.pm
+
+
+2005-02-03 23:50:39 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-2
+
+    Summary:
+      fix EHCI/UHCI interference
+    Revision:
+      yaird--devo--0.1--patch-2
+
+     * It turns out some PCI EHCI drivers work best if the UHCI
+       driver is also loaded.  Generalise to: always load modules
+       for every function of a PCI slot you need.
+
+    modified files:
+     src/Hardware.pm
+
+
+2005-02-03 21:26:53 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	patch-1
+
+    Summary:
+      get rid of debug code
+    Revision:
+      yaird--devo--0.1--patch-1
+
+     * Drop hacked in 'sleep' action, leave sleep
+       on the image.
+
+    modified files:
+     src/Plan.pm
+
+
+2005-02-03 21:10:19 GMT	Erik van Konijnenburg <ekonijn at xs4all.nl>	base-0
+
+    Summary:
+      initial import
+    Revision:
+      yaird--devo--0.1--base-0
+
+     * first edition under version control.
+       seems to work in some simple cases,
+       still need to remove some debugging code.
+
+    new files:
+     LICENSE README doc/Makefile doc/authors.xml doc/concepts.xml
+     doc/figures/console.dia doc/figures/console.png doc/input.xml
+     doc/intro.xml doc/kernel.xml doc/license.xml doc/raid.xml
+     doc/security.xml doc/spec.xml doc/tools.xml doc/yaird.xml
+     src/ActiveBlockDev.pm src/ActiveBlockDevTab.pm src/Base.pm
+     src/Blacklist.pm src/BlockSpecialFile.pm
+     src/BlockSpecialFileTab.pm src/Conf.pm src/FsEntry.pm
+     src/FsOpts.pm src/FsTab.pm src/Hardware.pm src/IdeDev.pm
+     src/Image.pm src/Input.pm src/InputTab.pm
+     src/LabeledPartition.pm src/LabeledPartitionTab.pm
+     src/LogicalVolume.pm src/LvmTab.pm src/ModDepTab.pm
+     src/ModDir.pm src/Obj.pm src/PciDev.pm src/PciMapEntry.pm
+     src/PciTab.pm src/PhysicalVolume.pm src/Plan.pm src/RaidDev.pm
+     src/RaidTab.pm src/ScsiDev.pm src/TestSet.pm src/UsbDev.pm
+     src/UsbMapEntry.pm src/UsbTab.pm src/VolumeGroup.pm
+     src/main.pl
+
+

Added: dists/trunk/utils/yaird/INSTALL
===================================================================
--- dists/trunk/utils/yaird/INSTALL	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/INSTALL	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+

Added: dists/trunk/utils/yaird/LICENCE.KLIBC
===================================================================
--- dists/trunk/utils/yaird/LICENCE.KLIBC	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/LICENCE.KLIBC	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,32 @@
+
+Yaird contains code based on klibc; this code is made available
+by the author under the following licence.  The relevant source
+files have this copyright notice included.
+
+
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *   
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *   
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */

Added: dists/trunk/utils/yaird/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,28 @@
+# 
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+
+include Makefile.incl
+
+SUBDIRS		= perl templates doc exec man
+
+# not compiled, but must go in the tarball.
+EXTRA_DIST = \
+	bootstrap.sh \
+	LICENCE.KLIBC

Added: dists/trunk/utils/yaird/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,630 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+# 
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/Makefile.incl \
+	$(top_srcdir)/configure $(top_srcdir)/include/config.h.in \
+	AUTHORS COPYING ChangeLog INSTALL NEWS TODO depcomp install-sh \
+	missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf
+SUBDIRS = perl templates doc exec man
+
+# not compiled, but must go in the tarball.
+EXTRA_DIST = \
+	bootstrap.sh \
+	LICENCE.KLIBC
+
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/Makefile.incl $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+	      cd $(srcdir) && $(AUTOMAKE) --gnu  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+include/config.h: include/stamp-h1
+	@if test ! -f $@; then \
+	  rm -f include/stamp-h1; \
+	  $(MAKE) include/stamp-h1; \
+	else :; fi
+
+include/stamp-h1: $(top_srcdir)/include/config.h.in $(top_builddir)/config.status
+	@rm -f include/stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status include/config.h
+$(top_srcdir)/include/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f include/stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f include/config.h include/stamp-h1
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	$(mkdir_p) $(distdir)/doc $(distdir)/include
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+	check-am clean clean-generic clean-recursive ctags \
+	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
+	dist-tarZ dist-zip distcheck distclean distclean-generic \
+	distclean-hdr distclean-recursive distclean-tags \
+	distcleancheck distdir distuninstallcheck dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/Makefile.incl
===================================================================
--- dists/trunk/utils/yaird/Makefile.incl	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/Makefile.incl	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,31 @@
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf

Added: dists/trunk/utils/yaird/NEWS
===================================================================
--- dists/trunk/utils/yaird/NEWS	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/NEWS	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,81 @@
+Version 0.0.11, 2005-08-07
+     * Support configuration file that determines what the generated
+       image should do.  It replaces command line options for root
+       file system selection and forNFS support.
+     * The file /etc/hotplug/blacklist does not have to exist:
+       this can be a machine without hotplug, or with a future
+       hotplug version, where blacklisting is delegated to module-init-tools.
+       Based on patch by Marian Andre <Marian.Andre at sq.sk>
+     * Bugfix: expect A-Z, in kernel config entries.
+     * Handle kernels that do not have ide-generic.
+
+Version 0.0.10, 2005-06-29
+     * Support legacy keyboard compiled as module.
+
+Version 0.0.9, 2005-06-25
+     * Place the docs under GPL instead of GFDL for the benefit of Debian.
+     * This release too boring to announce on the mailing lists.
+
+Version 0.0.8, 2005-06-10
+     * Implement NFS root support (TCP, UDP, v2), based on klibc code.
+     * Merge klibc-1.0.14 changes.
+     * Make debugging output and shell break-outs optional,
+       triggered by kernel option 'ydebug'.
+     * Minor template simplifications.
+     * Added manual page.
+
+Version 0.0.7, 2005-05-08
+     * Support cryptsetup-luks (Based on patch by Dick Middleton)
+     * Bugfixes
+       - cryptsetup, handle multiple hard links to same block special dev
+       - cryptsetup, recognise keyword 'none' in /etc/crypttab
+       - cryptsetup, keyfile check now for both luks and plain
+       - cryptsetup, missing module for aes-cbc-essiv:sha256
+       - Fedora template: dash was used instead of ash
+
+Version 0.0.6, 2005-05-02
+     * Support cryptsetup.  See the README file, see HTML documentation.
+     * Support aliases and options in modprobe.conf,
+       simply by using modprobe rather than doing a reimplementation in perl.
+     * tested OK with ulibc
+     * Bugfixes:
+       - failure to generate image on systems without LVM
+       - overcrowded /dev under Debian with udev
+       - failure to generate image if multiple links to same raid device exist
+       - uninitialised value in verbose output
+
+Version 0.0.5, 2005-03-21
+     * change installation directory from /usr/local/share/yaird/
+       to /usr/local/lib/yaird/, since there are executables included now.
+     * add run_init: executable to make the move to the real root
+       device in initramfs context.
+     * README: new section on (optional) use of klibc,
+       new section on replacing mkinitrd during kernel install.
+     * more reliable shared library detection: works with glibc and
+       klibc; if other C libraries use shared libraries, an error
+       message results.
+     * adapt Debian template to use initramfs rather than initrd.
+       The old initrd template is available as Debian-initrd.
+     * add command line option --root=/dev/hdb, to simplify testing.
+     * allow template to see requested kernel version,
+       and to copy a complete tree to the image.  This makes it
+       possible to put /lib/modules/2.6.10-smp on the image and do hotplug.
+     * Documentation: writeup on initramfs, notes on shared libraries.
+
+Version 0.0.4, 2005-02-23
+     * Process kernel command line options: init=, ro, rw.
+     * Boot into single user mode supported
+     * Support modules outside /lib/modules
+     * Support modules with extension other than .ko
+     * Warn about duplicates in modules.dep
+     * Generated image now waits for device to become visible in /sys,
+       and gives error message if it doesn't
+     * Support 2.6.10 sysfs layout: SCSI now has a
+       new subdirectory 'target'.
+     * Warn about unrecognised paths in /sys
+     * Allow empty lines in /etc/fstab.
+     * Empty lines in /etc/fstab are valid.
+       (Patch Goffredo Baroncelli)
+
+Version 0.0.3, 2005-02-16
+     * First public release.

Added: dists/trunk/utils/yaird/README
===================================================================
--- dists/trunk/utils/yaird/README	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/README	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,128 @@
+
+YAIRD -- Yet Another MkInitRd
+=============================
+
+This is a proof of concept rewrite of mkinitrd, intended to test the
+idea that we can get a more accurate picture of the modules needed
+to boot a linux system by fully utilizing the information in sysfs.
+It comes with templates that make it possible to generate different
+initrd or initramfs images for different distributions.
+
+Proof of concept means this software is barely tested: it may
+produce a working image, or it may eat your disk.  This is a good
+moment to re-read the "NO WARRANTY" part of the licence,
+and decide whether you want to test this software.
+
+
+Installation
+============
+
+Two perl modules need to be installed before using the application:
+
+    --	HTML::Template.  This is a standard package under Debian,
+    	in Fedora FC3 available via extras.
+    --	Parse::RecDescent.  In Debian known as libparse-recdescent-perl,
+    	in Fedora FC3 as perl-Parse-RecDescent.
+
+Unpack, then configure and install:
+
+	$ ./configure --prefix=$HOME/local
+	$ make install
+
+This installs a main configuration file (.../lib/yaird/conf/Default.cfg)
+that specifies what the generated images should do.  In addition to this,
+a template file is needed, that tunes this for the distribution in use.
+Pick one from the provided examples, and copy it to the default location:
+
+	$ cd $HOME/local/lib/yaird/conf
+	$ cp Debian.cfg Templates.cfg
+
+If you want to regenerate the html documentation, you need the xmlto
+package.
+
+If you're installing from version control rather than a tarball,
+you'll also need to have automake and autoconf available, and
+need to run bootstrap.sh before doing 'configure; make'.
+
+
+Installing with klibc
+=====================
+
+Yaird comes with a small C programs, and to avoid the overhead of the GNU
+C library, you may want to compile this with klibc.  Note however that
+this is only effective if every other program that is copied to the
+initial root filesystem (such as mount, mknod and a shell) is compiled
+in the same manner.
+
+Recent versions of klibc provide klcc, a wrapper around gcc that makes
+it easier to port programs to klibc.  Installation is faily simple;
+the most important point is to make a symlink to a configured linux
+source tree.  The SHLIBDIR determines where the shared library version
+ends up.  If you want to use klibc for programs used early in the
+boot process it makes sense to put it on the root file system.
+
+You will need klibc 1.0.14 or newer.
+
+	$ cd klibc-1.0.14
+	$ ln -s /usr/src/linux... linux
+	$ make bindir=$HOME/local/bin \
+		mandir=$HOME/local/man \
+		INSTALLDIR=$HOME/local \
+		SHLIBDIR=$HOME/local/shlib \
+		install
+	$
+
+Once you have klibc, you can configure yaird to make use of it
+as follows:
+
+	$ ./configure CFLAGS=-static CC=$HOME/local/bin/klcc \
+		--prefix=$HOME/local
+	...
+	$ make install
+
+The use of CFLAGS=-shared is optional.
+
+
+Installing with uclibc
+======================
+
+To use uclibc rather than glibc or klibc:
+ - Install uclibc.
+   on debian, this can be done with "apt-get install uclibc-toolchain".
+ - Verify that /usr/bin/ldd produces correct output for an
+   executable compiled with i386-uclibc-linux-gcc.
+   If this is not the case, reconfigure and rebuild uclibc
+   to support ldd.
+ - configure and build yaird with uclibc:
+
+	$ ./configure CC=i386-uclibc-linux-gcc \
+		--prefix=$HOME/local
+	...
+	$ make install
+
+
+Using the application
+=====================
+
+See the manual page.
+
+
+Using yaird as a replacement for mkinitrd
+=========================================
+
+If you install a new kernel from your distribution, that means
+making a new initial boot image.  The postinstall script that
+comes with the kernel will normally do this using mkinitrd;
+if you want yaird to be used instead, some tweaking is necessary.
+
+For Debian, there is a native package that includes mkinitrd.yaird,
+a wrapper around yaird that uses the same command line conventions
+as mkinitrd.  Place the following line in /etc/kernel-img.conf
+to use yaird as a replacement for mkinitrd:
+
+	ramdisk = /usr/sbin/mkinitrd.yaird
+
+This only works with kernels distributed after june 2005.
+
+For Fedora, you'll have to modify /sbin/new-kernel-package;
+not tested yet.

Added: dists/trunk/utils/yaird/TODO
===================================================================
--- dists/trunk/utils/yaird/TODO	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/TODO	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,20 @@
+Todo:
+	- for the extended config file:
+		- adapt news
+	- verify ext2 => ext3 journal replay: journal should only
+	  be done *after* fsck, so mount as ext2 in initramfs,
+	  then as ext3 in /etc/init.d.
+	- use blkid.  this knows more filesystems than yaird,
+	  plus it knows that ext3 should be ext2 in initramfs.
+	  to be examined.
+	- for cryptsetup, do we need infinite loop around bad
+	  password, or fall into a shell?
+	- what do we need for internationalization?
+	- Fedora 4 no longer ships ash; need an alternative
+	- support loopback devices as root
+	- dmraid - manage software raid controllers.
+	- kernel command line processing: root=,
+	- support multipath
+	- ext2 migration, still necessary?
+	- software suspend support
+	- add Fedora spec file?

Added: dists/trunk/utils/yaird/aclocal.m4
===================================================================
--- dists/trunk/utils/yaird/aclocal.m4	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/aclocal.m4	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,862 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+

Added: dists/trunk/utils/yaird/bootstrap.sh
===================================================================
--- dists/trunk/utils/yaird/bootstrap.sh	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/bootstrap.sh	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,49 @@
+#
+# Bootstrap.sh - generate files needed to configure the package
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Use this if you got yaird from version control and need
+# to generate the configure scripts that come with the tarball.
+#
+# See http://sources.redhat.com/autobook/.
+# See http://www.gnu.org/software/autoconf/manual/autoconf-2.57/
+#
+# V=--verbose
+# Q=--quiet
+# set -x
+
+# to build makefiles for shared libraries
+# libtoolize --force  || exit 1
+
+# copy definitions from /usr/share to ./aclocal.m4
+# for macros that are used in configure.in
+aclocal $V  || exit 1
+
+# use aclocal.m4 to create a configure file from configure.in
+autoconf $V  || exit 1
+
+# Build config.h.in, needed if you have C code.
+autoheader  || exit 1
+
+# transform makefile.am to makefile.in;
+# copy helpful scripts such as install-sh from /usr/share to here.
+automake $V --add-missing  || exit 1
+
+# At this point, the tree can be tarred, transplanted to the target
+# system and installed with:
+# configure --prefix=/home/santaclaus/testing --enable-template=Debian
+# make install

Added: dists/trunk/utils/yaird/configure
===================================================================
--- dists/trunk/utils/yaird/configure	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/configure	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,4406 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="perl/main.pl"
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB XMLTO LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-nuke           Nuke initramfs before moving to real root
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+YAIRD_VERSION=0.0.11
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=yaird
+ VERSION=${YAIRD_VERSION}
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+#
+# Optional feature
+#
+# Check whether --enable-nuke or --disable-nuke was given.
+if test "${enable_nuke+set}" = set; then
+  enableval="$enable_nuke"
+
+		case "${enableval}" in
+		yes) enable_nuke=true ;;
+		no)  enable_nuke=false ;;
+		*) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-nuke" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-nuke" >&2;}
+   { (exit 1); exit 1; }; } ;;
+		esac
+
+else
+
+		enable_nuke=false
+
+fi;
+if test "$enable_nuke" = true; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_NUKE 1
+_ACEOF
+
+fi
+
+# Checks for programs.
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+
+if test -n "$PERL"; then
+  echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+#
+# XML formatting; unclear what processor is most widely available.
+#
+# Extract the first word of "xmlto", so it can be a program name with args.
+set dummy xmlto; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XMLTO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $XMLTO in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_path_XMLTO" && ac_cv_path_XMLTO=":"
+  ;;
+esac
+fi
+XMLTO=$ac_cv_path_XMLTO
+
+if test -n "$XMLTO"; then
+  echo "$as_me:$LINENO: result: $XMLTO" >&5
+echo "${ECHO_T}$XMLTO" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+# Checks for libraries.
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+
+# Use this when we need to compile C programs.
+          ac_config_headers="$ac_config_headers include/config.h"
+
+
+                                                                                          ac_config_files="$ac_config_files Makefile templates/Makefile perl/Makefile doc/Makefile exec/Makefile exec/ipconfig/Makefile exec/nfsmount/Makefile man/Makefile doc/yaird.xml"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "templates/Makefile" ) CONFIG_FILES="$CONFIG_FILES templates/Makefile" ;;
+  "perl/Makefile" ) CONFIG_FILES="$CONFIG_FILES perl/Makefile" ;;
+  "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+  "exec/Makefile" ) CONFIG_FILES="$CONFIG_FILES exec/Makefile" ;;
+  "exec/ipconfig/Makefile" ) CONFIG_FILES="$CONFIG_FILES exec/ipconfig/Makefile" ;;
+  "exec/nfsmount/Makefile" ) CONFIG_FILES="$CONFIG_FILES exec/nfsmount/Makefile" ;;
+  "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+  "doc/yaird.xml" ) CONFIG_FILES="$CONFIG_FILES doc/yaird.xml" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at CYGPATH_W@,$CYGPATH_W,;t t
+s, at PACKAGE@,$PACKAGE,;t t
+s, at VERSION@,$VERSION,;t t
+s, at ACLOCAL@,$ACLOCAL,;t t
+s, at AUTOCONF@,$AUTOCONF,;t t
+s, at AUTOMAKE@,$AUTOMAKE,;t t
+s, at AUTOHEADER@,$AUTOHEADER,;t t
+s, at MAKEINFO@,$MAKEINFO,;t t
+s, at install_sh@,$install_sh,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s, at mkdir_p@,$mkdir_p,;t t
+s, at AWK@,$AWK,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at am__leading_dot@,$am__leading_dot,;t t
+s, at AMTAR@,$AMTAR,;t t
+s, at am__tar@,$am__tar,;t t
+s, at am__untar@,$am__untar,;t t
+s, at PERL@,$PERL,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at DEPDIR@,$DEPDIR,;t t
+s, at am__include@,$am__include,;t t
+s, at am__quote@,$am__quote,;t t
+s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s, at CCDEPMODE@,$CCDEPMODE,;t t
+s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at XMLTO@,$XMLTO,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_dest" : 'X\(//\)[^/]' \| \
+	 X"$ac_dest" : 'X\(//\)$' \| \
+	 X"$ac_dest" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+


Property changes on: dists/trunk/utils/yaird/configure
___________________________________________________________________
Name: svn:executable
   + *

Added: dists/trunk/utils/yaird/configure.in
===================================================================
--- dists/trunk/utils/yaird/configure.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/configure.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,82 @@
+# 
+# configure.in -- what to configure before building the package
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Process this file with autoconf to produce a configure script.
+#
+
+# autoconf claims that this should be package name;
+# but it seems that the name of a randomly choosen but
+# existing file is required.
+AC_INIT(perl/main.pl)
+
+YAIRD_VERSION=0.0.11
+AM_INIT_AUTOMAKE(yaird,${YAIRD_VERSION})
+
+#
+# Optional feature
+#
+AC_ARG_ENABLE(nuke,
+	AC_HELP_STRING([--enable-nuke],
+		[Nuke initramfs before moving to real root]),
+	[
+		case "${enableval}" in
+		yes) enable_nuke=true ;;
+		no)  enable_nuke=false ;;
+		*) AC_MSG_ERROR(bad value ${enableval} for --enable-nuke) ;;
+		esac
+	],[
+		enable_nuke=false
+		])
+if test "$enable_nuke" = true; then
+	AC_DEFINE(ENABLE_NUKE,1,
+		[Define to nuke initramfs before moving to real root])
+fi
+
+# Checks for programs.
+AC_PATH_PROG(PERL,perl)
+AC_PROG_CC
+AC_PROG_RANLIB
+
+#
+# XML formatting; unclear what processor is most widely available.
+#
+AC_PATH_PROG(XMLTO,xmlto,:)
+
+# Checks for libraries.
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+
+# Use this when we need to compile C programs.
+AM_CONFIG_HEADER(include/config.h)
+
+AC_CONFIG_FILES([
+	Makefile
+	templates/Makefile
+	perl/Makefile
+	doc/Makefile
+	exec/Makefile
+	exec/ipconfig/Makefile
+	exec/nfsmount/Makefile
+	man/Makefile
+	doc/yaird.xml
+	])
+AC_OUTPUT()
+

Added: dists/trunk/utils/yaird/debian/cdbs/1/rules/buildinfo.mk
===================================================================
--- dists/trunk/utils/yaird/debian/cdbs/1/rules/buildinfo.mk	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/cdbs/1/rules/buildinfo.mk	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,41 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2004 Jonas Smedegaard <dr at jones.dk>
+# Description: Generate and include build information
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_class_buildinfo
+_cdbs_class_buildinfo := 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), dh-buildinfo
+
+common-install-arch common-install-indep:: debian/stamp-buildinfo
+
+debian/stamp-buildinfo:
+	dh_buildinfo
+
+clean::
+	rm -f debian/stamp-buildinfo
+
+endif

Added: dists/trunk/utils/yaird/debian/changelog
===================================================================
--- dists/trunk/utils/yaird/debian/changelog	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/changelog	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,181 @@
+yaird (0.0.11-4) unstable; urgency=low
+
+  * Patch perl/Parser.pm to allow identifiers with leading digit or
+    containing dash (like loading the modules 3c509 and ne2k-pci).
+  * Suggest doc-base.
+  * Drop ugly workaround for bug#327659 now fixed.
+  * Move configuration files below /etc, and alternatives out as
+    examples.
+
+ -- Jonas Smedegaard <dr at jones.dk>  Thu, 13 Oct 2005 02:56:49 +0200
+
+yaird (0.0.11-3) unstable; urgency=low
+
+  * Release officially for Debian.
+    + Hotplug blacklist is now optional. Fixes bug#325768.
+  * Patch perl/Blacklist.pm to fix typo in above change (thanks to Peter
+    Samuelson <peter at p12n.org>).
+  * Patch perl/KConfig.pm to also accept "= " in values, to work with
+    default Debian powerpc images.
+  * This release also truly closes: bug#324774 (mdadm fixed in unreleased
+    0.0.11-2).
+  * Add ugly workarund in debian/rules for bug#327659.
+
+ -- Jonas Smedegaard <dr at jones.dk>  Mon, 12 Sep 2005 06:03:48 +0200
+
+yaird (0.0.11-2) unstable; urgency=low
+
+  * Bugfix: mdadm.patch, based on upstream revision patch-64.
+    Mdadm 1.9.0 has devices= in normal scan output,
+    in 1.12.0 this info is only produced if --verbose option
+    is given.  With 1.9.0, the -v option produces completely
+    different output, that 1.12.0 only produces if -v is given
+    twice.  We first try to retrieve devices= without -v,
+    if that doesn't work, retry with -v.
+    Closes: #324774.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Thu, 25 Aug 2005 21:11:45 +0200
+
+yaird (0.0.11-1) unstable; urgency=low
+
+  * New upstream version.
+  * depends on libparse-recdescent-perl.
+  * mkinitrd.yaird no longer needs --format option
+  * rules: configure no longer knows --enable-template option
+  * rules: install default templates for debian with simple copy
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sun,  7 Aug 2005 22:10:02 +0200
+
+yaird (0.0.10-5) unstable; urgency=low
+
+  * Release officially for Debian.
+  * Manually strip build-essential from build-dependencies. Closes:
+    bug#317504 (thanks to Jeroen van Wolffelaar <jeroen at wolffelaar.nl>).
+
+ -- Jonas Smedegaard <dr at jones.dk>  Wed, 20 Jul 2005 13:24:32 +0200
+
+yaird (0.0.10-4) unstable; urgency=low
+
+  * add quilt infrastructure
+  * patch: survive missing ide-generic in kernel
+  * patch: allow uppercase and minus in kernel config vars
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sat,  2 Jul 2005 02:16:44 +0200
+
+yaird (0.0.10-3) unstable; urgency=low
+
+  * release officially for Debian.
+  * This truly closes: bug#315298 (improved long description was added
+    in 0.0.9-5).
+
+ -- Jonas Smedegaard <dr at jones.dk>  Wed, 29 Jun 2005 23:27:24 +0200
+
+yaird (0.0.10-2) unstable; urgency=low
+
+  * Avoid tla junk in generated diff.gz.
+    (no change to the package itself, just generated with different
+    dpkg-buildpackage options)
+  * Update of control file in build restored but optional:
+    set DEB_BUILD_OPTIONS=update in environment to make it happen.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Wed, 29 Jun 2005 21:44:14 +0200
+
+yaird (0.0.10-1) unstable; urgency=low
+
+  * Fix bug introduced in 0.0.9-1:
+    nfs runtime support was included, but necessary template missing.
+  * New upstream:
+     - Support legacy keyboard compiled as module.
+  * Claim compliance to policy 3.6.2.0:
+     - yes, we do docbase
+     - yes, support programs live under /usr/lib
+     - n/a, we're not a web server.
+  * Don't do automatic update of control file in build;
+    this goes against http://release.debian.org/etch_rc_policy.txt
+    (plus it's way too error prone)
+
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Tue, 28 Jun 2005 23:37:31 +0200
+
+yaird (0.0.9-5) unstable; urgency=low
+
+  * More to the point description.  Closes: #315298.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sun, 26 Jun 2005 22:25:30 +0200
+
+yaird (0.0.9-4) unstable; urgency=low
+
+  * Packaged officially for Debian, using the excellent packaging files
+    from upstream.
+  * Leaving bug#315298 open, to allow upstream to do the rewording of
+    long description.
+
+ -- Jonas Smedegaard <dr at jones.dk>  Sun, 26 Jun 2005 14:27:23 +0200
+
+yaird (0.0.9-3) unstable; urgency=low
+
+  * Sigh.  Really adapt architecture.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sat, 25 Jun 2005 19:20:35 +0200
+
+yaird (0.0.9-2) unstable; urgency=low
+
+  * really adapt maintainer name this time.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sat, 25 Jun 2005 18:36:40 +0200
+
+yaird (0.0.9-1) unstable; urgency=low
+
+  * new upstream:
+  * FSF change of address
+  * yaird html doc is GPL now, not GFDL.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sat, 25 Jun 2005 16:19:04 +0200
+
+yaird (0.0.8-4) unstable; urgency=low
+
+  * mkinitrd.yaird no longer verbose.
+  * adapt FSF address in GPL notices;
+    debian part only, address in tarball waits for 0.0.9.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Sat, 25 Jun 2005 15:32:07 +0200
+
+yaird (0.0.8-3) unstable; urgency=low
+
+  * Prepare for inclusion in official debian archive:
+  * Set new maintainer: Jonas Smedegaard <dr at jones.dk>
+  * Architecture: any.
+  * support buildinfo.
+  * add watch file.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Fri, 24 Jun 2005 21:20:41 +0200
+
+yaird (0.0.8-2) unstable; urgency=low
+
+  * Note the use of ramdisk= in /etc/kernel-img.conf.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Fri, 17 Jun 2005 12:31:59 +0200
+
+yaird (0.0.8-1) unstable; urgency=low
+
+  * New upstream release.
+  * Change maintainer.
+  * Install html doc.
+    Some tla crap left, unavoidable given dh_installdocs interface.
+  * builddepend on xmlto
+  * mkinitrd wrapper to debian subdir to minimize changes to orig tarball
+  * mkinitrd wrapper format hardcoded to cpio format and /usr/sbin/ as
+    directory
+  * added doc-base file
+  * added mkinitrd.yaird.8 manual page.
+  * build-depends still to be done.
+  * copyright closer to example from new-maint guide.
+
+ -- Erik van Konijnenburg <ekonijn at xs4all.nl>  Thu,  9 Jun 2005 23:09:30 +0200
+
+yaird (0.0.6-1) unstable; urgency=low
+
+  * Initial Debian package.
+
+ -- Steven Ihde <sihde at hamachi.us>  Fri,  6 May 2005 21:23:22 -0700
+

Added: dists/trunk/utils/yaird/debian/compat
===================================================================
--- dists/trunk/utils/yaird/debian/compat	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/compat	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1 @@
+4

Added: dists/trunk/utils/yaird/debian/control
===================================================================
--- dists/trunk/utils/yaird/debian/control	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/control	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,38 @@
+Source: yaird
+Section: utils
+Priority: optional
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27-1), dh-buildinfo, xmlto
+Maintainer: Jonas Smedegaard <dr at jones.dk>
+Standards-Version: 3.6.2.0
+
+Package: yaird
+Architecture: any
+Depends: ${shlibs:Depends}, ${perl:Depends}, libhtml-template-perl, dash, libparse-recdescent-perl
+Suggests: doc-base
+Description: Yet Another mkInitRD
+ Yaird generates initial boot images in initramfs format.
+ The boot image is an intermediate step between the boot loader
+ (eg Grub, Lilo) and the init scripts on the root file system;
+ it loads modules and enables devices to a level where the kernel
+ can access the real root file system, and then hands over control
+ to the init scripts.
+ .
+ Compared with earlier implementations like mkinitrd, it does a
+ better job of deciding which modules are needed for your system,
+ so it produces smaller images and there is less risk of making
+ an image that will not boot.  This comes at a price:
+ only Linux 2.6 is supported (because 2.6 has sysfs, which makes
+ it a lot easier to do a hardware inventory).
+ .
+ See mkinitrd.yaird(8) for how to activate the program.
+ .
+ Supported: SATA, IDE, LVM2, mdadm, cryptsetup, cryptsetup-luks
+ (cryptsetup-luks is not yet in the official Debian distribution),
+ USB keyboards, NFS root.
+ .
+ Untested: USB storage, SCSI.
+ .
+ Not yet supported: EVMS, swsusp, firewire, DASD, loopback, loopaes,
+ dmraid (dmraid is not yet in Debian).
+ .
+ At the moment, yaird is lightly tested.

Added: dists/trunk/utils/yaird/debian/control.in
===================================================================
--- dists/trunk/utils/yaird/debian/control.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/control.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,38 @@
+Source: yaird
+Section: utils
+Priority: optional
+Build-Depends: @cdbs@, xmlto
+Maintainer: Jonas Smedegaard <dr at jones.dk>
+Standards-Version: 3.6.2.0
+
+Package: yaird
+Architecture: any
+Depends: ${shlibs:Depends}, ${perl:Depends}, libhtml-template-perl, dash, libparse-recdescent-perl
+Suggests: doc-base
+Description: Yet Another mkInitRD
+ Yaird generates initial boot images in initramfs format.
+ The boot image is an intermediate step between the boot loader
+ (eg Grub, Lilo) and the init scripts on the root file system;
+ it loads modules and enables devices to a level where the kernel
+ can access the real root file system, and then hands over control
+ to the init scripts.
+ .
+ Compared with earlier implementations like mkinitrd, it does a
+ better job of deciding which modules are needed for your system,
+ so it produces smaller images and there is less risk of making
+ an image that will not boot.  This comes at a price:
+ only Linux 2.6 is supported (because 2.6 has sysfs, which makes
+ it a lot easier to do a hardware inventory).
+ .
+ See mkinitrd.yaird(8) for how to activate the program.
+ .
+ Supported: SATA, IDE, LVM2, mdadm, cryptsetup, cryptsetup-luks
+ (cryptsetup-luks is not yet in the official Debian distribution),
+ USB keyboards, NFS root.
+ .
+ Untested: USB storage, SCSI.
+ .
+ Not yet supported: EVMS, swsusp, firewire, DASD, loopback, loopaes,
+ dmraid (dmraid is not yet in Debian).
+ .
+ At the moment, yaird is lightly tested.

Added: dists/trunk/utils/yaird/debian/copyright
===================================================================
--- dists/trunk/utils/yaird/debian/copyright	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/copyright	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,46 @@
+This package was debianized by Steven Ihde <sihde at hamachi.us>  on
+Fri,  6 May 2005 21:23:22 -0700
+
+It was downloaded from: http://www.xs4all.nl/~ekonijn/yaird/
+
+Upstream author: Erik van Konijnenburg <ekonijn at xs4all.nl>
+
+This software is copyright (c) 2005 Erik van Konijnenburg
+
+You are free to distribute this software under the terms of
+the GNU General Public License.
+On Debian systems, the complete text of the GNU General Public
+License can be found in the file `/usr/share/common-licenses/GPL'.
+
+Yaird contains code based on klibc; this code is made available
+by the author under the following licence.  The relevant source
+files have this copyright notice included.
+
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *   
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *   
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+

Added: dists/trunk/utils/yaird/debian/docs
===================================================================
--- dists/trunk/utils/yaird/debian/docs	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/docs	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,2 @@
+doc/yaird.html
+doc/figures/

Added: dists/trunk/utils/yaird/debian/mkinitrd.yaird
===================================================================
--- dists/trunk/utils/yaird/debian/mkinitrd.yaird	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/mkinitrd.yaird	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# mkinitrd - emulate mkinitrd with yaird for kernel-image installs.
+#
+# Copyright (C) 2001-2003 Herbert Xu <herbert at debian.org>
+# Copyright (C) 2005 Erik van Konijnenburg <ekonijn at xs4all.nl>
+#		- ripped out everything but the options.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+
+PROG=mkinitrd.yaird
+outfile=''
+
+while getopts "d:km:o:r:" flag; do
+	case $flag in
+	d)
+		echo "$PROG: $flag unsupported"
+		exit 1
+		;;
+	k)
+		echo "$PROG: $flag unsupported"
+		exit 1
+		;;
+	m)
+		# ignore 
+		;;
+	o)
+		outfile="$OPTARG"
+		;;
+	r)
+		echo "$PROG: $flag unsupported"
+		exit 1
+		;;
+	*)
+		echo "$PROG: unknown option $flag"
+		exit 1
+		;;
+	esac
+done
+shift $(($OPTIND - 1))
+
+if [ "$outfile" = "" ]; then
+	echo "$PROG: no output file specified"
+	exit 1
+fi
+if [ $# -gt 1 ]; then
+	echo "$PROG: extra arguments found"
+	exit 1
+fi
+
+# Note that version may be a pathname;
+# this is used by the installer for Debian kernel image packages.
+VERSION=$1
+[ $# -gt 0 ] || unset VERSION
+case $VERSION in
+/lib/modules/*/[!/]*)
+	;;
+/lib/modules/[!/]*)
+	VERSION=${VERSION#/lib/modules/}
+	VERSION=${VERSION%%/*}
+	;;
+esac
+
+case $VERSION in
+*/*)
+	echo $PROG: $VERSION is not a valid kernel version >&2
+	exit 1
+	;;
+esac
+
+VERSION="${VERSION-$(uname -r)}"
+
+exec /usr/sbin/yaird --output "$outfile" "$VERSION"

Added: dists/trunk/utils/yaird/debian/mkinitrd.yaird.8
===================================================================
--- dists/trunk/utils/yaird/debian/mkinitrd.yaird.8	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/mkinitrd.yaird.8	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,48 @@
+.TH MKINITRD.YAIRD 8
+.SH NAME
+mkinitrd.yaird \- mkinitrd for initramfs
+.SH SYNOPSIS
+.B mkinitrd.yaird
+.BI -o destination
+.RI [ version ]
+.SH DESCRIPTION
+.I Mkinitrd.yaird
+is a wrapper around
+.IR yaird (8)
+that accepts the same command line arguments as the Debian program
+.IR mkinitrd (8),
+a tool to create an initial boot image.
+.P
+To let
+.I yaird
+build the initial boot image when a Debian kernel package is installed,
+rather than the default
+.IR mkinitrd ,
+put the following line in 
+.IR /etc/kernel-img.conf :
+
+.RS
+ramdisk = /usr/sbin/mkinitrd.yaird
+.RE
+
+Support for the ramdisk variable is built into the kernel package;
+it is available in Debian kernels packaged since june 2005.
+.SH OPTIONS
+.TP
+.BI "-o" destination
+Place result here.
+The destination must not exist yet.
+There is no default for this option.
+.TP
+.BI "-m" command
+This option is ignored.
+.TP
+version
+The kernel version for which the initial boot image
+is to be generated.
+.SH AUTHOR
+Erik van Konijnenburg <ekonijn at xs4all.nl>
+.SH SEE ALSO
+.IR yaird (8),
+.IR mkinitrd (8),
+.IR kernel-img.conf (5).

Added: dists/trunk/utils/yaird/debian/patches/hotplug-typo.patch
===================================================================
--- dists/trunk/utils/yaird/debian/patches/hotplug-typo.patch	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/patches/hotplug-typo.patch	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,13 @@
+Index: yaird-0.0.11/perl/Blacklist.pm
+===================================================================
+--- yaird-0.0.11.orig/perl/Blacklist.pm.orig	2005-08-07 22:57:40.000000000 +0200
++++ yaird-0.0.11.orig/perl/Blacklist.pm	2005-09-12 05:48:43.000000000 +0200
+@@ -36,7 +36,7 @@
+ 	}
+ 	my $blackMap = {};
+ 	my $hotplugDir = Conf::get ('hotplug');
+-	my $blackListName = "hotplugDir/blacklist";
++	my $blackListName = "$hotplugDir/blacklist";
+ 	if (-e $blackListName) {
+ 		# The blacklist does not have to exist:
+ 		# there are machines without hotplug,

Added: dists/trunk/utils/yaird/debian/patches/kconf-check.patch
===================================================================
--- dists/trunk/utils/yaird/debian/patches/kconf-check.patch	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/patches/kconf-check.patch	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,26 @@
+Replace-subject: allow space and equals sign in kernel config vars
+
+Forgot to report that the earlier fix was not enough (should be obvious
+now that it is pointed out):
+
+yaird error: bad value in /boot/config-2.6.13-git10+squashfs+wrr+fbsplash:
+CONFIG_CMDLINE="console=ttyS0,9600 console=tty0" (fatal)
+
+yaird error: bad value in /boot/config-2.6.13-git10+squashfs+wrr+fbsplash:
+CONFIG_CMDLINE="console=ttyS0,9600 console=tty0" (fatal)
+
+Fix: Allow " =" in KConfig.pm line 69.
+
+Index: yaird-0.0.10/perl/KConfig.pm
+===================================================================
+--- yaird-0.0.10.orig/perl/KConfig.pm	2005-07-02 01:31:43.000000000 +0200
++++ yaird-0.0.10/perl/KConfig.pm	2005-07-02 01:33:30.000000000 +0200
+@@ -66,7 +66,7 @@
+ 			|| $value eq 'm'
+ 			|| $value =~ /^-?\d+$/
+ 			|| $value =~ /^0x[0-9a-f]+$/
+-			|| $value =~ /^"[-a-zA-Z0-9,._\/]*"$/
++			|| $value =~ /^"[-a-zA-Z0-9,._\/= ]*"$/
+ 		) {
+ 			$kConfMap->{$key} = $value;
+ 		}

Added: dists/trunk/utils/yaird/debian/patches/mdadm.patch
===================================================================
--- dists/trunk/utils/yaird/debian/patches/mdadm.patch	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/patches/mdadm.patch	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,114 @@
+Replace-subject: support mdadm > 1.9.0 output
+
+    Bugfix: mdadm.patch, based on upstream revision patch-64.
+    Mdadm 1.9.0 has devices= in normal scan output,
+    in 1.12.0 this info is only produced if --verbose option
+    is given.  With 1.9.0, the -v option produces completely
+    different output, that 1.12.0 only produces if -v is given
+    twice.  We first try to retrieve devices= without -v,
+    if that doesn't work, retry with -v.
+    Closes: #324774.
+
+Index: yaird-0.0.11/perl/RaidTab.pm
+===================================================================
+--- yaird-0.0.11.orig/perl/RaidTab.pm	2005-08-08 22:58:58.000000000 +0200
++++ yaird-0.0.11/perl/RaidTab.pm	2005-08-25 21:23:40.000000000 +0200
+@@ -32,36 +32,86 @@
+ my $raidTab = undef;
+ 
+ 
+-sub init () {
+-	if (defined ($raidTab)) {
+-		return;
+-	}
++#
++# getCommandOutput -- all lines of output for a given command or fatal
++#
++sub getCommandOutput ($) {
++	my ($cmd) = @_;
+ 
+-	# my $name = Conf::get('fstab');
+-	$raidTab = [];
+ 	my $in;
+-	if (! open ($in, "-|", "/sbin/mdadm --detail --scan")) {
+-		Base::fatal ("Can't read mdadm output");
++	if (! open ($in, "-|", $cmd)) {
++		Base::fatal ("Can't read output for $cmd");
+ 	}
+ 	my @lines = <$in>;
+ 	if (! close ($in)) {
+-		Base::fatal ("Could not read mdadm output");
++		Base::fatal ("Could not read output for $cmd");
+ 	}
++	return [ @lines ];
++}
++
++
++#
++# joinStanzas -- given a list of lines, return list where indented
++# continuation lines are joined with predecessor.
++#
++sub joinStanzas ($) {
++	my ($lines) = @_;
++	my @result = ();
+ 	my $buf;
+-	for my $line (@lines) {
++	for my $line (@{$lines}) {
+ 		chomp $line;
+ 		if ($line =~ /^\s+/) {
+ 			$buf = $buf . $line;
+ 		}
+ 		else {
+ 			if (defined ($buf)) {
+-				processLine ($buf);
++				push @result, $buf;
+ 			}
+ 			$buf = $line;
+ 		}
+ 	}
+ 	if (defined ($buf)) {
+-		processLine ($buf);
++		push @result, $buf;
++	}
++	return [ @result ];
++}
++
++
++#
++# init -- initialise table of all known raid devices.
++#
++# Sigh.  Mdadm 1.9.0 has devices= in normal scan output,
++# in 1.12.0 this info is only produced if --verbose option
++# is given.  With 1.9.0, the -v option produces completely
++# different output, that 1.12.0 only produces if -v is given
++# twice.  We first try to retrieve devices= without -v,
++# if that doesn't work, retry with -v.  See Debian Bug#324774.
++#
++sub init () {
++	if (defined ($raidTab)) {
++		return;
++	}
++
++	$raidTab = [];
++
++	my $lines = joinStanzas (getCommandOutput
++			("/sbin/mdadm --detail --scan"));
++
++	if (@{$lines} <= 0) {
++		# no output and no error: done.
++		return;
++	}
++
++	if ($lines->[0] !~ /\sdevices=/) {
++		# output, but without the devices part,
++		# lets retry.
++		# Note: don't be deceived by the num-devices=... clause.
++		$lines = joinStanzas (getCommandOutput
++			("/sbin/mdadm --detail --scan --verbose"));
++	}
++
++	for my $line (@{$lines}) {
++		processLine ($line);
+ 	}
+ }
+ 

Added: dists/trunk/utils/yaird/debian/patches/module-loading_with_digit_or_dash.patch
===================================================================
--- dists/trunk/utils/yaird/debian/patches/module-loading_with_digit_or_dash.patch	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/patches/module-loading_with_digit_or_dash.patch	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,20 @@
+--- yaird-0.0.11.orig/perl/Parser.pm
++++ yaird-0.0.11/perl/Parser.pm
+@@ -168,7 +168,7 @@
+ 		# these identifiers to have same name as reserved
+ 		# words in config language, so no need to quote.
+ 		#
+-identifier :	/[A-Za-z][A-Za-z0-9_]*/
++identifier :	/[A-Za-z0-9][A-Za-z0-9_-]*/
+ 	      |	<error>
+ 
+ 
+@@ -395,7 +395,7 @@
+ 		# these identifiers to have same name as reserved
+ 		# words in config language, so no need to quote.
+ 		#
+-identifier :	/[A-Za-z][A-Za-z0-9_]*/
++identifier :	/[A-Za-z0-9][A-Za-z0-9_-]*/
+ 	      |	<error>
+ 
+ 

Added: dists/trunk/utils/yaird/debian/patches/series
===================================================================
--- dists/trunk/utils/yaird/debian/patches/series	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/patches/series	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,4 @@
+mdadm.patch
+hotplug-typo.patch
+kconf-check.patch
+module-loading_with_digit_or_dash.patch

Added: dists/trunk/utils/yaird/debian/rules
===================================================================
--- dists/trunk/utils/yaird/debian/rules	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/rules	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,30 @@
+#!/usr/bin/make -f
+
+#
+# Put DEB_BUILD_OPTIONS=update in environment
+# to force control to be regenerated from control.in
+#
+ifneq (,$(findstring update,$(DEB_BUILD_OPTIONS)))
+DEB_AUTO_UPDATE_DEBIAN_CONTROL := yes
+endif
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+include debian/cdbs/1/rules/buildinfo.mk
+
+DEB_DH_PERL_ARGS = /usr/lib/yaird/perl
+
+# dh_install cannot handle rename,
+# so need an explicit rule here.
+common-install-arch::
+	cp templates/Debian.cfg debian/yaird/usr/lib/yaird/conf/Templates.cfg
+
+# Move configuration files below /etc, and alternatives out as examples
+binary-post-install/yaird::
+	mv $(DEB_DESTDIR)/usr/lib/yaird/conf $(DEB_DESTDIR)/usr/share/doc/yaird/examples
+	mkdir -p $(DEB_DESTDIR)/etc/yaird $(DEB_DESTDIR)/usr/lib/yaird/conf
+	for cfgfile in Default.cfg Templates.cfg; do \
+		mv $(DEB_DESTDIR)/usr/share/doc/yaird/examples/$$cfgfile $(DEB_DESTDIR)/etc/yaird; \
+		ln -s /etc/yaird/$$cfgfile $(DEB_DESTDIR)/usr/lib/yaird/conf/$$cfgfile; \
+	done


Property changes on: dists/trunk/utils/yaird/debian/rules
___________________________________________________________________
Name: svn:executable
   + *

Added: dists/trunk/utils/yaird/debian/watch
===================================================================
--- dists/trunk/utils/yaird/debian/watch	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/watch	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,3 @@
+# run the "uscan" command to check for upstream updates and more.
+version=3
+http://www.xs4all.nl/~ekonijn/yaird/yaird-(.*)\.tar\.gz	debian	uupdate

Added: dists/trunk/utils/yaird/debian/yaird.doc-base
===================================================================
--- dists/trunk/utils/yaird/debian/yaird.doc-base	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/yaird.doc-base	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,17 @@
+Document: yaird
+Title: Yaird -- Yet Another Mkinitrd
+Author: Erik van Konijnenburg
+Abstract:  This memo discusses the design goals and implementation of
+ Yaird (Yet Another mkInitRD), a proof-of-concept application to create
+ an initial boot image, a minimal filesystem used to bring a booting
+ Linux kernel to a level where it can access the root file system and
+ use startup scripts to bring the system to the normal run level. It
+ differs from earlier mkinitrd implementations in that it leverages the
+ information in sysfs to minimise the number of special cases that the
+ application has to know about, and in that it uses a template system to
+ separate the analysis of the system from the building of the image.
+Section: admin
+
+Format: HTML
+Index: /usr/share/doc/yaird/yaird.html
+Files: /usr/share/doc/yaird/yaird.html

Added: dists/trunk/utils/yaird/debian/yaird.install
===================================================================
--- dists/trunk/utils/yaird/debian/yaird.install	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/yaird.install	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1 @@
+debian/mkinitrd.yaird usr/sbin

Added: dists/trunk/utils/yaird/debian/yaird.manpages
===================================================================
--- dists/trunk/utils/yaird/debian/yaird.manpages	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/debian/yaird.manpages	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1 @@
+debian/mkinitrd.yaird.8

Added: dists/trunk/utils/yaird/depcomp
===================================================================
--- dists/trunk/utils/yaird/depcomp	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/depcomp	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:


Property changes on: dists/trunk/utils/yaird/depcomp
___________________________________________________________________
Name: svn:executable
   + *

Added: dists/trunk/utils/yaird/doc/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/doc/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,49 @@
+#
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Quick hack of a makefile, based on dia xml documentation.
+# using the XSL sheets with xsltproc is a lot quicker than
+# using jade via db2html; the generated html also is a lot more
+# readable.  On the other hand, jade's validation looks more robust.
+#
+
+noinst_DATA	= yaird.html
+CLEANFILES	= $(noinst_DATA)
+
+yaird.html: $(EXTRA_DIST) yaird.xml
+	$(XMLTO) xhtml-nochunks yaird.xml
+
+
+
+# not compiled, but must go in the tarball.
+EXTRA_DIST = \
+	authors.xml \
+	concepts.xml \
+	crypto.xml \
+	figures/console.dia \
+	figures/console.png \
+	input.xml \
+	intro.xml \
+	kernel.xml \
+	license.xml \
+	nfs.xml \
+	raid.xml \
+	security.xml \
+	shlibs.xml \
+	spec.xml \
+	tools.xml

Added: dists/trunk/utils/yaird/doc/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/doc/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,328 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Quick hack of a makefile, based on dia xml documentation.
+# using the XSL sheets with xsltproc is a lot quicker than
+# using jade via db2html; the generated html also is a lot more
+# readable.  On the other hand, jade's validation looks more robust.
+#
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = doc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/yaird.xml.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES = yaird.xml
+SOURCES =
+DIST_SOURCES =
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+noinst_DATA = yaird.html
+CLEANFILES = $(noinst_DATA)
+
+# not compiled, but must go in the tarball.
+EXTRA_DIST = \
+	authors.xml \
+	concepts.xml \
+	crypto.xml \
+	figures/console.dia \
+	figures/console.png \
+	input.xml \
+	intro.xml \
+	kernel.xml \
+	license.xml \
+	nfs.xml \
+	raid.xml \
+	security.xml \
+	shlibs.xml \
+	spec.xml \
+	tools.xml
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  doc/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+yaird.xml: $(top_builddir)/config.status $(srcdir)/yaird.xml.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/figures
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+
+yaird.html: $(EXTRA_DIST) yaird.xml
+	$(XMLTO) xhtml-nochunks yaird.xml
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/doc/authors.xml
===================================================================
--- dists/trunk/utils/yaird/doc/authors.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/authors.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,9 @@
+<section id="authors-chap">
+  <title>Authors</title>
+  <para>
+   This is a place holder section.
+   <application>Yaird</application> was written by ...
+   website here ... comments to ... bug reports ...
+  </para>
+ 
+</section>

Added: dists/trunk/utils/yaird/doc/concepts.xml
===================================================================
--- dists/trunk/utils/yaird/doc/concepts.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/concepts.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,566 @@
+<section id="concepts">
+  <title>Concepts</title>
+  <para>
+    This section discusses the basic concepts underlying
+    <application>yaird</application>.
+    The main procedure of the program is this:
+    <programlisting>
+      #
+      # go -- main program:
+      # write an image to destination in specified format.
+      # destination must not exist yet.
+      # templates define how actions in masterplan are expanded.
+      #
+      sub go ($$) {
+	      my ($config, $destination) = @_;
+	      my $masterPlan = Plan::makePlan ($config->{goals});
+	      my $image = $masterPlan->expand ($config->{templates});
+	      Pack::package ($image, $config->{format}, $destination);
+      }
+    </programlisting>
+
+    What it does is simple:
+    <orderedlist>
+
+      <listitem>
+	<para>
+	  given some goals, make a plan with a number of actions
+	  that the generated image should execute;
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  transform the plan to a detailed description of the image;
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  build and pack the image.
+	</para>
+      </listitem>
+
+    </orderedlist>
+
+  </para>
+
+  <simplesect>
+    <title>About Goals</title>
+
+    <para>
+      The generated initial boot image should achieve a number of goals
+      before handing over control to the root file system.  There is a
+      configuration file that determines what these goals are; the
+      default list of goals is as follows:
+      <programlisting>
+	GOALS
+		TEMPLATE	prologue
+		INPUT
+		MODULE		mousedev
+		MODULE		evdev
+		MOUNTDIR	"/" "/mnt"
+		TEMPLATE	postlude
+	END GOALS
+      </programlisting>
+    </para>
+
+    <para>
+      The complete list of goals that <application>yaird</application>
+      knows about is as follows:
+
+      <variablelist>
+	
+	<varlistentry>
+	  <term>
+	    TEMPLATE name
+	  </term>
+	  <listitem>
+	    <para>
+	      Add the contents of the named template to the image.
+	      It is not possible to pass arguments to the template.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    MODULE name
+	  </term>
+	  <listitem>
+	    <para>
+	      Add the named module to the image.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    INPUT
+	  </term>
+	  <listitem>
+	    <para>
+	      Add modules for every keyboard device found on the
+	      system to the image.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    NETWORK
+	  </term>
+	  <listitem>
+	    <para>
+	      Add modules for every ethernet device found on the
+	      system to the image.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    MOUNTDIR fsdir mountPoint
+	  </term>
+	  <listitem>
+	    <para>
+	      Given a directory that occurs in /etc/fstab,
+	      get the underlying block device and file system type
+	      working, then mount it at mountPoint.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    MOUNTDEV blockDevice mountPoint
+	  </term>
+	  <listitem>
+	    <para>
+	      Given a block device that occurs in /etc/fstab,
+	      get the block device and corresponding file system type
+	      working, then mount it at mountPoint.
+	      It is not possible to express activating a block device
+	      without mounting it somewhere.
+	    </para>
+	  </listitem>
+	</varlistentry>
+      </variablelist>
+      It is likely that new types of goal will need to be introduced
+      to support features such as software suspend.
+    </para>
+
+  </simplesect>
+
+  <simplesect>
+    <title>Making the Plan</title>
+
+    <para>
+      The goals listed in the configuration file need to be translated
+      into actions to be taken by the generated image.
+      As an example, before mounting a file system, the modules containing
+      the implementation of the file system need to be loaded.
+    </para>
+
+    <para>
+      To refine the goal of loading a kernel module,
+      the <code>ModProbe</code> module invokes the
+      <application>modprobe</application> command to find any
+      prerequisite modules, skipping any modules that are blacklisted
+      or compiled into the kernel.  Aliases are handled transparantly
+      by modprobe, module options are recorded to be included in the
+      initial image.
+      If the
+      <application>modprobe</application> command decides a module
+      needs an install command, an error is generated because we
+      cannot in general determine which executables the install
+      command would need to be on the initial boot image.
+    </para>
+
+    <para>
+      The <code>KConfig</code> module determines if loading a
+      module can be omitted because the module is hardcoded into the
+      kernel.  As an example, it is aware of the fact that the module
+      <code>ext3</code> is not needed if the new kernel configuration
+      contains <code>CONFIG_EXT3_FS=y</code>.<footnote>
+	<para>
+	  Having knowledge of the relation between module names and
+	  kernel defines hardcoded into <application>yaird</application>
+	  is hardly elegant.  Perhaps it is possible to generate this
+	  mapping based on the kernel Makefiles when building the
+	  kernel, but that's too complex just now.
+	</para>
+      </footnote>
+      Only a few modules are known: <application>yaird</application>
+      looks for modules such as <code>ext3</code> when that filesystem
+      is used, so it makes sense to check whether a missing module
+      is compiled in.  On the other hand, hardware modules that are
+      compiled in never show up in <filename>modules.pcimap</filename>
+      and friends, so they remain completely outside the view of
+      <application>yaird</application>.
+    </para>
+
+    <para>
+      Before a device as listed in <filename>/etc/fstab</filename> can be
+      mounted, that device needs to be enabled.  That device could be an
+      NFS mount, a loopback mount or it could be a block device.
+      The loopback case is not supported yet, but block devices are.
+      This support is based on a number of sources of information:
+      <orderedlist>
+
+	<listitem>
+	  <para>
+	    Scanning the <filename>/dev</filename> directory gives us the
+	    relation between all block special files and major/minor
+	    numbers.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    Scanning the <filename>/sys/block</filename> directory gives us the
+	    relation between all major/minor numbers and kernel names
+	    such as <code>dm-0</code> or <code>sda1</code>; it
+	    also gives the relation between partitions and complete
+	    devices.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    If there is a symlink in a <filename>/sys/block</filename>
+	    subdirectory to the <filename>/sys/devices</filename>
+	    directory, it also gives is the relation between a block
+	    device and the underlying hardware.
+	  </para>
+	</listitem>
+
+      </orderedlist>
+    </para>
+
+    <para>
+      Based on the kernel name and partition relationships of the device,
+      we determine the steps needed to activate the device.  As an example,
+      to activate <code>sda1</code>, we need to activate <code>sda</code>,
+      then create a block special file for <code>sda1</code>.  As
+      another example, to activate <code>dm-0</code>, our first bet is
+      to check whether this is an LVM logical volume, and if so activate the
+      physical volumes underlying the volume group, and finally running
+      <code>vgchange -a y</code>.
+      Otherwise, it could be an encrypted device, for which we
+      generate different code.
+    </para>
+  </simplesect>
+
+  <simplesect>
+    <title>Hardware Planning</title>
+
+    <para>
+      Some devices, such as <code>sdx</code> or <code>hdy</code>, are
+      expected to have underlying hardware; as an example, <code>sda</code>
+      may be backed by <code>pci0000:00/0000:00:1f.2/host0/0:0:0:0</code>.
+      This represents a hardware path, in this case a controller on the PCI
+      bus that connects to a SCSI device.  In order to use the device,
+      every component on the path needs to be activated, the component
+      closest to the CPU first.
+      Based on the pathname in <filename>/sys/devices</filename> and on
+      files within the directory for the component, we can determine
+      what kind of component we're dealing with, and how to find the
+      required modules.
+    </para>
+
+    <para>
+      Finding modules closely follows the methods used in the
+      <application>hotplug</application> package, and the
+      <application>hotplug</application> approach in turn is an almost
+      literal translation of the code that the kernel uses to find a
+      driver for a newly detected piece of hardware.
+    </para>
+
+    <para>
+      For components that talk some protocol over a bus, like SCSI or
+      IDE disks or CDROMs, this is a simple hard coded selection; as an
+      example, the <code>ScsiDev</code> module knows that a SCSI device
+      with a <filename>type</filename> file containing "5" is a CDROM,
+      and that <code>sr-mod</code> is the appropriate driver.
+    </para>
+
+    <para>
+      Devices such as PCI or USB devices cannot be classified into
+      a few simple categories.  These devices have properties such
+      as "Vendor", "Device" and "Class" that are visible in sysfs.
+      The source code of kernel driver modules for these devices
+      contains a table listing which combination of properties mark a
+      device that the driver is prepared to handle.  When the kernel
+      is compiled, these tables are summarised in a text file such
+      as <filename>modules.pcimap</filename>.  Based on this table,
+      we find a driver module needed for the device and mark it for
+      inclusion on the image.
+    </para>
+
+    <para>
+      Multiple modules can match the same hardware: as an example,
+      <code>usb-storage</code> and <code>ub</code> both match an USB
+      stick.  In such cases, we load all matching modules into the
+      kernel and leave it to kernel to decide who gets to manage the
+      device.  There's one complication: some modules, such as
+      <code>usb-core</code>, match any device (probably to maintain some
+      administration of their own, or to provide an ultra-generic
+      interface), but do not actually provide access to the device.
+      Such devices are weeded out by the <code>Blacklist</code> module,
+      based on information in
+      <filename>/etc/hotplug/blacklist</filename> and
+      <filename>/etc/hotplug/blacklist.d</filename>.
+    </para>
+
+    <para>
+      It turns out that the "load modules for every component in the sysfs
+      path" approach is not always sufficient: sometimes you have to load
+      siblings as well.  As an example, consider a combined EHCI/UHCI
+      USB controller on a single chip.  The same ports can show up as EHCI
+      or UHCI devices, different PCI functions in the same PCI slot, with
+      different sysfs directories, depending on what kind of hardware is
+      connected.  Purely following the sysfs path, we would only need to load
+      the EHCI driver, but it appears that on this kind of chip, EHCI devices
+      are not reliably detected unless the UHCI driver is loaded as well.
+      For this reason, we extend the algorithm with a rule: "for PCI devices,
+      load modules for every function in the PCI slot".
+    </para>
+
+    <para>
+      That's actually a bit much: it would load all of ALSA if you have a
+      combined ISA/IDE/USB/Multimedia chipset.  So we limit the above
+      to those PCI functions that provide USB ports.
+    </para>
+
+  </simplesect>
+
+  <simplesect>
+    <title>Plan Transformation</title>
+
+    <para>
+      The plan generated in the first phase is a collection of general
+      intentions, stuff like 'load this module', but it does not
+      specify exactly what files must be placed on the image and what
+      lines are to be added to the initialisation scripts.
+    </para>
+
+    <para>
+      The module <code>ActionList</code> represents this plan with a
+      list of hashes; every hash contains at least 'action' and
+      'target', with other keys added to provide extra information
+      as needed.  If two steps in the plan have identical action and
+      target, the last one is considered redundant and silently omitted.
+    </para>
+
+    <para>
+      This plan is transformed to an exact image description with
+      the help of templates.
+      
+      These templates are read from a configuration file; for every
+      type of action they can contain:
+      <itemizedlist>
+	<listitem>
+	  <para>
+	    files to be copied from the mother system to the 
+	    same location on the image;
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    directories to be created on the image; these do
+	    not have to exist on the mother system;
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    trees to be copied recursively from the mother
+	    system to the image;
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    script fragments: a few lines of code to be appended to
+	    the named file on the image.
+	  </para>
+	</listitem>
+      </itemizedlist>
+      All of the above are fed through HTML-Template, with the hash
+      describing this action as parameters.  In practice, this looks
+      like so:
+      <programlisting>
+	#
+	# Template -- translating general intentions to exact image layout
+	#
+	TEMPLATE SET
+
+	    TEMPLATE insmod
+	    BEGIN
+		FILE "&lt;TMPL_VAR NAME=target>"
+		FILE "/sbin/insmod"
+
+		# optionList may be undef
+		# and already is suitably escaped.
+		SCRIPT "/init"
+		BEGIN
+		    !/sbin/insmod '&lt;TMPL_VAR NAME=target>' \
+		    !      &lt;TMPL_VAR NAME=optionList>
+		END SCRIPT
+	    END TEMPLATE
+
+	    # lots of other templates omitted ...
+	END TEMPLATE SET
+
+      </programlisting>
+    </para>
+
+    <para>
+      There are a few attributes that are available to every template:
+      <variablelist>
+
+	<varlistentry>
+	  <term>
+	    version
+	  </term>
+	  <listitem>
+	    <para>
+	      The kernel version we're generating an image for.
+	      Useful if you want your image to include a complete copy
+	      of <filename>/lib/modules/(version)/kernel</filename>.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    appVersion
+	  </term>
+	  <listitem>
+	    <para>
+	      The version of <application>yaird</application> used to
+	      build the image.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    auxDir
+	  </term>
+	  <listitem>
+	    <para>
+	      The directory where <application>yaird</application>
+	      keeps executables intended to go on the image, such as
+	      <application>run_init</application>.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+      </variablelist>
+    </para>
+
+    <para>
+      Currently, there are templates for Debian and for Fedora, plus
+      a template showing how to use the older initrd approach.
+    </para>
+
+  </simplesect>
+
+  <simplesect>
+    <title>Image Generation</title>
+    <para>
+      The detailed image description consists of a collection of names of
+      files, directories, symbolic links and block or character devices,
+      plus a number of lines of shell script.  The image description does
+      not contain permission or ownership information: files always have
+      mode 444, executables and directories always 555, devices always
+      mode 600,<footnote>
+	<para>
+	  Having device files on the image is wrong: it will
+	  break if the new kernel uses different device numbers.  Mostly
+	  this can be avoided by using the <filename>dev</filename>
+	  files provided by sysfs, but there is a bootstrap problem:
+	  the <application>mount</application> command needed to
+	  access sysfs assumes <filename>/dev/null</filename> and
+	  <filename>/dev/console</filename> are available.
+	</para>
+      </footnote> and everything is owned by root.
+    </para>
+
+    <para>
+      The <code>Image</code> module contains the image description and
+      can write the image to a directory.  It understands about symlinks:
+      if <filename>/sbin/vgscan</filename> is added to the image and it
+      happens to be a symlink to <filename>lvmiopversion</filename>, both
+      <filename>vgscan</filename> and <filename>lvmiopversion</filename>
+      will be added to the image.  Shared libraries are supported
+      via the <code>SharedLibraries</code> module, as discussed in
+      <xref linkend="shlibs"/>.  Invocations of other executables are not
+      recognised automatically: if <filename>lvmiopversion</filename> executes
+      <filename>/etc/lvm-200/vgscan</filename>, the latter needs to be
+      added explicitly to the image.
+    </para>
+
+    <para>
+      The copying of complete trees to the image is influenced by the
+      copying for executables: if there is a symlink in the tree, it's
+      target is also included on the image, but if the target is a
+      directory, its contents are not copied recursively.  This
+      approach avoids loops in image generation.
+      Note that the target of a symlink must exist:
+      <application>yaird</application> refuses to copy dangling links.
+    </para>
+  </simplesect>
+
+  <simplesect>
+    <title>Packing the Image</title>
+    <para>
+      The final step is packing the image in a format that the
+      bootloader can process; this is handled by the module
+      <code>Pack</code>.  The following formats are supported:
+      <variablelist>
+
+	<varlistentry>
+	  <term>
+	    cpio
+	  </term>
+	  <listitem>
+	    <para>
+	      A zipped cpio file (new ASCII format), required for the
+	      initramfs model as used in the templates for Debian and
+	      Fedora.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    directory
+	  </term>
+	  <listitem>
+	    <para>
+	      An unpacked directory, good for debugging or manually
+	      creating odd formats.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    cramfs
+	  </term>
+	  <listitem>
+	    <para>
+	      A cramfs filesystem, used for Debian initrd images.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+      </variablelist>
+    </para>
+  </simplesect>
+
+</section>

Added: dists/trunk/utils/yaird/doc/crypto.xml
===================================================================
--- dists/trunk/utils/yaird/doc/crypto.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/crypto.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,334 @@
+<section id="crypto">
+  <title>Supporting Encrypted Disks</title>
+
+  <para>
+    To protect the content of your disk against unwanted reading
+    even if the machine is stolen, it can make sense to encrypt the disk.
+    This section discusses Linux support for disk encryption and
+    the impact this has on the initial boot image.
+  </para>
+
+  <para>
+    The idea here is to encrypt the entire disk with a single key:
+    the kernel encrypts and decrypts all blocks on an underlying
+    device and presents it as a new ordinary block device, where
+    you can use mkfs and fsck as always.  Thus an encrypted disk
+    only protects the confidentiality of your data in cases where
+    the hardware is first switched off and then taken away for later
+    perusal by the bad guys.  It will not protect confidentiality
+    if the bad guy gains access to a running system, either through
+    an exploit or with a valid account.
+  </para>
+
+  <para>
+    There are different implementations of this idea.  All implementations
+    use the kernel crypto modules (the same stuff that supports IPsec),
+    but they differ in how that cryptography is squeezed between userland
+    and the diskplatter.<footnote><para>See GDBE for a similar mechanism under
+    BSD.</para></footnote>
+    Note that we do not compare how effective the various implementations are
+    at keeping your data secret: if your data is important enough to encrypt,
+    it's also important enough to do your own research into which implementation
+    is most robust.
+    <variablelist>
+
+      <varlistentry>
+	<term>
+	  cryptoloop
+	</term>
+	<listitem>
+	  <para>
+	    Is in mainline kernel 2.6.10, but has reliability problems, such as
+	    possible deadlocks.  The cryptoloop maintainer:
+	    "We should support cryptoloop. No new features, but working
+	    well. At the same time we should declare it 'deprecated' and
+	    provide dm-crypt as alternative."
+	    See <ulink url="http://kerneltrap.org/node/2433">kerneltrap</ulink>
+	    for background.
+	    The on-disk format is trivial: just the encrypted data.
+	    When the device is initialised, the user enters a passphrase
+	    and a hash of this phrase is used as key to do the decryption,
+	    and if the result is a filesystem, the key was valid.
+	  </para>
+	</listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term>
+	  dm-crypt
+	</term>
+	<listitem>
+	  <para>
+	    Is in mainline kernel since 2.6.4.  It uses device mapper
+	    (the same framework that is also used by LVM), which makes
+	    it more stable than cryptoloop.
+	    See <ulink url="http://www.saout.de/misc/dm-crypt/">dm-crypt:
+	    a device-mapper crypto target</ulink>.
+	    Dm-crypt can use the same on-disk format as cryptoloop, but
+	    the device mapper makes it easy to reserve part of the disk
+	    for a partition header with key material.
+	  </para>
+	  <para>
+	    Such a partition header, <ulink url="http://luks.endorphin.org/">LUKS</ulink>,
+	    is now under development; it will offer improved protection
+	    against dictionary attacks and will make it easier to change
+	    the password on an encrypted disk.  Due to the way the device
+	    mapper works, support for the partition header can be implemented
+	    completely in userspace.
+	  </para>
+	  <para>
+	    LUKS is integrated in Gentoo and
+	    included in Fedora FC4 test1.  A debian package exists
+	    (<ulink url="http://einsteinmg.dyndns.org/debian/unstable/">cryptsetup-luks</ulink>),
+	    but is not (yet) included in the main archive.
+	  </para>
+	</listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term>
+	  loopaes
+	</term>
+	<listitem>
+	  <para>
+	    An encrypting loop device; see
+	    <ulink url="http://loop-aes.sourceforge.net">http://loop-aes.sourceforge.net</ulink>,
+	    <ulink url="http://mail.nl.linux.org/linux-crypto/">http://mail.nl.linux.org/linux-crypto/</ulink>.
+	    It's not in mainline kernel, and the author has no intentions
+	    of pushing it in.
+	  </para>
+	</listitem>
+      </varlistentry>
+    </variablelist>
+  </para>
+
+  <para>
+    All these implementations need some kind of userspace tool to pass
+    key material to the kernel; this key material may come from lots of
+    places:
+    <itemizedlist>
+      <listitem>
+	<para>
+	  in the most simple case, it could be a hashed version of the
+	  password
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  it could be a large random key stored in a gpg-encrypted file
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  for swap devices, it could be randomly regenerated on each reboot
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  for file systems other than the root, it could be from a file
+	  with mode 600 on the root file system
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  the key could be stored on a USB stick, stored separately
+	  from the machine.
+	</para>
+      </listitem>
+    </itemizedlist>
+  </para>
+
+  <para>
+    An overview of relevant userspace tools:
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  the losetup command has an encryption option to use the
+	  cryptoloop module.  Note that this does not cause cryptoloop
+	  to be mounted automatically.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  versions of the mount command in Debian and Fedora have
+	  a 'loop,encryption' option that will be passed to losetup
+	  for use with cryptoloop, like so:
+	  <programlisting>
+	    /dev/vg0/crwrap /crypt1 ext3 loop,encryption=aes,noauto 0 0
+	  </programlisting>
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  The dmsetup command can set and show parameters (including
+	  key hashes!) for dm based devices, including dm-crypt and
+	  LVM.  With a bit of shell scripting, you can hash a password
+	  and pass it on the command line to set up a dm-crypt device.
+	  <programlisting>
+	    # : dont bother cracking this key, its a dummy
+	    # dmsetup table
+	    crypted: 0 2097152 crypt aes-cbc-plain \
+		    e9975dcb10992fbc03a52f44e8f830d8e997\
+		    5dcb10992fbc03a52f44e8f830d8e9975dcb\
+		    10992fbc03a52f44e8f830d8 0 254:7 0
+	    vg0-crwrap: 0 2097152 linear 8:3 56623488
+	    #
+	  </programlisting>
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  The cryptsetup command adds a friendly wrapper around this.
+	  In particular, it has hashing of the keyword built in.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  A modified package cryptsetup-luks exists, that adds
+	  extra options to (1) create a luks headers for a partition and
+	  (2) open a partition given one of a number of possible
+	  passphrases.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  The file <filename>/etc/crypttab</filename> is a debian
+	  extension to cryptsetup: it provides a list of crypted
+	  devices, their underlying devices, corresponding cipher
+	  and hash settings, plus the source for the passphrase:
+	  either some file or the controlling terminal.  This allows the devices
+	  to be activated by /etc/init.d/cryptdisks.  There is a
+	  thread on adding <filename>/etc/crypttab</filename> to
+	  Fedora: too late for FC3, to be considered again for FC4:
+	  see <ulink url="https://bugzilla.redhat.com/bugzilla/long_list.cgi?buglist=124789">here</ulink>
+	  and
+	  <ulink url="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=133461">here</ulink>.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    In order to activate an encrypted device with cryptsetup,
+    we need to detect:
+    <itemizedlist>
+      <listitem>
+	<para>
+	  which underlying device to use
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  which encryption and hash algorithm to use
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  where the passphrase comes from
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  whether we have a plain crypted partition from LUKS partition
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    In order to determine all these points we need information from
+    <filename>/etc/crypttab</filename>; as a consistency check, we'll
+    compare this to the output from "cryptsetup
+    status".<footnote>
+      <para>
+	The output from "dmsetup table" would be an alternative.
+	It's easier to parse, but introduces an additional package
+	dependency.
+      </para>
+    </footnote>
+  </para>
+
+  <para>
+    The resulting actions:
+    <orderedlist>
+      <listitem>
+	<para>
+	  If the source of the passphrase is something other than
+	  the console, abort.  There are too many variables to support
+	  this reliably.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  For the passphrase hash algorithm, no modules need to be loaded,
+	  since it is included by cryptsetup from a user space
+	  library.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Make the underlying device available.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Modprobe the dm-crypt and the cipher (the module name
+	  is the part of the cipher name before the first hyphen).
+	  If the cipher block mode needs a hash, load that too.
+	  Note that the cipher block mode hash is something
+	  different from the passphrase hash: it's the part after
+	  the colon in eg 'aes-cbc-essiv:sha256'.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  For plain cryptsetup, invoke an action with the following
+	  parameters:
+	  <programlisting>
+	    cryptsetup  target=device
+			src= ...
+			hash= ...
+			cipher= ...
+			size= ...
+			verify=y|undef
+	  </programlisting>
+	  Here the cryptsetup action will result in a script
+	  fragment in /init that has "cryptsetup create" in a loop
+	  until exit status is 0.  For plain cryptsetup,
+	  this only has effect in combination with the "verify"
+	  option: exit status is 0 is the user gives the same
+	  password twice in succession.  With cryptsetup-luks,
+	  this would test that the passphrase actually gives access
+	  to the encrypted device.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  For cryptsetup-luks, invoke a similar action with fewer
+	  parameters, since so much of the required information
+	  is already in the header.
+	</para>
+      </listitem>
+    </orderedlist>
+  </para>
+</section>

Added: dists/trunk/utils/yaird/doc/figures/console.dia
===================================================================
(Binary files differ)


Property changes on: dists/trunk/utils/yaird/doc/figures/console.dia
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: dists/trunk/utils/yaird/doc/figures/console.png
===================================================================
(Binary files differ)


Property changes on: dists/trunk/utils/yaird/doc/figures/console.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: dists/trunk/utils/yaird/doc/input.xml
===================================================================
--- dists/trunk/utils/yaird/doc/input.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/input.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,443 @@
+<section id="input">
+  <title>Supporting Input Devices</title>
+
+  <para>
+    A working console and keyboard during the initial boot image execution
+    is needed to enter a password for encrypted file systems; it also
+    helps while debugging.  This section discusses the kernel input
+    layer and how it can be supported during image generation.
+  </para>
+
+  <para>
+    The console is a designated terminal, where kernel output goes, and that
+    is the initial I/O device for <filename>/sbin/init</filename>.  Like all
+    terminal devices, it provides a number of functions: you can read
+    and write to it, plus it has a number of <code>ioctl()</code>
+    functions to manage line buffering, interrupt characters and
+    baudrate or parity where applicable.
+  </para>
+
+  <para>
+    Terminals come in different types: it can be a VT100 or terminal
+    emulator connected via an RS232 cable, or it can be a combination
+    of a CRT and a keyboard.  The keyboard can be connected via
+    USB or it can talk a byte oriented protocol via a legacy UART
+    chip.
+  </para>
+    
+  <para>
+    The CRT is managed in two layers.  The top layer, "virtual
+    terminal", manages a two dimensional array describing which letter
+    should go in which position of the screen.  In fact, there are a
+    number of different arrays, and which one is actually visible on
+    the screen is selected by a keyboard combination.
+    Below the virtual terminals is a layer that actually places the
+    letters on the screen.  This can be done a letter at a time,
+    using a VGA interface, or the letters can be painted pixel by
+    pixel, using a frame buffer.
+  </para>
+
+  <para>
+    Below the terminal concept we find the input layer.  This provides a
+    unified interface to the various user input devices: mouse, keyboard,
+    PC speaker, joystick, tablet.  These input devices not only
+    generate data, they can also receive input from the computer.  As
+    an example, the keyboard needs computer input to operate the NUM
+    LOCK indicator.  Hardware devices such as keyboards register
+    themselves with the input layer, describing their capabilities
+    (I can send relative position, have two buttons and no LEDs),
+    and the input layer assigns a handler to the hardware device.
+    The handler presents the device to upper layers, either as a char
+    special file or as the input part of a terminal device.
+    This is not a one-to-one mapping: every mouse gets its own
+    handler, but keyboard and PC speaker share a handler, so it looks
+    to userland like you have a keyboard that can do "beep".
+  </para>
+
+  <para>
+    In addition to handlers for specific type of upper layers (mouse,
+    joystick, touch screen) there is a generic handler that provides a
+    character device file such as <filename>/dev/input/event0</filename>
+    for every input device detected; input events are presented through
+    these devices in a unified format.  The input layer generates
+    hotplug events for these generic event handlers; hotplug uses
+    <filename>modules.inputmap</filename> to load a module containing a
+    suitable upper layer event handler.  The keyboard handler is a special
+    case that does not occur in this map, so for image generation there
+    is little to be learned from hotplug input support.
+  </para>
+
+  <para>
+    To guarantee a working console, <application>yaird</application>
+    should examine <filename>/dev/console</filename>, determine
+    whether it's RS232 or hardware directly connected to the computer,
+    and then load modules for either serial port, or for virtual
+    terminals, the input layer and any hardware underlying it.
+    Unfortunately, <filename>/dev/console</filename> does not give
+    a hint what is below the terminal interface, and unfortunately,
+    lots of input devices are legacy hardware that is hard to probe
+    and only sketchily described by sysfs in kernel 2.6.10.
+  </para>
+
+  <para>
+    This means that a guarantee for a working console cannot be made,
+    which is why distribution kernels come with components such as the
+    keyboard and serial port driver compiled into the kernel.  We can
+    do something else though: provide modules for keyboard devices
+    provided the kernel provides correct information.  That covers the
+    case of USB keyboards, and that's something that's not compiled
+    into distribution kernels, so that the administrator has to add
+    modules explictly in order to get the keyboard working in
+    the initial boot image.
+  </para>
+
+  <para>
+    Lets examine the sources of information we have to find which input
+    hardware we have to support.
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  In <filename>/sys/class/input</filename>, all input devices
+	  are enumerated.  Mostly, these only contain a
+	  <filename>dev</filename> file containing major/minor number,
+	  but USB devices also have a <filename>device</filename>
+	  symlink into <filename>/sys/devices</filename> identifying
+	  the underlying hardware.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  In <filename>/boot/menu/grub.lst</filename>, kernel options
+	  can be defined that determine whether to use a serial line as
+	  console and whether to use a frame buffer.  The consequence
+	  is that it is fundamentally impossible to determine by looking
+	  at the hardware alone what's needed to get an image that will
+	  boot without problems.  This probably means we'll have to consider
+	  supplying some modules in the image that will only get loaded
+	  depending on kernel options.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  The file <filename>/proc/bus/input/devices</filename> gives
+	  a formatted overview of all known input devices; entries look
+	  like this:
+	  <programlisting>
+	    I: Bus=0003 Vendor=413c Product=2003 Version=0100
+	    N: Name="DELL DELL USB Keyboard"
+	    P: Phys=usb-0000:00:1d.7-4.1/input1
+	    H: Handlers=kbd event2
+	    B: EV=100003
+	    B: KEY=7f f0000 0 3878 d801d101 1e0000 0 0 0
+	  </programlisting>
+	  Here the "I" line shows identification information passed to
+	  the input layer by the hardware driver that is used to look
+	  up the appropiate handler.  "N" is a printable name provided
+	  by the hardware driver.  "P" is a hint at location in a bus
+	  of the device; note how this line is completely unrelated to
+	  the location of the hardware in
+	  <filename>/sys/devices</filename>.
+	  The H (Handlers) line is obvious; The B lines specify
+	  capabilities of the device, plus extra information for each
+	  capability.  Known capabilities include:
+	  <informaltable frame='topbot'>
+	    <tgroup cols='2' align='left'>
+	      <thead>
+		<row>
+		  <entry>Capability</entry>
+		  <entry>Description</entry>
+		</row>
+	      </thead>
+	      <tbody>
+		<row>
+		  <entry>SYN</entry>
+		  <entry>Input event is completed</entry>
+		</row>
+		<row>
+		  <entry>KEY</entry>
+		  <entry>Key press/release event</entry>
+		</row>
+		<row>
+		  <entry>REL</entry>
+		  <entry>Relative measure, as in mouse movement</entry>
+		</row>
+		<row>
+		  <entry>ABS</entry>
+		  <entry>Absolute position, as in graphics
+		  tablet</entry>
+		</row>
+		<row>
+		  <entry>MSC</entry>
+		  <entry>Miscelanious</entry>
+		</row>
+		<row>
+		  <entry>SND</entry>
+		  <entry>Beep</entry>
+		</row>
+		<row>
+		  <entry>REP</entry>
+		  <entry>Set hardware repeat</entry>
+		</row>
+		<row>
+		  <entry>FF</entry>
+		  <entry>Don't know</entry>
+		</row>
+		<row>
+		  <entry>PWR</entry>
+		  <entry>Power event: on/off switch pressed.</entry>
+		</row>
+		<row>
+		  <entry>FF_STATUS</entry>
+		  <entry>Don't know.</entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </listitem>
+    </itemizedlist>
+  </para>
+
+  <para>
+    Finally, let's consider some kernel configuration defines, the
+    corresponding modules and their function.  This could be used as a
+    start to check whether all components required to make an
+    operational console are available on the generated image:
+    <informaltable frame='topbot'>
+      <tgroup cols='3' align='left'>
+	<thead>
+	  <row>
+	    <entry>Define</entry>
+	    <entry>Module</entry>
+	    <entry>Description</entry>
+	  </row>
+	</thead>
+	<tbody valign='top'>
+
+	  <row>
+	    <entry>VT</entry>
+	    <entry>(bool)</entry>
+	    <entry>
+	      Support multiple virtual terminals, irrespective of what
+	      hardware is used to display letters from the virtual
+	      terminal on the CRT.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>VT_CONSOLE</entry>
+	    <entry>(bool)</entry>
+	    <entry>
+	      Make the VT a candidate for console output.  The alternative
+	      is a serial line to a VT100 or terminal emulator
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>VGA_CONSOLE</entry>
+	    <entry>(bool)</entry>
+	    <entry>
+	      Display a terminal on CRT using the VGA interface.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>FRAMEBUFFER_CONSOLE</entry>
+	    <entry>fbcon</entry>
+	    <entry>
+	      Display a terminal on a framebuffer, painting letters a
+	      pixel at a time.  This has to know about fonts.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>FB_VESA</entry>
+	    <entry>vesafb</entry>
+	    <entry>
+	      Implement a framebuffer based on VESA (a common standard
+	      for PC graphic cards), a place where an X server or
+	      the framebuffer console can write pixels to be displayed
+	      on CRT.
+	      There are many different framebuffer modules that
+	      optimise for different graphics cards.
+	      Note that while vesafb and other drivers such as intelfb
+	      can be built as a module, they only function correctly
+	      when built into the kernel.  Most framebuffer modules
+	      depend on three other modules to function correctly:
+	      cfbfillrect, cfbcopyarea, cfbimgblt.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>ATKBD</entry>
+	    <entry>atkbd</entry>
+	    <entry>
+	      Interpret input from a standard AT or PS/2 keyboard.
+	      Other keyboards use other byte codes, see for example
+	      the Acorn keyboard (rpckbd).
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>SERIO</entry>
+	    <entry>serio</entry>
+	    <entry>
+	      Module that manages a stream of bytes from and to an IO port.
+	      It includes a kernel thread (kseriod) that handles the queue
+	      needed to talk to slow ports.  It is normally used for
+	      dedicated IO ports talking to PS/2 mouse and keyboard,
+	      but can also be interfaced to serial ports (COM1, COM2).
+	      The atkbd driver uses a serio driver to communicate with
+	      the keyboard.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>SERIO_I8042</entry>
+	    <entry>i8042</entry>
+	    <entry>
+	      Implement a serio stream on top of the i8042 chip, the chip
+	      that connects the standard AT keyboard and PS/2 mouse to
+	      the computer.
+	      This is legacy hardware: it's not connected via PCI but
+	      directly to the 'platform bus'.
+	      When a chip such as i8042 that implements
+	      serio is detected, it registers itself with the input
+	      layer.  The input layer then lets drivers that use serio
+	      (such as atkbd and psmouse) probe whether a known device
+	      is connected via the chip; if such a device is found,
+	      it is registered as a new input device.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>SERIAL_8250</entry>
+	    <entry>serial</entry>
+	    <entry>
+	      Support for serial ports (COM1, COM2) on PC hardware.
+	      Lots of other configuration options exist to support
+	      multiple cards and fiddle with interrupts.
+	      If compiled in rather than modular, a further option,
+	      SERIAL_8250_CONSOLE, allows using the serial port as a
+	      console.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>USB_HID</entry>
+	    <entry>usbhid</entry>
+	    <entry>
+	      Driver for USB keyboards and mice.
+	      Another define, USB_HIDINPUT, needs to be true for
+	      these devices to actually work.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>USB_KBD</entry>
+	    <entry>usbkbd</entry>
+	    <entry>
+	      Severely limited form of USB keyboard; uses the "boot
+	      protocol".  This conflicts with the complete driver.
+	    </entry>
+	  </row>
+
+	</tbody>
+      </tgroup>
+      
+    </informaltable>
+  </para>
+
+  <para>
+    The following figure gives an example of how the various modules 
+    can fit together.
+  </para>
+
+  <figure id="console-module-flow">
+    <title>
+      Module relation for common console setup
+    </title>
+    <mediaobject>
+      <imageobject>
+	<imagedata fileref="figures/console.png" format="PNG"/>
+      </imageobject>
+    </mediaobject>
+  </figure>
+
+  <para>
+    In practical terms, a first step toward a more robust boot image
+    is to support new keyboard types, such as USB keyboards.
+    The following algorithm should do that.
+
+    <orderedlist>
+      
+      <listitem>
+	<para>
+	  Interpret <filename>/proc/bus/input/devices</filename>.
+	</para>
+      </listitem>
+      
+      <listitem>
+	<para>
+	  Look for devices that have handler kbd <emphasis>and</emphasis>
+	  that have buttons.  Mice and the PC speaker don't match that
+	  criterium, keyboards do.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  You could interpret the name field of such devices if you're
+	  interested in supporting legacy keyboards.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  The devices that have handler 'kbd' also have a handler 'event\d',
+	  where input is presented in a generalised event format;
+	  look up this device in /sys/class/input/event\d/.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  If it's got a device symlink, load the hardware drivers for that
+	  hardware device (most likely it's usbhid plus a usb core driver).
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Don't bother with a mknod, the input is handled via
+	  <filename>/dev/console</filename>.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Otherwise it's presumable a legacy device; you could check for
+	  the existence of
+	  <filename>/sys/devices/platform/i8042/serio\d/</filename>,
+	  or you could just assume the appropriate driver to be compiled in.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Implement support for
+	  <filename>/etc/hotplug/blacklist</filename>,
+	  since some USB keyboards publish two interfaces (full HID
+	  and the limited boot protocol), the input layer makes both
+	  visible in <filename>/proc/bus/input/devices</filename> and
+	  the corresponding modules are mutually conflicting.
+	  The blacklist is used to filter out one of these modules.
+	</para>
+      </listitem>
+
+    </orderedlist>
+  </para>
+</section>                                                                       

Added: dists/trunk/utils/yaird/doc/intro.xml
===================================================================
--- dists/trunk/utils/yaird/doc/intro.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/intro.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,31 @@
+<section id="intro-chapter">
+  <title>Introduction</title>
+  <para>
+    <application>Yaird</application> (Yet Another mkInitRD) is an
+    application to create an initial boot image, a minimal filesystem used
+    to bring a booting Linux kernel to a level where it can access
+    the root file system and use startup scripts to bring the system
+    to the normal run level.
+ </para>
+
+  <para>
+    It differs from earlier <application>mkinitrd</application>
+    implementations in that it attempts to leverage the information in
+    sysfs to minimise the number of special cases that the application
+    has to know about, and in that it uses a template system to separate
+    the analysis of the system from the building of the image.
+  </para>
+
+  <para>
+    This document gives an overview of the design and implementation
+    of <application>Yaird</application>; see the README file for
+    usage information.  This text assumes familiarity with Linux
+    system administration and the basics of hotplug and sysfs.
+  </para>
+
+  <para>
+    This document describes version &VERSION;
+    of <application>Yaird</application>.
+    This is a very rough, proof of concept, version.
+  </para>
+</section>

Added: dists/trunk/utils/yaird/doc/kernel.xml
===================================================================
--- dists/trunk/utils/yaird/doc/kernel.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/kernel.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,534 @@
+<section id="kernel">
+  <title>The interface between kernel and image</title>
+
+  <para>
+    The initial boot image is supposed to load enough modules to let
+    the real root device be mounted cleanly.  It starts up in a
+    <emphasis>very</emphasis> bare environment and it has to do tricky
+    stuff like juggling root filesystems; to pull that off successfully
+    it makes sense to take a close look at the environment that the
+    kernel creates for the image and what the kernel expects it to do.
+    This section contains raw design notes based on kernel 2.6.8.
+  </para>
+
+  <para>
+    The processing of the image starts even before the kernel is
+    activated.  The bootloader, grub or lilo for example, reads two
+    files from the boot file system into ram: the kernel and image.
+    The bootloader somehow manages to set two variables in the kernel:
+    <code>initrd_start</code> and <code>initrd_end</code>; these variables
+    point to the copy of the image in ram.  The bootloader now
+    hands over control to the kernel.
+  </para>
+
+  <para>
+    During setup, the kernel creates a special file system, rootfs.
+    This mostly reuses ramfs code, but there are a few twists: it can
+    never be mounted from userspace, there's only one copy, and it's not
+    mounted on top of anything else.  The existence of rootfs means that
+    the rest of the kernel always can assume there's a place to mount
+    other file systems.  It also is a place where temporary files can
+    be created during the boot sequence.
+  </para>
+
+    <para>
+      In <code>initramfs.c:populate_rootfs()</code>, there are two
+      possibilities.  If the image looks like a cpio.gz file, it is
+      unpacked into rootfs.  If the file <filename>/init</filename> is
+      among the files unpacked from the cpio file, the initramfs model
+      is used; otherwise we get a more complex interaction between kernel
+      and initrd, discussed in <xref linkend="initrd"/>.
+    </para>
+
+  <simplesect>
+    <title>Booting with Initramfs</title>
+    <para>
+      If the image was a cpio file, and it contains a file
+      <filename>/init</filename>, the initram model is used.
+      The kernel does some basic setup and hands over control to
+      <filename>/init</filename>; it is then up to
+      <filename>/init</filename> to make a real root available and to
+      transfer control to the <filename>/sbin/init</filename> command
+      on the real root.
+    </para>
+
+    <para>
+      The tricky part is to do that in such a way that there
+      is no way for user processes to gain access to the rootfs
+      filesystem; and in such a way that rootfs remains empty and
+      hidden under the user root file system.  This is best done
+      using some C code; <application>yaird</application> uses
+      <application>run_init</application>, a small tool based on
+      <application>klibc</application>.
+      <programlisting>
+	# invoked as last command in /init, with no other processes running,
+	# as follows:
+	# exec run_init /newroot /sbin/init "$@"
+	- chdir /newroot
+	# following after lots of sanity checks and not across mounts:
+	- rm -rf /*
+	- mount --move . /
+	- chroot .
+	- chdir /
+	- open /dev/console
+	- exec /sbin/init "$@"
+      </programlisting>
+    </para>
+
+  </simplesect>
+
+  <simplesect id="initrd">
+    <title>Booting with initrd</title>
+    <para>
+      If the image was not a cpio file, the kernel copies the
+      initrd image from where ever the boot loader left it to
+      <filename>rootfs:/initrd.image</filename>, and frees the ram used
+      by the bootloader for the initrd image.
+    </para>
+
+    <para>
+      After reading initrd, the kernel does more setup to the point where
+      we have:
+      <itemizedlist>
+
+	<listitem>
+	  <para>
+	      working CPU and memory management
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      working process management
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      compiled in drivers activated
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      a number of support processes such as ksoftirqd are created.
+	      (These processes have the rootfs as root; they can get a new
+	      root when the <code>pivot_root()</code> system call is used.)
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      something like a console.  <code>Console_init()</code> is
+	      called before PCI or USB probes, so expect only compiled in
+	      console devices to work.
+	  </para>
+	</listitem>
+
+      </itemizedlist>
+    </para>
+
+    <para>
+      At this point, in <code>do_mounts.c:prepare_namespace()</code>,
+      the kernel looks for a root filesystem to mount.  That root file
+      system can come from a number of places: NFS, a raid device, a plain
+      disk or an initrd.  If it's an initrd, the sequence is as follows
+      (where devfs can fail if it's not compiled into the kernel)
+
+      <programlisting>
+      - mount -t devfs devfs /dev
+      - md_run_setup()
+      - process initrd
+      - umount /dev
+      - mount --move . /
+      - chroot .
+      - mount -t devfs devfs /dev
+      </programlisting>
+
+    </para>
+
+    <para>
+      Once that returns, in <code>init/main.c:init()</code>,
+      initialisation memory is freed and <filename>/sbin/init</filename>
+      is executed with <code>/dev/console</code> as file  descriptor 0, 1
+      and 2.  <filename>/sbin/init</filename> can be overruled with
+      an <code>init=/usr/bin/firefox</code> parameter passed to the
+      boot loader; if <filename>/sbin/init</filename> is not found,
+      <filename>/etc/init</filename> and a number of other fallbacks
+      are tried.  We're in business.
+    </para>
+
+    <para>
+      The processing of initrd starts in
+      <code>do_mounts_initrd.c:initrd_load()</code>.  It creates
+      <filename>rootfs:/dev/ram</filename>, then copies
+      <filename>rootfs:/initrd.image</filename> there and unlinks
+      <filename>rootfs:/initrd.image</filename>.  Now we have the initrd
+      image in a block device, which is good for mounting.  It calls
+      <code>handle_initrd()</code>, which does:
+
+      <programlisting>
+      # make another block special file for ram0
+      - mknod /dev/root.old b 1 0
+      # try mounting initrd with all known file systems,
+      # optionally read-only
+      - mount -t xxx /dev/root.old /root
+      - mkdir rootfs:/old
+      - cd /root
+      - mount --move . /
+      - chroot .
+      - mount -t devfs devfs /dev
+      - system ("/linuxrc");
+      - cd rootfs:/old
+      - mount --move / .
+      - cd rootfs:/
+      - chroot .
+      - umount rootfs:/old/dev
+      - ... more ...
+      </programlisting>
+
+    </para>
+
+    <para>
+      So <filename>initrd:/linuxrc</filename> runs in an environment where
+      initrd is the root, with devfs mounted if available, and rootfs is
+      invisible (except that there are open file handles to directories
+      in rootfs, needed to change back to the old environment).
+    </para>
+
+    <para>
+      Now the idea seems to have been that <filename>/linuxrc</filename>
+      would mount the real root and <code>pivot_root</code> into it, then start
+      <filename>/sbin/init</filename>.  Thus, linuxrc would never return.
+      However, <code>main.c:init()</code> does some usefull stuff only
+      after linuxrc returns: freeing init memory segments and starting numa
+      policy, so in eg Debian and Fedora, <filename>/linuxrc</filename>
+      will end, and <filename>/sbin/init</filename>
+      is started by <code>main.c:init()</code>.
+    </para>
+
+    <para>
+      After linuxrc returns, the variable <code>real_root_dev</code>
+      determines what happens.  This variable can be read and written
+      via <filename>/proc/sys/kernel/real-root-dev</filename>.  If it
+      is 0x0100 (the device number of <filename>/dev/ram0</filename>)
+      or something equivalent, <code>handle_initrd()</code> will change
+      directory to <filename>/old</filename> and return.  If it is
+      something else, <code>handle_initrd()</code> will decode it, mount
+      it as root, mount initrd as <filename>/root/initrd</filename>,
+      and again start <filename>/sbin/init</filename>.  (if mounting as
+      <filename>/root/initrd</filename> fails, the block device is freed.)
+    </para>
+
+    <para>
+      Remember <code>handle_initrd()</code> was called via
+      <code>load_initrd()</code> from <code>prepare_namespace()</code>,
+      and <code>prepare_namespace()</code> ends by chrooting into the
+      current directory: <filename>rootfs:/old</filename>.
+    </para>
+
+    <para>
+      Note that <filename>rootfs:/old</filename> was move-mounted
+      from '/' after <filename>/linuxrc</filename> returned.
+      When <filename>/linuxrc</filename> started, the root was
+      initrd, but <filename>/linuxrc</filename> may have done a
+      <code>pivot_root()</code>, replacing the root with a real root,
+      say <filename>/dev/hda1</filename>.
+    </para>
+
+    <para>
+      Thus:
+      <itemizedlist>
+
+	<listitem>
+	  <para>
+	      <filename>/linuxrc</filename> is started with initrd
+	      mounted as root.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      There is working memory management, processes, compiled
+	      in drivers, and stdin/out/err are connected to a console,
+	      if the relevant drivers are compiled in.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      Devfs may be mounted on <filename>/dev</filename>.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      <filename>/linuxrc</filename> can <code>pivot_root</code>.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      If you echo 0x0100 to
+	      <filename>/proc/sys/kernel/real-root-dev</filename>,
+	      the <code>pivot_root</code> will remain in effect after
+	      <filename>/linuxrc</filename> ends.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	      After <filename>/linuxrc</filename> returns,
+	      <filename>/dev</filename> may be unmounted and replaced
+	      with devfs.
+	  </para>
+	</listitem>
+
+      </itemizedlist>
+    </para>
+
+    <para>
+      Thus a good strategy for <filename>/linuxrc</filename> is to
+      do as little as possible, and defer the real initialisation
+      to <filename>/sbin/init</filename> on the initrd; this
+      <filename>/sbin/init</filename> can then <code>pivot_root</code>
+      into the real root device.
+      <programlisting>
+	#!/bin/dash
+	set -x
+	mount -nt proc proc /proc
+	# root=$(cat proc/sys/kernel/real-root-dev)
+	echo 256 > proc/sys/kernel/real-root-dev
+	umount -n /proc
+      </programlisting>
+    </para>
+
+  </simplesect>
+
+  <simplesect>
+    <title>Kernel command line parameters</title>
+    <para>
+      The kernel passes more information than just an initial file system
+      to the initrd or initramfs image; there also are the kernel boot
+      parameters.  The bootloader passes these to the kernel, and the kernel
+      in turn passes them on via <filename>/proc/cmdline</filename>.
+    </para>
+
+    <para>
+      An old version of these parameters is documented in the
+      <citerefentry>
+	<!--
+		Sometimes I think docbook is overdoing this markup thing;
+		this used to be just .IR bootparam 7
+	-->
+	<refentrytitle>bootparam</refentrytitle>
+	<manvolnum>7</manvolnum>
+      </citerefentry> manual page; more recent information is in the kernel
+      documentation file <citetitle>kernel-parameters.txt</citetitle>.
+      Mostly, these parameters are used to configure non-modular drivers,
+      and thus not very interesting to <application>yaird</application>.
+      Then there are parameters such as <code>noapic</code>, which are
+      interpreted by the kernel core and also irrelevant to
+      <application>yaird</application>.
+      Finally there are a few parameters which are used by the kernel
+      to determine how to mount the root file system.
+    </para>
+
+    <para>
+      Whether the initial image should emulate these options or ignore them
+      is open to discussion; you can make a case that the flexibility these
+      options offer has become irrelevant now that initrd/initramfs offers
+      far more fine grained control over the way in which the system
+      is booted.
+      Support for these options is mostly a matter of tuning the
+      distribution specific templates, but it is possible that the
+      templates need an occassional hint from the planner.
+      To find out just how much "mostly" is, we'll try to implement
+      full support for these options and see where we run into
+      limitations.
+      An inventarisation of relevant options.
+      <variablelist>
+
+	<varlistentry>
+	  <term>
+	    ydebug
+	  </term>
+	  <listitem>
+	    <para>
+	      The kernel does not know about this option,
+	      so we can use it to enable debugging in the generated image.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    ide
+	  </term>
+	  <listitem>
+	    <para>
+	      These are options for the modular ide-core driver.
+	      This could be supported by adding an attribute
+	      "isIdeCore" to insmod actions, and expanding the ide
+	      kernel options only for insmod actions where that
+	      attribute is true.
+	      It seems cleaner to support the options from
+	      <filename>/etc/modprobe.conf</filename>.
+	      Unsupported for now.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    init
+	  </term>
+	  <listitem>
+	    <para>
+	      The first program to be started on the definitive root device,
+	      default <filename>/sbin/init</filename>.  Supported.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    ro
+	  </term>
+	  <listitem>
+	    <para>
+	      Mount the definitive root device read only,
+	      so that it can be submitted to <application>fsck</application>.
+	      Supported; this is the default behaviour.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    rw
+	  </term>
+	  <listitem>
+	    <para>
+	      Three guesses.  Supported.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    resume, noresume
+	  </term>
+	  <listitem>
+	    <para>
+	      Which device (not) to use for software suspend.
+	      To be done.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    root
+	  </term>
+	  <listitem>
+	    <para>
+	      The device to mount as root.  This is a nasty one:
+	      the planner by default only creates device nodes
+	      that are needed to mount the root device, and even
+	      if you were to put hotplug on the inital image
+	      to create all possible device nodes, there's still
+	      the matter of putting support for the proper file system
+	      on the initial image.
+	      We could make an option to
+	      <application>yaird</application> to specify a list
+	      of possible root devices and load the necessary
+	      modules for all of them.
+	      Unsupported until there's a clear need for it.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    rootflags
+	  </term>
+	  <listitem>
+	    <para>
+	      Flags to use while mounting root file system.
+	      Implement together with root option.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    rootfstype
+	  </term>
+	  <listitem>
+	    <para>
+	      File system type for root file system.
+	      Implement together with root option.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    ip, nfsaddrs =
+	    &lt;client-ip>:&lt;server-ip>:&lt;gw-ip>:&lt;netmask>:&lt;hostname>:&lt;device>:&lt;autoconf>
+	  </term>
+	  <listitem>
+	    <para>
+	      These two are aliases, with "ip" being the preferred
+	      form.  This option may appear more than once.
+	      It tells the kernel to configure a network device,
+	      either based on values that are part of the option
+	      string or based values supplied by DHCP.
+	    </para>
+
+	    <para>
+	      In <application>yaird</application>, it also triggers
+	      the mounting of an NFS root.<footnote>
+		<para>
+		  The idea that the "ip=" kernel command line option
+		  implies mounting an NFS root is debatable.  Since
+		  the only use of the network for now is mounting NFS
+		  we can get away with it, and it simplifies passing
+		  a DHCP supplied boot path to the NFS mount code.
+		  If we find situations where IP is needed but NFS is
+		  not, we'll have to trigger NFS mount when 
+		  "root=/dev/nfs".
+		</para>
+	      </footnote>
+	    </para>
+
+	    <para>
+	      See <xref linkend="nfs"/> and the kernel documentation
+	      file <filename>nfsroot.txt</filename> for details.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+	<varlistentry>
+	  <term>
+	    nfsroot=[&lt;server-ip>:]&lt;root-dir>[,&lt;nfs-options>]
+	  </term>
+	  <listitem>
+	    <para>
+	      Where the root file system to be mounted is coming from.
+	      If you don't give any options, we try first with NFS over
+	      TCP, then over UDP and finally NFSv2.
+	      If DHCP specifies a root directory, server and root are
+	      based on DHCP, but options in nfsroot are still applied.
+	      If nfsroot does not give server-ip, the server IP given
+	      by DHCP is used.
+	    </para>
+	  </listitem>
+	</varlistentry>
+
+      </variablelist>
+
+    </para>
+  </simplesect>
+</section>

Added: dists/trunk/utils/yaird/doc/license.xml
===================================================================
--- dists/trunk/utils/yaird/doc/license.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/license.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,65 @@
+<section id="license-chapter">
+  <title>License</title>
+  <para>
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the <citetitle>GNU General Public
+    License</citetitle> as published by the Free Software Foundation;
+    either version 2 of the License, or (at your option) any later
+    version.
+  </para>
+  <para>
+    This program is distributed in the hope that it will be useful, but
+    WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    <citetitle>GNU General Public License</citetitle> for more details.
+  </para>
+  <para>
+    You should have received a copy of the <citetitle>GNU General Public
+    License</citetitle> along with this program; you may also obtain
+    a copy of the <citetitle>GNU General Public License</citetitle>
+    from the Free Software Foundation by visiting <ulink type="http"
+    url="http://www.fsf.org">their Web site</ulink> or by writing to
+    <address>
+      Free Software Foundation, Inc.
+      <street>51 Franklin St</street>, Fifth Floor
+      <city>Boston</city>, <state>MA</state> <postcode>02110-1301</postcode>
+      <country>USA</country>
+    </address>
+  </para>
+  <simplesect>
+    <title>Klibc code</title>
+    <para>
+      Yaird contains code based on klibc; this code is made available
+      by the author under the following licence.  The relevant source
+      files have this copyright notice included.
+      <programlisting>
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *   
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *   
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+      </programlisting>
+    </para>
+  </simplesect>
+</section>

Added: dists/trunk/utils/yaird/doc/nfs.xml
===================================================================
--- dists/trunk/utils/yaird/doc/nfs.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/nfs.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,205 @@
+<section id="nfs">
+  <title>Supporting NFS Root</title>
+
+  <para>
+    It is possible to use an NFS share rather than a local disk
+    as root device; this is (obviously) useful for diskless terminals,
+    but it also can come in handy for recovery.
+  </para>
+
+  <para>
+    Examples of projects using NFS root for diskless work
+    are
+    	<ulink url="http://www.ltsp.org/">LTSP</ulink>,
+	<ulink url="http://lessdisks.net/">Lessdisks</ulink> and
+	<ulink url="http://people.redhat.com/~hp/stateless/StatelessLinux.pdf"
+	>Stateless Linux</ulink>.
+    In these projects, the initial boot image comes with the distribution
+    and it must be sufficiently generic to support a wide range of
+    hardware; in particular it must probe for different network
+    cards.  For yaird, we'll focus on recovery use, where the initial
+    boot image is tailored for a single computer.
+  </para>
+
+  <para>
+    Although in principe the kernel and initial boot image for an NFS root
+    system can be stored on a local disk, it's more common to have them
+    loaded over the network with TFTP.  This means you'll need a boot loader
+    that can work over the network, such as pxelinux.
+    This takes place before the initial boot image takes over;
+    we won't dive into the details here.
+  </para>
+
+  <para>
+    There are a number of issues that make it impossible to automatically
+    determine exactly what is needed to do a network boot:
+    <itemizedlist>
+      <listitem>
+	<para>
+	  Not all interfaces are suitable for booting: think of
+	  loopback devices IPsec tunnels, 802.1Q endpoints.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Interfaces may be renamed by <application>udev</application>;
+	  thus there is no link between the name while running
+	  <application>yaird</application> and the name while
+	  running the initial boot image.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Once the system is running, there is no way to determine
+	  how an interface got its IP address: could be RARP, DHCP
+	  or static.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  An NFS share in <filename>/etc/fstab</filename> contains
+	  a hostname and directory, with no portable indication how
+	  that name is resolved to an IP address, whether that IP
+	  address will be unchanged during the next reboot and whether
+	  the route to that IP address will stay unchanged.
+	</para>
+      </listitem>
+    </itemizedlist>
+    This means we cannot determine how to mount the NFS root using
+    only information that is readily available on the running system:
+    we'll need a hint.  Rather than give that hint in the form of
+    <application>yaird</application> configuration options, we will
+    use the kernel command line.
+  </para>
+
+  <para>
+    The NFS part of the boot process takes place after
+    loading of keyboard drivers and before switching to the
+    final root.  It has the following phases:
+    
+    <itemizedlist>
+      <listitem>
+	<para>
+	  Load device drivers for every interface that is backed
+	  by hardware: <filename>/sys/class/net/*/device</filename>.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  load protocols:
+	  nfs for file sharing (this implies lockd and sunrpc),
+	  and af_packet for raw ether, needed for DHCP.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Configure interfaces: get an IP address, netmask, broadcast,
+	  gateway.  As a side effect, get hostname, dns, rootserver,
+	  rootpath.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Mount the NFS root.
+	</para>
+      </listitem>
+    </itemizedlist>
+
+    The last two steps are done by a single program,
+    <application>trynfs</application>.  This is based on the klibc
+    components <application>ipconfig</application> and
+    <application>nfsmount</application>.
+
+    This program only is invoked if the kernel command line parameter
+    ip= (or its alias nfsaddrs=) is set.  The kernel parameters ip=,
+    nfsaddrs=, nfsroot= are passed as arguments to
+    <application>trynfs</application>.
+  </para>
+
+  <para>
+    <application>Yaird</application> has an option "--nfs" with possible
+    values "none" (default), "option" and "only".  With "none", no NFS
+    code is generated.  With "option" and "only", NFS code is generated,
+    and it is an error if no hardware-backed network interface is found.
+    With "option", the NFS code is generated before the code to mount the
+    root on hard disk; if no "ip=" kernel command line parameter is given,
+    the system boots from disk.
+    With "only", only the NFS code is generated, with no code to access
+    file systems on harddisk.  If no "ip=" kernel command line parameter
+    is given, the system falls in the "attempt to kill init" at the end
+    of the boot script.
+  </para>
+
+  <simplesect id="nfs4">
+    <title>NFS Pitfalls</title>
+
+    <para>
+      <application>Yaird</application> can get the system to a state
+      where init is running from an NFS mounted root device, but that
+      is not always sufficient to get a reliable system: the init
+      scripts will also need to be written to work well in an NFS
+      mounted environment.  This section discusses some potential
+      problems.
+    </para>
+
+    <para>
+      The Linux version of NFSv4 (<ulink
+      url="http://www.nfsv4.org/">Working Group</ulink>,
+      <ulink url="http://www.citi.umich.edu/projects/nfsv4/">Linux
+      reference implementation</ulink>)
+      has a new channel of communication between the kernel and user
+      space: rpc_pipefs.  This is normally mounted on
+      <filename>/ar/lib/nfs/rpc_pipefs</filename>, and is used to
+      let a user space daemon do locking and Kerberos on behalf of the
+      kernel.
+    </para>
+
+    <para>
+      The rpc_pipefs support on a machine can interfere with
+      <application>yaird</application>.  As an example, in Fedora,
+      <filename>/etc/modprobe.conf.dist</filename> has an 'install'
+      line for module 'sunrpc' that automatically mounts the
+      rpc_pipefs filesystem when the module is loaded.  This means
+      the filesystem is not mounted if the sunrpc module happens
+      to be compiled into the kernel; it also can't be mounted if
+      sunrpc is loaded from the initial boot image, since there is no
+      <filename>/var/lib/nfs/rpc_pipefs</filename> yet to mount it on.
+      When <application>yaird</application> sees such an install line,
+      it can no longer determine what should go on the initial boot
+      image and terminates.
+    </para>
+
+    <para>
+      The workaround is to remove the 'install' line from
+      <filename>modprobe.conf</filename> and to do the mounting
+      in an <filename>/etc/init.d</filename> script before the
+      <application>rpc.gssd</application> and
+      <application>rpc.statd</application> daemons are started.
+    </para>
+
+    <para>
+      Note that using Kerberos with an NFS mounted root is of
+      questionable value: Kerberos relies on a secret file on the root
+      file system to guarantee the security of NFS, and if that secret
+      file is on an NFS file system that is itself not protected by
+      Kerberos, the guarantee loses value.
+    </para>
+
+    <para>
+      Another potential problem is dhclient, a tool to configure a
+      network interface with DHCP.  This can call a user script
+      to manage DHCP state changes, and on FC4, that script happens
+      to stop and start the interface to get it to a known state.
+      Since the script itself is accessed over NFS via the interface,
+      the stopping works, but the starting doesn't ...  By using a
+      fixed IP address you avoid this problem, but that is not a 
+      generally applicable solution.
+    </para>
+  </simplesect>
+</section>

Added: dists/trunk/utils/yaird/doc/raid.xml
===================================================================
--- dists/trunk/utils/yaird/doc/raid.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/raid.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,196 @@
+<section id="raid">
+  <title>Supporting Raid Devices</title>
+
+  <para>
+    This section discusses software raid devices from an initial boot
+    image perspective: how to get the root device up and running.
+    There are other aspects to consider, the bootloader for example:
+    if your root device is on a mirror for reliability, it would be
+    a disappointment if after the crash you still had a long downtime
+    because the MBR was only available on the crashed disk.  Then there's
+    the issue of managing raid devices in combination with hotplugging:
+    once the system is operational, how should the raid devices that
+    the initial image left untouched be brought online?
+  </para>
+
+  <para>
+    Raid devices are managed via ioctls (mostly; there is something
+    called "autorun" in the kernel)
+    The interface from userland is simple: mknod a block device file,
+    send an ioctl to it specifying the devnos of the underlying block
+    devices and whether you'd like mirroring or striping, then send
+    a final ioctl to activate the device.  This leaves the managing
+    application free to pick any unused device (minor) number and
+    has no assumptions about device file names.
+  </para>
+
+  <para>
+    Devices that take part in a raid set also have a "superblock",
+    a header at the end of the device that contains a uuid and indicates
+    how many drives and spares are supposed to take part in the raid set.
+    This can be used be the kernel to do consistency checking, it can also
+    be used by applications to scan for all disks belonging in a raid set,
+    even if one of the component drives is moved to another disk controller.
+  </para>
+
+  <para>
+    The fact that the superblock is at the end of a device has an obvious
+    advantage: if you somehow loose your raid software, the device
+    underlying a mirror can be mounted directly as a fallback measure.
+  </para>
+
+  <para>
+    If raid is compiled into the kernel rather than provided as a module,
+    the kernel uses superblocks at boot time to find raid sets and make
+    them available without user interaction.  In this case the filename of
+    the created blockdevice is hardcoded: <filename>/dev/md\d</filename>.
+    This feature is intended for machines with root on a raid device
+    that don't use an initial boot image.  This autorun feature is
+    also accessible via an ioctl, but it's not used in management
+    applications, since it won't work with an initial boot image and
+    it can be a nuisance if some daemon brought a raid set online just
+    after the administator took it off line for replacement.
+  </para>
+
+  <para>
+    Finally, by picking a different major device number for the raid device,
+    the raid device can be made partitionable without use of LVM.
+  </para>
+
+  <para>
+    There are at least three different raid management applications
+    for Linux: raidtools, the oldest; mdadm, more modern; and EVMS, a
+    suite of graphical and command line tools that manages not only raid
+    but also LVM, partitioning and file system formating.  We'll only
+    consider mdadm for now.  The use of mdadm is simple:
+  </para>
+
+  <para>
+    <itemizedlist>
+      <listitem>
+	<para>
+	  There's an option to create a new device from components,
+	  building the superblock.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Another option assembles a raid device from components,
+	  assuming the superblocks are already available.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Optionally, a configuration file can be used, specifying which
+	  components make up a device, whether a device file should
+	  be created or it is assumed to exist, whether it's stripe or
+	  mirror, and the uuid.  Also, a wildcard pattern can be given:
+	  disks matching this pattern will be searched for superblocks.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Information given in the configuration file can be omitted
+	  on the command line.	If there's a wildcard, you don't even
+	  have to specify the component devices of the raid device.
+	  A typical command is <code>mdadm --assemble /dev/md-root
+	  auto=md uuid=...</code>, which translates to "create
+	  <filename>/dev/md-root</filename> with some unused minor number,
+	  and put the components with matching uuid in it."
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    So far, raid devices look fairly simple to use; the complications
+    arise when you have to play nicely with all the other software
+    on the box.  It turns out there are quite a lot of packages that
+    interact with raid devices:
+  </para>
+
+  <para>
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  When the md module is loaded, it registers 256 block devices
+	  with <application>devfs</application>.  These devices
+	  are not actually allocated, they're just names set up to
+	  allocate the underlying device when opened.  These names in
+	  <application>devfs</application> have no counterpart in sysfs.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  When the LVM <application>vgchange</application> is started,
+	  it opens all md devices to scan for headers, only to find the
+	  raid devices have no underlying components and will return
+	  no data.  In this process, all these stillborn md devices get
+	  registered with sysfs.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  When <application>udevstart</application> is executed
+	  at boot time, it walks over the sysfs tree and lets
+	  <application>udev</application> create block devices files for
+	  every block device it finds in sysfs.  The name and permissions
+	  of the created file are configurable, and there is a hook to
+	  initialise SELinux access controls.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  When <application>mdadm</application> is invoked with the auto
+	  option, it will create a block device file with an unused
+	  device number and put the requested raid volume under it.
+	  The created device file is owned by whoever executed the
+	  <application>mdadm</application> command, permissions are 0600
+	  and there are no hooks for SELinux.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  When the Debian installer builds a system with LVM and raid, the
+	  raid volumes have names such as <filename>/dev/md0</filename>,
+	  where there is an assumption about the device minor number in
+	  the name of the file.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    For the current Debian mkinitrd, this all works together in
+    a wonderful manner: devfs creates file names for raid devices,
+    LVM scans them with as side effect entering the devices in sysfs,
+    and after pivotroot <application>udevstart</application> triggers
+    udev into creating block device files with proper permissions and
+    SELinux hooks.  Later in the processing of <filename>rcS.d</filename>,
+    <application>mdadm</application> will put a raid device under the
+    created special file.  Convoluted but correct, except for the fact
+    that out of 256 generated raid device files, up to 255 are unused.
+  </para>
+
+  <para>
+    In <application>yaird</application>, we do not use devfs.
+    Instead, we do a <application>mknod</application> before the
+    <application>mdadm</application>, taking care to use the same
+    device number that's in use in the running kernel.  We expect
+    <filename>mdadm.conf</filename> to contain an <code>auto=md</code>
+    option for any raid device files that need to be created.
+    This approach should work regardless of whether the fstab uses
+    <filename>/dev/md\d</filename> or a device number independent name.
+  </para>
+
+</section>

Added: dists/trunk/utils/yaird/doc/security.xml
===================================================================
--- dists/trunk/utils/yaird/doc/security.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/security.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,224 @@
+<section id="security">
+  <title>Security</title>
+
+  <para>
+    This section discusses security: avoiding downtime, avoiding revealing
+    sensitive information, avoiding unwanted modifications to the data;
+    either through accident or malice.
+    A good introduction to secure programming can be found in 
+    <ulink url="http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/">
+      <citetitle>
+	Secure Programming for Linux and Unix HOWTO</citetitle></ulink>.
+  </para>
+  
+  <para>
+    For <application>yaird</application>, security is not very
+    complicated: although it runs with root privileges, the program is
+    not setuid, and all external input comes from files or programs
+    installed by the admnistrator, so our main focus is on avoiding
+    downtime caused by ignored error codes.
+    A full blown risk assessment would be overkill, so we'll just use
+    the HOWTO as a checklist to verify that the basic precautions are
+    in place.
+  </para>
+
+  <para>
+    <informaltable frame='topbot'>
+      <tgroup cols='3' align='left'>
+	<thead>
+	  <row>
+	    <entry>Group</entry>
+	    <entry>Mitigation</entry>
+	    <entry>Status</entry>
+	  </row>
+	</thead>
+	<tbody valign='top'>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Verify command line</entry>
+	    <entry>
+	      Yes.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Verify and clean up environment</entry>
+	    <entry>
+	      Complete environment is reset at start of program.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Avoid assumptions about file descriptors</entry>
+	    <entry>
+	      Handled by perl.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Verify file names</entry>
+	    <entry>
+	      Perl taint check shows filenames are verified for
+	      absence of odd characters before passing to
+	      subprocesses.
+	      TODO: examine UTF-8 impact.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Verify file content</entry>
+	    <entry>
+	      File contents in sysfs verified.
+	      Fstab entries properly quoted.
+	      TODO: check for spaces in names of LVM volume or of
+	      modules; could end up in generated /sbin/init.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Verify locale settings</entry>
+	    <entry>
+	      All locale related environment variables are wiped at
+	      program startup.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Verify character encoding</entry>
+	    <entry>
+	      All IO is byte oriented.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Bad input</entry>
+	    <entry>Buffer overflow</entry>
+	    <entry>
+	      In perl?
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Program structure</entry>
+	    <entry>Separate data and control</entry>
+	    <entry>
+	      Under this heading, the HOWTO discusses the dangers of
+	      auto-executing macros in data files.  The closest thing we
+	      have to a data file are the templates that tune the image
+	      to the distribution.  We use a templating language that
+	      does not allow code embedding, and the image generation
+	      module does not make it possible for template output to
+	      end up outside of the image.  Conclusion: broken templates
+	      can produce a broken image, but cannot affect the running
+	      system.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Program structure</entry>
+	    <entry>Minimize privileges</entry>
+	    <entry>
+	      The user is supposed to bring his own root privileges to
+	      the party, not much to be done here.  A related issue
+	      is the minimizing of privileges in the system that is
+	      started with the generated image.  This would include
+	      starting SELinux at the earliest possible moment.
+	      At least in Fedora, that earliest possible moment is
+	      in <filename>rc.sysinit</filename>, well past the moment
+	      where the initial boot image hands over control to the newly
+	      mount root file system.  No <application>yaird</application>
+	      support needed.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Program structure</entry>
+	    <entry>Safe defaults</entry>
+	    <entry>
+	      Configuration only specifies sources of information,
+	      like /etc/hotplug, not much can go wrong here.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Program structure</entry>
+	    <entry>Safe Initialisation</entry>
+	    <entry>
+	      The location of the main configuration file is configured
+	      as an absolute path into the application.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Program structure</entry>
+	    <entry>Fail safe</entry>
+	    <entry>
+	      Planning and writing the image is separated;
+	      writing only starts after planning is succesfully completed.
+	      Todo: consider backout on write failure.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Program structure</entry>
+	    <entry>Avoid race conditions</entry>
+	    <entry>
+	      Temporary files and directories are created
+	      with the <code>File::Temp</code> module, which is
+	      resistant to name guessing attacks.
+	      The completed image is installed with <code>rename</code>
+	      rather than <code>link</code>; if an existing file is
+	      overwritten, this guarantees there's no race where the
+	      old image has been deleted bu the new one is not yet in
+	      place.  (Note that there is no option in place yet which
+	      allows overwriting of existing files.)
+	      To do: examine File::Temp safe_level=HIGH.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Underlying resources</entry>
+	    <entry>Handle meta characters</entry>
+	    <entry>
+	      Protection against terminal escape sequences in output
+	      is not yet in place.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Underlying resources</entry>
+	    <entry>Check system call results</entry>
+	    <entry>
+	      Yes.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Language specific</entry>
+	    <entry>Verify perl behaviour with taint.</entry>
+	    <entry>
+	      Yes.
+	    </entry>
+	  </row>
+
+	  <row>
+	    <entry>Language specific</entry>
+	    <entry>Avoid perl open magic with 3rd argument.</entry>
+	    <entry>
+	      Yes.
+	    </entry>
+	  </row>
+
+	</tbody>
+      </tgroup>
+    </informaltable>
+  </para>
+
+</section>                                                                       

Added: dists/trunk/utils/yaird/doc/shlibs.xml
===================================================================
--- dists/trunk/utils/yaird/doc/shlibs.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/shlibs.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,207 @@
+<section id="shlibs">
+  <title>Supporting Shared Libraries</title>
+
+  <para>
+    When an executable is added to the image, we want any required shared
+    libraries to be added automatically.  The <code>SharedLibraries</code>
+    module determines which files are required.  This section discusses
+    the features of kernel and compiler we need to be aware of in order
+    to do this reliably.
+  </para>
+
+  <para>
+    Linux executables today are in ELF format; it is defined in
+    <ulink url="http://www.linuxbase.org/spec/book/ELF-generic/ELF-generic.html">
+      <citetitle>
+	Generic ELF Specification ELFVERSION</citetitle></ulink>,
+    part of the Linux Standard Base.  This is based on part of the System
+    V ABI: Tool Interface Standard (TIS), Executable and Linking Format
+    (ELF) Sepcification
+  </para>
+
+  <para>
+    ELF has consequences in different parts of the system: in
+    the link-editor, that needs to merge ELF object files into ELF
+    executables; in the kernel (<filename>fs/binfmt_elf.c</filename>),
+    that has to place the executable in RAM and transfer control to it,
+    and in the runtime loader, that is invoked when starting the
+    application to load the necessary shared libraries into RAM.
+    The idea is as follows.
+  </para>
+
+  <itemizedlist>
+    <listitem>
+      <para>
+	Executables are in ELF format, with a type of either
+	<code>ET_EXEC</code> (executable) or <code>ET_DYN</code> (shared
+	library; yes, you can execute those.)  There are other types of
+	ELF file (core files for example) but you can't execute them.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	These files contain two kind of headers: program headers and
+	section headers.  Program headers define segments of the file that
+	the kernel should store consequetively in RAM; section headers define
+	parts of the file that should be treated by the link editor
+	as a single unit.  Program headers normally point to a group
+	of adjacent sections.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	The program may be statically linked or dynamically (with shared
+	libraries).
+	If it's statically linked, the kernel loads relevant segments,
+	then transfers control to main() in userland.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	If it's dynamically linked, one of the program headers has type
+	<code>PT_INTERP</code>.  It points to a segment that contains
+	the name of a (static) executable; this executable is loaded in
+	RAM together with the segments of the dynamic executable.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	The kernel then transfers control to the userland
+	interpreter, passing program headers and related info in a
+	fourth argument to <code>main()</code>, after <code>envp</code>.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	There's one interesting twist: one of the segments loaded
+	into RAM (<filename>linux-gate.so</filename>) does not
+	come from the executable, but is a piece of kernel mapped
+	into user space.  It contains a subroutine that the kernel
+	provides to do a system call; the idea is that this way,
+	the C library does not have to know which calling convention
+	for system calls is supported by the kernel and optimal for
+	the current hardware.  The link editor knows nothing about
+	this, only the interpreter knows that the kernel can pass the
+	address of this subroutine together with the program headers.
+	<footnote>
+	  <para>
+	    For more info on the kernel-supplied shared library for
+	    system calls, see
+	
+	    <ulink url="http://lwn.net/Articles/18411/">
+	      <citetitle>LWN: How to speed up system calls</citetitle></ulink>,
+	    <ulink url="http://lwn.net/Articles/30258/">
+	      <citetitle>LWN: Patch: i386 vsyscall DSO implementation</citetitle></ulink>,
+	    <ulink url="http://www.uwsg.iu.edu/hypermail/linux/kernel/0306.2/0674.html">
+	      <citetitle>LKML: common name for the kernel DSO</citetitle></ulink>.
+	  </para>
+	</footnote>
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	The interpreter interprets the <code>.dynamic</code> section of
+	the dynamic executable.  This is a table containing various types
+	of info; if the type is <code>DT_NEEDED</code>, the info is the
+	name of a shared library that is needed to run the executable.
+	Normally, it's the basename.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	The interpreter searches <code>LD_LIBARY_PATH</code> for the
+	library and loads the first working version it finds, using a
+	breath-first search.  Once everything is loaded, the interpreter
+	hands over control to main in the executable.
+      </para>
+    </listitem>
+
+    <listitem>
+      <para>
+	Except that that's not how it really works: the path that glibc
+	uses depends on whether threads are supported, and klibc can
+	function as a <code>PT_INTERP</code> but will not load additional
+	libraries.
+      </para>
+    </listitem>
+  </itemizedlist>
+
+  <para>
+    The <application>ldd</application> command finds the pathnames
+    of shared libraries used by an executable.  This works
+    only for glibc: it invokes the interpreter
+    with the executable as argument plus an environment variable that
+    tells it to print the pathnames rather than load them.  For other
+    C libraries, there's no guaranteed correct way to find the path of
+    shared libraries.
+  </para>
+
+  <para>
+    Update: <application>ldd</application> also works for another 
+    C library, uclibc, unless you disable that support while building
+    the library by unsetting <code>LDSO_LDD_SUPPORT</code>.
+  </para>
+
+  <para>
+    Thus, to figure out what goes on the initial ram image, first try
+    <application>ldd</application>.  If that gives an answer, good.
+    Otherwise, use a helper program to find <code>PT_INTERP</code> and
+    <code>DT_NEEDED</code>.  If there's only <code>PT_INTERP</code>, good,
+    add it to the image.  If there are <code>DT_NEEDED</code> libraries
+    as well, and they have relative rather than absolute pathnames,
+    we can't determine the full path, so don't generate an image.
+  </para>
+
+  <para>
+    There are a number of options to build a helper to extract the relevant
+    information from the executable:
+    <itemizedlist>
+      <listitem>
+	<para>
+	  Build it in perl.  The problem here is that unpacking 64-bit
+	  integers is an optional part of the language.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Build a wrapper around <application>objdump</application> or
+	  <application>readelf</application>.  The drawback is that
+	  there programs are not part of a minimal Linux distribution:
+	  depending on them in <application>yaird</application> would
+	  increase the footprint.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Building a C program using libbdf.  This is a library
+	  intended to simplify working with object files.  Drawbacks
+	  are that it adds complexity that is not necessary in our
+	  context since it supports multiple executable formats;
+	  furthermore, at least in Debian it is treated as internal
+	  to the gcc tool chain, complicating packaging the tool.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Building a C program based on <filename>elf.h</filename>.
+	  This turns out to be easy to do.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    <application>Yaird</application> uses the last approach listed.
+  </para>
+</section>

Added: dists/trunk/utils/yaird/doc/spec.xml
===================================================================
--- dists/trunk/utils/yaird/doc/spec.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/spec.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,337 @@
+<section id="spec">
+  <title>Goals, features, to do</title>
+  <para>
+    The purpose in life of a tool like <application>Yaird</application>
+    is to produce an initial boot image that loads the required modules
+    to allow a booting kernel to access the root file system and from
+    there use the startup scripts to get to the default run level.
+    This means that hardly any drivers need to be compiled into the kernel
+    itself, so a distribution can produce a kernel with a large amount of
+    modules that will run unchanged on practically any hardware, without
+    introducing a large number of unused drivers that would waste RAM.
+    In a sense, the initial boot image customises the kernel to the hardware
+    it happens to be running on.
+  </para>
+
+  <para>
+    That purpose still leaves a lot of room to optimise for different
+    goals: as an example, you could attempt to make the generated
+    image as small as possible, or you could attempt to make the
+    generated image so flexible that it will boot on any hardware.
+    This chapter discusses the goals that determined the design, the
+    resulting features, and what's still left to do.
+  </para>
+
+  <para>
+    The goals<footnote>
+      <para>
+	Well, not really.  I started this thingy to show off a small
+	algorithm to find required modules based on sysfs information.
+	To make that a credible demonstration, the small algorithm
+	turned out to need a lot of scaffolding to turn it into a
+	working program ...
+      </para>
+    </footnote>
+    of <application>Yaird</application> are as follows:
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  Be free, as in GPL.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Be maintainable.  Small functions with documented arguments
+	  and result are better than a shell script full of constructs
+	  like <code>eval "awk | bash | tac 3>&amp;7"</code>.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Be secure and reliable.  The application should stop with an error
+	  message at the slightest provocation, rather than run the
+	  risk of producing a non-booting initrd image.
+	  The application should not open loopholes that allow the 'bad
+	  guys' to modify the image, gain access to raw devices or
+	  overwrite system files.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Be distribution agnostic.  Fedora and Debian run similar
+	  kernels and similar startup scripts, so there's little
+	  reason why the glue between the two levels should be
+	  completely different.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Have limited footprint.  The tools needed to build and run
+	  the application should be few and widely available, with a
+	  preference for tools that are installed anyway.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Be future proof.  Future kernels may use different modules
+	  and may change device numbers; the application should need
+	  no changes to cope with such migrations.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Promote code reuse.  Make functions side-effect free and
+	  independent of context, so that it's easy to package the
+	  core as a library that can be reused in other applications.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Generate small images.  The application should accurately
+	  detect what modules are needed to get the root file system
+	  running and include only those modules on the generated
+	  image.<footnote>
+	      <para>
+		An alternative and equally interesting exercise would be
+		an attempt to generate a universal initrd that could be
+		distributed together with the kernel.  Such an image
+		would most likely be based on udev/hotplug.
+	      </para>
+	    </footnote>
+	  </para>
+	</listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    Requirements:
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  Linux 2.6.8 or later, both when running
+	  <application>yaird</application> and when running the generated
+	  image.  By limiting the goal to support only recent kernels,
+	  we can drastically reduce the number of special cases and
+	  knowledge about modules in the application.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  A version of <application>modprobe</application> suitable
+	  for 2.6 kernels.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Sysfs and procfs, both on the old and on the
+	  new kernel.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Perl and the HTML-Template module.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    To achieve these goals, the following features are implemented:
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  Templating system to tune the generated image to a
+	  given distribution; templates for Debian and Fedora FC3
+	  included.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Interprets <filename>/etc/fstab</filename>, including
+	  details such as octal escapes, <code>ignore</code> and
+	  <code>noauto</code> keywords, and &mdash; for ext3 and reiser
+	  file systems &mdash; label and uuid detection.
+	  Where applicable, options in <filename>/etc/fstab</filename>
+	  are used in the generated image.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Supports volume management via LVM2; activates only the volume
+	  group required for the root file system.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Supports software RAID via mdadm; activates only required
+	  devices.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Supports encrypted filesystems via cryptsetup and
+	  cryptsetup-luks.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Supports NFS root filesystems.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Understands SATA, IDE devices.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Generated image does not use hard coded device
+	  numbers.<footnote>
+	    <para>
+	      Except where the distribution depends on it;
+	      there are some issues with mdadm in Debian.
+	    </para>
+	  </footnote>
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Image generation understands how included executables may
+	  depend on symbolic links and shared libraries.  Shared libraries
+	  work for both glibc and klibc.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Support input devices such as USB keyboard, if the input
+	  device supports sysfs.
+	  Input devices are needed in the initial image to supply
+	  a password for encrypted root disk and to do debugging.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Basic support for kernel command line as passed by the boot
+	  loader.  Interprets init=, ro, rw.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Module aliases and options as specified in
+	  <filename>/etc/modprobe.d</filename> are supported.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Interprets the blacklist information from hotplug.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Interprets the kernel configuration file that defines whether a
+	  component is built in, available as a module or unavailable.
+	  By maintaining a mapping between module name and config
+	  parameter for selected modules, we avoid error messages if
+	  for instance a required file system is built into the kernel.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Supports initramfs, both in Debian and Fedora versions.
+	  An example template using the older initrd model
+	  is included for Debian.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Does not require devfs in either the old or the new kernel.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Behaviour of the generated image can be tuned using
+	  configuration files.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    Obviously, this tool is far from complete.  Here's a list of
+    features that still need to be implemented:
+    <itemizedlist>
+
+      <listitem>
+	<para>
+	  Understands USB and SCSI storage, no special provisions
+	  are needed for code generation, but it's not tested yet.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  EVMS, an alternative user level interface to LVM2 and MD,
+	  is not supported yet.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Swsusp is not supported yet.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Firewire and DASD are not supported.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Loopback file systems are not supported yet.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Filesystems encrypted via loopaes are not supported yet.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+</section>                                                                       

Added: dists/trunk/utils/yaird/doc/tools.xml
===================================================================
--- dists/trunk/utils/yaird/doc/tools.xml	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/tools.xml	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,316 @@
+<section id="tools">
+  <title>Tool Chain</title>
+  <para>
+    This section discusses which tools are used in implementing
+    <application>yaird</application> and why.
+  </para>
+
+  <para>
+    The application is built as a collection of perl modules.
+    The use of a scripting language makes consistent error checking
+    and building sane data structures a lot easier than shell
+    scripting; using perl rather than python is mainly because in
+    Debian perl has 'required' status while python is only 'standard'.
+    The code follows some conventions:
+  </para>
+
+  <para>
+    <itemizedlist>
+      <listitem>
+	<para>
+	  Where there are multiple items of a kind, say fstab entries,
+	  the perl module implements a class for individual items.
+	  All classes share a common base class, <code>Obj</code>,
+	  that handles constructor argument validation and that offers
+	  a place to plug in debugging code.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Object attributes are used via accessor methods to catch
+	  typos in attribute names.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Objects have a <code>string</code> method, that returns
+	  a string version of the object.  Binary data is not
+	  guaranteed to be absent from the string version.
+	</para>
+      </listitem>
+
+      <listitem>
+	<para>
+	  Where there are multiple items of a kind, say fstab entries,
+	  the collection is implemented as a module that is not a
+	  class.  There is a function <code>all</code> that returns a
+	  list of all known items, and functions <code>findByXxx</code>
+	  to retrieve an item where the Xxx attribute has a given
+	  value.  There is an <code>init</code> function that
+	  initializes the collection; this is called automatically
+	  upon first invocation of <code>all</code> or
+	  <code>findByXxx</code>.
+	  Collections may have convenience functions
+	  <code>findXxxByYyy</code>: return attribute Xxx, given a
+	  value for attribute Yyy.
+	</para>
+      </listitem>
+
+    </itemizedlist>
+  </para>
+
+  <para>
+    The generated initrd image needs a command interpreter;
+    the choice of command interpreter is exclusively determined
+    by the image generation template.
+    At this point, both Debian and Fedora templates use the
+    <application>dash</application> shell, for historical reasons only.
+    Presumably <application>busybox</application> could be used to build a
+    smaller image.  However, support for initramfs requires a complicated
+    construction involving a combination of mount, chroot and chdir;
+    to do that reliably, <application>nash</application> as used in Fedora
+    seems a more attractive option.
+  </para>
+
+  <para>
+    Documentation is in docbook format, since it's widely supported,
+    supports numerous output formats, has better separation between
+    content and layout than texinfo, and provides better guarantees
+    against malformed HTML than texinfo.
+  </para>
+
+  <simplesect>
+    <title>Autoconf</title>
+    <para>
+      GNU automake is used to build and install the application,
+      where 'building' is perhaps too big a word adding the location
+      of the underlying modules to the wrapper script.
+      The reasons for using automake: it provides packagers with a
+      well known mechanism for changing installation directories,
+      and it makes it easy for developers to produce a cruft-free
+      and reproducible tarball based on the tree extracted from
+      version control.
+    </para>
+  </simplesect>
+
+  <simplesect>
+    <title>C Library</title>
+    <para>
+      The standard C library under linux is glibc.  This is big:
+      1.2Mb, where an alternative implementation, klibc, is only 28Kb.
+      The reason klibc can be so much smaller than glibc is that a
+      lot of features of glibc, like NIS support, are not relevant for
+      applications that need to do basic stuff like loading an IDE driver.
+    </para>
+
+    <para>
+      There are other small libc implementations: in the embedded world,
+      dietlibc and uClibc are popular.  However, klibc was specifically
+      developed to support the initial image: it's intended to be included
+      with the mainline kernel and allow moving a lot of startup magic out
+      of the kernel into the initial image.  See 
+      <ulink url="http://marc.theaimsgroup.com/?m=101070502919547">
+	<citetitle>
+	  LKML: [RFC] klibc requirements, round 2</citetitle></ulink>
+      for requirements on klibc; the
+      <ulink url="http://www.zytor.com/mailman/listinfo/klibc">
+	mailing list</ulink> is the most current
+      source of information.
+    </para>
+
+    <para>
+      Recent versions of klibc (1.0 and later) include a wrapper around
+      gcc, named klcc, that will compile a program with klibc.  This means
+      <application>yaird</application> does not need to include klibc,
+      but can easily be configured to use klibc rather than glibc.
+      Of course this will only pay off if <emphasis>every</emphasis>
+      executable on the initial image uses klibc.
+    </para>
+
+    <para>
+      <application>Yaird</application> does not have to be extended in
+      order to support klibc, but it is necessary to avoid assumptions
+      about which shared libraries are used.  This is discussed in 
+      <xref linkend="shlibs"/>.
+    </para>
+  </simplesect>
+
+  <simplesect>
+    <title>Template Processing</title>
+    <para>
+      This section discusses the templates used to transform
+      high-level actions to lines of script in the generated image.
+      These templates are intended to cope with small differences
+      between distributions: a shell that is named
+      <application>dash</application> in Debian and
+      <application>ash</application> in Fedora for example.
+      By processing the output of <application>yaird</application>
+      through a template, we can confine the tuning of
+      <application>yaird</application> for a specific distribution
+      to the template, without having to touch the core code.
+    </para>
+
+    <para>
+      One important function of a template library is to enforce
+      a clear separation between progam logic and output formatting:
+      there should be no way to put perl fragments inside a template.
+      See <ulink url="http://www.stringtemplate.org/">StringTemplate</ulink>
+      for a discussion of what is needed in a templating system, plus
+      a Java implementation.
+    </para>
+
+    <para>
+      Lets consider a number of possible templating solutions:
+      <itemizedlist>
+
+	<listitem>
+	  <para>
+	    <ulink url="http://www.template-toolkit.org/">
+	     Template Toolkit</ulink>:
+	    widely used, not in perl core distribution, does not
+	    prevent mixing of code and templates.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    <ulink url="http://search.cpan.org/dist/Text-Template/lib/Text/Template.pm">
+	      Text::Template</ulink>:
+	    not in perl core distribution, does not
+	    prevent mixing of code and templates.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    Some XSLT processor.  Not in core distribution,
+	    more suitable for file-to-file transformations
+	    than for expanding in-process data; overkill.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    <ulink url="http://search.cpan.org/~samtregar/HTML-Template-2.7/Template.pm">
+	      HTML-Template</ulink>:
+	    not in perl core distribution,
+	    prevents mixing of code and templates,
+	    simple, no dependencies, dual GPL/Artistic license.
+	    Available in Debian as
+	    <application>libhtml-template-perl</application>,
+	    in Fedora 2 as perl-HTML-Template, dropped from Fedora 3,
+	    but available via
+	    <ulink url="http://download.fedora.redhat.com/pub/fedora/linux/extras/">
+	      Fedora Extras</ulink>.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    A home grown templating system: a simple system such as the
+	    HTML-Template module is over 100Kb.  We can cut down on that
+	    by dropping functions we don't immediately need, but the effort
+	    to get a tested and documented implementation remains substantial.
+	  </para>
+	</listitem>
+	
+      </itemizedlist>
+    </para>
+
+    <para>
+      The HTML-Template approach is the best match for our
+      requirements, so used in <application>yaird</application>.
+    </para>
+
+  </simplesect>
+
+  <simplesect>
+    <title>Configuration Parsing</title>
+
+    <para>
+      <application>Yaird</application> has a fair number of
+      configuration items: templates containing a list of files and
+      trees, named shell script fragments with a value that spans
+      multiple lines.  If future versions of the application are going
+      to be more flexible, the number of configuration items is only
+      going to grow.  Somehow this information has to be passed to the
+      application; an overview of the options.
+
+      <itemizedlist>
+	<listitem>
+	  <para>
+	    Configuration as part of the program.  Simply hard-code
+	    all configuration choices, and structure the program so that
+	    the configuration part is a well defined part of the
+	    program.  The advantage is that there is no need for any
+	    infrastructure, the disadvantage is that there is no clear
+	    boundary where problems can be reported, and that it
+	    requires the user to be familiar with the programming
+	    language.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    <ulink
+	    url="http://search.cpan.org/~abw/AppConfig-1.56/lib/AppConfig.pm">AppConfig</ulink>.
+	    A mature perl module that parses configuration files in a
+	    format similar to Win32 "INI" files.  Widely used, stable,
+	    flexible, well-documented, with as added bonus the fact that
+	    it unifies options given on the command line and in the
+	    configuration file.  An ideal solution, except for the fact
+	    that we need a more complex configuration than can
+	    conventiently be expressed in INI-file format.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    An XML based configuration format.  XML parsers for perl are
+	    readily available.  The advantage is that it's an industry
+	    standard; the disadvantage that the markup can get very
+	    verbose and that support for input validation is limited
+	    (XML::LibXML mentions a binding for RelaxNG, but the code is
+	    missing, and defining an input format in XML-Schema ... just
+	    say no).
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    <ulink url="http://www.yaml.org/">YAML</ulink> is a data
+	    serialisation format that is a lot more readable than XML.
+	    The disadvantage is that it's not as widely known as XML,
+	    that it's an indentation based language (so confusion over tabs
+	    versus spaces can arise) and that support for input validation
+	    is completely missing.
+	  </para>
+	</listitem>
+
+	<listitem>
+	  <para>
+	    A custom made configuration language, based on
+	    <ulink
+	    url="http://search.cpan.org/dist/Parse-RecDescent/">Perl::RecDescent</ulink>,
+	    a widely used, mature module to do recursive descent parsing
+	    in perl.  Using a custom language means we can structure the
+	    language to minimise opportunities for mistakes, can provide
+	    relevant error messages, can support complex configuration
+	    structures and can easily parse the configuration file to a tree
+	    format that's suitable for further processing.  The disadvantage
+	    is that a custom language is yet another syntax to learn.
+	  </para>
+	</listitem>
+
+      </itemizedlist>
+    </para>
+
+    <para>
+      Building a recursive descent parser seems the best match for this
+      application.
+    </para>
+
+  </simplesect>
+</section>

Added: dists/trunk/utils/yaird/doc/yaird.xml.in
===================================================================
--- dists/trunk/utils/yaird/doc/yaird.xml.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/doc/yaird.xml.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+
+
+<!DOCTYPE article
+
+  PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "docbookx.dtd"
+
+  [
+    <!ENTITY VERSION "@VERSION@">
+
+    <!ENTITY INTRODUCTION SYSTEM "intro.xml">
+    <!ENTITY SPEC SYSTEM "spec.xml">
+    <!ENTITY CONCEPTS SYSTEM "concepts.xml">
+    <!ENTITY KERNEL SYSTEM "kernel.xml">
+    <!ENTITY RAID SYSTEM "raid.xml">
+    <!ENTITY CRYPTO SYSTEM "crypto.xml">
+    <!ENTITY NFS SYSTEM "nfs.xml">
+    <!ENTITY INPUT SYSTEM "input.xml">
+    <!ENTITY SHLIBS SYSTEM "shlibs.xml">
+    <!ENTITY SECURITY SYSTEM "security.xml">
+    <!ENTITY TOOLS SYSTEM "tools.xml">
+    <!ENTITY AUTHORS SYSTEM "authors.xml">
+    <!ENTITY LICENSE SYSTEM "license.xml">
+  ]
+
+>
+
+<article id="index" lang="en">
+
+ <articleinfo>
+  <title>Yaird &mdash; Yet Another Mkinitrd</title>
+  <pubdate>2005-02-09</pubdate>
+  <author>
+    <firstname>Erik</firstname>
+    <surname>van Konijnenburg</surname>
+    <email>ekonijn at xs4all.nl</email>
+  </author>
+
+  <abstract>
+    <para>
+      This memo discusses the design goals and implementation of
+      <application>Yaird</application> (Yet Another mkInitRD),
+      a proof-of-concept application to create an initial boot image,
+      a minimal filesystem used to bring a booting Linux kernel to a
+      level where it can access the root file system and use startup
+      scripts to bring the system to the normal run level.  It differs
+      from earlier <application>mkinitrd</application> implementations in
+      that it leverages the information in sysfs to minimise the number
+      of special cases that the application has to know about, and in
+      that it uses a template system to separate the analysis of the
+      system from the building of the image.
+    </para>
+  </abstract>
+
+  <copyright>
+   <year>2005</year>
+   <holder>Erik van Konijnenburg</holder>
+  </copyright>                                                  
+
+  <!--
+    <releaseinfo>
+      This is version &VERSION; of the Yaird manual.
+    </releaseinfo>
+  -->
+
+ </articleinfo>
+
+&INTRODUCTION;
+&SPEC;
+&CONCEPTS;
+&KERNEL;
+&RAID;
+&CRYPTO;
+&NFS;
+&INPUT;
+&SHLIBS;
+&SECURITY;
+&TOOLS;
+&AUTHORS;
+&LICENSE;
+
+</article>

Added: dists/trunk/utils/yaird/exec/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/exec/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,36 @@
+#
+# Makefile.am -- compiling executables to be included in generated image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# The interesting part here is integration with klibc: it's absent.
+# The hope is that by specifying -I and -l flags to configure, an external
+# klibc build can be used.  This is untested.
+#
+
+# place package-specific executables that may go on the image in
+# this directory.
+
+SUBDIRS = ipconfig nfsmount
+aux_PROGRAMS = run_init findlibs trynfs
+
+include ../Makefile.incl
+
+run_init_SOURCES = run_init.c
+findlibs_SOURCES = findlibs.c
+trynfs_SOURCES = trynfs.c
+trynfs_LDADD = nfsmount/libnfsmount.a ipconfig/libipconfig.a

Added: dists/trunk/utils/yaird/exec/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/exec/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,581 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#
+# Makefile.am -- compiling executables to be included in generated image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# The interesting part here is integration with klibc: it's absent.
+# The hope is that by specifying -I and -l flags to configure, an external
+# klibc build can be used.  This is untested.
+#
+
+# place package-specific executables that may go on the image in
+# this directory.
+
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+aux_PROGRAMS = run_init$(EXEEXT) findlibs$(EXEEXT) trynfs$(EXEEXT)
+DIST_COMMON = $(srcdir)/../Makefile.incl $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = exec
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(auxdir)"
+auxPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(aux_PROGRAMS)
+am_findlibs_OBJECTS = findlibs.$(OBJEXT)
+findlibs_OBJECTS = $(am_findlibs_OBJECTS)
+findlibs_LDADD = $(LDADD)
+am_run_init_OBJECTS = run_init.$(OBJEXT)
+run_init_OBJECTS = $(am_run_init_OBJECTS)
+run_init_LDADD = $(LDADD)
+am_trynfs_OBJECTS = trynfs.$(OBJEXT)
+trynfs_OBJECTS = $(am_trynfs_OBJECTS)
+trynfs_DEPENDENCIES = nfsmount/libnfsmount.a ipconfig/libipconfig.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(findlibs_SOURCES) $(run_init_SOURCES) $(trynfs_SOURCES)
+DIST_SOURCES = $(findlibs_SOURCES) $(run_init_SOURCES) \
+	$(trynfs_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = ipconfig nfsmount
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf
+run_init_SOURCES = run_init.c
+findlibs_SOURCES = findlibs.c
+trynfs_SOURCES = trynfs.c
+trynfs_LDADD = nfsmount/libnfsmount.a ipconfig/libipconfig.a
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../Makefile.incl $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  exec/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  exec/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-auxPROGRAMS: $(aux_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(auxdir)" || $(mkdir_p) "$(DESTDIR)$(auxdir)"
+	@list='$(aux_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(auxPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(auxdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(auxPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(auxdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-auxPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(aux_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(auxdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(auxdir)/$$f"; \
+	done
+
+clean-auxPROGRAMS:
+	-test -z "$(aux_PROGRAMS)" || rm -f $(aux_PROGRAMS)
+findlibs$(EXEEXT): $(findlibs_OBJECTS) $(findlibs_DEPENDENCIES) 
+	@rm -f findlibs$(EXEEXT)
+	$(LINK) $(findlibs_LDFLAGS) $(findlibs_OBJECTS) $(findlibs_LDADD) $(LIBS)
+run_init$(EXEEXT): $(run_init_OBJECTS) $(run_init_DEPENDENCIES) 
+	@rm -f run_init$(EXEEXT)
+	$(LINK) $(run_init_LDFLAGS) $(run_init_OBJECTS) $(run_init_LDADD) $(LIBS)
+trynfs$(EXEEXT): $(trynfs_OBJECTS) $(trynfs_DEPENDENCIES) 
+	@rm -f trynfs$(EXEEXT)
+	$(LINK) $(trynfs_LDFLAGS) $(trynfs_OBJECTS) $(trynfs_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/findlibs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/run_init.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trynfs.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(auxdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-auxPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-auxPROGRAMS
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-auxPROGRAMS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-auxPROGRAMS clean-generic clean-recursive ctags \
+	ctags-recursive distclean distclean-compile distclean-generic \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-auxPROGRAMS \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-auxPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/exec/findlibs.c
===================================================================
--- dists/trunk/utils/yaird/exec/findlibs.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/findlibs.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,444 @@
+/* findlibs.c: find libraries used by an ELF executable.
+
+    Copyright (C) 2005, Erik van Konijnenburg
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+*/
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <limits.h>
+#include <elf.h>
+
+#include <config.h>
+
+extern int	optint;
+extern int	opterr;
+extern int	optopt;
+extern char *	optarg;
+
+static int	silent = 0;		/* dont do error messages */
+static char *	progname = "findlibs";
+static char *	version = VERSION;
+
+void
+message (char *fmt, ...)
+{
+	va_list	ap;
+	if (! silent) {
+		va_start (ap, fmt);
+		fprintf (stderr, "%s: ", progname);
+		vfprintf (stderr, fmt, ap);
+		fprintf (stderr, "\n");
+		va_end (ap);
+	}
+}
+
+void
+fatal (char *fmt, ...)
+{
+	va_list	ap;
+	if (! silent) {
+		va_start (ap, fmt);
+		fprintf (stderr, "%s: ", progname);
+		vfprintf (stderr, fmt, ap);
+		fprintf (stderr, " (fatal)\n");
+		va_end (ap);
+	}
+	exit (1);
+}
+
+void
+usage (void)
+{
+	printf ("\
+    %s [ -qhv ] executable\n\
+    print dynamic loader and basenames of shared libraries for executable\n\
+    -q: do not print error messages, just give exit code\n\
+    -h: this help text\n\
+    -v: version\n\
+    corrupt ELF files cause an error exit status, non ELF-files\n\
+    or non-executable ELF files do not.\n\
+",
+		progname);
+}
+
+void *
+getStuff (FILE *fp, Elf32_Off offset, Elf32_Word size)
+{
+	int		rc;
+	size_t		rc2;
+	void *		ptr = NULL;
+
+	ptr = malloc(size);
+	if (! ptr) {
+		fatal ("could not allocate memory");
+	}
+
+	rc = fseek (fp, offset, SEEK_SET);
+	if (rc != 0) {
+		fatal ("could not seek");
+	}
+	rc2 = fread (ptr, size, 1, fp);
+	if (rc2 != 1) {
+		fatal ("could not read");
+	}
+	return ptr;
+}
+
+void
+doOne32 (char *filename, FILE *fp)
+{
+	int		i;
+	Elf32_Ehdr *	ehdr = NULL;
+	Elf32_Phdr *	phdr = NULL;
+	int		interpIndex = -1;	/* prog hdr with interp. */
+	Elf32_Shdr *	shdrs = NULL;
+	int		dynamicIndex = -1;	/* section named .dynamic */
+	Elf32_Dyn *	dynamic = NULL;
+	int		dynstrIndex = -1;	/* section named .dynstr */
+	char *		dynstr = NULL;
+	char *		sectionNames = NULL;
+
+
+	ehdr = getStuff (fp, 0, sizeof(*ehdr));
+
+	if (ehdr->e_ehsize != sizeof(*ehdr)) {
+		fatal ("bad size ehdr %s", filename);
+	}
+
+	if (! (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)) {
+		message ("bad type ehdr %s", filename);
+		goto out;
+	}
+
+	if (ehdr->e_phentsize != sizeof (*phdr)) {
+		fatal ("bad size phdr %s", filename);
+	}
+
+	if (ehdr->e_phnum < 1 || ehdr->e_phnum > (65336/sizeof(*phdr))) {
+		fatal ("bad count phdr %s", filename);
+	}
+
+	phdr = getStuff (fp, ehdr->e_phoff, ehdr->e_phnum * sizeof(*phdr));
+
+	for (i = 0; i < ehdr->e_phnum; i++) {
+		if (phdr[i].p_type == PT_INTERP) {
+			if (interpIndex >= 0) {
+				fatal ("corrupt image, interp %s", filename);
+			}
+			interpIndex = i;
+		}
+	}
+
+	/*
+	 * Print interpreter.
+	 * Note you can have files with DT_NEEDED without interp;
+	 * shared libraries are an example.
+	 */
+	if (interpIndex >= 0) {
+		Elf32_Off	offset = phdr[interpIndex].p_offset;
+		Elf32_Word	size = phdr[interpIndex].p_filesz;
+		char *		interpreter = NULL;
+
+		if (size < 2 || size > PATH_MAX) {
+			fatal ("funny interpreter %s", filename);
+		}
+
+		interpreter = getStuff (fp, offset, size);
+		if (interpreter[size - 1] != '\0') {
+			fatal ("broken interpreter %s", filename);
+		}
+
+		printf ("interpreter: %s\n", interpreter);
+
+		free (interpreter);
+	}
+
+	/*
+	 * read section headers
+	 */
+	if (ehdr->e_shentsize != sizeof (Elf32_Shdr)) {
+		fatal ("bad section header size %s", filename);
+	}
+	shdrs = getStuff (fp, ehdr->e_shoff, sizeof(*shdrs) * ehdr->e_shnum);
+
+	/*
+	 * read section header names
+	 */
+	if (ehdr->e_shstrndx >= ehdr->e_shnum) {
+		fatal ("no section names in %s", filename);
+	}
+	sectionNames = getStuff (fp, shdrs[ehdr->e_shstrndx].sh_offset,
+			shdrs[ehdr->e_shstrndx].sh_size);
+
+
+	/*
+	 * Find .dynamic section and corresponding strings.
+	 */
+	for (i = 0; i < ehdr->e_shnum; i++) {
+		char *	name = &sectionNames[shdrs[i].sh_name];
+		if (strcmp (name, ".dynamic") == 0) {
+			dynamicIndex = i;
+		}
+		else if (strcmp (name, ".dynstr") == 0) {
+			dynstrIndex = i;
+		}
+	}
+
+	if (dynamicIndex < 0) {
+		goto out;
+	}
+
+	if (dynamicIndex >= 0  &&  dynstrIndex < 0) {
+		fatal ("corrupt dynamic without dynstr %s", filename);
+	}
+	if (dynamicIndex > ehdr->e_shnum) {
+		fatal ("dynamic out of range %s", filename);
+	}
+	if (dynstrIndex > ehdr->e_shnum) {
+		fatal ("dynamic out of range %s", filename);
+	}
+	dynamic = getStuff (fp, shdrs[dynamicIndex].sh_offset,
+			shdrs[dynamicIndex].sh_size);
+	dynstr = getStuff (fp, shdrs[dynstrIndex].sh_offset,
+			shdrs[dynstrIndex].sh_size);
+
+	for (i = 0;; i++) {
+		if (dynamic[i].d_tag == DT_NEEDED) {
+			Elf32_Word offset = dynamic[i].d_un.d_val;
+			char *name = &dynstr[offset];
+
+			printf ("needed: %s\n", name);
+		}
+		if (dynamic[i].d_tag == DT_NULL) {
+			break;
+		}
+	}
+
+out:
+	if (dynstr) free (dynstr);
+	if (dynamic) free (dynamic);
+	if (ehdr) free (ehdr);
+	if (phdr) free (phdr);
+	if (shdrs) free (shdrs);
+	if (sectionNames) free (sectionNames);
+}
+
+
+void
+doOne64 (char *filename, FILE *fp)
+{
+	int		i;
+	Elf64_Ehdr *	ehdr = NULL;
+	Elf64_Phdr *	phdr = NULL;
+	int		interpIndex = -1;	/* proghdr has interp. */
+	Elf64_Shdr *	shdrs = NULL;
+	int		dynamicIndex = -1;	/* section named .dynamic */
+	Elf64_Dyn *	dynamic = NULL;
+	int		dynstrIndex = -1;	/* section named .dynstr */
+	char *		dynstr = NULL;
+	char *		sectionNames = NULL;
+
+
+	ehdr = getStuff (fp, 0, sizeof(*ehdr));
+
+	if (ehdr->e_ehsize != sizeof(*ehdr)) {
+		fatal ("bad size ehdr %s", filename);
+	}
+
+	if (! (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)) {
+		message ("bad type ehdr %s", filename);
+		goto out;
+	}
+
+	if (ehdr->e_phentsize != sizeof (*phdr)) {
+		fatal ("bad size phdr %s", filename);
+	}
+
+	if (ehdr->e_phnum < 1 || ehdr->e_phnum > (65336/sizeof(*phdr))) {
+		fatal ("bad count phdr %s", filename);
+	}
+
+	phdr = getStuff (fp, ehdr->e_phoff, ehdr->e_phnum * sizeof(*phdr));
+
+	for (i = 0; i < ehdr->e_phnum; i++) {
+		if (phdr[i].p_type == PT_INTERP) {
+			if (interpIndex >= 0) {
+				fatal ("corrupt image, interp %s", filename);
+			}
+			interpIndex = i;
+		}
+	}
+
+	/*
+	 * Print interpreter.
+	 * Note you can have files with DT_NEEDED without interp;
+	 * shared libraries are an example.
+	 */
+	if (interpIndex >= 0) {
+		Elf64_Off	offset = phdr[interpIndex].p_offset;
+		Elf64_Xword	size = phdr[interpIndex].p_filesz;
+		char *		interpreter = NULL;
+
+		if (size < 2 || size > PATH_MAX) {
+			fatal ("funny interpreter %s", filename);
+		}
+
+		interpreter = getStuff (fp, offset, size);
+		if (interpreter[size - 1] != '\0') {
+			fatal ("broken interpreter %s", filename);
+		}
+
+		printf ("interpreter: %s\n", interpreter);
+
+		free (interpreter);
+	}
+
+	/*
+	 * read section headers
+	 */
+	if (ehdr->e_shentsize != sizeof (Elf64_Shdr)) {
+		fatal ("bad section header size %s", filename);
+	}
+	shdrs = getStuff (fp, ehdr->e_shoff, sizeof(*shdrs) * ehdr->e_shnum);
+
+	/*
+	 * read section header names
+	 */
+	if (ehdr->e_shstrndx >= ehdr->e_shnum) {
+		fatal ("no section names in %s", filename);
+	}
+	sectionNames = getStuff (fp, shdrs[ehdr->e_shstrndx].sh_offset,
+			shdrs[ehdr->e_shstrndx].sh_size);
+
+	for (i = 0; i < ehdr->e_shnum; i++) {
+		char *	name = &sectionNames[shdrs[i].sh_name];
+		if (strcmp (name, ".dynamic") == 0) {
+			dynamicIndex = i;
+		}
+		else if (strcmp (name, ".dynstr") == 0) {
+			dynstrIndex = i;
+		}
+	}
+
+	if (dynamicIndex < 0) {
+		goto out;
+	}
+
+	if (dynamicIndex >= 0  &&  dynstrIndex < 0) {
+		fatal ("corrupt dynamic without dynstr %s", filename);
+	}
+	if (dynamicIndex > ehdr->e_shnum) {
+		fatal ("dynamic out of range %s", filename);
+	}
+	if (dynstrIndex > ehdr->e_shnum) {
+		fatal ("dynamic out of range %s", filename);
+	}
+	dynamic = getStuff (fp, shdrs[dynamicIndex].sh_offset,
+			shdrs[dynamicIndex].sh_size);
+	dynstr = getStuff (fp, shdrs[dynstrIndex].sh_offset,
+			shdrs[dynstrIndex].sh_size);
+
+	for (i = 0;; i++) {
+		if (dynamic[i].d_tag == DT_NEEDED) {
+			Elf64_Xword offset = dynamic[i].d_un.d_val;
+			char *name = &dynstr[offset];
+
+			printf ("needed: %s\n", name);
+		}
+		if (dynamic[i].d_tag == DT_NULL) {
+			break;
+		}
+	}
+
+out:
+	if (dynstr) free (dynstr);
+	if (dynamic) free (dynamic);
+	if (ehdr) free (ehdr);
+	if (phdr) free (phdr);
+	if (shdrs) free (shdrs);
+	if (sectionNames) free (sectionNames);
+}
+
+
+void
+doOne (char *filename)
+{
+	FILE *		fp;
+	size_t		rc;
+	unsigned char	magic[EI_NIDENT];
+
+	fp = fopen (filename, "r");
+	if (! fp) {
+		fatal ("could not open %s", filename);
+	}
+
+	rc = fread (magic, 1, EI_NIDENT, fp);
+	if (rc < EI_NIDENT) {
+		message ("not an ELF file: %s", filename);
+		return;
+	}
+
+	if (strncmp (magic, ELFMAG, SELFMAG) != 0) {
+		message ("not an ELF file: bad magic in %s", filename);
+		return;
+	}
+
+	switch (magic[EI_CLASS]) {
+	case ELFCLASS32:
+		doOne32 (filename, fp);
+		break;
+	case ELFCLASS64:
+		doOne64 (filename, fp);
+		break;
+	default:
+		fatal ("bad class %s", filename);
+	}
+
+	if (fclose (fp)) {
+		fatal ("could not close %s", filename);
+	}
+}
+
+int
+main (int argc, char *argv[])
+{
+	int	i;
+	while ((i = getopt (argc, argv, "hvq")) >= 0) {
+		switch (i) {
+		case 'h':
+			usage ();
+			return 0;
+		case 'v':
+			message ("version %s", version);
+			return 0;
+		case 'q':
+			silent = 1;
+			break;
+		default:
+			fatal ("bad argument %c, -h for help", optopt);
+		}
+	}
+	if (optind != argc -1) {
+		fatal ("too many arguments");
+	}
+
+	doOne (argv[optind]);
+	return 0;
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,33 @@
+#
+# Makefile.am -- compiling executables to be included in generated image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# NOTE: We compile the same sources twice,
+# once as standalone program, once as library to be linked with trymount.
+#
+
+# place package-specific executables that may go on the image in
+# this directory.
+aux_PROGRAMS = ipconfig
+noinst_LIBRARIES = libipconfig.a
+
+include ../../Makefile.incl
+
+ipconfig_SOURCES = bootp_proto.c dhcp_proto.c main.c netdev.c packet.c \
+	bootp_packet.h bootp_proto.h dhcp_proto.h ipconfig.h netdev.h packet.h
+libipconfig_a_SOURCES = bootp_proto.c dhcp_proto.c main.c netdev.c packet.c \
+	bootp_packet.h bootp_proto.h dhcp_proto.h ipconfig.h netdev.h packet.h

Added: dists/trunk/utils/yaird/exec/ipconfig/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,474 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#
+# Makefile.am -- compiling executables to be included in generated image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# NOTE: We compile the same sources twice,
+# once as standalone program, once as library to be linked with trymount.
+#
+
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+aux_PROGRAMS = ipconfig$(EXEEXT)
+DIST_COMMON = README $(srcdir)/../../Makefile.incl \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = exec/ipconfig
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libipconfig_a_AR = $(AR) $(ARFLAGS)
+libipconfig_a_LIBADD =
+am_libipconfig_a_OBJECTS = bootp_proto.$(OBJEXT) dhcp_proto.$(OBJEXT) \
+	main.$(OBJEXT) netdev.$(OBJEXT) packet.$(OBJEXT)
+libipconfig_a_OBJECTS = $(am_libipconfig_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(auxdir)"
+auxPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(aux_PROGRAMS)
+am_ipconfig_OBJECTS = bootp_proto.$(OBJEXT) dhcp_proto.$(OBJEXT) \
+	main.$(OBJEXT) netdev.$(OBJEXT) packet.$(OBJEXT)
+ipconfig_OBJECTS = $(am_ipconfig_OBJECTS)
+ipconfig_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libipconfig_a_SOURCES) $(ipconfig_SOURCES)
+DIST_SOURCES = $(libipconfig_a_SOURCES) $(ipconfig_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+noinst_LIBRARIES = libipconfig.a
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf
+ipconfig_SOURCES = bootp_proto.c dhcp_proto.c main.c netdev.c packet.c \
+	bootp_packet.h bootp_proto.h dhcp_proto.h ipconfig.h netdev.h packet.h
+
+libipconfig_a_SOURCES = bootp_proto.c dhcp_proto.c main.c netdev.c packet.c \
+	bootp_packet.h bootp_proto.h dhcp_proto.h ipconfig.h netdev.h packet.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../../Makefile.incl $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  exec/ipconfig/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  exec/ipconfig/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libipconfig.a: $(libipconfig_a_OBJECTS) $(libipconfig_a_DEPENDENCIES) 
+	-rm -f libipconfig.a
+	$(libipconfig_a_AR) libipconfig.a $(libipconfig_a_OBJECTS) $(libipconfig_a_LIBADD)
+	$(RANLIB) libipconfig.a
+install-auxPROGRAMS: $(aux_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(auxdir)" || $(mkdir_p) "$(DESTDIR)$(auxdir)"
+	@list='$(aux_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(auxPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(auxdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(auxPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(auxdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-auxPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(aux_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(auxdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(auxdir)/$$f"; \
+	done
+
+clean-auxPROGRAMS:
+	-test -z "$(aux_PROGRAMS)" || rm -f $(aux_PROGRAMS)
+ipconfig$(EXEEXT): $(ipconfig_OBJECTS) $(ipconfig_DEPENDENCIES) 
+	@rm -f ipconfig$(EXEEXT)
+	$(LINK) $(ipconfig_LDFLAGS) $(ipconfig_OBJECTS) $(ipconfig_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bootp_proto.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dhcp_proto.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netdev.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/packet.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/../..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(auxdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-auxPROGRAMS clean-generic clean-noinstLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-auxPROGRAMS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-auxPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-auxPROGRAMS \
+	clean-generic clean-noinstLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-auxPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-auxPROGRAMS \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/exec/ipconfig/README
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/README	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/README	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,103 @@
+BOOTP/DHCP client for klibc
+---------------------------
+
+Usage:
+
+ipconfig [-c proto] [-d interface] [-n] [-p port] [-t timeout] [interface ...]
+
+-c proto	Use PROTO as the configuration protocol for all
+		interfaces, unless overridden by specific interfaces.
+-d interface	Either the name of an interface, or a long spec.
+-n		Do nothing - just print the configuration that would
+		be performed.
+-p port		Send bootp/dhcp broadcasts from PORT, to PORT - 1.
+-t timeout	Give up on all unconfigured interfaces after TIMEOUT secs.
+
+You can configure multiple interfaces by passing multiple interface
+specs on the command line, or by using the special interface name
+"all".  If you're autoconfiguring any interfaces, ipconfig will wait
+until either all such interfaces have been configured, or the timeout
+passes.
+
+PROTO can be one of the following, which selects the autoconfiguration
+protocol to use:
+
+not specified	use all protocols (the default)
+dhcp		use bootp and dhcp
+bootp		use bootp only
+rarp		use rarp (not currently supported)
+none		no autoconfiguration - either static config, or none at all
+
+An interface spec can be either short form, which is just the name of
+an interface (eth0 or whatever), or long form.  The long form consists
+of up to seven elements, separated by colons:
+
+<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
+
+  <client-ip>	IP address of the client. If empty, the address will
+                either be determined by RARP/BOOTP/DHCP. What protocol
+                is used de- pends on the <autoconf> parameter. If this
+                parameter is not empty, autoconf will be used.
+
+  <server-ip>   IP address of the NFS server. If RARP is used to
+                determine the client address and this parameter is NOT
+                empty only replies from the specified server are
+                accepted. To use different RARP and NFS server,
+                specify your RARP server here (or leave it blank), and
+                specify your NFS server in the `nfsroot' parameter
+                (see above). If this entry is blank the address of the
+                server is used which answered the RARP/BOOTP/DHCP
+                request.
+
+  <gw-ip>       IP address of a gateway if the server is on a different
+                subnet. If this entry is empty no gateway is used and the
+                server is assumed to be on the local network, unless a
+                value has been received by BOOTP/DHCP.
+
+  <netmask>     Netmask for local network interface. If this is empty,
+                the netmask is derived from the client IP address assuming
+                classful addressing, unless overridden in BOOTP/DHCP reply.
+
+  <hostname>    Name of the client. If empty, the client IP address is
+                used in ASCII notation, or the value received by
+                BOOTP/DHCP.
+
+  <device>      Name of network device to use. If this is empty, all
+                devices are used for RARP/BOOTP/DHCP requests, and the
+                first one we receive a reply on is configured. If you
+                have only one device, you can safely leave this blank.
+
+  <autoconf>	Method to use for autoconfiguration. If this is either
+                'rarp', 'bootp', or 'dhcp' the specified protocol is
+                used.  If the value is 'both', 'all' or empty, all
+                protocols are used.  'off', 'static' or 'none' means
+                no autoconfiguration.
+
+IP addresses and netmasks must be either absent (defaulting to zero)
+or presented in dotted-quad notation.
+
+An interface spec can be prefixed with either "ip=", "nfsaddrs=", both
+of which are ignored.  These (along with the ugliness of the long
+form) are present for compatibility with the in-kernel ipconfig code
+from 2.4 and earlier kernels.
+
+Here are a few examples of valid ipconfig command lines.
+
+Enable the loopback interface:
+    ipconfig 127.0.0.1:::::lo:none
+
+Try to configure eth0 using bootp for up to 30 seconds:
+    ipconfig -t 30 -c bootp eth0
+
+Configure eth0 and eth1 using dhcp or bootp, and eth2 statically:
+    ipconfig -c any eth0 eth1 192.168.1.1:::::eth2:none
+
+--
+
+From Russell's original README, and still true:
+
+The code in main.c is yucky imho.  Needs cleaning.
+
+--
+Russell King (2002/10/22)
+Bryan O'Sullivan (2003/04/29)

Added: dists/trunk/utils/yaird/exec/ipconfig/bootp_packet.h
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/bootp_packet.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/bootp_packet.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,34 @@
+/*
+ * ipconfig/bootp_packet.h
+ */
+#ifndef BOOTP_PACKET_H
+#define BOOTP_PACKET_H
+
+#include <sys/uio.h>
+
+struct netdev;
+
+/* packet ops */
+#define BOOTP_REQUEST	1
+#define BOOTP_REPLY	2
+
+/* your basic bootp packet */
+struct bootp_hdr {
+	__u8	op;
+	__u8	htype;
+	__u8	hlen;
+	__u8	hops;
+	__u32	xid;
+	__u16	secs;
+	__u16	flags;
+	__u32	ciaddr;
+	__u32	yiaddr;
+	__u32	siaddr;
+	__u32	giaddr;
+	__u8	chaddr[16];
+	char	server_name[64];
+	char	boot_file[128];
+	/* 312 bytes of extensions */
+};
+
+#endif

Added: dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.c
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,202 @@
+/*
+ * ipconfig/bootp_proto.c
+ *
+ * BOOTP packet protocol handling.
+ */
+#include <sys/types.h>
+#include <linux/types.h>	/* for __u8 */
+#include <sys/uio.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <netinet/in.h>
+
+#include "ipconfig.h"
+#include "netdev.h"
+#include "bootp_packet.h"
+#include "bootp_proto.h"
+#include "packet.h"
+
+static __u8 bootp_options[312] = {
+	[0]   = 99, 130, 83, 99,/* RFC1048 magic cookie */
+	[4]   = 1, 4,		/*   4-  9 subnet mask */
+	[10]  = 3, 4,		/*  10- 15 default gateway */
+	[16]  = 5, 8,		/*  16- 25 nameserver */
+	[26]  = 12, 32,		/*  26- 59 host name */
+	[60]  = 40, 32,		/*  60- 95 nis domain name */
+	[96]  = 17, 40,		/*  96-137 boot path */
+	[138] = 57, 2, 1, 150,	/* 138-141 extension buffer */
+	[142] = 255,		/* end of list */
+};
+
+/*
+ * Send a plain bootp request packet with options
+ */
+int bootp_send_request(struct netdev *dev)
+{
+	struct bootp_hdr bootp;
+	struct iovec iov[] = {
+		/* [0] = ip + udp headers */
+		[1] = { &bootp, sizeof(bootp) },
+		[2] = { bootp_options, 312 }
+	};
+
+	memset(&bootp, 0, sizeof(struct bootp_hdr));
+
+	bootp.op     = BOOTP_REQUEST,
+	bootp.htype  = dev->hwtype;
+	bootp.hlen   = dev->hwlen;
+	bootp.xid    = dev->bootp.xid;
+	bootp.ciaddr = dev->ip_addr;
+	bootp.secs   = htons(time(NULL) - dev->open_time);
+	memcpy(bootp.chaddr, dev->hwaddr, 16);
+
+	DEBUG(("-> bootp xid 0x%08x secs 0x%08x ",
+	       bootp.xid, ntohs(bootp.secs)));
+
+	return packet_send(dev, iov, 2);
+}
+
+/*
+ * Parse a bootp reply packet
+ */
+int
+bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, __u8 *exts, int extlen)
+{
+	dev->bootp.gateway    = hdr->giaddr;
+	dev->ip_addr          = hdr->yiaddr;
+	dev->ip_server        = hdr->siaddr;
+	dev->ip_netmask       = INADDR_ANY;
+	dev->ip_broadcast     = INADDR_ANY;
+	dev->ip_gateway       = hdr->giaddr;
+	dev->ip_nameserver[0] = INADDR_ANY;
+	dev->ip_nameserver[1] = INADDR_ANY;
+	dev->hostname[0]      = '\0';
+	dev->nisdomainname[0] = '\0';
+	dev->bootpath[0]      = '\0';
+
+	if (extlen >= 4 && exts[0] == 99 && exts[1] == 130 &&
+	    exts[2] == 83 && exts[3] == 99) {
+		__u8 *ext;
+
+		for (ext = exts + 4; ext - exts < extlen; ) {
+			__u8 len, opt = *ext++;
+			if (opt == 0)
+				continue;
+
+			len = *ext++;
+
+			switch (opt) {
+			case 1:	/* subnet mask */
+				memcpy(&dev->ip_netmask, ext, len > 4 ? 4 : len);
+				break;
+			case 3: /* default gateway */
+				memcpy(&dev->ip_gateway, ext, len > 4 ? 4 : len);
+				break;
+			case 6:	/* DNS server */
+				memcpy(&dev->ip_nameserver, ext, len > 8 ? 8 : len);
+				break;
+			case 12: /* host name */
+				if (len > sizeof(dev->hostname) - 1)
+					len = sizeof(dev->hostname) - 1;
+				memcpy(&dev->hostname, ext, len);
+				dev->hostname[len] = '\0';
+				break;
+			case 15: /* domain name */
+				if (len > sizeof(dev->dnsdomainname) - 1)
+					len = sizeof(dev->dnsdomainname) - 1;
+				memcpy(&dev->dnsdomainname, ext, len);
+				dev->dnsdomainname[len] = '\0';
+				break;
+			case 17: /* root path */
+				if (len > sizeof(dev->bootpath) - 1)
+					len = sizeof(dev->bootpath) - 1;
+				memcpy(&dev->bootpath, ext, len);
+				dev->bootpath[len] = '\0';
+				break;
+			case 26: /* interface MTU */
+				if ( len == 2  )
+					dev->mtu = (ext[0] << 8) + ext[1];
+				break;
+			case 28: /* broadcast addr */
+				memcpy(&dev->ip_broadcast, ext, len > 4 ? 4 : len);
+				break;
+			case 40: /* NIS domain name */
+				if (len > sizeof(dev->nisdomainname) - 1)
+					len = sizeof(dev->nisdomainname) - 1;
+				memcpy(&dev->nisdomainname, ext, len);
+				dev->nisdomainname[len] = '\0';
+				break;
+			}				
+
+			ext += len;
+		}
+	}
+
+	/*
+	 * Got packet.
+	 */
+	return 1;
+}
+
+/*
+ * Receive a bootp reply and parse packet
+ */
+int bootp_recv_reply(struct netdev *dev)
+{
+	struct bootp_hdr bootp;
+	__u8 bootp_options[312];
+	struct iovec iov[] = {
+		/* [0] = ip + udp headers */
+		[1] = { &bootp, sizeof(struct bootp_hdr) },
+		[2] = { bootp_options, 312 }
+	};
+	int ret;
+
+	ret = packet_recv(iov, 3);
+	if (ret <= 0)
+		return ret;
+
+	if (ret < sizeof(struct bootp_hdr) ||
+	    bootp.op != BOOTP_REPLY ||		/* RFC951 7.5 */
+	    bootp.xid != dev->bootp.xid ||
+	    memcmp(bootp.chaddr, dev->hwaddr, 16))
+		return 0;
+
+	ret -= sizeof(struct bootp_hdr);
+
+	return bootp_parse(dev, &bootp, bootp_options, ret);
+}
+
+/*
+ * Initialise interface for bootp.
+ */
+int bootp_init_if(struct netdev *dev)
+{
+	short flags;
+
+	/*
+	 * Get the device flags
+	 */
+	if (netdev_getflags(dev, &flags))
+		return -1;
+
+	/*
+	 * We can't do DHCP nor BOOTP if this device
+	 * doesn't support broadcast.
+	 */
+	if (dev->mtu < 364 || (flags & IFF_BROADCAST) == 0) {
+		dev->caps &= ~(CAP_BOOTP | CAP_DHCP);
+		return 0;
+	}
+	
+	/*
+	 * Get a random XID
+	 */
+	dev->bootp.xid = (__u32)lrand48();
+	dev->open_time = time(NULL);
+
+	return 0;
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.h
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/bootp_proto.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,7 @@
+/*
+ * bootp_proto.h
+ */
+int bootp_send_request(struct netdev *dev);
+int bootp_recv_reply(struct netdev *dev);
+int bootp_parse(struct netdev *dev, struct bootp_hdr *hdr, __u8 *exts, int extlen);
+int bootp_init_if(struct netdev *dev);

Added: dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.c
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,215 @@
+/*
+ * ipconfig/dhcp_proto.c
+ *
+ * DHCP RFC 2131 and 2132
+ */
+#include <sys/types.h>
+#include <linux/types.h>	/* for __u8 */
+#include <sys/uio.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "ipconfig.h"
+#include "netdev.h"
+#include "bootp_packet.h"
+#include "bootp_proto.h"
+#include "dhcp_proto.h"
+#include "packet.h"
+
+static __u8 dhcp_params[] = {
+	1,			/* subnet mask */
+	3,			/* default gateway */
+	6,			/* DNS server */
+	12,			/* host name */
+	15,			/* domain name */
+	17,			/* root path */
+	26,			/* interface mtu */
+	28,			/* broadcast addr */
+	40,			/* NIS domain name (why?) */
+};
+
+static __u8 dhcp_discover_hdr[] = {
+	99, 130, 83, 99,	/* bootp cookie */
+	53, 1, DHCPDISCOVER,	/* dhcp message type */
+	55, sizeof(dhcp_params),/* parameter list */
+};
+
+static __u8 dhcp_request_hdr[] = {
+	99, 130, 83, 99,	/* boot cookie */
+	53, 1, DHCPREQUEST,	/* dhcp message type */
+#define SERVER_IP_OFF 9
+	54, 4, 0, 0, 0, 0,	/* server IP */
+#define REQ_IP_OFF 15
+	50, 4, 0, 0, 0, 0,	/* requested IP address */
+	55, sizeof(dhcp_params),/* parameter list */
+};
+
+static __u8 dhcp_end[] = {
+	255,
+};
+
+static struct iovec dhcp_discover_iov[] = {
+	/* [0] = ip + udp header */
+	/* [1] = bootp header */
+	[2] = { dhcp_discover_hdr, sizeof(dhcp_discover_hdr) },
+	[3] = { dhcp_params, sizeof(dhcp_params) },
+	[4] = { dhcp_end, sizeof(dhcp_end) }
+};
+
+static struct iovec dhcp_request_iov[] = {
+	/* [0] = ip + udp header */
+	/* [1] = bootp header */
+	[2] = { dhcp_request_hdr, sizeof(dhcp_request_hdr) },
+	[3] = { dhcp_params, sizeof(dhcp_params) },
+	[4] = { dhcp_end, sizeof(dhcp_end) }
+};
+
+/*
+ * Parse a DHCP response packet
+ */
+static int
+dhcp_parse(struct netdev *dev, struct bootp_hdr *hdr, __u8 *exts, int extlen)
+{
+	__u8 type = 0;
+	__u32 serverid = INADDR_NONE;
+	int ret = 0;
+
+	if (extlen >= 4 && exts[0] == 99 && exts[1] == 130 &&
+	    exts[2] == 83 && exts[3] == 99) {
+		__u8 *ext;
+
+		for (ext = exts + 4; ext - exts < extlen; ) {
+			__u8 len, *opt = ext++;
+			if (*opt == 0)
+				continue;
+
+			len = *ext++;
+
+			ext += len;
+
+			if (*opt == 53)
+				type = opt[2];
+			if (*opt == 54)
+				memcpy(&serverid, opt + 2, 4);
+		}
+	}
+
+	switch (type) {
+	case DHCPOFFER:
+		ret = bootp_parse(dev, hdr, exts, extlen);
+		if (ret == 1 && serverid != INADDR_NONE)
+			dev->serverid = serverid;
+		DEBUG(("\n   dhcp offer\n"));
+		break;
+
+	case DHCPACK:
+		ret = bootp_parse(dev, hdr, exts, extlen);
+		DEBUG(("\n   dhcp ack\n"));
+		break;
+
+	case DHCPNAK:
+		ret = 2;
+		DEBUG(("\n   dhcp nak\n"));
+		break;
+	}
+	return ret;
+}
+
+/*
+ * Receive and parse a DHCP packet
+ */
+static int dhcp_recv(struct netdev *dev)
+{
+	struct bootp_hdr bootp;
+	__u8 dhcp_options[1500];
+	struct iovec iov[] = {
+		/* [0] = ip + udp header */
+		[1] = { &bootp, sizeof(struct bootp_hdr) },
+		[2] = { dhcp_options, sizeof(dhcp_options) }
+	};
+	int ret;
+
+	ret = packet_recv(iov, 3);
+	if (ret <= 0)
+		return ret;
+
+	DEBUG(("\n   dhcp xid %08x ", dev->bootp.xid));
+
+	if (ret < sizeof(struct bootp_hdr) ||
+	    bootp.op != BOOTP_REPLY ||		/* RFC951 7.5 */
+	    bootp.xid != dev->bootp.xid ||
+	    memcmp(bootp.chaddr, dev->hwaddr, 16))
+		return 0;
+
+	ret -= sizeof(struct bootp_hdr);
+
+	return dhcp_parse(dev, &bootp, dhcp_options, ret);
+}
+
+static int dhcp_send(struct netdev *dev, struct iovec *vec, int len)
+{
+	struct bootp_hdr bootp;
+
+	memset(&bootp, 0, sizeof(struct bootp_hdr));
+
+	bootp.op     = BOOTP_REQUEST;
+	bootp.htype  = dev->hwtype;
+	bootp.hlen   = dev->hwlen;
+	bootp.xid    = dev->bootp.xid;
+	bootp.ciaddr = dev->ip_addr;
+	bootp.giaddr = dev->bootp.gateway;
+	bootp.secs   = htons(time(NULL) - dev->open_time);
+	memcpy(bootp.chaddr, dev->hwaddr, 16);
+
+	vec[1].iov_base = &bootp;
+	vec[1].iov_len = sizeof(struct bootp_hdr);
+
+	DEBUG(("xid %08x secs %d ",
+	       bootp.xid, ntohs(bootp.secs)));
+
+	return packet_send(dev, vec, len);
+}
+
+/*
+ * Send a DHCP discover packet
+ */
+int dhcp_send_discover(struct netdev *dev)
+{
+	dev->ip_addr = INADDR_ANY;
+	dev->ip_gateway = INADDR_ANY;
+
+	DEBUG(("-> dhcp discover "));
+	
+	return dhcp_send(dev, dhcp_discover_iov, 5);
+}
+
+/*
+ * Receive a DHCP offer packet
+ */
+int dhcp_recv_offer(struct netdev *dev)
+{
+	return dhcp_recv(dev);
+}
+
+/*
+ * Send a DHCP request packet
+ */
+int dhcp_send_request(struct netdev *dev)
+{
+	memcpy(&dhcp_request_hdr[SERVER_IP_OFF], &dev->serverid, 4);
+	memcpy(&dhcp_request_hdr[REQ_IP_OFF], &dev->ip_addr, 4);
+
+	DEBUG(("-> dhcp request "));
+
+	return dhcp_send(dev, dhcp_request_iov, 5);
+}
+
+/*
+ * Receive a DHCP ack packet
+ */
+int dhcp_recv_ack(struct netdev *dev)
+{
+	return dhcp_recv(dev);
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.h
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/dhcp_proto.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,18 @@
+/*
+ * ipconfig/dhcp_proto.h
+ */
+
+/* DHCP message types */
+#define DHCPDISCOVER    1
+#define DHCPOFFER       2
+#define DHCPREQUEST     3
+#define DHCPDECLINE     4
+#define DHCPACK         5
+#define DHCPNAK         6
+#define DHCPRELEASE     7
+#define DHCPINFORM      8
+
+int dhcp_send_discover(struct netdev *dev);
+int dhcp_recv_offer(struct netdev *dev);
+int dhcp_send_request(struct netdev *dev);
+int dhcp_recv_ack(struct netdev *dev);

Added: dists/trunk/utils/yaird/exec/ipconfig/ipconfig.h
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/ipconfig.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/ipconfig.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,31 @@
+/*
+ * ipconfig/ipconfig.h
+ */
+
+#include <sys/types.h>
+#include <linux/types.h>	/* for __u16 */
+
+#define LOCAL_PORT	68
+#define REMOTE_PORT	(LOCAL_PORT - 1)
+
+extern __u16 cfg_local_port;
+extern __u16 cfg_remote_port;
+
+extern struct netdev *ifaces;
+
+extern int ipconfig_main(int argc, char *argv[]);
+
+/*
+ * Note for gcc 3.2.2:
+ *
+ * If you're turning on debugging, make sure you get rid of -Os from
+ * the gcc command line, or else ipconfig will fail to link.
+ */
+#undef IPC_DEBUG
+
+#undef DEBUG
+#ifdef IPC_DEBUG
+#define DEBUG(x) printf x
+#else
+#define DEBUG(x) do { } while(0)
+#endif

Added: dists/trunk/utils/yaird/exec/ipconfig/main.c
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/main.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/main.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,760 @@
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *   
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *   
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * ipconfig/main.c
+ */
+#define _XOPEN_SOURCE	/* for POLLRDNORM */
+#define _SVID_SOURCE	/* for SYS_NMLN */
+#include <errno.h>
+#include <poll.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <time.h>
+#include <arpa/inet.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>	/* for getopts */
+
+#include <net/if_arp.h>
+
+#include "ipconfig.h"
+#include "netdev.h"
+#include "bootp_packet.h"
+#include "bootp_proto.h"
+#include "dhcp_proto.h"
+#include "packet.h"
+
+static const char sysfs_class_net[] = "/sys/class/net";
+static const char *progname;
+static char do_not_config;
+static unsigned int default_caps = CAP_DHCP | CAP_BOOTP | CAP_RARP;
+static int loop_timeout = -1;
+static int configured;
+
+struct state {
+	int		state;
+	int		restart_state;
+	time_t		expire;
+	int		retry_period;
+
+	struct netdev	*dev;
+	struct state	*next;
+};
+
+static inline const char *my_inet_ntoa(__u32 addr)
+{
+	struct in_addr a;
+
+	a.s_addr = addr;
+
+	return inet_ntoa(a);
+}
+
+static void print_device_config(struct netdev *dev)
+{
+	printf("IP-Config: %s complete (from %s):\n", dev->name,
+		my_inet_ntoa(dev->serverid ? dev->serverid : dev->ip_server));
+	printf(" address: %-16s ", my_inet_ntoa(dev->ip_addr));
+	printf("broadcast: %-16s ", my_inet_ntoa(dev->ip_broadcast));
+	printf("netmask: %-16s\n", my_inet_ntoa(dev->ip_netmask));
+	printf(" gateway: %-16s ", my_inet_ntoa(dev->ip_gateway));
+	printf("dns0     : %-16s ", my_inet_ntoa(dev->ip_nameserver[0]));
+	printf("dns1   : %-16s\n", my_inet_ntoa(dev->ip_nameserver[1]));
+	if (dev->hostname[0])
+		printf(" host   : %-64s\n", dev->hostname);
+	if (dev->dnsdomainname[0])
+		printf(" domain : %-64s\n", dev->dnsdomainname);
+	if (dev->nisdomainname[0])
+		printf(" nisdomain: %-64s\n", dev->nisdomainname);
+	printf(" rootserver: %s ", my_inet_ntoa(dev->ip_server));
+	printf("rootpath: %s\n", dev->bootpath);
+}
+
+static void configure_device(struct netdev *dev)
+{
+	if (do_not_config)
+		return;
+
+	if (netdev_setmtu(dev))
+		printf("IP-Config: failed to set MTU on %s to %u\n",
+		       dev->name, dev->mtu);
+
+	if (netdev_setaddress(dev))
+		printf("IP-Config: failed to set addresses on %s\n", dev->name);
+	if (netdev_setdefaultroute(dev))
+		printf("IP-Config: failed to set default route on %s\n", dev->name);
+}
+
+static void dump_device_config(struct netdev *dev)
+{
+	char fn[40];
+	FILE *f;
+
+	snprintf(fn, sizeof(fn), "/tmp/net-%s.conf", dev->name);
+	f = fopen(fn, "w");
+	if (f) {
+		fprintf(f, "DEVICE=%s\n", dev->name);
+		fprintf(f, "IPV4ADDR=%s\n", my_inet_ntoa(dev->ip_addr));
+		fprintf(f, "IPV4BROADCAST=%s\n", my_inet_ntoa(dev->ip_broadcast));
+		fprintf(f, "IPV4NETMASK=%s\n", my_inet_ntoa(dev->ip_netmask));
+		fprintf(f, "IPV4GATEWAY=%s\n", my_inet_ntoa(dev->ip_gateway));
+		fprintf(f, "IPV4DNS0=%s\n", my_inet_ntoa(dev->ip_nameserver[0]));
+		fprintf(f, "IPV4DNS1=%s\n", my_inet_ntoa(dev->ip_nameserver[1]));
+		fprintf(f, "HOSTNAME=%s\n", dev->hostname);
+		fprintf(f, "DNSDOMAIN=%s\n", dev->dnsdomainname);
+		fprintf(f, "NISDOMAIN=%s\n", dev->nisdomainname);
+		fprintf(f, "ROOTSERVER=%s\n", my_inet_ntoa(dev->ip_server));
+		fprintf(f, "ROOTPATH=%s\n", dev->bootpath);
+		fclose(f);
+	}
+}
+
+static __u32 inet_class_netmask(__u32 ip)
+{
+	ip = ntohl(ip);
+	if (IN_CLASSA(ip))
+		return htonl(IN_CLASSA_NET);
+	if (IN_CLASSB(ip))
+		return htonl(IN_CLASSB_NET);
+	if (IN_CLASSC(ip))
+		return htonl(IN_CLASSC_NET);
+	return INADDR_ANY;
+}
+
+static void postprocess_device(struct netdev *dev)
+{
+	if (dev->ip_netmask == INADDR_ANY) {
+		dev->ip_netmask = inet_class_netmask(dev->ip_addr);
+		printf("IP-Config: %s guessed netmask %s\n",
+			dev->name, my_inet_ntoa(dev->ip_netmask));
+	}
+	if (dev->ip_broadcast == INADDR_ANY) {
+		dev->ip_broadcast = (dev->ip_addr & dev->ip_netmask) | ~dev->ip_netmask;
+		printf("IP-Config: %s guessed broadcast address %s\n",
+			dev->name, my_inet_ntoa(dev->ip_broadcast));
+	}
+	if (dev->ip_nameserver[0] == INADDR_ANY) {
+		dev->ip_nameserver[0] = dev->ip_server;
+		printf("IP-Config: %s guessed nameserver address %s\n",
+			dev->name, my_inet_ntoa(dev->ip_nameserver[0]));
+	}
+}
+
+static void complete_device(struct netdev *dev)
+{
+	postprocess_device(dev);
+	configure_device(dev);
+	dump_device_config(dev);
+	print_device_config(dev);
+
+	++configured;
+
+	dev->next = ifaces;
+	ifaces = dev;
+}
+
+static int process_receive_event(struct state *s, time_t now)
+{
+	int handled = 1;
+
+	switch (s->state) {
+	case DEVST_BOOTP:
+		s->restart_state = DEVST_BOOTP;
+		switch (bootp_recv_reply(s->dev)) {
+		case -1:
+			s->state = DEVST_ERROR;
+			break;
+		case 1:
+			s->state = DEVST_COMPLETE;
+			DEBUG(("\n   bootp reply\n"));
+			break;
+		}
+		break;
+
+	case DEVST_DHCPDISC:
+		s->restart_state = DEVST_DHCPDISC;
+		switch (dhcp_recv_offer(s->dev)) {
+		case -1:
+			s->state = DEVST_ERROR;
+			break;
+		case 1: /* Offer received */
+			s->state = DEVST_DHCPREQ;
+			dhcp_send_request(s->dev);
+			break;
+		}
+		break;
+
+	case DEVST_DHCPREQ:
+		s->restart_state = DEVST_DHCPDISC;
+		switch (dhcp_recv_ack(s->dev)) {
+		case -1: /* error */
+			s->state = DEVST_ERROR;
+			break;
+		case 1:	/* ACK received */
+			s->state = DEVST_COMPLETE;
+			break;
+		case 2:	/* NAK received */
+			s->state = DEVST_DHCPDISC;
+			break;
+		}
+		break;
+	}
+
+	switch (s->state) {
+	case DEVST_COMPLETE:
+		complete_device(s->dev);
+		break;
+
+	case DEVST_ERROR:
+		/* error occurred, try again in 10 seconds */
+		s->expire = now + 10;
+	default:
+		DEBUG(("\n"));
+		handled = 0;
+		break;
+	}
+
+	return handled;
+}
+
+static void process_timeout_event(struct state *s, time_t now)
+{
+	int ret = 0;
+
+	/*
+	 * Is the link up?  If not, try again in 1 second.
+	 */
+	if (!netdev_running(s->dev)) {
+		s->expire = now + 1;
+		s->state = s->restart_state;
+		return;
+	}
+
+	/*
+	 * If we had an error, restore a sane state to
+	 * restart from.
+	 */
+	if (s->state == DEVST_ERROR)
+		s->state = s->restart_state;
+
+	/*
+	 * Now send a packet depending on our state.
+	 */
+	switch (s->state) {
+	case DEVST_BOOTP:
+		ret = bootp_send_request(s->dev);
+		s->restart_state = DEVST_BOOTP;
+		break;
+
+	case DEVST_DHCPDISC:
+		ret = dhcp_send_discover(s->dev);
+		s->restart_state = DEVST_DHCPDISC;
+		break;
+
+	case DEVST_DHCPREQ:
+		ret = dhcp_send_request(s->dev);
+		s->restart_state = DEVST_DHCPDISC;
+		break;
+	}
+
+	if (ret == -1) {
+		s->state = DEVST_ERROR;
+		s->expire = now + 10;
+	} else {
+		s->expire = now + s->retry_period;
+
+		s->retry_period *= 2;
+		if (s->retry_period > 60)
+			s->retry_period = 60;
+	}
+}
+
+static struct state *slist;
+struct netdev *ifaces;
+
+static int do_pkt_recv(int pkt_fd, time_t now)
+{
+	int ifindex, ret;
+	struct state *s;
+
+	ret = packet_peek(&ifindex);
+	if (ret < 0)
+		goto bail;
+
+	for (s = slist; s; s = s->next) {
+		if (s->dev->ifindex == ifindex) {
+			ret |= process_receive_event(s, now);
+			break;
+		}
+	}
+
+ bail:
+	return ret;
+}
+
+static int loop(void)
+{
+#define NR_FDS	1
+	struct pollfd fds[NR_FDS];
+	struct state *s;
+	int pkt_fd;
+	int nr = 0;
+	struct timeval now, prev;
+	time_t start;
+
+	pkt_fd = packet_open();
+	if (pkt_fd == -1) {
+		perror("packet_open");
+		return -1;
+	}
+
+	fds[0].fd = pkt_fd;
+	fds[0].events = POLLRDNORM;
+
+	gettimeofday(&now, NULL);
+	start = now.tv_sec;
+	while (1) {
+		int timeout = 60;
+		int pending = 0;
+		int timeout_ms;
+		int x;
+
+		for (s = slist; s; s = s->next) {
+			/*
+			 * pick the first working interface,
+			 * bootpath or not.  To get all interfaces
+			 * up, use 'continue'.
+			 */
+			if (s->state == DEVST_COMPLETE)
+				goto bail;
+
+			pending++;
+
+			if (s->expire - now.tv_sec <= 0)
+				process_timeout_event(s, now.tv_sec);
+
+			if (timeout > s->expire - now.tv_sec)
+				timeout = s->expire - now.tv_sec;
+		}
+
+		if (pending == 0)
+			break;
+
+		timeout_ms = timeout * 1000;
+
+		for (x = 0; x < 2; x++) {
+			int delta_ms;
+
+			if (timeout_ms <= 0)
+				timeout_ms = 100;
+
+			nr = poll(fds, NR_FDS, timeout_ms);
+			prev = now;
+			gettimeofday(&now, NULL);
+
+			if ((fds[0].revents & POLLRDNORM)) {
+				nr = do_pkt_recv(pkt_fd, now.tv_sec);
+				if (nr == 1)
+					break;
+				else if (nr == 0)
+					packet_discard();
+			}
+
+			if (loop_timeout >= 0 &&
+			    now.tv_sec - start >= loop_timeout) {
+				printf("IP-Config: no response after %d "
+				       "secs - giving up\n", loop_timeout);
+				goto bail;
+			}
+
+			delta_ms = (now.tv_sec - prev.tv_sec) * 1000;
+			delta_ms += (now.tv_usec - prev.tv_usec) / 1000;
+
+			DEBUG(("Delta: %d ms\n", delta_ms));
+
+			timeout_ms -= delta_ms;
+		}
+	}
+ bail:
+	packet_close();
+
+	return 0;
+}
+
+static int add_one_dev(struct netdev *dev)
+{
+	struct state *state;
+
+	state = malloc(sizeof(struct state));
+	if (!state)
+		return -1;
+
+	state->dev = dev;
+	state->expire = time(NULL);
+	state->retry_period = 1;
+
+	/*
+	 * Select the state that we start from.
+	 */
+	if (dev->caps & CAP_DHCP && dev->ip_addr == INADDR_ANY) {
+		state->restart_state = state->state = DEVST_DHCPDISC;
+	} else if (dev->caps & CAP_DHCP) {
+		state->restart_state = state->state = DEVST_DHCPREQ;
+	} else if (dev->caps & CAP_BOOTP) {
+		state->restart_state = state->state = DEVST_BOOTP;
+	}
+
+	state->next = slist;
+	slist = state;
+
+	return 0;
+}
+
+static void parse_addr(__u32 *addr, const char *ip)
+{
+	struct in_addr in;
+	if (inet_aton(ip, &in) == 0) {
+		fprintf(stderr, "%s: can't parse IP address '%s'\n",
+			progname, ip);
+		exit(1);
+	}
+	*addr = in.s_addr;
+}
+
+static unsigned int parse_proto(const char *ip)
+{
+	unsigned int caps = 0;
+
+	if (*ip == '\0' || strcmp(ip, "on") == 0 || strcmp(ip, "any") == 0)
+		caps = CAP_BOOTP | CAP_DHCP | CAP_RARP;
+	else if (strcmp(ip, "both") == 0)
+		caps = CAP_BOOTP | CAP_RARP;
+	else if (strcmp(ip, "dhcp") == 0)
+		caps = CAP_BOOTP | CAP_DHCP;
+	else if (strcmp(ip, "bootp") == 0)
+		caps = CAP_BOOTP;
+	else if (strcmp(ip, "rarp") == 0)
+		caps = CAP_RARP;
+	else if (strcmp(ip, "none") == 0 || strcmp(ip, "static") == 0 || strcmp(ip, "off") == 0)
+		goto bail;
+	else {
+		fprintf(stderr, "%s: invalid protocol '%s'\n",
+			progname, ip);
+		exit(1);
+	}
+ bail:
+	return caps;
+}
+
+static int add_all_devices(struct netdev *template);
+
+static int parse_device(struct netdev *dev, const char *ip)
+{
+	char *cp;
+	int i, opt;
+
+	if (strncmp(ip, "ip=", 3) == 0) {
+		ip += 3;
+	}
+	else if (strncmp(ip, "nfsaddrs=", 9) == 0) {
+		ip += 9;
+	}
+
+	if (strchr(ip, ':') == NULL) {
+		dev->name = ip;
+		goto done;
+	}
+
+	for (i = opt = 0; ip && *ip; ip = cp, opt++) {
+		if ((cp = strchr(ip, ':'))) {
+			*cp++ = '\0';
+		}
+		if (opt > 6) {
+			fprintf(stderr, "%s: too many options for %s\n",
+				progname, dev->name);
+			exit(1);
+		}
+
+		if (*ip == '\0')
+			continue;
+		DEBUG(("IP-Config: opt #%d: '%s'\n", opt, ip));
+		switch (opt) {
+		case 0:
+			parse_addr(&dev->ip_addr, ip);
+			dev->caps = 0;
+			break;
+		case 1:
+			parse_addr(&dev->ip_server, ip);
+			break;
+		case 2:
+			parse_addr(&dev->ip_gateway, ip);
+			break;
+		case 3:
+			parse_addr(&dev->ip_netmask, ip);
+			break;
+		case 4:
+			strncpy(dev->hostname, ip, SYS_NMLN - 1);
+			dev->hostname[SYS_NMLN - 1] = '\0';
+			break;
+		case 5:
+			dev->name = ip;
+			break;
+		case 6:
+			dev->caps = parse_proto(ip);
+			break;
+		}
+	}
+ done:
+	if (dev->name == NULL ||
+	    dev->name[0] == '\0' ||
+	    strcmp(dev->name, "all") == 0) {
+		add_all_devices(dev);
+		return 0;
+	}
+	return 1;
+}
+
+static void bringup_device(struct netdev *dev)
+{
+	if (netdev_up(dev) == 0) {
+		if (dev->caps) {
+			add_one_dev(dev);
+		} else {
+			complete_device(dev);
+		}
+	}
+}
+
+static void bringup_one_dev(struct netdev *template, struct netdev *dev)
+{
+		if (template->ip_addr != INADDR_NONE)
+			dev->ip_addr = template->ip_addr;
+		if (template->ip_server != INADDR_NONE)
+			dev->ip_server = template->ip_server;
+		if (template->ip_gateway != INADDR_NONE)
+			dev->ip_gateway = template->ip_gateway;
+		if (template->ip_netmask != INADDR_NONE)
+			dev->ip_netmask = template->ip_netmask;
+		if (template->ip_nameserver[0] != INADDR_NONE)
+			dev->ip_nameserver[0] = template->ip_nameserver[0];
+		if (template->ip_nameserver[1] != INADDR_NONE)
+			dev->ip_nameserver[1] = template->ip_nameserver[1];
+		if (template->hostname[0] != '\0')
+			strcpy(dev->hostname, template->hostname);
+		dev->caps &= template->caps;
+
+		bringup_device(dev);
+}
+
+static struct netdev *add_device(const char *info)
+{
+	struct netdev *dev;
+	int i;
+
+	dev = malloc(sizeof(struct netdev));
+	if (dev == NULL) {
+		fprintf(stderr, "%s: out of memory\n", progname);
+		exit(1);
+	}
+
+	memset(dev, 0, sizeof(struct netdev));
+	dev->caps = default_caps;
+
+	if (parse_device(dev, info) == 0)
+		goto bail;
+
+	if (netdev_init_if(dev) == -1)
+		goto bail;
+
+	if (bootp_init_if(dev) == -1)
+		goto bail;
+
+	printf("IP-Config: %s hardware address", dev->name);
+	for (i = 0; i < dev->hwlen; i++)
+		printf("%c%02x", i == 0 ? ' ' : ':', dev->hwaddr[i]);
+	printf(" mtu %d%s%s\n", dev->mtu,
+		dev->caps & CAP_DHCP  ? " DHCP"  :
+		dev->caps & CAP_BOOTP ? " BOOTP" : "",
+	       dev->caps & CAP_RARP  ? " RARP"  : "");
+	return dev;
+ bail:
+	free(dev);
+	return NULL;
+}
+
+static int add_all_devices(struct netdev *template)
+{
+	DIR *d;
+	struct dirent *de;
+	struct netdev *dev;
+	char t[PATH_MAX], p[255];
+	int i, fd;
+	unsigned long flags;
+
+	d = opendir(sysfs_class_net);
+	if (!d)
+		return 0;
+
+	while((de = readdir(d)) != NULL ) {
+		/* This excludes devices beginning with dots or "dummy", as well as . or .. */
+		if ( de->d_name[0] == '.' || !strcmp(de->d_name, "..") )
+			continue;
+		i = snprintf(t, PATH_MAX-1, "%s/%s/flags", sysfs_class_net, de->d_name);
+		if (i < 0 || i >= PATH_MAX-1)
+			continue;
+		t[i] = '\0';
+		fd = open(t, O_RDONLY);
+		if (fd < 0) {
+			perror(t);
+			continue;
+		}
+		i = read(fd, &p, sizeof(p) - 1);
+		close(fd);
+		if (i < 0) {
+			perror(t);
+			continue;
+		}
+		p[i] = '\0';
+		flags = strtoul(p, NULL, 0);
+		/* Heuristic for if this is a reasonable boot interface.
+		   This is the same
+		   logic the in-kernel ipconfig uses... */
+		if ( !(flags & IFF_LOOPBACK) &&
+		     (flags & (IFF_BROADCAST|IFF_POINTOPOINT)) )
+		{
+			if ( !(dev = add_device(de->d_name)) )
+				continue;
+			bringup_one_dev(template, dev);
+		}
+	}
+	closedir(d);
+	return 1;
+}
+
+static int check_autoconfig(void)
+{
+	int ndev = 0, nauto = 0;
+	struct state *s;
+
+	for (s = slist; s; s = s->next) {
+		ndev++;
+		if (s->dev->caps)
+			nauto++;
+	}
+
+	if (ndev == 0) {
+		if (configured == 0) {
+			fprintf(stderr, "%s: no devices to configure\n",
+				progname);
+			exit(1);
+		}
+	}
+
+	return nauto;
+}
+
+int main(int argc, char *argv[])
+	__attribute__ ((weak, alias ("ipconfig_main")));
+
+int ipconfig_main(int argc, char *argv[])
+{
+	struct netdev *dev;
+	struct timeval now;
+	int c, port;
+
+	progname = argv[0];
+
+	gettimeofday(&now, NULL);
+	srand48(now.tv_usec ^ (now.tv_sec << 24));
+
+	do {
+		c = getopt(argc, argv, "c:d:np:t:");
+		if (c == EOF)
+			break;
+
+		switch (c) {
+		case 'c':
+			default_caps = parse_proto(optarg);
+			break;
+		case 'p':
+			port = atoi(optarg);
+			if (port <= 0 || port > USHRT_MAX) {
+				fprintf(stderr,
+					"%s: invalid port number %d\n",
+					progname, port);
+				exit(1);
+			}
+			cfg_local_port = port;
+			cfg_remote_port = cfg_local_port - 1;
+			break;
+		case 't':
+			loop_timeout = atoi(optarg);
+			if (loop_timeout < 0) {
+				fprintf(stderr,
+					"%s: invalid timeout %d\n",
+					progname, loop_timeout);
+				exit(1);
+			}
+			break;
+		case 'n':
+			do_not_config = 1;
+			break;
+		case 'd':
+			dev = add_device(optarg);
+			if (dev)
+				bringup_device(dev);
+			break;
+		case '?':
+			fprintf(stderr, "%s: invalid option -%c\n",
+				progname, optopt);
+			exit(1);
+		}
+	} while (1);
+
+	for (c = optind; c < argc; c++) {
+		dev = add_device(argv[c]);
+		if (dev)
+			bringup_device(dev);
+	}
+
+	if (check_autoconfig()) {
+		if (cfg_local_port != LOCAL_PORT) {
+			printf("IP-Config: binding source port to %d, "
+			       "dest to %d\n",
+			       cfg_local_port,
+			       cfg_remote_port);
+		}
+		loop();
+	}
+
+	return 0;
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/netdev.c
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/netdev.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/netdev.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,243 @@
+/*
+ * ipconfig/netdev.c
+ *
+ * ioctl-based device configuration
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <netinet/in.h>
+#include <net/route.h>
+
+#include "netdev.h"
+
+static int cfd = -1;
+
+static void copy_name(struct netdev *dev, struct ifreq *ifr)
+{
+	strncpy(ifr->ifr_name, dev->name, sizeof(ifr->ifr_name));
+	ifr->ifr_name[sizeof(ifr->ifr_name) - 1] = '\0';
+}
+
+int netdev_getflags(struct netdev *dev, short *flags)
+{
+	struct ifreq ifr;
+
+	copy_name(dev, &ifr);
+
+	if (ioctl(cfd, SIOCGIFFLAGS, &ifr) == -1) {
+		perror("SIOCGIFFLAGS");
+		return -1;
+	}
+
+	*flags = ifr.ifr_flags;
+	return 0;
+}
+
+static int netdev_sif_addr(struct ifreq *ifr, int cmd, __u32 addr)
+{
+	struct sockaddr_in *sin = (struct sockaddr_in *)&ifr->ifr_addr;
+
+	sin->sin_family = AF_INET;
+	sin->sin_addr.s_addr = addr;
+
+	return ioctl(cfd, cmd, ifr);
+}
+
+int netdev_setaddress(struct netdev *dev)
+{
+	struct ifreq ifr;
+
+	copy_name(dev, &ifr);
+
+	if (dev->ip_addr != INADDR_ANY &&
+	    netdev_sif_addr(&ifr, SIOCSIFADDR, dev->ip_addr) == -1) {
+		perror("SIOCSIFADDR");
+		return -1;
+	}
+
+	if (dev->ip_broadcast != INADDR_ANY &&
+	    netdev_sif_addr(&ifr, SIOCSIFBRDADDR, dev->ip_broadcast) == -1) {
+		perror("SIOCSIFBRDADDR");
+		return -1;
+	}
+
+	if (dev->ip_netmask != INADDR_ANY &&
+	    netdev_sif_addr(&ifr, SIOCSIFNETMASK, dev->ip_netmask) == -1) {
+		perror("SIOCSIFNETMASK");
+		return -1;
+	}
+
+	return 0;
+}
+
+int netdev_setdefaultroute(struct netdev *dev)
+{
+	struct rtentry r;
+
+	if (dev->ip_gateway == INADDR_ANY)
+		return 0;
+
+	memset(&r, 0, sizeof(r));
+
+	((struct sockaddr_in *)&r.rt_dst)->sin_family = AF_INET;
+	((struct sockaddr_in *)&r.rt_dst)->sin_addr.s_addr = INADDR_ANY;
+	((struct sockaddr_in *)&r.rt_gateway)->sin_family = AF_INET;
+	((struct sockaddr_in *)&r.rt_gateway)->sin_addr.s_addr = dev->ip_gateway;
+	((struct sockaddr_in *)&r.rt_genmask)->sin_family = AF_INET;
+	((struct sockaddr_in *)&r.rt_genmask)->sin_addr.s_addr = INADDR_ANY;
+	r.rt_flags = RTF_UP | RTF_GATEWAY;
+
+	if (ioctl(cfd, SIOCADDRT, &r) == -1 && errno != EEXIST) {
+		perror("SIOCADDRT");
+		return -1;
+	}
+	return 0;
+}
+
+int netdev_setmtu(struct netdev *dev)
+{
+	struct ifreq ifr;
+
+	copy_name(dev, &ifr);
+	ifr.ifr_mtu = dev->mtu;
+
+	return ioctl(cfd, SIOCSIFMTU, &ifr);
+}	
+
+static int netdev_gif_addr(struct ifreq *ifr, int cmd, __u32 *ptr)
+{
+	struct sockaddr_in *sin = (struct sockaddr_in *)&ifr->ifr_addr;
+
+	if (ioctl(cfd, cmd, ifr) == -1)
+		return -1;
+
+	*ptr = sin->sin_addr.s_addr;
+
+	return 0;
+}
+
+int netdev_up(struct netdev *dev)
+{
+	struct ifreq ifr;
+
+	copy_name(dev, &ifr);
+
+	if (ioctl(cfd, SIOCGIFFLAGS, &ifr) == -1) {
+		perror("SIOCGIFFLAGS");
+		return -1;
+	}
+
+	ifr.ifr_flags |= IFF_UP;
+
+	if (ioctl(cfd, SIOCSIFFLAGS, &ifr) == -1) {
+		perror("SIOCSIFFLAGS");
+		return -1;
+	}
+	return 0;
+}
+
+int netdev_down(struct netdev *dev)
+{
+	struct ifreq ifr;
+
+	copy_name(dev, &ifr);
+
+	if (ioctl(cfd, SIOCGIFFLAGS, &ifr) == -1) {
+		perror("SIOCGIFFLAGS");
+		return -1;
+	}
+
+	ifr.ifr_flags &= ~IFF_UP;
+
+	if (ioctl(cfd, SIOCSIFFLAGS, &ifr) == -1) {
+		perror("SIOCSIFFLAGS");
+		return -1;
+	}
+	return 0;
+}
+
+int netdev_init_if(struct netdev *dev)
+{
+	struct ifreq ifr;
+
+	if (cfd == -1)
+		cfd = socket(AF_INET, SOCK_DGRAM, 0);
+	if (cfd == -1) {
+		perror("socket(AF_INET)");
+		return -1;
+	}
+
+	copy_name(dev, &ifr);
+
+	if (ioctl(cfd, SIOCGIFINDEX, &ifr) == -1) {
+		perror("SIOCGIFINDEX");
+		return -1;
+	}
+
+	dev->ifindex = ifr.ifr_ifindex;
+
+	if (ioctl(cfd, SIOCGIFMTU, &ifr) == -1) {
+		perror("SIOCGIFMTU");
+		return -1;
+	}
+
+	dev->mtu = ifr.ifr_mtu;
+
+	if (ioctl(cfd, SIOCGIFHWADDR, &ifr) == -1) {
+		perror("SIOCGIFHWADDR");
+		return -1;
+	}
+
+	dev->hwtype = ifr.ifr_hwaddr.sa_family;
+	dev->hwlen  = 0;
+
+	switch (dev->hwtype) {
+	case ARPHRD_ETHER:
+		dev->hwlen = 6;
+		break;
+	case ARPHRD_EUI64:
+		dev->hwlen = 8;
+		break;
+	case ARPHRD_LOOPBACK:
+		dev->hwlen = 0;
+		break;
+	default:
+		return -1;
+	}
+
+	memcpy(dev->hwaddr, ifr.ifr_hwaddr.sa_data, dev->hwlen);
+	memset(dev->hwbrd, 0xff, dev->hwlen);
+
+	/*
+	 * Try to get the current interface information.
+	 */
+	if (dev->ip_addr == INADDR_NONE &&
+	    netdev_gif_addr(&ifr, SIOCGIFADDR, &dev->ip_addr) == -1) {
+		perror("SIOCGIFADDR");
+		dev->ip_addr = 0;
+		dev->ip_broadcast = 0;
+		dev->ip_netmask = 0;
+		return 0;
+	}
+
+	if (dev->ip_broadcast == INADDR_NONE &&
+	    netdev_gif_addr(&ifr, SIOCGIFBRDADDR, &dev->ip_broadcast) == -1) {
+		perror("SIOCGIFBRDADDR");
+		dev->ip_broadcast = 0;
+	}
+
+	if (dev->ip_netmask == INADDR_NONE &&
+	    netdev_gif_addr(&ifr, SIOCGIFNETMASK, &dev->ip_netmask) == -1) {
+		perror("SIOCGIFNETMASK");
+		dev->ip_netmask = 0;
+	}
+
+	return 0;
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/netdev.h
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/netdev.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/netdev.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,77 @@
+/*
+ * ipconfig/netdev.h
+ */
+#include <sys/utsname.h>
+#include <sys/types.h>
+#include <linux/types.h>
+#include <net/if.h>
+
+#define BPLEN		40
+
+struct netdev {
+	const char 	*name;			/* Device name		*/
+	unsigned int	ifindex;		/* interface index	*/
+	unsigned int	hwtype;			/* ARPHRD_xxx		*/
+	unsigned int	hwlen;			/* HW address length	*/
+	__u8		hwaddr[16];		/* HW address		*/
+	__u8		hwbrd[16];		/* Broadcast HW address */
+	unsigned int	mtu;			/* Device mtu		*/
+	unsigned int	caps;			/* Capabilities		*/
+	time_t		open_time;
+
+	struct {				/* BOOTP/DHCP info	*/
+		int	fd;
+		__u32	xid;
+		__u32	gateway;		/* BOOTP/DHCP gateway	*/
+	} bootp;
+
+	struct {				/* RARP information	*/
+		int	fd;
+	} rarp;
+
+	__u32		ip_addr;		/* my address		*/
+	__u32		ip_broadcast;		/* broadcast address	*/
+	__u32		ip_server;		/* server address	*/
+	__u32		ip_netmask;		/* my subnet mask	*/
+	__u32		ip_gateway;		/* my gateway		*/
+	__u32		ip_nameserver[2];	/* two nameservers	*/
+	__u32		serverid;		/* dhcp serverid	*/
+	char		hostname[SYS_NMLN];	/* hostname		*/
+	char		dnsdomainname[SYS_NMLN];/* dns domain name	*/
+	char		nisdomainname[SYS_NMLN];/* nis domain name	*/
+	char		bootpath[BPLEN];	/* boot path		*/
+	struct netdev	*next;			/* next configured i/f	*/
+};
+
+/*
+ * Device capabilities
+ */
+#define CAP_BOOTP	(1<<0)
+#define CAP_DHCP	(1<<1)
+#define CAP_RARP	(1<<2)
+
+/*
+ * Device states
+ */
+#define DEVST_UP	0
+#define DEVST_BOOTP	1
+#define DEVST_DHCPDISC	2
+#define DEVST_DHCPREQ	3
+#define DEVST_COMPLETE	4
+#define DEVST_ERROR	5
+
+int netdev_getflags(struct netdev *dev, short *flags);
+int netdev_setaddress(struct netdev *dev);
+int netdev_setdefaultroute(struct netdev *dev);
+int netdev_up(struct netdev *dev);
+int netdev_down(struct netdev *dev);
+int netdev_init_if(struct netdev *dev);
+int netdev_setmtu(struct netdev *dev);
+
+static inline int netdev_running(struct netdev *dev)
+{
+	short flags;
+	int ret = netdev_getflags(dev, &flags);
+
+	return ret ? 0 : !!(flags & IFF_RUNNING);
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/packet.c
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/packet.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/packet.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,288 @@
+/*
+ * ipconfig/packet.c
+ *
+ * Packet socket handling glue.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <net/if_packet.h>
+#include <netinet/if_ether.h>
+#include <netinet/in.h>
+#include <netpacket/packet.h>
+#include <asm/byteorder.h>
+#include <arpa/inet.h>
+#include <netinet/ip.h>
+#include <netinet/udp.h>
+
+#include "ipconfig.h"
+#include "netdev.h"
+#include "packet.h"
+
+static int pkt_fd = -1;
+
+__u16 cfg_local_port = LOCAL_PORT;
+__u16 cfg_remote_port = REMOTE_PORT;
+
+int packet_open(void)
+{
+	int fd, one = 1;
+
+	if (pkt_fd != -1)
+		return pkt_fd;
+	
+	/*
+	 * Get a PACKET socket for IP traffic.
+	 */
+	fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
+	if (fd == -1) {
+		perror("socket");
+		return -1;
+	}
+
+	/*
+	 * We want to broadcast
+	 */
+	if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &one,
+		       sizeof(one)) == -1) {
+		perror("SO_BROADCAST");
+		close(fd);
+		fd = -1;
+	}
+
+	pkt_fd = fd;
+
+	return fd;
+}
+
+void packet_close(void)
+{
+	close(pkt_fd);
+	pkt_fd = -1;
+}
+
+static unsigned int ip_checksum(__u16 *hdr, int len)
+{
+	unsigned int chksum = 0;
+
+	while (len) {
+		chksum += *hdr++;
+		chksum += *hdr++;
+		len--;
+	}
+	chksum = (chksum & 0xffff) + (chksum >> 16);
+	chksum = (chksum & 0xffff) + (chksum >> 16);
+	return (~chksum) & 0xffff;
+}
+
+struct header {
+	struct iphdr	ip;
+	struct udphdr	udp;
+} __attribute__((packed));
+
+static struct header ipudp_hdrs = {
+	.ip = {
+		.ihl		= 5,
+		.version	= IPVERSION,
+		.frag_off	= __constant_htons(IP_DF),
+		.ttl		= 64,
+		.protocol	= IPPROTO_UDP,
+		.saddr		= INADDR_ANY,
+		.daddr		= INADDR_BROADCAST,
+	},
+	.udp = {
+		.source		= __constant_htons(LOCAL_PORT),
+		.dest		= __constant_htons(REMOTE_PORT),
+		.len		= 0,
+		.check		= 0,
+	},
+};
+
+#ifdef IPC_DEBUG		/* Only used by DEBUG(()) */
+static char *ntoa(__u32 addr)
+{
+	struct in_addr in = { addr };
+	return inet_ntoa(in);
+}
+#endif
+
+/*
+ * Send a packet.  The options are listed in iov[1...iov_len].
+ * iov[0] is reserved for the bootp packet header.
+ */
+int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
+{
+	struct sockaddr_ll sll;
+	struct msghdr msg = {
+		.msg_name	= &sll,
+		.msg_namelen	= sizeof(sll),
+		.msg_iov	= iov,
+		.msg_iovlen	= iov_len,
+		.msg_control	= NULL,
+		.msg_controllen	= 0,
+		.msg_flags	= 0
+	};
+	int i, len = 0;
+
+	if (cfg_local_port != LOCAL_PORT) {
+		ipudp_hdrs.udp.source = htons(cfg_local_port);
+		ipudp_hdrs.udp.dest = htons(cfg_remote_port);
+	}
+	
+	DEBUG(("\n   udp src %d dst %d", ntohs(ipudp_hdrs.udp.source),
+	       ntohs(ipudp_hdrs.udp.dest)));
+
+	DEBUG(("\n   ip src %s ", ntoa(ipudp_hdrs.ip.saddr)));
+	DEBUG(("dst %s ", ntoa(ipudp_hdrs.ip.daddr)));
+
+	/*
+	 * Glue in the ip+udp header iovec
+	 */
+	iov[0].iov_base = &ipudp_hdrs;
+	iov[0].iov_len = sizeof(struct header);
+
+	for (i = 0; i < iov_len; i++)
+		len += iov[i].iov_len;
+
+	sll.sll_family   = AF_PACKET;
+	sll.sll_protocol = htons(ETH_P_IP);
+	sll.sll_ifindex  = dev->ifindex;
+	sll.sll_hatype   = dev->hwtype;
+	sll.sll_pkttype  = PACKET_BROADCAST;
+	sll.sll_halen    = dev->hwlen;
+	memcpy(sll.sll_addr, dev->hwbrd, dev->hwlen);
+
+	ipudp_hdrs.ip.tot_len   = htons(len);
+	ipudp_hdrs.ip.check     = 0;
+	ipudp_hdrs.ip.check     = ip_checksum((__u16 *)&ipudp_hdrs.ip,
+						ipudp_hdrs.ip.ihl);
+
+	ipudp_hdrs.udp.len      = htons(len - sizeof(struct iphdr));
+
+	DEBUG(("\n   bytes %d\n", len));
+	
+	return sendmsg(pkt_fd, &msg, 0);
+}
+
+int packet_peek(int *ifindex)
+{
+	struct sockaddr_ll sll;
+	struct iphdr iph;
+	int ret, sllen = sizeof(struct sockaddr_ll);
+
+	/*
+	 * Peek at the IP header.
+	 */
+	ret = recvfrom(pkt_fd, &iph, sizeof(struct iphdr),
+		       MSG_PEEK, (struct sockaddr *)&sll, &sllen);
+	if (ret == -1)
+		return -1;
+
+	if (sll.sll_family != AF_PACKET)
+		goto discard_pkt;
+
+	if (iph.ihl < 5 || iph.version != IPVERSION)
+		goto discard_pkt;
+
+	*ifindex = sll.sll_ifindex;
+
+	return 0;
+
+ discard_pkt:
+	packet_discard();
+	return 0;
+}
+
+void packet_discard(void)
+{
+	struct iphdr iph;
+	struct sockaddr_ll sll;
+	socklen_t sllen = sizeof(sll);
+	
+	recvfrom(pkt_fd, &iph, sizeof(iph), 0,
+		 (struct sockaddr *) &sll, &sllen);
+}
+
+/*
+ * Receive a bootp packet.  The options are listed in iov[1...iov_len].
+ * iov[0] must point to the bootp packet header.
+ */
+int packet_recv(struct iovec *iov, int iov_len)
+{
+	struct iphdr *ip, iph;
+	struct udphdr *udp;
+	struct msghdr msg = {
+		.msg_name	= NULL,
+		.msg_namelen	= 0,
+		.msg_iov	= iov,
+		.msg_iovlen	= iov_len,
+		.msg_control	= NULL,
+		.msg_controllen	= 0,
+		.msg_flags	= 0
+	};
+	int ret, iphl;
+
+	ret = recvfrom(pkt_fd, &iph, sizeof(struct iphdr),
+		       MSG_PEEK, NULL, NULL);
+	if (ret == -1)
+		return -1;
+
+	if (iph.ihl < 5 || iph.version != IPVERSION)
+		goto discard_pkt;
+
+	iphl = iph.ihl * 4;
+
+	ip = malloc(iphl + sizeof(struct udphdr));
+	if (!ip)
+		goto discard_pkt;
+
+	udp = (struct udphdr *)((char *)ip + iphl);
+
+	iov[0].iov_base = ip;
+	iov[0].iov_len = iphl + sizeof(struct udphdr);
+
+	ret = recvmsg(pkt_fd, &msg, 0);
+	if (ret == -1)
+		goto free_pkt;
+
+	DEBUG(("<- bytes %d ", ret));
+
+	if (ip_checksum((__u16 *)ip, ip->ihl) != 0)
+		goto free_pkt;
+
+	DEBUG(("\n   ip src %s ", ntoa(ip->saddr)));
+	DEBUG(("dst %s ", ntoa(ip->daddr)));
+
+	if (ntohs(ip->tot_len) > ret || ip->protocol != IPPROTO_UDP)
+		goto free_pkt;
+
+	ret -= 4 * ip->ihl;
+
+	DEBUG(("\n   udp src %d dst %d ", ntohs(udp->source),
+	       ntohs(udp->dest)));
+	
+	if (udp->source != htons(cfg_remote_port) ||
+	    udp->dest != htons(cfg_local_port))
+		goto free_pkt;
+
+	if (ntohs(udp->len) > ret)
+		goto free_pkt;
+
+	ret -= sizeof(struct udphdr);
+
+	free(ip);
+
+	return ret;
+
+ free_pkt:
+	free(ip);
+	return 0;
+
+ discard_pkt:
+	DEBUG(("discarded\n"));
+	packet_discard();
+	return 0;
+}

Added: dists/trunk/utils/yaird/exec/ipconfig/packet.h
===================================================================
--- dists/trunk/utils/yaird/exec/ipconfig/packet.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/ipconfig/packet.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,9 @@
+/*
+ * ipconfig/packet.h
+ */
+int packet_open(void);
+void packet_close(void);
+int packet_send(struct netdev *dev, struct iovec *iov, int iov_len);
+int packet_peek(int *ifindex);
+void packet_discard(void);
+int packet_recv(struct iovec *iov, int iov_len);

Added: dists/trunk/utils/yaird/exec/nfsmount/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,48 @@
+#
+# Makefile.am -- compiling executables to be included in generated image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# NOTE: We compile the same sources twice,
+# once as standalone program, once as library to be linked with trymount.
+#
+
+# place package-specific executables that may go on the image in
+# this directory.
+aux_PROGRAMS = nfsmount
+noinst_LIBRARIES = libnfsmount.a
+
+include ../../Makefile.incl
+
+#
+# nfs_mount.h includes linux/in.h, which breaks glibc,
+# so we can't use it.
+# We also cannot inline the code, since that would make the whole
+# program GPL, and GPL does not allow extra restrictions
+# on distribution, and HPA's licence has the restriction
+# that his disclaimer be kept intact.
+# The fun part is that the kernel compiles perfectly well
+# without the offending linux/in.h.
+#
+CLEANFILES = ridiculous.h
+BUILT_SOURCES = ridiculous.h
+ridiculous.h:	/usr/include/linux/nfs_mount.h
+	grep -v '<linux/in.h>' < $< > $@
+
+nfsmount_SOURCES = dummypmap.c main.c mount.c portmap.c sunrpc.c \
+	dummypmap.h nfsmount.h sunrpc.h
+libnfsmount_a_SOURCES = dummypmap.c main.c mount.c portmap.c sunrpc.c \
+	dummypmap.h nfsmount.h sunrpc.h

Added: dists/trunk/utils/yaird/exec/nfsmount/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,494 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#
+# Makefile.am -- compiling executables to be included in generated image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# NOTE: We compile the same sources twice,
+# once as standalone program, once as library to be linked with trymount.
+#
+
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+aux_PROGRAMS = nfsmount$(EXEEXT)
+DIST_COMMON = $(srcdir)/../../Makefile.incl $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+subdir = exec/nfsmount
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+libnfsmount_a_AR = $(AR) $(ARFLAGS)
+libnfsmount_a_LIBADD =
+am_libnfsmount_a_OBJECTS = dummypmap.$(OBJEXT) main.$(OBJEXT) \
+	mount.$(OBJEXT) portmap.$(OBJEXT) sunrpc.$(OBJEXT)
+libnfsmount_a_OBJECTS = $(am_libnfsmount_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(auxdir)"
+auxPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(aux_PROGRAMS)
+am_nfsmount_OBJECTS = dummypmap.$(OBJEXT) main.$(OBJEXT) \
+	mount.$(OBJEXT) portmap.$(OBJEXT) sunrpc.$(OBJEXT)
+nfsmount_OBJECTS = $(am_nfsmount_OBJECTS)
+nfsmount_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libnfsmount_a_SOURCES) $(nfsmount_SOURCES)
+DIST_SOURCES = $(libnfsmount_a_SOURCES) $(nfsmount_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+noinst_LIBRARIES = libnfsmount.a
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf
+
+#
+# nfs_mount.h includes linux/in.h, which breaks glibc,
+# so we can't use it.
+# We also cannot inline the code, since that would make the whole
+# program GPL, and GPL does not allow extra restrictions
+# on distribution, and HPA's licence has the restriction
+# that his disclaimer be kept intact.
+# The fun part is that the kernel compiles perfectly well
+# without the offending linux/in.h.
+#
+CLEANFILES = ridiculous.h
+BUILT_SOURCES = ridiculous.h
+nfsmount_SOURCES = dummypmap.c main.c mount.c portmap.c sunrpc.c \
+	dummypmap.h nfsmount.h sunrpc.h
+
+libnfsmount_a_SOURCES = dummypmap.c main.c mount.c portmap.c sunrpc.c \
+	dummypmap.h nfsmount.h sunrpc.h
+
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../../Makefile.incl $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  exec/nfsmount/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  exec/nfsmount/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libnfsmount.a: $(libnfsmount_a_OBJECTS) $(libnfsmount_a_DEPENDENCIES) 
+	-rm -f libnfsmount.a
+	$(libnfsmount_a_AR) libnfsmount.a $(libnfsmount_a_OBJECTS) $(libnfsmount_a_LIBADD)
+	$(RANLIB) libnfsmount.a
+install-auxPROGRAMS: $(aux_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(auxdir)" || $(mkdir_p) "$(DESTDIR)$(auxdir)"
+	@list='$(aux_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(auxPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(auxdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(auxPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(auxdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-auxPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(aux_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(auxdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(auxdir)/$$f"; \
+	done
+
+clean-auxPROGRAMS:
+	-test -z "$(aux_PROGRAMS)" || rm -f $(aux_PROGRAMS)
+nfsmount$(EXEEXT): $(nfsmount_OBJECTS) $(nfsmount_DEPENDENCIES) 
+	@rm -f nfsmount$(EXEEXT)
+	$(LINK) $(nfsmount_LDFLAGS) $(nfsmount_OBJECTS) $(nfsmount_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dummypmap.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mount.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/portmap.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sunrpc.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/../..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(auxdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-auxPROGRAMS clean-generic clean-noinstLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-auxPROGRAMS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-auxPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-auxPROGRAMS \
+	clean-generic clean-noinstLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-auxPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-auxPROGRAMS \
+	uninstall-info-am
+
+ridiculous.h:	/usr/include/linux/nfs_mount.h
+	grep -v '<linux/in.h>' < $< > $@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/exec/nfsmount/dummypmap.c
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/dummypmap.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/dummypmap.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,146 @@
+/*
+ * dummypmap.c
+ *
+ * Enough portmapper functionality that mount doesn't hang trying
+ * to start lockd.  Enables nfsroot with locking functionality.
+ *
+ * Note: the kernel will only speak to the local portmapper
+ * using RPC over UDP.
+ */
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/socket.h>
+
+#include "sunrpc.h"
+
+struct portmap_call
+{
+        struct rpc_call rpc;
+        __u32 program;
+        __u32 version;
+        __u32 proto;
+        __u32 port;
+};
+
+struct portmap_reply
+{
+        struct rpc_reply rpc;
+        __u32 port;
+};
+
+int bind_portmap(void)
+{
+	int sock = socket(PF_INET, SOCK_DGRAM, 0);
+	struct sockaddr_in sin;
+	
+	if ( sock < 0 )
+		return -1;
+	
+	memset(&sin, 0, sizeof sin);
+	sin.sin_family      = AF_INET;
+	sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+	sin.sin_port        = htons(RPC_PMAP_PORT);
+	if ( bind(sock, (struct sockaddr *)&sin, sizeof sin) < 0 ) {
+		int err = errno;
+		close(sock);
+		errno = err;
+		return -1;
+	}
+	
+	return sock;
+}
+
+int dummy_portmap(int sock, FILE *portmap_file)
+{
+	struct sockaddr_in sin;
+	int pktlen, addrlen;
+	union {
+		struct portmap_call c;
+		unsigned char b[65536];	/* Max UDP packet size */
+	} pkt;
+	struct portmap_reply rply;
+	
+	for(;;) {
+		addrlen = sizeof sin;
+		pktlen = recvfrom(sock, &pkt.c.rpc.hdr.udp, sizeof pkt, 0,
+				  (struct sockaddr *)&sin, &addrlen);
+		
+		if ( pktlen < 0 ) {
+			if ( errno == EINTR )
+				continue;
+			
+			return -1;
+		}
+		
+		/* +4 to skip the TCP fragment header */
+		if ( pktlen+4 < sizeof(struct portmap_call) )
+			continue;			/* Bad packet */
+		
+		if ( pkt.c.rpc.hdr.udp.msg_type != htonl(RPC_CALL) )
+			continue;			/* Bad packet */
+		
+		memset(&rply, 0, sizeof rply);
+		
+		rply.rpc.hdr.udp.xid      = pkt.c.rpc.hdr.udp.xid;
+		rply.rpc.hdr.udp.msg_type = htonl(RPC_REPLY);
+		
+		if ( pkt.c.rpc.rpc_vers != htonl(2) ) {
+			rply.rpc.reply_state = htonl(REPLY_DENIED);
+			/* state <- RPC_MISMATCH == 0 */
+		} else if ( pkt.c.rpc.program != htonl(PORTMAP_PROGRAM) ) {
+			rply.rpc.reply_state = htonl(PROG_UNAVAIL);
+		} else if ( pkt.c.rpc.prog_vers != htonl(2) ) {
+			rply.rpc.reply_state = htonl(PROG_MISMATCH);
+		} else if ( pkt.c.rpc.cred_len != 0 ||
+			    pkt.c.rpc.vrf_len != 0 ) {
+			/* Can't deal with credentials data; the kernel won't send them */
+			rply.rpc.reply_state = htonl(SYSTEM_ERR);
+		} else {
+			switch ( ntohl(pkt.c.rpc.proc) ) {
+			case PMAP_PROC_NULL:
+				break;
+			case PMAP_PROC_SET:
+				if ( pkt.c.proto == htonl(IPPROTO_TCP) ||
+				     pkt.c.proto == htonl(IPPROTO_UDP) ) {
+					if ( portmap_file )
+						fprintf(portmap_file, "%u %u %s %u\n",
+							ntohl(pkt.c.program), ntohl(pkt.c.version),
+							pkt.c.proto == htonl(IPPROTO_TCP) ? "tcp" : "udp",
+							ntohl(pkt.c.port));
+					rply.port = htonl(1);	/* TRUE = success */
+				}
+				break;
+			case PMAP_PROC_UNSET:
+				rply.port = htonl(1);	/* TRUE = success */
+				break;
+			case PMAP_PROC_GETPORT:
+				break;
+			case PMAP_PROC_DUMP:
+				break;
+			default:
+				rply.rpc.reply_state = htonl(PROC_UNAVAIL);
+				break;
+			}
+		}
+		
+		sendto(sock, &rply.rpc.hdr.udp, sizeof rply - 4, 0,
+		       (struct sockaddr *)&sin, addrlen);
+	}
+}
+      
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+  if ( argc > 1 )
+    portmap_file = fopen(argv[1], "a");
+
+  return dummy_portmap();
+}
+#endif
+

Added: dists/trunk/utils/yaird/exec/nfsmount/dummypmap.h
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/dummypmap.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/dummypmap.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,11 @@
+/*
+ * dummyportmap.h
+ *
+ * Functions for the portmap spoofer
+ */
+
+#include <stdio.h>
+
+int bind_portmap(void);
+int dummy_portmap(int sock, FILE *portmap_file);
+

Added: dists/trunk/utils/yaird/exec/nfsmount/main.c
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/main.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/main.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,295 @@
+/*
+ * nfsmount/main.c
+ */
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *   
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *   
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <arpa/inet.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include "nfsmount.h"
+#include "sunrpc.h"
+#include "dummypmap.h"
+
+static char *progname;
+
+static struct nfs_mount_data mount_data = {
+	.version = NFS_MOUNT_VERSION,
+	.flags = NFS_MOUNT_NONLM | NFS_MOUNT_VER3 | NFS_MOUNT_TCP,
+	.rsize = 0,		/* Server's choice */
+	.wsize = 0,		/* Server's choice */
+	.timeo = 7,
+	.retrans = 3,
+	.acregmin = 3,
+	.acregmax = 60,
+	.acdirmin = 30,
+	.acdirmax = 60,
+	.namlen = NAME_MAX,
+};
+
+__u32 nfs_port;
+
+static struct int_opts {
+	char *name;
+	int  *val;
+} int_opts[] = {
+	{ "port",	&nfs_port },
+	{ "rsize",	&mount_data.rsize },
+	{ "wsize",	&mount_data.wsize },
+	{ "timeo",	&mount_data.timeo },
+	{ "retrans",	&mount_data.retrans },
+	{ "acregmin",	&mount_data.acregmin },
+	{ "acregmax",	&mount_data.acregmax },
+	{ "acdirmin",	&mount_data.acdirmin },
+	{ "acdirmax",	&mount_data.acdirmax },
+	{ NULL,		NULL }
+};
+
+static struct bool_opts {
+	char *name;
+	int  and_mask;
+	int  or_mask;
+} bool_opts[] = {
+	{ "soft",	~NFS_MOUNT_SOFT,	NFS_MOUNT_SOFT },
+	{ "hard",	~NFS_MOUNT_SOFT,	0 },
+	{ "intr",	~NFS_MOUNT_INTR,	NFS_MOUNT_INTR },
+	{ "nointr",	~NFS_MOUNT_INTR,	0 },
+	{ "posix",	~NFS_MOUNT_POSIX,	NFS_MOUNT_POSIX },
+	{ "noposix",	~NFS_MOUNT_POSIX,	0 },
+	{ "cto",	~NFS_MOUNT_NOCTO,	0 },
+	{ "nocto",	~NFS_MOUNT_NOCTO,	NFS_MOUNT_NOCTO },
+	{ "ac",		~NFS_MOUNT_NOAC,	0 },
+	{ "noac",	~NFS_MOUNT_NOAC,	NFS_MOUNT_NOAC },
+	{ "lock",	~NFS_MOUNT_NONLM,	0 },
+	{ "nolock",	~NFS_MOUNT_NONLM,	NFS_MOUNT_NONLM },
+	{ "v2",		~NFS_MOUNT_VER3,	0 },
+	{ "v3",		~NFS_MOUNT_VER3,	NFS_MOUNT_VER3 },
+	{ "udp",	~NFS_MOUNT_TCP,		0 },
+	{ "tcp",	~NFS_MOUNT_TCP,		NFS_MOUNT_TCP },
+	{ "broken_suid",~NFS_MOUNT_BROKEN_SUID,	NFS_MOUNT_BROKEN_SUID },
+	{ "ro",		~NFS_MOUNT_KLIBC_RONLY, NFS_MOUNT_KLIBC_RONLY },
+	{ "rw",		~NFS_MOUNT_KLIBC_RONLY,	0 },
+	{ NULL,		0,			0 }
+};
+
+static int parse_int(const char *val, const char *ctx)
+{
+	char *end;
+	int ret;
+
+	ret = (int) strtoul(val, &end, 0);
+	if (*val == '\0' || *end != '\0') {
+		fprintf(stderr, "%s: invalid value for %s\n", val, ctx);
+		exit(1);
+	}
+	return ret;
+}
+
+static void parse_opts(char *opts)
+{
+	char *cp, *val;
+
+	while ((cp = strsep(&opts, ",")) != NULL) {
+		if (*cp == '\0')
+			continue;
+		if ((val = strchr(cp, '=')) != NULL) {
+			struct int_opts *opts = int_opts;
+			*val++ = '\0';
+			while (opts->name && strcmp(opts->name, cp) != 0)
+				opts++;
+			if (opts->name)
+				*(opts->val) = parse_int(val, opts->name);
+			else {
+				fprintf(stderr, "%s: bad option '%s'\n",
+					progname, cp);
+				exit(1);
+			}
+		} else {
+			struct bool_opts *opts = bool_opts;
+			while (opts->name && strcmp(opts->name, cp) != 0)
+				opts++;
+			if (opts->name) {
+				mount_data.flags &= opts->and_mask;
+				mount_data.flags |= opts->or_mask;
+			} else {
+				fprintf(stderr, "%s: bad option '%s'\n",
+					progname, cp);
+				exit(1);
+			}
+		}
+	}
+}
+
+static __u32 parse_addr(const char *ip)
+{
+	struct in_addr in;
+	if (inet_aton(ip, &in) == 0) {
+		fprintf(stderr, "%s: can't parse IP address '%s'\n",
+			progname, ip);
+		exit(1);
+	}
+	return in.s_addr;
+}
+
+static void check_path(const char *path)
+{
+	struct stat st;
+
+	if (stat(path, &st) == -1) {
+		perror("stat");
+		exit(1);
+	}
+	else if (!S_ISDIR(st.st_mode)) {
+		fprintf(stderr, "%s: '%s' not a directory\n",
+			progname, path);
+		exit(1);
+	}
+}
+
+int main(int argc, char *argv[])
+	__attribute__ ((weak, alias ("nfsmount_main")));
+
+int nfsmount_main(int argc, char *argv[])
+{
+	struct timeval now;
+	__u32 server = 0;
+	char *rem_name;
+	char *rem_path;
+	char *hostname;
+	char *path;
+	int c;
+	int spoof_portmap = 0;
+	FILE *portmap_file = NULL;
+
+	progname = argv[0];
+
+	gettimeofday(&now, NULL);
+	srand48(now.tv_usec ^ (now.tv_sec << 24));
+
+	while ((c = getopt(argc, argv, "o:p:")) != EOF) {
+		switch (c) {
+		case 'o':
+			parse_opts(optarg);
+			break;
+		case 'p':
+			spoof_portmap = 1;
+			portmap_file  = fopen(optarg, "w");
+			break;
+		case '?':
+			fprintf(stderr, "%s: invalid option -%c\n",
+				progname, optopt);
+			exit(1);
+		}
+	}
+
+	if (optind == argc) {
+		fprintf(stderr, "%s: need a path\n", progname);
+		exit(1);
+	}
+
+	hostname = rem_path = argv[optind];
+
+	if ((rem_name = strdup(rem_path)) == NULL) {
+		perror("strdup");
+		exit(1);
+	}
+
+	if ((rem_path = strchr(rem_path, ':')) == NULL) {
+		fprintf(stderr, "%s: need a server\n", progname);
+		exit(1);
+	}
+
+	*rem_path++ = '\0';
+
+	if (*rem_path != '/') {
+		fprintf(stderr, "%s: need a path\n", progname);
+		exit(1);
+	}
+
+	server = parse_addr(hostname);
+
+	if (optind <= argc - 2) {
+		path = argv[optind + 1];
+	} else {
+		path = "/nfs_root";
+	}
+
+	check_path(path);
+
+	if ( spoof_portmap ) {
+		int sock = bind_portmap();
+
+		if ( sock == -1 ) {
+			if ( errno == EINVAL || errno == EADDRINUSE )
+				spoof_portmap = 0; /* Assume not needed */
+			else {
+				fprintf(stderr,
+					"%s: portmap spoofing failed\n",
+					progname);
+				exit(1);
+			}
+		} else {
+			spoof_portmap = fork();
+			if ( spoof_portmap == -1 ) {
+				fprintf(stderr, "%s: cannot fork\n", progname);
+				exit(1);
+			} else if ( spoof_portmap == 0 ) {
+				/* Child process */
+				dummy_portmap(sock, portmap_file);
+				_exit(255); /* Error */
+			} else {
+				/* Parent process */
+				close(sock);
+			}
+		}
+	}
+
+	if (nfs_mount(rem_name, hostname, server, rem_path, path,
+		      &mount_data) != 0)
+		return 1;
+
+	/* If we set up the spoofer, tear it down now */
+	if ( spoof_portmap ) {
+		kill(SIGTERM, spoof_portmap);
+		while ( waitpid(spoof_portmap, NULL, 0) == -1 &&
+			errno == EINTR );
+	}
+
+	free(rem_name);
+
+	return 0;
+}

Added: dists/trunk/utils/yaird/exec/nfsmount/mount.c
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/mount.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/mount.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,366 @@
+#include <sys/mount.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <linux/nfs.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "nfsmount.h"
+#include "sunrpc.h"
+
+static __u32 mount_port;
+
+struct mount_call
+{
+	struct rpc_call rpc;
+	__u32 path_len;
+	char path[0];
+};
+
+
+/*
+ * The following structure is the NFS v3 on-the-wire file handle,
+ * as defined in rfc1813.
+ * This differs from the structure used by the kernel,
+ * defined in <linux/nfh3.h>: rfc has a long in network order,
+ * kernel has a short in native order.
+ * Both kernel and rfc use the name nfs_fh; kernel name is
+ * visible to user apps in some versions of libc.
+ * Use different name to avoid clashes.
+ */
+#define NFS_MAXFHSIZE_WIRE 64
+struct nfs_fh_wire
+{
+	__u32 size;
+	char data[NFS_MAXFHSIZE_WIRE];
+} __attribute__((packed));
+
+
+struct mount_reply
+{
+	struct rpc_reply reply;
+	__u32 status;
+	struct nfs_fh_wire fh;
+} __attribute__((packed));
+
+#define MNT_REPLY_MINSIZE (sizeof(struct rpc_reply) + sizeof(__u32))
+
+static int get_ports(__u32 server, const struct nfs_mount_data *data)
+{
+	__u32 nfs_ver, mount_ver;
+	__u32 proto;
+
+	if (data->flags & NFS_MOUNT_VER3) {
+		nfs_ver = NFS3_VERSION;
+		mount_ver = NFS_MNT3_VERSION;
+	} else {
+		nfs_ver = NFS2_VERSION;
+		mount_ver = NFS_MNT_VERSION;
+	}
+
+	proto = (data->flags & NFS_MOUNT_TCP) ? IPPROTO_TCP : IPPROTO_UDP;
+
+	if (nfs_port == 0) {
+		nfs_port = portmap(server, NFS_PROGRAM, nfs_ver,
+				   proto);
+		if (nfs_port == 0) {
+			if (proto == IPPROTO_TCP) {
+				struct in_addr addr = { server };
+				fprintf(stderr, "NFS over TCP not "
+					"available from %s\n",
+					inet_ntoa(addr));
+				return -1;
+			}
+			nfs_port = NFS_PORT;
+		}
+	}
+
+	if (mount_port == 0) {
+		mount_port = portmap(server, NFS_MNT_PROGRAM, mount_ver,
+				     proto);
+		if (mount_port == 0)
+			mount_port = MOUNT_PORT;
+	}
+	return 0;
+}
+
+static inline int pad_len(int len)
+{
+	return (len + 3) & ~3;
+}
+
+
+#ifdef NFS_DEBUG
+void hex_dump (const char *msg, const char *buf, int len) {
+	int i, done = 0;
+	printf ("%s: %p, length %d\n", msg, buf, len);
+	while (done < len) {
+		printf ("%04x: ", done);
+		for (i = done; i < done + 16; i++) {
+			if (i < len) 
+				printf ("%02x ", buf[i] & 0xff);
+			else
+				printf ("   ");
+			if (i % 4 == 3) printf (" ");
+		}
+		for (i = done; i < done + 16; i++) {
+			if (i < len) 
+				printf ("%c", isprint(buf[i]) ? buf[i] : '.');
+			if (i % 4 == 3) printf (" ");
+		}
+		printf ("\n");
+		done += 16;
+	}
+}
+#endif NFS_DEBUG
+
+
+static inline void dump_params(__u32 server,
+			       const char *path,
+			       const struct nfs_mount_data *data)
+{
+#ifdef NFS_DEBUG
+	struct in_addr addr = { server };
+
+	printf("NFS params:\n");
+	printf("  server = %s, path = \"%s\", ", inet_ntoa(addr), path);
+	printf("version = %d, proto = %s\n",
+	       data->flags & NFS_MOUNT_VER3 ? 3 : 2,
+	       (data->flags & NFS_MOUNT_TCP) ? "tcp" : "udp");
+	printf("  mount_port = %d, nfs_port = %d, flags = %08x\n",
+	       mount_port, nfs_port, data->flags);
+	printf("  rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
+	       data->rsize, data->wsize, data->timeo, data->retrans);
+	printf("  acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
+	       data->acregmin, data->acregmax, data->acdirmin, data->acdirmax);
+	printf("  soft = %d, intr = %d, posix = %d, nocto = %d, noac = %d\n",
+	       (data->flags & NFS_MOUNT_SOFT) != 0,
+	       (data->flags & NFS_MOUNT_INTR) != 0,
+	       (data->flags & NFS_MOUNT_POSIX) != 0,
+	       (data->flags & NFS_MOUNT_NOCTO) != 0,
+	       (data->flags & NFS_MOUNT_NOAC) != 0);
+#endif
+}
+
+static inline void dump_fh(const char *data, int len)
+{
+#ifdef NFS_DEBUG
+	hex_dump ("Root file handle", data, len);
+#endif
+}
+
+static struct mount_reply mnt_reply;
+
+static int mount_call(__u32 proc, __u32 version,
+		      const char *path,
+		      struct client *clnt)
+{
+	struct mount_call *mnt_call = NULL;
+	size_t path_len, call_len;
+	struct rpc rpc;
+	int ret = 0;
+
+	path_len = strlen(path);
+	call_len = sizeof(*mnt_call) + pad_len(path_len);
+
+	if ((mnt_call = malloc(call_len)) == NULL) {
+		perror("malloc");
+		goto bail;
+	}
+
+	memset(mnt_call, 0, sizeof(*mnt_call));
+
+	mnt_call->rpc.program = htonl(NFS_MNT_PROGRAM);
+	mnt_call->rpc.prog_vers = htonl(version);
+	mnt_call->rpc.proc = htonl(proc);
+	mnt_call->path_len = htonl(path_len);
+	memcpy(mnt_call->path, path, path_len);
+
+	rpc.call = (struct rpc_call *) mnt_call;
+	rpc.call_len = call_len;
+	rpc.reply = (struct rpc_reply *) &mnt_reply;
+	rpc.reply_len = sizeof(mnt_reply);
+
+	if (rpc_call(clnt, &rpc) < 0)
+		goto bail;
+
+	if (proc != MNTPROC_MNT) {
+		goto done;
+	}
+
+	if (rpc.reply_len < MNT_REPLY_MINSIZE) {
+		fprintf(stderr, "incomplete reply: %zu < %zu\n",
+			rpc.reply_len, MNT_REPLY_MINSIZE);
+		goto bail;
+	}
+
+	if (mnt_reply.status != 0) {
+		fprintf(stderr, "mount call failed: %d\n",
+			ntohl(mnt_reply.status));
+		goto bail;
+	}
+
+	goto done;
+
+ bail:
+	ret = -1;
+
+ done:
+	if (mnt_call) {
+		free(mnt_call);
+	}
+
+	return ret;
+}
+
+static int mount_v2(const char *path,
+		    struct nfs_mount_data *data,
+		    struct client *clnt)
+{
+	int ret = mount_call(MNTPROC_MNT, NFS_MNT_VERSION, path, clnt);
+
+	if (ret == 0) {
+		dump_fh((const char *) &mnt_reply.fh, NFS2_FHSIZE);
+
+		data->root.size = NFS_FHSIZE;
+		memcpy(data->root.data, &mnt_reply.fh, NFS_FHSIZE);
+		memcpy(data->old_root.data, &mnt_reply.fh, NFS_FHSIZE);
+	}
+
+	return ret;
+}
+
+static inline int umount_v2(const char *path, struct client *clnt)
+{
+	return mount_call(MNTPROC_UMNT, NFS_MNT_VERSION, path, clnt);
+}
+
+static int mount_v3(const char *path,
+		    struct nfs_mount_data *data,
+		    struct client *clnt)
+{
+	int ret = mount_call(MNTPROC_MNT, NFS_MNT3_VERSION, path, clnt);
+
+	if (ret == 0) {
+		size_t fhsize = ntohl(mnt_reply.fh.size);
+
+		dump_fh((const char *) &mnt_reply.fh.data, fhsize);
+
+		memset(data->old_root.data, 0, NFS_FHSIZE);
+		memset(&data->root, 0, sizeof(data->root));
+		data->root.size = fhsize;
+		memcpy(&data->root.data, mnt_reply.fh.data, fhsize);
+		data->flags |= NFS_MOUNT_VER3;
+	}
+
+	return ret;
+}
+
+static inline int umount_v3(const char *path, struct client *clnt)
+{
+	return mount_call(MNTPROC_UMNT, NFS_MNT3_VERSION, path, clnt);
+}
+
+int nfs_mount(const char *pathname, const char *hostname,
+	      __u32 server, const char *rem_path, const char *path,
+	      struct nfs_mount_data *data)
+{
+	struct client *clnt = NULL;
+	struct sockaddr_in addr;
+	char mounted = 0;
+	int sock = -1;
+	int ret = 0;
+	int mountflags;
+
+	if (get_ports(server, data) != 0) {
+		goto bail;
+	}
+
+	dump_params(server, path, data);
+
+	if (data->flags & NFS_MOUNT_TCP) {
+		clnt = tcp_client(server, mount_port, CLI_RESVPORT);
+	} else {
+		clnt = udp_client(server, mount_port, CLI_RESVPORT);
+	}
+
+	if (clnt == NULL) {
+		goto bail;
+	}
+
+	if (data->flags & NFS_MOUNT_VER3) {
+		ret = mount_v3(rem_path, data, clnt);
+	} else {
+		ret = mount_v2(rem_path, data, clnt);
+	}
+
+	if (ret == -1) {
+		goto bail;
+	}
+	mounted = 1;
+
+	if (data->flags & NFS_MOUNT_TCP) {
+		sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+	} else {
+		sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
+	}
+
+	if (sock == -1) {
+		perror("socket");
+		goto bail;
+	}
+
+	if (bindresvport(sock, 0) == -1) {
+		perror("bindresvport");
+		goto bail;
+	}
+
+	addr.sin_family = AF_INET;
+	addr.sin_addr.s_addr = server;
+	addr.sin_port = htons(nfs_port);
+	memcpy(&data->addr, &addr, sizeof(data->addr));
+
+	strncpy(data->hostname, hostname, sizeof(data->hostname));
+
+	data->fd = sock;
+
+	mountflags = (data->flags & NFS_MOUNT_KLIBC_RONLY) ? MS_RDONLY : 0;
+	data->flags = data->flags & NFS_MOUNT_FLAGMASK;
+	ret = mount(pathname, path, "nfs", mountflags, data);
+
+	if (ret == -1) {
+		perror("mount");
+		goto bail;
+	}
+
+	DEBUG(("Mounted %s on %s\n", pathname, path));
+
+	goto done;
+
+ bail:
+	if (mounted) {
+		if (data->flags & NFS_MOUNT_VER3) {
+			umount_v3(path, clnt);
+		} else {
+			umount_v2(path, clnt);
+		}
+	}
+
+	ret = -1;
+
+ done:
+	if (clnt) {
+		client_free(clnt);
+	}
+
+	if (sock != -1) {
+		close(sock);
+	}
+
+	return ret;
+}
+

Added: dists/trunk/utils/yaird/exec/nfsmount/nfsmount.h
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/nfsmount.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/nfsmount.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,37 @@
+/*
+ * nfsmount/nfsmount.h
+ */
+
+#include <sys/types.h>
+#include <linux/types.h>
+
+#include "ridiculous.h"
+
+extern __u32 nfs_port;
+
+extern int nfsmount_main(int argc, char *argv[]);
+int nfs_mount(const char *rem_name, const char *hostname,
+	      __u32 server, const char *rem_path,
+	      const char *path, struct nfs_mount_data *data);
+
+enum nfs_proto {
+	v2 = 2,
+	v3,
+};
+
+/* masked with NFS_MOUNT_FLAGMASK before mount() call */
+#define NFS_MOUNT_KLIBC_RONLY	0x00010000U
+/*
+ * Note for gcc 3.2.2:
+ *
+ * If you're turning on debugging, make sure you get rid of -Os from
+ * the gcc command line, or else ipconfig will fail to link.
+ */
+#undef NFS_DEBUG
+
+#undef DEBUG
+#ifdef NFS_DEBUG
+#define DEBUG(x) printf x
+#else
+#define DEBUG(x) do { } while(0)
+#endif

Added: dists/trunk/utils/yaird/exec/nfsmount/portmap.c
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/portmap.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/portmap.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,73 @@
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <asm/byteorder.h>	/* __constant_hton* */
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "nfsmount.h"
+#include "sunrpc.h"
+
+struct portmap_call
+{
+	struct rpc_call rpc;
+	__u32 program;
+	__u32 version;
+	__u32 proto;
+	__u32 port;
+};
+
+struct portmap_reply
+{
+	struct rpc_reply rpc;
+	__u32 port;
+};
+
+static struct portmap_call call = {
+	.rpc.program   = __constant_htonl(RPC_PMAP_PROGRAM),
+	.rpc.prog_vers = __constant_htonl(RPC_PMAP_VERSION),
+	.rpc.proc      = __constant_htonl(PMAP_PROC_GETPORT),
+};
+
+__u32 portmap(__u32 server, __u32 program, __u32 version, __u32 proto)
+{
+	struct portmap_reply reply;
+	struct client *clnt;
+	struct rpc rpc;
+	__u32 port = 0;
+
+	if ((clnt = tcp_client(server, RPC_PMAP_PORT, 0)) == NULL) {
+		if ((clnt = udp_client(server, RPC_PMAP_PORT, 0)) == NULL) {
+			goto bail;
+		}
+	}
+
+	call.program = htonl(program);
+	call.version = htonl(version);
+	call.proto = htonl(proto);
+
+	rpc.call = (struct rpc_call *) &call;
+	rpc.call_len = sizeof(call);
+	rpc.reply = (struct rpc_reply *) &reply;
+	rpc.reply_len = sizeof(reply);
+
+	if (rpc_call(clnt, &rpc) < 0)
+		goto bail;
+
+	if (rpc.reply_len < sizeof(reply)) {
+		fprintf(stderr, "incomplete reply: %d < %d\n",
+			rpc.reply_len, sizeof(reply));
+		goto bail;
+	}
+
+	port = ntohl(reply.port);
+
+ bail:
+	DEBUG(("Port for %d/%d[%s]: %d\n", program, version,
+	       proto == IPPROTO_TCP ? "tcp" : "udp", port));
+
+	if (clnt) {
+		client_free(clnt);
+	}
+
+	return port;
+}

Added: dists/trunk/utils/yaird/exec/nfsmount/sunrpc.c
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/sunrpc.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/sunrpc.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,256 @@
+#define _XOPEN_SOURCE	/* for POLLRDNORM */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <errno.h>
+#include <poll.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "nfsmount.h"
+#include "sunrpc.h"
+
+/*
+ * The magic offset is needed here because RPC over TCP includes a
+ * field that RPC over UDP doesn't.  Luvverly.
+ */
+static int rpc_do_reply(struct client *clnt, struct rpc *rpc, size_t off)
+{
+	int ret;
+
+	if ((ret = read(clnt->sock,
+			((char *) rpc->reply) + off,
+			rpc->reply_len - off)) == -1) {
+		perror("read");
+		goto bail;
+	}
+	else if (ret < sizeof(struct rpc_reply) - off) {
+		fprintf(stderr, "short read: %d < %zu\n", ret,
+			sizeof(struct rpc_reply) - off);
+		goto bail;
+	}
+	rpc->reply_len = ret + off;
+
+	if ((!off && !(ntohl(rpc->reply->hdr.frag_hdr) & LAST_FRAG)) ||
+	    rpc->reply->hdr.udp.xid != rpc->call->hdr.udp.xid ||
+	    rpc->reply->hdr.udp.msg_type != htonl(RPC_REPLY)) {
+		fprintf(stderr, "bad reply\n");
+		goto bail;
+	}
+
+	if (ntohl(rpc->reply->state) != REPLY_OK) {
+		fprintf(stderr, "rpc failed: %d\n", ntohl(rpc->reply->state));
+		goto bail;
+	}
+
+	ret = 0;
+	goto done;
+
+ bail:
+	ret = -1;
+ done:
+	return ret;
+}
+
+static void rpc_header(struct client *clnt, struct rpc *rpc)
+{
+	rpc->call->hdr.frag_hdr = htonl(LAST_FRAG | rpc->call_len);
+	rpc->call->hdr.udp.xid = lrand48();
+	rpc->call->hdr.udp.msg_type = htonl(RPC_CALL);
+	rpc->call->rpc_vers = htonl(2);
+}
+
+static int rpc_call_tcp(struct client *clnt, struct rpc *rpc)
+{
+	int ret;
+
+	rpc_header(clnt, rpc);
+
+	if ((ret = write(clnt->sock, rpc->call, rpc->call_len)) == -1) {
+		perror("write");
+		goto bail;
+	}
+	else if (ret < rpc->call_len) {
+		fprintf(stderr, "short write: %d < %zu\n",
+			ret, rpc->call_len);
+		goto bail;
+	}
+
+	ret = rpc_do_reply(clnt, rpc, 0);
+	goto done;
+
+ bail:
+	ret = -1;
+
+ done:
+	return ret;
+}
+
+static int rpc_call_udp(struct client *clnt, struct rpc *rpc)
+{
+#define NR_FDS 1
+#define TIMEOUT_MS 3000
+#define MAX_TRIES 100
+#define UDP_HDR_OFF (sizeof(struct rpc_header) - sizeof(struct rpc_udp_header))
+	struct pollfd fds[NR_FDS];
+	int ret = -1;
+	int i;
+
+	rpc_header(clnt, rpc);
+
+	fds[0].fd = clnt->sock;
+	fds[0].events = POLLRDNORM;
+
+	rpc->call_len -= UDP_HDR_OFF;
+
+	for (i = 0; i < MAX_TRIES; i++) {
+		int timeout_ms = TIMEOUT_MS + (lrand48() % (TIMEOUT_MS / 2));
+		if ((ret = write(clnt->sock,
+				 ((char *) rpc->call) + UDP_HDR_OFF,
+				 rpc->call_len)) == -1) {
+			perror("write");
+			goto bail;
+		}
+		else if (ret < rpc->call_len) {
+			fprintf(stderr, "short write: %d < %zu\n", ret,
+				rpc->call_len);
+			goto bail;
+		}
+		for (; i < MAX_TRIES; i++) {
+			if ((ret = poll(fds, NR_FDS, timeout_ms)) == -1) {
+				perror("poll");
+				goto bail;
+			}
+			if (ret == 0) {
+				DEBUG(("Timeout #%d\n", i + 1));
+				break;
+			}
+			if ((ret = rpc_do_reply(clnt, rpc, UDP_HDR_OFF)) == 0) {
+				goto done;
+			} else {
+				DEBUG(("Failed on try #%d - retrying\n",
+				       i + 1));
+			}
+		}
+	}
+
+ bail:
+	ret = -1;
+
+ done:
+	return ret;
+}
+
+struct client *tcp_client(__u32 server, __u16 port, __u32 flags)
+{
+	struct client *clnt = malloc(sizeof(*clnt));
+	struct sockaddr_in addr;
+	int sock;
+
+	if (clnt == NULL) {
+		perror("malloc");
+		goto bail;
+	}
+
+	memset(clnt, 0, sizeof(clnt));
+
+	if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
+		perror("socket");
+		goto bail;
+	}
+
+	if ((flags & CLI_RESVPORT) && bindresvport(sock, 0) == -1) {
+		perror("bindresvport");
+		goto bail;
+	}
+
+	clnt->sock = sock;
+	clnt->call_stub = rpc_call_tcp;
+
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(port);
+	addr.sin_addr.s_addr = server;
+
+	if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
+		perror("connect");
+		goto bail;
+	}
+
+	goto done;
+ bail:
+	if (clnt) {
+		free(clnt);
+		clnt = NULL;
+	}
+ done:
+	return clnt;
+}
+
+struct client *udp_client(__u32 server, __u16 port, __u32 flags)
+{
+	struct client *clnt = malloc(sizeof(*clnt));
+	struct sockaddr_in addr;
+	int sock;
+
+	if (clnt == NULL) {
+		perror("malloc");
+		goto bail;
+	}
+
+	memset(clnt, 0, sizeof(clnt));
+
+	if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
+		perror("socket");
+		goto bail;
+	}
+
+	if ((flags & CLI_RESVPORT) && bindresvport(sock, 0) == -1) {
+		perror("bindresvport");
+		goto bail;
+	} else {
+		struct sockaddr_in me;
+
+		me.sin_family = AF_INET;
+		me.sin_port = 0;
+		me.sin_addr.s_addr = INADDR_ANY;
+
+		if (0 && bind(sock, (struct sockaddr *) &me, sizeof(me)) == -1) {
+			perror("bind");
+			goto bail;
+		}
+	}
+
+	clnt->sock = sock;
+	clnt->call_stub = rpc_call_udp;
+
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(port);
+	addr.sin_addr.s_addr = server;
+
+	if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
+		perror("connect");
+		goto bail;
+	}
+
+	goto done;
+ bail:
+	if (clnt) {
+		free(clnt);
+		clnt = NULL;
+	}
+ done:
+	return clnt;
+}
+
+void client_free(struct client *c)
+{
+	if (c->sock != -1)
+		close(c->sock);
+	free(c);
+}
+
+int rpc_call(struct client *client, struct rpc *rpc)
+{
+	return client->call_stub(client, rpc);
+}

Added: dists/trunk/utils/yaird/exec/nfsmount/sunrpc.h
===================================================================
--- dists/trunk/utils/yaird/exec/nfsmount/sunrpc.h	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/nfsmount/sunrpc.h	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,100 @@
+/*
+ * sunrpc.h - open-coded SunRPC structures
+ */
+#include <sys/types.h>
+#include <linux/types.h>	/* for __u32 */
+
+#define SUNRPC_PORT	111
+#define MOUNT_PORT	627
+
+#define RPC_CALL	0
+#define RPC_REPLY	1
+
+#define PORTMAP_PROGRAM	100000
+#define NLM_PROGRAM	100021
+
+#define RPC_PMAP_PROGRAM	100000
+#define RPC_PMAP_VERSION	2
+#define RPC_PMAP_PORT		111
+
+#define PMAP_PROC_NULL		0
+#define PMAP_PROC_SET		1
+#define PMAP_PROC_UNSET		2
+#define PMAP_PROC_GETPORT	3
+#define PMAP_PROC_DUMP		4
+
+#define LAST_FRAG	0x80000000
+
+#define REPLY_OK	0
+#define REPLY_DENIED    1
+
+#define SUCCESS		0
+#define PROG_UNAVAIL	1
+#define PROG_MISMATCH	2
+#define PROC_UNAVAIL	3
+#define GARBAGE_ARGS	4
+#define SYSTEM_ERR	5
+
+struct rpc_udp_header
+{
+	__u32 xid;
+	__u32 msg_type;
+};
+
+struct rpc_header
+{
+	__u32 frag_hdr;
+	struct rpc_udp_header udp;
+};
+
+struct rpc_call
+{
+	struct rpc_header hdr;
+	__u32 rpc_vers;
+
+	__u32 program;
+	__u32 prog_vers;
+	__u32 proc;
+	__u32 cred_flavor;
+
+	__u32 cred_len;
+	__u32 vrf_flavor;
+	__u32 vrf_len;
+};
+
+struct rpc_reply 
+{
+	struct rpc_header hdr;
+	__u32 reply_state;
+	__u32 vrf_flavor;
+	__u32 vrf_len;
+	__u32 state;
+};
+
+struct rpc
+{
+	struct rpc_call *call;
+	size_t call_len;
+	struct rpc_reply *reply;
+	size_t reply_len;
+};
+
+struct client;
+
+typedef int (*call_stub)(struct client *, struct rpc *);
+
+struct client
+{
+	int sock;
+	call_stub call_stub;
+};
+
+#define CLI_RESVPORT	00000001
+
+struct client *tcp_client(__u32 server, __u16 port, __u32 flags);
+struct client *udp_client(__u32 server, __u16 port, __u32 flags);
+void client_free(struct client *client);
+
+int rpc_call(struct client *client, struct rpc *rpc);
+
+__u32 portmap(__u32 server, __u32 program, __u32 version, __u32 proto);

Added: dists/trunk/utils/yaird/exec/run_init.c
===================================================================
--- dists/trunk/utils/yaird/exec/run_init.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/run_init.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,264 @@
+#ident "$Id: run-init.c,v 1.8 2005/01/01 22:34:34 hpa Exp $"
+/* ----------------------------------------------------------------------- *
+ *   
+ *   Copyright 2004 H. Peter Anvin - All Rights Reserved
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *   obtaining a copy of this software and associated documentation
+ *   files (the "Software"), to deal in the Software without
+ *   restriction, including without limitation the rights to use,
+ *   copy, modify, merge, publish, distribute, sublicense, and/or
+ *   sell copies of the Software, and to permit persons to whom
+ *   the Software is furnished to do so, subject to the following
+ *   conditions:
+ *   
+ *   The above copyright notice and this permission notice shall
+ *   be included in all copies or substantial portions of the Software.
+ *   
+ *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *   OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * run-init.c
+ *
+ * Usage: exec run-init [-c /dev/console] /real-root /sbin/init "$@"
+ *
+ * This program should be called as the last thing in a shell script
+ * acting as /init in an initramfs; it does the following:
+ *
+ * - Delete all files in the initramfs;
+ * - Remounts /real-root onto the root filesystem;
+ * - Chroots;
+ * - Opens /dev/console;
+ * - Spawns the specified init program (with arguments.)
+ */
+
+#include <alloca.h>
+#include <assert.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/vfs.h>
+
+#include <config.h>
+
+
+/* Make it possible to compile on glibc by including constants that the
+   always-behind shipped glibc headers may not include.  Classic example
+   on why the lack of ABI headers screw us up. */
+#ifndef TMPFS_MAGIC
+# define TMPFS_MAGIC	0x01021994
+#endif
+#ifndef RAMFS_MAGIC
+# define RAMFS_MAGIC	0x858458f6
+#endif
+#ifndef MS_MOVE
+# define MS_MOVE	8192
+#endif
+
+static const char *program;
+
+static void __attribute__((noreturn)) die(const char *msg)
+{
+  fprintf(stderr, "%s: %s: %s\n", program, msg, strerror(errno));
+  exit(1);
+}
+
+
+#ifdef ENABLE_NUKE
+static int nuke(const char *what);
+
+static int nuke_dirent(int len, const char *dir, const char *name, dev_t me)
+{
+  int bytes = len+strlen(name)+2;
+  char path[bytes];
+  int xlen;
+  struct stat st;
+
+  xlen = snprintf(path, bytes, "%s/%s", dir, name);
+  assert(xlen < bytes);
+
+  if ( lstat(path, &st) )
+    return ENOENT;		/* Return 0 since already gone? */
+
+  if ( st.st_dev != me )
+    return 0;			/* DO NOT recurse down mount points!!!!! */
+
+  return nuke(path);
+}
+
+/* Wipe the contents of a directory, but not the directory itself */
+static int nuke_dir(const char *what)
+{
+  int len = strlen(what);
+  DIR *dir;
+  struct dirent *d;
+  int err = 0;
+  struct stat st;
+
+  if ( lstat(what, &st) )
+    return errno;
+  
+  if ( !S_ISDIR(st.st_mode) )
+    return ENOTDIR;
+
+  if ( !(dir = opendir(what)) ) {
+    /* EACCES means we can't read it.  Might be empty and removable;
+       if not, the rmdir() in nuke() will trigger an error. */
+    return (errno == EACCES) ? 0 : errno;
+  }
+  
+  while ( (d = readdir(dir)) ) {
+    /* Skip . and .. */
+    if ( d->d_name[0] == '.' &&
+	 (d->d_name[1] == '\0' ||
+	  (d->d_name[1] == '.' && d->d_name[2] == '\0')) )
+      continue;
+    
+    err = nuke_dirent(len, what, d->d_name, st.st_dev);
+    if ( err ) {
+      closedir(dir);
+      return err;
+    }
+  }
+  
+  closedir(dir);
+
+  return 0;
+}
+
+static int nuke(const char *what)
+{
+  int rv;
+  int err = 0;
+
+  rv = unlink(what);
+  if ( rv < 0 ) {
+    if ( errno == EISDIR ) {
+      /* It's a directory. */
+      err = nuke_dir(what);
+      if ( !err ) err = rmdir(what) ? errno : err;
+    } else {
+      err = errno;
+    }
+  }
+
+  if ( err ) {
+    errno = err;
+    die(what);
+  } else {
+    return 0;
+  }
+}
+#else /* no ENABLE_NUKE */
+static inline int
+nuke_dir(const char *what)
+{
+	return 0;
+}
+#endif /* ENABLE_NUKE */
+
+static void __attribute__((noreturn)) usage(void)
+{
+  fprintf(stderr, "Usage: exec %s [-c consoledev] /real-root /sbin/init [args]\n", program);
+  exit(1);
+}
+
+
+int main(int argc, char *argv[])
+{
+  struct stat   rst, cst, ist;
+  struct statfs sfs;
+  int o;
+  int confd;
+
+  /* Command-line options and defaults */
+  const char *console = "/dev/console";
+  const char *realroot;
+  const char *init;
+  char **initargs;
+
+  /* First, parse the command line */
+  program = argv[0];
+
+  while ( (o = getopt(argc, argv, "c:")) != -1 ) {
+    if ( o == 'c' ) {
+      console = optarg;
+    } else {
+      usage();
+    }
+  }
+
+  if ( argc-optind < 2 )
+    usage();
+
+  realroot = argv[optind];
+  init     = argv[optind+1];
+  initargs = argv+optind+1;
+
+  /* First, change to the new root directory */
+  if ( chdir(realroot) )
+    die("chdir to new root");
+
+  /* This is a potentially highly destructive program.  Take some
+     extra precautions. */
+
+  /* Make sure the current directory is not on the same filesystem
+     as the root directory */
+  if ( stat("/", &rst) || stat(".", &cst) )
+    die("stat");
+
+  if ( rst.st_dev == cst.st_dev )
+    die("current directory on the same filesystem as the root");
+  
+  /* The initramfs should have /init */
+  if ( stat("/init", &ist) || !S_ISREG(ist.st_mode) )
+    die("can't find /init on initramfs");
+
+  /* Make sure we're on a ramfs */
+  if ( statfs("/", &sfs) )
+    die("statfs /");
+  if ( sfs.f_type != RAMFS_MAGIC && sfs.f_type != TMPFS_MAGIC )
+    die("rootfs not a ramfs or tmpfs");
+
+  /* Okay, I think we should be safe... */
+
+  /* Delete rootfs contents */
+  if ( nuke_dir("/") )
+    die("nuking initramfs contents");
+
+  /* Overmount the root */
+  if ( mount(".", "/", NULL, MS_MOVE, NULL) )
+    die("overmounting root");
+  
+  /* chroot, chdir */
+  if ( chroot(".") || chdir("/") )
+    die("chroot");
+
+  /* Open /dev/console */
+  if ( (confd = open(console, O_RDWR)) < 0 )
+    die("opening console");
+  dup2(confd, 0);
+  dup2(confd, 1);
+  dup2(confd, 2);
+  close(confd);
+
+  /* Spawn init */
+  execv(init, initargs);
+  die(init);			/* Failed to spawn init */
+}

Added: dists/trunk/utils/yaird/exec/trynfs.c
===================================================================
--- dists/trunk/utils/yaird/exec/trynfs.c	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/exec/trynfs.c	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,278 @@
+/* trymount.c: try activating interfaces and mount a future root
+
+    Copyright (C) 2005, Erik van Konijnenburg
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+*/
+#include <alloca.h>
+#include <stdio.h>
+#include <stdarg.h>		/* for va_args */
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>		/* for getopt */
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+
+#include <config.h>
+#include "ipconfig/netdev.h"
+
+/*
+ * ipconfig returns linked list of working devices here.
+ */
+extern int ipconfig_main (int argc, char *argv[]);
+extern struct netdev *ifaces;
+
+/* arguably, this should be in netdev.h */
+static inline const char *my_inet_ntoa(uint32_t addr)
+{
+	struct in_addr a;
+
+	a.s_addr = addr;
+
+	return inet_ntoa(a);
+}
+
+extern int nfsmount_main (int argc, char *argv[]);
+
+
+extern int	optint;
+extern int	opterr;
+extern int	optopt;
+extern char *	optarg;
+
+static char *	progname = "trynfs";
+static char *	version = VERSION;
+
+static void
+message (char *fmt, ...)
+{
+	va_list	ap;
+	va_start (ap, fmt);
+	fprintf (stderr, "%s: ", progname);
+	vfprintf (stderr, fmt, ap);
+	fprintf (stderr, "\n");
+	va_end (ap);
+}
+
+static void
+fatal (char *fmt, ...)
+{
+	va_list	ap;
+	va_start (ap, fmt);
+	fprintf (stderr, "%s: ", progname);
+	vfprintf (stderr, fmt, ap);
+	fprintf (stderr, " (fatal)\n");
+	va_end (ap);
+	exit (1);
+}
+
+static void
+usage (void)
+{
+	printf ("\
+    %s [ -hv ] ip=... [ nfsroot=... ] mount-point \n\
+    Activate network interfaces, then do NFS mount.\n\
+    ip= and nfsroot= as in linux/Documentation/nfsroot.txt\n\
+    If DHCP provides a root path, nfsroot server:path is overridden,\n\
+    but NFS mount options still apply.\n\
+    If no NFS options are given, mount is attempted first\n\
+    without options, then with option 'udp', then with option 'v2'.\n\
+\n\
+    -h: usage\n\
+    -v: version\n\
+",
+		progname);
+}
+
+
+int
+do_ipconfig (int argc, char *argv[]) {
+	int i, a = 0;
+	char **args = alloca ((argc + 1) * sizeof (char *));
+	if (! args) {
+		/* behaviour undefined on stack overflow,
+		 * so the following may be useless ...
+		 */
+		fatal ("out of memory");
+	}
+
+	args[a++] = "IP-Config";
+	for (i = 1; i < argc; i++) {
+		if (strncmp ("ip=", argv[i], 3) == 0
+			|| strncmp ("nfsaddrs=", argv[i], 9) == 0)
+		{
+			args[a++] = argv[i];
+		}
+	}
+	args[a] = NULL;
+	return ipconfig_main (a, args);
+}
+
+
+int
+do_nfsmount (char *nfsserver, char *nfspath, char *nfsopts, char *mountpoint)
+{
+	int	a = 0;
+	char *	args[6];
+	char *	fullpath = NULL;
+		
+	fullpath = alloca (strlen(nfsserver) + strlen(nfspath) + 7);
+	if (!fullpath) {
+		fatal ("out of memory");
+	}
+	sprintf (fullpath, "%s:%s", nfsserver, nfspath);
+
+	args[a++] = "NFS-Mount";
+	if (nfsopts) {
+		args[a++] = "-o";
+		args[a++] = nfsopts;
+	}
+	args[a++] = fullpath;
+	args[a++] = mountpoint;
+	args[a] = NULL;
+	if (nfsopts) {
+		message ("starting nfsmount -o %s %s %s",
+				nfsopts, fullpath, mountpoint);
+	}
+	else {
+		message ("starting nfsmount %s %s", fullpath, mountpoint);
+	}
+	return nfsmount_main (a, args);
+}
+
+
+int
+main (int argc, char *argv[])
+{
+	int	i;
+	char *	nfsroot = NULL;		/* from the nfsroot= argument */
+	char *	mountpoint = NULL;	/* mount here on client */
+
+	char *	nfsserver = NULL;	/* server as dotted decimal */
+	char	buf[40];
+	char *	nfspath = NULL;		/* path on server to mount */
+	char *	nfsopts = NULL;		/* nfs options */
+	int	rc;			/* exist status */
+
+	while ((i = getopt (argc, argv, "hv")) >= 0) {
+		switch (i) {
+		case 'h':
+			usage ();
+			return 0;
+		case 'v':
+			message ("version %s", version);
+			return 0;
+		default:
+			fatal ("unknown argument, -h for help");
+		}
+	}
+
+	for (i = optind; i < argc; i++) {
+		if (strncmp (argv[i], "ip=", 3) == 0) {
+			continue;
+		}
+		else if (strncmp (argv[i], "nfsaddrs=", 9) == 0) {
+			continue;
+		}
+		else if (strncmp (argv[i], "nfsroot=", 8) == 0) {
+			if (nfsroot) {
+				fatal ("duplicate nfsroot= argument");
+			}
+			nfsroot = argv[i]+8;
+		}
+		else {
+			if (mountpoint) {
+				fatal ("too many arguments");
+			}
+			mountpoint = argv[i];
+		}
+	}
+
+	if (mountpoint == NULL) {
+		fatal ("no mointpoint specified");
+	}
+	if (mountpoint[0] != '/') {
+		fatal ("mointpoint is not an absolute path");
+	}
+
+	/*
+	 * Get a working interface, plus any provided DHCP values.
+	 */
+	do_ipconfig (argc, argv);
+	if (ifaces == NULL) {
+		fatal ("no working network interfaces");
+	}
+	
+	/*
+	 * Good.  We have a working interface, now to
+	 * mount it.
+	 * First do options and choose between nfsroot= and dhcp reply
+	 */
+
+
+	if (nfsroot) {
+		char *p = strchr (nfsroot, ',');
+		if (p) {
+			*p++ = '\0';
+			if (p) {
+				nfsopts = p;
+			}
+		}
+	}
+
+	if (strlen (ifaces->bootpath) > 0) {
+		strcpy (buf, my_inet_ntoa(ifaces->ip_server));
+		nfsserver = buf;
+		nfspath = ifaces->bootpath;
+	}
+	else if (nfsroot) {
+		char *p = strchr (nfsroot, ':');
+		if (p) {
+			*p++ = '\0';
+			nfsserver = nfsroot;
+			nfspath = p;
+		}
+		else {
+			strcpy (buf, my_inet_ntoa(ifaces->ip_server));
+			nfsserver = buf;
+			nfspath = nfsroot;
+		}
+	}
+	else {
+		fatal ("no nfsroot on command line or DHCP reply");
+	}
+
+	/*
+	 * Now try mounting.  If no options are given,
+	 * we try some fallback options.
+	 */
+	if (nfsopts) {
+		rc = do_nfsmount (nfsserver, nfspath, nfsopts, mountpoint);
+	}
+	else {
+		rc = do_nfsmount (nfsserver, nfspath, NULL, mountpoint);
+		if (rc != 0) {
+			rc = do_nfsmount(nfsserver,nfspath,"udp",mountpoint);
+		}
+		if (rc != 0) {
+			rc = do_nfsmount(nfsserver,nfspath,"v2",mountpoint);
+		}
+	}
+
+	return rc;
+}

Added: dists/trunk/utils/yaird/include/config.h.in
===================================================================
--- dists/trunk/utils/yaird/include/config.h.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/include/config.h.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,25 @@
+/* include/config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define to nuke initramfs before moving to real root */
+#undef ENABLE_NUKE
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Version number of package */
+#undef VERSION

Added: dists/trunk/utils/yaird/install-sh
===================================================================
--- dists/trunk/utils/yaird/install-sh	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/install-sh	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
+
+    -T) no_target_directory=true
+	shift
+	continue;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
+	break;;
+  esac
+done
+
+if test -z "$1"; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    src=
+
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dstarg: Is a directory" >&2
+	exit 1
+      fi
+      dst=$dst/`basename "$src"`
+    fi
+  fi
+
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+  # Make sure that the destination directory exists.
+
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+	 '
+    IFS="${IFS-$defaultIFS}"
+
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
+    IFS=$oIFS
+
+    pathcomp=
+
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
+      shift
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+	# mkdir can fail with a `File exist' error in case several
+	# install-sh are creating the directory concurrently.  This
+	# is OK.
+	test -d "$pathcomp" || exit
+      fi
+      pathcomp=$pathcomp/
+    done
+  fi
+
+  if test -n "$dir_arg"; then
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+  else
+    dstfile=`basename "$dst"`
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
+
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dstdir/$dstfile"; then
+	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+	       || {
+		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+		 (exit 1); exit 1
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+	 }
+    }
+  fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:


Property changes on: dists/trunk/utils/yaird/install-sh
___________________________________________________________________
Name: svn:executable
   + *

Added: dists/trunk/utils/yaird/man/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/man/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/man/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,21 @@
+#
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+
+dist_man8_MANS	= yaird.8

Added: dists/trunk/utils/yaird/man/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/man/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/man/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,349 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = man
+DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+man8dir = $(mandir)/man8
+am__installdirs = "$(DESTDIR)$(man8dir)"
+NROFF = nroff
+MANS = $(dist_man8_MANS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+dist_man8_MANS = yaird.8
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  man/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  man/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-man8: $(man8_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
+	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.8*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    8*) ;; \
+	    *) ext='8' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
+	done
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.8*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    8*) ;; \
+	    *) ext='8' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
+	  rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
+	done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+	for dir in "$(DESTDIR)$(man8dir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man: install-man8
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man8
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-man8 install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+	uninstall-am uninstall-info-am uninstall-man uninstall-man8
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/man/yaird.8
===================================================================
--- dists/trunk/utils/yaird/man/yaird.8	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/man/yaird.8	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,290 @@
+.TH YAIRD 8
+.SH NAME
+yaird \- generate initial boot image as initramfs or initrd
+.SH SYNOPSIS
+.B yaird
+.BI --output= dest
+.RI [ options... ]
+.RI [ version ]
+.br
+.B yaird
+.B --test
+.RI [ options... ]
+.RI [ version ]
+.SH DESCRIPTION
+.I Yaird
+(Yet Another MkInitRD)
+generates initial boot images in initrd or initramfs format.
+This is an intermediate step
+between the boot loader and the init scripts on the root file system;
+it loads modules and enables devices to a level
+where the kernel can access the real root file system,
+and then hands over control to the init scripts.
+You need a new boot image every time you install a new kernel,
+and when you switch to a different root device.
+If you are using distribution provided kernels,
+building the boot image is likely to be done automatically by the
+installation software.
+.P
+Most distributions include a distribution-specific tool called
+.IR mkinitrd (8)
+for the same task.
+The
+.I yaird
+alternative differs in that it only supports 2.6 kernels:
+that means it can use the information provided by newer kernels
+to build smaller images and if necessary produce better error messages.
+.P
+Another difference is that there is a clear separation between the
+code that analyses the system and the templates that determine how
+these actions are handled by the boot image; this separation makes it
+relatively simple to customise the generated images.
+.P
+The following configurations are supported: SATA, IDE, LVM2, mdadm,
+cryptsetup, cryptsetup-luks, USB keyboards, NFS root.
+.P
+The following are untested: USB storage, SCSI storage.
+.P
+Not yet supported: EVMS, swsusp, firewire, DASD, loopback, loopaes, dmraid.
+.\"
+.SH OPTIONS
+.TP
+.BI "-f, --format=" format
+Produce the image in this format.
+Valid formats are: directory, cramfs, cpio.
+Use the cpio format to get an image for use with the 'initramfs'
+model of booting; this is the preferred model for 2.6 kernels.
+Use 'directory' to leave the image as a directory instead of packing it,
+either for debugging purposes or to pack it in a file system format
+of your preference.
+Use 'cramfs' to get an image in the cramfs file system format
+for use with the older 'initrd' model of booting.
+The default is determined by the main configuration file.
+.TP
+.BI "-o, --output=" destination
+Place result here.
+The destination must not exist yet.
+There is no default for this option.
+.TP
+.BI "-c, --config=" config-file
+The configuration file that specifies what the
+initial boot image should do.
+The default is .../lib/yaird/conf/Default.conf
+.TP
+.B "-h, -?, --help"
+Print help text and exit.
+.TP
+.B "-V, --version"
+Print version and exit.
+.TP
+.B "-v, --verbose"
+Print progress messages.
+.TP
+.B "-d, --debug"
+Print debugging information.
+.TP
+.B "-q, --quiet"
+Suppress warning messages.
+.TP
+.B "-t, --test"
+Print overview of system data and exit;
+used as basis for debugging.
+.SH USAGE
+Root privileges are required to use
+.IR yaird .
+.P
+When booting a yaird generated image,
+the presence of a kernel command line parameter 'ydebug'
+will trigger debugging options in the image:
+showing commands as they are executed, an interactive
+shell before control is handed over to the init scripts.
+.P
+If you're using
+.IR mdadm (8),
+you may find that not all md devices are created when booting with 
+.IR yaird.
+The solution is to add an "auto=md" option to all devices in
+.IR /etc/mdadm/mdadm.conf .
+.P
+If you're using
+.IR cryptsetup (8)
+for your root device, you need a configuration file
+.I /etc/crypttab
+in order to determine which hash function is used
+and to verify that the passphrase will be supplied by the controlling
+terminal.
+This file is a Debian invention; if your distribution does not document it,
+consult your favourite search engine.
+For an encrypted device
+.IR /dev/mapper/crypted ,
+the configuration file should look more or less as follows:
+
+.RS
+# <target device> <source device> <key file> <options>
+.br
+crypted /dev/sda3 none cipher=aes-cbc-plain
+.RE
+
+For cryptsetup-luks, the same configuration file is used.
+.P
+If you want the generated initial image to boot into a file system
+other than the root in the current
+.IR /etc/fstab ,
+or to do booting over NFS, modify the main configuration file.
+.P
+If you're using an NFS root, note that your systems init scripts
+may need changes to work properly.  As an example, resetting a
+network interface card to get it in a known state may be a good idea in
+general, but not if your root file system is accessed via that interface.
+.SH EXAMPLES
+Assuming the main configuration file holds something like:
+
+.RS
+CONFIG
+.br
+	FORMAT	cpio
+.br
+	TEMPLATE FILE "/usr/local/lib/yaird/conf/Templates.cfg"
+.br
+	GOALS
+.br
+		TEMPLATE	prologue
+.br
+		INPUT
+.br
+		MODULE		mousedev
+.br
+		MODULE		evdev
+.br
+		MOUNTDIR	"/" "/mnt"
+.br
+		TEMPLATE	postlude
+.br
+	END GOALS
+.br
+END CONFIG
+.RE
+
+To generate an image in initramfs format for the current kernel
+and current root disk:
+
+.RS
+yaird --output=/boot/initrd.img
+.RE
+
+To generate, with progress report, an image for kernel version 2.6.11:
+
+.RS
+yaird --verbose --output=/boot/initrd.img-2.6.11 2.6.11
+.RE
+
+To generate an image that will boot into /dev/vg0/root
+rather than the default root, edit the configuration file
+to replace MOUNTDIR with MOUNTDEV:
+
+.RS
+MOUNTDEV "/dev/vg0/root" "/mnt"
+.RE
+
+To generate an image that will boot over NFS using an ethernetcard found
+on the current machine, edit the configuration file to replace MOUNTDIR 
+with the following:
+
+.RS
+NETWORK
+.br
+MODULE nfs
+.br
+MODULE af_packet
+.br
+TEMPLATE nfsstart
+.RE
+
+To let grub load an initial boot image from local disk
+in combination with an NFS root file system on a server
+that can only handle NFS over UDP:
+
+.RS
+title	Linux 2.6.11 network boot
+.br
+root	(hd0,1)
+.br
+kernel	/vmlinuz-2.6.11 ip=eth0 nfsroot=10.1.1.1:/dat/root,udp
+.br
+initrd	/initrd.img-2.6.11
+.br
+boot
+.RE
+
+.SH FILES
+There is a main configuration file .../lib/yaird/conf/Default.cfg,
+that determines
+.IP \(em
+The default format of the generated image;
+.IP \(em
+A list of goals the image should achieve, such as loading a module
+or mounting a device;
+.IP \(em
+The location of a secondary configuration file containing templates.
+.P
+This secondary configuration file, normally .../lib/yaird/conf/Templates.cfg,
+that determines what needs to be placed on the boot image in order to
+achieve results such as mounting a device.
+These templates are at a lower level than the goals specified in the main
+configuration file: as an example the main configuration file can specify
+that a module must be loaded, without specifying pathname, extensions,
+dependencies or options, but the template file need only be able to do
+a single
+.I insmod
+with all details spelled out.
+See the HTML documentation
+for the format of these configuration files.
+.P
+Additionally, a number of other files are used to determine what should
+go on the boot image.
+.TP
+.I /sys
+Kernel-provided overview of hardware that needs to be supported.
+.TP
+.I "/etc/hotplug/blacklist, /etc/hotplug/blacklist.d"
+Modules listed here will not be considered as possible drivers for
+detected hardware.
+.TP
+.I /etc/crypttab
+Determines source of passphrase and which cryptographic algorithms
+to use for
+.I cryptsetup
+or
+.IR cryptsetup-luks .
+.TP
+.I /etc/fstab
+Which device to use as root, file system modules, mount options.
+.TP
+.I /proc/bus/input/devices
+Whether support for USB keyboards is needed.
+.TP
+.I /boot/config-2.6.11
+Which drivers are compiled into the kernel,
+so that no additional modules need to be loaded.
+.TP
+.I "/etc/modprobe.conf, /etc/modprobe.d"
+used indirectly via
+.IR modprobe (8);
+determines which options to use when loading a module into the kernel.
+.SH BUGS
+Report bugs to the author;
+adding the output of
+.I yaird
+with the --test and --verbose options helps.
+.SH AUTHOR
+Erik van Konijnenburg <ekonijn at xs4all.nl>
+.SH SEE ALSO
+.IR boot (7),
+.IR cryptsetup (8),
+.IR grub (8),
+.IR lilo (8),
+.IR mdadm (8),
+.IR mkinitrd (8),
+.IR modprobe (8).
+.P
+http://www.xs4all.nl/~ekonijn/yaird/yaird.html

Added: dists/trunk/utils/yaird/missing
===================================================================
--- dists/trunk/utils/yaird/missing	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/missing	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f y.tab.h ]; then
+	echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case "$firstarg" in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case "$firstarg" in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:


Property changes on: dists/trunk/utils/yaird/missing
___________________________________________________________________
Name: svn:executable
   + *

Added: dists/trunk/utils/yaird/perl/ActionList.pm
===================================================================
--- dists/trunk/utils/yaird/perl/ActionList.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/ActionList.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,183 @@
+#!perl -w
+#
+# ActionList -- record and expand actions to be performed by the initrd image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Actions are represented by a hash, containing at least:
+#  - action
+#  - target
+#
+# Actions are added to the end of the list, but if an action
+# with same name and target already exists, the later action
+# is considered redundant and silently omited.
+#
+# The point of an action list is that it can be expanded to an Image,
+# an exact description of every file, directory and script that should
+# go on the initrd image.
+#
+# This expansion is driven by templates, where attributes from the
+# hash may be inserted in file names or script fragments.
+# There are attributes that are added automatically to every action:
+#  - version, the required kernel version.
+#
+
+use strict;
+use warnings;
+use HTML::Template;
+
+use Base;
+use Conf;
+
+package ActionList;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->{actions} = [];
+}
+
+
+#
+# add -- add an action to the plan.
+#
+sub add {
+	my ($self, $action, $target, %hash ) = @_;
+
+	for my $a (@{$self->{actions}}) {
+		if ($a->{action} eq $action && $a->{target} eq $target) {
+			Base::debug ("redundant action: $action, $target");
+			return;
+		}
+	}
+
+	my $pairs = "";
+	for my $key (sort keys %hash) {
+		my $val = ($hash{$key} or '--');
+		$pairs .= "$key=$val ";
+	}
+	Base::info ("action: $action, $target {$pairs}");
+
+	push @{$self->{actions}}, {
+		action => $action,
+		target => $target,
+		version => Conf::get('version'),
+		appVersion => Conf::get('appVersion'),
+		auxDir => Conf::get('auxDir'),
+		%hash
+		};
+}
+
+
+#
+# string -- render an action list.
+#
+sub string {
+	my $self = shift;
+	my $result = "";
+	for my $a (@{$self->{actions}}) {
+		my $action = $a->{action};
+		my $target = $a->{target};
+		my $pairs = "";
+		for my $key (sort keys %{$a}) {
+			next if $key eq "action";
+			next if $key eq "target";
+			next if $key eq "version";
+			next if $key eq "appVersion";
+			next if $key eq "auxDir";
+			my $val = $a->{$key};
+			my $pairs .= "$key=$val ";
+		}
+		$result .= "\t\t$action $target {$pairs}\n";
+	}
+	return $result;
+}
+
+
+#
+# expandFragment -- given a fragment of text, and a hash
+# of parameter settings, return the fragment with HTML::Template
+# expansion applied.
+# Don't die on bad parameters: caller cannot know which parameters
+# the template is willing to use.
+#
+sub expandFragment ($$) {
+	my ($fragment, $params) = @_;
+	my $htempl = HTML::Template->new (
+		scalarref => \$fragment,
+		die_on_bad_params => 0,
+		);
+	$htempl->param ($params);
+	my $result = $htempl->output();
+	return $result;
+}
+
+
+#
+# expand -- given an overall plan, return an initrd image specification.
+#
+sub expand {
+	my ($self, $templates) = @_;
+	my $image = Image->new();
+
+	for my $a (@{$self->{actions}}) {
+		my $action = $a->{action};
+		Base::debug ("expanding '$action'");
+		my $template = $templates->{$action};
+		if (! defined ($template)) {
+			Base::fatal ("no template for $action defined");
+		}
+
+		for my $directive (@{$template->{directives}}) {
+			my $type = $directive->{type};
+			my $origin = $directive->{origin};
+			Base::debug ("applying $type, $origin");
+
+			if ($type eq "file") {
+				my $fileTempl = $directive->{value};
+				my $fileName = expandFragment ($fileTempl, $a);
+				$image->addFile ($fileName, $origin);
+			}
+			elsif ($type eq "directory") {
+				my $dirTempl = $directive->{value};
+				my $dirName = expandFragment ($dirTempl, $a);
+				$image->addDirectory ($dirName, $origin);
+			}
+			elsif ($type eq "tree") {
+				my $treeTempl = $directive->{value};
+				my $treeName = expandFragment ($treeTempl, $a);
+				$image->addTree ($treeName, $origin);
+			}
+			elsif ($type eq "script") {
+				my $scriptNTempl = $directive->{pathname};
+				my $scriptName = expandFragment ($scriptNTempl, $a);
+				my $contentTempl = $directive->{value};
+				my $content = expandFragment ($contentTempl, $a);
+				$image->addScriptLine ($scriptName, $content, $origin);
+			}
+			else {
+				Base::bug ("cannot handle $type at $origin");
+			}
+		}
+
+	}
+
+	return $image;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/ActiveBlockDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/ActiveBlockDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/ActiveBlockDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,106 @@
+#!perl -w
+#
+# ActiveBlockDev -- a single blockdev, as found in /sys
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# The blockdev can be a whole device or a partition.
+# descriptors contain:
+# - name, path as found in /sys (sda, sda/sda1)
+# - devno, as found in /sys (8:1)
+# - parent, undef for whole device, maj:minor of parent otherwise
+# - hw, path to underlying hardware device,
+# 		eg an ide controller somewhere on a PCI bus.
+#		this is a path relative to /sys/devices,
+#		and can be undef (eg for ram disk)
+# - yspecial, a block special file giving access to the device
+# 		in the generated initrd image.  This often needs
+# 		a mknod on the generated image.  This must be aware
+# 		of the fact that device-mapper based devices
+# 		(LVM, cryptsetup) must be in /dev/mapper.
+# - partitions, list of partitions contained in the device.
+#		these partitions are also ActiveBlockDevs.
+#
+# NOTE: the partition list relies on ActiveBlockDevTab making
+# a complete scan of all block devices, each partition registering
+# itself as partition with the parent device.
+#
+use strict;
+use warnings;
+use BlockSpecialFileTab;
+package ActiveBlockDev;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('name', 'devno', 'parent', 'hw');
+	$self->{partitions} = [];
+	if (defined ($self->parent)) {
+		push @{$self->parent->partitions}, $self;
+	}
+}
+
+sub name	{ return $_[0]->{name}; }
+sub devno	{ return $_[0]->{devno}; }
+sub parent	{ return $_[0]->{parent}; }
+sub hw		{ return $_[0]->{hw}; }
+sub partitions	{ return $_[0]->{partitions}; }
+
+sub string {
+	my $self = shift;
+	my $name = $self->name;
+	my $devno = $self->devno;
+	my $parent = (defined($self->parent) ? $self->parent->name : "--");
+	my $hw = ($self->hw or "--");
+	my $yspecial = ($self->yspecial or "--");
+	return "$name($devno) in $parent at $hw becomes $yspecial";
+}
+
+sub yspecial {
+	my $self = shift;
+	my $name = $self->name;
+	my $devno = $self->devno;
+	my $yspecial = "/dev/$name";
+	if ($name =~ /^dm-\d+$/) {
+		my $paths = BlockSpecialFileTab::pathsByDevno ($devno);
+		if (! defined ($paths)) {
+			Base::fatal ("No block special file for $name in /dev");
+		}
+		my $match = undef;
+		for my $p (@{$paths}) {
+			if ($p =~ m!^/dev/mapper/([^/]*)$!) {
+				if (defined ($match)) {
+					Base::fatal ("Don't know how to choose between $match and $p for $name");
+				}
+				$match = $p;
+			}
+		}
+		if (! defined ($match)) {
+			Base::fatal ("No block special file for $name in /dev/mapper");
+		}
+		$yspecial = $match;
+	}
+	return $yspecial;
+}
+
+sub hasPartitions {
+	my $self = shift;
+	return ($#{$self->partitions} >= 0);
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/ActiveBlockDevTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/ActiveBlockDevTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/ActiveBlockDevTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,149 @@
+#!perl -w
+#
+# ActiveBlockDevTab -- descriptors of all block devices in /sys
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+use ActiveBlockDev;
+package ActiveBlockDevTab;
+
+
+my $abdTab = undef;
+my $abdList = undef;
+
+
+sub init () {
+	if (defined ($abdTab)) {
+		return;
+	}
+	$abdTab = {};
+
+	my $blockdir;
+	my $blockPath = Conf::get('sysFs') . "/block";
+	if (! opendir ($blockdir, "$blockPath")) {
+		Base::fatal ("can't open directory $blockPath");
+	}
+	while (defined (my $entry = readdir ($blockdir))) {
+		next if $entry eq ".";
+		next if $entry eq "..";
+		oneBlockDev($blockPath, $entry);
+	}
+	if (! closedir ($blockdir)) {
+		Base::fatal ("could not read directory $blockPath");
+	}
+
+	$abdList = [values %{$abdTab}];
+}
+
+sub oneBlockDev ($$) {
+	my ($blockPath, $entry) = @_;
+	my $devno = Base::getStringFile("$blockPath/$entry/dev");
+	if (exists ($abdTab->{$devno})) {
+		Base::fatal ("found duplicate devno in $blockPath/$entry");
+	}
+	my $hw = readlink("$blockPath/$entry/device");
+	# failure results in undef, which is exactly how
+	# we want to represent absence of a hw device.
+	if (defined ($hw)) {
+		unless ($hw =~ s!^(\.\./)+devices/!!) {
+			# imagine localised linux (/sys/geraete ...)
+			Base::fatal ("bad device link in $blockPath/$entry");
+		}
+	}
+	my $descr = ActiveBlockDev->new (
+		name => $entry,
+		devno => $devno,
+		parent => undef,
+		hw => $hw,
+		);
+	$abdTab->{$devno} = $descr;
+
+	#
+	# Scan partitions.
+	# Note that these are only visible after someone
+	# read the a block from the device.
+	#
+	my $devdir;
+	if (! opendir ($devdir, "$blockPath/$entry")) {
+		Base::fatal ("can't open directory $blockPath/$entry");
+	}
+	while (defined (my $partition = readdir ($devdir))) {
+		next if $partition eq ".";
+		next if $partition eq "..";
+		next unless -d "$blockPath/$entry/$partition";
+
+		# there can be subdirectories in a blockdev
+		# other than partitions; eg /sys/block/sda/queue.
+		# a partition has major:minor, so has a dev file.
+		next unless -f "$blockPath/$entry/$partition/dev";
+
+		onePartition($blockPath, $entry, $partition, $descr);
+	}
+	if (! closedir ($devdir)) {
+		Base::fatal ("could not read directory $blockPath/$entry");
+	}
+}
+
+sub onePartition ($$$$) {
+	my ($blockPath, $entry, $partition, $parent) = @_;
+	my $dev = Base::getStringFile("$blockPath/$entry/$partition/dev");
+	if (exists ($abdTab->{$dev})) {
+		Base::fatal ("found duplicate devno in $blockPath/$entry/$partition");
+	}
+	$abdTab->{$dev} = ActiveBlockDev->new (
+		name => $partition,
+		devno => $dev,
+		parent => $parent,
+		hw => undef,
+		);
+}
+
+#
+# all -- return list of all known active block devices.
+#
+sub all	() {
+	init;
+	return $abdList;
+}
+
+#
+# findByDevno -- given devno in format maj:min,
+# return corresponding descriptor or undef.
+#
+sub findByDevno ($) {
+	my ($devno) = @_;
+	init;
+	return $abdTab->{$devno};
+}
+
+#
+# findByPath -- given path to block device file in /dev,
+# return corresponding descriptor or undef.
+#
+sub findByPath ($) {
+	my ($path) = @_;
+	my $devno = Base::devno ($path);
+	if (! defined ($devno)) {
+		return undef;
+	}
+	return findByDevno ($devno);
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Base.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Base.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Base.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,299 @@
+#!perl -w
+#
+# Base -- support stuff
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# setProgName -- what label to use in further messages.
+# setVerbose -- if true, print info
+# setDebug -- if true, print info and debug
+# setQuiet -- if true, don't print warnings
+#
+# debug -- irritating noise
+# info -- reassuring noise
+# warning -- not good, but processing continues, exit status unaffected
+# error -- not good, processing continues, exit status non-zero,
+# 		program should not make changes to environment
+# 		such as writing output files.
+# fatal -- not good, exit immediately with non-zero status.
+# bug -- fatal error in the program, not environment.
+# assert -- if condition not met, it's a bug.
+# bye -- exit now.
+#
+# Also routines to
+# - read content of one-line files
+# - get device number from block or character device files
+# - interpret symbolic links
+# - interpret pathnames
+#
+use strict;
+use warnings;
+package Base;
+
+
+my $progName = "[app]";
+sub setProgName ($) { $progName = $_[0]; }
+
+my $verbose = 0;
+sub setVerbose ($) { $verbose = $_[0]; }
+
+my $debug = 0;
+sub setDebug ($) { $debug = $_[0]; }
+
+my $quiet = 0;
+sub setQuiet ($) { $quiet = $_[0]; }
+
+
+my $exitCode = 0;
+
+
+sub debug ($) {
+	my $msg = shift;
+	if ($debug) {
+		print "$progName:D: $msg\n";
+	}
+}
+
+sub info ($) {
+	my $msg = shift;
+	if ($verbose || $debug) {
+		print "$progName: $msg\n";
+	}
+}
+
+sub warning ($) {
+	my $msg = shift;
+	if (! $quiet) {
+		print STDERR "$progName warning: $msg\n";
+	}
+}
+
+sub error ($) {
+	my $msg = shift;
+	print STDERR "$progName error: $msg\n";
+	$exitCode = 1;
+
+}
+
+sub fatal ($) {
+	my $msg = shift;
+	error ($msg . " (fatal)");
+	bye();
+}
+
+sub bug ($) {
+	my $msg = shift;
+	my ($package, $file, $line) = caller;
+	fatal ($msg . " (internal $file:$line)");
+}
+
+sub assert ($) {
+	my $cond = shift;
+	my ($package, $file, $line) = caller;
+	if (! $cond) {
+		fatal ("assert failed (internal $file:$line)");
+	}
+}
+
+sub bye () {
+	exit ($exitCode);
+}
+
+
+#
+# getStringFile -- return contents of a file that must contain
+# a single line, dropping optional trailing space, or die.
+#
+sub getStringFile ($) {
+	my ($filename) = @_;
+	if (! open (F, "<", "$filename")) {
+		Base::fatal ("can't open $filename");
+	}
+	my $line = <F>;
+	if (! defined ($line)) {
+		Base::fatal ("empty file $filename");
+	}
+	chomp $line;
+	if (defined (<F>)) {
+		Base::fatal ("extra lines in $filename");
+	}
+	if (! close (F)) {
+		Base::fatal ("could not read $filename");
+	}
+	return $line;
+}
+
+
+#
+# getHexFile -- given path to file, return content interpreted as hex number.
+#
+sub getHexFile ($) {
+	my ($filename) = @_;
+	my $content = getStringFile ($filename);
+	if ($content !~ /^(0x)?[0-9a-fA-F]+$/) {
+		fatal ("not a hex file: $filename");
+	}
+	return hex($content);
+}
+
+
+#
+# devno -- given pathname to a device, return "maj:min" or undef.
+# symlinks are resolved implicitly.
+#
+sub devno ($) {
+	my ($path) = @_;
+	if ( ! (-b $path || -c _)) {
+		return undef;
+	}
+
+	my @fields = stat _;
+	if ($#fields != 12) {
+		Base::fatal ("stat failed on device $path");
+	}
+	# from 2.6.10-rc2, kdev.h, backward compatible.
+	my $devno = $fields[6];
+	my $major = ($devno & 0xfff00) >> 8;
+	my $minor = ($devno & 0xff) | (($devno >> 12) & 0xfff00);
+	return "$major:$minor";
+}
+
+
+#
+# expandLink -- given a path to a symlink file,
+# return a path to what it points to.
+#
+sub expandLink ($) {
+	my ($path) = @_;
+	Base::assert (-l $path);
+	my $target = readlink("$path");
+
+	if (isAbsolute ($target)) {
+		return canon ($target);
+	}
+	my $base = dirname ($path);
+	return canon ("$base/$target");
+}
+
+
+#
+# isAbsolute -- given a path, return true iff it starts at root.
+#
+sub isAbsolute ($) {
+	my ($path) = @_;
+	return $path =~ /^\//;
+}
+
+
+#
+# canon -- given path, return copy with redundant stuff removed.
+#
+sub canon ($) {
+	my ($path) = @_;
+
+	if ($path eq '') {
+		$path = '.';
+	}
+	if ($path =~ m![^/]/+$!) {
+		# drop trailing slashes, except in path like ////
+		$path =~ s!/+$!!;
+	}
+
+	# iterate over components (ignoring duplicate slashes)
+	# interpret a null list as 'current directory'
+	# interpret a leading '' in list as absolute path
+	# . can be dropped
+	# .. causes dropping of last element of list, but:
+	# (1) /.. => / 
+	# (2) ../.. is not dropped.
+	# (3) ./.. => ..
+	my @result = ();
+	for my $component (split (/\/+/, $path)) {
+		if ($component eq '.') {
+			next;
+		}
+		elsif ($component eq '..') {
+			if ($#result == -1) {
+				push @result, '..';
+			}
+			elsif ($#result == 0 && $result[0] eq '') {
+				next;
+			}
+			elsif ($result[$#result] eq '..') {
+				push @result, '..';
+			}
+			else {
+				pop @result;
+			}
+		}
+		else {
+			push @result, $component;
+		}
+	}
+	if ($#result == -1) {
+		return ".";
+	}
+	elsif ($#result == 0 && $result[0] eq '') {
+		return '/';
+	}
+	else {
+		return join ('/', @result);
+	}
+}
+
+
+#
+# basename -- given path, return final component of canonified path
+#
+sub basename ($) {
+	my ($path) = @_;
+	my $t = canon ($path);
+	if ($t =~ m!.*/([^/]+)$!) {
+		# something is after the slash,
+		# the simple case
+		return $1;
+	}
+	elsif ($t !~ m!/!) {
+		# basename aap => aap
+		return $t;
+	}
+	else {
+		return '/';
+	}
+}
+
+
+#
+# dirname -- given path, return all but final component of canonified path
+#
+sub dirname ($) {
+	my ($path) = @_;
+	my $t = canon ($path);
+	if ($t =~ m!(.+)/[^/]+$!) {
+		# something before and after the slash
+		return $1;
+	}
+	elsif ($t !~ m!/!) {
+		# dirname aap => .
+		# but also dirname .. => .
+		return '.';
+	}
+	else {
+		return '/';
+	}
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Blacklist.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Blacklist.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Blacklist.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,110 @@
+#!perl -w
+#
+# Blacklist -- encapsulate /etc/hotplug/blacklist
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# isBlacklisted -- module occurs in one of the hotplug blacklists.
+# normalise underscore to hyhpen before comparing.
+#
+
+use strict;
+use warnings;
+use Base;
+use Conf;
+package Blacklist;
+
+my $blackMap = undef;
+my $blackList = undef;
+
+sub init () {
+	if (defined ($blackList)) {
+		return;
+	}
+	my $blackMap = {};
+	my $hotplugDir = Conf::get ('hotplug');
+	my $blackListName = "hotplugDir/blacklist";
+	if (-e $blackListName) {
+		# The blacklist does not have to exist:
+		# there are machines without hotplug,
+		# and blacklist support in hotplug is
+		# likely to be replaced with a keyword in
+		# the module-init-tools config file.
+		# If it does exist, but is unreadable,
+		# that's an error.
+		parseBlackList ($blackListName);
+	}
+
+	my $dir;
+	my $dirName = "$hotplugDir/blacklist.d";
+	if (-d $dirName) {
+		# blacklist.d does not have to exist (Debian
+		# has it, Fedora not), but if it exists,
+		# it must be readable.
+		if (! opendir ($dir, $dirName)) {
+			Base::fatal ("can't open directory $dirName");
+		}
+		while (defined(my $entry = readdir($dir))) {
+			if ( -f "$dirName/$entry" ) {
+				parseBlackList ("$dirName/$entry");
+			}
+		}
+		if (! closedir ($dir)) {
+			Base::fatal ("could not read directory $dirName");
+		}
+	}
+
+	my $blackList = [ keys %{$blackMap} ];
+}
+
+sub parseBlackList ($) {
+	my ($fileName) = @_;
+	if (! open (IN, "<", "$fileName")) {
+		Base::fatal ("can't open blacklist $fileName");
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/#.*//;
+		$line =~ s/^\s+//;
+		$line =~ s/\s+$//;
+		$line =~ s/_/-/g;
+		if ($line eq "") {
+			next;
+		}
+		if ($line !~ /^[a-zA-Z0-9-]+$/) {
+			Base::fatal ("bad line in blacklist $fileName: $line");
+		}
+		$blackMap->{$line}++;
+	}
+	if (! close (IN)) {
+		Base::fatal ("could not read blacklist $fileName");
+	}
+}
+
+sub all	() {
+	init;
+	return $blackList;
+}
+
+sub isBlacklisted ($) {
+	my ($module) = @_;
+	init;
+	$module =~ s/_/-/g;
+	return exists ($blackMap->{$module});
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/BlockSpecialFileTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/BlockSpecialFileTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/BlockSpecialFileTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,91 @@
+#!perl -w
+#
+# BlockSpecialFileTab -- block special files found in /dev
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# pathsByDevno -- list of all matching block special files in /dev for a devno
+# allDevnos -- list of all devno's present in /dev.
+#
+use strict;
+use warnings;
+use Conf;
+package BlockSpecialFileTab;
+
+
+my $bsfTab = undef;
+my $bsfList = undef;
+
+
+sub walkBlockSpecialFiles ($);
+
+sub init () {
+	if (defined ($bsfTab)) {
+		return;
+	}
+	$bsfTab = {};
+	my $devDir = Conf::get('dev');
+	walkBlockSpecialFiles ($devDir);
+	$bsfList = [ sort keys %{$bsfTab} ];
+}
+
+sub walkBlockSpecialFiles ($) {
+	my ($dirName) = @_;
+	my $dir;
+	if (! opendir ($dir, $dirName)) {
+		Base::fatal ("can't open directory $dirName");
+	}
+	while (defined(my $entry = readdir($dir))) {
+		next if $entry eq ".";
+		next if $entry eq "..";
+		my $path = "$dirName/$entry";
+		if (-l $path) {
+			next;
+		}
+		elsif (-b _) {
+			my $devno = Base::devno ($path);
+			push @{$bsfTab->{$devno}}, $path;
+		}
+		elsif (-d _) {
+			walkBlockSpecialFiles ($path);
+		}
+	}
+	if (! closedir ($dir)) {
+		Base::fatal ("could not read directory $dirName");
+	}
+}
+
+
+#
+# pathsByDevno -- list of all matching block special files in /dev for devno,
+# or undef.
+#
+sub pathsByDevno ($) {
+	my ($devno) = @_;
+	init;
+	return $bsfTab->{$devno};
+}
+
+#
+# all -- return list of all devno's with  a path in /dev.
+#
+sub allDevnos () {
+	init;
+	return $bsfList;
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/Conf.pm.in
===================================================================
--- dists/trunk/utils/yaird/perl/Conf.pm.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Conf.pm.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,94 @@
+#!perl -w
+#
+# Conf -- configured path names and such.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# You can get and set configuration items by name,
+# with the following restrictions:
+# - only get and set known keys
+# - after first get, no further set is allowed.
+#
+# Defaults are packaged as subs, so that you can change
+# one setting and have the change ripple through in other
+# settings.
+#
+use strict;
+use warnings;
+use Base;
+package Conf;
+
+sub get($);
+
+#
+# Default values for configuration; if there is no default,
+# it's not a known parameter, and you cannot modify it.
+#
+my $defaults = {
+	version		=> sub { my $v = `uname -r`; chomp $v; $v; },
+	libModules	=> sub { "/lib/modules"; },
+	kernConf	=> sub { "/boot/config-"
+				. get('version'); },
+	modDep		=> sub { get('libModules')
+				. '/' . get('version')
+				. '/modules.dep'; },
+	usbMap		=> sub { get('libModules')
+				. '/' . get('version')
+				. '/modules.usbmap'; },
+	pciMap		=> sub { get('libModules')
+				. '/' . get('version')
+				. '/modules.pcimap'; },
+	modDir		=> sub { get('libModules')
+				. '/' . get('version')
+				. '/kernel'; },
+	sysFs		=> sub { "/sys"; },
+	procFs		=> sub { "/proc"; },
+	dev		=> sub { "/dev"; },
+	fstab		=> sub { "/etc/fstab"; },
+	crypttab	=> sub { "/etc/crypttab"; },
+	hotplug		=> sub { "/etc/hotplug"; },
+	appVersion	=> sub { "@VERSION@"; },
+	auxDir		=> sub { "@AUXDIR@"; },
+	cfgDir		=> sub { "@CFGDIR@"; },
+};
+
+
+my $overrides = {};		# config values where default is overridden,
+				# presumably via command line.
+my $used = {};			# if a key exists, the config value has
+				# been used, and it no longer can be changed.
+
+sub get ($) {
+	my ($key) = @_;
+	my $dflt = $defaults->{$key};
+	Base::assert (defined ($dflt));
+	$used->{$key}++;
+	my $ovr = $overrides->{$key};
+	if (defined ($ovr)) {
+		return $ovr;
+	}
+	return &{$dflt}();
+}
+
+sub set ($$) {
+	my ($key, $value) = @_;
+	my $dflt = $defaults->{$key};
+	Base::assert (defined ($dflt));
+	Base::assert (! defined ($used->{$key}));
+	$overrides->{$key} = $value;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/CryptEntry.pm
===================================================================
--- dists/trunk/utils/yaird/perl/CryptEntry.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/CryptEntry.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,47 @@
+#!perl -w
+#
+# CryptEntry -- encapsulate a single entry in /etc/crypttab
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use LabeledPartitionTab;
+package CryptEntry;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('dst', 'src', 'keyFile', 'opts', 'origin');
+}
+
+sub dst		{ return $_[0]->{dst}; }
+sub src		{ return $_[0]->{src}; }
+sub keyFile	{ return $_[0]->{keyFile}; }
+sub opts	{ return $_[0]->{opts}; }
+sub origin	{ return $_[0]->{origin}; }
+
+sub string {
+	my $self = shift;
+	my $dst = $self->dst();
+	my $src = $self->src();
+	my $opts = $self->opts()->string();
+	return "$dst in $src with $opts";
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/CryptTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/CryptTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/CryptTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,110 @@
+#!perl -w
+#
+# CryptTab -- encapsulate /etc/crypttab.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Hmm, what do we do about no crypttab?
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+use CryptEntry;
+package CryptTab;
+
+
+my $cryptTab = undef;
+
+
+sub init () {
+	if (defined ($cryptTab)) {
+		return;
+	}
+	$cryptTab = [];
+	my $name = Conf::get('crypttab');
+	if (! -e $name) {
+		#
+		# It's OK if there's no /etc/crypttab, but if it
+		# exists, it had better be readable.
+		#
+		return;
+	}
+	if (! open (IN, "<", "$name")) {
+		Base::fatal ("can't read $name");
+	}
+	my $lineNo = 0;
+	while (defined (my $line = <IN>)) {
+		$lineNo++;
+		chomp $line;
+
+		$line =~ s/^\s*//;
+		next if $line =~ /^#/;	# comment line
+		next if $line eq "";
+
+		my @fields = split (/\s+/, $line);
+		if (@fields < 2) {
+			Base::fatal ("no source device in $name:$lineNo");
+		}
+		my $dst = shift @fields;
+		my $src = shift @fields;
+		my $keyFile = shift @fields; # may be undef
+		my $optString = (shift @fields or '');
+		my $opts = Opts->new (string => $optString);
+
+		if (defined ($keyFile) && $keyFile eq 'none') {
+			$keyFile = undef;
+		}
+
+		my $descr = CryptEntry->new(
+			dst => $dst,
+			src => $src,
+			keyFile => $keyFile,
+			opts => $opts,
+			origin => "$name:$lineNo",
+			);
+		push @{$cryptTab}, $descr;
+	}
+	if (! close (IN)) {
+		Base::fatal ("could not read $name");
+	}
+}
+
+sub all	() {
+	init;
+	return $cryptTab;
+}
+
+#
+# findByDst -- return crypttab entry or undef
+#
+sub findByDst ($) {
+	my ($dst) = @_;
+	my $result;
+	for my $entry (@{CryptTab::all()}) {
+		if ($entry->dst() eq $dst) {
+			if (defined ($result)) {
+				my $o1 = $entry->origin;
+				my $o2 = $result->origin;
+				Base::fatal ("duplicate device '$dst' in $o1, $o2");
+			}
+			$result = $entry;
+		}
+	}
+	return $result;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/FsEntry.pm
===================================================================
--- dists/trunk/utils/yaird/perl/FsEntry.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/FsEntry.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,130 @@
+#!perl -w
+#
+# FsEntry -- encapsulate a single entry in /etc/fstab
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use LabeledPartitionTab;
+package FsEntry;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('dev', 'mnt', 'type', 'opts', 'origin');
+}
+
+sub dev		{ return $_[0]->{dev}; }
+sub mnt		{ return $_[0]->{mnt}; }
+sub type	{ return $_[0]->{type}; }
+sub opts	{ return $_[0]->{opts}; }
+sub origin	{ return $_[0]->{origin}; }
+
+sub string {
+	my $self = shift;
+	my $dev = $self->dev();
+	my $mnt = $self->mnt();
+	my $type = $self->type();
+	my $opts = $self->opts()->string();
+	my $origin = $self->origin();
+	return "$origin: $mnt at $dev ($type) with $opts";
+}
+
+
+#
+# isRequiredAtBoot -- To be mounted at boot time with mount -a.
+# This does not imply the initrd should already mount it.
+#
+sub isRequiredAtBoot {
+	my $self = shift;
+	return 0 if ($self->type eq "ignore");
+	return 0 if ($self->opts->exists("noauto"));
+	return 1;
+}
+
+
+#
+# blockDevPath -- return (blockdev pathname, undef) for an fstab entry.
+# must resolve LABEL= and UUID=.  Note that LVM and raid devices
+# may be implemented on top of multiple other devices; this returns
+# only the top device.
+#
+# Returns (undef, message) if first field of fstab entry does not point to
+# an existing block device.  Possible reasons:
+# - filesystem does not have underlying device, such as /proc.
+# - filesystem has a non-file underlying resource, such as NFS
+# - garbage line with missing blockdev
+# - filesystem has a plain file as underlying resource;
+#   this can be a loopback file system, or swap to plain file.
+#
+# NOTE: We should support the last case, but for now that's too difficult:
+# imagine /a/b/c, where /a is reiserfs, b is a symlink to /d (an NFS
+# filesystem), and /d/c is a symlink to /e/f, where /e is a ramdisk.)
+#
+sub blockDevPath {
+	my $self = shift;
+	my $dev = $self->dev();
+	my $origin = $self->origin();
+	my $msg = undef;
+
+	if ($dev =~  /^\//) {
+		if ($self->opts->exists('loop')) {
+			$msg = "loopback mount for '$dev' not supported ($origin)";
+			return (undef, $msg);
+		}
+		if (-f $dev && $self->type eq "swap") {
+			$msg = "swap to regular file for '$dev' not supported ($origin)";
+			return (undef, $msg);
+		}
+
+		if (! -e $dev) {
+			$msg = "'$dev' not found ($origin)";
+			return (undef, $msg);
+		}
+
+		if (! -b $dev) {
+			$msg = "'$dev' must be a block device ($origin)";
+			return (undef, $msg);
+		}
+
+		return ($dev, undef);
+	}
+	elsif ($dev =~ /^LABEL=(.*)/) {
+		my $path = LabeledPartitionTab::findPathByLabel ($1);
+		if (defined ($path)) {
+			return ($path, undef);
+		}
+		$msg = "label '$1' not found ($origin)";
+		return (undef, $msg);
+	}
+	elsif ($dev =~ /^UUID=(.*)/) {
+		my $path = LabeledPartitionTab::findPathByUuid ($1);
+		if (defined ($path)) {
+			return ($path, undef);
+		}
+		$msg = "uuid '$1' not found ($origin)";
+		return (undef, $msg);
+	}
+	$msg = "bad device name '$dev' ($origin)";
+	return (undef, $msg);
+}
+
+
+1;
+
+

Added: dists/trunk/utils/yaird/perl/FsOpts.pm
===================================================================
--- dists/trunk/utils/yaird/perl/FsOpts.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/FsOpts.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,66 @@
+#!perl -w
+#
+# FsOpts -- encapsulate the options in an FsEntry
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# This just adds a fstab specific access function to basic opts.
+#
+use strict;
+use warnings;
+package FsOpts;
+use base 'Opts';
+
+#
+# cmdLineVersion -- return a version of all options suitable for
+# a mount command line.
+# Note that some options in fstab can only be used in fstab,
+# not in scripts.
+#
+sub cmdLineVersion {
+	my $self = shift;
+	my $opts = $self->{optsHash};
+
+	my @cmdLine = ();
+	for my $key (sort keys %{$opts}) {
+		next if $key eq 'auto';
+		next if $key eq 'noauto';
+		next if $key eq 'nouser';
+		next if $key eq 'owner';
+		next if $key eq 'user';
+		next if $key eq 'users';
+		next if $key eq 'defaults';
+		my $val = $opts->{$key};
+		if (defined ($val)) {
+			push @cmdLine, "$key=$val";
+		}
+		else {
+			push @cmdLine, "$key";
+		}
+	}
+	if ($#cmdLine == -1) {
+		return "";
+	}
+	else {
+		# protect against logdev=John's disk.
+		my $cmdLine = join (',', @cmdLine);
+		$cmdLine =~ s/(['\\])/\\$1/g; 
+		return "-o '$cmdLine'";
+	}
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/FsTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/FsTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/FsTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,151 @@
+#!perl -w
+#
+# FsTab -- encapsulate /etc/fstab.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+use FsOpts;
+use FsEntry;
+package FsTab;
+
+
+my $fsTab = undef;
+
+
+sub init () {
+	if (defined ($fsTab)) {
+		return;
+	}
+	$fsTab = [];
+	my $name = Conf::get('fstab');
+	if (! open (IN, "<", "$name")) {
+		Base::fatal ("can't read $name");
+	}
+	my $lineNo = 0;
+	while (defined (my $line = <IN>)) {
+		$lineNo++;
+		$line =~ s/^\s+//;
+		next if $line =~ /^#/;	# comment line
+		next if $line eq "";	# empty line
+		my @fields = split (/\s+/, $line, 999);
+		if ($#fields < 6) {
+			# no test for extra fields;
+			# the mount command allows that.
+			Base::fatal ("malformed line in $name:$lineNo");
+		}
+		if ($fields[2] eq "swap") {
+			if (($fields[1] ne "none") &&($fields[1] ne "swap")) {
+				Base::fatal ("bad swap entry in $name:$lineNo");
+			}
+		}
+		
+		my $opts = FsOpts->new (
+			string => unmangle($fields[3]));
+
+		#
+		# Canon makes sure that mountpoint /usr is same as /usr/.
+		# For UUID= devices, it should be harmless.
+		#
+		my $descr = FsEntry->new(
+			dev => Base::canon (unmangle($fields[0])),
+			mnt => Base::canon (unmangle($fields[1])),
+			type => unmangle($fields[2]),
+			opts => $opts,
+			origin => "$name:$lineNo",
+			);
+		push @{$fsTab}, $descr;
+	}
+	if (! close (IN)) {
+		Base::fatal ("could not read $name");
+	}
+}
+
+sub all	() {
+	init;
+	return $fsTab;
+}
+
+sub findByMountPoint ($) {
+	my ($mnt) = @_;
+	my $result;
+
+	$mnt = Base::canon ($mnt);
+	for my $entry (@{FsTab::all()}) {
+		if ($entry->mnt() eq $mnt) {
+			if (defined ($result)) {
+				Base::fatal ("duplicate mount point in fstab $mnt");
+			}
+			$result = $entry;
+		}
+	}
+	if (! defined ($result)) {
+		Base::fatal ("mount point not in fstab: $mnt");
+	}
+	return $result;
+}
+
+#
+# findByDevName -- given name of a block device, find fstab entry.
+# Note:
+# - some devices may not have blockdev, eg nfs devices
+# - some may be specified as LABEL=/usr
+# - aliases can occur: eg /dev/root and /dev/hda1 have same device no.
+#
+sub findByDevName ($) {
+	my ($dev) = @_;
+	my $result;
+	my $devno = Base::devno ($dev);
+	if (! defined ($devno)) {
+		Base::fatal ("cannot find device number for: $dev");
+	}
+
+	for my $entry (@{FsTab::all()}) {
+		my ($b2, $msg) = $entry->blockDevPath();
+		if (! defined ($b2)) {
+			next;
+		}
+		my $n2 = Base::devno ($b2);
+		if (! defined ($n2)) {
+			next;
+		}
+
+		if ($n2 eq $devno) {
+			if (defined ($result)) {
+				Base::fatal ("duplicate device name in fstab: $dev");
+			}
+			$result = $entry;
+		}
+	}
+	if (! defined ($result)) {
+		Base::fatal ("device name not in fstab: $dev");
+	}
+	return $result;
+}
+
+# replace octal escapes
+sub unmangle ($) {
+	my ($string) = @_;
+	while ($string =~ /\\([0-7]{3})/) {
+		$string = $` . chr (oct ($1)) . $';
+	}
+	return $string;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Hardware.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Hardware.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Hardware.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,249 @@
+#!perl -w
+#
+# Hardware -- find modules for a thingy in /devices.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# Method: walk up the path, and for everything you recognise,
+# prepend the appropriate module.
+# As an example, for a usb-stick connected via a hub to a pci card,
+# you'l need usb-storage, a usb protocol driver, and some usb module.
+#
+use strict;
+use warnings;
+use Conf;
+use IdeDev;
+use ScsiDev;
+use PciDev;
+use PciTab;
+use UsbDev;
+use UsbTab;
+package Hardware;
+
+
+#
+# moduleList -- given a path relativwe to /sys/devices,
+# return a list of the modules needed to activate it.
+#
+sub moduleList ($) {
+	my ($path) = @_;
+	my $result = [];
+	my @components = split (/\/+/, $path);
+	my $devicesPath = Conf::get ('sysFs') . "/devices";
+	for my $i (0 .. $#components) {
+		my $abspath = $devicesPath
+			. "/" . join ('/', @components[0 .. $i]);
+		my $modules = undef;
+		if ($abspath =~ m!/pci[0-9a-f]{4}:[0-9a-f]{2}$!) {
+			# PCI bus; harmless
+		}
+		elsif (-f "$abspath/subsystem_vendor") {
+			# PCI function on a slot.
+			my $dev = PciDev->new (path => $abspath);
+			$modules = PciTab::find ($dev);
+			push @{$modules}, @{addPciSiblings ($abspath)};
+		}
+
+		elsif (-f "$abspath/bDeviceClass"
+			|| -f "$abspath/bInterfaceClass")
+		{
+			#
+			# USB.  Every component in the path
+			# "usb1/1-4/1-4.4/1-4.4:1.0" has either
+			# a deviceClass or interfaceClass attribute.
+			#
+			my $dev = UsbDev->new (path => $abspath);
+			$modules = UsbTab::find ($dev);
+		}
+
+		elsif ($abspath =~ m!/ide\d+$!) {
+			# IDE bus; harmless
+		}
+		elsif ($abspath =~ m!/ide\d+/\d+\.\d+$!) {
+			# IDE device
+			my $dev = IdeDev->new (path => $abspath);
+			$modules = IdeDev::findModuleByIdeDev ($dev);
+		}
+		
+		elsif ($abspath =~ m!/host\d+$!) {
+			# grouping of SCSI devices; harmless.
+		}
+		elsif ($abspath =~ m!/target\d+:\d+:\d+$!) {
+			# grouping of SCSI devices within a host
+			# (2.6.10 and later); harmless.
+		}
+		elsif ($abspath =~ m!/\d+:\d+:\d+:\d+$!
+			&& -f "$abspath/scsi_level")
+		{
+			my $dev = ScsiDev->new (path => $abspath);
+			$modules = ScsiDev::findModuleByScsiDev ($dev);
+		}
+
+
+		elsif ($abspath =~ m!/platform$!) {
+			# the platform (pseudo) bus itself does not need any modules.
+		}
+		elsif ($abspath =~ m!/i8042$!) {
+			# Controller for the serio bus for AT mouse and keyboard.
+			$modules = [ "i8042" ];
+		}
+		elsif ($abspath =~ m!/serio\d+$!) {
+			#
+			# The following is conceptually wrong: serio is a bus,
+			# and an attached device such as a keyboard should be in
+			# a subdirectory of that.  However, in 2.6.11, that subdirectory
+			# does not exist.  We'll assume the most common case, an AT keyboard;
+			# other keyboards will have to wait for a kernel patch.
+			#
+			# Adding psmouse is also wrong, but at least in FC4,
+			# the distro kernel has psmouse compiled in, and nothing
+			# probes for it.  This hack really belongs in a template;
+			# we'll get to that when the overall config is more flexible.
+			#
+			$modules = [ "serio", "atkbd", "psmouse" ];
+		}
+		elsif ($abspath =~ m!/floppy.\d+$!) {
+			$modules = [ "floppy" ];
+		}
+
+		else {
+			# NOTE: We may want to avoid duplicate messages
+			Base::error ("unrecognised device: $abspath");
+		}
+
+		if (defined ($modules)) {
+			push @{$result}, @{$modules};
+		}
+	}
+	return $result;
+}
+
+
+#
+# addPciSiblings -- probably a bug.
+#
+# Here's something odd: my test machine has an USB keyboard, connected
+# via PCI.  The same 8 ports are visible both as one 8-port EHCI
+# controller and four 2-port UHCI controllers.  The difference is not
+# in the hardware, only in the protocol used to talk to the remote device.
+# These are different PCI functions (0..7) in the same PCI slot (1d):
+#	0000:00:1d.0 USB Controller: Intel ... USB UHCI #1 (rev 03)
+#	0000:00:1d.1 USB Controller: Intel ... USB UHCI #2 (rev 03)
+#	0000:00:1d.2 USB Controller: Intel ... USB UHCI #3 (rev 03)
+#	0000:00:1d.3 USB Controller: Intel ... USB UHCI #4 (rev 03)
+#	0000:00:1d.7 USB Controller: Intel ... USB2 EHCI Controller (rev 03)
+#
+# The keyboard shows up under the EHCI controller, a printer shows up
+# under one of the UHCI controllers.
+# If we load only the EHCI module, the UHCI-only printer causes some
+# complaints, and the keyboard is not detected (unless you try to
+# debug this via a serial line ...)
+# If you load UHCI as well, the keyboard is detected flawlessly.
+#
+# We could interpret this as a bug in EHCI, and claim that a non-EHCI
+# device on one of the ports should not interfere with detecting devices
+# on other ports, but it's more productive to see this as an example of
+# how some PCI devices work better if there's a driver for every
+# function in the slot.
+#
+# (Or you could just add a special case to always add an UHCI driver
+# after EHCI, but then you would have to consider OHCI as well, plus
+# think about blacklisting and competing USB driver implementations.
+# I'd rather not go there.)
+#
+# The kernel function pci_setup_device() uses the following format
+# for PCI function directories in sysfs:
+#	"%04x:%02x:%02x.%d", domain, bus, slot, function.
+#
+# Given an absolute path to a PCI function directory, return a list
+# of modules needed for all USB functions *except* the one specified by
+# the path, but only if the path refers to a USB function.
+#
+# Limiting this behaviour to USB functions alone is desirable, given
+# the existence of chips such as VT8366/A/7, that combine ISA, IDE,
+# USB and multimedia in a single PCI slot.
+#
+sub addPciSiblings ($) {
+	my ($abspath) = @_;
+	my $modules = [];
+	if (! isUsb ($abspath)) {
+		return $modules;
+	}
+
+	my $dirName = Base::dirname ($abspath);
+	my $cur = Base::basename ($abspath);
+
+	if ($cur !~ /^([0-9a-f]{4}):([0-9a-f]{2}):([0-9a-f]{2})\.(\d)$/) {
+		Base::fatal ("Odd PCI directory in sysfs: $abspath");
+	}
+	my $domain = $1;
+	my $bus = $2;
+	my $slot = $3;
+	my $function = $4;
+
+	#print "D $dirName, B $cur, d $domain b $bus s $slot f $function\n";
+	my $dir;
+	if (! opendir ($dir, $dirName)) {
+		Base::fatal ("can't open directory $dirName");
+	}
+	while (defined(my $entry = readdir($dir))) {
+		if ($entry !~ /^([0-9a-f]{4}):([0-9a-f]{2}):([0-9a-f]{2})\.(\d+)$/) {
+			next;
+		}
+		if (! ($1 eq $domain && $2 eq $bus && $3 eq $slot
+			&& $4 ne $function))
+		{
+			next;
+		}
+
+		# OK, it's in my slot, and it isn't me.
+		# Add required modules if it's USB.
+		my $sibling = "$dirName/$entry";
+		if (isUsb ($sibling)) {
+			my $dev = PciDev->new (path => $sibling);
+			push @{$modules}, @{PciTab::find ($dev)};
+		}
+	}
+        if (! closedir ($dir)) {
+		Base::fatal ("could not read directory $dirName");
+	}
+	return $modules;
+}
+
+#
+# isUsb -- given an absolute path into sysfs, true iff it controls a usb port.
+#
+sub isUsb ($) {
+	my ($abspath) = @_;
+	my $dir;
+	my $result = 0;
+	if (! opendir ($dir, $abspath)) {
+		Base::fatal ("can't open directory $abspath");
+	}
+	while (defined(my $entry = readdir($dir))) {
+		if ($entry =~ /^usb\d+$/) {
+			$result = 1;
+		}
+	}
+        if (! closedir ($dir)) {
+		Base::fatal ("could not read directory $abspath");
+	}
+	return $result;
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/IdeDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/IdeDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/IdeDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,131 @@
+#!perl -w
+#
+# IdeDev -- probed values for an IDE device as found in /proc/ide
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# The probed values for an IDE device as found in /proc/ide,
+# based on the name in /sys/devices/.../ideX/X.X/block.
+#
+# path - location in sysfs
+# name - descriptive string, retrieved from device
+# media - type of device: disk, tape, ...
+# model - descriptive string, retrieved from device
+#
+# Background: hotplug is triggered when an IDE controller is
+# found on for instance the PCI bus.  The loaded module should
+# be good enough to talk to the hardware, but that does not
+# mean you can actually use it: you will also need something
+# to use the hardware driver to send IDE commands over the
+# IDE cable to the controller on the other end of the cable.
+# Those commands also have to make sense: a disk controller
+# uses a different set of IDE commands than an IDE tape controller.
+# The ide-disk, ide-cdrom etc modules are the protocol drivers
+# that handle this.
+#
+# Ide-generic is special: it does not talk to the device at the far end
+# of the cable, but to the chipset at the near end.  It manages a lot of
+# different devices (in fact can function as a default for any PCI IDE
+# chipset) but does not come with modalias to attest to that capability.
+# When ide-disk is seen, load ide-generic as well.  The effect is that if
+# there was no specific driver for the PCI chipset, ide-generic will
+# function as a default.
+#
+# The following detection is based on an ide.rc script by Marco d'Itri
+# that was not included in hotplug.  Note that some CDROMs may need
+# ide-generic in addition to ide-cdrom to work; that can be considered
+# a driver bug rather than a valid dependency.  Note that there is discussion
+# over whether ide-generic should grab otherwise unhandled IDE devices.
+# - http://thread.gmane.org/gmane.linux.hotplug.devel/6003
+# - http://lists.debian.org/debian-kernel/2004/11/msg00218.html
+# - http://www.ussg.iu.edu/hypermail/linux/kernel/0410.1/1452.html
+#
+# Hmm, via82cxxx (2.6.8) also needs ide-generic to load it seems.  That could
+# be because ide-generic contains a call to ide_probe_init() which is in
+# the ide-core module.  Or it could be because the IDE part of the chip
+# is managed by ide-generic.
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+package IdeDev;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('path');
+	my $path = $self->path;
+	my $link = readlink ("$path/block");
+	if (! defined ($link)) {
+		Base::fatal ("no link to block device in $path");
+	}
+	if ($link !~ m!.*/([^/]+)!) {
+		Base::fatal ("malformed link to block device in $path");
+	}
+	my $name = $1;
+	my $ideDir = Conf::get('procFs') . "/ide";
+	$self->{name} = $name;
+	$self->{media} = Base::getStringFile ("$ideDir/$name/media");
+	$self->{model} = Base::getStringFile ("$ideDir/$name/model");
+}
+
+sub path	{ return $_[0]->{path}; }
+sub name	{ return $_[0]->{name}; }
+sub media	{ return $_[0]->{media}; }
+sub model	{ return $_[0]->{model}; }
+
+sub string {
+	my $self = shift;
+	my $path = $self->path();
+	my $name = $self->name();
+	my $media = $self->media();
+	my $model = $self->model();
+	return "$name ($media) = $model at $path";
+}
+
+
+#
+# findModuleByIdeDev -- list of suitable IDE drivers;
+# you need all of them.
+#
+sub findModuleByIdeDev ($) {
+	my ($ideDev) = @_;
+	my $media = $ideDev->media();
+	my $result = [];
+	if (! KConfig::isOmitted ("ide-generic")) {
+		# Supply ide-generic as default chipseet driver only if
+		# it was compiled into the kernel.
+		push @{$result}, "ide-generic";
+	}
+	
+	my $driver;
+	$driver = "ide-disk" if ($media eq "disk");
+	$driver = "ide-tape" if ($media eq "tape");
+	$driver = "ide-cd" if ($media eq "cdrom");
+	$driver = "ide-floppy" if ($media eq "floppy");
+	if (defined ($driver)) {
+		push @{$result}, $driver;
+	}
+
+	return $result;
+}
+
+
+1;
+

Added: dists/trunk/utils/yaird/perl/Image.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Image.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Image.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,287 @@
+#!perl -w
+#
+# Image -- what should go on the initrd image
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Note: consider keeping origin information with files on the image,
+# so that we can give more precise error messages if some file cannot
+# be copied to the image.
+#
+use strict;
+use warnings;
+use SharedLibraries;
+use File::Copy;
+use Base;
+package Image;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->{directories} = {};
+	$self->{files} = {};
+	$self->{devices} = {};
+	$self->{symlinks} = {};
+	$self->{scripts} = {};
+}
+
+#
+# addFile -- mark listed file, it should be copied to image.
+# If we add a symlink, make sure it stays a symlink in the target
+# image, and that both link and target are included.  This matters
+# eg for LVM, that has lots of symlinks to a single executable,
+# with behaviour determined by the name of the link.
+#
+sub addFile {
+	my ($self, $file, $origin) = @_;
+	Base::assert (Base::isAbsolute ($file));
+
+	# avoid problems with adding /lib/modules/. or
+	# distinguishing between /bin and //bin.
+	$file = Base::canon($file);
+
+	$self->addParents ($file);
+	if (-l $file) {
+		if (! exists ($self->{symlinks}{$file})) {
+			# careful: in order to break loops, we must
+			# first mark the symlink, *then* follow it.
+			# We cannot warn, since we do not know whether
+			# the symlink was found in the course of symlink
+			# resolution, or whether multiple executables
+			# have the same symlink as a shared library.
+			#
+			# NOTE: Perhaps maintain an explicit stack of
+			# symlinks being resolved in order to be able
+			# to warn about loops?
+			#
+			my $link = readlink ($file);
+			if (! defined ($link)) {
+				Base::fatal ("could not follow symlink $file ($origin)");
+			}
+			if ($link !~ m!^([\w./-]+)$!) {
+				# taint check.
+				Base::fatal ("Strange character in symlink target for $file ($origin)");
+			}
+			$link = $1;
+
+			Base::debug ("to image: $file (symlink) ($origin)");
+			$self->{symlinks}{$file} = $link;
+			my $target = Base::expandLink ($file);
+			$self->addFile ($target, $origin);
+		}
+	}
+	elsif (-b $file) {
+		my $devno = Base::devno ($file);
+		Base::debug ("to image: $file (blockdev) ($origin)");
+		$self->{devices}{$file} = "b:$devno";
+	}
+	elsif (-c $file) {
+		my $devno = Base::devno ($file);
+		Base::debug ("to image: $file (chardev) ($origin)");
+		$self->{devices}{$file} = "c:$devno";
+	}
+	elsif (-d $file) {
+		$self->addDirectory ($file, $origin);
+	}
+	elsif (-f $file) {
+		Base::debug ("to image: $file ($origin)");
+		$self->{files}{$file}++;
+		if (-x $file) {
+			$self->addLibraries ($file, $origin);
+		}
+	}
+	elsif (! -e $file) {
+		Base::fatal ("missing file requested for image: $file ($origin)");
+	}
+	else {
+		Base::fatal ("odd file mode: $file ($origin)");
+	}
+}
+
+
+#
+# addDirectory -- add a directory to the image
+# the difference with addFile ($dir) is that the directory
+# does not have to exist on the mother system.
+#
+sub addDirectory {
+	my ($self, $directory, $origin) = @_;
+	Base::assert (Base::isAbsolute ($directory));
+
+	$self->addParents ($directory);
+	Base::debug ("to image: $directory (directory) ($origin)");
+	$self->{directories}{$directory}++;
+}
+
+
+#
+# addParents -- given a pathname to be included on
+# initrd image, ensure that parent directories are also created.
+#
+sub addParents {
+	my ($self, $path) = @_;
+	Base::assert (Base::isAbsolute ($path));
+
+	my @components = split (/\/+/, $path);
+	for my $idx (1 .. ($#components -1)) {
+		my $dir = join ('/', @components[0 .. $idx]);
+		$self->{directories}{$dir}++;
+	}
+}
+
+#
+# addTree -- add a tree to the image
+# this is an existing file or directory with everything in it.
+# NOTE: There's a trade-off here: it would be faster to defer walking
+# the tree to the actual writing of the tree, but that would require
+# duplicating the addFile checks on file type.  2.6.10 has 1700 files
+# in /lib/modules; I expect the overhead to be acceptable.
+#
+sub addTree {
+	my ($self, $treeName, $origin) = @_;
+
+	$self->addFile ($treeName);
+	if (-d $treeName && ! -l $treeName) {
+		my $dir;
+		if (! opendir ($dir, $treeName)) {
+			Base::fatal ("can't open directory $treeName ($origin)");
+		}
+		while (defined(my $entry = readdir($dir))) {
+			next if $entry eq ".";
+			next if $entry eq "..";
+			my $path = "$treeName/$entry";
+			$self->addTree ($path, $origin);
+		}
+		if (! closedir ($dir)) {
+			Base::fatal ("could not read directory $treeName ($origin)");
+		}
+	}
+}
+
+
+#
+# addLibraries -- given an executable to be included on
+# initrd image, ensure that shared libraries are also included.
+# If the executable is a shell script or statically linked,
+# nothing needs to be done.
+#
+sub addLibraries {
+	my ($self, $executable, $origin) = @_;
+	my $in;
+
+	for my $lib (@{SharedLibraries::find ($executable)}) {
+		$self->addFile ($lib, $origin);
+	}
+}
+
+#
+# addScriptLine -- given scriptname and text, append text to the
+# text to be included in script.
+#
+sub addScriptLine {
+	my ($self, $scriptname, $text, $origin) = @_;
+	Base::assert (Base::isAbsolute ($scriptname));
+
+	$self->addParents ($scriptname);
+	$self->{scripts}{$scriptname} .= "$text";
+}
+
+
+#
+# buildHere -- given pathname of a destination directory,
+# create that directory, with all files and scripts prescribed
+# by self in it.
+# The top directory is expected to be created by File::Temp::tempfile.
+#
+sub buildHere {
+	my ($self, $dest) = @_;
+
+	if (! -d $dest) {
+		Base::fatal ("Build directory not found: $dest");
+	}
+	if (! chmod (0755, $dest)) {
+		Base::fatal ("Could not chmod $dest");
+	}
+
+	for my $d (sort keys %{$self->{directories}}) {
+		if (! mkdir ("$dest$d")) {
+			Base::fatal ("Could not mkdir $dest$d");
+		}
+		if (! chmod (0755, "$dest$d")) {
+			Base::fatal ("Could not chmod $dest$d");
+		}
+	}
+
+	for my $f (sort keys %{$self->{files}}) {
+		if (! File::Copy::copy ($f, "$dest$f")) {
+			Base::fatal ("Could not copy $f to $dest$f");
+		}
+		if (-x $f) {
+			if (! chmod (0555, "$dest$f")) {
+			    Base::fatal ("Could not chmod 0555 $dest$f");
+			}
+		}
+		else {
+			if (! chmod (0444, "$dest$f")) {
+			    Base::fatal ("Could not chmod 0444 $dest$f");
+			}
+		}
+	}
+
+	for my $d (sort keys %{$self->{devices}}) {
+		my $typDevno = $self->{devices}{$d};
+		if ($typDevno =~ /^(b|c):(\d+):(\d+)$/) {
+			#
+			# permission 0600 is restrictive but sufficient:
+			# the devices created here are used only by root
+			# on a temporary root, so we can get away with
+			# /dev/null mode 0600.  More permissive modes
+			# risk ending up with a /dev/hda1 0666 somewhere
+			# in a temporary directory.
+			#
+			if (system ("/bin/mknod -m 0600 '$dest$d' $1 $2 $3") != 0) {
+				Base::fatal ("Could not mknod $dest$d $1 $2 $3");
+			}
+		}
+		else {
+			Base::bug ("bad devno $typDevno for $d");
+		}
+	}
+
+	for my $l (sort keys %{$self->{symlinks}}) {
+		my $target = $self->{symlinks}{$l};
+		if (! symlink ($target, "$dest/$l")) {
+			Base::fatal ("Could symlink $target $dest$l");
+		}
+	}
+
+	for my $scriptname (sort keys %{$self->{scripts}}) {
+		my $script = $self->{scripts}{$scriptname};
+		if (!open (OUT, ">", "$dest$scriptname")) {
+			Base::fatal ("Can't create $dest$scriptname");
+		}
+		print OUT "$script";
+		if (!close (OUT)) {
+			Base::fatal ("Could not write $dest$scriptname");
+		}
+		if (! chmod (0555, "$dest$scriptname")) {
+			Base::fatal ("Couldn't chmod 0555 $dest$scriptname");
+		}
+	}
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Input.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Input.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Input.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,104 @@
+#!perl -w
+#
+# Input - a single device from the input layer
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# info - info provided by low level driver for module matching
+# name - provided by driver
+# phys - provided by driver, no relation to sysfs location
+# handlers - input layer handlers
+# capabilities - kind of events that can be generated
+# hw - ...
+#
+# Handler 'kbd' indicates the device is used for console;
+# there is also a generic handler for each device, event\d+,
+# that may have a link to underlying sysfs device.
+# Capability KEY indicates there are buttons, this includes
+# both qwerty keys and the fire button on a joystick.
+#
+
+use strict;
+use warnings;
+use Base;
+use Conf;
+package Input;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('info', 'name', 'phys', 'handlers', 'capabilities');
+
+	#
+	# Find hardware link, if any.
+	#
+	$self->{hw} = undef;
+	for my $handler (keys %{$self->handlers}) {
+		if ($handler !~ /^event\d+$/) {
+			next;
+		}
+		my $devLink = Conf::get('sysFs')
+			. "/class/input/$handler/device";
+		my $hw = readlink ($devLink);
+		if (defined ($hw)) {
+			unless ($hw =~ s!^(\.\./)+devices/!!) {
+				# imagine localised linux (/sys/geraete ...)
+				Base::fatal ("bad device link in $devLink");
+			}
+			$self->{hw} = $hw;
+		}
+	}
+}
+
+sub info	{ return $_[0]->{info}; }
+sub name	{ return $_[0]->{name}; }
+sub phys	{ return $_[0]->{phys}; }
+sub handlers	{ return $_[0]->{handlers}; }
+sub capabilities	{ return $_[0]->{capabilities}; }
+sub hw		{ return $_[0]->{hw}; }
+
+sub string {
+	my $self = shift;
+	my $name = $self->name;
+	my $phys = $self->phys;
+	my $hw = $self->hw;
+	$hw = "--" unless defined $hw;
+	my $h = join (",", keys %{$self->handlers});
+	my $c = join (",", keys %{$self->capabilities});
+	my $kbd = $self->isKbd ? " (KBD)" : "";
+	my $str = "$name is $phys at $hw [$h] [$c]$kbd";
+	return $str;
+}
+
+#
+# isKbd -- device may be useful to get an operational keyboard.
+# This is conservative: there are two input devices for a DELL USB
+# keyboard for example, and we make no effort to determine if
+# we can leave one of them out.
+#
+sub isKbd {
+	my $self = shift;
+	if (! exists ($self->capabilities->{KEY})) {
+		return 0;
+	}
+	if (! exists ($self->handlers->{kbd})) {
+		return 0;
+	}
+	return 1;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/InputTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/InputTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/InputTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,99 @@
+#!perl -w
+#
+# InputTab -- encapsulate /proc/bus/input/devices
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+
+use strict;
+use warnings;
+use Base;
+use Conf;
+use Input;
+
+package InputTab;
+
+my $inputList = undef;
+
+sub init () {
+	if (defined ($inputList)) {
+		return;
+	}
+	$inputList = [];
+	my $name = Conf::get('procFs') . '/bus/input/devices';
+	if (! open (IN, "<", "$name")) {
+		Base::fatal ("can't open $name");
+	}
+	my $work = {
+		capabilities => {},
+	};
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		if ($line =~ /^I: (.*)$/) {
+			$work->{info} = $1;
+		}
+		elsif ($line =~ /^N: Name="(.*)"$/) {
+			$work->{name} = $1;
+		}
+		elsif ($line =~ /^P: Phys=(.*)$/) {
+			$work->{phys} = $1;
+		}
+		elsif ($line =~ /^H: Handlers=(.*)$/) {
+			my @handlers = split (/\s+/, $1);
+			$work->{handlers} = {};
+			for my $h (@handlers) {
+				$work->{handlers}{$h}++;
+			}
+		}
+		elsif ($line =~ /^B: ([A-Z]+)=(.*)$/) {
+			$work->{capabilities}{$1} = $2;
+		}
+		elsif ($line =~ /^$/) {
+			if (! exists ($work->{info})) {
+				Base::fatal ("missing I: in $name");
+			}
+			if (! exists ($work->{name})) {
+				Base::fatal ("missing N: in $name");
+			}
+			if (! exists ($work->{phys})) {
+				Base::fatal ("missing P: in $name");
+			}
+			if (! exists ($work->{handlers})) {
+				Base::fatal ("missing H: in $name");
+			}
+			push @{$inputList}, Input->new (%{$work});
+			$work = {
+				capabilities => {},
+			};
+		}
+		else {
+			Base::fatal ("unrecognised line in $name: $line");
+		}
+
+	}
+	if (! close (IN)) {
+		Base::fatal ("could not read $name");
+	}
+}
+
+sub all	() {
+	init;
+	return $inputList;
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/KConfig.pm
===================================================================
--- dists/trunk/utils/yaird/perl/KConfig.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/KConfig.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,252 @@
+#!perl -w
+#
+# KConfig -- encapsulate kernel configuration file and builtin modules
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# KConfig is a mapping from kernel define symbol to value.
+# Common values are 'y' (compiled in), 'm' modular.
+# The "no" choice in kernel configuration is represented by absence of the
+# symbol.  Other values (for example decimal or hex numbers) also occur.
+#
+# We also maintain a list of known modules and corresponding kernel define.
+# If the define is 'y', we need not load the corresponding module.
+# This is not relevant to hardware (if a PCI controller is builtin,
+# it will not occur in modules.pcimap, so no loading is attempted),
+# but it does help with filesystems, where an 'ext3' line in /etc/fstab
+# means the ext3 module needs to be loaded unless its compiled in.
+#
+
+use strict;
+use warnings;
+use Base;
+use Conf;
+package KConfig;
+
+my $kConfMap = undef;
+my $kConfList = undef;
+
+sub init () {
+	if (defined ($kConfMap)) {
+		return;
+	}
+	$kConfMap = {};
+	my $name = Conf::get('kernConf');
+	if (! open (IN, "<", "$name")) {
+		Base::fatal ("can't open kernel config file $name");
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/^\s+//;
+		$line =~ s/\s+$//;
+		$line =~ s/#.*//;
+		next if ($line eq "");
+
+		if ($line !~ /^([A-Z][A-Za-z0-9_]+)=(.+)$/) {
+			# lowercase is uncommon, but: CONFIG_SCx200=m
+			Base::fatal "bad line in $name: $line";
+		}
+		my $key = $1;
+		my $value = $2;
+		if ($value eq 'y'
+			|| $value eq 'm'
+			|| $value =~ /^-?\d+$/
+			|| $value =~ /^0x[0-9a-f]+$/
+			|| $value =~ /^"[-a-zA-Z0-9,._\/]*"$/
+		) {
+			$kConfMap->{$key} = $value;
+		}
+		else {
+			Base::fatal "bad value in $name: $line";
+		}
+	}
+	if (! close (IN)) {
+		Base::fatal "could not read kernel config file $name";
+	}
+	$kConfList = [ sort keys %{$kConfMap} ];
+}
+
+#
+# Map module name to kernel define.  Module names here
+# must use hyphen, not underscore.
+#
+my $moduleMap = {
+	# user interface devices
+	fbcon => 'FRAMEBUFFER_CONSOLE',
+	vesafb => 'FB_VESA',
+	serio => 'SERIO',
+	i8042 => 'SERIO_I8042',
+	usbhid => 'USB_HID',
+	atkbd => 'KEYBOARD_ATKBD',
+	mousedev => 'INPUT_MOUSEDEV',
+	evdev => 'INPUT_EVDEV',
+	psmouse => 'MOUSE_PS2',
+
+	# file systems
+	ext2 => 'EXT2_FS',
+	ext3 => 'EXT3_FS',
+	jbd => 'JBD',
+	reiserfs => 'REISERFS_FS',
+	jfs => 'JFS_FS',
+	xfs => 'XFS_FS',
+	minix => 'MINIX_FS',
+	romfs => 'ROMFS_FS',
+	isofs => 'ISO9660_FS',
+	udf => 'UDF_FS',
+	fat => 'FAT_FS',
+	msdos => 'MSDOS_FS',
+	vfat => 'VFAT_FS',
+	# broken, and nonmodular: umsdos => 'UMSDOS_FS',
+	ntfs => 'NTFS_FS',
+	adfs => 'ADFS_FS',
+	affs => 'AFFS_FS',
+	hfs => 'HFS_FS',
+	hfsplus => 'HFSPLUS_FS',
+	befs => 'BEFS_FS',
+	bfs => 'BFS_FS',
+	efs => 'EFS_FS',
+	jffs => 'JFFS_FS',
+	jffs2 => 'JFFS2_FS',
+	cramfs => 'CRAMFS',
+	freevxfs => 'VXFS_FS',
+	hpfs => 'HPFS_FS',
+	qnx4 => 'QNX4FS_FS',
+	sysv => 'SYSV_FS',
+	ufs => 'UFS_FS',
+	nfs => 'NFS_FS',
+	smbfs => 'SMB_FS',
+	cifs => 'CIFS',
+	ncpfs => 'NCP_FS',
+	coda => 'CODA_FS',
+	kafs => 'AFS_FS',
+
+	# network
+	'af-packet' => 'PACKET',
+
+	# device mapper: raid and lvm.
+	linear => 'MD_LINEAR',
+	raid0 => 'MD_RAID0',
+	raid1 => 'MD_RAID1',
+	raid10 => 'MD_RAID10',
+	raid5 => 'MD_RAID5',
+	raid6 => 'MD_RAID6',
+	multipath => 'MD_MULTIPATH',
+	faulty => 'MD_FAULTY',
+	md => 'BLK_DEV_MD',
+	'dm-mod' => 'BLK_DEV_DM',
+	'dm-crypt' => 'DM_CRYPT',
+	'dm-snapshot' => 'DM_SNAPSHOT',
+	'dm-mirror' => 'DM_MIRROR',
+	'dm-zero' => 'DM_ZERO',
+
+	# crypto
+	hmac => 'CRYPTO_HMAC',
+	'crypto-null' => 'CRYPTO_NULL',
+	md4 => 'CRYPTO_MD4',
+	md5 => 'CRYPTO_MD5',
+	sha1 => 'CRYPTO_SHA1',
+	sha256 => 'CRYPTO_SHA256',
+	sha512 => 'CRYPTO_SHA512',
+	wp512 => 'CRYPTO_WP512',
+	des => 'CRYPTO_DES',
+	blowfish => 'CRYPTO_BLOWFISH',
+	twofish => 'CRYPTO_TWOFISH',
+	serpent => 'CRYPTO_SERPENT',
+	aes => 'CRYPTO_AES',
+	cast5 => 'CRYPTO_CAST5',
+	cast6 => 'CRYPTO_CAST6',
+	arc4 => 'CRYPTO_ARC4',
+	tea => 'CRYPTO_TEA',
+	khazad => 'CRYPTO_KHAZAD',
+	anubis => 'CRYPTO_ANUBIS',
+	deflate => 'CRYPTO_DEFLATE',
+	'michael-mic' => 'CRYPTO_MICHAEL_MIC',
+	crc32c => 'CRYPTO_CRC32C',
+	tcrypt => 'CRYPTO_TEST',
+
+	# IDE
+	'ide-generic' => 'IDE_GENERIC',
+	'ide-disk' => 'BLK_DEV_IDEDISK',
+	'ide-cd' => 'BLK_DEV_IDECD',
+	'ide-tape' => 'BLK_DEV_IDETAPE',
+	'ide-floppy' => 'BLK_DEV_IDEFLOPPY',
+
+	# SCSI
+	'sd-mod' => 'BLK_DEV_SD',
+	'st' => 'CHR_DEV_ST',
+	'sr-mod' => 'BLK_DEV_SR',
+	'sg' => 'CHR_DEV_SG',
+};
+
+
+#
+# all -- return a list of all known configuration defines
+#
+sub all	() {
+	init;
+	return $kConfList;
+}
+
+#
+# allKnownModules -- return list of all module names for
+# which a corresponding kernel define is known.
+#
+sub allKnownModules () {
+	init;
+	return [ sort keys %{$moduleMap} ];
+}
+
+#
+# isBuiltIn -- true if the module is known to be compiled
+# into the kernel.
+#
+sub isBuiltIn ($) {
+	my ($module) = @_;
+	init;
+	$module =~ s!_!-!g;
+	my $confKey = $moduleMap->{$module};
+	if (! defined ($confKey)) {
+		return 0;
+	}
+	my $confVal = $kConfMap->{"CONFIG_$confKey"};
+	if (! defined ($confVal)) {
+		return 0;
+	}
+	return ($confVal eq 'y');
+}
+
+#
+# isOmitted -- true if the module is not part of the kernel:
+# neither compiled in nor module.
+#
+sub isOmitted ($) {
+	my ($module) = @_;
+	init;
+	$module =~ s!_!-!g;
+	my $confKey = $moduleMap->{$module};
+	if (! defined ($confKey)) {
+		# if we don't know what kernel define corresponds
+		# to the module name, we can't know whether it's
+		# compiled in.  Punt.
+		Base::bug ("broken isOmitted check for $module");
+	}
+	my $confVal = $kConfMap->{"CONFIG_$confKey"};
+	return (! defined ($confVal));
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/LabeledPartition.pm
===================================================================
--- dists/trunk/utils/yaird/perl/LabeledPartition.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/LabeledPartition.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,152 @@
+#!perl -w
+#
+# LabeledPartition -- a partition with ext2 or other label.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# descriptors contain:
+# - label - string such as volume name for matching in /etc/fstab
+# - uuid - similar but hex
+# - path - the block special file where the label was found
+# - type - what kind of superblock the label was found in.
+#
+# NOTE: consider delegating this whole mess to findfs from the
+# e2fsprogs package.  That package can probe for an extensive
+# set of superblocks, knows about LVM, but does not make fs type
+# information available via the command line.
+#
+use strict;
+use warnings;
+package LabeledPartition;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('label', 'uuid', 'path', 'type');
+}
+
+sub label	{ return $_[0]->{label}; }
+sub uuid	{ return $_[0]->{uuid}; }
+sub type	{ return $_[0]->{type}; }
+sub path	{ return $_[0]->{path}; }
+
+sub string {
+	my $self = shift;
+	my $label = ($self->label or '-');
+	my $uuid = ($self->uuid or '-');
+	my $type = $self->type;
+	my $path = $self->path;
+	return "labeled($type) $label, $uuid at $path";
+}
+
+
+#
+# try -- return descriptor for labeled fs, or undef,
+# trying a number of formats for superblock.
+#
+sub try ($) {
+	my ($path) = @_;
+	my $result = undef;
+	my $fh;
+	if (! open ($fh, "<", "$path")) {
+		return $result;
+	}
+	binmode ($fh);
+	$result = tryExt2 ($fh, $path) unless defined $result;
+	$result = tryReiser ($fh, $path) unless defined $result;
+
+	# ignore errors, could not have been very wrong
+	# if a working superblock came out of it.
+	close ($fh);
+	return $result;
+}
+
+
+#
+# lets hope the sysadm labeled it in ascii not utf8.
+# based on util-linux-2.12h mount; they have lots of other
+# superblocks to match.  Later.
+#
+sub tryExt2 ($$) {
+	my ($fh, $path) = @_;
+	my $result = undef;
+
+	if (! seek ($fh, 1024, 0)) {
+		return $result;
+	}
+	# undef on read error - is this worth a warning?
+	my $superBlock;
+	my $rc = read ($fh, $superBlock, 1024);
+	if (! defined ($rc) || $rc != 1024) {
+		return $result;
+	}
+	my ($magic, $uuid, $label) =
+		unpack
+		"x[56] v x[34] x[VVV] H[32] Z[16]",
+		$superBlock;
+
+	if ($magic == 0xEF53) {
+		$uuid = fancyUuid ($uuid);
+		$result = LabeledPartition->new (
+			type => "ext2",
+			label => $label,
+			uuid => $uuid,
+			path => $path,
+			);
+	}
+	return $result;
+}
+
+# fancyUuid - given a hex uuid, add hyphens at conventional place.
+sub fancyUuid ($) {
+	my ($uuid) = @_;
+	$uuid =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12})$/$1-$2-$3-$4-$5/;
+	return lc ($uuid);
+}
+
+sub tryReiser ($$) {
+	my ($fh, $path) = @_;
+	my $result = undef;
+	# offset in reisser 3.6 (3.5-3.5.10 had 8k)
+	if (! seek ($fh, (64*1024), 0)) {
+		return $result;
+	}
+	# undef on read error - is this worth a warning?
+	my $superBlock;
+	my $rc = read ($fh, $superBlock, 1024);
+	if (! defined ($rc) || $rc != 1024) {
+		return $result;
+	}
+	my ($magic, $uuid, $label) =
+		unpack
+		"x[52] Z[10] x[22] a[16] Z[16]",
+		$superBlock;
+	my $t = join ("", map { sprintf "%02x", ord($_) } split(//, $uuid));
+	if ($magic eq "ReIsEr2Fs" || $magic eq "ReIsEr3Fs") {
+		$uuid = fancyUuid ($uuid);
+		$result = LabeledPartition->new (
+			type => "reiserfs",
+			label => $label,
+			uuid => fancyUuid($t),
+			path => $path,
+			);
+	}
+	return $result;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/LabeledPartitionTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/LabeledPartitionTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/LabeledPartitionTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,145 @@
+#!perl -w
+#
+# LabeledPartitionTab -- all partitions with a label or uuid.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Found by looking at partitions of block devices in /sys that
+# - have hardware backing them
+# - are accessible via a block special file in /dev.
+# - like mount(8), scan in two passes: raid devices first,
+#   ignore known uuids in second scan on underlying devices.
+#
+#
+
+use strict;
+use warnings;
+use Base;
+use BlockSpecialFileTab;
+use LabeledPartition;
+package LabeledPartitionTab;
+
+my $lpTab = undef;
+my $lpList = [];
+
+
+sub init () {
+	if (defined ($lpTab)) {
+		return;
+	}
+
+	$lpTab = {};
+	for my $pass (0, 1) {
+		for my $abd (@{ActiveBlockDevTab::all()}) {
+			my $name = $abd->name();
+			my $devno = $abd->devno();
+			my $paths = BlockSpecialFileTab::pathsByDevno($devno);
+			if (! defined ($paths)) {
+				# must be accessible via block special file
+				next;
+			}
+			next if $abd->hasPartitions();
+
+			# let's not look for labels on floppy,
+			# tends to hang.
+			# NOTE: perhaps not look for labels on any
+			# removable device, as marked by /sys?
+			next if ($name =~ /^fd\d+$/);
+
+			if (($pass == 0) == ($name =~ /^md\d+$/)) {
+				# all paths give access to the same device
+				# pick first one to actually open it.
+				my $special = $paths->[0];
+				my $descr = LabeledPartition::try ($special);
+				if (defined ($descr)) {
+					#
+					# Using a partially completed
+					# data structure.  In first pass,
+					# the list empty, so nothing found.
+					# In second pass, we look at non-raid
+					# devices, and only raid devices
+					# are in the list.
+					# The tricky part is that the list
+					# used to find existing devices
+					# is updated only at the end of the
+					# pass, so that different devices
+					# with same uuid are entered in the
+					# table and will cause a proper error
+					# message if the uuid is later used
+					# to find a device.
+					#
+					if (! findByUuid ($descr->uuid)) {
+						my $devno = $abd->devno;
+						$lpTab->{$devno} = $descr;
+					}
+				}
+			}
+		}
+		$lpList = [ values %{$lpTab} ];
+	}
+
+}
+
+sub all	() {
+	init;
+	return $lpList;
+}
+
+sub findByLabel ($) {
+	my ($label) = @_;
+	my $result = undef;
+	for my $lp (@{LabeledPartitionTab::all()}) {
+		if ($lp->label() eq $label) {
+			if (defined ($result)) {
+				Base::fatal ("duplicate file system label $label");
+			}
+			$result = $lp;
+		}
+	}
+	return $result;
+}
+
+sub findPathByLabel ($) {
+	my ($label) = @_;
+	my $lp = findByLabel ($label);
+	return $lp->path() if $lp;
+	return undef;
+}
+
+sub findByUuid ($) {
+	my ($uuid) = @_;
+	my $result = undef;
+	$uuid = lc ($uuid);
+	for my $lp (@{LabeledPartitionTab::all()}) {
+		if ($lp->uuid() eq $uuid) {
+			if (defined ($result)) {
+				Base::fatal ("duplicate file system uuid $uuid");
+			}
+			$result = $lp;
+		}
+	}
+	return $result;
+}
+
+sub findPathByUuid ($) {
+	my ($uuid) = @_;
+	my $lp = findByUuid ($uuid);
+	return $lp->path() if $lp;
+	return undef;
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/LogicalVolume.pm
===================================================================
--- dists/trunk/utils/yaird/perl/LogicalVolume.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/LogicalVolume.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,50 @@
+#!perl -w
+#
+# LogicalVolume -- Logical Volume Descriptor
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# lvnam - logical volume name
+# vgnam - volume group name
+# devno - "major:minor"
+#
+
+use strict;
+use warnings;
+package LogicalVolume;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('lvnam', 'vgnam', 'devno');
+}
+
+sub lvnam	{ return $_[0]->{lvnam}; }
+sub vgnam	{ return $_[0]->{vgnam}; }
+sub devno	{ return $_[0]->{devno}; }
+
+sub string {
+	my $self = shift;
+	my $lvnam = $self->lvnam;
+	my $vgnam = $self->vgnam;
+	my $devno = $self->devno;
+	my $str = "$lvnam in $vgnam at $devno";
+	return $str;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/LvmTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/LvmTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/LvmTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,246 @@
+#!perl -w
+#
+# LvmTab -- encapsulate LVM output
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# The trick here is to find all block devices that back a physical
+# volume that is part of a volume group, where in that volume group
+# there is a logical volume with maj:min that contains a filesystem
+# to be mounted at boot time.  In particular, if there are two
+# volume groups, one for OS and one for database, you don't want
+# the modules for the database drives on your initrd image.
+#
+# If no LVM executables are found on init, the internal maps are
+# set to empty (as opposed to undefined).  No error is generated.
+#
+# NOTE: There seem to be newer reporting tools (vgs, lvs, pvs)
+# that produce more flexible reports for easier grepping than with
+# the commands used here.
+#
+use strict;
+use warnings;
+use Base;
+use LogicalVolume;
+use VolumeGroup;
+use PhysicalVolume;
+package LvmTab;
+
+
+my $lvMap = undef;
+my $vgMap = undef;
+my $pvMap = undef;
+my $lvList = undef;
+my $vgList = undef;
+my $pvList = undef;
+
+sub init () {
+	if (defined ($lvMap)) {
+		return;
+	}
+	initLvMap ();
+	initVgMap ();
+	initPvMap ();
+	$lvList = [ values %{$lvMap} ];
+	$vgList = [ values %{$vgMap} ];
+	$pvList = [ values %{$pvMap} ];
+}
+
+sub allLogicalVolumes () {
+	init;
+	return $lvList;
+}
+
+sub allVolumeGroups () {
+	init;
+	return $vgList;
+}
+
+sub allPhysicalVolumes () {
+	init;
+	return $pvList;
+}
+
+sub findLVByDevno ($) {
+	init;
+	return $lvMap->{$_[0]};
+}
+
+sub findVGByVgnam ($) {
+	init;
+	return $vgMap->{$_[0]};
+}
+
+sub findPVsByVgnam ($) {
+	my ($vgnam) = @_;
+	my $result = [];
+	for my $pv (@{allPhysicalVolumes()}) {
+		if ($pv->vgnam() eq $vgnam) {
+			push @{$result}, $pv;
+		}
+	}
+	return $result;
+}
+
+#
+# findPhysicalVolumePathsByLVDevno -- return a list of special file names
+# that make up the physical volumes underlying a logical volume
+# identified by maj:min, or undef if the devno seems not to be
+# implemented by lvm.
+#
+sub findPVPathsByLVDevno ($) {
+	my ($devno) = @_;
+	my $lv = LvmTab::findLVByDevno ($devno);
+	if (! defined ($lv)) {
+		return undef;
+	}
+	my $vgnam = $lv->vgnam();
+	if (! defined (LvmTab::findVGByVgnam($vgnam))) {
+		Base::fatal ("unknown LVM volume group $vgnam for Logical Volume $devno");
+	}
+	my $result = [];
+	for my $pv (@{LvmTab::findPVsByVgnam ($vgnam)}) {
+		push @{$result}, $pv->pvnam();
+	}
+	return $result;
+}
+
+
+# build map from devno to logical volume descriptor,
+# built on lvdisplay.
+#
+# /dev/vg0/root:vg0:3:1:-1:1:2097152:256:-1:0:0:254:0
+#
+sub initLvMap () {
+	$lvMap = {};
+	if (! open (IN, "-|", "lvdisplay -c 2> /dev/null")) {
+		Base::debug ("can't run lvdisplay");
+		return;
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/^\s*//;
+		my @fields = split (/:/, $line, 500);
+		if ($#fields != 12) {
+			Base::fatal ("malformed output from lvdisplay");
+		}
+		my $lvnam = $fields[0];
+		my $vgnam = $fields[1];
+		# Hide this, since lvdisplay output is inconsistent with docs.
+		my $lvsiz = $fields[6];
+		my $major = $fields[11];
+		my $minor = $fields[12];
+		if ($major !~ /^\d+$/) {
+			Base::fatal ("malformed output (major) from lvdisplay");
+		}
+		if ($minor !~ /^\d+$/) {
+			Base::fatal ("malformed output (minor) from lvdisplay");
+		}
+		my $devno = "$major:$minor";
+		if (exists ($lvMap->{$devno})) {
+			Base::fatal ("duplicate output ($devno) from lvdisplay");
+		}
+		$lvMap->{$devno} = LogicalVolume->new (
+			lvnam => $lvnam,
+			vgnam => $vgnam,
+			devno => $devno,
+			);
+	}
+	if (! close (IN)) {
+		Base::fatal ("error running lvdisplay");
+	}
+}
+
+# build map from vgnam to volume group descriptor,
+# built on vgdisplay.
+#
+#  vg0:r/w:772:-1:0:7:6:-1:0:1:1:77799424:4096: \
+#  	18994:6912:12082:MO1svc-uvVC-TFCL-qvrB-29wD-bh9K-V2e3U2
+#
+sub initVgMap () {
+	$vgMap = {};
+	if (! open (IN, "-|", "vgdisplay -c 2> /dev/null")) {
+		Base::debug ("can't run vgdisplay");
+		return;
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/^\s*//;
+		my @fields = split (/:/, $line, 500);
+		if ($#fields != 16) {
+			Base::fatal ("malformed output from vgdisplay");
+		}
+		my ($vgnam, $vgacc, $vgstat,
+			$vgnum, $maxlv, $curlv, $openlv,
+			$maxlvsiz, $maxpvcnt, $curpvcnt, $actpvcnt,
+			$vgsiz, $extsiz, $extcnt, $extalloc, $extfree,
+			$uuid)
+			= @fields;
+
+		if (exists ($vgMap->{$vgnam})) {
+			Base::fatal ("duplicate output ($vgnam) from vgdisplay");
+		}
+		$vgMap->{$vgnam} = VolumeGroup->new (
+			vgnam => $vgnam,
+			uuid => $uuid,
+			);
+	}
+	if (! close (IN)) {
+		Base::fatal ("error running vgdisplay");
+	}
+}
+
+# build map from pvnam to physical volume descriptor,
+# built on pvdisplay.
+#
+#  /dev/sda3:vg0:155598848:-1:8:8:-1:4096:18994: \
+#  	12082:6912:X5hDer-dYpy-jpAB-IhXQ-44j4-kyj0-cOQkyE
+#
+sub initPvMap () {
+	$pvMap = {};
+	if (! open (IN, "-|", "pvdisplay -c 2> /dev/null")) {
+		Base::debug ("can't run pvdisplay");
+		return;
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/^\s*//;
+		my @fields = split (/:/, $line, 500);
+		if ($#fields != 11) {
+			Base::fatal ("malformed output from pvdisplay");
+		}
+		my ($pvnam,$vgnam,$pvsiz,$pvnum,$pvstat,
+			$pvalloc,$lvcnt,$extsiz,$extcnt,
+			$extfree,$extalloc,$uuid)
+			= @fields;
+
+		if (exists ($pvMap->{$pvnam})) {
+			Base::fatal ("duplicate output ($pvnam) from vgdisplay");
+		}
+		$pvMap->{$pvnam} = PhysicalVolume->new (
+			pvnam => $pvnam,
+			vgnam => $vgnam,
+			uuid => $uuid,
+			);
+	}
+	if (! close (IN)) {
+		Base::fatal ("error running pvdisplay");
+	}
+}
+
+1;
+
+

Added: dists/trunk/utils/yaird/perl/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/perl/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,91 @@
+# 
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+
+include ../Makefile.incl
+
+sbin_SCRIPTS	= yaird
+CLEANFILES	= $(sbin_SCRIPTS) Conf.pm
+
+edit =	sed \
+	-e 's!@PERL\@!$(PERL)!' \
+	-e 's!@PACKAGE\@!$(PACKAGE)!' \
+	-e 's!@VERSION\@!$(VERSION)!' \
+	-e 's!@AUXDIR\@!$(auxdir)!' \
+	-e 's!@CFGDIR\@!$(configdir)!' \
+	-e 's!@PERLDIR\@!$(perldir)!'
+
+yaird:	main.pl
+	$(edit) < $< > $@
+	chmod ugo+x $@
+
+Conf.pm: Conf.pm.in
+	$(edit) < $< > $@
+
+# not compiled, but must go in the tarball.
+EXTRA_DIST = \
+	main.pl \
+	Conf.pm.in
+
+nodist_perl_DATA = \
+	Conf.pm
+
+dist_perl_DATA = \
+	ActionList.pm \
+	ActiveBlockDev.pm \
+	ActiveBlockDevTab.pm \
+	Base.pm \
+	Blacklist.pm \
+	BlockSpecialFileTab.pm \
+	CryptEntry.pm \
+	CryptTab.pm \
+	FsEntry.pm \
+	FsOpts.pm \
+	FsTab.pm \
+	Hardware.pm \
+	IdeDev.pm \
+	Image.pm \
+	Input.pm \
+	InputTab.pm \
+	KConfig.pm \
+	LabeledPartition.pm \
+	LabeledPartitionTab.pm \
+	LogicalVolume.pm \
+	LvmTab.pm \
+	ModProbe.pm \
+	NetDev.pm \
+	NetDevTab.pm \
+	Obj.pm \
+	Opts.pm \
+	Pack.pm \
+	Parser.pm \
+	PciDev.pm \
+	PciMapEntry.pm \
+	PciTab.pm \
+	PhysicalVolume.pm \
+	Plan.pm \
+	RaidDev.pm \
+	RaidTab.pm \
+	ScsiDev.pm \
+	SharedLibraries.pm \
+	TestSet.pm \
+	UsbDev.pm \
+	UsbMapEntry.pm \
+	UsbTab.pm \
+	VolumeGroup.pm
+

Added: dists/trunk/utils/yaird/perl/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/perl/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,471 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+# 
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(dist_perl_DATA) $(srcdir)/../Makefile.incl \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = perl
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(perldir)" \
+	"$(DESTDIR)$(perldir)"
+sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(sbin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+dist_perlDATA_INSTALL = $(INSTALL_DATA)
+nodist_perlDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_perl_DATA) $(nodist_perl_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf
+sbin_SCRIPTS = yaird
+CLEANFILES = $(sbin_SCRIPTS) Conf.pm
+edit = sed \
+	-e 's!@PERL\@!$(PERL)!' \
+	-e 's!@PACKAGE\@!$(PACKAGE)!' \
+	-e 's!@VERSION\@!$(VERSION)!' \
+	-e 's!@AUXDIR\@!$(auxdir)!' \
+	-e 's!@CFGDIR\@!$(configdir)!' \
+	-e 's!@PERLDIR\@!$(perldir)!'
+
+
+# not compiled, but must go in the tarball.
+EXTRA_DIST = \
+	main.pl \
+	Conf.pm.in
+
+nodist_perl_DATA = \
+	Conf.pm
+
+dist_perl_DATA = \
+	ActionList.pm \
+	ActiveBlockDev.pm \
+	ActiveBlockDevTab.pm \
+	Base.pm \
+	Blacklist.pm \
+	BlockSpecialFileTab.pm \
+	CryptEntry.pm \
+	CryptTab.pm \
+	FsEntry.pm \
+	FsOpts.pm \
+	FsTab.pm \
+	Hardware.pm \
+	IdeDev.pm \
+	Image.pm \
+	Input.pm \
+	InputTab.pm \
+	KConfig.pm \
+	LabeledPartition.pm \
+	LabeledPartitionTab.pm \
+	LogicalVolume.pm \
+	LvmTab.pm \
+	ModProbe.pm \
+	NetDev.pm \
+	NetDevTab.pm \
+	Obj.pm \
+	Opts.pm \
+	Pack.pm \
+	Parser.pm \
+	PciDev.pm \
+	PciMapEntry.pm \
+	PciTab.pm \
+	PhysicalVolume.pm \
+	Plan.pm \
+	RaidDev.pm \
+	RaidTab.pm \
+	ScsiDev.pm \
+	SharedLibraries.pm \
+	TestSet.pm \
+	UsbDev.pm \
+	UsbMapEntry.pm \
+	UsbTab.pm \
+	VolumeGroup.pm
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../Makefile.incl $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  perl/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  perl/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_SCRIPTS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f $$d$$p; then \
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	    echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+	    $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-sbinSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_SCRIPTS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	  echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(sbindir)/$$f"; \
+	done
+uninstall-info-am:
+install-dist_perlDATA: $(dist_perl_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(perldir)" || $(mkdir_p) "$(DESTDIR)$(perldir)"
+	@list='$(dist_perl_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(dist_perlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(perldir)/$$f'"; \
+	  $(dist_perlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(perldir)/$$f"; \
+	done
+
+uninstall-dist_perlDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_perl_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(perldir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(perldir)/$$f"; \
+	done
+install-nodist_perlDATA: $(nodist_perl_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(perldir)" || $(mkdir_p) "$(DESTDIR)$(perldir)"
+	@list='$(nodist_perl_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(nodist_perlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(perldir)/$$f'"; \
+	  $(nodist_perlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(perldir)/$$f"; \
+	done
+
+uninstall-nodist_perlDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_perl_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(perldir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(perldir)/$$f"; \
+	done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(perldir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_perlDATA install-nodist_perlDATA
+
+install-exec-am: install-sbinSCRIPTS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_perlDATA uninstall-info-am \
+	uninstall-nodist_perlDATA uninstall-sbinSCRIPTS
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-dist_perlDATA install-exec install-exec-am \
+	install-info install-info-am install-man \
+	install-nodist_perlDATA install-sbinSCRIPTS install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am uninstall uninstall-am uninstall-dist_perlDATA \
+	uninstall-info-am uninstall-nodist_perlDATA \
+	uninstall-sbinSCRIPTS
+
+
+yaird:	main.pl
+	$(edit) < $< > $@
+	chmod ugo+x $@
+
+Conf.pm: Conf.pm.in
+	$(edit) < $< > $@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: dists/trunk/utils/yaird/perl/ModProbe.pm
===================================================================
--- dists/trunk/utils/yaird/perl/ModProbe.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/ModProbe.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,159 @@
+#!perl -w
+#
+# ModProbe -- insert modules plus dependencies
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# This uses modprobe to determine which files to load to get a certain
+# module.  It adds two extra features:
+#  - do not load blacklisted modules
+#  - if we know a module is compiled into the kernel,
+#    don't attempt to load it, and don't complain.
+#
+# Notes on the behaviour of modprobe:
+#
+#   modprobe --verbose --dry-run --show-depends --set-version 2.6.11 aes
+#
+# shows the files that are needed, regardless of whether they are
+# already loaded.  Lines start with 'insmod ' for files to be loaded,
+# or 'install ' for commands to be executed.
+#
+# Modprobe file format:
+#  - characters are bytes, no messing with utf-8.
+#  - backslash at end of line merges lines
+#  - other \x get replaced by x
+#  - ^\s*# lines are ignored
+#  - lines without : are ignored.
+# This means "aap: noot.#7" is a valid dependency.
+# The backslash interpretation is mostly for modprobe.conf;
+# depmod does not generate it.
+#
+# Modprobe determines module name by dropping everything after dot:
+# "/lib/noot.#7" is module "noot".  We'll adopt the same policy.
+#
+# Depmod only grabs modules ending in .ko or .ko.gz.
+#
+# Note that modprobe does not discriminate against modules outside
+# /lib/modules: if it's listed in modules.dep, it's a valid module.
+#
+# Note that redhat has a convention that modules in .../update take
+# precedence over other modules with the same name.  Depmod implements
+# this by not putting modules that are overridden in modules.dep.
+# Thus modprobe needs no special action to support that convention.
+#
+# The logic modprobe uses to determine which modules to load:
+# - replace hyphens with underscore
+# - read config specified on command line,
+#   OR modprobe.conf OR modprobe.d, only first one found.
+#   Remember all "install" and "option" directives,
+#   rewrite module name if an alias matches
+# - if no alias found and the name is of the form 'symbol:xxx':
+# 	look in modules.symbols to resolve to a module name
+# - if alias found:
+#	make a list of modules to load, based on modules.dep
+# - else:
+#	make a list of modules to load, based on modules.dep
+#	if that turned up no modules AND there was no install cmd:
+#		- look in modules.aliases to resolve to modulename
+#		- make a list of modules to load, based on modules.dep
+# - if the list to load is empty AND there was no install command:
+# 	- complain.
+# # in insmod():
+# - recurse over the module list, most basic stuff first, doing:
+# 	- if there is a command for this module name:
+# 		execute it
+# 	- else:
+#		load the module
+#
+# Loading of the module is done with a system call.  The option string
+# is passed as third argument; splitting the option string in separate
+# module options is done in the kernel.  Double quote escapes spaces,
+# double quotes themselves cannot be escaped.
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+use ActionList;
+use Blacklist;
+use KConfig;
+package ModProbe;
+
+
+#
+# addModules -- given an actionList and list of modules,
+# add actions to load all modules, plus their dependencies,
+# unless blacklisted or compiled in.
+#
+sub addModules ($$) {
+	my ($actionList, $modList) = @_;
+
+	for my $moduleName (@{$modList}) {
+		if (Blacklist::isBlacklisted ($moduleName)) {
+			next;
+		}
+		if (KConfig::isBuiltIn ($moduleName)) {
+			next;
+		}
+		addOneModule ($actionList, $moduleName);
+	}
+}
+
+
+#
+# addOneModule -- for one module, that is not blacklisted or compiled in,
+# add actions to load it plus all its dependencies.
+#
+sub addOneModule ($$) {
+	my ($actionList, $m) = @_;
+	my $v = Conf::get('version');
+	my $cmd = "/sbin/modprobe -v -n --show-depends --set-version $v $m";
+	if (! open (IN, "-|", "$cmd 2> /dev/null")) {
+		Base::fatal ("can't run modprobe");
+		return;
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/\s+$//;
+		if ($line =~ /^install (.*)/) {
+			Base::fatal ("modprobe $m requires install $1");
+		}
+		elsif ($line =~ /^insmod (\S+)$/) {
+			$actionList->add ("insmod", $1,
+				optionList => '');
+		}
+		elsif ($line =~ /^insmod (\S+)\s+(.*)$/) {
+			my $file = $1;
+			my $option = $2;
+			
+			# This should allow options in modprobe.conf
+			# to contain both ' and " characters and spaces.
+			$option =~ s![^a-zA-Z0-9,_./=-]!\\$&!g;
+
+			$actionList->add ("insmod", $file,
+				optionList => $option);
+		}
+		else {
+			Base::fatal ("modprobe $m - unsupported output $line");
+		}
+	}
+	if (! close (IN)) {
+		Base::fatal ("error running modprobe $m");
+	}
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/NetDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/NetDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/NetDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,50 @@
+#!perl -w
+#
+# NetDev - a single network device, just name, hw
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# The blockdev can be a whole device or a partition.
+# descriptors contain:
+# - name, path as found in /sys (sda, sda/sda1)
+# - hw, path to underlying hardware device,
+# 		eg an ide controller somewhere on a PCI bus.
+#		this is a path relative to /sys/devices,
+#		and can be undef (eg for ram disk)
+#
+use strict;
+use warnings;
+package NetDev;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('name', 'hw');
+}
+
+sub name	{ return $_[0]->{name}; }
+sub hw		{ return $_[0]->{hw}; }
+
+sub string {
+	my $self = shift;
+	my $name = $self->name;
+	my $hw = ($self->hw or "--");
+	return "$name at $hw";
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/NetDevTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/NetDevTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/NetDevTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,83 @@
+#!perl -w
+#
+# NetDevTab -- active network devices, based on /sys/class/net.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+use NetDev;
+package NetDevTab;
+
+
+my $netTab = undef;		# indexed by name
+my $netList = undef;
+
+
+sub init () {
+	if (defined ($netTab)) {
+		return;
+	}
+	$netTab = {};
+
+	my $netDir;
+	my $netPath = Conf::get('sysFs') . "/class/net";
+	if (! opendir ($netDir, "$netPath")) {
+		Base::fatal ("can't open directory $netPath");
+	}
+	while (defined (my $entry = readdir ($netDir))) {
+		next if $entry eq ".";
+		next if $entry eq "..";
+		oneNetDev($netPath, $entry);
+	}
+	if (! closedir ($netDir)) {
+		Base::fatal ("could not read directory $netDir");
+	}
+
+	# the sort helps eth0 get loaded before eth1
+	# no guarantee, since devices may have been renamed via udev.
+	$netList = [ sort {$a->name cmp $b->name} values %{$netTab}];
+}
+
+sub oneNetDev ($$) {
+	my ($netPath, $entry) = @_;
+	my $hw = readlink("$netPath/$entry/device");
+	# failure results in undef, which is exactly how
+	# we want to represent absence of a hw device.
+	if (defined ($hw)) {
+		unless ($hw =~ s!^(\.\./\.\./\.\./)+devices/!!) {
+			# imagine localised linux (/sys/geraete ...)
+			Base::fatal ("bad device link in $netPath/$entry");
+		}
+	}
+	my $descr = NetDev->new (
+		name => $entry,
+		hw => $hw,
+		);
+	$netTab->{$entry} = $descr;
+}
+
+#
+# all -- return list of all known active block devices.
+#
+sub all	() {
+	init;
+	return $netList;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Obj.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Obj.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Obj.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,61 @@
+#!perl -w
+#
+# Obj -- basic object stuff
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# The new() function takes a hash as argument, used to do object
+# initialisation.  Initialisation is delegated to fill() in derived
+# classes.  Fill() is expected to use takeArgs() to claim those
+# initialisation args it's interested in; other args are left for
+# fill() functions further down the inheritance chain.  Arguments
+# may have undef as value.
+#
+
+use strict;
+use warnings;
+use Base;
+package Obj;
+
+sub new {
+	my $class = shift;
+	my $self = {};
+	$self->{'_args'} = { @_ };
+	bless ($self, $class);
+	$self->fill();
+        my $bad = join (', ', keys %{$self->{'_args'}});
+	if ($bad ne '') {
+		Base::bug "Unknown constructor args: $bad";
+	}
+	return $self;
+}
+
+sub fill {
+	my $self = shift;
+	# Derived classes can claim arguments like so:
+	# self->SUPER::fill();
+	# $self->takeArgs ('a', 'b', 'c');
+}
+
+sub takeArgs {
+	my ($self, @fields) = @_;
+	for my $field (@fields) {
+		Base::assert (exists ($self->{'_args'}{$field}));
+		$self->{$field} = delete $self->{'_args'}{$field};
+	}
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Opts.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Opts.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Opts.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,68 @@
+#!perl -w
+#
+# Opts -- encapsulate options as in fstab or crypttab
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+package Opts;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+
+	$self->takeArgs ('string');
+	my @optlist = split (/,/, $self->{string});
+	my $opthash = {};
+	for my $opt (@optlist) {
+		if ($opt =~ /^(.*)=(.*)$/) {
+			$opthash->{$1} = $2;
+		}
+		else {
+			$opthash->{$opt} = undef;
+		}
+	}
+	$self->{optsHash} = $opthash;
+}
+
+#
+# exists -- the option occurs, possibly with undef value.
+#
+sub exists {
+	my ($self, $optnam) = @_;
+	return exists ($self->{optsHash}{$optnam});
+}
+
+sub get {
+	my ($self, $optnam) = @_;
+	return $self->{optsHash}{$optnam};
+}
+
+sub string {
+	my $self = shift;
+	my $opts = $self->{optsHash};
+	my @optlist = ();
+	for my $key (sort keys %{$opts}) {
+		push @optlist, ("$key=" . ($opts->{$key} or "-"));
+	}
+	return join (',', @optlist);
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/Pack.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Pack.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Pack.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,133 @@
+#!perl -w
+#
+# Pack -- create an image and pack in suitable format.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# knownFormat -- true if it's a known format
+# package -- given format, image descriptor and destination,
+#     put the image in the destination in requested format.
+#
+# Supported formats:
+#  -- directory, for debugging
+#  -- cramfs, as used in Debian initrd
+#  -- cpio, actually cpio.gz, as used in Fedora initramfs.
+#
+# This module takes care not to leave a partially completed destination
+# on error.
+#
+
+use strict;
+use warnings;
+use File::Temp;
+use Base;
+use Image;
+
+package Pack;
+
+sub packDirectory ($$);
+sub packCramfs ($$);
+sub packCpio ($$);
+
+my $packagers = {
+	directory	=> \&packDirectory,
+	cramfs		=> \&packCramfs,
+	cpio		=> \&packCpio,
+};
+
+sub knownFormat ($) {
+	return exists ($packagers->{$_[0]});
+}
+
+sub package ($$$) {
+	my ($image, $format, $destination) = @_;
+	Base::assert (knownFormat ($format));
+
+	#
+	# Temp based on destination,to increase likelyhood
+	# of rename being atomic.
+	#
+	my $template = "$destination.XXXXXXXXXXXXXXXX";
+	my $tempdir = File::Temp::tempdir ($template, CLEANUP => 1);
+	$image->buildHere ($tempdir);
+
+	$packagers->{$format}($tempdir, $destination);
+}
+
+
+
+sub packDirectory ($$) {
+	my ($tempdir, $destination) = @_;
+
+	if (! rename ($tempdir, $destination)) {
+		Base::fatal ("could not move $tempdir to $destination");
+	}
+}
+
+
+
+sub packCramfs ($$) {
+	my ($tempdir, $destination) = @_;
+
+	my $template = "$destination.XXXXXXXXXXXXXXXX";
+	my ($fh, $tempfile) = File::Temp::tempfile ($template, UNLINK => 1);
+	if (system ("/usr/sbin/mkcramfs -E '$tempdir' '$tempfile' > /dev/null") != 0) {
+		Base::fatal ("mkcramfs $tempdir failed");
+	}
+	if (! rename ($tempfile, $destination)) {
+		Base::fatal ("could not move $tempfile to $destination");
+	}
+}
+
+
+
+sub packCpio ($$) {
+	my ($tempdir, $destination) = @_;
+
+	#
+	# Note how the tempfile can be a relative path, and how cpio
+	# depends on a chdir into tempdir.  Thus, cpio output tempfile
+	# should *not* be based on a template.
+	#
+
+	my $template = "$destination.XXXXXXXXXXXXXXXX";
+	my ($fh, $fromCpio) = File::Temp::tempfile (UNLINK => 1);
+	my ($fh2, $fromGzip) = File::Temp::tempfile ($template, UNLINK => 1);
+
+	#
+	# There are multiple universal unique portable archive formats,
+	# each with the same magic number.
+	# cpio(1) mentions newc and odc; these differ in size of
+	# fields of header.  Whether -oc generates newc or odc depends
+	# on a define in cpio, with Fedora picking a different default
+	# than Debian.  The kernel accepts only newc format (see initramfs.c).
+	# Use the -H newc option to get the right format, regardless
+	# of which default the distro chooses for -c.
+	#
+	if (system ("cd '$tempdir' && find . | cpio --quiet -o -H newc > $fromCpio")) {
+		# $! is useless here: inappropriate ioctl for device ...
+		Base::fatal ("cpio $tempdir failed");
+	}
+	if (system ("gzip -9 < $fromCpio > $fromGzip")) {
+		Base::fatal ("gzip $tempdir failed");
+	}
+
+	if (! rename ($fromGzip, $destination)) {
+		Base::fatal ("could not move $fromGzip to $destination");
+	}
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Parser.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Parser.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Parser.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,452 @@
+#!perl -w
+#
+# Parser -- read the config file and template file
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# This file contains two separate parsers: one for the overall config,
+# one for the template specification.  The reason is that different
+# configurations (eg disk or network based) can share the same templates.
+#
+use strict;
+use warnings;
+use Parse::RecDescent;
+
+use Base;
+
+package Parser;
+
+
+		#
+		# Comment processing: the part of
+		# line after # is ignored.
+		#
+$Parse::RecDescent::skip = qr{(\s+|#.*\n)*};
+
+		#
+		# First grammar: the templates
+		#
+my $templateGrammar = <<'...';
+
+
+		#
+		# start_rule -- parse config file and
+		# return errors.
+		# It turns out that everything but the first
+		# error is useless.
+		#
+start_rule :	config_file[fileName => $arg{fileName} ]
+	      |	{
+			my $fileName = $arg{fileName};
+			my $errors = $thisparser->{errors};
+			$thisparser->{errors} = undef;
+			my $firstError = shift @{$errors};
+			my $msg = $firstError->[0];
+			my $line = $firstError->[1];
+			Base::fatal ("$fileName:$line: $msg");
+		}
+
+
+config_file :	template_set[fileName => $arg{fileName}] end_of_file
+		{ $return = $item{template_set}; }
+	      |	<error>
+
+end_of_file :	/\z/
+	      |	<error: junk at end of file>
+
+
+template_set :	<rulevar: $set = {} >
+template_set :	'TEMPLATE' 'SET' <commit>
+			template[fileName => $arg{fileName}, set => $set](s)
+		'END' 'TEMPLATE' 'SET'
+		{
+			$return = $set;
+		}
+	    |   <error?>
+
+
+template :	'TEMPLATE' <commit> identifier
+		'BEGIN'
+			template_directive[fileName => $arg{fileName}](s?)
+		'END' 'TEMPLATE'
+		{
+			my $name = $item{identifier};
+
+			if (exists ($arg{set}->{$name})) {
+				my $old = $arg{set}->{$name}{origin};
+ 				Base::fatal ("$arg{fileName}:$prevline: redefinition of $name (earlier definition at $old)");
+			}
+
+			$arg{set}->{$name} = {
+				origin => "$arg{fileName}:$prevline",
+				identifier => $item{identifier},
+				directives => $item{'template_directive(s?)'},
+			};
+			$return = 1;
+		}
+	    |	<error?>
+
+
+template_directive :
+		file_directive[fileName => $arg{fileName}]
+	    |	dir_directive[fileName => $arg{fileName}]
+	    |	tree_directive[fileName => $arg{fileName}]
+	    |	script_directive[fileName => $arg{fileName}]
+	    |	<error>
+
+
+		#
+		# Include this file from host on the image
+		#
+file_directive:	'FILE' <commit> pathname
+		{
+			$return = {
+				type => 'file',
+				value => $item{pathname},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Create this directory on the image
+		#
+dir_directive :	'DIRECTORY' <commit> pathname
+		{
+			$return = {
+				type => 'directory',
+				value => $item{pathname},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Copy this tree recursively from host to image
+		#
+tree_directive:	'TREE' <commit> pathname
+		{
+			$return = {
+				type => 'tree',
+				value => $item{pathname},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Add this fragment to named script on the image
+		#
+script_directive: 'SCRIPT' <commit> pathname
+		'BEGIN'
+			inline_fragment
+		'END' 'SCRIPT'
+		{
+			$return = {
+				type => 'script',
+				pathname => $item{pathname},
+				value => $item{inline_fragment},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+	    |	<error?>
+
+
+		#
+		# Identifier in config file; normally corresponds to
+		# variable in calling perl code.  No reason to allow
+		# these identifiers to have same name as reserved
+		# words in config language, so no need to quote.
+		#
+identifier :	/[A-Za-z][A-Za-z0-9_]*/
+	      |	<error>
+
+
+		#
+		# Pathname on generated image.  This will be subjected
+		# to template substitution, so can contain stuff not
+		# commonly found in pathnames
+		# Let's not allow newline, to give error recovery some chance.
+		#
+pathname :	/"[^"\n]+"/
+		{
+			$return = $item{__PATTERN1__};
+			$return =~ s/^"(.*)"$/\1/;
+		}
+	      |	<error: Invalid pathname: use double quoted string>
+
+
+		#
+		# A here document.  Twist: leading space plus '!'
+		# is removed.  This means no terminator is needed,
+		# and the here doc can be indented, and (unlike YAML)
+		# it's insensitive to tabs vs space problems.
+		#
+inline_fragment: /!.*\n(\s*!.*\n)*/
+		{
+			$return = $item{__PATTERN1__};
+			$return =~ s/^\s*!//mg;
+		}
+	      |	<error: Invalid inline fragment: start lines with exclamation mark (!)>
+
+...
+
+
+		#
+		# Second grammar, this one for the overall config file.
+		# This has some stuff in common with the template grammar.
+		# Can we avoid repeating the code?  Options:
+		# - merge config files at install time - too many variants
+		# - concat the shared part to each grammar - ugly
+		# - parameter to select real start_rule - hmm; possible
+		# - recdescent include mechanism - ugly: call can be
+		#   only where syntax allows it, but replacement text
+		#   can straddle syntactic boundaries.
+		# For now, just duplicate.
+		#
+my $configGrammar = <<'...';
+
+
+		#
+		# start_rule -- parse config file and return errors.
+		# It turns out that everything but the first error is useless.
+		#
+start_rule :	config_file[fileName => $arg{fileName} ]
+	      |	{
+			my $fileName = $arg{fileName};
+			my $errors = $thisparser->{errors};
+			$thisparser->{errors} = undef;
+			my $firstError = shift @{$errors};
+			my $msg = $firstError->[0];
+			my $line = $firstError->[1];
+			Base::fatal ("$fileName:$line: $msg");
+		}
+
+
+config_file :	config_set[fileName => $arg{fileName}] end_of_file
+		{ $return = $item{config_set}; }
+	      |	<error>
+
+end_of_file :	/\z/
+	      |	<error: junk at end of file>
+
+
+config_set :	<rulevar: $set = {} >
+config_set :	'CONFIG'  <commit>
+			config_item[fileName => $arg{fileName}, set => $set](s)
+		'END' 'CONFIG'
+		{
+			if (! exists ($set->{templateFileName})) {
+ 				Base::fatal ("$arg{fileName}:$prevline: missing templatefile specification");
+			}
+			if (! exists ($set->{goals})) {
+ 				Base::fatal ("$arg{fileName}:$prevline: missing goal list");
+			}
+			$return = $set;
+		}
+	    |   <error?>
+
+
+		# do these need origin?  seems a bit small for that.
+config_item :	goal_list[fileName => $arg{fileName}, set => $arg{set}]
+	    |	format_specification[fileName => $arg{fileName}, set => $arg{set}]
+	    |	template_file_name[fileName => $arg{fileName}, set => $arg{set}]
+	    |	<error>
+
+
+format_specification :
+		'FORMAT' <commit> identifier
+		{
+			if (exists ($arg{set}->{format})) {
+ 				Base::fatal ("$arg{fileName}:$prevline: duplicate format specification");
+			}
+			$arg{set}->{format} = $item{identifier};
+			$return = 1;
+		}
+	    |	<error?>
+
+
+
+template_file_name :
+		'TEMPLATE' <commit> 'FILE' pathname
+		{
+			if (exists ($arg{set}->{templateFileName})) {
+ 				Base::fatal ("$arg{fileName}:$prevline: duplicate templatefile specification");
+			}
+			$arg{set}->{templateFileName} = $item{pathname};
+			$return = 1;
+		}
+	    |	<error?>
+
+
+		#
+		# Goal_list - what the initial image should do.
+		#
+goal_list :	'GOALS' <commit>
+			goal_directive[fileName => $arg{fileName}](s?)
+		'END' 'GOALS'
+		{
+			if (exists ($arg{set}->{goals})) {
+ 				Base::fatal ("$arg{fileName}:$prevline: duplicate goal list");
+			}
+			$arg{set}->{goals} = $item{'goal_directive(s?)'};
+			$return = 1;
+		}
+	    |	<error?>
+
+
+goal_directive :
+		template_directive[fileName => $arg{fileName}]
+	    |	input_directive[fileName => $arg{fileName}]
+	    |	network_directive[fileName => $arg{fileName}]
+	    |	module_directive[fileName => $arg{fileName}]
+	    |	mountdir_directive[fileName => $arg{fileName}]
+	    |	mountdev_directive[fileName => $arg{fileName}]
+	    |	<error>
+
+
+		#
+		# Expand this template.  No parameters supported.
+		#
+template_directive:	'TEMPLATE' <commit> identifier
+		{
+			$return = {
+				type => 'template',
+				value => $item{identifier},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Load modules for all input devices
+		#
+input_directive :	'INPUT'
+		{
+			$return = {
+				type => 'input',
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Load modules for all network devices
+		#
+network_directive :	'NETWORK'
+		{
+			$return = {
+				type => 'network',
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Load this module
+		#
+module_directive:	'MODULE' <commit> identifier
+		{
+			$return = {
+				type => 'module',
+				value => $item{identifier},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Mount the fs that fstab lists for pathname
+		#
+mountdir_directive:	'MOUNTDIR' <commit> pathname mount_point
+		{
+			$return = {
+				type => 'mountdir',
+				value => $item{pathname},
+				mountPoint => $item{mount_point},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+		#
+		# Mount the fs in blockdev
+		#
+mountdev_directive:	'MOUNTDEV' <commit> pathname mount_point
+		{
+			$return = {
+				type => 'mountdev',
+				value => $item{pathname},
+				mountPoint => $item{mount_point},
+				origin => "$arg{fileName}:$prevline",
+			};
+		}
+
+mount_point:	pathname
+
+		#
+		# Identifier in config file; normally corresponds to
+		# variable in calling perl code.  No reason to allow
+		# these identifiers to have same name as reserved
+		# words in config language, so no need to quote.
+		#
+identifier :	/[A-Za-z][A-Za-z0-9_]*/
+	      |	<error>
+
+
+		#
+		# Pathname.
+		# Let's not allow newline, to give error recovery some chance.
+		#
+pathname :	/"[^"\n]+"/
+		{
+			$return = $item{__PATTERN1__};
+			$return =~ s/^"(.*)"$/\1/;
+		}
+	      |	<error: Invalid pathname: use double quoted string>
+
+...
+
+
+#
+# parse -- given grammar and filename, return parse tree or die.
+# what the tree looks like is completely determined by the grammar.
+#
+sub parse ($$) {
+	my ($grammar, $fileName) = @_;
+	my $parser = new Parse::RecDescent ($grammar);
+
+	if (! open (IN, "<", $fileName)) {
+		Base::fatal ("could not open $fileName");
+	}
+	my $slurp = $/;
+	$/ = undef;
+	my $text = <IN>;
+	$/ = $slurp;
+	if (! close (IN)) {
+		Base::fatal ("could not read $fileName");
+	}
+
+	# $::RD_TRACE = 1;
+	my $tree = $parser->start_rule ($text, 0, 'fileName' => $fileName);
+	return $tree;
+}
+
+#
+# parseConfig -- parse config file and template file
+#
+sub parseConfig ($) {
+	my ($fileName) = @_;
+	my $config = parse ($configGrammar, $fileName);
+	$config->{templates} = parse ($templateGrammar,
+		$config->{templateFileName});
+	return $config;
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/PciDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/PciDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/PciDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,46 @@
+#!perl -w
+#
+# PciDev -- the probed values for a PCI device, as found in /sys.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use Base;
+package PciDev;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('path');
+	my $path = $self->path;
+	$self->{vendor} = Base::getHexFile ("$path/vendor");
+	$self->{device} = Base::getHexFile ("$path/device");
+	$self->{subvendor} = Base::getHexFile ("$path/subsystem_vendor");
+	$self->{subdevice} = Base::getHexFile ("$path/subsystem_device");
+	$self->{class} = Base::getHexFile ("$path/class");
+}
+
+sub path	{ return $_[0]->{path}; }
+sub vendor	{ return $_[0]->{vendor}; }
+sub device	{ return $_[0]->{device}; }
+sub subvendor	{ return $_[0]->{subvendor}; }
+sub subdevice	{ return $_[0]->{subdevice}; }
+sub class	{ return $_[0]->{class}; }
+
+
+1;

Added: dists/trunk/utils/yaird/perl/PciMapEntry.pm
===================================================================
--- dists/trunk/utils/yaird/perl/PciMapEntry.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/PciMapEntry.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,65 @@
+#!perl -w
+#
+# PciMapEntry - iencapsulate a line form modules.pcimap.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# Knows how to match, can return module name.
+#
+
+use strict;
+use warnings;
+use Base;
+package PciMapEntry;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('module', 'vendor', 'device', 'subvendor',
+			'subdevice', 'class', 'classmask', 'driver_data');
+}
+
+sub module	{ return $_[0]->{module}; }
+
+# we could do the PCI_ANY processing in init,
+# if it turns out to be time critical.
+my $PCI_ANY = 0xffffffff;
+sub matches {
+	my ($self, $dev) = @_;
+	if ($self->{vendor} != $PCI_ANY  && $self->{vendor} != $dev->vendor) {
+		return 0;
+	}
+	if ($self->{device} != $PCI_ANY  && $self->{device} != $dev->device) {
+		return 0;
+	}
+	if ($self->{subvendor} != $PCI_ANY 
+		&& $self->{subvendor} != $dev->subvendor) {
+		return 0;
+	}
+	if ($self->{subdevice} != $PCI_ANY
+		&& $self->{subdevice} != $dev->subdevice) {
+		return 0;
+	}
+	if ($self->{class} == ($dev->class & $self->{classmask})) {
+		return 1;
+	}
+	return 0;
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/PciTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/PciTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/PciTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,89 @@
+#!perl -w
+#
+# PciTab -- encapsulate modules.pcimap
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+
+use strict;
+use warnings;
+use Base;
+use Conf;
+use PciMapEntry;
+package PciTab;
+
+my $pciList = undef;
+
+# Parse this:
+# # pci module         vendor     device     subvendor  subdevice  class      class_mask driver_data
+# parport_pc           0x00001106 0x00000686 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
+# parport_pc           0x00001106 0x00008231 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
+
+sub init () {
+	if (defined ($pciList)) {
+		return;
+	}
+	$pciList = [];
+	my $name = Conf::get('pciMap');
+	if (! open (IN, "<", "$name")) {
+		Base::fatal ("can't open pci module list $name");
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/#.*//;
+		$line =~ s/^\s+//;
+		$line =~ s/\s+$//;
+		next if ($line eq "");
+		my @fields = split (/\s+/, $line, 999);
+		if ($#fields != 7) {
+			Base::fatal "malformed line in pci module list $name";
+		}
+		push @{$pciList}, PciMapEntry->new (
+			module => $fields[0],
+			vendor => hex ($fields[1]),
+			device => hex ($fields[2]),
+			subvendor => hex ($fields[3]),
+			subdevice => hex ($fields[4]),
+			class => hex ($fields[5]),
+			classmask => hex ($fields[6]),
+			driver_data => hex ($fields[7]),
+			);
+	}
+	if (! close (IN)) {
+		Base::fatal "could not read pci module list $name";
+	}
+}
+
+sub all	() {
+	init;
+	return $pciList;
+}
+
+# given pathname in devices tree, find module name in PCI map as a list.
+sub find ($) {
+	my ($dev) = @_;
+	my @result = ();
+	for my $pme (@{PciTab::all()}) {
+		if ($pme->matches ($dev)) {
+			push @result, $pme->module;
+		}
+	}
+	return [@result];
+}
+
+
+1;
+

Added: dists/trunk/utils/yaird/perl/PhysicalVolume.pm
===================================================================
--- dists/trunk/utils/yaird/perl/PhysicalVolume.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/PhysicalVolume.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,49 @@
+#!perl -w
+#
+# PhysicalVolume -- Physical Volume Descriptor
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# pvnam - physical volume name
+# vgnam - volume group name
+# devno - "major:minor"
+#
+
+use strict;
+use warnings;
+package PhysicalVolume;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('pvnam', 'vgnam', 'uuid');
+}
+
+sub pvnam	{ return $_[0]->{pvnam}; }
+sub vgnam	{ return $_[0]->{vgnam}; }
+sub uuid	{ return $_[0]->{uuid}; }
+
+sub string {
+	my $self = shift;
+	my $pvnam = $self->pvnam;
+	my $vgnam = $self->vgnam;
+	my $uuid = $self->uuid;
+	my $str = "$pvnam in $vgnam, $uuid";
+	return $str;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/Plan.pm
===================================================================
--- dists/trunk/utils/yaird/perl/Plan.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/Plan.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,609 @@
+#!perl -w
+#
+# Plan -- high-level stuff
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+#
+use strict;
+use warnings;
+use Base;
+use FsTab;
+use ActiveBlockDevTab;
+use LvmTab;
+use Hardware;
+use ModProbe;
+use RaidTab;
+use Image;
+use ActionList;
+use CryptTab;
+use NetDevTab;
+
+package Plan;
+
+
+
+#
+# addHardware -- given hardware path, potentially undef,
+# add required actions to the action list.
+#
+sub addHardware ($$) {
+	my ($actions, $hardware) = @_;
+	if (defined ($hardware)) {
+		my $modList = Hardware::moduleList ($hardware);
+		ModProbe::addModules ($actions, $modList);
+		Base::info ("hardware: completed $hardware");
+	}
+}
+
+
+#
+# addDevicePlan -- given an active block device, add to actions
+# a sequence to make it into a working device file, suitable for mounting.
+# There is a possibility of loops here (consider an fstab
+# where /a is a loopback mount of /a/disk.img); we want do
+# detect these loops and produce an error.  Also, we want to
+# avoid double work: if five lvm logical volumes use the same
+# underlying raid device, there's not much point in running
+# mdadm five times.
+# There are some contraints on the name of the device file;
+# see yspecial in ActiveBlockDev.
+#
+# The actual methods to make a device available are a bag of tricks
+# that we try in order until we find one that works.  Since different
+# methods may be needed for similar devices (device mapper in particular)
+# we cannot use a switch to directly select the appropriate method.
+#
+# actions - add actions here
+# device - the active block device to be made available.
+# working - list of devices we're working on, excluding path.
+#
+sub addDevicePlan ($$$) {
+	my ($actions, $device, $working) = @_;
+
+	my $name = $device->name;
+	for my $w (@{$working}) {
+		if ($w eq $device) {
+			Base::fatal ("loop detected: $name\n");
+		}
+	}
+
+	my $ok = 0;
+	$ok || ($ok = tryParent ($actions,$device,[$device,@{$working}]));
+	$ok || ($ok = tryDmCrypt ($actions,$device,[$device,@{$working}]));
+	$ok || ($ok = tryLvm ($actions,$device,[$device,@{$working}]));
+	$ok || ($ok = tryRaid ($actions,$device,[$device,@{$working}]));
+	$ok || ($ok = tryHardware ($actions,$device,[$device,@{$working}]));
+	if (! $ok) {
+		Base::fatal ("unsupported device required: $name");
+	}
+	Base::debug ("device: completed $name");
+}
+
+#
+# tryParent -- If it's a partition, do the whole
+# device, then make a special file for the partition.
+#
+sub tryParent ($$$) {
+	my ($actions, $device, $working) = @_;
+
+	my $parent = $device->parent;
+	if (! defined ($parent)) {
+		return 0;
+	}
+
+	addDevicePlan($actions,$parent,$working);
+	my $name = $device->name;
+	my $pname = $parent->name;
+	$actions->add ("mkbdev", $device->yspecial,
+			sysname => "$pname/$name");
+	return 1;
+}
+
+#
+# tryDmCrypt -- if the device is encrypted with dm-crypt,
+# and /etc/crypttab tells us the appropriate hash etc,
+# use cryptsetup to make it available.
+# Supports both plain cryptsetup and cryptsetup-luks.
+#
+sub tryDmCrypt ($$$) {
+	my ($actions, $device, $working) = @_;
+
+	my $name = $device->name;
+	my $devno = $device->devno;
+
+	if ($name !~ /^dm-\d+$/) {
+		return 0;
+	}
+
+	# cryptsetup builds on libdevmapper, which only
+	# works with files in /dev/mapper/.
+	my $target = undef;
+	for my $p (@{BlockSpecialFileTab::pathsByDevno($devno)}) {
+		if ($p =~ m!^/dev/mapper/([^/]*)$!) {
+			$target = $1;
+		}
+	}
+	if (! defined ($target)) {
+		#
+		# We have a dm device that is not in /dev/mapper.
+		# This is sufficiently odd to merit a fatal().
+		# The ugly part is that this errror really does not
+		# relate to dm-crypt; OTOH we can generate a better
+		# error message here than by simply failing all matches.
+		#
+		Base::fatal ("device '$name' relies on device mapper, but no corresponding block special file is in /dev/mapper.");
+	}
+
+	# Check this device is in crypttab
+	my $cryptEntry = CryptTab::findByDst ($target);
+	if (!defined ($cryptEntry)) {
+		return 0;
+	}
+
+	#
+	# Device is in crypttab, so cryptsetup should work.
+	# From this point on, errors are fatal.
+	#
+
+	# Check consistency of configuration
+
+	if ($cryptEntry->keyFile) {
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("encrypted device '$target' has keyfile specified in $origin.  This is not supported.");
+	}
+
+	if ($cryptEntry->opts->exists('swap')) {
+		# not thought about what this needs yet.
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("Can't handle 'swap' option for $target at $origin");
+	}
+
+	#
+	# Hmm, what if the encrypted device is readonly? 
+	# - dont generate initrd with readonly device:
+	#   it's not likely to boot
+	# - dont ignore configuration directives:
+	#   if crypttab says its readonly, we're not
+	#   going to set it up r/w.
+	# - so if config says readonly, fatal error:
+	#   we can't reliably produce a safe image.
+	# - as a separate issue, if the device is currently
+	#   setup readonly, the initrd can make it r/w as
+	#   the config file says it must.  This situation
+	#   is not worth a warning.
+	#
+	if ($cryptEntry->opts->exists('readonly')) {
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("encrypted device '$target' is marked readonly in $origin.  This is not supported.");
+	}
+
+	#
+	# get info about dmcrypt device
+	#
+	if (! open (IN, "-|", "/sbin/cryptsetup status $target")) {
+		Base::fatal ("can't run cryptsetup status $target");
+	}
+	my %dmstatus;
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		if ($line =~ m!^/dev/mapper/.* is active:!) {
+			next;
+		}
+		if ($line =~ /^\s*([^:]+):\s+(.+)$/) {
+			$dmstatus{$1} = $2;
+		}
+		# ignore garbage.
+	}
+	if (! close (IN)) {
+		Base::fatal ("error running cryptsetup status $target");
+	}
+
+	for my $key ('cipher','keysize','device','offset','size','mode') {
+		if (! defined ($dmstatus{$key})) {
+			Base::fatal ("missing '$key' record in output for cryptsetup status '$target'");
+		}
+	}
+
+	#
+	# Verify that active device matches configuration file.
+	#
+
+	my $cipher = $dmstatus{cipher};
+	my $confCipher = $cryptEntry->opts->get('cipher');
+	if (defined ($confCipher) && $cipher !~ /$confCipher(-.*)?/) {
+		# NOTE: this means 'aes' in /etc/crypttab
+		# matches aes-cbc-plain, but also with other
+		# minor modes such as aes-cbc-essiv:sha256.
+		# For now, keeping track of all default modes
+		# in kernel crypt modules is too complicated.
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("cryptsetup shows active cipher ($cipher) for '$target' conflicts with $origin ($confCipher)");
+	}
+
+	my $keySize = $dmstatus{keysize};
+	$keySize =~ s/ bits$//;
+	my $confSize = $cryptEntry->opts->get('size');
+	if (defined ($confSize) && ($keySize ne $confSize)) {
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("cryptsetup shows active cipher size ($keySize) for '$target' conflicts with $origin ($confSize)");
+	}
+
+	my $src = Base::canon($dmstatus{device});
+	my $confSrc = Base::canon($cryptEntry->src);
+	if (Base::devno($src) ne Base::devno($confSrc)) {
+		# NOTE: there may be different block special files
+		# with the same devno, and cryptsetup an crypttab
+		# need not use the same one.
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("cryptsetup shows active backing device ($src) for '$target' conflicts with $origin ($confSrc)");
+	}
+
+
+	#
+	# See if it is a luks device and we have a luks-enabled
+	# cryptsetup installed.
+	#
+	my $ignoreThis = `/sbin/cryptsetup isLuks $confSrc 2> /dev/null`;
+	my $isLuks = ($? == 0);
+
+	if (! $isLuks) {
+		# Non-zero offset is supported by cryptsetup,
+		# but not crypttab.
+		my $offset = $dmstatus{offset};
+		if ($offset ne '0 sectors') {
+			Base::fatal ("cryptsetup shows offset ($offset) for '$target' is non-zero.  This is unsupported.  Perhaps you need a cryptsetup with luks support?");
+		}
+	}
+
+	my $abd = ActiveBlockDevTab::findByPath($src);
+	if (!defined ($abd)) {
+		my $origin = $cryptEntry->origin;
+		Base::fatal ("Block device '$src' not found for $origin");
+	}
+
+
+	#
+	# Time to start image generation.  At this point we have:
+	# - target: the encrypted device to be generated
+	# - isLuks: it's a luks device
+	# - abd: descritor for the underlying device
+	# - cipher: full name of the cipher
+	# - keySize: size in bits of the cipher
+	# - hash: the passphrase hash function
+	# - verify: whether to ask passphrase twice
+	#   doing verify for luks is silly but supported.
+	#
+
+	addDevicePlan($actions,$abd,$working);
+
+	ModProbe::addModules ($actions, [ "dm-crypt" ]);
+
+	$cipher =~ /^([^-]+)-/;
+	ModProbe::addModules ($actions, [ $1 ]);
+	if ($cipher =~ /:(.*)$/) {
+		#
+		# Some block cipher modes, notably aes-cbc-essiv:sha256,
+		# need a hash in the kernel.
+		# This differs from the hash applied to the passphrase.
+		#
+		ModProbe::addModules ($actions, [ $1 ]);
+	}
+
+	if ($isLuks) {
+		$actions->add ("cryptsetup_luks", $target,
+			src => $abd->yspecial,
+			verify => ($cryptEntry->opts->exists('verify') ? 1 : 0),
+			);
+	}
+	else {
+		$actions->add ("cryptsetup", $target,
+			src => $abd->yspecial,
+			cipher => $cipher,
+			keySize => $keySize,
+			hash => $cryptEntry->opts->get('hash'),
+			verify => ($cryptEntry->opts->exists('verify') ? 1 : 0),
+			);
+	}
+
+	return 1;
+}
+
+
+#
+# tryLvm -- to start an LVM device, make available the underlying
+# physical volumes, then start the volume group.  Creating the block
+# special file is a side effect of starting the volume group.
+# The activeBlockDev->yspecial() method is choosen such that the name
+# returned matches the name of the block special file generated by vgchange.
+# Physical volumes are named by the block special file giving access to it.
+#
+sub tryLvm ($$$) {
+	my ($actions, $device, $working) = @_;
+
+	my $name = $device->name;
+	my $devno = $device->devno;
+	if ($name !~ /^dm-\d+$/) {
+		return 0;
+	}
+
+	my $lv = LvmTab::findLVByDevno ($devno);
+	if (! defined ($lv)) {
+		# Base::fatal ("Can't find LVM info for $name");
+		return 0;
+	}
+	my $vgnam = $lv->vgnam;
+	for my $physVol (@{LvmTab::findPVsByVgnam($vgnam)}) 
+	{
+		my $pdev = ActiveBlockDevTab::findByPath ($physVol->pvnam);
+		addDevicePlan ($actions, $pdev, $working);
+	}
+	ModProbe::addModules ($actions, [ "dm-mod" ]);
+	$actions->add ("vgchange", $vgnam);
+	return 1;
+}
+
+
+#
+# tryRaid -- To start an md raid device, start the underlying hardware,
+# load raid module, then do mdadm --assemble.
+#
+sub tryRaid ($$$) {
+	my ($actions, $device, $working) = @_;
+
+	my $name = $device->name;
+	my $devno = $device->devno;
+	if ($name !~ /^md\d+$/) {
+		return 0;
+	}
+
+	my $rd = RaidTab::findByDevno ($devno);
+	if (! defined ($rd)) {
+		Base::fatal ("Can't find Raid info for $name");
+	}
+	my $components = [];
+	for my $subDiskPath (@{$rd->devices()}) {
+		my $subDisk = ActiveBlockDevTab::findByPath ($subDiskPath);
+		addDevicePlan ($actions, $subDisk, $working);
+		my $subName = $subDisk->yspecial;
+		push @{$components}, {dev => $subName};
+	}
+	ModProbe::addModules ($actions, [ $rd->level ]);
+
+	my $uuid = $rd->uuid;
+	my ($major, $minor) = ($devno =~ /(\d+):(\d+)/);
+
+	$actions->add ("mdadm", $device->yspecial,
+		major => $major,
+		minor => $minor,
+		uuid => $uuid,
+		components => $components,
+		);
+	return 1;
+}
+
+
+#
+# tryHardware -- for devices that just want some modules loaded.
+#
+sub tryHardware ($$$) {
+	my ($actions, $device, $working) = @_;
+
+	my $name = $device->name;
+	if (
+		$name =~ /^hd[a-z]$/
+             || $name =~ /^sd[a-z]$/
+             || $name =~ /^fd\d+$/)
+	{
+		# IDE or SCSI.
+		my $hardware = $device->hw;
+		addHardware ($actions, $hardware);
+		$actions->add("mkbdev", $device->yspecial, sysname => $name);
+		return 1;
+	}
+
+	#
+	# floppies before 2.6.12 or so did not have hardware link.
+	# plan B: assume that a floppy is a floppy.
+	#
+	if ($name =~ /^fd\d+$/) {
+		ModProbe::addModules ($actions, [ "floppy" ]);
+		$actions->add("mkbdev", $device->yspecial, sysname => $name);
+		return 1;
+	}
+
+	return 0;
+}
+
+
+
+#
+# addInputPlan -- list of actions to activate console,
+# for now only keyboard, no framebuffer.
+#
+# The legacy mouse is a bit, well, odd.
+# you need mousedev to get the /dev/input/mice interface
+# to the mouse, psmouse alone will only give you /dev/psaux,
+# which is not good enough for X-Windows.
+# FC4, 2.6.12: probing psmouse in multiuser *somehow* sucks
+# in mousedev, but loading it in initramfs doesn't, probably
+# because of some limitation in coldplugging.
+# This hack belongs in a higher level config file, but we
+# don't have that yet.
+#
+# The legacy kbd is odd in other ways.  The kbd handler
+# does not show up in /sys/class/input/kbd (2.6.12),
+# but if you load evdev, it will show up as /sys/class/unput/event\d,
+# complete with hardware link.
+#
+# To cope with this, add 'mousedev' and 'evdev' after activating
+# input devices.
+#
+sub addInputPlan ($) {
+	my ($actions) = @_;
+	for my $input (@{InputTab::all()}) {
+		my $str = $input->string;
+		Base::debug ("addInput: consider $str");
+
+		if (! $input->isKbd()) {
+			Base::debug ("addInput: skipping");
+			next;
+		}
+		if (defined ($input->hw)) {
+			addHardware ($actions, $input->hw);
+			next;
+		}
+
+		#
+		# fallback crap.  The hardware symlink is missing
+		# for AT keyboards before 2.6.12 (11?) or if
+		# module evdev is not loaded.
+		#
+		if ($input->name =~ /AT Translated Set 2 keyboard/) {
+			ModProbe::addModules ($actions, [ "i8042", "atkbd" ]);
+		}
+	}
+	Base::debug ("addInput: end");
+}
+
+
+#
+# addNetworkPlan -- add list of actions to activate all
+# network devices.  This is for nfs root mount,
+# and since we can't predict routing at boot time,
+# we just activate all devices.
+#
+sub addNetworkPlan ($) {
+	my ($actions) = @_;
+	for my $netDev (@{NetDevTab::all()}) {
+		my $name = $netDev->name;
+		Base::info ("network: starting $name");
+		if (defined ($netDev->hw)) {
+			addHardware ($actions, $netDev->hw);
+		}
+	}
+}
+
+
+#
+# addBlockDevMount -- add list of actions to mount named device
+# at mountPoint: activate device, activate fstype, do mount.
+#
+sub addBlockDevMount ($$$) {
+	my ($actions, $rootDevName, $mountPoint) = @_;
+
+	#
+	# Device must be in fstab, to determine options
+	#
+	my $root = FsTab::findByDevName($rootDevName);
+	if (! defined ($root)) {
+		fatal ("requested root device ($rootDevName) not in fstab");
+	}
+
+	#
+	# and device must be in /dev, to determine whether
+	# it's raid, lvm, scsi or whatever.
+	#
+	my $abd = ActiveBlockDevTab::findByPath($rootDevName);
+	if (! defined ($abd)) {
+		my $origin = $root->origin;
+		Base::fatal ("block device '$rootDevName' unavailable ($origin)");
+	}
+
+	addDevicePlan ($actions, $abd, []);
+
+	my $fsType = $root->type;
+	ModProbe::addModules ($actions, [ $fsType ]);
+
+	my $yspecial = $abd->yspecial();
+	my $opts = $root->opts->cmdLineVersion();
+
+	# XXX - isRoot should be readOnly, and configurable.
+	$actions->add ("mount", $mountPoint,
+		options => $opts,
+		fsType => $fsType,
+		isRoot => 1,
+		device => $yspecial);
+}
+
+
+#
+# addFsTabMount -- add list of actions to mount the device
+# at fsTabEntry (eg /, /usr, /var) at mountPoint (eg /mnt)
+# on the initial file system.  the fsTabEntry must correspond
+# to a block device: NFS not supported here.
+#
+sub addFsTabMount ($$$) {
+	my ($actions, $fsTabEntry, $mountPoint) = @_;
+	my $root = FsTab::findByMountPoint($fsTabEntry);
+	if (! defined ($root)) {
+		fatal ("can't find $fsTabEntry in fstab");
+	}
+
+	my ($blockDevName, $msg) = $root->blockDevPath();
+	if (! defined ($blockDevName)) {
+		Base::fatal ($msg);
+	}
+	addBlockDevMount ($actions, $blockDevName, $mountPoint);
+}
+
+
+#
+# makePlan -- given list of goals read from config file,
+# translate to list of actions that can be put on the initial image.
+#
+sub makePlan ($) {
+	my ($goals) = @_;
+	my $actions = ActionList->new();
+
+	for my $goal (@{$goals}) {
+		my $origin = $goal->{origin};
+		my $type = $goal->{type};
+		my $value = ($goal->{value} || "--");
+
+		Base::info ("goal: $type, $value ($origin)");
+
+		if ($type eq 'template') {
+			$actions->add ($value, "");
+		}
+		elsif ($type eq 'module') {
+			ModProbe::addModules ($actions, [ $value ]);
+		}
+		elsif ($type eq 'input') {
+			addInputPlan ($actions);
+		}
+		elsif ($type eq 'network') {
+			addNetworkPlan ($actions);
+		}
+		elsif ($type eq 'mountdir') {
+			my $mountPoint = $goal->{mountPoint};
+			Base::assert (defined ($mountPoint));
+			addFsTabMount ($actions, $value, $mountPoint);
+		}
+		elsif ($type eq 'mountdev') {
+			my $mountPoint = $goal->{mountPoint};
+			Base::assert (defined ($mountPoint));
+			addBlockDevMount ($actions, $value, $mountPoint);
+		}
+		else {
+			Base::fatal ("Unknown goal");
+		}
+	}
+	return $actions;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/RaidDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/RaidDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/RaidDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,48 @@
+#!perl -w
+#
+# RaidDev -- the probed values for a raid device, as found by mdadm.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+package RaidDev;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('path', 'devno', 'uuid', 'level', 'devices');
+}
+
+sub path	{ return $_[0]->{path}; }
+sub devno	{ return $_[0]->{devno}; }
+sub uuid	{ return $_[0]->{uuid}; }
+sub level	{ return $_[0]->{level}; }
+sub devices	{ return $_[0]->{devices}; }
+
+sub string {
+	my $self = shift;
+	my $path = $self->path;
+	my $devno = $self->devno;
+	my $uuid = $self->uuid;
+	my $level = $self->level;
+	my $devices = join (',', @{$self->devices});
+	return "$path($devno, $level) = $uuid at $devices";
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/RaidTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/RaidTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/RaidTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,171 @@
+#!perl -w
+#
+# RaidTab -- encapsulate mdadm output
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# NOTE: The mdadm --detail shows only devices that are running,
+# and does not distinguish between partitionable and non-partitionable
+# devices.
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+use RaidDev;
+package RaidTab;
+
+
+my $raidTab = undef;
+
+
+sub init () {
+	if (defined ($raidTab)) {
+		return;
+	}
+
+	# my $name = Conf::get('fstab');
+	$raidTab = [];
+	my $in;
+	if (! open ($in, "-|", "/sbin/mdadm --detail --scan")) {
+		Base::fatal ("Can't read mdadm output");
+	}
+	my @lines = <$in>;
+	if (! close ($in)) {
+		Base::fatal ("Could not read mdadm output");
+	}
+	my $buf;
+	for my $line (@lines) {
+		chomp $line;
+		if ($line =~ /^\s+/) {
+			$buf = $buf . $line;
+		}
+		else {
+			if (defined ($buf)) {
+				processLine ($buf);
+			}
+			$buf = $line;
+		}
+	}
+	if (defined ($buf)) {
+		processLine ($buf);
+	}
+}
+
+sub processLine ($) {
+	my ($line) = @_;
+	my @fields = split (/\s+/, $line);
+	if ($fields[0] ne "ARRAY") {
+		Base::fatal ("Expected ARRAY keyword in mdadm output");
+	}
+	my $path = $fields[1];
+	my $uuid;
+	my $level;
+	my $devices;
+	for my $i (2 .. $#fields) {
+		if ($fields[$i] =~ /^uuid=(.+)$/i) {
+			if (defined ($uuid)) {
+				Base::fatal ("duplicate uuid attribute in mdadm output");
+			}
+			$uuid = $1;
+		}
+		elsif ($fields[$i] =~ /^super-minor=(\d+)$/i) {
+			# nothing
+		}
+		elsif ($fields[$i] =~ /^devices=(.+)$/i) {
+			if (defined ($devices)) {
+				Base::fatal ("duplicate devices attribute in mdadm output");
+			}
+			$devices = $1;
+		}
+		elsif ($fields[$i] =~ /^level=(.+)$/i) {
+			if (defined ($level)) {
+				Base::fatal ("duplicate level attribute in mdadm output");
+			}
+			$level = $1;
+		}
+		elsif ($fields[$i] =~ /^num-devices=(\d+)$/i) {
+			# nothing
+		}
+		elsif ($fields[$i] =~ /^spare-group=(.+)$/i) {
+			# nothing
+		}
+		elsif ($fields[$i] =~ /^auto=(.+)$/i) {
+			# nothing
+		}
+		elsif ($fields[$i] =~ /^spares=(\d+)$/i) {
+			# nothing
+		}
+		else {
+			my $pair = $fields[$i];
+			Base::fatal ("Unknown attribute $pair in mdadm output");
+		}
+	}
+	if (! defined($path)) {
+		Base::fatal ("Missing device field in mdadm output");
+	}
+	if (! defined($uuid)) {
+		Base::fatal ("Missing uuid attribute in mdadm output");
+	}
+	if (! defined($level)) {
+		Base::fatal ("Missing level attribute in mdadm output");
+	}
+	if (! defined($devices)) {
+		Base::fatal ("Missing devices attribute in mdadm output");
+	}
+
+	my $devno = Base::devno ($path);
+	if (! defined($devno)) {
+		Base::fatal ("Device '$path' in mdadm output: cant find device major/minor number");
+	}
+
+	my $descr = RaidDev->new (
+		path => $path,
+		devno => $devno,
+		uuid => $uuid,
+		level => $level,
+		devices => [split (/,/, $devices)],
+		);
+	push @{$raidTab}, $descr;
+}
+
+
+sub all	() {
+	init;
+	return $raidTab;
+}
+
+sub findByPath ($) {
+	my ($path) = @_;
+	for my $rd (@{all()}) {
+		if ($rd->path() eq $path) {
+			return $rd;
+		}
+	}
+	return undef;
+}
+
+sub findByDevno ($) {
+	my ($devno) = @_;
+	for my $rd (@{all()}) {
+		if ($rd->devno() eq $devno) {
+			return $rd;
+		}
+	}
+	return undef;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/ScsiDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/ScsiDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/ScsiDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,107 @@
+#!perl -w
+#
+# ScsiDev -- the probed values for a SCSI device, as found in /sys.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Like IDE devices, SCSI devices need a protocol driver, based
+# on device type, without hardware probing and matching against
+# a kernel generated table.
+#
+# The type and module knowledge is based in /etc/hotplug/scsi.agent,
+# that attributes scsi/scsi.h.
+#
+use strict;
+use warnings;
+use Base;
+package ScsiDev;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('path');
+	my $path = $self->path;
+	my $name = readlink ("$path/block");
+	if (defined ($name)) {
+		$name = Base::basename ($name);
+		$self->{name} = $name;
+	}
+	else {
+		$self->{name} = undef;
+	}
+	$self->{vendor} = Base::getStringFile ("$path/vendor");
+	$self->{model} = Base::getStringFile ("$path/model");
+
+	my $type = Base::getStringFile ("$path/type");
+	$self->{type} = "disk" if $type eq '0';
+	$self->{type} = "tape" if $type eq '1';
+	$self->{type} = "printer" if $type eq '2';
+	$self->{type} = "processor" if $type eq '3';
+	$self->{type} = "worm" if $type eq '4';
+	$self->{type} = "cdrom" if $type eq '5';
+	$self->{type} = "scanner" if $type eq '6';
+	$self->{type} = "mod" if $type eq '7';
+	$self->{type} = "changer" if $type eq '8';
+	$self->{type} = "comm" if $type eq '9';
+	$self->{type} = "enclosure" if $type eq '14';
+	$self->{type} = "type$type" if (!defined ($self->{type}));
+}
+
+sub path	{ return $_[0]->{path}; }
+sub name	{ return $_[0]->{name}; }
+sub vendor	{ return $_[0]->{vendor}; }
+sub model	{ return $_[0]->{model}; }
+sub type	{ return $_[0]->{type}; }
+
+sub string {
+	my $self = shift;
+	my $path = $self->path();
+	my $name = $self->name();
+	my $vendor = $self->vendor();
+	my $model = $self->model();
+	my $type = $self->type();
+	$name = "---" if (! defined ($name));
+	return "$name ($type) = $vendor, $model at $path";
+}
+
+
+#
+# findModuleByScsiDev -- list of required SCSI drivers
+#
+sub findModuleByScsiDev ($) {
+	my ($scsiDev) = @_;
+	my $type = $scsiDev->type();
+	my $driver;
+	$driver = "sd-mod" if $type eq "disk";
+	# "FIXME some tapes use 'osst'"
+	$driver = "st" if $type eq "tape";
+	# if $type eq "printer";
+	# if $type eq "processor";
+	$driver = "sr-mod" if $type eq "worm";
+	$driver = "sr-mod" if $type eq "cdrom";
+	# if $type eq "scanner";
+	$driver = "sd-mod" if $type eq "mod";
+	# if $type eq "changer";
+	# if $type eq "comm";
+	# if $type eq "enclosure";
+	$driver = "sg" if (! defined ($driver));
+	return [ $driver ];
+}
+
+1;
+
+

Added: dists/trunk/utils/yaird/perl/SharedLibraries.pm
===================================================================
--- dists/trunk/utils/yaird/perl/SharedLibraries.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/SharedLibraries.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,155 @@
+#!perl -w
+#
+# SharedLibraries -- what shared libraries an object needs.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+use strict;
+use warnings;
+use Base;
+use Conf;
+package SharedLibraries;
+
+
+#
+# find -- find the shared libraries that are needed by an executable.
+# Try to find libraries with ldd first.  That works only with executables
+# linked with glibc, so if ldd finds nothing, we look for traces of klibc.
+#
+sub find ($) {
+	my ($executable) = @_;
+	my $in;
+	my $result = [];
+
+	if ($executable !~ m!^([.\w/-]+)$!) {
+		# taint check.
+		Base::fatal ("odd characters in executable name: $executable");
+	}
+	$executable = $1;
+
+	Base::debug ("looking for shared libs in $executable");
+	#
+	# <blech>
+	# on FC4, modules are excutable (silly), so we need to check for shared
+	# libs.  However, with ldd from glibc 2.3.5 this results in:
+	# ldd: /lib/ld-linux.so.2 exited with unknown exit code (139)
+	# We make an attempt to skip them.
+	#
+	my $modDir = Conf::get ('modDir');
+	if ($executable =~ /^$modDir\/.*\.ko$/) {
+		Base::debug ("ignore module $executable");
+		return $result;
+	}
+	# </blech>
+
+	if (! open ($in, "-|", "/usr/bin/ldd $executable")) {
+		Base::fatal ("can't read ldd for $executable");
+	}
+	while (defined (my $line = <$in>)) {
+		chomp $line;
+		last if ($line =~ /statically linked/);
+		if ($line =~ /not a dynamic executable/) {
+			#
+			# Happens when doing ldd on a shell script
+			# or kernel module (these have x-bit on in FC3,
+			# no idea why they would do that).  Ldd exit status
+			# will be non-zero.
+			# Ldd only understands executables compiled with
+			# glibc; try to find use of other libraries.
+			#
+			return findLibr ($executable);
+		}
+		elsif ($line =~ m!.* => (/.+) \(0x[0-9a-fA-F]+\)$!) {
+			#
+			# in ldd 2.3.2 (Debian) output looks like this:
+			# /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000)
+			#
+			push @{$result}, $1;
+		}
+		elsif ($line =~ m!^\s*(/[^\s]+) \(0x[0-9a-fA-F]+\)$!) {
+			#
+			# But ldd 2.3.3 (FC3) has this:
+			# /lib/ld-linux.so.2 (0x0056f000)
+			#
+			push @{$result}, $1;
+		}
+		elsif ($line =~ m!.* =>  \(0x[0-9a-fA-F]+\)$!) {
+			#
+			# And eg amd64 also has this:
+			#	linux-gate.so.1 =>  (0x00000000)
+			#
+			# note the double space.  This is a section not
+			# loaded from a file but mapped in by the kernel.
+			# The kernel puts some code with proper syscall
+			# linkage here.
+			# See http://lkml.org/lkml/2003/6/18/156
+			#
+			next;
+		}
+		else {
+			Base::fatal ("unexpected ldd output for $executable: $line");
+		}
+	}
+	if (! close ($in)) {
+		Base::fatal ("could not read ldd for $executable");
+	}
+	return $result;
+}
+
+
+#
+# findLibr -- given a filename, return name of dynamic loader.
+# non-ELF files or non-executable ELF files return empty list,
+# corrupt ELF files are fatal error.
+# If there are shared libraries without absolute path,
+# fatal error, since we don't know how the path the library uses
+# to look up the shared library.
+#
+sub findLibr ($) {
+	my ($executable) = @_;
+	my $in;
+	my $result = [];
+	my $auxDir = Conf::get ('auxDir');
+
+	if (! open ($in, "-|", "$auxDir/findlibs -q $executable")) {
+		Base::fatal ("can't run findlibr for $executable");
+	}
+
+	while (defined (my $line = <$in>)) {
+		chomp $line;
+		if ($line =~ /^interpreter: ([\w.\/-]+)$/) {
+			push @{$result}, $1;
+		}
+		elsif ($line =~ /^needed: ([\w.\/-]+)$/) {
+			if (Base::isAbsolute ($1)) {
+				push @{$result}, $1;
+			}
+			else {
+				fatal ("shared library without glibc: $1 in $executable");
+			}
+		}
+		else {
+			bug ("odd output for findlibs");
+		}
+	}
+
+	if (! close ($in)) {
+		Base::fatal ("could not run findlibr for $executable");
+	}
+	return $result;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/TestSet.pm
===================================================================
--- dists/trunk/utils/yaird/perl/TestSet.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/TestSet.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,231 @@
+#!perl -w
+#
+# Test -- test routines, mostly printing hw inventory.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+#
+use strict;
+use warnings;
+use Base;
+use FsTab;
+use ActiveBlockDevTab;
+use BlockSpecialFileTab;
+use LabeledPartitionTab;
+use LvmTab;
+use Hardware;
+use RaidTab;
+use InputTab;
+use Image;
+use Plan;
+use KConfig;
+
+package TestSet;
+
+
+sub testGetFsTab () {
+	print "Entries in fstab:\n";
+	for my $entry (@{FsTab->all}) {
+		my $str = $entry->string;
+		my $cmd = $entry->opts->cmdLineVersion;
+		print "\t$str\n";
+		print "\t\t$cmd\n";
+	}
+}
+
+
+sub testActiveBlockDevs () {
+	print "Block devices in /sys:\n";
+	for my $abd (@{ActiveBlockDevTab::all()}) {
+		my $str = $abd->string;
+		print "\t$str\n";
+	}
+}
+
+sub testActiveBlockDevPartitions () {
+	print "Partitions for block devices in /sys:\n";
+	for my $abd (@{ActiveBlockDevTab::all()}) {
+		my $str = $abd->string;
+		my $hp = $abd->hasPartitions() ? "yes" : "no";
+		my $partitions = $abd->partitions();
+		my $partList = '['
+			. join (',', (map {$_->name} @{$partitions})) . ']';
+		print "\t$str\n";
+		print "\t\tpartitioned:\t$hp\n";
+		print "\t\tpartitions:\t$partList\n";
+	}
+}
+
+
+sub testBlockSpecialFiles () {
+	print "Block special files /dev:\n";
+	for my $devno (@{BlockSpecialFileTab::allDevnos()}) {
+		my $paths = BlockSpecialFileTab::pathsByDevno ($devno);
+		my $list = join (", ", @{$paths});
+		print "\t$devno: $list\n";
+	}
+}
+
+
+sub testLabeledPartitions () {
+	print "Labeled partitions detected:\n";
+	for my $lp (@{LabeledPartitionTab::all()}) {
+		my $str = $lp->string;
+		print "\t$str\n";
+	}
+}
+
+
+sub testLvm () {
+	print "LVM Logical Volumes:\n";
+	for my $lv (@{LvmTab::allLogicalVolumes()}) {
+		my $str = $lv->string;
+		print "\t$str\n";
+	}
+
+	print "LVM Volume Groups:\n";
+	for my $vg (@{LvmTab::allVolumeGroups()}) {
+		my $str = $vg->string;
+		print "\t$str\n";
+	}
+
+	print "LVM Physical Volumes:\n";
+	for my $pv (@{LvmTab::allPhysicalVolumes()}) {
+		my $str = $pv->string;
+		print "\t$str\n";
+	}
+}
+
+
+sub testHardware () {
+	print "Hardware modules needed for devices in /sys:\n";
+	for my $abd (@{ActiveBlockDevTab::all()}) {
+		my $str = $abd->string;
+		my $hw = $abd->hw;
+		next unless defined ($hw);
+		print "\t$str\n";
+		my $moduleList = Hardware::moduleList ($hw);
+		print "\t\t[" . join(',', @{$moduleList}) . "]\n";
+	}
+}
+
+sub testRaidDevices () {
+	print "Raid devices:\n";
+	for my $rd (@{RaidTab::all()}) {
+		my $str = $rd->string;
+		print "\t$str\n";
+	}
+}
+
+sub testInput () {
+	print "Input devices:\n";
+	for my $inp (@{InputTab::all()}) {
+		my $str = $inp->string;
+		print "\t$str\n";
+	}
+}
+
+sub testInterpretation () {
+	print "Interpreted Fstab Entries:\n";
+	for my $fse (@{FsTab->all}) {
+		my $fseStr = $fse->string;
+		my $active = $fse->isRequiredAtBoot ? "yes": "no";
+		my ($path, $msg) = $fse->blockDevPath();
+		my $lvmStr = "--";
+		my $devno = "--";
+		my $hardware;
+		my $name = "--";
+		my $modules;
+		if (defined ($path) && -b $path) {
+			$devno = Base::devno ($path);
+			my $lvmFiles = LvmTab::findPVPathsByLVDevno ($devno);
+			if (defined ($lvmFiles)) {
+				$lvmStr = '[' . join (',', @{$lvmFiles}) . ']';
+			}
+
+			my $abd = ActiveBlockDevTab::findByDevno($devno);
+			if (defined ($abd)) {
+				$name = $abd->name();
+				my $parent = $abd->parent();
+				if (defined ($parent)) {
+					$hardware = $parent->hw();
+				}
+				else {
+					$hardware = $abd->hw();
+				}
+			}
+		}
+		if (defined ($hardware)) {
+			my $moduleList = Hardware::moduleList ($hardware);
+			$modules = "[" . join(',', @{$moduleList}) . "]";
+		}
+
+		$hardware = "--" unless defined ($hardware);
+		$modules = "--" unless defined ($modules);
+		$path = "--" unless defined ($path);
+		print "\t$fseStr\n";
+		print "\t\tactive:\t$active\n";
+		print "\t\tdevno:\t$devno\n";
+		print "\t\tpath:\t$path\n";
+		print "\t\tname:\t$name\n";
+		print "\t\thw:\t$hardware\n";
+		print "\t\tmods:\t$modules\n";
+		print "\t\tlvm:\t$lvmStr\n";
+
+		if (defined ($path)) {
+			my $abd = ActiveBlockDevTab::findByPath($path);
+			if (defined ($abd)) {
+				my $list = ActionList->new();
+				Plan::addDevicePlan ($list, $abd, []);
+				# the output provided by addDevicePlan
+				# is enough.
+				# print $list->string();
+			}
+		}
+	}
+}
+
+sub testKconfig () {
+	print "Kernel Builtin Modules:\n";
+	for my $module (@{KConfig::allKnownModules()}) {
+		my $builtIn = KConfig::isBuiltIn($module) ? "BUILTIN" : "--";
+		print "\t$module:\t$builtIn\n";
+	}
+}
+
+#
+# testAll -- run various interesting subroutines
+# that may trigger errors.
+#
+sub testAll ()
+{
+	testGetFsTab ();
+	testBlockSpecialFiles ();
+	testLabeledPartitions ();
+	testActiveBlockDevs ();
+	testActiveBlockDevPartitions ();
+	testLvm ();
+	testHardware ();
+	testRaidDevices();
+	testInterpretation ();
+	testInput ();
+	testKconfig ();
+	Base::bye ();
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/UsbDev.pm
===================================================================
--- dists/trunk/utils/yaird/perl/UsbDev.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/UsbDev.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,88 @@
+#!perl -w
+#
+# UsbDev -- the probed values for a USB device, as found in /sys.
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# The information passed to the matcher should correspond to what
+# is passed by hotplug.
+#
+# For devices:
+#	vendor, product, bcdDevice = 0, 0, 0
+#	deviceClass, subClass, protocol = from /sys
+#	interfaceClass, subClass, protocol = 1000,1000,1000
+# For interfaces:
+#	vendor, product, bcdDevice = from /sys in parent device
+#	deviceClass, subClass, protocol = 1000,1000,1000
+#	interfaceClass, subClass, protocol = from /sys
+#
+# Note that somewhere in 2.5, the hotplug events for USB
+# changed: old kernels only had an event for the first interface,
+# with no distinction between interface and device.
+#
+use strict;
+use warnings;
+use Base;
+package UsbDev;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('path');
+	my $path = $self->{path};
+	if (-f "$path/bDeviceClass") {
+		$self->{idVendor} = 0;
+		$self->{idProduct} = 0;
+		$self->{bcdDevice} = 0;
+		$self->{bDeviceClass} = Base::getHexFile ("$path/bDeviceClass");
+		$self->{bDeviceSubClass} = Base::getHexFile ("$path/bDeviceSubClass");
+		$self->{bDeviceProtocol} = Base::getHexFile ("$path/bDeviceProtocol");
+		$self->{bInterfaceClass} = 1000;
+		$self->{bInterfaceSubClass} = 1000;
+		$self->{bInterfaceProtocol} = 1000;
+	}
+	elsif (-f "$path/bInterfaceClass") {
+		$self->{idVendor} = Base::getHexFile ("$path/../idVendor");
+		$self->{idProduct} = Base::getHexFile ("$path/../idProduct");
+		$self->{bcdDevice} = Base::getHexFile ("$path/../bcdDevice");
+		$self->{bDeviceClass} = 1000;
+		$self->{bDeviceSubClass} = 1000;
+		$self->{bDeviceProtocol} = 1000;
+		$self->{bInterfaceClass} = Base::getHexFile ("$path/bInterfaceClass");
+		$self->{bInterfaceSubClass} = Base::getHexFile ("$path/bInterfaceSubClass");
+		$self->{bInterfaceProtocol} = Base::getHexFile ("$path/bInterfaceProtocol");
+	}
+	else {
+		Base::fatal "trying to interpret $path as /sys USB devive";
+	}
+}
+
+sub idVendor		{ return $_[0]->{idVendor}; }
+sub idProduct		{ return $_[0]->{idProduct}; }
+sub bcdDevice		{ return $_[0]->{bcdDevice}; }
+sub bDeviceClass	{ return $_[0]->{bDeviceClass}; }
+sub bDeviceSubClass	{ return $_[0]->{bDeviceSubClass}; }
+sub bDeviceProtocol	{ return $_[0]->{bDeviceProtocol}; }
+sub bInterfaceClass	{ return $_[0]->{bInterfaceClass}; }
+sub bInterfaceSubClass	{ return $_[0]->{bInterfaceSubClass}; }
+sub bInterfaceProtocol	{ return $_[0]->{bInterfaceProtocol}; }
+
+
+
+1;

Added: dists/trunk/utils/yaird/perl/UsbMapEntry.pm
===================================================================
--- dists/trunk/utils/yaird/perl/UsbMapEntry.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/UsbMapEntry.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,133 @@
+#!perl -w
+#
+# UsbMapEntry -- encapsulate single line from modules.usbmap
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+# Knows how to match, can return module name.
+#
+# The ultimate authority on matching is
+# linux/drivers/usb/core/usb.c:usb_match_id(),
+# the routine where the kernel determines whether to let a particular
+# driver probe an interface.  Both the hotplug usb.agent and this
+# script mimic the behaviour of that function.
+# AFAICS, usb_match_id is only invoked on interfaces, not on the devices
+# these interfaces are part of.
+# However, driver/usb/core/hub.c:usb_new_device() invokes device_add()
+# for both the device and (via usb_set_configuration()) for the interfaces;
+# this in turn will produce hotplut events (in the case of interfaces with
+# a callback to usb_hotplug(), which puts product information in the hotplug
+# environment), and the hotplug scripts will do matching for both devices
+# and interfaces.  The coldplug script usb.rc emulates this kernel behaviour.
+#
+# Thus, there seems to be a discrepancy between what gets matched in the
+# kernel and what gets matched in hotplug; we follow hotplug behaviour.
+#
+# Note that hotplug uses this matching algorithm not only on the module
+# map provided by the kernel, but also on /etc/hotplug/usb/*.usermap;
+# the latter results not in loading of a module but in execution of a script.
+# This can be used to start gphoto, or it can be used to push firmware
+# to a device.  Question: what should mkinitrd know about this?
+#
+use strict;
+use warnings;
+package UsbMapEntry;
+use base 'Obj';
+
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('module', 'match_flags', 'idVendor', 
+			'idProduct', 'bcdDevice_lo', 'bcdDevice_hi',
+			'bDeviceClass', 'bDeviceSubClass', 'bDeviceProtocol',
+			'bInterfaceClass', 'bInterfaceSubClass',
+			'bInterfaceProtocol', 'driver_info');
+}
+
+sub module		{ return $_[0]->{module}; }
+sub match_flags		{ return $_[0]->{match_flags}; }
+sub idVendor		{ return $_[0]->{idVendor}; }
+sub idProduct		{ return $_[0]->{idProduct}; }
+sub bcdDevice_lo	{ return $_[0]->{bcdDevice_lo}; }
+sub bcdDevice_hi	{ return $_[0]->{bcdDevice_hi}; }
+sub bDeviceClass	{ return $_[0]->{bDeviceClass}; }
+sub bDeviceSubClass	{ return $_[0]->{bDeviceSubClass}; }
+sub bDeviceProtocol	{ return $_[0]->{bDeviceProtocol}; }
+sub bInterfaceClass	{ return $_[0]->{bInterfaceClass}; }
+sub bInterfaceSubClass	{ return $_[0]->{bInterfaceSubClass}; }
+sub bInterfaceProtocol	{ return $_[0]->{bInterfaceProtocol}; }
+sub driver_info		{ return $_[0]->{driver_info}; }
+
+# we could do the USB_MATCH_XXX processing in init,
+# if it turns out to be time critical.
+my $USB_MATCH_VENDOR		= 0x0001;
+my $USB_MATCH_PRODUCT		= 0x0002;
+my $USB_MATCH_DEV_LO		= 0x0004;
+my $USB_MATCH_DEV_HI		= 0x0008;
+my $USB_MATCH_DEV_CLASS		= 0x0010;
+my $USB_MATCH_DEV_SUBCLASS	= 0x0020;
+my $USB_MATCH_DEV_PROTOCOL	= 0x0040;
+my $USB_MATCH_INT_CLASS		= 0x0080;
+my $USB_MATCH_INT_SUBCLASS	= 0x0100;
+my $USB_MATCH_INT_PROTOCOL	= 0x0200;
+
+
+sub matches {
+	my ($self, $dev) = @_;
+	my $match = $self->match_flags;
+
+	if ($match & $USB_MATCH_VENDOR && $self->idVendor != $dev->idVendor) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_PRODUCT && $self->idProduct != $dev->idProduct) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_DEV_LO && $self->bcdDevice_lo > $dev->bcdDevice) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_DEV_HI && $self->bcdDevice_hi < $dev->bcdDevice) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_DEV_CLASS && $self->bDeviceClass != $dev->bDeviceClass) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_DEV_SUBCLASS && $self->bDeviceSubClass != $dev->bDeviceSubClass) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_DEV_PROTOCOL && $self->bDeviceProtocol != $dev->bDeviceProtocol) {
+		return 0;
+	}
+
+	# Quoting usb.agent:
+	# for now, this only checks the first of perhaps
+	# several interfaces for this device.
+	if ($match & $USB_MATCH_INT_CLASS && $self->bInterfaceClass != $dev->bInterfaceClass) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_INT_SUBCLASS && $self->bInterfaceSubClass != $dev->bInterfaceSubClass) {
+		return 0;
+	}
+	if ($match & $USB_MATCH_INT_PROTOCOL && $self->bInterfaceProtocol != $dev->bInterfaceProtocol) {
+		return 0;
+	}
+
+	return 1;
+}
+
+1;
+

Added: dists/trunk/utils/yaird/perl/UsbTab.pm
===================================================================
--- dists/trunk/utils/yaird/perl/UsbTab.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/UsbTab.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,92 @@
+#!perl -w
+#
+# UsbTab -- encapsulate modules.usbmap
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+
+use strict;
+use warnings;
+use Base;
+use UsbMapEntry;
+package UsbTab;
+
+my $usbList = undef;
+
+# Parse this:
+# # usb module         match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
+# bfusb                0x0003      0x057c   0x2200    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x0
+# bcm203x              0x0003      0x0a5c   0x2033    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x0
+
+sub init () {
+	if (defined ($usbList)) {
+		return;
+	}
+	$usbList = [];
+	my $name = Conf::get('usbMap');
+	if (! open (IN, "<", "$name")) {
+		Base::fatal ("can't open usb module list $name");
+	}
+	while (defined (my $line = <IN>)) {
+		chomp $line;
+		$line =~ s/#.*//;
+		$line =~ s/^\s+//;
+		$line =~ s/\s+$//;
+		next if ($line eq "");
+		my @fields = split (/\s+/, $line, 999);
+		if ($#fields != 12) {
+			Base::fatal ("malformed line in usb module list $name");
+		}
+		push @{$usbList}, UsbMapEntry->new (
+			module => $fields[0],
+			match_flags => hex ($fields[1]),
+			idVendor => hex ($fields[2]),
+			idProduct => hex ($fields[3]),
+			bcdDevice_lo => hex ($fields[4]),
+			bcdDevice_hi => hex ($fields[5]),
+			bDeviceClass => hex ($fields[6]),
+			bDeviceSubClass => hex ($fields[7]),
+			bDeviceProtocol => hex ($fields[8]),
+			bInterfaceClass => hex ($fields[9]),
+			bInterfaceSubClass => hex ($fields[10]),
+			bInterfaceProtocol => hex ($fields[11]),
+			driver_info => hex ($fields[12]),
+			);
+	}
+	if (! close (IN)) {
+		Base::fatal ("could not read usb module list $name");
+	}
+}
+
+sub all	() {
+	init;
+	return $usbList;
+}
+
+# given pathname in devices tree, return list of matching modules.
+sub find ($) {
+	my ($dev) = @_;
+	my @result = ();
+	for my $ume (@{UsbTab::all()}) {
+		if ($ume->matches ($dev)) {
+			push @result, $ume->module;
+		}
+	}
+	return [@result];
+}
+
+
+1;

Added: dists/trunk/utils/yaird/perl/VolumeGroup.pm
===================================================================
--- dists/trunk/utils/yaird/perl/VolumeGroup.pm	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/VolumeGroup.pm	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,45 @@
+#!perl -w
+#
+# VolumeGroup -- Volume Group Descriptor
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# vgnam - volume group name
+# uuid - uuid
+#
+use strict;
+use warnings;
+package VolumeGroup;
+use base 'Obj';
+
+sub fill {
+	my $self = shift;
+	$self->SUPER::fill();
+	$self->takeArgs ('vgnam', 'uuid');
+}
+
+sub vgnam	{ return $_[0]->{vgnam}; }
+sub uuid	{ return $_[0]->{uuid}; }
+
+sub string {
+	my $self = shift;
+	my $vgnam = $self->vgnam;
+	my $uuid = $self->uuid;
+	my $str = "$vgnam, $uuid";
+	return $str;
+}
+
+1;

Added: dists/trunk/utils/yaird/perl/main.pl
===================================================================
--- dists/trunk/utils/yaird/perl/main.pl	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/perl/main.pl	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,244 @@
+#!@PERL@
+#
+# Main -- an exercise in boot image building
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+#
+use strict;
+use warnings;
+use lib '@PERLDIR@';
+
+use Getopt::Long;
+use Plan;
+use TestSet;
+use Pack;
+use Parser;
+
+my $appName = "@PACKAGE@";
+my $appVersion = "@VERSION@";
+
+
+#
+# go -- main program:
+# write an image to destination in specified format.
+# destination must not exist yet.
+# templates define how actions in masterplan are expanded.
+#
+sub go ($$) {
+	my ($config, $destination) = @_;
+	my $masterPlan = Plan::makePlan ($config->{goals});
+	my $image = $masterPlan->expand ($config->{templates});
+	Pack::package ($image, $config->{format}, $destination);
+}
+
+
+#
+# paranoia -- Random bits of -
+#
+sub paranoia {
+	umask 077;
+
+	#
+	# Perlsec(1) identifies the following as risky:
+	#
+	#	delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; 
+	#
+	# but just scrapping the complete environment
+	# seems to work nicely.
+	#
+	delete @ENV{keys %ENV};
+	$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin';
+}
+
+
+#
+# usage -- print invocation patterns of the application
+# For --nfs, use -N as short option rather than -n,
+# since -n is often used as a 'just-pretend' option.
+#
+sub usage {
+	print <<"//";
+
+$appName generates initrd images.
+
+$appName --test [ version ]
+	print an overview of system data, without writing anything to disk.
+
+$appName --output dest [ version ]
+	generate an initrd image in 'dest'.
+
+Options:
+   -h, -?, --help	print this help text and exit
+   -V, --version	print version and exit (don't bother: $appVersion)
+   -v, --verbose	print progress messages
+   -d, --debug		detailed output
+   -q, --quiet		don't print warning messages
+   -o, --output dest	place result here
+   -c, --config file	use this configuration file
+   -f, --format form	produce the image in this format,
+			valid values: directory, cramfs, cpio
+   -t, --test		print overview of system data,
+			used as basis for debugging.
+
+//
+}
+
+
+#
+# main -- main program, argument processing
+#
+sub main {
+	my ($opt_help, $opt_version,
+		$opt_verbose, $opt_quiet, $opt_debug,
+		$opt_config, $opt_format, $opt_output,
+		$opt_test);
+
+	paranoia ();
+	Base::setProgName ($appName);
+
+	my @warnings = ();
+	{
+		#
+		# catch warnings during getopt, but not elsewhere.
+		# The idea is to let -? produce help without complaint,
+		# even if other args are broken.
+		#
+		local $SIG{__WARN__} = sub { push @warnings, $_[0]; };
+
+		Getopt::Long::Configure ("bundling");
+		my $result = GetOptions (
+			"h|help|?"	=> \$opt_help,
+			"V|version"	=> \$opt_version,
+			"v|verbose"	=> \$opt_verbose,
+			"q|quiet"	=> \$opt_quiet,
+			"d|debug"	=> \$opt_debug,
+			"c|config=s"	=> \$opt_config,
+			"f|format=s"	=> \$opt_format,
+			"o|output=s"	=> \$opt_output,
+			"t|test"	=> \$opt_test,
+			);
+	}
+
+	#
+	# --help and --version processed without regard to other options,
+	# exit without side effect.
+	#
+	if (defined ($opt_help)) {
+		usage ();
+		Base::bye();
+	}
+	if (defined ($opt_version)) {
+		Base::setVerbose (1);
+		Base::info ("version $appVersion");
+		Base::bye();
+	}
+
+	#
+	# Argument validation
+	#
+	for my $w (@warnings) {
+		# lazy: perhaps we could provide more info here?
+		Base::fatal ("$w");
+	}
+	if (defined ($opt_output) && defined ($opt_test)) {
+		Base::fatal "conflicting options --output and --test";
+	}
+	if (! defined ($opt_output) && ! defined ($opt_test)) {
+		Base::fatal "one of --output and --test must be given";
+	}
+	if (defined ($opt_output)) {
+		#
+		# Untaint -- is there a need for 'output' with an umlaut?
+		# do this before existence test.
+		#
+		if ($opt_output !~ m!^([-_./[a-zA-Z0-9+]+)$!) {
+			Base::fatal ("illegal character in output file name");
+		}
+		$opt_output = $1;
+
+		if (-e $opt_output) {
+			Base::fatal "destination $opt_output already exists";
+		}
+
+	}
+	if (defined ($opt_test)) {
+		if (defined ($opt_format)) {
+			Base::fatal "conflicting options --test and --format";
+		}
+	}
+	if ($#ARGV > 0) {
+		my $valid = $ARGV[0];
+		Base::fatal "extra arguments after $valid";
+	}
+
+	#
+	# All arguments validated; start processing.
+	#
+	if ($#ARGV == 0) {
+		Conf::set ("version", $ARGV[0]);
+	}
+	if ($opt_verbose) {
+		Base::setVerbose (1);
+	}
+	if ($opt_debug) {
+		Base::setDebug (1);
+	}
+	if ($opt_quiet) {
+		Base::setQuiet (1);
+	}
+	if (! defined ($opt_config)) {
+		$opt_config = Conf::get("cfgDir") . "/Default.cfg";
+	}
+
+	# avoid silly messages with an early test
+	my $v = Conf::get("version");
+	my $mdir = Conf::get("libModules") . "/$v";
+	if (! -d $mdir) {
+		Base::fatal ("unknown kernel version: $v");
+	}
+
+	my $config = Parser::parseConfig ($opt_config);
+
+	#
+	# output format on command line overrides config file;
+	# output format must be defined in at least one of them.
+	#
+	if (defined ($opt_format)) {
+		$config->{format} = $opt_format;
+	}
+	if (! defined ($config->{format})) {
+		Base::fatal ("no output format defined in config file or command line");
+	}
+	if (! Pack::knownFormat ($config->{format})) {
+		my $format = $config->{format};
+		Base::fatal "unknown format: $format";
+	}
+
+	#
+	# go for it.
+	#
+	if (defined ($opt_test)) {
+		TestSet::testAll();
+	}
+	elsif (defined ($opt_output)) {
+		go ($config, $opt_output);
+	}
+	Base::bye;
+}
+
+main ();

Added: dists/trunk/utils/yaird/templates/Debian-initrd.cfg
===================================================================
--- dists/trunk/utils/yaird/templates/Debian-initrd.cfg	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/templates/Debian-initrd.cfg	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,410 @@
+#
+# Debian-initrd -- translate general intentions to exact initrd layout
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# This is written in a special purpose language;
+# see the HTML documentation for syntax definition.
+#
+# These templates define the translation from general intentions in the
+# plan to exact lists of files and script fragments to be included 
+# on the initrd image.  Templates are indexed by an action name, and include:
+# 	- files to be copied from current system to initrd;
+# 	  often executables.
+# 	- directories to be created
+# 	- fragments to be appended to scripts on the image,
+# 	  these are in a hash from script name to script content.
+#
+# Filenames and script fragments are processed by HTML::Template
+# before being added to the image.
+#
+# If you want to implement busybox support, this is the place to do it.
+#
+# Obviously, the template names and the attributes used in the template
+# should match what is provided by the planner.
+#
+
+TEMPLATE SET
+	TEMPLATE prologue
+	BEGIN
+		#
+		# In principle, we don't want device files on the initrd
+		# image: device numbers can change between kernels.
+		# Instead, create device files at boot time based on info
+		# in sysfs.  However, /dev/null and /dev/console are needed
+		# to mount sysfs.
+		#
+		FILE "/dev/null"
+		FILE "/dev/console"
+		FILE "/bin/dash"
+		FILE "/bin/cat"
+		FILE "/bin/mkdir"
+		FILE "/bin/mount"
+		FILE "/bin/umount"
+		FILE "/bin/mknod"
+		FILE "/bin/sleep"
+		FILE "/usr/sbin/chroot"
+		FILE "/sbin/pivot_root"
+
+		DIRECTORY "/mnt"
+		DIRECTORY "/proc"
+		DIRECTORY "/sys"
+		DIRECTORY "/dev"
+		DIRECTORY "/etc"
+		DIRECTORY "/var"
+
+		SCRIPT "/linuxrc"
+		BEGIN
+			!#!/bin/dash
+			!set -x
+			!export PATH=/sbin:/bin
+			!mount -nt proc proc /proc
+			!root=$(cat proc/sys/kernel/real-root-dev)
+			!echo 256 > proc/sys/kernel/real-root-dev
+			!echo "linuxrc: root is $root"
+			!umount -n /proc
+			!exit 0
+		END SCRIPT
+
+		#
+		# We can provide debugging opportunities in the
+		# initramfs image; the question is when and how
+		# to enable this.  Consider two types of user:
+		# - a developer, working on the template
+		# - an end user, who has a boot problem with
+		#   an image that was generated automatically
+		#   after installing a new distribution kernel.
+		#
+		# The developer can simply add debugging code
+		# to the template.
+		# For the end user, adding an option to the kernel
+		# command line is easier to enable debugging
+		# than rebuilding the boot image with special
+		# options or a modified configuration file.
+		#
+		# For this reason, we won't provide a template
+		# parameter to control debugging, instead we
+		# interpret a new kernel command line parameter:
+		# ydebug.
+		#
+		SCRIPT "/sbin/init"
+		BEGIN
+			!#!/bin/dash
+			!#
+			!# Generator version: yaird <TMPL_VAR NAME=appVersion>.
+			!# Kernel version: <TMPL_VAR NAME=version>.
+			!#
+			!INIT_DEBUG=
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+			!
+			!#
+			!#  Utility functions
+			!#
+			!mksymdev () {
+			!	devfile="$1"
+			!	sysfile="$2"
+			!	cb="$3"
+			!	devpair=$(/bin/cat "$sysfile")
+			!	for delay in 1 2 4 8 16
+			!	do
+			!		if [ "$devpair" = "" ]
+			!		then
+			!			echo "Waiting $delay seconds for $sysfile to show up"
+			!			sleep $delay
+			!		fi
+			!		devpair=$(/bin/cat "$sysfile")
+			!	done
+			!
+			!	if [ "$devpair" = "" ]
+			!	then
+			!		echo "Device $sysfile seems to be down."
+			!		echo "Debugging opportunity, type ^D to continue."
+			!		/bin/dash
+			!	fi
+			!
+			!	maj=${devpair%:*}
+			!	min=${devpair#*:}
+			!	/bin/mknod "$devfile" $cb $maj $min
+			!}
+			!mkcdev () {
+			!	mksymdev "$1" "/sys/class/$2/dev" c
+			!}
+			!mkbdev () {
+			!	mksymdev "$1" "/sys/block/$2/dev" b
+			!}
+			!
+			!switchroot () {
+			!	if [ "$INIT_DEBUG" != "" ]
+			!	then
+			!		echo "Debugging opportunity, ^D to continue."
+			!		/bin/dash
+			!	fi
+			!
+			!	echo "Switching root ..."
+			!	cd /mnt
+			!	# unmount /dev/twice, may have devfs planted by kernel
+			!	/bin/umount -n /dev
+			!	/bin/umount -n /dev
+			!	/bin/umount -n /var
+			!	/bin/umount -n /etc
+			!	/bin/umount -n /sys
+			!	/bin/umount -n /proc
+			!	/sbin/pivot_root . initrd
+			!	exec initrd/usr/sbin/chroot . $init "$@" < dev/console > dev/console 2>&1
+			!}
+			!
+			!#
+			!# Setting up mounts
+			!#
+			!/bin/mount -nt sysfs sysfs /sys
+			!/bin/mount -nt proc proc /proc
+			!/bin/mount -nt tmpfs none /dev
+			!# these help for vgchange
+			!/bin/mount -nt tmpfs tmpfs /etc
+			!/bin/mount -nt tmpfs tmpfs /var
+			!# /dev/tty is needed for eg cryptsetup.
+			!mkcdev /dev/tty tty/tty
+			!
+			!#
+			!# Command line processing
+			!# init - first proc to start on next root
+			!# root - to be done: how should it relate
+			!#	to file system selection?
+			!# ro,rw - mount root read-only or read-write.
+			!# 	This is like a mount -r; it overrules
+			!# 	a -o rw.
+			!# noresume, resume - to be done
+			!# ide - options for module ide_core.
+			!# 	need a way to append these to proper
+			!# 	module.  do a check on module name
+			!# 	in insmod template?
+			!# ip=, nfsaddrs=, nfsroot= - support NFS boot
+			!#
+			!ro=-r
+			!ip=
+			!nfsroot=
+			!init=/sbin/init
+			!for i in $(cat /proc/cmdline)
+			!do
+			!	case "$i" in
+			!	init=*)
+			!		init=${i#init=}
+			!		;;
+			!	ro)
+			!		ro=-r
+			!		;;
+			!	rw)
+			!		ro=
+			!		;;
+			!	ip=*|nfsaddrs=*)
+			!		ip="$ip $i"
+			!		;;
+			!	nfsroot=*)
+			!		nfsroot="$i"
+			!		;;
+			!	ydebug)
+			!		INIT_DEBUG=yes
+			!	esac
+			!done
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE insmod
+	BEGIN
+		FILE "<TMPL_VAR NAME=target>"
+		FILE "/sbin/insmod"
+
+		# optionList may be undef
+		# and already is suitably escaped.
+		SCRIPT "/sbin/init"
+		BEGIN
+			!/sbin/insmod '<TMPL_VAR NAME=target>' <TMPL_VAR NAME=optionList>
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE mkbdev
+	BEGIN
+		SCRIPT "/sbin/init"
+		BEGIN
+			!mkbdev '<TMPL_VAR NAME=target>' '<TMPL_VAR NAME=sysname>'
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# We cannot make mapper/control any earlier,
+	# since dm-mod needs to be loaded to be able
+	# to determine devno.
+	#
+	TEMPLATE vgchange
+	BEGIN
+		FILE "/lib/lvm-200/vgchange"
+		FILE "/sbin/vgchange"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!if [ ! -c /dev/mapper/control ]
+			!then
+			!	/bin/mkdir /dev/mapper
+			!	mkcdev /dev/mapper/control misc/device-mapper
+			!fi
+			!/sbin/vgchange -a y '<TMPL_VAR NAME=target>'
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: mdadm can operate without knowledge
+	# of device numbers; it will assign an unused
+	# one to the new device.  Thus you could have
+	# device name /dev/md/boot that is stable,
+	# regardless of which other raid devices are
+	# operational.  However, debian installer
+	# consistently uses device names like /dev/md0,
+	# where the name depends on earlier minors
+	# that happen to have been assigned.
+	# To work around this problem, we forego
+	# the --auto option, and mknod the device
+	# before putting an md under it.  Better hope
+	# the major number is not going to change ...
+	#
+	TEMPLATE mdadm
+	BEGIN
+		FILE "/sbin/mdadm"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!mknod <TMPL_VAR NAME=target> b <TMPL_VAR NAME=major> <TMPL_VAR NAME=minor>
+			!mdadm --assemble <TMPL_VAR NAME=target> --uuid <TMPL_VAR NAME=uuid> \
+			!	<TMPL_LOOP NAME=components> <TMPL_VAR NAME=dev></TMPL_LOOP>
+		END SCRIPT
+	END TEMPLATE
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - cipher
+	# - keySize (always there, 0 for NULL crypto)
+	# - hash (hashname or undef)
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		-c <TMPL_VAR NAME=cipher> \
+			!		-s <TMPL_VAR NAME=keySize> \
+			!		<TMPL_IF NAME=hash> \
+			!			-h '<TMPL_VAR NAME=hash>' \
+			!		</TMPL_IF> \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		create '<TMPL_VAR NAME=target>' \
+			!		'<TMPL_VAR NAME=src>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup_luks
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		luksOpen '<TMPL_VAR NAME=src>' \
+			!		'<TMPL_VAR NAME=target>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: honouring the kernel cmdline option ro,rw
+	# is very nice, but...  If you have an ext3 in a
+	# file loopback-mounted from vfat, it's unlikely
+	# that a remount rw of root will also make the
+	# underlying vfat read-write.  Underlying filesystems
+	# should ignore the kernel ro/rw option; we
+	# have an attribute isRoot that's defined iff
+	# this is the real root.
+	#
+	# always -n, since we dont have writable /etc/mtab.
+	#
+	TEMPLATE mount
+	BEGIN
+		SCRIPT "/sbin/init"
+		BEGIN
+			!/bin/mount -n \
+			!	<TMPL_IF NAME=isRoot>$ro</TMPL_IF> \
+			!	-t <TMPL_VAR NAME=fsType> \
+			!	<TMPL_VAR NAME=options> \
+			!	<TMPL_VAR NAME=device> \
+			!	<TMPL_VAR NAME=target>
+		END SCRIPT
+	END TEMPLATE
+
+	TEMPLATE nfsstart
+	BEGIN
+		FILE "<TMPL_VAR NAME=auxDir>/trynfs"
+		SCRIPT "/sbin/init"
+		BEGIN
+			!if [ "$ip" != "" ]
+			!then
+			!	<TMPL_VAR NAME=auxDir>/trynfs $ip $nfsroot /mnt
+			!	switchroot "$@"
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+	TEMPLATE postlude
+	BEGIN
+		SCRIPT "/sbin/init"
+		BEGIN
+			!switchroot "$@"
+		END SCRIPT
+	END TEMPLATE
+END TEMPLATE SET

Added: dists/trunk/utils/yaird/templates/Debian.cfg
===================================================================
--- dists/trunk/utils/yaird/templates/Debian.cfg	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/templates/Debian.cfg	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,388 @@
+#
+# Template -- for translation general intentions to exact initrd layout
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# These templates define the translation from general intentions in the
+# plan to exact lists of files and script fragments to be included 
+# on the initrd image.  Templates are indexed by an action name, and include:
+# 	- files to be copied from current system to initrd;
+# 	  often executables.
+# 	- directories to be created
+# 	- fragments to be appended to scripts on the image,
+# 	  these are in a hash from script name to script content.
+#
+# Everything is processed by HTML::Template before being added to the
+# image: script fragments, but also file names and script names.
+# Leading spaces are dropped from template lines.
+#
+# If you want to implement busybox support, this is the place to do it.
+#
+# Obviously, the template names and the attributes used in the template
+# should match what is provided by the planner.
+#
+#
+
+TEMPLATE SET
+	TEMPLATE prologue
+	BEGIN
+		# In principle, we don't want device files on the initrd
+		# image: device numbers can change between kernels.
+		# Instead, create device files at boot time based on info
+		# in sysfs.  However, /dev/null and /dev/console are needed
+		# to mount sysfs.
+		FILE "/dev/null"
+		FILE "/dev/console"
+		FILE "/bin/dash"
+		FILE "/bin/cat"
+		FILE "/bin/mkdir"
+		FILE "/bin/mount"
+		FILE "/bin/umount"
+		FILE "/bin/mknod"
+		FILE "/bin/sleep"
+		FILE "<TMPL_VAR NAME=auxDir>/run_init"
+
+		DIRECTORY "/mnt"
+		DIRECTORY "/proc"
+		DIRECTORY "/sys"
+		DIRECTORY "/dev"
+		DIRECTORY "/etc"
+		DIRECTORY "/var"
+
+		#
+		# We can provide debugging opportunities in the
+		# initramfs image; the question is when and how
+		# to enable this.  Consider two types of user:
+		# - a developer, working on the template
+		# - an end user, who has a boot problem with
+		#   an image that was generated automatically
+		#   after installing a new distribution kernel.
+		#
+		# The developer can simply add debugging code
+		# to the template.
+		# For the end user, adding an option to the kernel
+		# command line is easier to enable debugging
+		# than rebuilding the boot image with special
+		# options or a modified configuration file.
+		#
+		# For this reason, we won't provide a template
+		# parameter to control debugging, instead we
+		# interpret a new kernel command line parameter:
+		# ydebug.
+		#
+		SCRIPT "/init"
+		BEGIN
+			!#!/bin/dash
+			!#
+			!# Generator version: yaird <TMPL_VAR NAME=appVersion>.
+			!# Kernel version: <TMPL_VAR NAME=version>.
+			!#
+			!INIT_DEBUG=
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+			!
+			!#
+			!#  Utility functions
+			!#
+			!mksymdev () {
+			!	devfile="$1"
+			!	sysfile="$2"
+			!	cb="$3"
+			!	devpair=$(/bin/cat "$sysfile")
+			!	for delay in 1 2 4 8 16
+			!	do
+			!		if [ "$devpair" = "" ]
+			!		then
+			!			echo "Waiting $delay seconds for $sysfile to show up"
+			!			sleep $delay
+			!		fi
+			!		devpair=$(/bin/cat "$sysfile")
+			!	done
+			!
+			!	if [ "$devpair" = "" ]
+			!	then
+			!		echo "Device $sysfile seems to be down."
+			!		echo "Debugging opportunity, type ^D to continue."
+			!		/bin/dash
+			!	fi
+			!
+			!	maj=${devpair%:*}
+			!	min=${devpair#*:}
+			!	/bin/mknod "$devfile" $cb $maj $min
+			!}
+			!mkcdev () {
+			!	mksymdev "$1" "/sys/class/$2/dev" c
+			!}
+			!mkbdev () {
+			!	mksymdev "$1" "/sys/block/$2/dev" b
+			!}
+			!
+			!switchroot () {
+			!	if [ "$INIT_DEBUG" != "" ]
+			!	then
+			!		echo "Debugging opportunity, ^D to continue."
+			!		/bin/dash
+			!	fi
+			!
+			!	echo "Switching root ..."
+			!	/bin/umount -n /sys
+			!	/bin/umount -n /proc
+			!	exec <TMPL_VAR NAME=auxDir>/run_init \
+			!		/mnt $init "$@"
+			!}
+			!
+			!#
+			!# Setting up mounts
+			!#
+			!/bin/mount -nt sysfs sysfs /sys
+			!/bin/mount -nt proc proc /proc
+			!#
+			!# We don't set up a separate /dev file system,
+			!# since rootfs is writable without problem.
+			!#
+			!
+			!# /dev/tty is needed for eg cryptsetup.
+			!mkcdev /dev/tty tty/tty
+			!
+			!#
+			!# Command line processing
+			!# init - first proc to start on next root
+			!# root - to be done: how should it relate
+			!#	to file system selection?
+			!# ro,rw - mount root read-only or read-write.
+			!# 	This is like a mount -r; it overrules
+			!# 	a -o rw.
+			!# noresume, resume - to be done
+			!# ide - options for module ide_core.
+			!# 	need a way to append these to proper
+			!# 	module.  do a check on module name
+			!# 	in insmod template?
+			!# ip=, nfsaddrs=, nfsroot= - support NFS boot
+			!#
+			!ro=-r
+			!ip=
+			!nfsroot=
+			!init=/sbin/init
+			!for i in $(cat /proc/cmdline)
+			!do
+			!	case "$i" in
+			!	init=*)
+			!		init=${i#init=}
+			!		;;
+			!	ro)
+			!		ro=-r
+			!		;;
+			!	rw)
+			!		ro=
+			!		;;
+			!	ip=*|nfsaddrs=*)
+			!		ip="$ip $i"
+			!		;;
+			!	nfsroot=*)
+			!		nfsroot="$i"
+			!		;;
+			!	ydebug)
+			!		INIT_DEBUG=yes
+			!	esac
+			!done
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE insmod
+	BEGIN
+		FILE "<TMPL_VAR NAME=target>"
+		FILE "/sbin/insmod"
+
+		# optionList may be undef
+		# and already is suitably escaped.
+		SCRIPT "/init"
+		BEGIN
+			!/sbin/insmod '<TMPL_VAR NAME=target>' \
+			!	<TMPL_VAR NAME=optionList>
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE mkbdev
+	BEGIN
+		SCRIPT "/init"
+		BEGIN
+			!mkbdev '<TMPL_VAR NAME=target>' '<TMPL_VAR NAME=sysname>'
+		END SCRIPT
+	END TEMPLATE
+
+	#
+	# We cannot make mapper/control any earlier,
+	# since dm-mod needs to be loaded to be able
+	# to determine devno.
+	#
+	TEMPLATE vgchange
+	BEGIN
+		FILE "/lib/lvm-200/vgchange"
+		FILE "/sbin/vgchange"
+		SCRIPT "/init"
+		BEGIN
+			!if [ ! -c /dev/mapper/control ]
+			!then
+			!	/bin/mkdir /dev/mapper
+			!	mkcdev /dev/mapper/control misc/device-mapper
+			!fi
+			!/sbin/vgchange -a y '<TMPL_VAR NAME=target>'
+		END SCRIPT
+	END TEMPLATE
+
+	#
+	# NOTE: mdadm can operate without knowledge
+	# of device numbers; it will assign an unused
+	# one to the new device.  Thus you could have
+	# device name /dev/md/boot that is stable,
+	# regardless of which other raid devices are
+	# operational.  However, debian installer
+	# consistently uses device names like /dev/md0,
+	# where the name depends on earlier minors
+	# that happen to have been assigned.
+	# To work around this problem, we forego
+	# the --auto option, and mknod the device
+	# before putting an md under it.  Better hope
+	# the major number is not going to change ...
+	#
+	TEMPLATE mdadm
+	BEGIN
+		FILE "/sbin/mdadm"
+		SCRIPT "/init"
+		BEGIN
+			!mknod <TMPL_VAR NAME=target> b <TMPL_VAR NAME=major> <TMPL_VAR NAME=minor>
+			!mdadm --assemble <TMPL_VAR NAME=target> --uuid <TMPL_VAR NAME=uuid> \
+			!	<TMPL_LOOP NAME=components> <TMPL_VAR NAME=dev></TMPL_LOOP>
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - cipher
+	# - keySize (always there, 0 for NULL crypto)
+	# - hash (hashname or undef)
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		-c <TMPL_VAR NAME=cipher> \
+			!		-s <TMPL_VAR NAME=keySize> \
+			!		<TMPL_IF NAME=hash> \
+			!			-h '<TMPL_VAR NAME=hash>' \
+			!		</TMPL_IF> \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		create '<TMPL_VAR NAME=target>' \
+			!		'<TMPL_VAR NAME=src>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup_luks
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		luksOpen '<TMPL_VAR NAME=src>' \
+			!		'<TMPL_VAR NAME=target>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: honouring the kernel cmdline option ro,rw
+	# is very nice, but...  If you have an ext3 in a
+	# file loopback-mounted from vfat, it's unlikely
+	# that a remount rw of root will also make the
+	# underlying vfat read-write.  Underlying filesystems
+	# should ignore the kernel ro/rw option; we
+	# have an attribute isRoot that's defined iff
+	# this is the real root.
+	#
+	# always -n, since we dont have writable /etc/mtab.
+	#
+	TEMPLATE mount
+	BEGIN
+		SCRIPT "/init"
+		BEGIN
+			!/bin/mount -n \
+			!	<TMPL_IF NAME=isRoot>$ro</TMPL_IF> \
+			!	-t <TMPL_VAR NAME=fsType> \
+			!	<TMPL_VAR NAME=options> \
+			!	<TMPL_VAR NAME=device> \
+			!	<TMPL_VAR NAME=target>
+		END SCRIPT
+	END TEMPLATE
+
+	TEMPLATE nfsstart
+	BEGIN
+		FILE "<TMPL_VAR NAME=auxDir>/trynfs"
+		SCRIPT "/init"
+		BEGIN
+			!if [ "$ip" != "" ]
+			!then
+			!	<TMPL_VAR NAME=auxDir>/trynfs $ip $nfsroot /mnt
+			!	switchroot "$@"
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+	TEMPLATE postlude
+	BEGIN
+		SCRIPT "/init"
+		BEGIN
+			!switchroot "$@"
+		END SCRIPT
+	END TEMPLATE
+END TEMPLATE SET

Added: dists/trunk/utils/yaird/templates/Default.cfg.in
===================================================================
--- dists/trunk/utils/yaird/templates/Default.cfg.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/templates/Default.cfg.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,137 @@
+#
+# Default.cfg.in - default Yaird configuration file
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+#
+
+CONFIG
+	#
+	# FORMAT -- Which default format to use for the generated image.
+	# use 'cpio' for initramfs, 'directory' if the image is not to
+	# packed in a single file, or 'cramfs' for initrd images.
+	# Can be overridden by command line option.
+	#
+	FORMAT	cpio
+
+	#
+	# TEMPLATE FILE -- This file contains boilerplate code
+	# to be used on certain occassions, eg when a module is to
+	# be inserted or a device to be created.  The boilerplate
+	# can be adapted for differences between distributions.
+	#
+	TEMPLATE FILE "@CFGDIR@/Templates.cfg"
+
+	#
+	# GOALS -- What should go on the generated image,
+	# in high-level terms.
+	#
+	GOALS
+		#
+		# TEMPLATE -- Insert named piece of boilerplate
+		# from the templates file.  There is no mechanism
+		# to pass parameters.
+		#
+		# By contention, 'prologue' is the first template
+		# added to the image; it should be used to interpret
+		# boot command line parameters.
+		#
+		TEMPLATE	prologue
+
+		#
+		# INPUT -- Insert all modules needed for keyboard
+		# devices found on the machine where the image is generated.
+		# This could also be handled by init scripts on the real
+		# root device, except of course when the keyboard is needed
+		# to enter a password for an encrypted root device.
+		#
+		# Instead of adding only modules for the keyboard devices
+		# found at the time the image is generated, you could also
+		# use a number of predefined devices, eg usbhid, psmouse,
+		# i8042, serio, atkbd.  The advantage is that you don't
+		# have to change the image if the hardware is changed,
+		# the disadvantage is that it stops working if you get a
+		# new kernel where the modules are named differently.
+		#
+		INPUT
+
+		#
+		# MODULE -- make a module available.  If the module is
+		# known to be compiled in the kernel, nothing is added
+		# to the image.  Otherwise, insmod(8) statements are
+		# added in the order given by modprobe(8).
+		#
+		# mousedev implements /dev/input/mice, a device that
+		# collects input from all mice attached to the system.
+		# It is used by X windows and GPM.  This module is not
+		# necessary to boot the system; if your kernel does
+		# not include this module, you can simply delete the
+		# following module line.  Ditto if the module is loaded
+		# via the init scripts on the root device, eg if it's
+		# listed in /etc/modules.
+		#
+		# evdev implements /dev/input/eventX, devices that present
+		# keyboard and mouse input in a manner independent from
+		# the console.  It also helps yaird to detect what kind of
+		# keyboard is connected to the system.  This module is not
+		# necessary to boot the system.
+		#
+		MODULE		mousedev
+		MODULE		evdev
+
+		#
+		# NETWORK -- Insert modules for all ethernet devices
+		# connected to the system, eg for NFS boot.  Note that
+		# the 'network' command does not set up IP addresses,
+		# only the hardware.
+		#
+		# NETWORK
+		#
+		# nfs implements the NFS protocol.
+		# MODULE	nfs
+		#
+		# af_packet allows access to network devices below
+		# the IP level, as raw packets.  It's needed for DHCP clients.
+		# MODULE	af_packet
+		#
+		# the nfsstart template uses DHCP to find IP addresses
+		# for the ethernet devices, then mounts a boot disk
+		# specified with DHCP and hands switches root to that.
+		# TEMPLATE	nfsstart
+
+		#
+		# MOUNTDIR -- Given a directory name that occurs in
+		# fstab, eg "/", insert all modules needed to access
+		# the underlying block device and file system type,
+		# and mount it somewhere else, eg in "/mnt".
+		# The block device can be raid, LVM, or encrypted.
+		#
+		MOUNTDIR	"/" "/mnt"
+
+		#
+		# MOUNTDEV -- You can also specify the device to be
+		# mounted as a block special file.  It still needs to
+		# occur in fstab.
+		#
+                # MOUNTDEV	"/dev/hda3" "/mnt"
+
+		#
+		# By convention, 'postlude' is the last template added.
+		# It should switch root to "/mnt".
+		#
+		TEMPLATE	postlude
+	END GOALS
+END CONFIG

Added: dists/trunk/utils/yaird/templates/Fedora.cfg
===================================================================
--- dists/trunk/utils/yaird/templates/Fedora.cfg	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/templates/Fedora.cfg	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,410 @@
+#
+# Template -- for translation general intentions to exact initrd layout
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# These templates define the translation from general intentions in the
+# plan to exact lists of files and script fragments to be included 
+# on the initrd image.  Templates are indexed by an action name, and include:
+# 	- files to be copied from current system to initrd;
+# 	  often executables.
+# 	- directories to be created
+# 	- fragments to be appended to scripts on the image,
+# 	  these are in a hash from script name to script content.
+#
+# Everything is processed by HTML::Template before being added to the
+# image: script fragments, but also file names and script names.
+# Leading spaces are dropped from template lines.
+#
+# If you want to implement busybox support, this is the place to do it.
+#
+# Obviously, the template names and the attributes used in the template
+# should match what is provided by the planner.
+#
+#
+
+TEMPLATE SET
+	TEMPLATE prologue
+	BEGIN
+		# In principle, we don't want device files on the initrd
+		# image: device numbers can change between kernels.
+		# Instead, create device files at boot time based on info
+		# in sysfs.  However, /dev/null and /dev/console are needed
+		# to mount sysfs.
+		FILE "/dev/null"
+		FILE "/dev/console"
+		FILE "/bin/ash"
+		FILE "/bin/cat"
+		FILE "/bin/mkdir"
+		FILE "/bin/mount"
+		FILE "/bin/umount"
+		FILE "/bin/mknod"
+		FILE "/bin/sleep"
+		FILE "<TMPL_VAR NAME=auxDir>/run_init"
+
+		DIRECTORY "/mnt"
+		DIRECTORY "/proc"
+		DIRECTORY "/sys"
+		DIRECTORY "/dev"
+		DIRECTORY "/etc"
+		DIRECTORY "/var"
+
+		#
+		# We can provide debugging opportunities in the
+		# initramfs image; the question is when and how
+		# to enable this.  Consider two types of user:
+		# - a developer, working on the template
+		# - an end user, who has a boot problem with
+		#   an image that was generated automatically
+		#   after installing a new distribution kernel.
+		#
+		# The developer can simply add debugging code
+		# to the template.
+		# For the end user, adding an option to the kernel
+		# command line is easier to enable debugging
+		# than rebuilding the boot image with special
+		# options or a modified configuration file.
+		#
+		# For this reason, we won't provide a template
+		# parameter to control debugging, instead we
+		# interpret a new kernel command line parameter:
+		# ydebug.
+		#
+		SCRIPT "/init"
+		BEGIN
+			!#!/bin/ash
+			!#
+			!# Generator version: yaird <TMPL_VAR NAME=appVersion>.
+			!# Kernel version: <TMPL_VAR NAME=version>.
+			!#
+			!INIT_DEBUG=
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+			!
+			!#
+			!#  Utility functions
+			!#
+			!mksymdev () {
+			!	devfile="$1"
+			!	sysfile="$2"
+			!	cb="$3"
+			!	devpair=$(/bin/cat "$sysfile")
+			!	for delay in 1 2 4 8 16
+			!	do
+			!		if [ "$devpair" = "" ]
+			!		then
+			!			echo "Waiting $delay seconds for $sysfile to show up"
+			!			sleep $delay
+			!		fi
+			!		devpair=$(/bin/cat "$sysfile")
+			!	done
+			!
+			!	if [ "$devpair" = "" ]
+			!	then
+			!		echo "Device $sysfile seems to be down."
+			!		echo "Debugging opportunity, type ^D to continue."
+			!		/bin/ash
+			!	fi
+			!
+			!	maj=${devpair%:*}
+			!	min=${devpair#*:}
+			!	/bin/mknod "$devfile" $cb $maj $min
+			!}
+			!mkcdev () {
+			!	mksymdev "$1" "/sys/class/$2/dev" c
+			!}
+			!mkbdev () {
+			!	mksymdev "$1" "/sys/block/$2/dev" b
+			!}
+			!
+			!#
+			!# fedora does not come with populated /dev 
+			!# on root and needs at least /dev/console.
+			!# Pass them via tmpfs.
+			!#
+			!switchroot () {
+			!	if [ "$INIT_DEBUG" != "" ]
+			!	then
+			!		echo "Debugging opportunity, ^D to continue."
+			!		/bin/ash
+			!	fi
+			!
+			!	echo "Switching root ..."
+			!	cd /mnt
+			!	mkcdev /dev/null mem/null
+			!	mkcdev /dev/zero mem/zero
+			!	mkcdev /dev/console tty/console
+			!	mkdir /dev/pts
+			!	mkdir /dev/shm
+			!	mount -n -t tmpfs --bind /dev /mnt/dev
+			!	/bin/umount -n /sys
+			!	/bin/umount -n /proc
+			!	exec <TMPL_VAR NAME=auxDir>/run_init \
+			!		/mnt $init "$@"
+			!}
+			!
+			!#
+			!# Setting up mounts
+			!#
+			!/bin/mount -nt sysfs sysfs /sys
+			!/bin/mount -nt proc proc /proc
+			!# In Fedora FC3, tmpfs *must* have the name
+			!# 'none', otherwise start_udev, called from
+			!# rc.sysinit will mount a new tmpfs over it,
+			!# and you loose access to nodes such as
+			!# /dev/vg0/root, expected to be created by
+			!# LVM in initramfs.
+			!/bin/mount -nt tmpfs none /dev
+			!
+			!# /dev/tty is needed for eg cryptsetup.
+			!mkcdev /dev/tty tty/tty
+			!
+			!#
+			!# Command line processing
+			!# init - first proc to start on next root
+			!# root - to be done: how should it relate
+			!#	to file system selection?
+			!# ro,rw - mount root read-only or read-write.
+			!# 	This is like a mount -r; it overrules
+			!# 	a -o rw.
+			!# noresume, resume - to be done
+			!# ide - options for module ide_core.
+			!# 	need a way to append these to proper
+			!# 	module.  do a check on module name
+			!# 	in insmod template?
+			!# ip=, nfsaddrs=, nfsroot= - support NFS boot
+			!#
+			!ro=-r
+			!ip=
+			!nfsroot=
+			!init=/sbin/init
+			!for i in $(cat /proc/cmdline)
+			!do
+			!	case "$i" in
+			!	init=*)
+			!		init=${i#init=}
+			!		;;
+			!	ro)
+			!		ro=-r
+			!		;;
+			!	rw)
+			!		ro=
+			!		;;
+			!	ip=*|nfsaddrs=*)
+			!		ip="$ip $i"
+			!		;;
+			!	nfsroot=*)
+			!		nfsroot="$i"
+			!		;;
+			!	ydebug)
+			!		INIT_DEBUG=yes
+			!	esac
+			!done
+			!if [ "$INIT_DEBUG" != "" ]
+			!then
+			!	set -x
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE insmod
+	BEGIN
+		FILE "<TMPL_VAR NAME=target>"
+		FILE "/sbin/insmod"
+		
+		# optionList may be undef
+		# and already is suitably escaped.
+		SCRIPT "/init"
+		BEGIN
+			!/sbin/insmod '<TMPL_VAR NAME=target>' \
+			!	<TMPL_VAR NAME=optionList>
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE mkbdev
+	BEGIN
+		SCRIPT "/init"
+		BEGIN
+			!mkbdev '<TMPL_VAR NAME=target>' '<TMPL_VAR NAME=sysname>'
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# Use static version of LVM.  Note that fedora starts with
+	# empty /dev, so we must make device nodes explicitly.
+	#
+	# We cannot make /dev/mapper/control any earlier,
+	# since dm-mod needs to be loaded to be able
+	# to determine devno.
+	#
+	TEMPLATE vgchange
+	BEGIN
+		FILE "/sbin/lvm"
+		SCRIPT "/init"
+		BEGIN
+			!if [ ! -c /dev/mapper/control ]
+			!then
+			!	/bin/mkdir /dev/mapper
+			!	mkcdev /dev/mapper/control misc/device-mapper
+			!fi
+			!/sbin/lvm vgchange -a y '<TMPL_VAR NAME=target>'
+			!/sbin/lvm vgmknodes
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: mdadm can operate without knowledge
+	# of device numbers; it will assign an unused
+	# one to the new device.  Thus you could have
+	# device name /dev/md/boot that is stable,
+	# regardless of which other raid devices are
+	# operational.  However, debian installer
+	# consistently uses device names like /dev/md0,
+	# where the name depends on earlier minors
+	# that happen to have been assigned.
+	# To work around this problem, we forego
+	# the --auto option, and mknod the device
+	# before putting an md under it.  Better hope
+	# the major number is not going to change ...
+	#
+	TEMPLATE mdadm
+	BEGIN
+		FILE "/sbin/mdadm"
+		SCRIPT "/init"
+		BEGIN
+			!mknod <TMPL_VAR NAME=target> b <TMPL_VAR NAME=major> <TMPL_VAR NAME=minor>
+			!mdadm --assemble <TMPL_VAR NAME=target> --uuid <TMPL_VAR NAME=uuid> \
+			!	<TMPL_LOOP NAME=components> <TMPL_VAR NAME=dev></TMPL_LOOP>
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - cipher
+	# - keySize (always there, 0 for NULL crypto)
+	# - hash (hashname or undef)
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		-c <TMPL_VAR NAME=cipher> \
+			!		-s <TMPL_VAR NAME=keySize> \
+			!		<TMPL_IF NAME=hash> \
+			!			-h '<TMPL_VAR NAME=hash>' \
+			!		</TMPL_IF> \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		create '<TMPL_VAR NAME=target>' \
+			!		'<TMPL_VAR NAME=src>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# cryptsetup arguments:
+	# - target
+	# - src
+	# - verify (yes or undef)
+	#
+	# A loop around 'cryptsetup --verify' can help detect
+	# and correct typo's in the crypt password.
+	#
+	TEMPLATE cryptsetup_luks
+	BEGIN
+		FILE "/sbin/cryptsetup"
+		SCRIPT "/init"
+		BEGIN
+			!DOCRYPT=1
+			!while [ "$DOCRYPT" != "0" ]
+			!do
+			!	/sbin/cryptsetup \
+			!		<TMPL_IF NAME=verify>-y </TMPL_IF> \
+			!		luksOpen '<TMPL_VAR NAME=src>' \
+			!		'<TMPL_VAR NAME=target>'
+			!	DOCRYPT=$?
+			!done
+		END SCRIPT
+	END TEMPLATE
+
+
+	#
+	# NOTE: honouring the kernel cmdline option ro,rw
+	# is very nice, but...  If you have an ext3 in a
+	# file loopback-mounted from vfat, it's unlikely
+	# that a remount rw of root will also make the
+	# underlying vfat read-write.  Underlying filesystems
+	# should ignore the kernel ro/rw option; we
+	# have an attribute isRoot that's defined iff
+	# this is the real root.
+	#
+	# always -n, since we dont have writable /etc/mtab.
+	#
+	TEMPLATE mount
+	BEGIN
+		SCRIPT "/init"
+		BEGIN
+			!/bin/mount -n \
+			!	<TMPL_IF NAME=isRoot>$ro</TMPL_IF> \
+			!	-t <TMPL_VAR NAME=fsType> \
+			!	<TMPL_VAR NAME=options> \
+			!	<TMPL_VAR NAME=device> \
+			!	<TMPL_VAR NAME=target>
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE nfsstart
+	BEGIN
+		FILE "<TMPL_VAR NAME=auxDir>/trynfs"
+		SCRIPT "/init"
+		BEGIN
+			!if [ "$ip" != "" ]
+			!then
+			!	<TMPL_VAR NAME=auxDir>/trynfs $ip $nfsroot /mnt
+			!	switchroot "$@"
+			!fi
+		END SCRIPT
+	END TEMPLATE
+
+
+	TEMPLATE postlude
+	BEGIN
+		SCRIPT "/init"
+		BEGIN
+			!switchroot "$@"
+		END SCRIPT
+	END TEMPLATE
+END TEMPLATE SET

Added: dists/trunk/utils/yaird/templates/Makefile.am
===================================================================
--- dists/trunk/utils/yaird/templates/Makefile.am	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/templates/Makefile.am	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,45 @@
+# 
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+include ../Makefile.incl
+
+edit =	sed \
+	-e 's!@PERL\@!$(PERL)!' \
+	-e 's!@PACKAGE\@!$(PACKAGE)!' \
+	-e 's!@VERSION\@!$(VERSION)!' \
+	-e 's!@AUXDIR\@!$(auxdir)!' \
+	-e 's!@CFGDIR\@!$(configdir)!' \
+	-e 's!@PERLDIR\@!$(perldir)!'
+
+Default.cfg: Default.cfg.in
+	$(edit) < $< > $@
+
+# not installed, but must go in the tarball.
+EXTRA_DIST = \
+	Default.cfg.in
+
+CLEANFILES	= Default.cfg
+nodist_config_DATA = \
+	Default.cfg
+
+# installed, and must go in tarball
+dist_config_DATA = \
+	Fedora.cfg \
+	Debian.cfg \
+	Debian-initrd.cfg
+

Added: dists/trunk/utils/yaird/templates/Makefile.in
===================================================================
--- dists/trunk/utils/yaird/templates/Makefile.in	2005-10-16 09:32:26 UTC (rev 4471)
+++ dists/trunk/utils/yaird/templates/Makefile.in	2005-10-16 09:41:17 UTC (rev 4472)
@@ -0,0 +1,405 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+# 
+# Makefile.incl -- shared defines between makefiles
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# - auxdir contains package specific executables that may be included
+#   in the generated image
+# - perldir contains perl modules to be included by the main program
+# - configdir is where templates and such distributed with the application
+#   live.  For now /usr/local/lib/yaird/conf/; the intention is to
+#   allow some kind of override from /etc/yaird/ in a later release.
+#
+# This cannot be simply passed from the master makefile; that would
+# be invisible to automake.
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(dist_config_DATA) $(srcdir)/../Makefile.incl \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = templates
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(configdir)" "$(DESTDIR)$(configdir)"
+dist_configDATA_INSTALL = $(INSTALL_DATA)
+nodist_configDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_config_DATA) $(nodist_config_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+auxdir = $(pkglibdir)/exec
+perldir = $(pkglibdir)/perl
+configdir = $(pkglibdir)/conf
+
+# 
+# Makefile.am -- installation and packaging instructions
+#   Copyright (C) 2005  Erik van Konijnenburg
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+edit = sed \
+	-e 's!@PERL\@!$(PERL)!' \
+	-e 's!@PACKAGE\@!$(PACKAGE)!' \
+	-e 's!@VERSION\@!$(VERSION)!' \
+	-e 's!@AUXDIR\@!$(auxdir)!' \
+	-e 's!@CFGDIR\@!$(configdir)!' \
+	-e 's!@PERLDIR\@!$(perldir)!'
+
+
+# not installed, but must go in the tarball.
+EXTRA_DIST = \
+	Default.cfg.in
+
+CLEANFILES = Default.cfg
+nodist_config_DATA = \
+	Default.cfg
+
+
+# installed, and must go in tarball
+dist_config_DATA = \
+	Fedora.cfg \
+	Debian.cfg \
+	Debian-initrd.cfg
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../Makefile.incl $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  templates/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  templates/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-dist_configDATA: $(dist_config_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)"
+	@list='$(dist_config_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(dist_configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \
+	  $(dist_configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \
+	done
+
+uninstall-dist_configDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_config_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(configdir)/$$f"; \
+	done
+install-nodist_configDATA: $(nodist_config_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)"
+	@list='$(nodist_config_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(nodist_configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \
+	  $(nodist_configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \
+	done
+
+uninstall-nodist_configDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_config_DATA)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(configdir)/$$f"; \
+	done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(configdir)" "$(DESTDIR)$(configdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_configDATA install-nodist_configDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_configDATA uninstall-info-am \
+	uninstall-nodist_configDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-dist_configDATA install-exec install-exec-am \
+	install-info install-info-am install-man \
+	install-nodist_configDATA install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-dist_configDATA uninstall-info-am \
+	uninstall-nodist_configDATA
+
+
+Default.cfg: Default.cfg.in
+	$(edit) < $< > $@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:




More information about the Kernel-svn-changes mailing list