Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8c36711
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,145 @@
+#
+#    Copyright (c) 2010-2011 Nest, Inc.
+#    All rights reserved.
+#
+#    This document is the property of Nest. It is considered
+#    confidential and proprietary information.
+#
+#    This document may not be reproduced or transmitted in any form,
+#    in whole or in part, without the express written permission of
+#    Nest.
+#
+#    Description:
+#      This file is the make file for util-linux, a variety of low-
+#      level system utilities for Linux.
+#
+
+BuildConfigSpecialized	:= No
+BuildProductSpecialized	:= No
+
+include pre.mak
+
+PackageName		:= util-linux-ng
+
+PackageExtension	:= tar.bz2
+PackageSeparator	:= -
+
+PackageArchive		:= $(PackageName).$(PackageExtension)
+PackageSourceDir	:= $(PackageName)$(PackageSeparator)$(PackageVersion)
+
+PackageBuildMakefile	= $(call GenerateBuildPaths,Makefile)
+
+CleanPaths		+= $(PackageLicenseFile)
+
+LinuxDir		:= sw/tps/linux
+LinuxIncDir		:= $(call GenerateResultPaths,$(LinuxDir),include)
+
+NCursesDir		:= sw/tps/ncurses
+NCursesIncDir		:= $(call GenerateResultPaths,$(NCursesDir),usr/include)
+NCursesLibDir		:= $(call GenerateResultPaths,$(NCursesDir),usr/lib)
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(PackageSourceDir)/COPYING: source
+
+$(PackageLicenseFile): $(PackageSourceDir)/COPYING
+	$(copy-result)
+
+# Extract the source from the archive and apply patches, if any.
+
+$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
+	$(expand-and-patch-package)
+
+# Prepare the sources.
+
+.PHONY: source
+source: | $(PackageSourceDir)
+
+# Patch the sources, if necessary.
+
+.PHONY: patch
+patch: source
+
+# Generate the package build makefile.
+
+$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory)
+	$(Verbose)cd $(BuildDirectory) && \
+	$(CURDIR)/$(PackageSourceDir)/configure \
+	CC="$(CC)" CXX="$(CXX)" AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+	CPPFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncDir)) \
+	$(call ToolGenerateIncludeArgument,$(NCursesIncDir))" \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	LDFLAGS="-L$(NCursesLibDir)" \
+	--build=$(HostTuple) \
+	--host=$(TargetTuple) \
+	--prefix=/usr \
+	--sysconfdir=/etc \
+	--localstatedir=/var \
+	--disable-agetty \
+	--disable-cramfs \
+	--disable-elvtune \
+	--disable-fallocate \
+	--disable-fsck \
+	--disable-init \
+	--disable-kill \
+	--disable-last \
+	--disable-login-utils \
+	--disable-makeinstall-chown \
+	--disable-makeinstall-setuid \
+	--disable-mesg \
+	--disable-nls \
+	--disable-partx \
+	--disable-pivot_root \
+	--disable-raw \
+	--disable-rdev \
+	--disable-rename \
+	--disable-reset \
+	--disable-schedutils \
+	--disable-switch_root \
+	--disable-tls \
+	--disable-unshare \
+	--disable-uuidd \
+	--disable-wall \
+	--disable-write \
+	--enable-libblkid \
+	--enable-libuuid \
+	--with-ncurses \
+	--without-slang \
+	--without-pam \
+	--without-selinux \
+	--without-audit
+
+# Configure the source for building.
+
+.PHONY: configure
+configure: source $(PackageBuildMakefile)
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+.PHONY: build
+build: configure
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	all
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+.PHONY: stage
+stage: build | $(ResultDirectory)
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	DESTDIR=$(ResultDirectory) \
+	install
+
+clean:
+	$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
+
+include post.mak
diff --git a/util-linux-ng-2.17.2/ABOUT-NLS b/util-linux-ng-2.17.2/ABOUT-NLS
new file mode 100644
index 0000000..2f50c66
--- /dev/null
+++ b/util-linux-ng-2.17.2/ABOUT-NLS
@@ -0,0 +1,768 @@
+Notes on the Free Translation Project
+*************************************
+
+Free software is going international!  The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that will gradually become able to speak many languages.
+A few packages already provide translations for their messages.
+
+   If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site.  But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+   Installers will find here some useful hints.  These notes also
+explain how users should proceed for getting the programs to use the
+available translations.  They tell how people wanting to contribute and
+work at translations should contact the appropriate team.
+
+   When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used.  The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+Quick configuration advice
+==========================
+
+If you want to exploit the full power of internationalization, you
+should configure it using
+
+     ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed.  So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation.  Future versions of GNU `gettext' will
+very likely convey even more functionality.  So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+   So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+INSTALL Matters
+===============
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language.  Most such
+packages use GNU `gettext'.  Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+   By default, this package will be installed to allow translation of
+messages.  It will automatically detect whether the system already
+provides the GNU `gettext' functions.  If not, the GNU `gettext' own
+library will be used.  This library is wholly contained within this
+package, usually in the `intl/' subdirectory, so prior installation of
+the GNU `gettext' package is _not_ required.  Installers may use
+special options at configuration time for changing the default
+behaviour.  The commands:
+
+     ./configure --with-included-gettext
+     ./configure --disable-nls
+
+will respectively bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+   When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this.  This might be not what is desirable.  You
+should use the more recent version of the GNU `gettext' library.  I.e.
+if the file `intl/VERSION' shows that the library which comes with this
+package is more recent, you should use
+
+     ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+   The configuration process will not test for the `catgets' function
+and therefore it will not be used.  The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+   Internationalized packages have usually many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language.  Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package.  However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+Using This Package
+==================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination.  Here `LL' is an ISO 639 two-letter language code,
+and `CC' is an ISO 3166 two-letter country code.  For example, let's
+suppose that you speak German and live in Germany.  At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+   You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries.  For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
+country code serves to distinguish the dialects.
+
+   The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc.  On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
+locales supported by your system for your country by running the command
+`locale -a | grep '^LL''.
+
+   Not all programs have translations for all languages.  By default, an
+English message is shown in place of a nonexistent translation.  If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries.  For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+   Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003).  During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+   In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect.  For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+Translating Teams
+=================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list.  The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
+area.
+
+   If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended.  For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+     subscribe
+
+   Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around.  If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `translation@iro.umontreal.ca' to reach the
+coordinator for all translator teams.
+
+   The English team is special.  It works at improving and uniformizing
+the terminology in use.  Proven linguistic skill are praised more than
+programming skill, here.
+
+Available Packages
+==================
+
+Languages are not equally supported in all packages.  The following
+matrix shows the current state of internationalization, as of January
+2004.  The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+     Ready PO files       af am ar az be bg bs ca cs da de el en en_GB eo es
+                        +----------------------------------------------------+
+     a2ps               |             []             [] [] []                |
+     aegis              |                               ()                   |
+     ant-phone          |                               ()                   |
+     anubis             |                                                    |
+     ap-utils           |                                                    |
+     aspell             |             []                                     |
+     bash               |                      []       []             [] [] |
+     batchelor          |                                                    |
+     bfd                |                            []                   [] |
+     binutils           |                            []                   [] |
+     bison              |                            [] []                [] |
+     bluez-pin          | []                      []                   []    |
+     clisp              |                                                    |
+     clisp              |                               []    []          [] |
+     console-tools      |                         []    []                   |
+     coreutils          |                      []    [] []                [] |
+     cpio               |                            [] []                [] |
+     darkstat           |                []          ()                   [] |
+     diffutils          |                      [] [] [] [] []          [] [] |
+     e2fsprogs          |                         []    []                [] |
+     enscript           |                      []    [] []        []         |
+     error              |                      []    [] []        []      [] |
+     fetchmail          |                      [] () [] [] []             [] |
+     fileutils          |                            [] []                [] |
+     findutils          |             []       []    [] [] []          [] [] |
+     flex               |                      []    [] []                [] |
+     fslint             |                                                    |
+     gas                |                                                 [] |
+     gawk               |                      []    [] []                [] |
+     gbiff              |                               []                   |
+     gcal               |                      []                            |
+     gcc                |                            []                   [] |
+     gettext            |             []       []    [] []                [] |
+     gettext-examples   | []                   []       []                [] |
+     gettext-runtime    |             []       []    [] []                [] |
+     gettext-tools      |                      []       []                [] |
+     gimp-print         |                         [] [] []        []      [] |
+     gliv               |                                                    |
+     glunarclock        |                            [] []                   |
+     gnubiff            |                               []                   |
+     gnucash            |                         []    ()        []      [] |
+     gnucash-glossary   |                            [] ()                [] |
+     gnupg              |                      [] ()    [] []          [] [] |
+     gpe-aerial         |                         []                         |
+     gpe-beam           |                         []    []                   |
+     gpe-calendar       |                         []    []                   |
+     gpe-clock          |                         []    []                   |
+     gpe-conf           |                         []    []                   |
+     gpe-contacts       |                         []    []                   |
+     gpe-edit           |                         []                         |
+     gpe-go             |                         []                         |
+     gpe-login          |                         []    []                   |
+     gpe-ownerinfo      |                         []    []                   |
+     gpe-sketchbook     |                         []    []                   |
+     gpe-su             |                         []    []                   |
+     gpe-taskmanager    |                         []    []                   |
+     gpe-timesheet      |                         []                         |
+     gpe-today          |                         []    []                   |
+     gpe-todo           |                         []    []                   |
+     gphoto2            |                         [] [] []                [] |
+     gprof              |                            [] []                [] |
+     gpsdrive           |                               ()    ()          () |
+     gramadoir          |                               []                   |
+     grep               |             [] []    []       [] []             [] |
+     gretl              |                                                 [] |
+     gtick              | []                            ()                   |
+     hello              |                      []    [] [] []          [] [] |
+     id-utils           |                            [] []                   |
+     indent             |                      []       []             [] [] |
+     iso_3166           |          []    [] [] [] [] [] [] []          [] [] |
+     iso_3166_1         |                      [] [] [] [] []             [] |
+     iso_3166_2         |                                                    |
+     iso_3166_3         |                               []                   |
+     iso_4217           |                      []    [] []                [] |
+     iso_639            |                                                    |
+     jpilot             |                         [] []                   [] |
+     jtag               |                                                    |
+     jwhois             |                                                 [] |
+     kbd                |                         [] [] [] []             [] |
+     latrine            |                               ()                   |
+     ld                 |                            []                   [] |
+     libc               |                      [] [] [] [] []             [] |
+     libgpewidget       |                         []    []                   |
+     libiconv           |                      []    [] []             [] [] |
+     lifelines          |                            [] ()                   |
+     lilypond           |                               []                   |
+     lingoteach         |                                                    |
+     lingoteach_lessons |                               ()                () |
+     lynx               |                      [] [] [] []                   |
+     m4                 |                         [] [] [] []                |
+     mailutils          |                      []                         [] |
+     make               |                            [] []                [] |
+     man-db             |                      [] () [] []                () |
+     minicom            |                         []    []                [] |
+     mysecretdiary      |                            [] []                [] |
+     nano               |                      [] () [] []                [] |
+     nano_1_0           |                      [] () [] []                [] |
+     opcodes            |                                                 [] |
+     parted             |                      [] [] [] []                [] |
+     ptx                |                      []    [] []             [] [] |
+     python             |                                                    |
+     radius             |                                                 [] |
+     recode             |             []       []    [] [] []          [] [] |
+     rpm                |                         [] []                      |
+     screem             |                                                    |
+     scrollkeeper       |             []       [] [] [] []                [] |
+     sed                | []                   []    [] []             [] [] |
+     sh-utils           |                            [] []                [] |
+     shared-mime-info   |                                                    |
+     sharutils          |                      [] [] [] [] []             [] |
+     silky              |                               ()                   |
+     skencil            |                            [] ()                [] |
+     sketch             |                            [] ()                [] |
+     soundtracker       |                            [] []                [] |
+     sp                 |                               []                   |
+     tar                |                         [] [] []                [] |
+     texinfo            |                            [] []             []    |
+     textutils          |                      []    [] []                [] |
+     tin                |                               ()        ()         |
+     tp-robot           |                                                    |
+     tuxpaint           |                      [] [] [] [] []     []      [] |
+     unicode-han-tra... |                                                    |
+     unicode-transla... |                                                    |
+     util-linux         |                      [] [] [] []                [] |
+     vorbis-tools       |             []          [] []                   [] |
+     wastesedge         |                               ()                   |
+     wdiff              |                      []    [] []                [] |
+     wget               |                []    []    [] [] []             [] |
+     xchat              |                      []       [] []             [] |
+     xfree86_xkb_xml    |                         [] []                      |
+     xpad               |                                                 [] |
+                        +----------------------------------------------------+
+                          af am ar az be bg bs ca cs da de el en en_GB eo es
+                           4  0  0  1  9  4  1 40 41 60 78 17  1   5   13 68
+     
+                          et eu fa fi fr ga gl he hr hu id is it ja ko lg
+                        +-------------------------------------------------+
+     a2ps               | []       [] []                      ()    ()    |
+     aegis              |                                                 |
+     ant-phone          |             []                                  |
+     anubis             |             []                                  |
+     ap-utils           |             []                                  |
+     aspell             |             [] []                               |
+     bash               |             []             []                   |
+     batchelor          |             [] []                               |
+     bfd                |             []                                  |
+     binutils           |             []                         []       |
+     bison              | []          []                []    []          |
+     bluez-pin          |          [] [] []          [] []                |
+     clisp              |                                                 |
+     clisp              |             []                                  |
+     console-tools      |                                                 |
+     coreutils          | []       [] [] []                   [] []       |
+     cpio               |             []    []       []             []    |
+     darkstat           |             () []          [] []                |
+     diffutils          |          [] []    [] []    [] []       []       |
+     e2fsprogs          |                                                 |
+     enscript           |             []          []                      |
+     error              |          [] [] []          []                   |
+     fetchmail          |                                        []       |
+     fileutils          | []          [] []          []       [] []       |
+     findutils          | []       [] [] [] []    [] [] []    [] [] []    |
+     flex               |             [] []                         []    |
+     fslint             |             []                                  |
+     gas                |             []                                  |
+     gawk               |             []       []                []       |
+     gbiff              |             []                                  |
+     gcal               |             []                                  |
+     gcc                |             []                                  |
+     gettext            |             []                         [] []    |
+     gettext-examples   |             []                         []       |
+     gettext-runtime    |          [] []                []       [] []    |
+     gettext-tools      |             []                         [] []    |
+     gimp-print         |             []                         []       |
+     gliv               |             ()                                  |
+     glunarclock        |          []    [] []       []                   |
+     gnubiff            |             []                                  |
+     gnucash            |             ()                      []          |
+     gnucash-glossary   |                                     []          |
+     gnupg              | []       [] []    []          []    [] []       |
+     gpe-aerial         |             []                                  |
+     gpe-beam           |             []                                  |
+     gpe-calendar       |             []             [] []                |
+     gpe-clock          |             []                                  |
+     gpe-conf           |             []                                  |
+     gpe-contacts       |             []             []                   |
+     gpe-edit           |             []                []                |
+     gpe-go             |             []                                  |
+     gpe-login          |             []             []                   |
+     gpe-ownerinfo      |             []             [] []                |
+     gpe-sketchbook     |             []                                  |
+     gpe-su             |             []                                  |
+     gpe-taskmanager    |             []                                  |
+     gpe-timesheet      |             [] []             []                |
+     gpe-today          |             [] []                               |
+     gpe-todo           |             []                []                |
+     gphoto2            |             []             []          []       |
+     gprof              |             []                []                |
+     gpsdrive           |             ()                      () ()       |
+     gramadoir          |             [] []                               |
+     grep               | []       [] [] [] [] [] [] [] []    [] []       |
+     gretl              |             []                      []          |
+     gtick              |          [] [] []                               |
+     hello              | []    [] [] [] [] [] [] [] [] []    [] [] []    |
+     id-utils           |             []             [] []    []          |
+     indent             | []       [] [] [] []       [] []    [] []       |
+     iso_3166           |    []       [] []       [] [] []    []          |
+     iso_3166_1         |    []       [] []          [] []                |
+     iso_3166_2         |                                                 |
+     iso_3166_3         |                                                 |
+     iso_4217           | []          []    []       []       [] []       |
+     iso_639            |                                                 |
+     jpilot             |             []                         ()       |
+     jtag               |             []                                  |
+     jwhois             |             []             [] []    []          |
+     kbd                |             []                                  |
+     latrine            |             []                                  |
+     ld                 |             []                                  |
+     libc               |          [] []    []       []          [] []    |
+     libgpewidget       |             [] []          [] []                |
+     libiconv           | []       [] [] [] []    [] [] []    []          |
+     lifelines          |             ()                                  |
+     lilypond           |             []                                  |
+     lingoteach         |             []                []                |
+     lingoteach_lessons |                                                 |
+     lynx               | []                         []       [] []       |
+     m4                 |             []    []          []       []       |
+     mailutils          |                                                 |
+     make               |             []    [] [] []             [] []    |
+     man-db             |                                     () ()       |
+     minicom            |          [] []             []          []       |
+     mysecretdiary      |             []                []                |
+     nano               |             []    []          []    []          |
+     nano_1_0           |             []    []          []    []          |
+     opcodes            |             []                                  |
+     parted             |             []    []                   []       |
+     ptx                | []       [] [] [] []       [] []                |
+     python             |                                                 |
+     radius             |             []                                  |
+     recode             |             []    [] []    [] []    []          |
+     rpm                |             []                            []    |
+     screem             |                                                 |
+     scrollkeeper       |                            []                   |
+     sed                | []       [] [] [] []       [] []    [] []       |
+     sh-utils           | []       [] [] []          []       [] []       |
+     shared-mime-info   |          [] []             []                   |
+     sharutils          | []          []    []       []          []       |
+     silky              |          () []             ()       ()          |
+     skencil            |             []                                  |
+     sketch             |             []                                  |
+     soundtracker       |             []                      []          |
+     sp                 |             []                         ()       |
+     tar                | []       [] []    []    [] [] []    [] []       |
+     texinfo            |             []       [] []             []       |
+     textutils          |             [] [] []       []          [] []    |
+     tin                | []          ()                                  |
+     tp-robot           |             []                                  |
+     tuxpaint           |          [] []       []    [] [] [] [] [] []    |
+     unicode-han-tra... |                                                 |
+     unicode-transla... |             [] []                               |
+     util-linux         | []       [] []             []       () []       |
+     vorbis-tools       |             []                                  |
+     wastesedge         |             ()                                  |
+     wdiff              | []          [] [] []       [] []                |
+     wget               | []       [] []    []    [] []          []       |
+     xchat              | []       [] []                                  |
+     xfree86_xkb_xml    |             []             []                   |
+     xpad               |             [] []                               |
+                        +-------------------------------------------------+
+                          et eu fa fi fr ga gl he hr hu id is it ja ko lg
+                          22  2  1 26 106 28 24  8 10 41 33  1 26 33 12  0
+     
+                          lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
+                        +-----------------------------------------------------+
+     a2ps               |             []       []    ()     ()     []   [] [] |
+     aegis              |                      ()                       () () |
+     ant-phone          |                      []                       []    |
+     anubis             |             []    [] []           []          [] [] |
+     ap-utils           |                      []           ()          []    |
+     aspell             |                      []                             |
+     bash               |                                          []   [] [] |
+     batchelor          |                                               []    |
+     bfd                |                                               []    |
+     binutils           |                                                  [] |
+     bison              |             []       []                  []   [] [] |
+     bluez-pin          |                      []           []          []    |
+     clisp              |                                                     |
+     clisp              |                      []                             |
+     console-tools      |                                                  [] |
+     coreutils          |                                   []             [] |
+     cpio               |                      []           []     []   [] [] |
+     darkstat           |             []       []                  []   []    |
+     diffutils          |             []       []           []     []   [] [] |
+     e2fsprogs          |                                   []                |
+     enscript           |                      []                  []   [] [] |
+     error              |                      []                  []   []    |
+     fetchmail          |                      []           []     ()      [] |
+     fileutils          |                                   []          [] [] |
+     findutils          |                      []           []     []   [] [] |
+     flex               |                                   []     []   [] [] |
+     fslint             |                      []                       []    |
+     gas                |                                                     |
+     gawk               |                                   []     []   []    |
+     gbiff              |                      []                       []    |
+     gcal               |                                                     |
+     gcc                |                                                     |
+     gettext            |                                   []          [] [] |
+     gettext-examples   |                      []           []          []    |
+     gettext-runtime    |                      []           []          [] [] |
+     gettext-tools      |                                   []          []    |
+     gimp-print         |                      []                             |
+     gliv               |                      []                  []   []    |
+     glunarclock        |             []       []                       [] [] |
+     gnubiff            |                      []                             |
+     gnucash            |                      []              []  ()      [] |
+     gnucash-glossary   |                      []              []             |
+     gnupg              |                                               []    |
+     gpe-aerial         |                      []              []       [] [] |
+     gpe-beam           |                      []              []       [] [] |
+     gpe-calendar       |                      []              []       [] [] |
+     gpe-clock          |                      []              []       [] [] |
+     gpe-conf           |                      []              []       [] [] |
+     gpe-contacts       |                      []              []       [] [] |
+     gpe-edit           |                      []              []       [] [] |
+     gpe-go             |                      []                       [] [] |
+     gpe-login          |                      []              []       [] [] |
+     gpe-ownerinfo      |                      []              []       [] [] |
+     gpe-sketchbook     |                      []              []       [] [] |
+     gpe-su             |                      []              []       [] [] |
+     gpe-taskmanager    |                      []              []       [] [] |
+     gpe-timesheet      |                      []              []       [] [] |
+     gpe-today          |                      []              []       [] [] |
+     gpe-todo           |                      []              []       [] [] |
+     gphoto2            |                                               []    |
+     gprof              |                                          []   []    |
+     gpsdrive           |                      ()    ()                 []    |
+     gramadoir          |                      ()                       []    |
+     grep               |                                   [] []  []   [] [] |
+     gretl              |                                                     |
+     gtick              |                      []                       [] [] |
+     hello              |    []       []    [] [] [] []     []     []   [] [] |
+     id-utils           |                      []                  []   [] [] |
+     indent             |                      []                  []   [] [] |
+     iso_3166           |          []                [] []                    |
+     iso_3166_1         |                      []    []                       |
+     iso_3166_2         |                                                     |
+     iso_3166_3         |                      []                             |
+     iso_4217           |          []          [] [] []     [] []  []      [] |
+     iso_639            |          []                                         |
+     jpilot             |                      ()    ()                       |
+     jtag               |                                                     |
+     jwhois             |                      []           []     []   [] () |
+     kbd                |                      []           []          []    |
+     latrine            |                                               []    |
+     ld                 |                                                     |
+     libc               |                   []       []     []     []         |
+     libgpewidget       |                      []              []       []    |
+     libiconv           |                      []           []     []   [] [] |
+     lifelines          |                                                     |
+     lilypond           |                                                     |
+     lingoteach         |                                                     |
+     lingoteach_lessons |                                                     |
+     lynx               |                      []                  []      [] |
+     m4                 |                      []           []     []   [] [] |
+     mailutils          |                                   []          [] [] |
+     make               |                      []           []     []      [] |
+     man-db             |                                               []    |
+     minicom            |                                   []     []   [] [] |
+     mysecretdiary      |                      []                  []   []    |
+     nano               |             []       []           []          [] [] |
+     nano_1_0           |             []    []    []        []          [] [] |
+     opcodes            |                      []                       []    |
+     parted             |                         []        [] []  []         |
+     ptx                |                   [] []    []     [] []  []   [] [] |
+     python             |                                                     |
+     radius             |                                   []             [] |
+     recode             |                                   []     []   [] [] |
+     rpm                |                                   [] []          [] |
+     screem             |                                                     |
+     scrollkeeper       |                   [] []           []          [] [] |
+     sed                |                                   []     []   []    |
+     sh-utils           |                   []                             [] |
+     shared-mime-info   |                      [] []                          |
+     sharutils          |                      []                          [] |
+     silky              |                                                  () |
+     skencil            |                                      []  []         |
+     sketch             |                                      []  []         |
+     soundtracker       |                                                     |
+     sp                 |                                                     |
+     tar                |             []    []       []     []     []   []    |
+     texinfo            |                   []              []          [] [] |
+     textutils          |                   []                             [] |
+     tin                |                                                     |
+     tp-robot           |                      []                             |
+     tuxpaint           | []          []       [] []        [] []  []   []    |
+     unicode-han-tra... |                                                     |
+     unicode-transla... |                                                     |
+     util-linux         |                      []                  []      [] |
+     vorbis-tools       |                      []                       [] [] |
+     wastesedge         |                                                     |
+     wdiff              |             []                    []     []   [] [] |
+     wget               |                                   []          [] [] |
+     xchat              |    []                []                          [] |
+     xfree86_xkb_xml    |                      []                          [] |
+     xpad               |                      []                       []    |
+                        +-----------------------------------------------------+
+                          lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
+                           1  2  0  3 12  0 10 69  6  7  1  40 26  36   76 63
+     
+                          sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
+                        +-----------------------------------------------------+
+     a2ps               |    []    []       [] []                             | 16
+     aegis              |                                                     |  0
+     ant-phone          |                                                     |  3
+     anubis             |                   [] []                             |  9
+     ap-utils           |                      ()                             |  3
+     aspell             |                                                     |  4
+     bash               |                                                     |  9
+     batchelor          |                                                     |  3
+     bfd                |          []       []                                |  6
+     binutils           |          []       []                  []            |  8
+     bison              |          []       []                                | 14
+     bluez-pin          | []       []                    []                   | 14
+     clisp              |                                                     |  0
+     clisp              |                                                     |  5
+     console-tools      |                                                     |  3
+     coreutils          |    []    []       []                        []      | 16
+     cpio               |          []                           []            | 14
+     darkstat           | []    [] []                           ()    ()      | 12
+     diffutils          |          []       []                        []      | 23
+     e2fsprogs          |          []       []                                |  6
+     enscript           |          []       []                                | 12
+     error              | []                []                        []      | 15
+     fetchmail          | []                []                                | 11
+     fileutils          |    []    []       []                  []    []      | 17
+     findutils          | [] [] [] []       []                  []            | 29
+     flex               |          []       []                                | 13
+     fslint             |                                                     |  3
+     gas                |                   []                                |  3
+     gawk               |          []       []                                | 12
+     gbiff              |                                                     |  4
+     gcal               |          []       []                                |  4
+     gcc                |                   []                                |  4
+     gettext            | [] []    []       []                        []      | 16
+     gettext-examples   | []    [] []       []                  []            | 14
+     gettext-runtime    | [] [] [] []       [] []               []    []      | 22
+     gettext-tools      | [] [] [] []       []                  []            | 14
+     gimp-print         | []       []                                         | 10
+     gliv               |                                                     |  3
+     glunarclock        |       [] []                    []                   | 13
+     gnubiff            |                                                     |  3
+     gnucash            | []                                          []      |  9
+     gnucash-glossary   | []       []                                 []      |  8
+     gnupg              | []       []       []                        []      | 17
+     gpe-aerial         |          []                                         |  7
+     gpe-beam           |          []                                         |  8
+     gpe-calendar       | []       []                    []           []      | 13
+     gpe-clock          | []    [] []                                         | 10
+     gpe-conf           | []       []                                         |  9
+     gpe-contacts       | []       []                                 []      | 11
+     gpe-edit           | []    [] []                    []           []      | 12
+     gpe-go             |                                                     |  5
+     gpe-login          | []    [] []                    []           []      | 13
+     gpe-ownerinfo      | []    [] []                                 []      | 13
+     gpe-sketchbook     | []       []                                         |  9
+     gpe-su             | []    [] []                                         | 10
+     gpe-taskmanager    | []    [] []                                         | 10
+     gpe-timesheet      | []    [] []                                 []      | 12
+     gpe-today          | []    [] []                    []           []      | 13
+     gpe-todo           | []       []                    []           []      | 12
+     gphoto2            | []       []                           []            | 11
+     gprof              |          []       []                                |  9
+     gpsdrive           | []       []                                         |  3
+     gramadoir          | []                                                  |  5
+     grep               |    [] []          [] []                             | 26
+     gretl              |                                                     |  3
+     gtick              |                                                     |  7
+     hello              | []    [] []       [] []                             | 34
+     id-utils           |          []       []                                | 12
+     indent             | []    [] []       []                                | 21
+     iso_3166           | [] [] [] []       []    []     []                   | 27
+     iso_3166_1         | [] []             []                                | 16
+     iso_3166_2         |                                                     |  0
+     iso_3166_3         |                                                     |  2
+     iso_4217           | [] []    []       [] []               []            | 24
+     iso_639            |                                                     |  1
+     jpilot             |          []       []        []        []    []      |  9
+     jtag               | []                                                  |  2
+     jwhois             |          ()       []                        []      | 11
+     kbd                |          []       []                                | 11
+     latrine            |                                                     |  2
+     ld                 |          []       []                                |  5
+     libc               | []       []       []                  []            | 20
+     libgpewidget       | []    [] []                    []                   | 13
+     libiconv           | [] [] [] []       [] []        []     []            | 27
+     lifelines          |          []                                         |  2
+     lilypond           |          []                                         |  3
+     lingoteach         |                                                     |  2
+     lingoteach_lessons |                                       ()            |  0
+     lynx               |          []       [] []                             | 14
+     m4                 |          []                           []            | 15
+     mailutils          |                                                     |  5
+     make               |          []       []                  []            | 16
+     man-db             |          []                                         |  5
+     minicom            |                                                     | 11
+     mysecretdiary      |          []       []                                | 10
+     nano               |       [] []       [] []                             | 17
+     nano_1_0           |          []       [] []                             | 17
+     opcodes            |          []       []                                |  6
+     parted             |          []       []                  []            | 15
+     ptx                |          []       []                                | 22
+     python             |                                                     |  0
+     radius             |                                                     |  4
+     recode             |    []    []       []                                | 20
+     rpm                |          []       []                                |  9
+     screem             |          []                           []            |  2
+     scrollkeeper       | []    [] []                                         | 15
+     sed                | [] [] [] []       [] []                             | 24
+     sh-utils           |    []             []                                | 14
+     shared-mime-info   |       [] []                                         |  7
+     sharutils          |       [] []       []                        []      | 17
+     silky              | ()                                                  |  3
+     skencil            |          []                                         |  6
+     sketch             |          []                                         |  6
+     soundtracker       | []       []                                         |  7
+     sp                 |                   []                                |  3
+     tar                | [] []    []       []                  []            | 24
+     texinfo            |          []       []                  []            | 14
+     textutils          |    []    []       []                        []      | 16
+     tin                |                                                     |  1
+     tp-robot           |                                                     |  2
+     tuxpaint           | []       []       []           []     []            | 29
+     unicode-han-tra... |                                                     |  0
+     unicode-transla... |                                                     |  2
+     util-linux         |          []       []                                | 15
+     vorbis-tools       |                                                     |  8
+     wastesedge         |                                                     |  0
+     wdiff              | []       []       []                                | 18
+     wget               | [] [] [] []       [] []               []    []      | 24
+     xchat              | [] [] [] []                           []            | 15
+     xfree86_xkb_xml    | []    []          [] []               []            | 11
+     xpad               |                                                     |  5
+                        +-----------------------------------------------------+
+       63 teams           sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
+      131 domains         47 19 28 83  0  0 59 13  1   1 11  0  22    22    0  1373
+
+   Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect.  This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+   For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer.  There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+   If January 2004 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
+matrix with full percentage details can be found at
+`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+
+Using `gettext' in new packages
+===============================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package.  Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library.  This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+   Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations.  The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project.  Therefore the information given above
+applies also for every other Free Software Project.  Contact
+`translation@iro.umontreal.ca' to make the `.pot' files available to
+the translation teams.
+
diff --git a/util-linux-ng-2.17.2/AUTHORS b/util-linux-ng-2.17.2/AUTHORS
new file mode 100644
index 0000000..0642512
--- /dev/null
+++ b/util-linux-ng-2.17.2/AUTHORS
@@ -0,0 +1,201 @@
+
+                            utils-linux-ng
+           (fork of util-linux, based on version 2.13-pre7)
+
+MAINTAINER:
+
+      Karel Zak <kzak@redhat.com>
+
+
+PAST MAINTAINERS:
+
+      Adrian Bunk <bunk@stusta.de>
+      Andries E. Brouwer <aeb@cwi.nl>
+
+
+AUTHORS (merged projects & commands):
+
+      fallocate:       Eric Sandeen <sandeen@redhat.com>
+                       Karel Zak <kzak@redhat.com>
+      flock:           H. Peter Anvin <hpa@zytor.com>
+      getopt:          Frodo Looijaard <frodol@dds.nl>
+      hwclock:         Bryan Henderson <bryanh@giraffe-data.com>
+      ipcmk:           Hayden James <hayden.james@gmail.com>
+      ldattach:        Tilman Schmidt <tilman@imap.cc>
+      libblkid:        Theodore Ts'o <tytso@mit.edu>
+      libuuid:         Theodore Ts'o <tytso@mit.edu>
+      lscpu:           Cai Qian <qcai@redhat.com>
+      rtcwake:         David Brownell <david-b@pacbell.net>
+                       Bernhard Walle <bwalle@suse.de>
+      schedutils:      Robert Love <rlove@rlove.org>
+      setarch:         Elliot Lee <sopwith@redhat.com>
+                       Jindrich Novy <jnovy@redhat.com>
+      simpleinit:      Richard Gooch <rgooch@atnf.csiro.au>
+      switch_root:     Peter Jones <pjones@redhat.com>
+                       Jeremy Katz <katzj@redhat.com>
+      unshare:         Mikhail Gusarov <dottedmag@dottedmag.net>
+      wipefs:          Karel Zak <kzak@redhat.com>
+
+
+CONTRIBUTORS:
+
+      A. Costa <agcosta@gis.net>
+      Adam Jackson <ajax@redhat.com>
+      Alain Guibert <alguibert+ulng@free.fr>
+      Alan Curry <pacman@TheWorld.com>
+      Alexey Gladkov <legion@altlinux.ru>
+      Alon Bar-Lev <alon.barlev@gmail.com>
+      Américo Wang <xiyou.wangcong@gmail.com>
+      Andreas Dilger <adilger@sun.com>
+      Andrew McGill <list2008@lunch.za.net>
+      Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl>
+      Arif E. Nugroho <arif_endro@yahoo.com>
+      Arkadiusz Miskiewicz <arekm@maven.pl>
+      Attila Áfra <attila.afra@gmail.com>
+      Aurelien Jarno <aurelien@aurel32.net>
+      Balint Cristian <cbalint@redhat.com>
+      Bastian Friedrich <bastian.friedrich@collax.com>
+      Benno Schulenberg <bensberg@justemail.net>
+      Bernardo Innocenti <bernie@codewiz.org>
+      Bernhard Walle <bwalle@suse.de>
+      Bryn M. Reeves <bmr@errorists.org>
+      Cai Qian <qcai@redhat.com>
+      Christophe Blaess <Christophe@Blaess.fr>
+      Christoph Hellwig <hch@infradead.org>
+      Chris Webb <chris@arachsys.com>
+      Claus Hindsgaul <claus_h@image.dk>
+      Cliff Wickman <cpw@sgi.com>
+      Clytie Siddall <clytie@riverland.net.au>
+      Colin Watson <cjwatson@canonical.com>
+      Corentin Chary <corentincj@iksaif.net>
+      Cristian Rodríguez <crrodriguez@opensuse.org>
+      Daisuke Yamashita <yamad@mb.infoweb.ne.jp>
+      Daniel Drake <dsd@laptop.org>
+      Daniel Mierswa <impulze@impulze.org>
+      Daniel Nylander <po@danielnylander.se>
+      David Brownell <david-b@pacbell.net>
+      David Miller <davem@davemloft.net>
+      David Woodhouse <dwmw2@infradead.org>
+      Denis ChengRq <crquan@gmail.com>
+      Dennis Gilmore <dennis@ausil.us>
+      Dmitry V. Levin <ldv@altlinux.org>
+      Eric Sandeen <sandeen@redhat.com>
+      Flávio Leitner <fleitner@redhat.com>
+      Florentin Duneau <fduneau@gmail.com>
+      Florian Zumbiehl <florz@florz.de>
+      Francesco Cosoleto <cosoleto@gmail.com>
+      Frédéric Bothamy <frederic.bothamy@free.fr>
+      Gabor Kelemen <kelemeng@gnome.hu>
+      Gabriel Barazer <gabriel@oxeva.fr>
+      Gabriel Burt <gburt@novell.com>
+      Guan Xin <guanx.bac@gmail.com>
+      Guillem Jover <guillem@hadrons.org>
+      Hamish Coleman <hamish@zot.org>
+      Hayden James <hayden.james@gmail.com>
+      Hendrik Lönngren <wikibugs@googlemail.com>
+      Henne Vogelsang <hvogel@opensuse.org>
+      H. Peter Anvin <hpa@zytor.com>
+      Hugh Dickins <hugh@veritas.com>
+      Imre Kaloz <kaloz@openwrt.org>
+      Jakob Unterwurzacher <jakobunt@gmail.com>
+      Jakub Bogusz <qboosh@pld-linux.org>
+      James Youngman <jay@gnu.org>
+      Jan Kara <jack@suse.cz>
+      Jan Sarenik <jsarenik@redhat.com>
+      Jason Vas Dias <jvdias@redhat.com>
+      Jeff Mahoney <jeffm@suse.com>
+      Jim Meyering <meyering@redhat.com>
+      John Keeping <john.keeping@lineone.net>
+      Josep Puigdemont <josep.puigdemont@gmail.com>
+      Justin B Rye <jbr@edlug.org.uk>
+      KaiGai Kohei <kaigai@kaigai.gr.jp>
+      Kalev Soikonen <ksop@hot.ee>
+      Kay Sievers <kay.sievers@vrfy.org>
+      Kees Cook <kees.cook@canonical.com>
+      Ken Kopin <kenkopin@gmail.com>
+      kevin.granade@gmail.com <kevin.granade@gmail.com>
+      Kunihiko IMAI <kimai@iodata.jp>
+      LaMont Jones <lamont@debian.org>
+      LaMont Jones <lamont@mmjgroup.com>
+      Lauri Nurmi <lanurmi@iki.fi>
+      Lawrence Rust <lawrence@softsystem.co.uk>
+      Linus Torvalds <torvalds@linux-foundation.org>
+      Li Zefan <lizf@cn.fujitsu.com>
+      Lubomir Kundrak <lkundrak@redhat.com>
+      Luciano Chavez <lnx1138@us.ibm.com>
+      Ludwig Nussel <ludwig.nussel@suse.de>
+      Makoto Kato <makoto.kt@gmail.com>
+      Marco Colombo <m.colombo@ed.ac.uk>
+      Marco d'Itri <md@Linux.IT>
+      Mark McLoughlin <markmc@redhat.com>
+      Martin Schlemmer <azarah@gentoo.org>
+      Martin Schulze <joey@infodrom.org>
+      Martin Steigerwald <ms@teamix.de>
+      Masatake YAMATO <jet@gyve.org>
+      Matthew Garrett <mjg59@srcf.ucam.org>
+      Matthias Koenig <mkoenig@suse.de>
+      Matthias König <mk@phasorlab.de>
+      maximilian attems <max@stro.at>
+      Maxim Levitsky <maximlevitsky@gmail.com>
+      Maxim V. Dziumanenko <mvd@mylinux.com.ua>
+      Meelis Roos <mroos@linux.ee>
+      Michael Piefel <piefel@informatik.hu-berlin.de>
+      Michel Robitaille <robitail@IRO.UMontreal.CA>
+      Mike Frysinger <vapier@gentoo.org>
+      Mike Hommey <mh@glandium.org>
+      Mikel Olasagasti Uranga <hey_neken@mundurat.net>
+      Mikhail Gusarov <dottedmag@dottedmag.net>
+      Miklos Szeredi <mszeredi@suse.cz>
+      Milan Broz <mbroz@redhat.com>
+      Moritz Muehlenhoff <jmm@inutil.org>
+      Nicolas Provost <nprovost@quadriv.com>
+      Nilgün Belma Bugüner <nilgun@buguner.name.tr>
+      Norbert Buchmuller <norbi@nix.hu>
+      Oliver Falk <oliver@linux-kernel.at>
+      Olivier Blin <blino@mandriva.com>
+      Pádraig Brady <P@draigBrady.com>
+      Pascal Terjan <pterjan@mandriva.com>
+      Paul Fox <pgf@laptop.org>
+      Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
+      Pavel Maryanov <acid_jack@ukr.net>
+      Pedro Ribeiro <p.m42.ribeiro@gmail.com>
+      Peter Breitenlohner <peb@mppmu.mpg.de>
+      Peter De Wachter <pdewacht@gmail.com>
+      Peter Jones <pjones@redhat.com>
+      Peter Volkov <pva@gentoo.org>
+      Petr Pisar <petr.pisar@atlas.cz>
+      Phan Vinh Thinh <teppi82@gmail.com>
+      Pierre Hauweele <antegallya@gmail.com>
+      Rajeev V. Pillai <rajeevvp@gmail.com>
+      Ram Pai <linuxram@us.ibm.com>
+      Randy Dunlap <randy.dunlap@oracle.com>
+      Ray Wang <wanglei1123@gmail.com>
+      Robert Förster <Dessa@gmake.de>
+      Robert Millan <rmh@aybabtu.com>
+      Rodrigo Stulzer Lopes <rodrigo@conectiva.com.br>
+      Roy Peled <the.roy.peled@gmail.com>
+      Samuel Thibault <samuel.thibault@ens-lyon.org>
+      Sam Varshavchik <mrsam@courier-mta.com>
+      Santiago Vila Doncel <sanvila@unex.es>
+      Sascha Sommer <ssommer@suse.de>
+      Scott James Remnant <scott@ubuntu.com>
+      Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+      Shachar Shemesh <shachar@debian.org>
+      Simon Mihevc <simonmihevc@email.si>
+      Stefan Krah <stefan@bytereef.org>
+      Stepan Kasal <skasal@redhat.com>
+      Stephan Maka <stephan@spaceboyz.net>
+      Steve Grubb <sgrubb@redhat.com>
+      Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
+      Sven Jost <sven.jost@googlemail.com>
+      Theodore Ts'o <tytso@mit.edu>
+      Tilman Schmidt <tilman@imap.cc>
+      Tom Prince <tom.prince@ualberta.net>
+      Valerie Aurora <vaurora@redhat.com>
+      Vincent Deffontaines <vincent@gryzor.com>
+      Vladimir Brednikov <vbrednikov@gmail.com>
+      Volker Schatz <oss@volkerschatz.com>
+      Yann Droneaud <yann@droneaud.fr>
+      Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
+      Yu Zhiguo <yuzg@cn.fujitsu.com>
+      Zdenek Behan <rain@matfyz.cz>
diff --git a/util-linux-ng-2.17.2/COPYING b/util-linux-ng-2.17.2/COPYING
new file mode 100644
index 0000000..623b625
--- /dev/null
+++ b/util-linux-ng-2.17.2/COPYING
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     51 Franklin Street, 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 Street, 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.
diff --git a/util-linux-ng-2.17.2/DEPRECATED b/util-linux-ng-2.17.2/DEPRECATED
new file mode 100644
index 0000000..a423601
--- /dev/null
+++ b/util-linux-ng-2.17.2/DEPRECATED
@@ -0,0 +1,60 @@
+The following is a list of commands or features that are deprecated.  All
+deprecated utils are in maintenace mode and we keep them in source tree for
+backward compatibilty only.
+
+What:	losetup -s
+When:	2.15
+Why:	the option -s is in collision with the Loop-AES losetup dialect that is used
+        in some distributions. Use the long version (--show) only.
+
+--------------------------
+
+What:	cryptoloop support in mount/losetup
+When:	undefined yet
+Why:	depreciated in favor of dm-crypt.
+
+---------------------------
+
+What:	elvtune
+When:	undefined yet
+Why:	useless for kernel >= 2.6.9
+
+---------------------------
+
+What:	arch(1) command
+When:	2.14
+Why:	deprecated in favor of uname(1) or arch(1) from coreutils
+
+	The arch(1) has been added (during 2.13 development cycle) to coreutuls
+	where it will be maintained as an alias for uname(1) command.
+
+----------------------------
+
+What:	kill(1) command
+Why:	deprecated in favor of kill from procps or bash build-in kill command
+
+----------------------------
+
+What:	newgrp(1)
+Why:	deprecated in favor of newgrp from shadow-utils
+
+----------------------------
+
+What:	vipw/vigr(8)
+Why:	deprecated in favor of vipw/vigr(8) from shadow-utils
+
+----------------------------
+
+What:	last(1)
+Why:	nobody uses this implementation
+
+----------------------------
+
+What:	shutdown(1)
+Why:	nobody uses this implementation
+
+----------------------------
+
+What:	rdev(8), ramsize(8), vidmode(8) and  rootflags(8)
+Why:	i386 specific and probably useless
+
diff --git a/util-linux-ng-2.17.2/INSTALL b/util-linux-ng-2.17.2/INSTALL
new file mode 100644
index 0000000..23e5f25
--- /dev/null
+++ b/util-linux-ng-2.17.2/INSTALL
@@ -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.
+
diff --git a/util-linux-ng-2.17.2/Makefile.am b/util-linux-ng-2.17.2/Makefile.am
new file mode 100644
index 0000000..f332510
--- /dev/null
+++ b/util-linux-ng-2.17.2/Makefile.am
@@ -0,0 +1,71 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+SUBDIRS = \
+	include \
+	disk-utils \
+	fdisk \
+	getopt \
+	lib \
+	shlibs \
+	login-utils \
+	misc-utils \
+	po \
+	schedutils \
+	sys-utils \
+	text-utils \
+	tests
+
+
+RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
+		-name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
+
+if LINUX
+SUBDIRS += \
+	hwclock \
+	partx
+endif
+
+if BUILD_MOUNT
+SUBDIRS += mount
+endif
+
+if BUILD_FSCK
+SUBDIRS += fsck
+endif
+
+ACLOCAL_AMFLAGS = -I m4
+
+EXTRA_DIST = \
+		autogen.sh \
+		README.devel \
+		README.licensing \
+		DEPRECATED \
+		licenses \
+		example.files \
+		po/update-potfiles \
+		tools \
+		docs
+
+
+distclean-local:
+	-find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
+	rm -rf autom4te.cache
+
+
+checkincludes:
+	@find * $(RCS_FIND_IGNORE) \
+		-name '*.[hcS]' -type f -print | sort -u \
+		| xargs $(top_srcdir)/tools/checkincludes.pl
+
+checkconfig:
+	@find * $(RCS_FIND_IGNORE) \
+		-name '*.[hcS]' -type f -print | sort -u \
+		| xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
+
+
+ENABLE_ALL = --enable-static-programs \
+ --enable-elvtune --enable-init --enable-kill --enable-last \
+ --enable-mesg --enable-partx --enable-raw --enable-rdev --enable-reset \
+ --enable-login-utils --enable-write --enable-arch --enable-mount
+
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-use-tty-group $(ENABLE_ALL)
diff --git a/util-linux-ng-2.17.2/Makefile.in b/util-linux-ng-2.17.2/Makefile.in
new file mode 100644
index 0000000..d662a18
--- /dev/null
+++ b/util-linux-ng-2.17.2/Makefile.in
@@ -0,0 +1,852 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = README $(am__configure_deps) $(dist_noinst_DATA) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/config.h.in $(top_srcdir)/config/include-Makefile.am \
+	$(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING INSTALL NEWS \
+	TODO config/config.guess config/config.rpath config/config.sub \
+	config/depcomp config/install-sh config/ltmain.sh \
+	config/missing config/mkinstalldirs config/texinfo.tex
+@LINUX_TRUE@am__append_1 = \
+@LINUX_TRUE@	hwclock \
+@LINUX_TRUE@	partx
+
+@BUILD_MOUNT_TRUE@am__append_2 = mount
+@BUILD_FSCK_TRUE@am__append_3 = fsck
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+DATA = $(dist_noinst_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = include disk-utils fdisk getopt lib shlibs login-utils \
+	misc-utils po schedutils sys-utils text-utils tests hwclock \
+	partx mount fsck
+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)"; }; }
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+SUBDIRS = include disk-utils fdisk getopt lib shlibs login-utils \
+	misc-utils po schedutils sys-utils text-utils tests \
+	$(am__append_1) $(am__append_2) $(am__append_3)
+RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
+		-name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
+
+ACLOCAL_AMFLAGS = -I m4
+EXTRA_DIST = \
+		autogen.sh \
+		README.devel \
+		README.licensing \
+		DEPRECATED \
+		licenses \
+		example.files \
+		po/update-potfiles \
+		tools \
+		docs
+
+ENABLE_ALL = --enable-static-programs \
+ --enable-elvtune --enable-init --enable-kill --enable-last \
+ --enable-mesg --enable-partx --enable-raw --enable-rdev --enable-reset \
+ --enable-login-utils --enable-write --enable-arch --enable-mount
+
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-use-tty-group $(ENABLE_ALL)
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign 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)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool config.lt
+
+# 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):
+	@fail= 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; \
+	  ($(am__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"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= 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; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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 || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@case `sed 15q $(srcdir)/NEWS` in \
+	*"$(VERSION)"*) : ;; \
+	*) \
+	  echo "NEWS not updated; not releasing" 1>&2; \
+	  exit 1;; \
+	esac
+	$(am__remove_distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	$(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
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(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)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__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 \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@$(am__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 $(DATA) config.h
+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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-local distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+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 mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+	ctags-recursive install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+	dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
+	distcheck distclean distclean-generic distclean-hdr \
+	distclean-libtool distclean-local distclean-tags \
+	distcleancheck distdir distuninstallcheck dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+distclean-local:
+	-find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
+	rm -rf autom4te.cache
+
+checkincludes:
+	@find * $(RCS_FIND_IGNORE) \
+		-name '*.[hcS]' -type f -print | sort -u \
+		| xargs $(top_srcdir)/tools/checkincludes.pl
+
+checkconfig:
+	@find * $(RCS_FIND_IGNORE) \
+		-name '*.[hcS]' -type f -print | sort -u \
+		| xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/NEWS b/util-linux-ng-2.17.2/NEWS
new file mode 100644
index 0000000..f38bc2e
--- /dev/null
+++ b/util-linux-ng-2.17.2/NEWS
@@ -0,0 +1,1639 @@
+util-linux-ng 2.17.2: Mar 22 2010
+* see docs/v2.17.2-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.2-ChangeLog
+
+util-linux-ng 2.17.1: Feb 22 2010
+* see docs/v2.17.1-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.1-ChangeLog
+
+util-linux-ng 2.17.1-rc1: Feb 16 2010
+* see docs/v2.17.1-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.1-rc1-ChangeLog
+
+util-linux-ng 2.17: Jan 8 2010
+* see docs/v2.17-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-ChangeLog
+
+util-linux-ng 2.17-rc3: Dec 10 2009
+* see docs/v2.17-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-rc3-ChangeLog
+
+util-linux-ng 2.17-rc2: Dec 9 2009
+* see docs/v2.17-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-rc2-ChangeLog
+
+util-linux-ng 2.17-rc1: Nov 20 2009
+* see docs/v2.17-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17-rc1-ChangeLog
+
+util-linux-ng 2.16: Jul  2009
+* see docs/v2.16-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16-ChangeLog
+
+util-linux-ng 2.16-rc2: Jul 2 2009
+* see docs/v2.16-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16-rc2-ChangeLog
+
+util-linux-ng 2.16-rc1: Jun 28 2009
+* see docs/v2.16-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16-rc1-ChangeLog
+
+util-linux-ng 2.15: May 5 2009
+* see docs/v2.15-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/v2.15-ChangeLog
+
+util-linux-ng 2.15-rc2: Apr 17 2009
+* see docs/v2.15-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/v2.15-rc2-ChangeLog
+
+util-linux-ng 2.15-rc1: Mar 18 2009
+* see docs/v2.15-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/v2.15-rc1-ChangeLog
+
+util-linux-ng 2.14: Jun 9 2008
+* see docs/v2.14-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14-ChangeLog
+
+util-linux-ng 2.14-rc3
+* see docs/v2.14-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14-rc3-ChangeLog
+
+util-linux-ng 2.14-rc2
+* see docs/v2.14-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14-rc2-ChangeLog
+
+util-linux-ng 2.14-rc1
+* see docs/v2.14-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14-rc1-ChangeLog
+
+util-linux-ng 2.13
+
+* see docs/v2.13-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13-ChangeLog
+
+util-linux-ng 2.13-rc3
+
+* see docs/v2.13-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13-rc3-ChangeLog
+
+util-linux-ng 2.13-rc2
+
+* see docs/v2.13-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13-rc2-ChangeLog
+
+util-linux-ng 2.13-rc1
+
+* see docs/v2.13-ReleaseNotes or complete changelog at
+  ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13-rc1-ChangeLog
+
+util-linux 2.13-pre7
+
+* mount: default to cifs instead of smbfs for sources
+         starting with // Lars Mueller()
+* flock: documentation updates (H. Peter Anvin)
+* new translation: id
+* updated translations: de, it, sl, uk
+
+util-linux 2.13-pre6
+
+* getopt: updated to 1.1.4
+* replaced all *llseek variants with lseek
+* misc build system, code and docs cleanups and fixes
+* updated translations: fr, it
+
+util-linux 2.13-pre5
+
+* {fsck,mkfs}.cramfs: updated to cramfs-1.1
+* {fsck,mkfs}.cramfs: removed PAGE_CACHE_SIZE usage
+* umount: fix "umount -n -r" (Derick Swanepoel)
+* misc build system and code cleanups and fixes
+* updated translation: ca
+
+util-linux 2.13-pre4
+
+* don't build fdisk on m68k (Mike Frysinger)
+* misc build system and documentation fixes
+* removed program: clear
+
+util-linux 2.13-pre3
+
+* misc buld system fixes
+* cfdisk: fix a segfault with ReiserFS partitions
+* umount: disallow -r option for non-root users
+* updated translations: da, fr, it, nl, ru, sl, tr
+
+util-linux 2.13-pre2
+
+* flock: replaced with flock-2.0.2 by H. Peter Anvin
+* misc build system fixes, libtool is no longer used
+* misc code fixes
+* updated translations: ca, fi, fr, nl, ru, tr
+
+util-linux 2.13-pre1
+
+* use GNU autoconf/automake/libtool for building
+* added schedutils
+* removed support for curses implementations other than ncurses
+* removed programs: arch, passwd, rescuept, setfdprm, sln
+* removed mkminix-0.1/
+* misc fixes and documentation updates
+* new translation: vi
+* updated translations: ca, de, fi, fr, it, nl, ru, tr
+
+util-linux 2.12q
+
+* updated translation: nl
+
+util-linux 2.12q-pre2
+
+* sfdisk: document -G option in --help output
+* updated translations: ca, et, fr
+
+util-linux 2.12q-pre1
+
+* new maintainer
+* sfdisk: add -G option (Andries Brouwer)
+* updated translations: de, es, ru, sv, tr
+
+util-linux 2.12p
+
+* cfdisk: fix number of new partition when partitions not in disk order
+* fdisk: fix Sun label handling in sector mode
+* mkfs: never truncate filename (not that that ever happened)
+* more: fix redraw flaw
+
+util-linux 2.12n,o
+
+* lomount: revert patch from 2.12j
+* lptune.8: -T option is obsolete
+* mkswap, mkswap.8, swapon: support labels
+  (use HAVE_BLKID=no as long as the blkid library doesnt support this)
+* umount: allow user unmounting repeatedly mounted nfs mounts
+
+util-linux 2.12m
+
+* cfdisk: recognize JFS, support reiserfs labels (flavio.stanchina@tin.it)
+* mount: fix option parsing bug
+* mount.8: several updates
+* swapon.8: document -v option
+
+util-linux 2.12l
+
+* Makefile: remove cat-id-tbl.c upon make clean
+* fdisk: fixed a bug that would cause a non-update of a sun disklabel
+* fdisk: use sectorsize instead of 512 for SGI (Eric Y. Theriault)
+* fdisk: use __attribute__((packed)) for alpha, ARM: avoid unaligned accesses
+* hwclock: actually use HAVE_tm_gmtoff
+* swapon: fix priority handling
+* umount: refuse to unmount an empty string
+
+util-linux 2.12k
+
+* cfdisk: fixed a signed character bug causing problems for Spanish users
+* configure, MCONFIG: detect gcc 3.4.0 and use -mtune option (Matthew Burgess)
+* configure: do not run ./conftest (for cross compilation) (NIIBE Yutaka)
+* fsck.cramfs: try to get correct PAGE_CACHE_SIZE
+* losetup: try to give better error messages
+* readprofile: default map file is /boot/System.map
+* rdev.8: added historical info on ramdisk
+* New French, Spanish, Swedish and Turkish messages
+
+util-linux 2.12j
+
+* cal: highlight today (Pádraig Brady)
+* lomount: stop reading passwd at NUL, fix lo_encrypt key_size (Wolfram Kleff)
+* losetup: add -f option to find an unused loop device
+  (Alexander Wigen, Remco van Mook)
+* more: code cleanup (Joachim Henke)
+* mount: add "group" mount option (Martin Dickopp)
+* sfdisk: fix 2.6.8 BLKRRPART ioctl damage (Eric Lammerts)
+* swapon: let swapon -a skip the swapfiles marked "noauto" (Dale R. Worley)
+* umount: fix problem with empty mtab (Bryan Kadzban)
+* umount: use special umount program if it exists (Ram Pai)
+* New Danish and French messages
+
+util-linux 2.12i
+
+* MCONFIG: fix build conditions
+* chfn, chsh: add error checking
+* cytune: use local header cyclades.h
+* fdisk: fix default SGI volume header size (Eric Sandeen)
+* fstab.c: use strsignal() instead of sys_siglist[]
+* hwclock: use <sys/io.h> when available on i386
+* hwclock: dont try KDGHWCLK on archs other than __m68k__
+* sfdisk: correct typo in __attribute__used nonsense
+* sfdisk: use PACKED on __arm__ (Jeroen Dobbelaere)
+* sfdisk: fix warning printout
+
+util-linux 2.12e,f,g,h
+
+* cfdisk: avoid crash if no partition table
+* elvtune: tell user that this only works on 2.4 kernels
+* lomount: clear passwords after use
+* mount: accept comments (introduced by \;) in fstab - withdrawn again
+* mount: accept comments (specified by comment=) in fstab
+* mount: support ocfs, ocfs2
+* [u]mount: be more careful with malloc, try to avoid OOM with many mounts
+* sfdisk: __attribute__used nonsense to support gcc 3.4
+* shutdown: do not unmount various virtual filesystems
+
+util-linux 2.12c,d
+
+* mount.8: added recent ext2 mount options
+* mount: support jfs mount-by-label, improve reiserfs support
+* sfdisk: remove strange "ends in a digit" heuristic
+* *fdisk: use common disksize() routine
+
+util-linux 2.12b
+
+* chsh: improved error message
+* dmesg: ask kernel proper buffer size
+* losetup: handle 64-bit offsets
+* blockdev: also report BLKGETSIZE64 result
+* blockdev, elvtune, fdisk: handle new kernel _IOR,_IOW defines
+* fdisk: remove strange "ends in a digit" heuristic
+* fdisk: also list Solaris as possible type for 0x82
+* mount: added --rbind option
+* mount: use blkid, uuid libraries when available
+* mount: support reiserfs mount by label
+* mount: attempt to use the right definition of dev_t in struct loopinfo
+* mount.8: jfs mount options added
+* readprofile: new -s option
+* rename.1: added ref to mmv.1
+* replay: renamed to scriptreplay; correct typos
+* script: do not use locale for time delay floating point number format
+* sfdisk: error messages to stderr
+* New Catalan, Dutch, Finnish, French, German, Spanish, Swedish, Turkish,
+  Ukrainian messages
+
+util-linux 2.12a
+
+* chfn, chsh, login, vipw: SElinux support
+* fdisk: fix for kernels 2.4.15-2.4.17
+* fdisk: fix when all partitions are in use
+* hwclock: add a timeout when waiting for a clock update (Göran Weinholt)
+* ipcs: compilation fix
+* ipcs: shminfo.shmall gives pages
+* login: use getutline() instead of getutid()
+* login: fix for 64-bit time_t
+* mount: efs support
+* partx: bigendian fix
+* readprofile: support for 64-bit addresses
+* setterm: fix klogctl error message (Joern Heissler)
+* setterm.1: clarification
+* sfdisk: fix check for is_ide_cdrom_or_tape
+* umount: skip proc, devfs, devpts on umount -a
+
+util-linux 2.12
+
+* losetup: cryptoloop support
+* losetup: -p option specifies fd for passphrase
+* fdisk: sgi layout fix
+* mount: -p option specifies fd for passphrase
+* mount: recognize some PCDOS floppies
+* umount: in "umount name", first try to interpret "name" as a mount point
+
+util-linux 2.12pre
+
+* Catalan messages (Antoni Bella Perez)
+* Danish messages (Claus Hindsgaul)
+* Dutch messages (Taco Witte)
+* Finnish messages (Lauri Nurmi)
+* French messages (Michel Robitaille)
+* German messages (Michael Piefel)
+* Slovenian messages (Primoz Peterlin)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* cfdisk: localize the Y/N answer, improve printing localized messages
+* cfdisk: make various variables long long - some disks are close to 2 TB
+* cfdisk: use BLKGETSIZE64
+* fdisk: make various variables unsigned to lengthen the life of 32-bit vars
+* fdisk: some sgi fixes (Phillip Kesling)
+* fdisk: k=1000, K=1024
+* fdisk: removed last occurrences of HDIO_REQ
+* fdisk: use BLKGETSIZE64
+* hwclock: fix rtc test (Heiko Zuerker)
+* login: set a timeout on printing the timeout message (Robert Ambrose)
+* md5: x86_64 fix (mmj)
+* more: POSIX fixes
+* mount: do not supply MS_MGC_VAL when there are conflicting flags
+* mount: ncp and smb are called smbfs and ncpfs - global change
+* mount: add support for xvm mount by label (Eric Sandeen)
+* mount: correct hfs magic recognition
+* mount: keep original umask - it influences the mount call (mmj)
+* raw.8: documented unbinding of raw devices
+* readprofile: fixed off-by eight error (Werner Almesberger)
+* script: add -c option (Wayne Davison)
+* sfdisk.8: added an example of partitioning with logical partitions
+* sfdisk: only add a AA55 signature for DOS-type partition tables
+* tailf: new (Rik Faith)
+
+util-linux 2.11z
+
+* Catalan messages (Antoni Bella Perez)
+* Danish messages (Claus Hindsgaul)
+* Dutch messages (Taco Witte)
+* Finnish messages (Lauri Nurmi)
+* French messages (Michel Robitaille) - HURRAY!
+* German messages (Michael Piefel)
+* Slovenian messages (Primoz Peterlin)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* getopt: replaced getopt-1.1.2 by getopt-1.1.3 (Frodo Looijaard)
+* mkcramfs: change default blocksize for ia64 and alpha
+* more.help: removed (it is built-in now, and translated)
+* mount: add -i option (inhibit calling external mount programs)
+* mount: change default: do resolve symlinks
+* readprofile: look for System.map also in /boot/System.map-`uname -r` (mmj)
+* sfdisk: also translate "start" and "end"; s/MB/MiB/
+
+util-linux 2.11y
+
+* Danish messages (Claus Hindsgaul)
+* Finnish messages (Lauri Nurmi)
+* German messages (Michael Piefel)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* cfdisk: improve escape seq recognition when compiled with slang
+* fdisk: decimal units
+* hwclock/rtc.c: minor cleanup (Joachim Henke)
+* ipcs: compilation fix
+* more: kill external help file (Joachim Henke)
+* mount: fix LABEL= handling for user umount
+* mount: don't abort on read error on photocds (Gyorgy Kovesdi)
+* mount.8: add dmask and fmask vfat mount options
+* pg: compilation fix (Joachim Henke)
+* script: localized time strings (Goeran Uddeborg)
+* setterm: accept devfs name (Joachim Henke)
+* simpleinit: security: refuse initctl_fd if setting FD_CLOEXEC fails
+* umount: allow user umount after mount by label or uuid
+
+util-linux 2.11x
+
+* Danish messages (Claus Hindsgaul)
+* Dutch messages (Taco Witte)
+* Finnish messages (Lauri Nurmi)
+* German messages (Michael Piefel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* cfdisk: correct error printout
+* fdisk: allow addition of a new partition when logicals all used
+  but primary free
+* hwclock: detect systime jumps backward during setting hwclock
+* mkfs.cramfs: do not mmap all files simultaneously
+* mkfs.cramfs: make blocksize settable
+* mkfs.minix: correct error printout
+* mkswap.8: now max 32 swapspaces
+* mount: new --rbind flag, for recursive loopback mounts
+* mount, umount: new -O option (Michael K. Johnson)
+* mount.8: -O and win95 options documented
+* setpwnam.c: open temp pw file with O_EXCL
+* simpleinit: fix for "spawn too fast" (Denis Vlasenko)
+* swapon: new -e option (Erik Troan)
+
+util-linux 2.11w
+
+* cfdisk, fdisk: allow slightly larger disk sizes
+* fdisk: Makefile: also for m68 (sun3) (Kaj-Michael Lang)
+* fdisk: allow to use the last partial cylinder, change display format
+* fdisk: do not ask partition number in case there is only one choice
+* fdisk: new sunlabel fix
+* login: fix possible local root exploit (Wojciech Purczynski)
+* more: bigendian fix
+
+util-linux 2.11v
+
+* Catalan messages (Antoni Bella Perez)
+* Finnish messages (Lauri Nurmi)
+* Very few Russian messages (panivan@yandex.ru)
+* Slovenian messages (Primoz Peterlin)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* fdisk: add -C, -H, -S command line options
+* fdisk: allow changing type 0
+* mkswap: enable use of > 2GB swapspace
+* more: translation fix
+* mount: set umask (Sebastian Krahmer)
+* mount: test both le and be version of cramfs magic (Olaf Hering)
+* mount: recognize Oracle magic
+* pg: use fseeko64 and ftello64 when available
+
+util-linux 2.11u
+
+* Danish messages (Claus Hindsgaul)
+* German messages (Michael Piefel)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* configure: for fsck.cramfs, mkfs.cramfs: add test for libz
+* text-utils/Makefile: pg fix (Toomas Rosin)
+* po/Makefile: typo fix (Silvan Minghetti)
+* agetty: use same test as login does to find utmp entry
+* fdisk: fix for fdisk on empty disk (Michael D. Black)
+* hwclock: compilation fix on alpha
+* mount: add mount by label for jfs (Christoph Hellwig)
+* mount: add mount by label for evms (Luciano Chavez)
+* mount: allow regular files when guessing (Michal Svec)
+* partx/gpt.c: fix size computation (Matt Domsch)
+* readprofile: new option -b (David Mosberger)
+* umount: don't umount devfs upon umount -a (David Gilbert)
+
+util-linux 2.11t
+
+* fdformat: remove test on major
+* fsck.cramfs: added NLS
+* fdisk: fix device names with sundisklabels under devfs (Kaj-Michael Lang)
+* fdisk: minor polishing
+* hwclock: also handle ENOTTY ioctl return (Maciej W. Rozycki)
+* hwclock: minor polishing
+* ipcrm.8: minor polishing
+* mkfs.cramfs: added NLS
+* mkfs.cramfs: added -v (verbose) option, and made default silent
+* mount: patch for make -j (RedHat)
+* swapoff: minor polishing
+
+util-linux 2.11s
+
+* Estonian messages (Meelis Roos)
+* French messages: some minor corrections
+* German messages (Michael Piefel)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* MCONFIG: allow "make DISABLE_NLS=yes <target>" (Peter Breitenlohner)
+* configure: don't run ./conftest - better for cross-compilation (Magnus Damm)
+* fdisk: fixes for disks with OSF/1 label
+* fsck.cramfs: new (from kernel source)
+* hwclock: improved adjtime handling (James P. Rutledge)
+* hwclock: remove shhopts stuff
+* ipcs: remove unused heading (Michael Kerrisk)
+* line: replace by C version - the sh version was broken (Gunnar Ritter)
+* login: default root path: added /usr/local/[s]bin (RedHat)
+* mkfs.cramfs: new (from kernel source)
+* mount: when no type is known, assume that prefix // implies samba (RedHat)
+* mount -a: avoid stat on devices that have noauto option (Jeroen Mostert)
+* mount by label: ignore RAID partitions (RedHat)
+* [u]mount: fstab.c fix (ejb@ql.org)
+* pg: new (Gunnar Ritter)
+* sfdisk: small BSD partition fix
+* swapoff -a: also do swapoff on all files found in /proc/swaps
+* swapon -a: skip files already found in /proc/swaps
+
+util-linux 2.11r
+
+* Estonian messages (Meelis Roos)
+* German messages (Michael Piefel)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* MCONFIG: move $(CFLAGS) to the end to allow overrides (Kevin P. Fleming)
+* cal: tiny fix (Mitsuru Chinen)
+* fdisk: avoid <linux/hdreg.h>
+* fdisk: x86_64 patch (Mads Martin Jørgensen)
+* hwclock.8: zoneinfo is now in /usr/share
+* mkswap: report in KiB instead of bytes.
+
+util-linux 2.11q
+
+* fdisk: geometry improvement
+* login: open tty fix (Denis Vlasenko)
+* more: wide character patches (Mitsuru Chinen)
+* mount: complain on mount-by-label when label is not unique (Matt Copping)
+* partx: add GUID Partition Tables (Matt Domsch)
+
+util-linux 2.11p
+
+* Danish messages (Claus Hindsgaul)
+* German messages (Karl Eichwalder)
+* Spanish messages (Santiago Vila Doncel)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* ipcrm: make POSIX compatible (Andre Corwin Mazzone)
+* ipcrm.8: idem
+* kill: fixed Makefile
+* login: setsid fixes
+* mkswap: max size of swap space is very large (Peter Chubb)
+* mount: JFS support for mount-by-label (hch)
+* nfsmount: check for <rpcsvc/nfs_prot.h> (hch)
+* readprofile: keep track of line numbers (John Levon)
+* umount: fix for MNT_DETACH
+
+util-linux 2.11o
+
+* Estonian messages (Meelis Roos)
+* Japanese messages (Daisuke Yamashita)
+* Spanish messages (Santiago Vila Doncel)
+* cal: option -s: Sunday is first day of the week
+* cal.1: updated
+* cfdisk: give not only bytes but also MB or GB for clarity.
+* colrm: wide character fix (Elliot Lee)
+* *fdisk: added Darwin types (Vincent Bourgonjen)
+* fstab.5: updated
+* hexdump: -C option
+* hwclock: cmos.c: do not include <asm/io.h> on alpha
+* mount: improved detection of ufs (and slowdown of detection of iso9660)
+* mount.8: added info on * in /etc/filesystems, shortname option of vfat,
+  mount --move, udf, return codes
+* raw: try /dev/raw/rawctl when /dev/rawctl fails (Thierry Vignaud)
+* rc.serial: removed - setserial is no longer in util-linux (kromJx)
+* README.admutil: removed - only of historical interest
+* README.bootutils-0.1: removed - only of historical interest
+* script: security fix
+* sfdisk: improved geometry detection; wider columns; default disks from
+  /proc/partitions
+* umount: permission test owner umount
+* wall.1: added suid restriction
+
+util-linux 2.11n
+
+* Danish messages (Claus Hindsgaul)
+* German messages (Karl Eichwalder)
+* Swedish messages (Christian Rose)
+* Turkish messages now in UTF-8 (Nilgün Belma Bugüner)
+* blockdev: add --report option
+* cal: fix for wide multibyte-char (Motonobu Ichimura)
+* cfdisk: recognize ext3 and reiserfs (Flavio Stanchina)
+* fsck.minix: i18n changes
+* ipc.{info,texi}: minor correction
+* login: compilation fix (Jaroslaw J. Pyszny)
+* mount.8: tmpfs mount options (Karl Eichwalder)
+* mount: recognize minix v2
+* mount: support mount-by-label also for lvm (Kirby Bohling)
+* mount: order guessing of fstypes according to seek offset
+* pivot_root: compilation fix for ia64
+* readprofile: byte order auto-detection (Werner Almesberger)
+
+util-linux 2.11m
+
+* Danish messages (Claus Hindsgaul)
+* German messages (Karl Eichwalder)
+* Swedish messages (Christian Rose)
+* Turkish messages (Nilgün Belma Bugüner)
+* fdisk: added netbsd type (Steven J. Hill)
+* more: fix for unsigned char (Rusty Russell)
+* mount: added sysv magic (Tim Launchbury)
+* setterm: fixed "setterm -foreground default"
+
+util-linux 2.11l
+
+* Danish messages (Claus Hindsgaul)
+* banner: removed - it is in bsdgames
+* fdisk: show partitions with empty type but some other nonzero field
+* login: copy the static struct that getpwnam() returns before calling
+  PAM routines that might themselves use getpwnam(). Abort on problems.
+  (Olaf Kirch)
+* mount: added jfs magic (Christoph Hellwig)
+* renice: report the correct new priority after a setpriority()
+* umount: add lazy unmount (Christoph Hellwig)
+
+util-linux 2.11k
+
+  Various potential buffer overflows were pointed out by awayzzz@digibel.org.
+  Fixes in agetty, hwclock, namei, readprofile, simpleinit, vipw.
+  (Also added a few [f]close() calls - entirely superfluously.)
+
+* agetty: avoid possible buffer overflow
+* cfdisk: recognize xfs (Nathan Scott)
+* cytune: added close()
+* fdformat: added close()
+* fdisk: added fclose()
+* hwclock: avoid possible buffer overflow
+* mkfs.minix: added fclose()
+* mount: remove the assumption that 635 is the default mount port
+* namei: avoid possible buffer overflow
+* rdev: added closedir()
+* readprofile: avoid possible buffer overflow
+* sfdisk: added fclose()
+* simpleinit: avoid possible buffer overflow
+* swapon: added fclose()
+* umount: use tcp when mount was done using tcp (James D Strandboge)
+* vipw: avoid possible buffer overflow
+
+util-linux 2.11j
+
+* fdisk: fix for AIX label (Olaf Hering)
+* fdisk: fix for creating DOS label when BSD label is present
+* mount.8: added remark about blocksize to ext2 sb= mount option description.
+* partitiontype: new, not installed
+
+util-linux 2.11i
+
+* testincl: do not run conftest (Brian Murphy)
+* blockdev: corrected ioctl numbers now that BLKBSZGET is in 2.4.10pre3
+* cal: fixed for Hungarian locale
+* cal: fixed for multibyte locales (Pablo Saratxaga)
+* fdisk: avoid superfluous warning about DOS partitions
+* line: new, to support SCO shell scripts (Christoph Hellwig)
+* mount: added vxfs magic
+* passwd: tiny fix for ARM (Ken Cox)
+* replay: replay typescript with timings (Joey Hess)
+* script: add -t flag for timing (Joey Hess)
+
+util-linux 2.11h
+
+* Turkish messages (Nilgün Belma Bugüner)
+* Danish messages (Claus Hindsgaul)
+* banner: minor fix (awayzzz@digibel.org)
+* mkfs.minix: minix v2 fix
+* more.1: improved (Edward Betts)
+* mount.8: corrected description of the nwfs uni_xlate mount option
+* vipw: make temp files of mode 0600 (Bill Nottingham)
+* wall: avoid writing to /dev/:0
+
+util-linux 2.11g
+
+* MCONFIG & configure: fix for gcc 3.0
+  Note that nfsmount_xdr.c may give warnings with gcc 3.0, essentially
+  because of defines in <rpc/xdr.h> that use things like ntohl(*buf++)
+  where ntohl(x) is a macro with several occurrences of x.
+* blockdev: support for the get/set blocksize ioctls
+  [not yet in the 2.4.5 kernel]
+* fdisk: added Linux/PA-RISC type (Matt Taggart)
+* mount: minor fix (Andrey J. Melnikoff)
+* mount: added some ext3 stuff (Andrew Morton)
+* mount: added heuristics for reiserfs (Andrew Morton)
+* mount.8: added ext3 and reiserfs docs (Andrew Morton)
+
+util-linux 2.11f
+
+* Czech messages (Jiøí Pavlovský)
+* fdisk: fix for "reorder" expert command
+  (use of sfdisk afterwards is still recommended)
+* mount: minor fixes
+
+util-linux 2.11e
+
+* Danish messages (Claus Hindsgaul)
+* Brazilian Portuguese messages (Rodrigo Stulzer Lopes)
+* agetty: give tty mode 0600 instead of 0622
+* cal: improved manpage
+* cfdisk: add user-friendliness in case of empty disk (Matthew Wilcox)
+* dmesg: improved manpage
+* fdisk: SuperH fix (ISHIKAWA Mutsumi)
+* hwclock: accept alpha options in both upper and lower case
+  (so as to make the man page correct)
+* hwclock: add option --noadjtime (Henrique M Holschuh)
+* login: child must have controlling tty (Michal Moskal)
+* more: don't seek unseekable input (David Whedon)
+* mount: upon request by Richard Gooch: if the mount point is specified
+  as symlink, put symlink, not actual mount point in mtab.
+  (This avoids the long and ugly devfs names, but may break things.
+  Please complain in case of problems.)
+* mount: with mount -a -t nfs:
+  if we used fallback to nfs v3, don't do so for subsequent mounts
+* mount: add heuristics for ext3 (Andrew Morton)
+* mount: added quota info to mount.8
+* mount: allow comma-separated type lists, also in fstab
+* raw: small fix for ppc
+
+util-linux 2.11d
+
+* fdisk: fix for OSF (Will Woods)
+* chsh: compilation fix (Ronald Wahl)
+
+util-linux 2.11c
+
+* Czech messages (Jiøí Pavlovský)
+* German messages (Elrond)
+* Makefile/MCONFIG improvements (Peter Breitenlohner)
+* fdisk: added a few partition types
+* fdisk: correct partition numbering for sgi partitions (Nathan Scott)
+* fdisk: make it compile on hppa by arbitrarily treating hppa like powerpc
+  (Matt Taggart)
+* fsck.minix: improved localisation (Elrond)
+* getopt: updated to version 1.1.2 (Frodo Looijaard)
+* hwclock: fixes for IA64 (Thorsten Kukuk)
+* hwclock: use /dev/vc/1 when devfs is used (Thomas Koeller)
+* hwclock: more devfs support (e.g. /dev/misc/rtc)
+* ipcs: add spaces in output (DeWitt Clinton),
+  correct some error messages (Bobby de Vos)
+* login: fix TIOCNOTTY (Andreas Haumer, Adam J. Richter)
+* login: add btmp logging of unsuccessful login attempts (Erik Troan)
+* login: avoid a SIGHUP race with PAM enabled (Peter 'Luna' Runestig)
+* login: copy the static result returned by gethostbyname to avoid
+  corruption by pam_authenticate via pam_ldap (Andreas Damm)
+* login: removed the REDHAT_IGNORED_MAILSIZE hack
+* login: unconditionally do vhangup
+* login: zero PAM_USER when no username was given (Arkadiusz Miskiewicz)
+* look: dictionary now under /usr/share (Erik Troan)
+* mount: add sanitize_env() (Solar Designer)
+* mount: another heuristic for vfat (Michal Svec)
+* mount: xfs magic has only one endianness (Nathan Scott)
+* mount: return failure when tcp used and portmap returns 0 (H. J. Lu)
+* rdev: allow unlimited recursion to find the long devfs names
+  Also, allow major,minor pair the specify device (request by Russell Coker)
+* readprofile: array bound check (Andrew Morton)
+* script: transmit window changes to child (Joey Hess)
+* sfdisk: endian fix for ppc (Gregory Geiselhart)
+* sfdisk: new feature: sign is offset from default (Byron Stanoszek)
+* sfdisk: add some default devices to list (Luca Montecchiani)
+* sfdisk: no partition table on ide tape
+* shutdown: close files, unblock signals (Richard Gooch)
+* simpleinit: block signals in handlers; add no_reboot option (Richard Gooch)
+* swapdev: deleted, it was last used with Linux 0.12.
+* umount: mips does support umount2 (Maciej W. Rozycki)
+* umount: add sanitize_env() (Solar Designer)
+* umount: fix exit status
+* wall: do not forget 80th character (Thorsten Kukuk)
+
+util-linux 2.11b:
+
+* Danish messages (Claus Hindsgaul)
+* umount: mips does not support umount2 (Christoph Martin)
+* fdisk: tiny fix
+* mount.8: adfs options documented, xfs corrected
+
+util-linux 2.11a:
+
+* tsort: deleted - it is part of GNU textutils 2.0
+* mount: fix rootdev() (Richard Kettlewell)
+* mount: fix gid of mtab file
+* mount: try /proc/filesystems after /etc/filesystems if the latter ends in "*"
+* fdisk: added a few system types
+
+util-linux 2.11:
+
+* Jump to 2.11 to note that libc-4.5.26 is no longer supported,
+  and we require libc-4.6.27 (since now snprintf is used).
+  Also, kbdrate has now been removed. Find it in kbd-1.05.
+  Added -D_FILE_OFFSET_BITS=64 to CFLAGS.
+* Danish messages (Claus Hindsgaul)
+* fdisk: avoid loop in case of extended without logical
+* ipcs: corrected interchanged report on msg_rtime/msg_stime (Arun Kumar U)
+* kill: updated manpage
+* last: very much faster with mmap (Marek Zelem)
+* login: Applied PAM patch by David MacKenzie <djm@web.us.uu.net>
+* login: do a setsid in the child (Erik Troan)
+* mount: make "mount 192.168.1.8:/ /a -o bg" work again (Bjoern Voigt)
+* mount: added constant MS_MOVE
+* readprofile: added -M option, updated manpage (Andrew Morton)
+* setsid: fork when it would fail otherwise (John Fremlin)
+* simpleinit: updated (Richard Gooch et al.)
+* vipw: also offer to edit shadow file (Erik Troan)
+* xfs docs (Nathan Scott)
+
+util-linux 2.10s:
+
+* Danish messages (Claus Hindsgaul)
+* fixes to make gcc happy (Joseph S. Myers)
+* fix for more on parisc (Richard Hirst)
+* change rdev to search subdirectories of /dev (Paul Clements)
+* ul fix (Masao Kawamura) - set columns correctly
+* cal fix (Brendan Kehoe) - don't overflow weekday array in Gaelic
+* fdisk fix (niles@scyld.com) - flush stdout
+* fdisk fix - don't forget to write out empty label
+* login: make default tty mode 0600
+* script: refuse to write typescript if that is a symlink
+* script: accept -V to output version
+* whereis: also search /usr/share/man.
+* hwclock: improve locale handling
+* hwclock: fix for Nautilus (Neoklis Kyriazis)
+* isosize: new
+
+util-linux 2.10r:
+
+* mount: support mount by uuid or label for xfs (Nathan Scott)
+* mount: added probe for minix on bigendian systems (Nathan Scott)
+* mount: added probes for cramfs, hfs, hpfs and adfs (Sepp Wijnands)
+* mount: change setup; let umount remove at most one line from /etc/mtab
+* mount: improve man page
+* more, col, colcrt, colrm, column, ul: nls improvements (Masao Kawamura)
+
+util-linux 2.10q:
+
+* mount: accept nonnumeric uid= and gid= options
+* write and wall: security improvement
+* fixed fdformat flaw (Werner Almesberger)
+* use right mountport upon umount (Glenn Lingle)
+* simpleinit / need / initctl stuff (Richard Gooch)
+* Portuguese messages (Rodrigo Stulzer Lopes et al.)
+
+util-linux 2.10p:
+
+* mount: don't set up a loop file with -o loop,remount (Marc Mutz)
+* fdisk: changes for sectorsize different from 512
+* more: standout fix (Paul Vojta)
+* more: improve usage message (Lincoln Myers)
+* logger: Added -d option to use datagrams (Gerwin Pfab)
+* cal: Added -3 option to also print prev/next month (Michael Charles Pruznick)
+* French messages (Christophe Merlet)
+* Japanese messages (Daisuke Yamashita)
+
+util-linux 2.10o:
+
+* fdformat: fixed to work with kernel 2.4.0test6 (Marek Wojtowicz)
+* losetup: also return status when only showing loop device status (ewt)
+* mount: do not retry ro if mount was ro; improve error message
+* login: not installed suid
+* getopt: by default install aux files in /usr/share/misc
+
+util-linux 2.10n:
+
+* added blockdev.8
+* change to elvtune (andrea)
+* fixed overrun in agetty (vii@penguinpowered.com)
+* shutdown: prefer umounting by mount point (rgooch)
+* fdisk: added plan9
+* fdisk: remove empty links in chain of extended partitions
+* mount: define ALWAYS_STAT
+* mount: add replace, after, before, over, bind
+* umount: also free loop device when not writing mtab
+* lomount: try both /dev/loopN and /dev/loop/N
+* hwclock: handle both /dev/rtc and /dev/efirtc (Bill Nottingham)
+* script: added -f (flush) option (Ivan Schreter)
+* script: added -q (quiet) option (Per Andreas Buer)
+* getopt: updated to version 1.1.0 (Frodo Looijaard)
+* Czech messages (Jiri Pavlovsky)
+
+util-linux 2.10m:
+
+* chfn fix when PAM is used (Martin-D. Lacasse)
+* do not use LC_NUMERIC part of locale in hwclock when writing /etc/adjtime
+* mount status return from smb or ncp fix (Mark Peloquin)
+* mount new option -l: also print label when listing mounts
+* mount add heuristic for xfs (Martin K. Petersen)
+* mount UUID and label cache (Erik Troan)
+* mount improve check for `already mounted' in case of label or uuid
+* fdisk partition names more devfs-friendly
+* fdisk bsdlabel large disk support
+* setterm.1: options documented (Colin Watson)
+* rename correction
+* German, Spanish, French, Italian, Portuguese messages
+  (Roger Luethi, Beth Powell, Alvaro Antunes)
+
+util-linux 2.10l:
+
+* Merged losetup.c and lomount.c
+* ANSIfied everything
+
+util-linux 2.10k:
+
+* NFS version 4 mount support (Trond Myklebust)
+* hwclock fix (Stefan Ring)
+* Added -p option to col, as required by SUS (Joseph S. Myers)
+
+util-linux 2.10j:
+
+* fdisk fixes (Michal Jaegermann)
+
+util-linux 2.10i:
+
+* new directory partx (with code to play with, not to use)
+* minor fdisk changes
+
+util-linux 2.10h:
+
+* Added pivot_root (Werner Almesberger)
+* Added elvtune (Andrea Arcangeli)
+* Added need and extended simpleinit and shutdown (Richard Gooch)
+* Removed all #include <linux/fs.h>
+* errno fixes (Joseph S. Myers)
+* IA-64 fixes (Michael K. Johnson)
+* fdisk fixes for OSF/1 on Alpha (David Huggins-Daines)
+* fdisk sectorsize fix (Greg Hosler)
+* mount speed= option to enable mounting bad CDROMs (Marco d'Itri)
+* ipcrm deletes several things at once (Frank Zago)
+
+util-linux 2.10g:
+
+* fdisk can now sort partitions into order [untested, beware!]
+* Update of mkswap for sparc64 (jj)
+* Update of raw (Stephen Tweedie):
+  Control file was /dev/raw, now /dev/rawctl
+  Access files were /dev/raw*, now /dev/raw/raw*
+* Czech messages (Jiri Pavlovsky)
+* German messages (Daniel Egger)
+* losetup locks memory (Frank v Waveren)
+
+util-linux 2.10f:
+
+* Security fix for mount (okir)
+* Avoid infinite loop in namei (Brett Wuth)
+* added clock-ppc.c (from Matsuura Takanori), not merged yet
+* deleted clockB subdirectory
+* recognize mkdosfs string (Michal Svec)
+
+util-linux 2.10e:
+
+* New: rename
+* Added option to mkswap so that user can override pagesize
+* fdisk -l now reads /proc/partitions when no device was given
+* Fixed fdisk.8 (James Manning)
+* Added devpts info to mount.8 (Elrond)
+* Newline fix for logger output to stdout (Henri Spencer)
+
+util-linux 2.10d:
+
+* Do not try to mount something as udf without good reason
+* Do not loop in umount if there is a stale lock file
+* Allow fdisk twice as many cylinders
+* Fixed non-casefolding search in look (Markus Demleitner)
+
+util-linux 2.10c:
+
+* Various compilation fixes
+
+util-linux 2.10b:
+
+* Fixed smbmount problem (Andrew Tridgell)
+* Fixed ddate problem with the day after St. Tib's Day (Brad)
+* German messages (Elrond)
+* Made kill a bit more standard compliant
+* Made some more programs output a version
+
+util-linux 2.10a:
+
+* Japanese messages (Daisuke Yamashita)
+* French messages and several Debian fixes (Vincent Renardias)
+* Fixed infinite loop in mkfs.minix
+
+util-linux 2.10:
+
+* Added BSD disklabel code to rescuept
+* Added blockdev utility
+* Fix losetup return code
+* Fix unit display in cfdisk
+* Do not redefine _PATH_MAILDIR (so that recent systems can have /var/mail)
+* Added --localtime option to hwclock;
+  added third line (LOCAL/UTC) to /etc/adjtime.
+* Add -H option to agetty (David Holland)
+
+util-linux 2.9z:
+
+* Japanese messages (Daisuke Yamashita)
+* Czech messages (Jiri Pavlovsky)
+* Added some udf stuff to mount.8
+* Added ioctl for fdisk on bsdlabels
+
+util-linux 2.9y:
+
+* Wide character support (Bruno Haible)
+* German messages and some small fixes (Elrond)
+* Small fix to owner mount option (Erik Troan)
+* Don't sleep so long in clock/kd.c (Christian T. Steigies)
+
+util-linux 2.9x:
+
+* German messages and a i18n fix (Elrond)
+* mount option: allow the owner to mount a device (RedHat)
+* ugly: let login open console with O_NONBLOCK (Maciej W. Rozycki)
+* UGLY: let login ignore mail that is precisely 523 bytes long (RedHat)
+* added mkfs.bfs, mkfs.bfs.8
+* mount now recognizes qnx4 and bfs partitions
+* rescuept now recognizes Unixware partitions
+* hwclock fix on m68k (Roman Hodek)
+* several minor things
+
+util-linux 2.9w:
+
+* Updated mount.8 (Yann Droneaud)
+* Improved makefiles
+* Fixed flaw in fdisk
+
+util-linux 2.9v:
+
+* cfdisk no longer believes the kernel's HDGETGEO
+  (and may be able to partition a 2 TB disk)
+
+util-linux 2.9u:
+
+* Czech more.help and messages (Jiøí Pavlovský)
+* Japanese messages (Daisuke Yamashita)
+* fdisk fix (Klaus G. Wagner)
+* mount fix (Hirokazu Takahashi)
+* agetty: enable hardware flow control (Thorsten Kranzkowski)
+* minor cfdisk improvements
+* fdisk no longer accepts a default device
+* Makefile fix
+
+util-linux 2.9t:
+
+* national language support for hwclock
+* Japanese messages (both by Daisuke Yamashita)
+* German messages and some misc i18n fixes (Elrond)
+* Czech messages (Jiøí Pavlovský)
+* wall fixed for /dev/pts/xx ttys
+* make last and wall use getutent() (Sascha Schumann)
+  [Maybe this is bad: last reading all of wtmp may be too slow.
+   Revert in case people complain.]
+* documented UUID= and LABEL= in fstab.5
+* added some partition types
+* swapon: warn only if verbose
+
+util-linux 2.9s:
+
+* tunelp patch (Andrea Arcangeli)
+* fixed mount race (HJLu)
+* German messages (Elrond)
+
+util-linux 2.9[pqr]:
+
+* errno->errsv patch (Arnaldo Carvalho de Melo)
+* hwclock patch for the Award 4.50g BIOS "2094" bug. (Dave Coffin)
+* fdisk patch to correct deletion of last logical partition
+
+util-linux 2.9o:
+
+* fix to login by Ambrose C. Li
+* improvement to mcookie inspired by a patch from Rik Faith
+* more i18n by Arnaldo Carvalho de Melo; pt_BR locale
+
+util-linux 2.9n:
+
+* Added -u option to logger (write to user-specified socket; Martin Schultze)
+* Added mount.smb script contributed by Greg Galperin
+* Some more national language support
+* mkfs.minix argument parsing fixed
+* write fixed for /dev/pts/xx ttys
+* configure adapted for the case of <scsi/scsi.h> that needs u_char.
+
+util-linux 2.9m:
+
+* Added national language support (misiek@pld.ORG.PL)
+* minor improvements in mount, fdisk, cfdisk, agetty, more
+
+util-linux 2.9l:
+
+* Added /dev/port use to hwclock again - it may be necessary for Jensen.
+
+util-linux 2.9k:
+
+* major reshuffle of hwclock stuff; added sparc and alpha code
+* fdisk fix
+* tiny shutdown fix
+
+util-linux 2.9j:
+
+* added configure
+* merged three lists of partition types in *fdisk
+* multi page display in cfdisk
+* test for getlogin() == "";
+* start fixup hwclock
+
+util-linux 2.9i:
+
+* fixed 2.9h typo in more
+* added -m: `Monday is 1st day' option to cal (Jean-Francois Bignolles)
+* changed PAM stuff in login.c (+- mjohnson)
+* added warning to cfdisk in case of multiple bootable partitions
+* added 2048-byte sector support in fdisk (Oliver Schaertel)
+
+util-linux 2.9h:
+
+* mount recognizes "uid=useruid" and "gid=usergid" in /etc/fstab.
+* documented the fact that "mount -t smb" will call /sbin/mount.smb.
+* mount gives clear error message when fstab does not end in newline.
+* swapon checks mode of file
+* cfdisk got a more specific exit status (Enrique Zanardi)
+
+util-linux 2.9g:
+
+* mount updates (locking, "users" keyword, "/etc/filesystems",
+  "proto" and "vers" options in nfsmount, ...)
+
+util-linux 2.9f:
+
+* made ul handle lines of arbitrary length (Scott Maxwell)
+* killed some C/H/S nonsense in fdisk
+* fixes for archs with unsigned char type (Ambrose Li)
+* fdisk fixes for power pc (Tom Rini)
+* added a define for NCURSES_CONST
+* fixes for list of signals in kill.c
+* fixes for user name length in last.c
+
+util-linux 2.9e:
+
+* added a forgotten declaration to login.c (Christian Oyarzun)
+
+util-linux 2.9d:
+
+* fixed segfault in umount caused by Wilcox' patch (Steffen Zahn)
+* added lnz stuff to fdisk
+
+util-linux 2.9c:
+
+* refixed PAM stuff in login.c that was broken in 2.8.
+
+util-linux 2.9b:
+
+* split README into INSTALL and HISTORY
+* added a sentence to swapon.8
+* behaviour of write on non-ASCII fixed
+* hwclock adapted to survive a failing mktime()
+
+util-linux 2.9a:
+
+* added an include to lib/my_reboot.c so that __GLIBC__ is defined
+* added setlocale() to login-utils/chfn.c
+* do not recompute MAIL in login-utils/login.c
+
+util-linux 2.9:
+
+HIGHLIGHTS for version 2.9:
+
+1) Removed programs:
+   - strings. There is a version in binutils.
+   - frag. (Moved to historic in 2.4, crept back in 2.5. Gone again.)
+1a) Not yet removed program:
+   - setfdprm. It also is in fdutils-5.2 (with an exceptionally
+     ugly man page).
+1b) Removed directory:
+   - bsd. (The routine getopt() is in libc. err() moved to lib.)
+2) Improvements:
+   - ddate has been fixed to count down to the new, right X-day
+   - look is now willing to search non-English dictionaries
+     (i.e., uses locale)
+   - cal now knows that Dutch day abbreviations have length 2 only
+   - mcookie does not block when no random stuff is available
+   - shutdown got a configuration file /etc/shutdown.conf
+   - fdisk now reads SGI disk labels (thanks to Andreas Neuper)
+   - mkswap now knows about new swap areas; mkswap.8 has been rewritten
+   - umount knows about umount2() and forced unmounting of nfs mounts
+     (however, I don't think it really works)
+   - mount is now willing to handle file names with embedded spaces
+   - mount can now mount things by UUID or volume name
+3) Uglifications:
+   - swap.h has been replaced by a private swap_constants.h since
+     <linux/swap.h> does not compile
+   - reboot has become a private routine, since libc5 and glibc2 conflict
+   - a mkminix-0.1 directory contains some patches to let mkfs.minix
+     work under DOS. (Untested.)
+4) Numerous other small changes.
+
+0xF) Send questions and/or patches to util-linux@math.uio.no
+
+util-linux 2.9 was released by Andries Brouwer - aeb@cwi.nl
+The address util-linux@math.uio.no reaches Rik, Andries, Peter,
+Michael, Erik, Nicolai and possibly others.  Hwclock stuff is
+forwarded to Bryan.
+
+util-linux 2.8:
+
+HIGHLIGHTS for version 2.8:
+
+1) New programs:
+   - getopt(1) by Frodo Looijaard replaces the older bsd based version.
+     Keywords: Backward compatible, supports --long options.
+1) Removed programs: 
+   - chroot: is no longer in util-linux.  Get it free with GNU sh-utils
+   - hostid: No-one could figure out the right way for this program to
+		work.  Another hostid program is included in poeigl
+		(see the LSM, Primary-site: ftp.daimi.aau.dk /pub/linux/poe)
+2) Various portability enhancements.  Among other things hwclock now works
+   a lot better on non Intel architectures.  Should compile with libc 4, 5
+   and 6 as well as old and recent kernels.  People using non-intel hardware
+   are encouraged to send patches.
+3) rev now only limits linelength to memory capacity
+4) dmesg now uses a buffer that matches the kernel buffer in size (8KB)
+
+
+util-linux 2.7:
+
+HIGLIGHTS for version 2.7:
+
+1) util-linux now _requires_ ncurses.  Several programs are completely
+   converted to use terminfo (instead of termcap).
+
+2) Removed progams:
+   - clock: Dropped entirely.  Use hwclock (included).
+   - sync: is in gnu fileutils.
+   - setserial: Is being maintained by Ted Ts'o, he recommends
+	setserial-2.12 (2.13 is bad luck)
+   - clear: Included in ncurses
+   - hostname, domainname, dnsdomainname: It's in net-utils.
+   - lpcntl.
+
+3) Bugfixes, additions:
+   - cfdisk: A much improved version. All known bugs have been fixed.
+   - sfdisk: A command line fdisk type utility, formerly called fdisk-3.04.
+   - SECURITY: All known holes in login, chfn, chsh and others have been
+     plugged.  UPGRADE NOW if you haven't already fixed them yourself.
+   - Should work with libc 4, 5 and 6 (gnulibc), on m68k, intel, alpha
+     and sparc.
+
+4) Problems:
+   - The rpcgen that comes in NetKit-B-0.09 is broken.  At least as
+     packaged with RedHat 4.2 (NetKit-B-0.09-6).  There are several
+     ways to deal with this:
+     - Don't run rpcgen, the needed pre-generated sources are included
+       (nfsmount_xdr.c).  You must hack mount/Makefile to do this.
+     - Edit the source emitted by rpcgen so it can compile.  This is very
+       simple if you know C.
+     - Disable the NFS parts of mount.  You have to edit mount/Makefile
+       to do this.
+     - Use some other rpcgen.
+
+util-linux 2.6.1
+
+This release was never made public
+
+See notes for 2.6 for installation instructions.
+
+This is a incremental release containing some fixes.  A new release
+will be made later fixing the outstanding bugs.
+- Things compiles and works better with recent releases of kernel, 
+  ncurses, and so forth: fdisk, more
+- Some fixes to make things compile out of the box on alphas.
+- There has been reported a problem with login and /etc/usertty.  It
+  should be fixed.  If you still have problems get a recent MAKEDEV and 
+  use it to make new tty devices.  They were renumbered sometime during
+  the 1.3 phase of the kernel.
+- ipcs now displays the key of the structures.
+- A (harmless?) overflow bug was fixed in login.
+
+Outstanding bugs:
+- login/getty has a denial of service problem.
+- Several places needs a bit more polish.
+- There are a _lot_ of nonfatal warnings when compiling mount.  This will
+  not necesarily be fixed.
+
+
+util-linux 2.6
+
+HIGHLIGHTS for version 2.6:
+
+0) The first release with me at the helm.  PLEASE SEND PATCHES AND
+   UPDATES TO: util-linux@math.uio.no.
+
+1) Removed programs:
+   - md5sum, dsplit: available in GNU textutils.
+   - syslogd: Sysklogd is now prefered.  It is available at 
+	tsx-11.mit.edu:/pub/sources/sbin
+	sunsite.unc.edu:/pub/Linux/system/Daemons
+
+2) Bugfixes, additions: 
+   - SECURITY: All known holes in mount have been fixed.  UPGRADE NOW
+     if you haven't already!
+   - Portability enhancments to the minix filesystem utils (m68k and
+     Arm patches).
+   - passwd/chsh/chfn will not mess up the passwd file on a NIS machine
+   - others too numerous to enumerate.
+
+3) New programs: 
+   - vigr (it's like vipw)
+   - Introducing hwclock.  A complete rewrite of the latest available
+     clock source.  It supports intel/CMOS, /dev/rtc and linux/m68k
+     system clock interfaces.  Clock supports the same things but is now
+     obsolete and will not be present in the next release.  Start using
+     hwclock now.  Please.
+
+
+util-linux 2.5
+
+HIGHLIGHTS for version 2.5:
+0) Nicolai Langfeldt is taking over maintenance of util-linux, with the
+   help of a few others (Michael K. Johnson, Andries Brouwer, and Rik
+   Faith).
+
+   PLEASE SEND PATCHES AND UPDATES TO: util-linux@math.uio.no
+
+1) The following packages have been removed.  Please use the up-to-date,
+   canonical versions of these packages from the listed places:
+
+    timezone support (/usr/lib/zoneinfo, libz.a, zic, zdump):
+        elsie.nci.nih.gov:/pub/tzcode95d.tar.gz
+        elsie.nci.nih.gov:/pub/tzdata95h.tar.gz
+    MAKEDEV-C:
+        sunsite.unc.edu:/pub/Linux/system/Admin/MAKEDEV-C-1.5.tar.gz
+    MAKEDEV:
+        sunsite.unc.edu:/pub/Linux/system/Admin/MAKEDEV-2.2.tar.gz
+    md5sum:
+        prep.ai.mit.edu:/pub/gnu/textutils-1.3.tar.gz
+        [The GNU version is now compatible with the Plumb/Lankester
+        version.]
+    ksymoops:
+        Now bundled with the kernel in linux/scripts.
+
+2) update_state has been removed
+3) fdisk now supports NetBSD disklabels courtesy of Bernhard Fastenrath
+   <fasten@athene.informatik.uni-bonn.de> (and > 8GB disks, courtesy of
+   Andries Brouwer)
+4) mount improved -- many patches from Andries Brouwer for greatly improved
+   error reporting
+5) ddate, chkdupexe, and other programs have been improved and bug fixed
+6) util-linux is now a source-only distribution
+7) mcookie generates better random numbers and will use /dev/random or
+   /dev/audio if available
+8) chfn, chsh, passwd, and vipw have been updated with security patches
+   from Zefram <A.Main@dcs.warwick.ac.uk>.  Now, they all use the same
+   locking, and several security holes have been patched.  Further, chsh
+   and chfn can be configured at compile time to require a password before
+   updates and chsh can be configured to only use shells from /etc/shells.
+        
+
+HIGHLIGHTS for version 2.4 (2.3 was never released):
+0) Michael K. Johnson <johnsonm@nigel.vnet.net> is the interim maintainer
+   while Rik Faith is working on PhD work.
+1) login now makes the login tty mode 600 and places it in group "tty"
+2) wall, and write will not write dangerous escape sequences
+3) wall and write can be run setgid "tty".  If util-linux is compiled for
+   this option, "mesg y" will only set group write instead of group/other
+   write.
+4) fdisk and cfdisk have been patched with the latest llseek.c.  Although I
+   had a lot of bug reports about fdisk from util-linux-2.2, I was unable
+   to reproduce any of the problems.  Some of the problems appeared to be
+   releated to a failure to reboot the machine after changing the partition
+   table, and some may have been due to a specific kernel revision problem.
+   However, this doesn't seem to account for all of the bug reports -- if
+   this version gives you problem, please send as complete a bug report as
+   possible.
+5) chkdupexe from Nicolai Langfeldt (janl@ifi.uio.no)
+6) ctrlaltdel now installs into /sbin instead of /usr/sbin
+7) mkfs replacement from Ron Sommeling (sommel@sci.kun.nl)
+8) lpcntl removed.  Use tunelp instead.
+9) ksymoops from Greg McGary <gkm@magilla.cichlid.com>
+10) mkfs.minix now clears the first 512 bytes of the file system so that
+    Minix disks won't be confused with MSDOS disks (Daniel Quinlan
+    (quinlan@yggdrasil.com))
+11) mkswap should now work on an Alpha running Linux
+12) frag removed.  See
+    sunsite.unc.edu:/pub/Linux/system/Filesystems/defrag-0.6.tar.gz for the
+    latest version.
+13) mount patches from Andries.Brouwer@cwi.nl and Dan Quinlan
+    (quinlan@yggdrasil.com).
+14) MAKEDEV and MAKEDEV-C updated to the latest versions.
+15) Paths updated for FSSTND 1.2.  This means that you may need to make
+    some links.  The links you need to make we system dependent.  The
+    ultimate goal is to rename /var/adm to /var/log and have a symbolic
+    link from /var/adm to /var/log during the transition period.  If you
+    are running an ELF system, you probably won't have to do anything.  The
+    bottom line is that the following files must exist or be pointers to
+    the old version (used internally by the a.out libraries):
+
+             New                 Old
+
+        /var/log/wtmp       /var/adm/wtmp
+        /var/log/lastlog    /var/adm/lastlog
+        /var/run/utmp       /var/adm/utmp
+
+HIGHLIGHTS for version 2.2:
+1) This is primarily a quick bug-fix release for version 2.1
+2) mkfs wrapper added back in, since e2fsprogs only supplies an fsck wrapper
+3) selection removed, since someone appears to be maintaining it now.  See
+   sunsite.unc.edu:/pub/linux/kernel/patches/console for recent sources.
+   For the time being, I'm keeping a copy in the historic subdirectory of
+   util-linux.  A "make install" should work find from within that
+   directory.
+4) Note that other floppy utilities are available from:
+    ftp.imag.fr:pub/Linux/ZLIBC/fdutils/fdutils-4.1.src.tar.gz
+    sunsite.unc.edu:/pub/Linux/system/Misc/fdutils-4.1.src.tar.gz
+    tsx-11.mit.edu:/pub/linux/sources/sbin/fdutils-4.1.src.tar.gz
+
+
+HIGHLIGHTS for version 2.1:
+
+1) Directory structure rearrange, with configuration support for those who
+   use shadow passwords and System V init (no support is provided for these
+   things, but your utilities won't get overwritten if you do a "make
+   install" after you properly edit MCONFIG).
+2) fdisk and cfdisk should work as expected with 2GB+ disk drives
+3) As usual, lots of stuff was updated and added, including mount, vipw,
+   readprofile
+4) Some stuff was also deleted, and can now be found elsewhere:
+    fsck wrapper: tsx-11.mit.edu:/pub/linux/ALPHA/ext2fs/e2fsprogs*
+    pwd, su: prep.ai.mit.edu:/pub/gnu/sh-utils*
+    ed: prep.ai.mit.edu:/pub/gnu/ed*
+    od: prep.ai.mit.edu:/pub/gnu/textutils*
+    uudecode/uuencode: prep.ai.mit.edu:/pub/gnu/sharutils*
+    bdflush/update: ftp.funet.fi:/pub/OS/Linux/PEOPLE/Linus/v1.1/bdflush*
+
+
+
+PARTIAL HISTORY OF UTIL-LINUX:
+
+bsd:
+    Nothing in this directory gets installed, but some BSD programs need
+    this support:
+        err.c: 8.1 (Berkeley) 6/4/93
+        err.h: 8.1 (Berkeley) 6/2/93
+        getopt.c: 4.13 (Berkeley) 2/23/91
+        pathnames.h: 5.3 (Berkeley) 5/9/89 with extensive modifications for
+                     Linux
+
+disk-utils:
+    cfdisk: 0.8 BETA (>2GB) from Kevin E. Martin (martin@cs.unc.edu) with
+            modifications for disks > 2GB.
+            ftp.cs.unc.edu:/pub/users/martin/linux/cfdisk-0.8.tar.gz
+    fdformat: Werner Almesberger (almesber@nessie.cs.id.ethz.ch), with
+              modifications by Marcel Mol (marcel@dutecad.et.tudelft.nl)).
+              Later, updated with a September 1992 version by Werner.
+    fdisk: A. V. Le Blanc (LeBlanc@mcc.ac.uk) fdisk 1.5 release, with
+           patched from Kevin Martin for DOS and OS/2 compatibility (1.5a);
+           Rik Faith (1.5b, 2.0).
+    fsck.minix, mkfs.minix: Linus Torvalds, with modifications by: Rik
+                            Faith (faith@cs.unc.edu), Scott Heavner
+                            (sdh@po.cwru.edu), Dr. Wettstein
+                            (greg%wind.uucp@plains.nodak.edu), Daniel
+                            Quinlan (quinlan@yggdrasil.com).
+    mkfs: David Engel (david@ods.com) and Fred N. van Kempen
+          (waltje@uWalt.NL.Mugnet.ORG)
+          Version 1.9 from Ron Sommeling (sommel@sci.kun.nl)
+    mkswap: Linus Torvalds, with modifications by Mike Jagdis
+            (jaggy@purplet.demon.co.uk. )
+            Version for Alpha from
+            cage.cs.arizona.edu:/pub/davidm/linux/mkswap-axp-950503.tar.gz
+    setfdprm: Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
+              Note that more floppy utilities are available from:
+                ftp.imag.fr:pub/Linux/ZLIBC/fdutils/fdutils-4.1.src.tar.gz
+                sunsite.unc.edu:/pub/Linux/system/Misc/fdutils-4.1.src.tar.gz
+                tsx-11.mit.edu:/pub/linux/sources/sbin/fdutils-4.1.src.tar.gz
+    llseek.c: from Remy Card's e2fsprogs-0.5b.tar.gz (21Mar95 version) from:
+                sunsite.unc.edu:/pub/Linux/system/Filesystems/ext2
+
+games:
+    banner: (8.3 (Berkeley) 4/2/94)
+            ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+
+login-utils:
+    agetty: W. Z. Venema, ported by Peter Orbaek <poe@daimi.aau.dk>.
+            ftp.daimi.aau.dk:/pub/linux/poe/poeigl-1.37.tar.gz
+    chfn: Salvatore Valente <svalente@athena.mit.edu>
+    chsh: Salvatore Valente <svalente@athena.mit.edu>
+    last: 5.11 w/year (Berkeley) 6/29/88; Port by Michael Haardt with
+          changes by Peter Orbaek.
+          ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil-1.16.tar.gz
+    login: 5.40 (Berkeley) 5/9/89; with ports by Michael Glad and Peter Orbaek
+           ftp.daimi.aau.dk:/pub/linux/poe/poeigl-1.37.tar.gz
+    mesg: 8.2 (Berkeley) 1/21/94
+          ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    newgrp: Michael Haardt, with modifications by Peter Orbaek.
+            ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil-1.16.tar.gz
+    passwd: Peter Orbaek, with yp modifications by Alvaro Martinez
+            Echevarria (alvaro@enano.etsit.upm.es)
+            ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil-1.16.tar.gz
+    shutdown: Peter Orbaek, with new modifications by Stephen Tweedie, Rik
+              Faith, and Dave (gentzel@nova.enet.dec.com).
+              ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil-1.16.tar.gz
+    simpleinit: Peter Orbaek
+                ftp.daimi.aau.dk:/pub/linux/poe/poeigl-1.37.tar.gz
+    vipw: 5.16 (Berkeley) 3/3/91, with modifications by Mike Grupenhoff
+          <kashmir@umiacs.UMD.EDU> 
+    wall: 8.2 (Berkeley) 11/16/93 (With changes so that damaging escape
+          sequences cannot be sent.)
+          ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+
+
+misc-utils:
+    cal: 8.4 (Berkeley) 4/2/94, with modifications by Rik Faith and
+         Hein@student.tu-clausthal.de (Jochen Hein).
+         ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    chkdupexe: Version 1.2 from "Nicolai Langfeldt" <janl@ifi.uio.no>
+    clear: Rik Faith
+    ddate: Druel the Chaotic aka Jeremy Johnson aka mpython@gnu.ai.mit.edu,
+           with modifications by Lee Harvey Oswald Smith, K.S.C. and
+           substantial updates from Rev. Bro. Lee H:. O:. Smith, KYTP
+    domainname: Peter Orbaek
+            ftp.daimi.aau.dk:/pub/linux/poe/poeigl-1.37.tar.gz
+    dsplit: David Arnstein (arnstein@netcom.com)
+            gatekeeper.dec.com:/pub/usenet/comp.sources.misc/volume40/dsplit
+    getopt (getoptprog): jhunix.hcf.jhu.edu:
+           /pub/public_domain_software/NetBSD/usr/src/usr.bin/getopt
+	   replaced by getopt-1.0.3.tar.gz from Frodo Looijaard,
+	   found at http://huizen.dds.nl/~frodol
+    hostid: Mitch DSouza (m.dsouza@mrc-apu.cam.ac.uk)
+            ftp.daimi.aau.dk:/pub/linux/poe/poeigl-1.37.tar.gz
+    hostname/dnsdomainname: Peter Tobias <tobias@server.et-inf.fho-emden.de>
+              This version (1.6) should also be available soon in:
+              nic.funet.fi:/pub/OS/Linux/PEOPLE/Linus/net-source/base/NetKit-A*
+    kill: BSD version, modified by Salvatore Valente <svalente@mit.edu>
+    logger: 8.1 (Berkeley) 6/6/93, with modifications by Rik Faith
+            ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    look.c: 8.1 (Berkeley) 6/14/93, with modifications by Rik Faith
+            ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    mcookie: Rik Faith (faith@cs.unc.edu)
+    md5sum: Branki Lankester and Colin Plumb.  The MD5 message-digest
+            algorithm is in the Public Domain.  This implementation
+            calculates message-digest information only, and can NOT be used
+            for encryption.  Therefore it is exportable from the USA.
+            Original sources in the MIT version of PGP 2.6.2.
+    namei: Roger S. Southwick, with modifications by Steve Tell.
+    reset: Rik Faith
+    script: 5.13 (Berkeley) 3/5/91, with modifications by Rick Sladkey
+            (jrs@world.std.com), Harald Koenig
+            (koenig@nova.tat.physik.uni-tuebingen.de).
+    setterm: Gordon Irlam (gordoni@cs.ua.oz.au), with modifications by
+             Peter MacDonald, Mika Liljeberg (liljeber@cs.Helsinki.FI),
+             John Walder (j-walder@uiuc.edu) [for dosemu].
+    tsort: 5.3 (Berkeley) 6/1/90
+           wuarchive.wustl.edu:/mirrors/4.3-reno
+    whereis: 5.5 (Berkeley) 4/18/91
+             wuarchive.wustl.edu:/mirrors/4.3-reno
+    write: 8.1 (Berkeley) 6/6/93, with modifications by Mike Grupenhoff
+           (kashmir@umiacs.umd.edu).  With changes so that damaging escape
+           sequences cannot be sent.
+           ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+
+
+mount:
+    mount, umount, swapon
+
+    Rick Sladkey put together the mount-0.99.6.tar.Z package, and Stephen
+    Tweedie provided updates.  The utilities were originally from that
+    package (all appear to be by Doug Quale (quale@saavik.cs.wisc.edu),
+    with modifications by H. J. Lu (hlu@eecs.wsu.edu) on 11/25/92; Rick
+    Sladkey (jrs@world.std.com) in January 1993; and Stephen Tweedie
+    <sct@dcs.ed.ac.uk> on 8 October 1993.  This distribution mount now
+    supports NFS stuff.  I have modified the man pages.  I have also added
+    a small patch from Hamish Glen Coleman (t933093@minyos.xx.rmit.OZ.AU)
+    which restores the -o semantics.
+    
+    Updated with Rick Sladkey's mount-0.99.14.tar.gz package, and with
+    extra patches from Rick.  Adam J. Richter allowed -t option to be
+    optional. Patrick J. Volkerding (volkerdi@mhd1.moorhead.msus.edu) and
+    Mitchum DSouza both provided patches that fixed the (null) problem when
+    not using -t. Mitchum DSouza
+    (mitch@mrc-applied-psychology.cambridge.ac.uk) added support for loop
+    device mounts. Sebastian Lederer
+    (lederer@next-pc.informatik.uni-bonn.de) added support for sending an
+    unmount RPC call to the server when an NFS-filesystem is unmounted.
+    Sander van Malssen (svm@kozmix.hacktic.nl) added support for remounting
+    readonly file systems readonly.  Mike Grupenhoff
+    <kashmir@umiacs.UMD.EDU> added a probe of the superblock for the type
+    before /proc/filesystems is checked.  Andries.Brouwer@cwi.nl fixed up
+    error reporting.
+
+    Updated with patches from Andries.Brouwer@cwi.nl and Dan Quinlan
+    (quinlan@yggdrasil.com).  And more patches from Andries and others.
+
+historic/selection: The complete selection-1.5 package, by Andrew Haylett
+    <ajh@gec-mrc.co.uk>, 17th June 1993, is included in the historic tree.
+    Kernel patches are no longer necessary for modern kernels, but these
+    were tiny so I left them in for historical reasons.  The Makefile was
+    modified for this distribution.  With changes from Rick Sladkey.
+
+sys-utils:
+    arch: Rik Faith <faith@cs.unc.edu>
+    chroot: Rick Sladkey <jrs@world.std.com>
+    clock: Originally from the timesrc-1.2.tar.Z package, Charles Hedrick,
+           hedrick@cs.rutgers.edu (V1.0); Rob Hooft, hooft@chem.ruu.nl
+           (V1.1); Harald Koenig (koenig@nova.tat.physik.uni-tuebingen.de)
+           (V1.2).  With additional changes: Hamish Coleman
+           (hamish@zot.apana.org.au) (V1.2a); Alan Modra
+           (alan@spri.levels.unisa.edu.au (V1.3, V1.4).
+    ctrlaltdel: Peter Orbaek <poe@daimi.aau.dk>
+                ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil-1.16.tar.gz
+    cytune: Nick Simicish (njs@scifi.emi.net) and Rik Faith (faith@cs.unc.edu)
+    dmesg: Theodore Ts'o (tytso@athena.mit.edu); Rick Sladkey
+           (jrs@world.std.com)
+    ipcrm: From the ipcdelta.tar.z distribution by krishna
+           balasub@cis.ohio-state.edu on 3/15/93.  ipc.info and ipc.texi
+           are also from that distribution.
+    ipcs: Also from the ipcdelta.tar.z distribution by krishna
+          balasub@cis.ohio-state.edu, with patches from Mike Jagdis
+          (jaggy@purplet.demon.co.uk)
+    kbdrate: Rik Faith (faith@cs.unc.edu), with patches from
+             Andries.Brouwer@cwi.nl and John Bowman
+             (bowman@hagar.ph.utexas.edu)
+    ksymoops: 1.7 from Greg McGary <gkm@magilla.cichlid.com>
+    rdev: almesber@nessie.cs.id.ethz.ch (Werner Almesberger), with
+          modifications from Peter MacDonald, Stephen Tweedie
+          (sct@dcs.ed.ac.uk), and Dave (gentzel@nova.enet.dec.com)
+    readprofile: Alessandro Rubini from readprofile-2.0.tar.gz
+    renice: 8.1 (Berkeley) 6/9/93
+            ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    setserial: Michael K. Johnson (johnsonm@stolaf.edu) re-released Rick
+               Sladkey's setserial in January 1993, with changes by
+               Theodore Ts'o (tytso@mit.edu).  I think that Theodore also
+               did extensive changes for version 2.01, I can't find any
+               notes about this in the documentation. However, Theodore
+               Ts'o (tytso@ATHENA.MIT.EDU) released version 2.10, and that
+               is now included.
+    setsid: Rick Sladkey <jrs@world.std.com>
+    sln: Mike Parker and David MacKenzie (from Linux's libc)
+    sync: Nick Holloway, with thanks to James Bonfield
+    tunelp: Michael K. Johnson (johnsonm@nigel.vnet.net)
+
+
+syslogd:
+   5.45 (Berkeley) 3/2/91
+
+   Most of the changes for syslogd come from Rick Sladkey
+   (jrs@world.std.com), but I'd like to thank other people who sent in
+   changes (which usually got forwarded to Rick): Carsten Paeth
+   (calle@calle.in-berlin.de) and Kaz Sasayama (kaz@lilia.iijnet.or.jp).
+
+text-utils:
+    col: 5.3 (Berkeley) 2/2/91; with patches from Andries.Brouwer@cwi.nl
+         and Carl Christofferson (cchris@connected.com)
+         wuarchive.wustl.edu:/mirrors/4.3-reno/{bin,usr.bin}
+    colcrt: 8.1 (Berkeley) 6/6/93 (Bill Joy)
+            ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    colrm: 5.4 (Berkeley) 6/1/90 (Jeff Schriebman)
+    column: 8.3 (Berkeley) 4/2/94
+            ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+    hexdump: 5.5 (Berkeley) 6/1/90
+             wuarchive.wustl.edu:/mirrors/4.3-reno/{bin,usr.bin}
+    more: 5.19 (Berkeley) 6/29/88 (Eric Shienbrood, Geoff Peck, John Foderaro)
+    rev: 5.2 (Berkeley) 3/21/92; with modifications by Charles Hannum
+         (mycroft@gnu.ai.mit.edu), Brian Koehmstedt (bpk@gnu.ai.mit.edu),
+         bjdouma@xs4all.nl
+         wuarchive.wustl.edu:/mirrors/4.3-reno/{bin,usr.bin}
+    strings: 5.10 (Berkeley) 5/23/91; with patches from Vitor Duarte
+             <vad@fct.unl.pt>
+             wuarchive.wustl.edu:/mirrors/4.3-reno/{bin,usr.bin}
+    ul: 8.1 (Berkeley) 6/6/93
+        ftp.cdrom.com:/pub/bsd-sources/4.4BSD-Lite/usr/src/usr.bin
+
diff --git a/util-linux-ng-2.17.2/README b/util-linux-ng-2.17.2/README
new file mode 100644
index 0000000..13d13e3
--- /dev/null
+++ b/util-linux-ng-2.17.2/README
@@ -0,0 +1,99 @@
+
+                          util-linux-ng
+           (fork of util-linux, based on version 2.13-pre7)
+
+         util-linux is a random collection of Linux utilities
+
+WEB PAGE:
+
+     http://kernel.org/~kzak/util-linux-ng/
+
+
+MAILING LIST:
+
+      E-MAIL: util-linux-ng@vger.kernel.org
+      URL:    http://vger.kernel.org/vger-lists.html#util-linux-ng
+
+
+DOWNLOAD:
+
+      ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/
+
+
+SOURCE CODE:
+
+      Web interface:
+          http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git
+      Checkout:
+          git clone git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git util-linux-ng
+
+NLS (PO TRANSLATIONS):
+
+      PO files are maintained by:
+          http://translationproject.org/domain/util-linux-ng.html
+
+NEUTRALITY:
+
+      The stuff in util-linux-ng should be rather distribution-neutral.
+      No RPMs/DEBs/... are provided - get yours from your distributor.
+
+
+VERSION SCHEMA:
+
+      Standard releases:
+
+          <major>.<minor>[.<maint>[.<bugfix>]]
+
+             major = fatal and deep changes
+             minor = typical release with new fetures
+             maint = maintenance releases; bug fixes only
+             bugfix = unplanned releases for critical/security bugs
+
+      Development releases:
+
+         <major>.<minor><suffix>
+
+             suffix = "devel" or "-rc<N>"
+
+
+COMPILATION:
+
+      See the INSTALL file for more details.
+
+      Notes:
+            * use SUID_CFLAGS and SUID_LDFLAGS when you want to define special
+              compiler options for typical suid programs, for example:
+
+                  ./configure SUID_CFLAGS="-fpie" SUID_LDFLAGS="-pie"
+
+              This feature is currently supported for chfn, chsh, newgrp,
+              write, mount, and umount.
+
+
+STATIC LINKING:
+
+      Use --enable-static-programs[=LIST] configure option when you want to use
+      statically linked programs.
+
+      Note, mount(8) uses get{pw,gr}nam() and getpwuid() functions for
+      translation from username and groupname to UID and GID. These functions
+      could be implemented by dynamically loaded independent modules (NSS) in
+      your libc (e.g. glibc). These modules are not statically linked to
+      mount(8) and mount.static is still using dlopen() like dynamically
+      linked version.
+
+      The translation won't work in environment where NSS modules are
+      not installed.
+
+      For example normal system (NSS modules are available):
+
+              # ./mount.static -v -f -n -ouid=kzak /mnt/foo
+              LABEL=/mnt/foo on /mnt/foo type vfat (rw,uid=500)
+                                                       ^^^^^^^
+      and without NSS modules:
+
+              # chroot . ./mount.static -v -f -n -ouid=kzak /mnt/win
+              LABEL=/mnt/win on /mnt/win type vfat (rw,uid=kzak)
+                                                       ^^^^^^^^
+
+
diff --git a/util-linux-ng-2.17.2/README.devel b/util-linux-ng-2.17.2/README.devel
new file mode 100644
index 0000000..d813574
--- /dev/null
+++ b/util-linux-ng-2.17.2/README.devel
@@ -0,0 +1,117 @@
+
+ Notes for util-linux-ng developers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AUTOTOOLS:
+
+     * "./autogen.sh" generates all necessary files (run it after checkout from
+       git)
+
+     * "make distclean" removes all unnecessary files, but code is still possible
+       recompile by "./configure; make"
+
+     * "make dist-gzip" (or -bzip2) creates tarball which is possible use without
+      autogen.sh
+
+
+PATCHES:
+
+     * send your patches to the mailing list or to upstream maintainer
+       (see the AUTHORS file)
+
+     * diff -u
+
+     * don't include generated (autotools) stuff to your patches
+       (hint: use git-clean [-X])
+
+     * patches are delivered via email only.  Downloading them from internet
+       servers is a pain.
+
+     * one patch per email, with the changelog in the body of the email.
+
+     * Subject: [PATCH] subsystem: description
+
+     * if someone else wrote the patch, they should be credited (and blamed)
+       for it. To communicate this, add a line:
+
+          From: John Doe <jdoe@wherever.com>
+
+     * add a Signed-off-by line (hint: use "git commit -s")
+
+       The sign-off is a simple line at the end of the explanation for the
+       patch, which certifies that you wrote it or otherwise have the right to
+       pass it on as a open-source patch.  The rules are pretty simple: if you
+       can certify the below:
+
+           By making a contribution to this project, I certify that:
+
+           (a) The contribution was created in whole or in part by me and I
+               have the right to submit it under the open source license
+               indicated in the file; or
+
+           (b) The contribution is based upon previous work that, to the best
+               of my knowledge, is covered under an appropriate open source
+               license and I have the right under that license to submit that
+               work with modifications, whether created in whole or in part
+               by me, under the same open source license (unless I am
+               permitted to submit under a different license), as indicated
+               in the file; or
+
+           (c) The contribution was provided directly to me by some other
+               person who certified (a), (b) or (c) and I have not modified it.
+
+           (d) I understand and agree that this project and the contribution
+               are public and that a record of the contribution (including all
+               personal information I submit with it, including my sign-off) is
+               maintained indefinitely and may be redistributed consistent with
+               this project or the open source license(s) involved.
+
+       then you just add a line saying
+
+               Signed-off-by: Random J Developer <random@developer.example.org>
+
+       using your real name (sorry, no pseudonyms or anonymous contributions.)
+
+
+     * for more details see:
+
+       The perfect patch
+                http://userweb.kernel.org/~akpm/stuff/tpp.txt
+
+CODING STYLE:
+
+     * the preferred coding style is based on the linux kernel Documentation/CodingStyle.
+       For more details see:
+
+       http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/CodingStyle
+
+
+SCM (source code management):
+
+     git clone git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git util-linux-ng
+
+
+    * maintenance (stable) branch
+        - created for every <major>.<minor> release
+        - branch name: stable/v<major>.<minor>
+
+    * bugfix branch
+        - created for <major>.<minor>.<maint> release for critical/security bugs only
+        - this branch is optional
+        - branch name: stable/v<major>.<minor>.<maint>
+
+    * master branch
+        - the status of this branch is: "it works for me". It means useful
+          but not well tested patches.
+        - it's source for occasional snapshots
+        - for long-term development or invasive changes should be an active
+          development forked into a separate branch (topic branches) from the
+          tip of "master".
+
+    * A new tag object is created for:
+        - every release, tag name: v<version>
+
+
+    * KNOWN BUGS:
+        - tag v2.13.1 is typo. Please, ignore this tag.
+
diff --git a/util-linux-ng-2.17.2/README.licensing b/util-linux-ng-2.17.2/README.licensing
new file mode 100644
index 0000000..0f4fef0
--- /dev/null
+++ b/util-linux-ng-2.17.2/README.licensing
@@ -0,0 +1,22 @@
+
+The project utils-linux-ng doesn't use same license for all code. There are
+code with:
+
+   * GPLv3+ (GNU General Public License version 3, or any later version)
+
+   * GPLv2+ (GNU General Public License version 2, or any later version)
+
+   * GPLv2 (GNU General Public License version 2)
+
+   * LGPLv2+ (GNU Lesser General Public License v2 (or 2.1) or any later version)
+
+   * BSD with advertising
+
+   * Public Domain
+
+Please, check source code for more details. A license is usually at the start
+of each source file.
+
+The /COPYING file (GPLv2+) is the default license for code without an explicitly
+defined license.
+
diff --git a/util-linux-ng-2.17.2/TODO b/util-linux-ng-2.17.2/TODO
new file mode 100644
index 0000000..cc3c0f9
--- /dev/null
+++ b/util-linux-ng-2.17.2/TODO
@@ -0,0 +1,145 @@
+libblkid
+--------
+
+ - add command line interface for blkid_probe_filter_types():
+
+       # blkid -p -o udev --filter-type nofat
+
+ - add -<BE|LE> suffix to test images for native-endian filesystems (e.g. swap)
+   and add support for such functionality to tests/ts/blkid/low-probe
+
+ - consolidate "getsize" stuff (see getsize.c and lib/blkdev.c)
+
+ - add values:
+
+	FSSIZE   -- filesystem size (klibc requirement)
+
+ - add reference counters to the binary interfaces. Currently, all chain 
+   data are allocated in blkid_probe and cannot be used independently on 
+   the probing stuff.
+
+	blkid_topology tp = blkdi_probe_get_topology(pr)
+
+	blkid_ref(tp);
+	...
+	blkid_unref(tp);
+
+fdisk(s)
+--------
+
+ * use off_t instead "long long"
+
+ * catch SIGINT (Ctrl-C) and return to main menu.
+   From Red Hat bugzilla #545488:
+
+   While using fdisk normally, if you accidentally pressed the wrong button (to
+   start a sequence of questions for some operation, e.g. 'c' to create
+   partition).  The tool tries too hard to keep asking you for valid input.  You
+   can't provide a blank or invalid input to get it to break out of the current
+   dialog sequence and get back to the main menu.
+
+ * fdisk/* refactoring
+
+ * add GPT support
+
+misc
+----
+
+ * use ngettext() for strings with plurals, for example
+
+    /* include/nls.h */
+    #define P_(id, id_plural, n)	ngettext(id, id_plural, n)
+
+    printf(P_("%d used sector",
+              "%d used sectors", sectors),
+              sectors);
+
+ * check for program_invocation_short_name in ./configure.ac and add 
+   lib/progname.c fallback for libc without this feature (for example
+   use the 1st field from /proc/#/cmdline)
+
+ * use something better than gtk-doc (doxyden?)
+
+ * partx: copy sun.c, mac.c and dash.c from kpartx
+   git://git.kernel.org/pub/scm/linux/storage/multipath-tools/.git
+
+ * swapon -s  -- LABELs support
+
+   Although mkswap has recently been -L option to create a label nothing appears to
+   have been change to swapon to display said labels. (rh#430386)
+
+ * use TZ=UTC for tests
+
+ * add NLS and err.h stuff to schedutils (chrt.c, taskset.c)
+
+ * add mllockall() and SCHED_FIFO to hwclock,
+   see http://lkml.org/lkml/2008/10/12/132
+ 
+ * use rpmatch() for all Y/N questions
+
+ * mount -a -- reorder fstab entries by paths before mount (just idea only)
+
+ * mount -a  (just idea only)
+
+        Date:   Sun, 3 Jun 2007 18:04:24 +0300 (MET DST)
+        From: Szabolcs Szakacsits <szaka@sienet.hu>
+
+	In the past the right record order could be figured out easily by just
+	checking out fstab (if one knew what to look for) but considering the
+	fastly increasing number of user space file systems and their usage, with
+	their path, library, etc dependencies, it's getting trickier and is a black
+	magic for most users because they simply expect drives to be mounted
+	independently of their order in fstab.
+
+	One typical, wrongly edited fstab example is:
+
+	  /dev/hda2 /             ext3      defaults  1 1
+	  /dev/hda1 /mnt/windows  ntfs-3g   defaults  0 0
+	  /dev/hda3 /usr          ext3      defaults  0 0
+
+	The events:
+
+	  mount  ->  /sbin/mount.ntfs-3g  ->
+		 ->  resolves to <path1>/ntfs-3g via a symlink ->
+		 ->  ntfs-3g requires at least <path2>/libfuse*
+
+	There are many potential solutions. For example installing everything on
+	the root file system which may be needed for successful mount. But this
+	is not always feasible or practical since we could end up putting almost
+	everything on the root file system in the end.
+
+	Another idea is an improved mount strategy:
+
+	  do {
+		try to mount all unmounted entries
+	  } while (not all mounted && at least one new was successfully mounted)
+
+ * agetty: use nl_langinfo() for days and months rather than hardcoded
+   English names.
+
+ * rewrite ipcs to use /proc/sys/kernel rather than unreliable syscalls
+   (there are problems with 32bit userspace on 64bit kernel)
+
+ * minix v3
+
+	From: Matthias Koenig <mkoenig@suse.de>
+	Date:   Tue, 25 Sep 2007 12:00:01 +0200
+
+	It seems that the kernel has support for minix fs v3
+	(though I have not tried it, just inspected some code when
+	trying to find a mkfs.minix issue).
+	It might be worth a thought implementing v3 support
+	(though I am not really sure how much people us minix fs ;-)
+	This might require some major code cleanup in mkfs.minix.
+
+ * rtcwake does not support wake from S5/off
+   http://bugzilla.redhat.com/show_bug.cgi?id=449115
+
+ * add SELinux security contexts support to the 'ipcs' utility
+   http://bugzilla.redhat.com/show_bug.cgi?id=225342
+
+   Would be great to list the current system IPC Objects with their respective
+   security labels (where allowed) with something like 'ipcs -Z' - following the
+   way other tools reports those.
+
+
diff --git a/util-linux-ng-2.17.2/aclocal.m4 b/util-linux-ng-2.17.2/aclocal.m4
new file mode 100644
index 0000000..f14421a
--- /dev/null
+++ b/util-linux-ng-2.17.2/aclocal.m4
@@ -0,0 +1,1149 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# 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 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# 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 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  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
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# 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 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  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 for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  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_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],
+[m4_foreach_w([_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, 2008
+# 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 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  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_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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
+
+m4_include([m4/gettext.m4])
+m4_include([m4/gtk-doc.m4])
+m4_include([m4/iconv.m4])
+m4_include([m4/lib-ld.m4])
+m4_include([m4/lib-link.m4])
+m4_include([m4/lib-prefix.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/nls.m4])
+m4_include([m4/po.m4])
+m4_include([m4/progtest.m4])
+m4_include([m4/tls.m4])
diff --git a/util-linux-ng-2.17.2/autogen.sh b/util-linux-ng-2.17.2/autogen.sh
new file mode 100755
index 0000000..f5e83f2
--- /dev/null
+++ b/util-linux-ng-2.17.2/autogen.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+#
+# Helps generate autoconf/automake stuff, when code is checked out from SCM.
+#
+# Copyright (C) 2006-2009 - Karel Zak <kzak@redhat.com>
+#
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+THEDIR=`pwd`
+cd $srcdir
+DIE=0
+HAS_GTKDOC=1
+
+(autopoint --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have autopoint installed to generate util-linux-ng build system.."
+        echo "Download the appropriate package for your distribution,"
+        echo "or see http://www.gnu.org/software/gettext"
+        DIE=1
+}
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autoconf installed to generate util-linux-ng build system."
+	echo
+	echo "Download the appropriate package for your distribution,"
+	echo "or see http://www.gnu.org/software/autoconf"
+	DIE=1
+}
+
+#(libtool --version) < /dev/null > /dev/null 2>&1 || {
+#	echo
+#	echo "You must have libtool-2 installed to generate util-linux-ng build system."
+#	echo "Download the appropriate package for your distribution,"
+#	echo "or see http://www.gnu.org/software/libtool"
+#	DIE=1
+#}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have automake installed to generate util-linux-ng build system."
+	echo 
+	echo "Download the appropriate package for your distribution,"
+	echo "or see http://www.gnu.org/software/automake"
+	DIE=1
+}
+(autoheader --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autoheader installed to generate util-linux-ng build system."
+	echo 
+	echo "Download the appropriate package for your distribution,"
+	echo "or see http://www.gnu.org/software/autoheader"
+	DIE=1
+}
+
+if test "$DIE" -eq 1; then
+	exit 1
+fi
+
+test -f mount/mount.c || {
+	echo "You must run this script in the top-level util-linux-ng directory"
+	exit 1
+}
+
+#ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
+#test ${ltver##2.} == "$ltver" && {
+#	echo "You must have libtool version >= 2.x.x, but you have $ltver."
+#	exit 1
+#}
+
+echo
+echo "Generate build-system by:"
+echo "   autopoint:  $(autopoint --version | head -1)"
+echo "   aclocal:    $(aclocal --version | head -1)"
+echo "   autoconf:   $(autoconf --version | head -1)"
+echo "   autoheader: $(autoheader --version | head -1)"
+echo "   automake:   $(automake --version | head -1)"
+#echo "   libtoolize: $(libtoolize --version | head -1)"
+
+set -e
+autopoint --force $AP_OPTS
+#libtoolize --force --copy $LT_OPTS
+aclocal -I m4 $AL_OPTS
+autoconf $AC_OPTS
+autoheader $AH_OPTS
+
+automake --add-missing $AM_OPTS
+
+cd $THEDIR
+
+echo
+echo "Now type '$srcdir/configure' and 'make' to compile."
+echo
+
+
diff --git a/util-linux-ng-2.17.2/config.h.in b/util-linux-ng-2.17.2/config.h.in
new file mode 100644
index 0000000..ec22b39
--- /dev/null
+++ b/util-linux-ng-2.17.2/config.h.in
@@ -0,0 +1,515 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
+/* Define to 1 if you have the <blkid/blkid.h> header file. */
+#undef HAVE_BLKID_BLKID_H
+
+/* Define to 1 if you have the <blkid.h> header file. */
+#undef HAVE_BLKID_H
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+#undef HAVE_DCGETTEXT
+
+/* Define to 1 if you have the declaration of `ADDR_COMPAT_LAYOUT', and to 0
+   if you don't. */
+#undef HAVE_DECL_ADDR_COMPAT_LAYOUT
+
+/* Define to 1 if you have the declaration of `ADDR_LIMIT_32BIT', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_LIMIT_32BIT
+
+/* Define to 1 if you have the declaration of `ADDR_LIMIT_3GB', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_LIMIT_3GB
+
+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
+   you don't. */
+#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+
+/* Define to 1 if you have the declaration of `FDPIC_FUNCPTRS', and to 0 if
+   you don't. */
+#undef HAVE_DECL_FDPIC_FUNCPTRS
+
+/* Define to 1 if you have the declaration of `MMAP_PAGE_ZERO', and to 0 if
+   you don't. */
+#undef HAVE_DECL_MMAP_PAGE_ZERO
+
+/* Define to 1 if you have the declaration of `READ_IMPLIES_EXEC', and to 0 if
+   you don't. */
+#undef HAVE_DECL_READ_IMPLIES_EXEC
+
+/* Define to 1 if you have the declaration of `STICKY_TIMEOUTS', and to 0 if
+   you don't. */
+#undef HAVE_DECL_STICKY_TIMEOUTS
+
+/* Define to 1 if you have the declaration of `WHOLE_SECONDS', and to 0 if you
+   don't. */
+#undef HAVE_DECL_WHOLE_SECONDS
+
+/* Define to 1 if you have the declaration of `_NL_TIME_WEEK_1STDAY', and to 0
+   if you don't. */
+#undef HAVE_DECL__NL_TIME_WEEK_1STDAY
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <err.h> header file. */
+#undef HAVE_ERR_H
+
+/* Define to 1 if you have the `fallocate' function. */
+#undef HAVE_FALLOCATE
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the `fstat64' function. */
+#undef HAVE_FSTAT64
+
+/* Define to 1 if you have the `fstatat' function. */
+#undef HAVE_FSTATAT
+
+/* Define to 1 if you have the `fsync' function. */
+#undef HAVE_FSYNC
+
+/* Define to 1 if you have the `futimens' function. */
+#undef HAVE_FUTIMENS
+
+/* Define to 1 if you have the `getdomainname' function. */
+#undef HAVE_GETDOMAINNAME
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getmntinfo' function. */
+#undef HAVE_GETMNTINFO
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `get_current_dir_name' function. */
+#undef HAVE_GET_CURRENT_DIR_NAME
+
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the `inet_aton' function. */
+#undef HAVE_INET_ATON
+
+/* Define to 1 if you have the `inotify_init' function. */
+#undef HAVE_INOTIFY_INIT
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `jrand48' function. */
+#undef HAVE_JRAND48
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
+
+/* Define to 1 if you have the `lchown' function. */
+#undef HAVE_LCHOWN
+
+/* Define to 1 if you have the `audit' library (-laudit). */
+#undef HAVE_LIBAUDIT
+
+/* Define to 1 if you have the -lblkid. */
+#undef HAVE_LIBBLKID
+
+/* Define to 1 if you have the in-tree libblkid. */
+#undef HAVE_LIBBLKID_INTERNAL
+
+/* Define to 1 if you have the `ncurses' library (-lncurses). */
+#undef HAVE_LIBNCURSES
+
+/* Define to 1 if you have the `ncursesw' library (-lncursesw). */
+#undef HAVE_LIBNCURSESW
+
+/* Define to 1 if you have the `selinux' library (-lselinux). */
+#undef HAVE_LIBSELINUX
+
+/* Define to 1 if you have the `termcap' library (-ltermcap). */
+#undef HAVE_LIBTERMCAP
+
+/* Define to 1 if you have the `util' library (-lutil). */
+#undef HAVE_LIBUTIL
+
+/* Define to 1 if you have the -luuid. */
+#undef HAVE_LIBUUID
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <linux/blkpg.h> header file. */
+#undef HAVE_LINUX_BLKPG_H
+
+/* Define to 1 if you have the <linux/compiler.h> header file. */
+#undef HAVE_LINUX_COMPILER_H
+
+/* Define to 1 if you have the <linux/fd.h> header file. */
+#undef HAVE_LINUX_FD_H
+
+/* Define to 1 if you have the <linux/major.h> header file. */
+#undef HAVE_LINUX_MAJOR_H
+
+/* Define to 1 if you have the <linux/raw.h> header file. */
+#undef HAVE_LINUX_RAW_H
+
+/* Define to 1 if you have the <linux/tiocl.h> header file. */
+#undef HAVE_LINUX_TIOCL_H
+
+/* Define to 1 if you have the <linux/version.h> header file. */
+#undef HAVE_LINUX_VERSION_H
+
+/* Define to 1 if you have the `llseek' function. */
+#undef HAVE_LLSEEK
+
+/* Define to 1 if have llseek prototype */
+#undef HAVE_LLSEEK_PROTOTYPE
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the `lseek64' function. */
+#undef HAVE_LSEEK64
+
+/* Define to 1 if have lseek64 prototype */
+#undef HAVE_LSEEK64_PROTOTYPE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the <ncurses.h> header file. */
+#undef HAVE_NCURSES_H
+
+/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
+#undef HAVE_NCURSES_NCURSES_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <net/if_dl.h> header file. */
+#undef HAVE_NET_IF_DL_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the `openat' function. */
+#undef HAVE_OPENAT
+
+/* Define to 1 if you have the `personality' function. */
+#undef HAVE_PERSONALITY
+
+/* Define to 1 if you have the `posix_fadvise' function. */
+#undef HAVE_POSIX_FADVISE
+
+/* Define to 1 if you have the `prctl' function. */
+#undef HAVE_PRCTL
+
+/* Define to 1 if you have the <pty.h> header file. */
+#undef HAVE_PTY_H
+
+/* Define to 1 if you have the <rpcsvc/nfs_prot.h> header file. */
+#undef HAVE_RPCSVC_NFS_PROT_H
+
+/* Define to 1 if you have the `rpmatch' function. */
+#undef HAVE_RPMATCH
+
+/* Define if struct sockaddr contains sa_len */
+#undef HAVE_SA_LEN
+
+/* Define to 1 if you have the `security_get_initial_context' function. */
+#undef HAVE_SECURITY_GET_INITIAL_CONTEXT
+
+/* Define to 1 if you have the <security/pam_misc.h> header file. */
+#undef HAVE_SECURITY_PAM_MISC_H
+
+/* Define to 1 if you have the `setresgid' function. */
+#undef HAVE_SETRESGID
+
+/* Define to 1 if you have the `setresuid' function. */
+#undef HAVE_SETRESUID
+
+/* Define to 1 if you have the <slang/slcurses.h> header file. */
+#undef HAVE_SLANG_SLCURSES_H
+
+/* Define to 1 if you have the <slcurses.h> header file. */
+#undef HAVE_SLCURSES_H
+
+/* Define to 1 if you have the `srandom' function. */
+#undef HAVE_SRANDOM
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
+/* Define to 1 if `c_line' is member of `struct termios'. */
+#undef HAVE_STRUCT_TERMIOS_C_LINE
+
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define to 1 if you have the <sys/disklabel.h> header file. */
+#undef HAVE_SYS_DISKLABEL_H
+
+/* Define to 1 if you have the <sys/disk.h> header file. */
+#undef HAVE_SYS_DISK_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/io.h> header file. */
+#undef HAVE_SYS_IO_H
+
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+#undef HAVE_SYS_MKDEV_H
+
+/* Define to 1 if you have the <sys/prctl.h> header file. */
+#undef HAVE_SYS_PRCTL_H
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#undef HAVE_SYS_QUEUE_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/swap.h> header file. */
+#undef HAVE_SYS_SWAP_H
+
+/* Define to 1 if you have the <sys/syscall.h> header file. */
+#undef HAVE_SYS_SYSCALL_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
+/* Define to 1 if the target supports thread-local storage. */
+#undef HAVE_TLS
+
+/* Does struct tm have a field tm_gmtoff? */
+#undef HAVE_TM_GMTOFF
+
+/* Define to 1 if the system has the type `union semun'. */
+#undef HAVE_UNION_SEMUN
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unlinkat' function. */
+#undef HAVE_UNLINKAT
+
+/* Define to 1 if you have the `unshare' function. */
+#undef HAVE_UNSHARE
+
+/* Define to 1 if you have the `updwtmp' function. */
+#undef HAVE_UPDWTMP
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define to 1 if you want to use uuid daemon. */
+#undef HAVE_UUIDD
+
+/* Define to 1 if you have the <uuid.h> header file. */
+#undef HAVE_UUID_H
+
+/* Define to 1 if you have the <uuid/uuid.h> header file. */
+#undef HAVE_UUID_UUID_H
+
+/* Do we have wide character support? */
+#undef HAVE_WIDECHAR
+
+/* Do we have __progname? */
+#undef HAVE___PROGNAME
+
+/* Define to 1 if you have the `__secure_getenv' function. */
+#undef HAVE___SECURE_GETENV
+
+/* libblkid date string */
+#undef LIBBLKID_DATE
+
+/* libblkid version string */
+#undef LIBBLKID_VERSION
+
+/* Should login chown /dev/vcsN? */
+#undef LOGIN_CHOWN_VCS
+
+/* Should login stat() the mailbox? */
+#undef LOGIN_STAT_MAIL
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Do we need -lcrypt? */
+#undef NEED_LIBCRYPT
+
+/* Should chsh allow only shells in /etc/shells? */
+#undef ONLY_LISTED_SHELLS
+
+/* 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
+
+/* Should pg ring the bell on invalid keys? */
+#undef PG_BELL
+
+/* Should chfn and chsh require the user to enter the password? */
+#undef REQUIRE_PASSWORD
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Is swapon() declared with two parameters? */
+#undef SWAPON_HAS_TWO_ARGS
+
+/* Fallback syscall number for fallocate */
+#undef SYS_fallocate
+
+/* Fallback syscall number for ioprio_get */
+#undef SYS_ioprio_get
+
+/* Fallback syscall number for ioprio_set */
+#undef SYS_ioprio_set
+
+/* Fallback syscall number for pivot_root */
+#undef SYS_pivot_root
+
+/* Fallback syscall number for sched_getaffinity */
+#undef SYS_sched_getaffinity
+
+/* Fallback syscall number for unshare */
+#undef SYS_unshare
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Should wall and write be installed setgid tty? */
+#undef USE_TTY_GROUP
+
+/* Version number of package */
+#undef VERSION
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+   code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
diff --git a/util-linux-ng-2.17.2/config/config.guess b/util-linux-ng-2.17.2/config/config.guess
new file mode 100755
index 0000000..dc84c68
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/config.guess
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# This file 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 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 Per Bothner.  Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep -q __ELF__
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[456])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=${UNAME_MACHINE}el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=${UNAME_MACHINE}
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes@openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf@swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+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`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/util-linux-ng-2.17.2/config/config.rpath b/util-linux-ng-2.17.2/config/config.rpath
new file mode 100755
index 0000000..4db13e5
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/config.rpath
@@ -0,0 +1,548 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+#   Copyright 1996-2003 Free Software Foundation, Inc.
+#   Taken from GNU libtool, 2001
+#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
+#
+# The first argument passed to this file is the canonical host specification,
+#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+#   than 256 bytes, otherwise the compiler driver will dump core. The only
+#   known workaround is to choose shorter directory names for the build
+#   directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+  wl='-Wl,'
+else
+  case "$host_os" in
+    aix*)
+      wl='-Wl,'
+      ;;
+    mingw* | pw32* | os2*)
+      ;;
+    hpux9* | hpux10* | hpux11*)
+      wl='-Wl,'
+      ;;
+    irix5* | irix6* | nonstopux*)
+      wl='-Wl,'
+      ;;
+    newsos6)
+      ;;
+    linux*)
+      case $CC in
+        icc|ecc)
+          wl='-Wl,'
+          ;;
+        ccc)
+          wl='-Wl,'
+          ;;
+      esac
+      ;;
+    osf3* | osf4* | osf5*)
+      wl='-Wl,'
+      ;;
+    sco3.2v5*)
+      ;;
+    solaris*)
+      wl='-Wl,'
+      ;;
+    sunos4*)
+      wl='-Qoption ld '
+      ;;
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      wl='-Wl,'
+      ;;
+    sysv4*MP*)
+      ;;
+    uts4*)
+      ;;
+  esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  case "$host_os" in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
+      ;;
+    amigaos*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can use
+      # them.
+      ld_shlibs=no
+      ;;
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    cygwin* | mingw* | pw32*)
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    netbsd*)
+      ;;
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+        ld_shlibs=no
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    sunos4*)
+      hardcode_direct=yes
+      ;;
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+  esac
+  if test "$ld_shlibs" = yes; then
+    # Unlike libtool, we use -rpath here, not --rpath, since the documented
+    # option of GNU ld is called -rpath, not --rpath.
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+  fi
+else
+  case "$host_os" in
+    aix3*)
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes; then
+        # Neither direct hardcoding nor static linking is supported with a
+        # broken collect2.
+        hardcode_direct=unsupported
+      fi
+      ;;
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+        # On IA64, the linker does run time linking by default, so we don't
+        # have to do anything special.
+        aix_use_runtimelinking=no
+      else
+        aix_use_runtimelinking=no
+        # Test if we are trying to use run time linking or normal
+        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+        # need to do runtime linking.
+        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+          for ld_flag in $LDFLAGS; do
+            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+              aix_use_runtimelinking=yes
+              break
+            fi
+          done
+        esac
+      fi
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      if test "$GCC" = yes; then
+        case $host_os in aix4.[012]|aix4.[012].*)
+          collect2name=`${CC} -print-prog-name=collect2`
+          if test -f "$collect2name" && \
+            strings "$collect2name" | grep resolve_lib_name >/dev/null
+          then
+            # We have reworked collect2
+            hardcode_direct=yes
+          else
+            # We have old collect2
+            hardcode_direct=unsupported
+            hardcode_minus_L=yes
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_libdir_separator=
+          fi
+        esac
+      fi
+      # Begin _LT_AC_SYS_LIBPATH_AIX.
+      echo 'int main () { return 0; }' > conftest.c
+      ${CC} ${LDFLAGS} conftest.c -o conftest
+      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      if test -z "$aix_libpath"; then
+        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      fi
+      if test -z "$aix_libpath"; then
+        aix_libpath="/usr/lib:/lib"
+      fi
+      rm -f conftest.c conftest
+      # End _LT_AC_SYS_LIBPATH_AIX.
+      if test "$aix_use_runtimelinking" = yes; then
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+      else
+        if test "$host_cpu" = ia64; then
+          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+        else
+          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        fi
+      fi
+      ;;
+    amigaos*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+    bsdi4*)
+      ;;
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      libext=lib
+      ;;
+    darwin* | rhapsody*)
+      if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+        hardcode_direct=no
+      fi
+      ;;
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+    freebsd2.2*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    freebsd2*)
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    freebsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    hpux9*)
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      ;;
+    hpux10* | hpux11*)
+      if test "$with_gnu_ld" = no; then
+        case "$host_cpu" in
+          hppa*64*)
+            hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+            hardcode_libdir_separator=:
+            hardcode_direct=no
+            ;;
+          ia64*)
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_direct=no
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+          *)
+            hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+            hardcode_libdir_separator=:
+            hardcode_direct=yes
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+        esac
+      fi
+      ;;
+    irix5* | irix6* | nonstopux*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    netbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    newsos6)
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    openbsd*)
+      hardcode_direct=yes
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      else
+        case "$host_os" in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+        esac
+      fi
+      ;;
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      ;;
+    osf3*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    osf4* | osf5*)
+      if test "$GCC" = yes; then
+        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+        # Both cc and cxx compiler support -rpath directly
+        hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+    sco3.2v5*)
+      ;;
+    solaris*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+    sunos4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    sysv4)
+      case $host_vendor in
+        sni)
+          hardcode_direct=yes # is this really true???
+          ;;
+        siemens)
+          hardcode_direct=no
+          ;;
+        motorola)
+          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+          ;;
+      esac
+      ;;
+    sysv4.3*)
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+        ld_shlibs=yes
+      fi
+      ;;
+    sysv4.2uw2*)
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      ;;
+    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      ;;
+    sysv5*)
+      hardcode_libdir_flag_spec=
+      ;;
+    uts4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    *)
+      ld_shlibs=no
+      ;;
+  esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+libname_spec='lib$name'
+case "$host_os" in
+  aix3*)
+    ;;
+  aix4* | aix5*)
+    ;;
+  amigaos*)
+    ;;
+  beos*)
+    ;;
+  bsdi4*)
+    ;;
+  cygwin* | mingw* | pw32*)
+    shrext=.dll
+    ;;
+  darwin* | rhapsody*)
+    shrext=.dylib
+    ;;
+  dgux*)
+    ;;
+  freebsd1*)
+    ;;
+  freebsd*)
+    ;;
+  gnu*)
+    ;;
+  hpux9* | hpux10* | hpux11*)
+    case "$host_cpu" in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    ;;
+  irix5* | irix6* | nonstopux*)
+    case "$host_os" in
+      irix5* | nonstopux*)
+        libsuff= shlibsuff=
+        ;;
+      *)
+        case $LD in
+          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+          *) libsuff= shlibsuff= ;;
+        esac
+        ;;
+    esac
+    ;;
+  linux*oldld* | linux*aout* | linux*coff*)
+    ;;
+  linux*)
+    ;;
+  netbsd*)
+    ;;
+  newsos6)
+    ;;
+  nto-qnx)
+    ;;
+  openbsd*)
+    ;;
+  os2*)
+    libname_spec='$name'
+    shrext=.dll
+    ;;
+  osf3* | osf4* | osf5*)
+    ;;
+  sco3.2v5*)
+    ;;
+  solaris*)
+    ;;
+  sunos4*)
+    ;;
+  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    ;;
+  sysv4*MP*)
+    ;;
+  uts4*)
+    ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/util-linux-ng-2.17.2/config/config.sub b/util-linux-ng-2.17.2/config/config.sub
new file mode 100755
index 0000000..2a55a50
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/config.sub
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file 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 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.
+
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray | -microblaze)
+		os=
+		basic_machine=$1
+		;;
+        -bluegene*)
+	        os=-cnk
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+	| tron-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+        cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+        microblaze)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+	tile*)
+		basic_machine=tile-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+        -auroraux)
+	        os=-auroraux
+		;;
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+        mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-cnk*|-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/util-linux-ng-2.17.2/config/depcomp b/util-linux-ng-2.17.2/config/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/depcomp
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# 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@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@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
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  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.
+  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
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  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
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+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 mechanism 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 $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/util-linux-ng-2.17.2/config/gtk-doc.make b/util-linux-ng-2.17.2/config/gtk-doc.make
new file mode 100644
index 0000000..19cd0e6
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/gtk-doc.make
@@ -0,0 +1,225 @@
+#
+# WARNING: this is not gtk-doc.make file from gtk-doc project. This
+#          file has been modified to match with util-linux-ng requirements:
+#
+#          * install files to $datadir
+#          * don't maintain generated files in git repository
+#          * don't distribute the final html files
+#          * don't require --enable-gtk-doc for "make dist"
+#          * support out-of-tree build ($srcdir != $builddir)
+#
+# -- kzak, Nov 2009
+#
+
+####################################
+# Everything below here is generic #
+####################################
+
+if GTK_DOC_USE_LIBTOOL
+GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_RUN = $(LIBTOOL) --mode=execute
+else
+GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_RUN = sh -c
+endif
+
+# We set GPATH here; this gives us semantics for GNU make
+# which are more like other make's VPATH, when it comes to
+# whether a source that is a target of one rule is then
+# searched for in VPATH/GPATH.
+#
+GPATH = $(srcdir)
+
+TARGET_DIR=$(docdir)/$(DOC_MODULE)
+
+EXTRA_DIST = 				\
+	$(content_files)		\
+	$(HTML_IMAGES)			\
+	$(DOC_MAIN_SGML_FILE)		\
+	$(DOC_MODULE)-sections.txt
+#	$(DOC_MODULE)-overrides.txt
+
+DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
+	   $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
+
+SCANOBJ_FILES = 		 \
+	$(DOC_MODULE).args 	 \
+	$(DOC_MODULE).hierarchy  \
+	$(DOC_MODULE).interfaces \
+	$(DOC_MODULE).prerequisites \
+	$(DOC_MODULE).signals
+
+REPORT_FILES = \
+	$(DOC_MODULE)-undocumented.txt \
+	$(DOC_MODULE)-undeclared.txt \
+	$(DOC_MODULE)-unused.txt
+
+CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
+
+if ENABLE_GTK_DOC
+all-local: html-build.stamp
+else
+all-local:
+endif
+
+docs: html-build.stamp
+
+$(REPORT_FILES): sgml-build.stamp
+
+#### scan ####
+
+scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(srcdir)/$(DOC_MODULE)-*.txt $(content_files)
+
+	test -f $(DOC_MODULE)-sections.txt || \
+		cp $(srcdir)/$(DOC_MODULE)-sections.txt $(builddir)
+
+	@echo 'gtk-doc: Scanning header files'
+	gtkdoc-scan --module=$(DOC_MODULE) \
+	            --source-dir=$(srcdir)/$(DOC_SOURCE_DIR) \
+	            --source-dir=$(builddir)/$(DOC_SOURCE_DIR) \
+	            --ignore-headers="$(IGNORE_HFILES)" \
+	            --output-dir=$(builddir) \
+	            $(SCAN_OPTIONS) $(EXTRA_HFILES)
+
+	if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
+	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \
+	    CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) \
+            $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) \
+			--module=$(DOC_MODULE) --output-dir=$(builddir) ; \
+	else \
+	    for i in $(SCANOBJ_FILES) ; do \
+               test -f $$i || touch $$i ; \
+	    done \
+	fi
+	touch scan-build.stamp
+
+$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(srcdir)/$(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
+	@true
+
+#### templates ####
+
+tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(srcdir)/$(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+	@echo 'gtk-doc: Rebuilding template files'
+	test -z $(builddir)/tmpl || $(MKDIR_P) $(builddir)/tmpl
+	gtkdoc-mktmpl --module=$(DOC_MODULE) \
+	              $(MKTMPL_OPTIONS)
+	touch tmpl-build.stamp
+
+tmpl.stamp: tmpl-build.stamp
+	@true
+
+tmpl/*.sgml:
+	@true
+
+
+#### xml ####
+
+sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(srcdir)/$(DOC_MODULE)-sections.txt $(builddir)/tmpl/*.sgml $(expand_content_files)
+	@echo 'gtk-doc: Building XML'
+	gtkdoc-mkdb --module=$(DOC_MODULE) \
+	            --source-dir=$(srcdir)/$(DOC_SOURCE_DIR) \
+	            --source-dir=$(builddir)/$(DOC_SOURCE_DIR) \
+	            --output-format=xml \
+	            --ignore-files="$(IGNORE_HFILES)" \
+	            --expand-content-files="$(expand_content_files)" \
+	            --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \
+	            $(MKDB_OPTIONS)
+	touch sgml-build.stamp
+
+sgml.stamp: sgml-build.stamp
+	@true
+
+#### html ####
+
+html-build.stamp: sgml.stamp $(srcdir)/$(DOC_MAIN_SGML_FILE) $(content_files)
+	@echo 'gtk-doc: Building HTML'
+	rm -rf $(builddir)/html
+	$(MKDIR_P) $(builddir)/html
+	cd $(builddir)/html && \
+	  gtkdoc-mkhtml --path="$(abs_builddir):$(abs_builddir)/xml:$(abs_srcdir)" \
+	                $(MKHTML_OPTIONS) \
+	                $(DOC_MODULE) \
+	                $(abs_srcdir)/$(DOC_MAIN_SGML_FILE)
+
+	test "x$(HTML_IMAGES)" = "x" || \
+		( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html )
+
+	@echo 'gtk-doc: Fixing cross-references'
+	gtkdoc-fixxref --module-dir=html \
+	               --html-dir=$(HTML_DIR) \
+	               $(FIXXREF_OPTIONS)
+	touch html-build.stamp
+
+##############
+
+clean-local:
+	rm -f *~ *.bak
+	rm -rf .libs
+
+distclean-local:
+	rm -rf xml html tmpl $(REPORT_FILES) *.stamp \
+	       $(DOC_MODULE)-overrides.txt \
+	       $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	test $(abs_builddir) ==  $(abs_srcdir) || \
+	       rm -f $(DOC_MODULE)-sections.txt
+
+install-data-local:
+	installfiles=`echo $(builddir)/html/*`; \
+	if test "$$installfiles" = '$(builddir)/html/*'; \
+	then echo '-- Nothing to install' ; \
+	else \
+	  if test -n "$(DOC_MODULE_VERSION)"; then \
+	    installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
+	  else \
+	    installdir="$(DESTDIR)$(TARGET_DIR)"; \
+	  fi; \
+	  $(mkinstalldirs) $${installdir} ; \
+	  for i in $$installfiles; do \
+	    echo '-- Installing '$$i ; \
+	    $(INSTALL_DATA) $$i $${installdir}; \
+	  done; \
+	  if test -n "$(DOC_MODULE_VERSION)"; then \
+	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
+	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
+	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
+	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
+	  fi; \
+	  ! which gtkdoc-rebase >/dev/null 2>&1 || \
+	    gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} ; \
+	fi
+
+uninstall-local:
+	if test -n "$(DOC_MODULE_VERSION)"; then \
+	  installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
+	else \
+	  installdir="$(DESTDIR)$(TARGET_DIR)"; \
+	fi; \
+	rm -rf $${installdir}
+
+#
+# Require gtk-doc when making dist
+#
+if ENABLE_GTK_DOC
+dist-check-gtkdoc:
+else
+dist-check-gtkdoc:
+	@echo "*** gtk-doc must be installed and enabled in order to make dist"
+	@false
+endif
+
+#dist-hook: dist-check-gtkdoc dist-hook-local sgml.stamp html-build.stamp
+#	mkdir $(distdir)/tmpl
+#	mkdir $(distdir)/xml
+#	mkdir $(distdir)/html
+#	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
+#	-cp $(srcdir)/xml/*.xml $(distdir)/xml
+#	cp $(srcdir)/html/* $(distdir)/html
+#	-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
+#	-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
+#	cd $(distdir) && rm -f $(DISTCLEANFILES)
+#	! which gtkdoc-rebase >/dev/null 2>&1 || \
+#	  gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
+#
+#.PHONY : dist-hook-local docs
diff --git a/util-linux-ng-2.17.2/config/include-Makefile.am b/util-linux-ng-2.17.2/config/include-Makefile.am
new file mode 100644
index 0000000..e13bb8e
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/include-Makefile.am
@@ -0,0 +1,32 @@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS =
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
diff --git a/util-linux-ng-2.17.2/config/install-sh b/util-linux-ng-2.17.2/config/install-sh
new file mode 100755
index 0000000..6781b98
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -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.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; 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
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  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 "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 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.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/util-linux-ng-2.17.2/config/ltmain.sh b/util-linux-ng-2.17.2/config/ltmain.sh
new file mode 100755
index 0000000..6939dcc
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/ltmain.sh
@@ -0,0 +1,8406 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#     --config             show all configuration variables
+#     --debug              enable verbose shell tracing
+# -n, --dry-run            display commands without modifying any files
+#     --features           display basic configuration information and exit
+#     --mode=MODE          use operation mode MODE
+#     --preserve-dup-deps  don't remove duplicate dependency libraries
+#     --quiet, --silent    don't print informational messages
+#     --tag=TAG            use configuration variables from tag TAG
+# -v, --verbose            print informational messages (default)
+#     --version            print version information
+# -h, --help               print short or long help message
+#
+# MODE must be one of the following:
+#
+#       clean              remove files from the build directory
+#       compile            compile a source file into a libtool object
+#       execute            automatically set library path, then run a program
+#       finish             complete the installation of libtool libraries
+#       install            install libraries or executables
+#       link               create a library or an executable
+#       uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#       host-triplet:	$host
+#       shell:		$SHELL
+#       compiler:		$LTCC
+#       compiler flags:		$LTCFLAGS
+#       linker:		$LD (gnu? $with_gnu_ld)
+#       $progname:		(GNU libtool) 2.2.6
+#       automake:		$automake_version
+#       autoconf:		$autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
+
+# 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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# NLS nuisances: We save the old values to restore during execute mode.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+	fi"
+done
+
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/bin/sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+  -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=:
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "X$my_tmpdir" | $Xsed
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "X$1" | $Xsed \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED -n '/^# Usage:/,/# -h/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    $ECHO
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	p
+     }' < "$progpath"
+    exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    func_error "missing argument for $1"
+    exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell, and then maybe $ECHO will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    $ECHO "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $ECHO "enable shared libraries"
+    else
+      $ECHO "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $ECHO "enable static libraries"
+    else
+      $ECHO "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+  # Shorthand for --mode=foo, only valid as the first argument
+  case $1 in
+  clean|clea|cle|cl)
+    shift; set dummy --mode clean ${1+"$@"}; shift
+    ;;
+  compile|compil|compi|comp|com|co|c)
+    shift; set dummy --mode compile ${1+"$@"}; shift
+    ;;
+  execute|execut|execu|exec|exe|ex|e)
+    shift; set dummy --mode execute ${1+"$@"}; shift
+    ;;
+  finish|finis|fini|fin|fi|f)
+    shift; set dummy --mode finish ${1+"$@"}; shift
+    ;;
+  install|instal|insta|inst|ins|in|i)
+    shift; set dummy --mode install ${1+"$@"}; shift
+    ;;
+  link|lin|li|l)
+    shift; set dummy --mode link ${1+"$@"}; shift
+    ;;
+  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+    shift; set dummy --mode uninstall ${1+"$@"}; shift
+    ;;
+  esac
+
+  # Parse non-mode specific arguments:
+  while test "$#" -gt 0; do
+    opt="$1"
+    shift
+
+    case $opt in
+      --config)		func_config					;;
+
+      --debug)		preserve_args="$preserve_args $opt"
+			func_echo "enabling shell trace mode"
+			opt_debug='set -x'
+			$opt_debug
+			;;
+
+      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			execute_dlfiles="$execute_dlfiles $1"
+			shift
+			;;
+
+      --dry-run | -n)	opt_dry_run=:					;;
+      --features)       func_features					;;
+      --finish)		mode="finish"					;;
+
+      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			case $1 in
+			  # Valid mode arguments:
+			  clean)	;;
+			  compile)	;;
+			  execute)	;;
+			  finish)	;;
+			  install)	;;
+			  link)		;;
+			  relink)	;;
+			  uninstall)	;;
+
+			  # Catch anything else as an error
+			  *) func_error "invalid argument for $opt"
+			     exit_cmd=exit
+			     break
+			     ;;
+		        esac
+
+			mode="$1"
+			shift
+			;;
+
+      --preserve-dup-deps)
+			opt_duplicate_deps=:				;;
+
+      --quiet|--silent)	preserve_args="$preserve_args $opt"
+			opt_silent=:
+			;;
+
+      --verbose| -v)	preserve_args="$preserve_args $opt"
+			opt_silent=false
+			;;
+
+      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			preserve_args="$preserve_args $opt $1"
+			func_enable_tag "$1"	# tagname is set here
+			shift
+			;;
+
+      # Separate optargs to long options:
+      -dlopen=*|--mode=*|--tag=*)
+			func_opt_split "$opt"
+			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+			shift
+			;;
+
+      -\?|-h)		func_usage					;;
+      --help)		opt_help=:					;;
+      --version)	func_version					;;
+
+      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+
+      *)		nonopt="$opt"
+			break
+			;;
+    esac
+  done
+
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      ;;
+  esac
+
+  # Having warned about all mis-specified options, bail out if
+  # anything was wrong.
+  $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+$opt_help || {
+  # Sanity checks first:
+  func_check_version_match
+
+  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+    func_fatal_configuration "not configured to build any kind of library"
+  fi
+
+  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+  # Darwin sucks
+  eval std_shrext=\"$shrext_cmds\"
+
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    func_error "unrecognized option \`-dlopen'"
+    $ECHO "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_ltwrapper_scriptname_result=""
+    if func_ltwrapper_executable_p "$1"; then
+	func_dirname_and_basename "$1" "" "."
+	func_stripname '' '.exe' "$func_basename_result"
+	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+        func_quote_for_eval "$arg"
+	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_quote_for_eval "$arg"
+	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	    done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-pie | -fpie | -fPIE)
+          pie_flag="$pie_flag $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+	    func_quote_for_eval "$arg"
+	    lastarg="$lastarg $func_quote_for_eval_result"
+	  done
+	  IFS="$save_ifs"
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_quote_for_eval "$lastarg"
+      base_compile="$base_compile $func_quote_for_eval_result"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+      removelist="$removelist $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    removelist="$removelist $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+	suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$mode'"
+        ;;
+    esac
+
+    $ECHO
+    $ECHO "Try \`$progname --help' for more information about other modes."
+
+    exit $?
+}
+
+  # Now that we've collected a possible --mode arg, show help if necessary
+  $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_quote_for_eval "$file"
+      args="$args $func_quote_for_eval_result"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	$ECHO "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
+    $ECHO "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $ECHO "   $libdir"
+    done
+    $ECHO
+    $ECHO "If you ever happen to want to link against installed libraries"
+    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $ECHO "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $ECHO "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $ECHO "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $ECHO "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $ECHO "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $ECHO
+
+    $ECHO "See any operating system documentation about shared libraries for"
+    case $host in
+      solaris2.[6789]|solaris2.1[0-9])
+        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	$ECHO "pages."
+	;;
+      *)
+        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+        ;;
+    esac
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
+    exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    install_prog="$install_prog$func_quote_for_eval_result"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      install_prog="$install_prog $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_verbose "extracting global C symbols from \`$progfile'"
+	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+	  $opt_dry_run || {
+	    eval '$ECHO ": $name " >> "$nlist"'
+	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	  }
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+"
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* )
+	    $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs.  */"
+	    lt_dlsym_const= ;;
+	  *osf5*)
+	    echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+	    lt_dlsym_const= ;;
+	  *)
+	    lt_dlsym_const=const ;;
+	  esac
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+	func_emit_wrapper_part1_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part1_arg1=$1
+	fi
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# 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+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    ECHO=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$ECHO works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$ECHO will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$ECHO "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+	func_emit_wrapper_part2_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part2_arg1=$1
+	fi
+
+	$ECHO "\
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2* | *-cegcc*)
+	  $ECHO "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $ECHO "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_arg1=$1
+	fi
+
+	# split this up so that func_emit_cwrapperexe_src
+	# can call each part independently.
+	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin.  Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+  func_to_host_path_result="$1"
+  if test -n "$1" ; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        case $build in
+          *mingw* ) # actually, msys
+            # awkward: cmd appends spaces to result
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_path_tmp1=`cygpath -w "$1"`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+                $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=""
+            fi
+            ;;
+        esac
+        if test -z "$func_to_host_path_result" ; then
+          func_error "Could not determine host path corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
+        fi
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+  func_to_host_pathlist_result="$1"
+  if test -n "$1" ; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        # Remove leading and trailing path separator characters from
+        # ARG. msys behavior is inconsistent here, cygpath turns them
+        # into '.;' and ';.', and winepath ignores them completely.
+        func_to_host_pathlist_tmp2="$1"
+        # Once set for this call, this variable should not be
+        # reassigned. It is used in tha fallback case.
+        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+          $SED -e 's|^:*||' -e 's|:*$||'`
+        case $build in
+          *mingw* ) # Actually, msys.
+            # Awkward: cmd appends spaces to result.
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # unfortunately, winepath doesn't convert pathlists
+            func_to_host_pathlist_result=""
+            func_to_host_pathlist_oldIFS=$IFS
+            IFS=:
+            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+              IFS=$func_to_host_pathlist_oldIFS
+              if test -n "$func_to_host_pathlist_f" ; then
+                func_to_host_path "$func_to_host_pathlist_f"
+                if test -n "$func_to_host_path_result" ; then
+                  if test -z "$func_to_host_pathlist_result" ; then
+                    func_to_host_pathlist_result="$func_to_host_path_result"
+                  else
+                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+                  fi
+                fi
+              fi
+              IFS=:
+            done
+            IFS=$func_to_host_pathlist_oldIFS
+            ;;
+        esac
+        if test -z "$func_to_host_pathlist_result" ; then
+          func_error "Could not determine the host path(s) corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+        fi
+        # Now, add the leading and trailing path separators back
+        case "$1" in
+          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+            ;;
+        esac
+        case "$1" in
+          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+            ;;
+        esac
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "$SHELL $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+#  define HAVE_SETENV
+#  ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+#  endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+    va_list args;
+    va_start (args, fmt);
+    (void) vfprintf (stderr, fmt, args);
+    va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+	    func_emit_wrapper_part1 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+	    cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+	    func_emit_wrapper_part2 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+
+	    cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_pathlist "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_pathlist "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+
+static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
+  /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
+  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
+  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+  /* very simple arg parsing; don't want to rely on getopt */
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  printf ("%s", script_text_part1);
+	  printf ("%s", script_text_part2);
+	  return 0;
+	}
+    }
+
+  newargz = XMALLOC (char *, argc + 1);
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal ("Couldn't find %s", argv[0]);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+			  tmp_pathspec));
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+			  actual_cwrapper_path));
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+			  target_name));
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+        {
+          if (argv[i][env_set_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_set_opt_len + 1;
+              lt_opt_process_env_set (p);
+            }
+          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_set (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_set_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+        {
+          if (argv[i][env_prepend_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_prepend_opt_len + 1;
+              lt_opt_process_env_prepend (p);
+            }
+          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_prepend_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+        {
+          if (argv[i][env_append_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_append_opt_len + 1;
+              lt_opt_process_env_append (p);
+            }
+          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_append (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_append_opt);
+          continue;
+        }
+      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  for (i = 0; i < newargc; i++)
+    {
+      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal ("getcwd failed");
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+			      tmp_pathspec));
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  char *errstr = strerror (errno);
+	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal ("Could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+  const char *p;
+  int len;
+  if (!arg || !*arg)
+    return 1;
+
+  p = strchr (arg, (int)'=');
+
+  if (!p)
+    return 1;
+
+  *value = xstrdup (++p);
+
+  len = strlen (arg) - strlen (*value);
+  *name = XMALLOC (char, len);
+  strncpy (*name, arg, len-1);
+  (*name)[len - 1] = '\0';
+
+  return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+    }
+
+  lt_setenv (name, value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 0);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 1);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		func_source "$arg"
+
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none &&
+		   test "$non_pic_object" = none; then
+		  func_fatal_error "cannot find name of object for \`$arg'"
+		fi
+
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file \`$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	shrext)
+	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+	weak)
+	  weak_libs="$weak_libs $arg"
+	  prev=
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework)
+	prev=framework
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	func_stripname '-L' '' "$arg"
+	dir=$func_stripname_result
+	if test -z "$dir"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
+	  else
+	    func_fatal_error "need path for \`-L' option"
+	  fi
+	fi
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot)
+	compiler_flags="$compiler_flags $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	compiler_flags="$compiler_flags $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	esac
+	continue
+	;;
+
+      -multi_module)
+	single_module="${wl}-multi_module"
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  func_fatal_error "only absolute run-paths are allowed"
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+	  linker_flags="$linker_flags $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -F/path gives path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none &&
+	     test "$non_pic_object" = none; then
+	    func_fatal_error "cannot find name of object for \`$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_duplicate_deps ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  case $lib in
+	  *.la)	func_source "$lib" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) deplibs="$deplibs $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    compiler_flags="$compiler_flags $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    func_warning "\`-l' is ignored for archives/objects"
+	    continue
+	  fi
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test "$linkmode" = lib; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+	  fi
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    ;;
+	  *)
+	    func_warning "\`-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    func_stripname '-R' '' "$deplib"
+	    dir=$func_stripname_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=yes
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=yes
+		;;
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		$ECHO
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
+		$ECHO "*** that it is just a static archive that I should not use here."
+	      else
+		$ECHO
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+	fi
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for \`$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    func_fatal_error "\`$lib' is not a convenience library"
+	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for \`$lib'"
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	func_basename "$lib"
+	laname="$func_basename_result"
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    func_warning "library \`$lib' was moved."
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	    # Keep a list of preopened convenience libraries to check
+	    # that they are being used correctly in the link pass.
+	    test -z "$libdir" && \
+		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         newlib_search_path="$newlib_search_path $func_stripname_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { { test "$prefer_static_libs" = no ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) temp_rpath="$temp_rpath$absdir:" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    $ECHO
+	    if test "$linkmode" = prog; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  $ECHO
+			  $ECHO "*** And there doesn't seem to be a static archive available"
+			  $ECHO "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+		add="$inst_prefix_dir$libdir/$linklib"
+	      else
+		add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $ECHO
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** I have the capability to make that library automatically link in when"
+	    $ECHO "*** you link to this library.  But I can only do this if you have a"
+	    $ECHO "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $ECHO "*** But as you try to build a module library, libtool will still create "
+	      $ECHO "*** a static module, that should work as long as the dlopening application"
+	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$ECHO
+		$ECHO "*** However, this would only work if libtool was able to extract symbol"
+		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$ECHO "*** not find such a program.  So, this module is probably useless."
+		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+	        func_dirname "$deplib" "" "."
+		dir="$func_dirname_result"
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of \`$dir'"
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path="-L$absdir/$objdir"
+		  ;;
+		esac
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
+
+		  path="-L$absdir"
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	else
+	  $ECHO
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	shift
+	IFS="$save_ifs"
+
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_minor"
+	    lt_irix_increment=no
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$1"
+	  revision="$2"
+	  age="$3"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	irix | nonstopux)
+	  if test "X$lt_irix_increment" = "Xno"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    func_warning "undefined symbols not allowed in $host shared libraries"
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      libobjs="$libobjs $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+		fi
+		if test -n "$i" ; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $ECHO
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    $ECHO "*** I have the capability to make that library automatically link in when"
+		    $ECHO "*** you link to this library.  But I can only do this if you have a"
+		    $ECHO "*** shared version of the library, which I believe you do not have"
+		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		newdeplibs="$newdeplibs $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $ECHO
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      $ECHO "*** I have the capability to make that library automatically link in when"
+		      $ECHO "*** you link to this library.  But I can only do this if you have a"
+		      $ECHO "*** shared version of the library, which you do not appear to have"
+		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $ECHO
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $ECHO "*** make it link in!  You will probably need to install it or some"
+		  $ECHO "*** library that it depends on before this library will be fully"
+		  $ECHO "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		newdeplibs="$newdeplibs $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+	    done
+	  fi
+	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
+	     $GREP . >/dev/null; then
+	    $ECHO
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $ECHO "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $ECHO
+	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $ECHO "*** a static module, that should work as long as the dlopening"
+	    $ECHO "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $ECHO
+	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
+	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $ECHO "*** not find such a program.  So, this module is probably useless."
+	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
+	    $ECHO "*** automatically added whenever a program is linked with this library"
+	    $ECHO "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $ECHO
+	      $ECHO "*** Since this library must not contain undefined symbols,"
+	      $ECHO "*** because either the platform does not support them or"
+	      $ECHO "*** it was explicitly requested with -no-undefined,"
+	      $ECHO "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname="$1"
+	shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	linknames=
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  delfiles="$delfiles $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
+	    fi
+	  fi
+	  ;;
+	esac
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      func_len " $cmd"
+	      len=$func_len_result
+	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    $ECHO 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    $ECHO ')' >> $output
+	    delfiles="$delfiles $output"
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    delfiles="$delfiles $output"
+	    output=$firstobj\"$file_list_spec$output\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=$obj
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	      fi
+	      delfiles="$delfiles $output"
+
+	    else
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	    fi
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
+	    IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
+	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  libobjs="$libobjs $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
+
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	else
+	  gentop="$output_objdir/${obj}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      compile_command="$compile_command ${wl}-bind_at_load"
+	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *cegcc)
+        # Disable wrappers for cegcc, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+	# Replace the output file specification.
+	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
+
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	fi
+
+	exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $ECHO for shipping.
+      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+	case $progpath in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+	esac
+	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
+
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_wrapper no > $output
+	    chmod +x $output
+	  ;;
+	esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save $symfileobj"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    oldobjs="$oldobjs $symfileobj"
+	  fi
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	generated="$generated $gentop"
+
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	cmds=$old_archive_from_new_cmds
+      else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  oldobjs="$oldobjs $func_extract_archives_result"
+	fi
+
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $ECHO "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+	eval cmds=\"$old_archive_cmds\"
+
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlfiles="$newdlfiles $libdir/$name"
+		;;
+	      *) newdlfiles="$newdlfiles $lib" ;;
+	      esac
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlprefiles="$newdlprefiles $libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) RM="$RM $arg"; rmforce=yes ;;
+      -*) RM="$RM $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if func_lalib_p "$file"; then
+
+	  # Read the .lo file
+	  func_source $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/util-linux-ng-2.17.2/config/missing b/util-linux-ng-2.17.2/config/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/missing
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@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, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# 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'
+  autom4te     touch the output file, or create a stub one
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@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
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f y.tab.h; then
+	echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/util-linux-ng-2.17.2/config/mkinstalldirs b/util-linux-ng-2.17.2/config/mkinstalldirs
new file mode 100755
index 0000000..d2d5f21
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/mkinstalldirs
@@ -0,0 +1,111 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage" 1>&2
+      exit 0
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+case $dirmode in
+  '')
+    if mkdir -p -- . 2>/dev/null; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    fi
+    ;;
+esac
+
+for file
+do
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
+
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+  	errstatus=$lasterr
+      else
+  	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+    	  lasterr=""
+  	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+  	  if test ! -z "$lasterr"; then
+  	    errstatus=$lasterr
+  	  fi
+  	fi
+      fi
+    fi
+
+    pathcomp="$pathcomp/"
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
+# mkinstalldirs ends here
diff --git a/util-linux-ng-2.17.2/config/texinfo.tex b/util-linux-ng-2.17.2/config/texinfo.tex
new file mode 100644
index 0000000..ff2c406
--- /dev/null
+++ b/util-linux-ng-2.17.2/config/texinfo.tex
@@ -0,0 +1,7210 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2005-07-05.19}
+%
+% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+% Foundation, Inc.
+%
+% This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING.  If not, write
+% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+% Boston, MA 02110-1301, USA.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction.  (This has been our intent since Texinfo was invented.)
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+%   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
+%   ftp://tug.org/tex/texinfo.tex
+%     (and all CTAN mirrors, see http://www.ctan.org).
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org.  Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem.  Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution.  For a simple
+% manual foo.texi, however, you can get away with this:
+%   tex foo.texi
+%   texindex foo.??
+%   tex foo.texi
+%   tex foo.texi
+%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent.  You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+  \catcode`+=\active \catcode`\_=\active}
+
+\message{Basics,}
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+  \let\linenumber = \empty % Pre-3.0.
+\else
+  \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
+
+% In some macros, we cannot use the `\? notation---the left quote is
+% in some cases the escape char.
+\chardef\backChar  = `\\
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dotChar   = `\.
+\chardef\exclamChar= `\!
+\chardef\plusChar  = `\+
+\chardef\questChar = `\?
+\chardef\semiChar  = `\;
+\chardef\underChar = `\_
+
+\chardef\spaceChar = `\ %
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode\spaceChar=\spacecat}
+
+{% for help with debugging.
+ % example usage: \expandafter\show\activebackslash
+ \catcode`\! = 0 \catcode`\\ = \active
+ !global!def!activebackslash{\}
+}
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+  Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+  ap-pen-dix bit-map bit-maps
+  data-base data-bases eshell fall-ing half-way long-est man-u-script
+  man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+  par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+  spell-ing spell-ings
+  stand-alone strong-est time-stamp time-stamps which-ever white-space
+  wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @| inserts a changebar to the left of the current line.  It should
+% surround any changed text.  This approach does *not* work if the
+% change spans more than two lines of output.  To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+  % \vadjust can only be used in horizontal mode.
+  \leavevmode
+  %
+  % Append this vertical mode material after the current line in the output.
+  \vadjust{%
+    % We want to insert a rule with the height and depth of the current
+    % leading; that is exactly what \strutbox is supposed to record.
+    \vskip-\baselineskip
+    %
+    % \vadjust-items are inserted at the left edge of the type.  So
+    % the \llap here moves out into the left-hand margin.
+    \llap{%
+      %
+      % For a thicker or thinner bar, change the `1pt'.
+      \vrule height\baselineskip width1pt
+      %
+      % This is the space between the bar and the text.
+      \hskip 12pt
+    }%
+  }%
+}
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal.  We don't just call \tracingall here,
+% since that produces some useless output on the terminal.  We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+  \tracingstats2
+  \tracingpages1
+  \tracinglostchars2  % 2 gives us more in etex
+  \tracingparagraphs1
+  \tracingoutput1
+  \tracingmacros2
+  \tracingrestores1
+  \showboxbreadth\maxdimen \showboxdepth\maxdimen
+  \ifx\eTeXversion\undefined\else % etex gives us more logging
+    \tracingscantokens1
+    \tracingifs1
+    \tracinggroups1
+    \tracingnesting2
+    \tracingassigns1
+  \fi
+  \tracingcommands3  % 3 gives us more in etex
+  \errorcontextlines16
+}%
+
+% add check for \lastpenalty to plain's definitions.  If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+  \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+  \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+  \removelastskip\penalty-200\bigskip\fi\fi}
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong  \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument.  Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+  %
+  \ifodd\pageno  \advance\hoffset by \bindingoffset
+  \else \advance\hoffset by -\bindingoffset\fi
+  %
+  % Do this outside of the \shipout so @code etc. will be expanded in
+  % the headline as they should be, not taken literally (outputting ''code).
+  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+  %
+  {%
+    % Have to do this stuff outside the \shipout because we want it to
+    % take effect in \write's, yet the group defined by the \vbox ends
+    % before the \shipout runs.
+    %
+    \indexdummies         % don't expand commands in the output.
+    \shipout\vbox{%
+      % Do this early so pdf references go to the beginning of the page.
+      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+      %
+      \ifcropmarks \vbox to \outervsize\bgroup
+        \hsize = \outerhsize
+        \vskip-\topandbottommargin
+        \vtop to0pt{%
+          \line{\ewtop\hfil\ewtop}%
+          \nointerlineskip
+          \line{%
+            \vbox{\moveleft\cornerthick\nstop}%
+            \hfill
+            \vbox{\moveright\cornerthick\nstop}%
+          }%
+          \vss}%
+        \vskip\topandbottommargin
+        \line\bgroup
+          \hfil % center the page within the outer (page) hsize.
+          \ifodd\pageno\hskip\bindingoffset\fi
+          \vbox\bgroup
+      \fi
+      %
+      \unvbox\headlinebox
+      \pagebody{#1}%
+      \ifdim\ht\footlinebox > 0pt
+        % Only leave this space if the footline is nonempty.
+        % (We lessened \vsize for it in \oddfootingxxx.)
+        % The \baselineskip=24pt in plain's \makefootline has no effect.
+        \vskip 2\baselineskip
+        \unvbox\footlinebox
+      \fi
+      %
+      \ifcropmarks
+          \egroup % end of \vbox\bgroup
+        \hfil\egroup % end of (centering) \line\bgroup
+        \vskip\topandbottommargin plus1fill minus1fill
+        \boxmaxdepth = \cornerthick
+        \vbox to0pt{\vss
+          \line{%
+            \vbox{\moveleft\cornerthick\nsbot}%
+            \hfill
+            \vbox{\moveright\cornerthick\nsbot}%
+          }%
+          \nointerlineskip
+          \line{\ewbot\hfil\ewbot}%
+        }%
+      \egroup % \vbox from first cropmarks clause
+      \fi
+    }% end of \shipout\vbox
+  }% end of group with \indexdummies
+  \advancepageno
+  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks.  Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1.  The argument is the rest of
+% the input line (except we remove a trailing comment).  #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+  \def\next{#2}%
+  \begingroup
+    \obeylines
+    \spaceisspace
+    #1%
+    \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+  \gdef\parseargline#1^^M{%
+    \endgroup % End of the group started in \parsearg.
+    \argremovecomment #1\comment\ArgTerm%
+  }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+%    @end itemize  @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+  \def\temp{#3}%
+  \ifx\temp\empty
+    % We cannot use \next here, as it holds the macro to run;
+    % thus we reuse \temp.
+    \let\temp\finishparsearg
+  \else
+    \let\temp\argcheckspaces
+  \fi
+  % Put the space token in:
+  \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \next.
+% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}
+
+% \parseargdef\foo{...}
+%	is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick.  --kasal, 16nov03
+
+\def\parseargdef#1{%
+  \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+  \def#2{\parsearg#1}%
+  \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+  \obeyspaces
+  \gdef\obeyedspace{ }
+
+  % Make each space character in the input produce a normal interword
+  % space in the output.  Don't allow a line break at this space, as this
+  % is used only in environments like @example, where each line of input
+  % should produce a line of output anyway.
+  %
+  \gdef\sepspaces{\obeyspaces\let =\tie}
+
+  % If an index command is used in an @example environment, any spaces
+  % therein should become regular spaces in the raw index file, not the
+  % expansion of \tie (\leavevmode \penalty \@M \ ).
+  \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex.  It's used like this:
+%
+%   \envdef\foo{...}
+%   \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo.  \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches.  The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as enviroments; they don't open a group.  (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At runtime, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+  \def\temp{#1}%
+  \ifx\thisenv\temp
+  \else
+    \badenverr
+  \fi
+}
+
+% Evironment mismatch, #1 expected:
+\def\badenverr{%
+  \errhelp = \EMsimple
+  \errmessage{This command can appear only \inenvironment\temp,
+    not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+  \ifx#1\empty
+    out of any environment%
+  \else
+    in environment \expandafter\string#1%
+  \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+  \if 1\csname iscond.#1\endcsname
+  \else
+    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+    \expandafter\checkenv\csname#1\endcsname
+    \csname E#1\endcsname
+    \endgroup
+  \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+  % Definitions to produce \{ and \} commands for indices,
+  % and @{ and @} for the aux/toc files.
+  \catcode`\{ = \other \catcode`\} = \other
+  \catcode`\[ = 1 \catcode`\] = 2
+  \catcode`\! = 0 \catcode`\\ = \other
+  !gdef!lbracecmd[\{]%
+  !gdef!rbracecmd[\}]%
+  !gdef!lbraceatcmd[@{]%
+  !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+  \def\temp{#1}%
+  \ifx\temp\imacro \ptexi
+  \else\ifx\temp\jmacro \j
+  \else \errmessage{@dotless can be used only with i or j}%
+  \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence.  (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo.  Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+  L\kern-.36em
+  {\setbox0=\hbox{T}%
+   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
+  \kern-.15em
+  \TeX
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off  says whether to put extra space after punctuation.
+% 
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+  \def\temp{#1}%
+  \ifx\temp\onword \plainfrenchspacing
+  \else\ifx\temp\offword \plainnonfrenchspacing
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+  \fi\fi
+}
+
+% @w prevents a word break.  Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line.  According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0).  If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large.  This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material.  In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom.  The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+  \ifnum\catcode`\^^M=\active \else
+    \errhelp = \groupinvalidhelp
+    \errmessage{@group invalid in context where filling is enabled}%
+  \fi
+  \startsavinginserts
+  %
+  \setbox\groupbox = \vtop\bgroup
+    % Do @comment since we are called inside an environment such as
+    % @example, where each end-of-line in the input causes an
+    % end-of-line in the output.  We don't want the end-of-line after
+    % the `@group' to put extra space in the output.  Since @group
+    % should appear on a line by itself (according to the Texinfo
+    % manual), we don't worry about eating any user text.
+    \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it.  Thus, space below is not quite equal to space
+% above.  But it's pretty close.
+\def\Egroup{%
+    % To get correct interline space between the last line of the group
+    % and the first line afterwards, we have to propagate \prevdepth.
+    \endgraf % Not \par, as it may have been set to \lisppar.
+    \global\dimen1 = \prevdepth
+  \egroup           % End the \vtop.
+  % \dimen0 is the vertical size of the group's box.
+  \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
+  % \dimen2 is how much space is left on the page (more or less).
+  \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
+  % if the group doesn't fit on the current page, and it's a big big
+  % group, force a page break.
+  \ifdim \dimen0 > \dimen2
+    \ifdim \pagetotal < \vfilllimit\pageheight
+      \page
+    \fi
+  \fi
+  \box\groupbox
+  \prevdepth = \dimen1
+  \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil  \mil=0.001in
+
+% Old definition--didn't work.
+%\parseargdef\need{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\parseargdef\need{%
+  % Ensure vertical mode, so we don't make a big box in the middle of a
+  % paragraph.
+  \par
+  %
+  % If the @need value is less than one line space, it's useless.
+  \dimen0 = #1\mil
+  \dimen2 = \ht\strutbox
+  \advance\dimen2 by \dp\strutbox
+  \ifdim\dimen0 > \dimen2
+    %
+    % Do a \strut just to make the height of this box be normal, so the
+    % normal leading is inserted relative to the preceding line.
+    % And a page break here is fine.
+    \vtop to #1\mil{\strut\vfil}%
+    %
+    % TeX does not even consider page breaks if a penalty added to the
+    % main vertical list is 10000 or more.  But in order to see if the
+    % empty box we just added fits on the page, we must make it consider
+    % page breaks.  On the other hand, we don't want to actually break the
+    % page after the empty box.  So we use a penalty of 9999.
+    %
+    % There is an extremely small chance that TeX will actually break the
+    % page at this \penalty, if there are no other feasible breakpoints in
+    % sight.  (If the user is using lots of big @group commands, which
+    % almost-but-not-quite fill up a page, TeX will have a hard time doing
+    % good page breaking, for example.)  However, I could not construct an
+    % example where a page broke at this \penalty; if it happens in a real
+    % document, then we can reconsider our strategy.
+    \penalty9999
+    %
+    % Back up by the size of the box, whether we did a page break or not.
+    \kern -#1\mil
+    %
+    % Do not allow a page break right after this kern.
+    \nobreak
+  \fi
+}
+
+% @br   forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+  \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph.  For more general purposes, use the \margin insertion
+% class.  WHICH is `l' or `r'.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+  \nobreak
+  \kern-\strutdepth
+  \vtop to \strutdepth{%
+    \baselineskip=\strutdepth
+    \vss
+    % if you have multiple lines of stuff to put here, you'll need to
+    % make the vbox yourself of the appropriate size.
+    \ifx#1l%
+      \llap{\ignorespaces #2\hskip\inmarginspacing}%
+    \else
+      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+    \fi
+    \null
+  }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+  \setbox0 = \hbox{\ignorespaces #2}%
+  \ifdim\wd0 > 0pt
+    \def\lefttext{#1}%  have both texts
+    \def\righttext{#2}%
+  \else
+    \def\lefttext{#1}%  have only one text
+    \def\righttext{#1}%
+  \fi
+  %
+  \ifodd\pageno
+    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+  \else
+    \def\temp{\inleftmargin\lefttext}%
+  \fi
+  \temp
+}
+
+% @include file    insert text of that file as input.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+  \pushthisfilestack
+  \def\thisfile{#1}%
+  {%
+    \makevalueexpandable
+    \def\temp{\input #1 }%
+    \expandafter
+  }\temp
+  \popthisfilestack
+}
+\def\filenamecatcodes{%
+  \catcode`\\=\other
+  \catcode`~=\other
+  \catcode`^=\other
+  \catcode`_=\other
+  \catcode`|=\other
+  \catcode`<=\other
+  \catcode`>=\other
+  \catcode`+=\other
+  \catcode`-=\other
+}
+
+\def\pushthisfilestack{%
+  \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+  \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+  \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+  the stack of filenames is empty.}}
+
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+  \ifhmode
+    \let\next\centerH
+  \else
+    \let\next\centerV
+  \fi
+  \next{\hfil \ignorespaces#1\unskip \hfil}%
+}
+\def\centerH#1{%
+  {%
+    \hfil\break
+    \advance\hsize by -\leftskip
+    \advance\hsize by -\rightskip
+    \line{#1}%
+    \break
+  }%
+}
+\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
+
+% @sp n   outputs n lines of vertical space
+
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore  is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+  \def\temp{#1}%
+  \ifx\temp\asisword
+  \else
+    \ifx\temp\noneword
+      \defaultparindent = 0pt
+    \else
+      \defaultparindent = #1em
+    \fi
+  \fi
+  \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+  \def\temp{#1}%
+  \ifx\temp\asisword
+  \else
+    \ifx\temp\noneword
+      \lispnarrowing = 0pt
+    \else
+      \lispnarrowing = #1em
+    \fi
+  \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading.  If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+  \def\temp{#1}%
+  \ifx\temp\noneword
+    \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+  \else\ifx\temp\insertword
+    \let\suppressfirstparagraphindent = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @firstparagraphindent option `\temp'}%
+  \fi\fi
+}
+
+% Here is how we actually suppress indentation.  Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+  \gdef\indent{%
+    \restorefirstparagraphindent
+    \indent
+  }%
+  \gdef\noindent{%
+    \restorefirstparagraphindent
+    \noindent
+  }%
+  \global\everypar = {%
+    \kern -\parindent
+    \restorefirstparagraphindent
+  }%
+}
+
+\gdef\restorefirstparagraphindent{%
+  \global \let \indent = \ptexindent
+  \global \let \noindent = \ptexnoindent
+  \global \everypar = {}%
+}
+
+
+% @asis just yields its argument.  Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+  \catcode\underChar = \active
+  \gdef\mathunderscore{%
+    \catcode\underChar=\active
+    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+  }
+}
+% Another complication: we want \\ (and @\) to output a \ character.
+% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
+% this is not advertised and we don't care.  Texinfo does not
+% otherwise define @\.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+  \tex
+  \mathunderscore
+  \let\\ = \mathbackslash
+  \mathactive
+  $\finishmath
+}
+\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+  \catcode`^ = \active
+  \catcode`< = \active
+  \catcode`> = \active
+  \catcode`+ = \active
+  \gdef\mathactive{%
+    \let^ = \ptexhat
+    \let< = \ptexless
+    \let> = \ptexgtr
+    \let+ = \ptexplus
+  }
+}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{$\ptexbullet$}
+\def\minus{$-$}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+  \leavevmode
+  \hbox to 1.5em{%
+    \hskip 0pt plus 0.25fil
+    .\hfil.\hfil.%
+    \hskip 0pt plus 0.5fil
+  }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+  \dots
+  \spacefactor=\endofsentencespacefactor
+}
+
+% @comma{} is so commas can be inserted into text without messing up
+% Texinfo's parsing.
+%
+\let\comma = ,
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
+   \iflinks
+     \tryauxfile
+     % Open the new aux file.  TeX will close it automatically at exit.
+     \immediate\openout\auxfile=\jobname.aux
+   \fi % \openindices needs to do some work in any case.
+   \openindices
+   \let\setfilename=\comment % Ignore extra @setfilename cmds.
+   %
+   % If texinfo.cnf is present on the system, read it.
+   % Useful for site-wide @afourpaper, etc.
+   \openin 1 texinfo.cnf
+   \ifeof 1 \else \input texinfo.cnf \fi
+   \closein 1
+   %
+   \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+  \newindex{cp}%
+  \newcodeindex{fn}%
+  \newcodeindex{vr}%
+  \newcodeindex{tp}%
+  \newcodeindex{ky}%
+  \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set).  So we test for \relax and 0 as well as \undefined,
+% borrowed from ifpdf.sty.
+\ifx\pdfoutput\undefined
+\else
+  \ifx\pdfoutput\relax
+  \else
+    \ifcase\pdfoutput
+    \else
+      \pdftrue
+    \fi
+  \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets, to
+% for display in the outlines, and in other places.  Thus, we have to
+% double any backslashes.  Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e.  Not good.
+% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
+% (and related messages, the final outcome is that it is up to the TeX
+% user to double the backslashes and otherwise make the string valid, so
+% that's we do).
+
+% double active backslashes.
+% 
+{\catcode`\@=0 \catcode`\\=\active
+ @gdef@activebackslash{@catcode`@\=@active @otherbackslash}
+ @gdef@activebackslashdouble{%
+   @catcode@backChar=@active
+   @let\=@doublebackslash}
+}
+
+% To handle parens, we must adopt a different approach, since parens are
+% not active characters.  hyperref.dtx (which has the same problem as
+% us) handles it with this amazing macro to replace tokens.  I've
+% tinkered with it a little for texinfo, but it's definitely from there.
+% 
+% #1 is the tokens to replace.
+% #2 is the replacement.
+% #3 is the control sequence with the string.
+% 
+\def\HyPsdSubst#1#2#3{%
+  \def\HyPsdReplace##1#1##2\END{%
+    ##1%
+    \ifx\\##2\\%
+    \else
+      #2%
+      \HyReturnAfterFi{%
+        \HyPsdReplace##2\END
+      }%
+    \fi
+  }%
+  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
+}
+\long\def\HyReturnAfterFi#1\fi{\fi#1}
+
+% #1 is a control sequence in which to do the replacements.
+\def\backslashparens#1{%
+  \xdef#1{#1}% redefine it as its expansion; the definition is simply
+             % \lastnode when called from \setref -> \pdfmkdest.
+  \HyPsdSubst{(}{\backslashlparen}{#1}%
+  \HyPsdSubst{)}{\backslashrparen}{#1}%
+}
+
+{\catcode\exclamChar = 0 \catcode\backChar = \other
+ !gdef!backslashlparen{\(}%
+ !gdef!backslashrparen{\)}%
+}
+
+\ifpdf
+  \input pdfcolor
+  \pdfcatalog{/PageMode /UseOutlines}%
+  \def\dopdfimage#1#2#3{%
+    \def\imagewidth{#2}%
+    \def\imageheight{#3}%
+    % without \immediate, pdftex seg faults when the same image is
+    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
+    \ifnum\pdftexversion < 14
+      \immediate\pdfimage
+    \else
+      \immediate\pdfximage
+    \fi
+      \ifx\empty\imagewidth\else width \imagewidth \fi
+      \ifx\empty\imageheight\else height \imageheight \fi
+      \ifnum\pdftexversion<13
+         #1.pdf%
+       \else
+         {#1.pdf}%
+       \fi
+    \ifnum\pdftexversion < 14 \else
+      \pdfrefximage \pdflastximage
+    \fi}
+  \def\pdfmkdest#1{{%
+    % We have to set dummies so commands such as @code, and characters
+    % such as \, aren't expanded when present in a section title.
+    \atdummies
+    \activebackslashdouble
+    \def\pdfdestname{#1}%
+    \backslashparens\pdfdestname
+    \pdfdest name{\pdfdestname} xyz%
+  }}%
+  %
+  % used to mark target names; must be expandable.
+  \def\pdfmkpgn#1{#1}%
+  %
+  \let\linkcolor = \Blue  % was Cyan, but that seems light?
+  \def\endlink{\Black\pdfendlink}
+  % Adding outlines to PDF; macros for calculating structure of outlines
+  % come from Petr Olsak
+  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+    \else \csname#1\endcsname \fi}
+  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+    \advance\tempnum by 1
+    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+  %
+  % #1 is the section text, which is what will be displayed in the
+  % outline by the pdf viewer.  #2 is the pdf expression for the number
+  % of subentries (or empty, for subsubsections).  #3 is the node text,
+  % which might be empty if this toc entry had no corresponding node.
+  % #4 is the page number
+  %
+  \def\dopdfoutline#1#2#3#4{%
+    % Generate a link to the node text if that exists; else, use the
+    % page number.  We could generate a destination for the section
+    % text in the case where a section has no node, but it doesn't
+    % seem worth the trouble, since most documents are normally structured.
+    \def\pdfoutlinedest{#3}%
+    \ifx\pdfoutlinedest\empty
+      \def\pdfoutlinedest{#4}%
+    \else
+      % Doubled backslashes in the name.
+      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
+       \backslashparens\pdfoutlinedest}%
+    \fi
+    %
+    % Also double the backslashes in the display string.
+    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
+     \backslashparens\pdfoutlinetext}%
+    %
+    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+  }
+  %
+  \def\pdfmakeoutlines{%
+    \begingroup
+      % Thanh's hack / proper braces in bookmarks
+      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+      %
+      % Read toc silently, to get counts of subentries for \pdfoutline.
+      \def\numchapentry##1##2##3##4{%
+	\def\thischapnum{##2}%
+	\def\thissecnum{0}%
+	\def\thissubsecnum{0}%
+      }%
+      \def\numsecentry##1##2##3##4{%
+	\advancenumber{chap\thischapnum}%
+	\def\thissecnum{##2}%
+	\def\thissubsecnum{0}%
+      }%
+      \def\numsubsecentry##1##2##3##4{%
+	\advancenumber{sec\thissecnum}%
+	\def\thissubsecnum{##2}%
+      }%
+      \def\numsubsubsecentry##1##2##3##4{%
+	\advancenumber{subsec\thissubsecnum}%
+      }%
+      \def\thischapnum{0}%
+      \def\thissecnum{0}%
+      \def\thissubsecnum{0}%
+      %
+      % use \def rather than \let here because we redefine \chapentry et
+      % al. a second time, below.
+      \def\appentry{\numchapentry}%
+      \def\appsecentry{\numsecentry}%
+      \def\appsubsecentry{\numsubsecentry}%
+      \def\appsubsubsecentry{\numsubsubsecentry}%
+      \def\unnchapentry{\numchapentry}%
+      \def\unnsecentry{\numsecentry}%
+      \def\unnsubsecentry{\numsubsecentry}%
+      \def\unnsubsubsecentry{\numsubsubsecentry}%
+      \readdatafile{toc}%
+      %
+      % Read toc second time, this time actually producing the outlines.
+      % The `-' means take the \expnumber as the absolute number of
+      % subentries, which we calculated on our first read of the .toc above.
+      %
+      % We use the node names as the destinations.
+      \def\numchapentry##1##2##3##4{%
+        \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+      \def\numsecentry##1##2##3##4{%
+        \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+      \def\numsubsecentry##1##2##3##4{%
+        \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+      \def\numsubsubsecentry##1##2##3##4{% count is always zero
+        \dopdfoutline{##1}{}{##3}{##4}}%
+      %
+      % PDF outlines are displayed using system fonts, instead of
+      % document fonts.  Therefore we cannot use special characters,
+      % since the encoding is unknown.  For example, the eogonek from
+      % Latin 2 (0xea) gets translated to a | character.  Info from
+      % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+      %
+      % xx to do this right, we have to translate 8-bit characters to
+      % their "best" equivalent, based on the @documentencoding.  Right
+      % now, I guess we'll just let the pdf reader have its way.
+      \indexnofonts
+      \setupdatafile
+      \activebackslash
+      \input \jobname.toc
+    \endgroup
+  }
+  %
+  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+    \ifx\PP\D\let\nextsp\relax
+    \else\let\nextsp\skipspaces
+      \ifx\p\space\else\addtokens{\filename}{\PP}%
+        \advance\filenamelength by 1
+      \fi
+    \fi
+    \nextsp}
+  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+  \ifnum\pdftexversion < 14
+    \let \startlink \pdfannotlink
+  \else
+    \let \startlink \pdfstartlink
+  \fi
+  \def\pdfurl#1{%
+    \begingroup
+      \normalturnoffactive\def\@{@}%
+      \makevalueexpandable
+      \leavevmode\Red
+      \startlink attr{/Border [0 0 0]}%
+        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+    \endgroup}
+  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+  \def\maketoks{%
+    \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+    \ifx\first0\adn0
+    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+    \else
+      \ifnum0=\countA\else\makelink\fi
+      \ifx\first.\let\next=\done\else
+        \let\next=\maketoks
+        \addtokens{\toksB}{\the\toksD}
+        \ifx\first,\addtokens{\toksB}{\space}\fi
+      \fi
+    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+    \next}
+  \def\makelink{\addtokens{\toksB}%
+    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+  \def\pdflink#1{%
+    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+    \linkcolor #1\endlink}
+  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+  \let\pdfmkdest = \gobble
+  \let\pdfurl = \gobble
+  \let\endlink = \relax
+  \let\linkcolor = \relax
+  \let\pdfmakeoutlines = \relax
+\fi  % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+  \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+  \csname ten#1\endcsname  % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+% Default leading.
+\newdimen\textleading  \textleading = 13.2pt
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly.  There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+  \normalbaselineskip = #1\relax
+  \normallineskip = \lineskipfactor\normalbaselineskip
+  \normalbaselines
+  \setbox\strutbox =\hbox{%
+    \vrule width0pt height\strutheightpercent\baselineskip
+                    depth \strutdepthpercent \baselineskip
+  }%
+}
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx}               %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}
+\setfont\deftt\ttshape{10}{\magstep1}
+\setfont\defttsl\ttslshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}
+\setfont\smallertt\ttshape{8}{1000}
+\setfont\smallerbf\bfshape{10}{800}
+\setfont\smallerit\itshape{8}{1000}
+\setfont\smallersl\slshape{8}{1000}
+\setfont\smallersf\sfshape{8}{1000}
+\setfont\smallersc\scshape{10}{800}
+\setfont\smallerttsl\ttslshape{10}{800}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+\def\authortt{\sectt}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}
+\setfont\reducedtt\ttshape{10}{1000}
+\setfont\reducedbf\bfshape{10}{1000}
+\setfont\reducedit\itshape{10}{1000}
+\setfont\reducedsl\slshape{10}{1000}
+\setfont\reducedsf\sfshape{10}{1000}
+\setfont\reducedsc\scshape{10}{1000}
+\setfont\reducedttsl\ttslshape{10}{1000}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families.  Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+  \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE.  We do this because \STYLE needs to also set the
+% current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower).  These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+  \let\tenttsl=\textttsl
+  \def\curfontsize{text}%
+  \def\lsize{reduced}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+  \let\tenttsl=\titlettsl
+  \def\curfontsize{title}%
+  \def\lsize{chap}\def\lllsize{subsec}%
+  \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+  \let\tenttsl=\chapttsl
+  \def\curfontsize{chap}%
+  \def\lsize{sec}\def\lllsize{text}%
+  \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+  \let\tenttsl=\secttsl
+  \def\curfontsize{sec}%
+  \def\lsize{subsec}\def\lllsize{reduced}%
+  \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+  \let\tenttsl=\ssecttsl
+  \def\curfontsize{ssec}%
+  \def\lsize{text}\def\lllsize{small}%
+  \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+  \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+  \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+  \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+  \let\tenttsl=\reducedttsl
+  \def\curfontsize{reduced}%
+  \def\lsize{small}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+  \let\tenttsl=\smallttsl
+  \def\curfontsize{small}%
+  \def\lsize{smaller}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+  \let\tenttsl=\smallerttsl
+  \def\curfontsize{smaller}%
+  \def\lsize{smaller}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{9.5pt}}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+%   8.5x11=86   smallbook=72  a4=90  a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+%   8.5x11=90+  smallbook=80  a4=90+  a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt.  So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+%   8.5x11=71  smallbook=60  a4=75  a5=58
+%
+% I wish the USA used A4 paper.
+% --karl, 24jan03.
+
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts \rm
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bfshape{10}{\magstep1}  % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}
+\setfont\shortconttt\ttshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+                    \ptexslash\fi\fi\fi}
+\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally uses \ttsl.
+% @var is set to this for defun arguments.
+\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally use \sl.  We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% @b, explicit bold.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph.  Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+  \def\plainfrenchspacing{%
+    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+    \def\endofsentencespacefactor{1000}% for @. and friends
+  }
+  \def\plainnonfrenchspacing{%
+    \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+    \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+    \def\endofsentencespacefactor{3000}% for @. and friends
+  }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+\def\t#1{%
+  {\tt \rawbackslash \plainfrenchspacing #1}%
+  \null
+}
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+    \vbox{\hrule\kern-0.4pt
+     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+    \kern-0.4pt\hrule}%
+  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+  {%
+    % Change normal interword space to be same as for the current font.
+    \spaceskip = \fontdimen2\font
+    %
+    % Switch to typewriter.
+    \tt
+    %
+    % But `\ ' produces the large typewriter interword space.
+    \def\ {{\spaceskip = 0pt{} }}%
+    %
+    % Turn off hyphenation.
+    \nohyphenation
+    %
+    \rawbackslash
+    \plainfrenchspacing
+    #1%
+  }%
+  \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+%  -- rms.
+{
+  \catcode`\-=\active
+  \catcode`\_=\active
+  %
+  \global\def\code{\begingroup
+    \catcode`\-=\active  \catcode`\_=\active
+    \ifallowcodebreaks
+     \let-\codedash
+     \let_\codeunder
+    \else
+     \let-\realdash
+     \let_\realunder
+    \fi
+    \codex
+  }
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{%
+  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
+  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+  % will therefore expand the active definition of _, which is us
+  % (inside @code that is), therefore an endless loop.
+  \ifusingtt{\ifmmode
+               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+             \else\normalunderscore \fi
+             \discretionary{}{}{}}%
+            {\_}%
+}
+\def\codex #1{\tclose{#1}\endgroup}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__.  This is undesirable in
+% some manuals, especially if they don't have long identifiers in
+% general.  @allowcodebreaks provides a way to control this.
+% 
+\newif\ifallowcodebreaks  \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\keywordtrue
+    \allowcodebreakstrue
+  \else\ifx\txiarg\keywordfalse
+    \allowcodebreaksfalse
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+  \fi\fi
+}
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+%   `example' (@kbd uses ttsl only inside of @example and friends),
+%   or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\worddistinct
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+  \else\ifx\txiarg\wordexample
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+  \else\ifx\txiarg\wordcode
+    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
+  \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct.'
+\kbdinputstyle distinct
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
+\let\indicateurl=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+  \unsepspaces
+  \pdfurl{#1}%
+  \setbox0 = \hbox{\ignorespaces #3}%
+  \ifdim\wd0 > 0pt
+    \unhbox0 % third arg given, show only that
+  \else
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0 > 0pt
+      \ifpdf
+        \unhbox0             % PDF: 2nd arg given, show only it
+      \else
+        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+      \fi
+    \else
+      \code{#1}% only url given, so show it
+    \fi
+  \fi
+  \endlink
+\endgroup}
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+  \def\email#1{\doemail#1,,\finish}
+  \def\doemail#1,#2,#3\finish{\begingroup
+    \unsepspaces
+    \pdfurl{mailto:#1}%
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+    \endlink
+  \endgroup}
+\else
+  \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font.  Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find.  We need it for
+% Polish suppressed-l.  --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}}              % roman font
+\def\sc#1{{\smallcaps#1}}       % smallcaps font
+\def\ii#1{{\it #1}}             % italic font
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+% 
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+  {\selectfonts\lsize #1}%
+  \def\temp{#2}%
+  \ifx\temp\empty \else
+    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+  \fi
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+% 
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+  {\plainfrenchspacing #1}%
+  \def\temp{#2}%
+  \ifx\temp\empty \else
+    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+  \fi
+}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
+% 
+% Although only regular is the truly official Euro symbol, we ignore
+% that.  The Euro is designed to be slightly taller than the regular
+% font height.
+% 
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+% 
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+% 
+% Also doesn't work in math.  Do we need to do math with euro symbols?
+% Hope not.
+% 
+% 
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+  % We set the font at each command, rather than predefining it in
+  % \textfonts and the other font-switching commands, so that
+  % installations which never need the symbol don't have to have the
+  % font installed.
+  % 
+  % There is only one designed size (nominal 10pt), so we always scale
+  % that to the current nominal size.
+  % 
+  % By the way, simply using "at 1em" works for cmr10 and the like, but
+  % does not work for cmbx10 and other extended/shrunken fonts.
+  % 
+  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+  %
+  \ifx\curfontstyle\bfstylename 
+    % bold:
+    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+  \else 
+    % regular:
+    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+  \fi
+  \thiseurofont
+}
+
+% @registeredsymbol - R in a circle.  The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+  $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+               \hfil\crcr\Orb}}%
+    }$%
+}
+
+% Laurent Siebenmann reports \Orb undefined with:
+%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
+% so we'll define it if necessary.
+% 
+\ifx\Orb\undefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page.  Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+        \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+  % Open one extra group, as we want to close it in the middle of \Etitlepage.
+  \begingroup
+    \parindent=0pt \textfonts
+    % Leave some space at the very top of the page.
+    \vglue\titlepagetopglue
+    % No rule at page bottom unless we print one at the top with @title.
+    \finishedtitlepagetrue
+    %
+    % Most title ``pages'' are actually two pages long, with space
+    % at the top of the second.  We don't want the ragged left on the second.
+    \let\oldpage = \page
+    \def\page{%
+      \iffinishedtitlepage\else
+	 \finishtitlepage
+      \fi
+      \let\page = \oldpage
+      \page
+      \null
+    }%
+}
+
+\def\Etitlepage{%
+    \iffinishedtitlepage\else
+	\finishtitlepage
+    \fi
+    % It is important to do the page break before ending the group,
+    % because the headline and footline are only empty inside the group.
+    % If we use the new definition of \page, we always get a blank page
+    % after the title page, which we certainly don't want.
+    \oldpage
+  \endgroup
+  %
+  % Need this before the \...aftertitlepage checks so that if they are
+  % in effect the toc pages will come out with page numbers.
+  \HEADINGSon
+  %
+  % If they want short, they certainly want long too.
+  \ifsetshortcontentsaftertitlepage
+    \shortcontents
+    \contents
+    \global\let\shortcontents = \relax
+    \global\let\contents = \relax
+  \fi
+  %
+  \ifsetcontentsaftertitlepage
+    \contents
+    \global\let\contents = \relax
+    \global\let\shortcontents = \relax
+  \fi
+}
+
+\def\finishtitlepage{%
+  \vskip4pt \hrule height 2pt width \hsize
+  \vskip\titlepagebottomglue
+  \finishedtitlepagetrue
+}
+
+%%% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
+		\let\tt=\authortt}
+
+\parseargdef\title{%
+  \checkenv\titlepage
+  \leftline{\titlefonts\rm #1}
+  % print a rule at the page bottom also.
+  \finishedtitlepagefalse
+  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+  \checkenv\titlepage
+  {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+  \def\temp{\quotation}%
+  \ifx\thisenv\temp
+    \def\quotationauthor{#1}% printed in \Equotation.
+  \else
+    \checkenv\titlepage
+    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+    {\authorfont \leftline{#1}}%
+  \fi
+}
+
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline    % headline on even pages
+\newtoks\oddheadline     % headline on odd pages
+\newtoks\evenfootline    % footline on even pages
+\newtoks\oddfootline     % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+                            \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+                            \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what  @headings on  does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+  %
+  % Leave some space for the footline.  Hopefully ok to assume
+  % @evenfooting will not be used by itself.
+  \global\advance\pageheight by -\baselineskip
+  \global\advance\vsize by -\baselineskip
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+
+% @headings double      turns headings on for double-sided printing.
+% @headings single      turns headings on for single-sided printing.
+% @headings off         turns them off.
+% @headings on          same as @headings double, retained for compatibility.
+% @headings after       turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{%
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+  \number\day\space
+  \ifcase\month
+  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+  \fi
+  \space\number\year}
+\fi
+
+% @settitle line...  specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent  \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin  \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+  \advance\hsize by -\rightskip
+  \advance\hsize by -\tableindent
+  \setbox0=\hbox{\itemindicate{#1}}%
+  \itemindex{#1}%
+  \nobreak % This prevents a break before @itemx.
+  %
+  % If the item text does not fit in the space we have, put it on a line
+  % by itself, and do not allow a page break either before or after that
+  % line.  We do not start a paragraph here because then if the next
+  % command is, e.g., @kindex, the whatsit would get put into the
+  % horizontal list on a line by itself, resulting in extra blank space.
+  \ifdim \wd0>\itemmax
+    %
+    % Make this a paragraph so we get the \parskip glue and wrapping,
+    % but leave it ragged-right.
+    \begingroup
+      \advance\leftskip by-\tableindent
+      \advance\hsize by\tableindent
+      \advance\rightskip by0pt plus1fil
+      \leavevmode\unhbox0\par
+    \endgroup
+    %
+    % We're going to be starting a paragraph, but we don't want the
+    % \parskip glue -- logically it's part of the @item we just started.
+    \nobreak \vskip-\parskip
+    %
+    % Stop a page break at the \parskip glue coming up.  However, if
+    % what follows is an environment such as @example, there will be no
+    % \parskip glue; then the negative vskip we just inserted would
+    % cause the example and the item to crash together.  So we use this
+    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+    % \parskip glue after all.  Section titles are handled this way also.
+    % 
+    \penalty 10001
+    \endgroup
+    \itemxneedsnegativevskipfalse
+  \else
+    % The item text fits into the space.  Start a paragraph, so that the
+    % following text (if any) will end up on the same line.
+    \noindent
+    % Do this with kerns and \unhbox so that if there is a footnote in
+    % the item text, it can migrate to the main vertical list and
+    % eventually be printed.
+    \nobreak\kern-\tableindent
+    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+    \unhbox0
+    \nobreak\kern\dimen0
+    \endgroup
+    \itemxneedsnegativevskiptrue
+  \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+  \let\itemindex\gobble
+  \tablecheck{table}%
+}
+\envdef\ftable{%
+  \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+  \tablecheck{ftable}%
+}
+\envdef\vtable{%
+  \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+  \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+  \ifnum \the\catcode`\^^M=\active
+    \endgroup
+    \errmessage{This command won't work in this context; perhaps the problem is
+      that we are \inenvironment\thisenv}%
+    \def\next{\doignore{#1}}%
+  \else
+    \let\next\tablex
+  \fi
+  \next
+}
+\def\tablex#1{%
+  \def\itemindicate{#1}%
+  \parsearg\tabley
+}
+\def\tabley#1{%
+  {%
+    \makevalueexpandable
+    \edef\temp{\noexpand\tablez #1\space\space\space}%
+    \expandafter
+  }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+  \aboveenvbreak
+  \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+  \ifnum 0#2>0 \tableindent=#2\mil \fi
+  \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+  \itemmax=\tableindent
+  \advance \itemmax by -\itemmargin
+  \advance \leftskip by \tableindent
+  \exdentamount=\tableindent
+  \parindent = 0pt
+  \parskip = \smallskipamount
+  \ifdim \parskip=0pt \parskip=2pt \fi
+  \let\item = \internalBitem
+  \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+  \aboveenvbreak
+  \itemmax=\itemindent
+  \advance\itemmax by -\itemmargin
+  \advance\leftskip by \itemindent
+  \exdentamount=\itemindent
+  \parindent=0pt
+  \parskip=\smallskipamount
+  \ifdim\parskip=0pt \parskip=2pt \fi
+  \def\itemcontents{#1}%
+  % @itemize with no arg is equivalent to @itemize @bullet.
+  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+  \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+  \advance\itemno by 1  % for enumerations
+  {\let\par=\endgraf \smallbreak}% reasonable place to break
+  {%
+   % If the document has an @itemize directly after a section title, a
+   % \nobreak will be last on the list, and \sectionheading will have
+   % done a \vskip-\parskip.  In that case, we don't want to zero
+   % parskip, or the item text will crash with the heading.  On the
+   % other hand, when there is normal text preceding the item (as there
+   % usually is), we do want to zero parskip, or there would be too much
+   % space.  In that case, we won't have a \nobreak before.  At least
+   % that's the theory.
+   \ifnum\lastpenalty<10000 \parskip=0in \fi
+   \noindent
+   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+   \vadjust{\penalty 1200}}% not good to break after first line of item.
+  \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list.  No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+  % If we were given no argument, pretend we were given `1'.
+  \def\thearg{#1}%
+  \ifx\thearg\empty \def\thearg{1}\fi
+  %
+  % Detect if the argument is a single token.  If so, it might be a
+  % letter.  Otherwise, the only valid thing it can be is a number.
+  % (We will always have one token, because of the test we just made.
+  % This is a good thing, since \splitoff doesn't work given nothing at
+  % all -- the first parameter is undelimited.)
+  \expandafter\splitoff\thearg\endmark
+  \ifx\rest\empty
+    % Only one token in the argument.  It could still be anything.
+    % A ``lowercase letter'' is one whose \lccode is nonzero.
+    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+    %   not equal to itself.
+    % Otherwise, we assume it's a number.
+    %
+    % We need the \relax at the end of the \ifnum lines to stop TeX from
+    % continuing to look for a <number>.
+    %
+    \ifnum\lccode\expandafter`\thearg=0\relax
+      \numericenumerate % a number (we hope)
+    \else
+      % It's a letter.
+      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+        \lowercaseenumerate % lowercase letter
+      \else
+        \uppercaseenumerate % uppercase letter
+      \fi
+    \fi
+  \else
+    % Multiple tokens in the argument.  We hope it's a number.
+    \numericenumerate
+  \fi
+}
+
+% An @enumerate whose labels are integers.  The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+  \itemno = \thearg
+  \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+  \itemno = \expandafter`\thearg
+  \startenumeration{%
+    % Be sure we're not beyond the end of the alphabet.
+    \ifnum\itemno=0
+      \errmessage{No more lowercase letters in @enumerate; get a bigger
+                  alphabet}%
+    \fi
+    \char\lccode\itemno
+  }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+  \itemno = \expandafter`\thearg
+  \startenumeration{%
+    % Be sure we're not beyond the end of the alphabet.
+    \ifnum\itemno=0
+      \errmessage{No more uppercase letters in @enumerate; get a bigger
+                  alphabet}
+    \fi
+    \char\uccode\itemno
+  }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments.  Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+  \advance\itemno by -1
+  \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble.  Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+%   @multitable @columnfractions .25 .3 .45
+%   @item ...
+%
+%   Numbers following @columnfractions are the percent of the total
+%   current hsize to be used for each column. You may use as many
+%   columns as desired.
+
+
+% Or use a template:
+%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+%   @item ...
+%   using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+%   @item first col stuff @tab second col stuff @tab third col
+%   @item
+%   first col stuff
+%   @tab
+%   second col stuff
+%   @tab
+%   third col
+%   @item first col stuff @tab second col stuff
+%   @tab Many paragraphs of text may be used in any column.
+%
+%         They will wrap at the width determined by the template.
+%   @item@tab@tab This will be in third column.
+%   @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+%                                                            to baseline.
+%   0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1.  We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+  \global\advance\colcount by 1
+  \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+  \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+  \def\firstarg{#1}%
+  \ifx\firstarg\xendsetuptable
+    \let\go = \relax
+  \else
+    \ifx\firstarg\xcolumnfractions
+      \global\setpercenttrue
+    \else
+      \ifsetpercent
+         \let\go\pickupwholefraction
+      \else
+         \global\advance\colcount by 1
+         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+                   % separator; typically that is always in the input, anyway.
+         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+      \fi
+    \fi
+    \ifx\go\pickupwholefraction
+      % Put the argument back for the \pickupwholefraction call, so
+      % we'll always have a period there to be parsed.
+      \def\go{\pickupwholefraction#1}%
+    \else
+      \let\go = \setuptable
+    \fi%
+  \fi
+  \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry.  Note that \everycr resets \everytab.
+\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
+%
+% A \tab used to include \hskip1sp.  But then the space in a template
+% line is not enough.  That is bad.  So let's go back to just `&' until
+% we encounter the problem it was intended to solve again.
+%					--karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab  % insert after every tab.
+%
+\envdef\multitable{%
+  \vskip\parskip
+  \startsavinginserts
+  %
+  % @item within a multitable starts a normal row.
+  % We use \def instead of \let so that if one of the multitable entries
+  % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+  % \endtemplate) expanding \doitemize.
+  \def\item{\crcr}%
+  %
+  \tolerance=9500
+  \hbadness=9500
+  \setmultitablespacing
+  \parskip=\multitableparskip
+  \parindent=\multitableparindent
+  \overfullrule=0pt
+  \global\colcount=0
+  %
+  \everycr = {%
+    \noalign{%
+      \global\everytab={}%
+      \global\colcount=0 % Reset the column counter.
+      % Check for saved footnotes, etc.
+      \checkinserts
+      % Keeps underfull box messages off when table breaks over pages.
+      %\filbreak
+	% Maybe so, but it also creates really weird page breaks when the
+	% table breaks over pages. Wouldn't \vfil be better?  Wait until the
+	% problem manifests itself, so it can be fixed for real --karl.
+    }%
+  }%
+  %
+  \parsearg\domultitable
+}
+\def\domultitable#1{%
+  % To parse everything between @multitable and @item:
+  \setuptable#1 \endsetuptable
+  %
+  % This preamble sets up a generic column definition, which will
+  % be used as many times as user calls for columns.
+  % \vtop will set a single line and will also let text wrap and
+  % continue for many paragraphs if desired.
+  \halign\bgroup &%
+    \global\advance\colcount by 1
+    \multistrut
+    \vtop{%
+      % Use the current \colcount to find the correct column width:
+      \hsize=\expandafter\csname col\the\colcount\endcsname
+      %
+      % In order to keep entries from bumping into each other
+      % we will add a \leftskip of \multitablecolspace to all columns after
+      % the first one.
+      %
+      % If a template has been used, we will add \multitablecolspace
+      % to the width of each template entry.
+      %
+      % If the user has set preamble in terms of percent of \hsize we will
+      % use that dimension as the width of the column, and the \leftskip
+      % will keep entries from bumping into each other.  Table will start at
+      % left margin and final column will justify at right margin.
+      %
+      % Make sure we don't inherit \rightskip from the outer environment.
+      \rightskip=0pt
+      \ifnum\colcount=1
+	% The first column will be indented with the surrounding text.
+	\advance\hsize by\leftskip
+      \else
+	\ifsetpercent \else
+	  % If user has not set preamble in terms of percent of \hsize
+	  % we will advance \hsize by \multitablecolspace.
+	  \advance\hsize by \multitablecolspace
+	\fi
+       % In either case we will make \leftskip=\multitablecolspace:
+      \leftskip=\multitablecolspace
+      \fi
+      % Ignoring space at the beginning and end avoids an occasional spurious
+      % blank line, when TeX decides to break the line at the space before the
+      % box from the multistrut, so the strut ends up on a line by itself.
+      % For example:
+      % @multitable @columnfractions .11 .89
+      % @item @code{#}
+      % @tab Legal holiday which is valid in major parts of the whole country.
+      % Is automatically provided with highlighting sequences respectively
+      % marking characters.
+      \noindent\ignorespaces##\unskip\multistrut
+    }\cr
+}
+\def\Emultitable{%
+  \crcr
+  \egroup % end the \halign
+  \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+  \def\multistrut{\strut}% just use the standard line spacing
+  %
+  % Compute \multitablelinespace (if not defined by user) for use in
+  % \multitableparskip calculation.  We used define \multistrut based on
+  % this, but (ironically) that caused the spacing to be off.
+  % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%%        If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+                                      %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+                                      %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed.  They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested.  But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+  \expandafter\let\csname #1\endcsname = \relax
+  \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+  % Scan in ``verbatim'' mode:
+  \catcode`\@ = \other
+  \catcode`\{ = \other
+  \catcode`\} = \other
+  %
+  % Make sure that spaces turn into tokens that match what \doignoretext wants.
+  \spaceisspace
+  %
+  % Count number of #1's that we've seen.
+  \doignorecount = 0
+  %
+  % Swallow text until we reach the matching `@end #1'.
+  \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+  \obeylines %
+  %
+  \gdef\dodoignore#1{%
+    % #1 contains the command name as a string, e.g., `ifinfo'.
+    %
+    % Define a command to find the next `@end #1', which must be on a line
+    % by itself.
+    \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}%
+    % And this command to find another #1 command, at the beginning of a
+    % line.  (Otherwise, we would consider a line `@c @ifset', for
+    % example, to count as an @ifset for nesting.)
+    \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+    %
+    % And now expand that command.
+    \obeylines %
+    \doignoretext ^^M%
+  }%
+}
+
+\def\doignoreyyy#1{%
+  \def\temp{#1}%
+  \ifx\temp\empty			% Nothing found.
+    \let\next\doignoretextzzz
+  \else					% Found a nested condition, ...
+    \advance\doignorecount by 1
+    \let\next\doignoretextyyy		% ..., look for another.
+    % If we're here, #1 ends with ^^M\ifinfo (for example).
+  \fi
+  \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+  \ifnum\doignorecount = 0	% We have just found the outermost @end.
+    \let\next\enddoignore
+  \else				% Still inside a nested condition.
+    \advance\doignorecount by -1
+    \let\next\doignoretext      % Look for the next @end.
+  \fi
+  \next
+}
+
+% Finish off ignored text.
+\def\enddoignore{\endgroup\ignorespaces}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+  {%
+    \makevalueexpandable
+    \def\temp{#2}%
+    \edef\next{\gdef\makecsname{SET#1}}%
+    \ifx\temp\empty
+      \next{}%
+    \else
+      \setzzz#2\endsetzzz
+    \fi
+  }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+  {%
+    \makevalueexpandable
+    \global\expandafter\let\csname SET#1\endcsname=\relax
+  }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+  \catcode`\- = \active \catcode`\_ = \active
+  %
+  \gdef\makevalueexpandable{%
+    \let\value = \expandablevalue
+    % We don't want these characters active, ...
+    \catcode`\-=\other \catcode`\_=\other
+    % ..., but we might end up with active ones in the argument if
+    % we're called from @code, as @code{@value{foo-bar_}}, though.
+    % So \let them to their normal equivalents.
+    \let-\realdash \let_\normalunderscore
+  }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file.  This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+  \expandafter\ifx\csname SET#1\endcsname\relax
+    {[No value for ``#1'']}%
+    \message{Variable `#1', used in @value, is not set.}%
+  \else
+    \csname SET#1\endcsname
+  \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+  {%
+    \makevalueexpandable
+    \let\next=\empty
+    \expandafter\ifx\csname SET#2\endcsname\relax
+      #1% If not set, redefine \next.
+    \fi
+    \expandafter
+  }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @dircategory CATEGORY  -- specify a category of the dir file
+% which this file should belong to.  Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index.  The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+  \iflinks
+    \expandafter\newwrite \csname#1indfile\endcsname
+    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+  \fi
+  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
+    \noexpand\doindex{#1}}
+}
+
+% @defindex foo  ==  \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+  \iflinks
+    \expandafter\newwrite \csname#1indfile\endcsname
+    \openout \csname#1indfile\endcsname \jobname.#1
+  \fi
+  \expandafter\xdef\csname#1index\endcsname{%
+    \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar    makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar   similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+  % Only do \closeout if we haven't already done it, else we'll end up
+  % closing the target index.
+  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
+    % The \closeout helps reduce unnecessary open files; the limit on the
+    % Acorn RISC OS is a mere 16 files.
+    \expandafter\closeout\csname#2indfile\endcsname
+    \expandafter\let\csname\donesynindex#2\endcsname = 1
+  \fi
+  % redefine \fooindfile:
+  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+  \expandafter\let\csname#2indfile\endcsname=\temp
+  % redefine \fooindex:
+  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+%  and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+  \escapechar = `\\     % use backslash in output files.
+  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+  \def\ {\realbackslash\space }%
+  % Need these in case \tex is in effect and \{ is a \delimiter again.
+  % But can't use \lbracecmd and \rbracecmd because texindex assumes
+  % braces and backslashes are used only as delimiters.
+  \let\{ = \mylbrace
+  \let\} = \myrbrace
+  %
+  % Do the redefinitions.
+  \commondummies
+}
+
+% For the aux and toc files, @ is the escape character.  So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files).  When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+  \def\@{@@}%
+  \def\ {@ }%
+  \let\{ = \lbraceatcmd
+  \let\} = \rbraceatcmd
+  %
+  % Do the redefinitions.
+  \commondummies
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+  %
+  % \definedummyword defines \#1 as \string\#1\space, thus effectively
+  % preventing its expansion.  This is used only for control% words,
+  % not control letters, because the \space would be incorrect for
+  % control characters, but is needed to separate the control word
+  % from whatever follows.
+  %
+  % For control letters, we have \definedummyletter, which omits the
+  % space.
+  %
+  % These can be used both for control words that take an argument and
+  % those that do not.  If it is followed by {arg} in the input, then
+  % that will dutifully get written to the index (or wherever).
+  %
+  \def\definedummyword  ##1{\def##1{\string##1\space}}%
+  \def\definedummyletter##1{\def##1{\string##1}}%
+  \let\definedummyaccent\definedummyletter
+  %
+  \commondummiesnofonts
+  %
+  \definedummyletter\_%
+  %
+  % Non-English letters.
+  \definedummyword\AA
+  \definedummyword\AE
+  \definedummyword\L
+  \definedummyword\OE
+  \definedummyword\O
+  \definedummyword\aa
+  \definedummyword\ae
+  \definedummyword\l
+  \definedummyword\oe
+  \definedummyword\o
+  \definedummyword\ss
+  \definedummyword\exclamdown
+  \definedummyword\questiondown
+  \definedummyword\ordf
+  \definedummyword\ordm
+  %
+  % Although these internal commands shouldn't show up, sometimes they do.
+  \definedummyword\bf
+  \definedummyword\gtr
+  \definedummyword\hat
+  \definedummyword\less
+  \definedummyword\sf
+  \definedummyword\sl
+  \definedummyword\tclose
+  \definedummyword\tt
+  %
+  \definedummyword\LaTeX
+  \definedummyword\TeX
+  %
+  % Assorted special characters.
+  \definedummyword\bullet
+  \definedummyword\comma
+  \definedummyword\copyright
+  \definedummyword\registeredsymbol
+  \definedummyword\dots
+  \definedummyword\enddots
+  \definedummyword\equiv
+  \definedummyword\error
+  \definedummyword\euro
+  \definedummyword\expansion
+  \definedummyword\minus
+  \definedummyword\pounds
+  \definedummyword\point
+  \definedummyword\print
+  \definedummyword\result
+  %
+  % We want to disable all macros so that they are not expanded by \write.
+  \macrolist
+  %
+  \normalturnoffactive
+  %
+  % Handle some cases of @value -- where it does not contain any
+  % (non-fully-expandable) commands.
+  \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+% Better have this without active chars.
+{
+  \catcode`\~=\other
+  \gdef\commondummiesnofonts{%
+    % Control letters and accents.
+    \definedummyletter\!%
+    \definedummyaccent\"%
+    \definedummyaccent\'%
+    \definedummyletter\*%
+    \definedummyaccent\,%
+    \definedummyletter\.%
+    \definedummyletter\/%
+    \definedummyletter\:%
+    \definedummyaccent\=%
+    \definedummyletter\?%
+    \definedummyaccent\^%
+    \definedummyaccent\`%
+    \definedummyaccent\~%
+    \definedummyword\u
+    \definedummyword\v
+    \definedummyword\H
+    \definedummyword\dotaccent
+    \definedummyword\ringaccent
+    \definedummyword\tieaccent
+    \definedummyword\ubaraccent
+    \definedummyword\udotaccent
+    \definedummyword\dotless
+    %
+    % Texinfo font commands.
+    \definedummyword\b
+    \definedummyword\i
+    \definedummyword\r
+    \definedummyword\sc
+    \definedummyword\t
+    %
+    % Commands that take arguments.
+    \definedummyword\acronym
+    \definedummyword\cite
+    \definedummyword\code
+    \definedummyword\command
+    \definedummyword\dfn
+    \definedummyword\emph
+    \definedummyword\env
+    \definedummyword\file
+    \definedummyword\kbd
+    \definedummyword\key
+    \definedummyword\math
+    \definedummyword\option
+    \definedummyword\samp
+    \definedummyword\strong
+    \definedummyword\tie
+    \definedummyword\uref
+    \definedummyword\url
+    \definedummyword\var
+    \definedummyword\verb
+    \definedummyword\w
+  }
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names.  It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+  % Accent commands should become @asis.
+  \def\definedummyaccent##1{\let##1\asis}%
+  % We can just ignore other control letters.
+  \def\definedummyletter##1{\let##1\empty}%
+  % Hopefully, all control words can become @asis.
+  \let\definedummyword\definedummyaccent
+  %
+  \commondummiesnofonts
+  %
+  % Don't no-op \tt, since it isn't a user-level command
+  % and is used in the definitions of the active chars like <, >, |, etc.
+  % Likewise with the other plain tex font commands.
+  %\let\tt=\asis
+  %
+  \def\ { }%
+  \def\@{@}%
+  % how to handle braces?
+  \def\_{\normalunderscore}%
+  %
+  % Non-English letters.
+  \def\AA{AA}%
+  \def\AE{AE}%
+  \def\L{L}%
+  \def\OE{OE}%
+  \def\O{O}%
+  \def\aa{aa}%
+  \def\ae{ae}%
+  \def\l{l}%
+  \def\oe{oe}%
+  \def\o{o}%
+  \def\ss{ss}%
+  \def\exclamdown{!}%
+  \def\questiondown{?}%
+  \def\ordf{a}%
+  \def\ordm{o}%
+  %
+  \def\LaTeX{LaTeX}%
+  \def\TeX{TeX}%
+  %
+  % Assorted special characters.
+  % (The following {} will end up in the sort string, but that's ok.)
+  \def\bullet{bullet}%
+  \def\comma{,}%
+  \def\copyright{copyright}%
+  \def\registeredsymbol{R}%
+  \def\dots{...}%
+  \def\enddots{...}%
+  \def\equiv{==}%
+  \def\error{error}%
+  \def\euro{euro}%
+  \def\expansion{==>}%
+  \def\minus{-}%
+  \def\pounds{pounds}%
+  \def\point{.}%
+  \def\print{-|}%
+  \def\result{=>}%
+  %
+  % We need to get rid of all macros, leaving only the arguments (if present).
+  % Of course this is not nearly correct, but it is the best we can do for now.
+  % makeinfo does not expand macros in the argument to @deffn, which ends up
+  % writing an index entry, and texindex isn't prepared for an index sort entry
+  % that starts with \.
+  % 
+  % Since macro invocations are followed by braces, we can just redefine them
+  % to take a single TeX argument.  The case of a macro invocation that
+  % goes to end-of-line is not handled.
+  % 
+  \macrolist
+}
+
+\let\indexbackslash=0  %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+  \iflinks
+  {%
+    % Store the main index entry text (including the third arg).
+    \toks0 = {#2}%
+    % If third arg is present, precede it with a space.
+    \def\thirdarg{#3}%
+    \ifx\thirdarg\empty \else
+      \toks0 = \expandafter{\the\toks0 \space #3}%
+    \fi
+    %
+    \edef\writeto{\csname#1indfile\endcsname}%
+    %
+    \ifvmode
+      \dosubindsanitize
+    \else
+      \dosubindwrite
+    \fi
+  }%
+  \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+  % Put the index entry in the margin if desired.
+  \ifx\SETmarginindex\relax\else
+    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+  \fi
+  %
+  % Remember, we are within a group.
+  \indexdummies % Must do this here, since \bf, etc expand at this stage
+  \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+      % so it will be output as is; and it will print as backslash.
+  %
+  % Process the index entry with all font commands turned off, to
+  % get the string to sort by.
+  {\indexnofonts
+   \edef\temp{\the\toks0}% need full expansion
+   \xdef\indexsorttmp{\temp}%
+  }%
+  %
+  % Set up the complete index entry, with both the sort key and
+  % the original text, including any font commands.  We write
+  % three arguments to \entry to the .?? file (four in the
+  % subentry case), texindex reduces to two when writing the .??s
+  % sorted result.
+  \edef\temp{%
+    \write\writeto{%
+      \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+  }%
+  \temp
+}
+
+% Take care of unwanted page breaks:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again.  Otherwise, the whatsit generated by the
+% \write will make \lastskip zero.  The result is that sequences
+% like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode.  We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip.  \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip.  The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+% ..., ready, GO:
+%
+\def\dosubindsanitize{%
+  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+  \skip0 = \lastskip
+  \edef\lastskipmacro{\the\lastskip}%
+  \count255 = \lastpenalty
+  %
+  % If \lastskip is nonzero, that means the last item was a
+  % skip.  And since a skip is discardable, that means this
+  % -\skip0 glue we're inserting is preceded by a
+  % non-discardable item, therefore it is not a potential
+  % breakpoint, therefore no \nobreak needed.
+  \ifx\lastskipmacro\zeroskipmacro
+  \else
+    \vskip-\skip0
+  \fi
+  %
+  \dosubindwrite
+  %
+  \ifx\lastskipmacro\zeroskipmacro
+    % If \lastskip was zero, perhaps the last item was a penalty, and
+    % perhaps it was >=10000, e.g., a \nobreak.  In that case, we want
+    % to re-insert the same penalty (values >10000 are used for various
+    % signals); since we just inserted a non-discardable item, any
+    % following glue (such as a \parskip) would be a breakpoint.  For example:
+    % 
+    %   @deffn deffn-whatever
+    %   @vindex index-whatever
+    %   Description.
+    % would allow a break between the index-whatever whatsit
+    % and the "Description." paragraph.
+    \ifnum\count255>9999 \penalty\count255 \fi
+  \else
+    % On the other hand, if we had a nonzero \lastskip,
+    % this make-up glue would be preceded by a non-discardable item
+    % (the whatsit from the \write), so we must insert a \nobreak.
+    \nobreak\vskip\skip0
+  \fi
+}
+
+% The index entry written in the file actually looks like
+%  \entry {sortstring}{page}{topic}
+% or
+%  \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+%  \initial {c}
+%     before the first topic whose initial is c
+%  \entry {topic}{pagelist}
+%     for a topic that is used without subtopics
+%  \primary {topic}
+%     for the beginning of a topic that is used with subtopics
+%  \secondary {subtopic}{pagelist}
+%     for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+  \dobreak \chapheadingskip{10000}%
+  %
+  \smallfonts \rm
+  \tolerance = 9500
+  \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+  %
+  % See if the index file exists and is nonempty.
+  % Change catcode of @ here so that if the index file contains
+  % \initial {@}
+  % as its first line, TeX doesn't complain about mismatched braces
+  % (because it thinks @} is a control sequence).
+  \catcode`\@ = 11
+  \openin 1 \jobname.#1s
+  \ifeof 1
+    % \enddoublecolumns gets confused if there is no text in the index,
+    % and it loses the chapter title and the aux file entries for the
+    % index.  The easiest way to prevent this problem is to make sure
+    % there is some text.
+    \putwordIndexNonexistent
+  \else
+    %
+    % If the index file exists but is empty, then \openin leaves \ifeof
+    % false.  We have to make TeX try to read something from the file, so
+    % it can discover if there is anything in it.
+    \read 1 to \temp
+    \ifeof 1
+      \putwordIndexIsEmpty
+    \else
+      % Index files are almost Texinfo source, but we use \ as the escape
+      % character.  It would be better to use @, but that's too big a change
+      % to make right now.
+      \def\indexbackslash{\backslashcurfont}%
+      \catcode`\\ = 0
+      \escapechar = `\\
+      \begindoublecolumns
+      \input \jobname.#1s
+      \enddoublecolumns
+    \fi
+  \fi
+  \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+  % Some minor font changes for the special characters.
+  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+  %
+  % Remove any glue we may have, we'll be inserting our own.
+  \removelastskip
+  %
+  % We like breaks before the index initials, so insert a bonus.
+  \nobreak
+  \vskip 0pt plus 3\baselineskip
+  \penalty 0
+  \vskip 0pt plus -3\baselineskip
+  %
+  % Typeset the initial.  Making this add up to a whole number of
+  % baselineskips increases the chance of the dots lining up from column
+  % to column.  It still won't often be perfect, because of the stretch
+  % we need before each entry, but it's better.
+  %
+  % No shrink because it confuses \balancecolumns.
+  \vskip 1.67\baselineskip plus .5\baselineskip
+  \leftline{\secbf #1}%
+  % Do our best not to break after the initial.
+  \nobreak
+  \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin.  It is used for index
+% and table of contents entries.  The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+%	\def\entry#1#2{...
+% But this frozes the catcodes in the argument, and can cause problems to
+% @code, which sets - active.  This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+%
+% The right solution is to prevent \entry from swallowing the whole text.
+%                                 --kasal, 21nov03
+\def\entry{%
+  \begingroup
+    %
+    % Start a new paragraph if necessary, so our assignments below can't
+    % affect previous text.
+    \par
+    %
+    % Do not fill out the last line with white space.
+    \parfillskip = 0in
+    %
+    % No extra space above this paragraph.
+    \parskip = 0in
+    %
+    % Do not prefer a separate line ending with a hyphen to fewer lines.
+    \finalhyphendemerits = 0
+    %
+    % \hangindent is only relevant when the entry text and page number
+    % don't both fit on one line.  In that case, bob suggests starting the
+    % dots pretty far over on the line.  Unfortunately, a large
+    % indentation looks wrong when the entry text itself is broken across
+    % lines.  So we use a small indentation and put up with long leaders.
+    %
+    % \hangafter is reset to 1 (which is the value we want) at the start
+    % of each paragraph, so we need not do anything with that.
+    \hangindent = 2em
+    %
+    % When the entry text needs to be broken, just fill out the first line
+    % with blank space.
+    \rightskip = 0pt plus1fil
+    %
+    % A bit of stretch before each entry for the benefit of balancing
+    % columns.
+    \vskip 0pt plus1pt
+    %
+    % Swallow the left brace of the text (first parameter):
+    \afterassignment\doentry
+    \let\temp =
+}
+\def\doentry{%
+    \bgroup % Instead of the swallowed brace.
+      \noindent
+      \aftergroup\finishentry
+      % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+    % #1 is the page number.
+    %
+    % The following is kludged to not output a line of dots in the index if
+    % there are no page numbers.  The next person who breaks this will be
+    % cursed by a Unix daemon.
+    \def\tempa{{\rm }}%
+    \def\tempb{#1}%
+    \edef\tempc{\tempa}%
+    \edef\tempd{\tempb}%
+    \ifx\tempc\tempd
+      \ %
+    \else
+      %
+      % If we must, put the page number on a line of its own, and fill out
+      % this line with blank space.  (The \hfil is overwhelmed with the
+      % fill leaders glue in \indexdotfill if the page number does fit.)
+      \hfil\penalty50
+      \null\nobreak\indexdotfill % Have leaders before the page number.
+      %
+      % The `\ ' here is removed by the implicit \unskip that TeX does as
+      % part of (the primitive) \par.  Without it, a spurious underfull
+      % \hbox ensues.
+      \ifpdf
+	\pdfgettoks#1.%
+	\ \the\toksA
+      \else
+	\ #1%
+      \fi
+    \fi
+    \par
+  \endgroup
+}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+  \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+  \parfillskip=0in
+  \parskip=0in
+  \hangindent=1in
+  \hangafter=1
+  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+  \ifpdf
+    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+  \else
+    #2
+  \fi
+  \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+  % Grab any single-column material above us.
+  \output = {%
+    %
+    % Here is a possibility not foreseen in manmac: if we accumulate a
+    % whole lot of material, we might end up calling this \output
+    % routine twice in a row (see the doublecol-lose test, which is
+    % essentially a couple of indexes with @setchapternewpage off).  In
+    % that case we just ship out what is in \partialpage with the normal
+    % output routine.  Generally, \partialpage will be empty when this
+    % runs and this will be a no-op.  See the indexspread.tex test case.
+    \ifvoid\partialpage \else
+      \onepageout{\pagecontents\partialpage}%
+    \fi
+    %
+    \global\setbox\partialpage = \vbox{%
+      % Unvbox the main output page.
+      \unvbox\PAGE
+      \kern-\topskip \kern\baselineskip
+    }%
+  }%
+  \eject % run that output routine to set \partialpage
+  %
+  % Use the double-column output routine for subsequent pages.
+  \output = {\doublecolumnout}%
+  %
+  % Change the page size parameters.  We could do this once outside this
+  % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+  % format, but then we repeat the same computation.  Repeating a couple
+  % of assignments once per index is clearly meaningless for the
+  % execution time, so we may as well do it in one place.
+  %
+  % First we halve the line length, less a little for the gutter between
+  % the columns.  We compute the gutter based on the line length, so it
+  % changes automatically with the paper format.  The magic constant
+  % below is chosen so that the gutter has the same value (well, +-<1pt)
+  % as it did when we hard-coded it.
+  %
+  % We put the result in a separate register, \doublecolumhsize, so we
+  % can restore it in \pagesofar, after \hsize itself has (potentially)
+  % been clobbered.
+  %
+  \doublecolumnhsize = \hsize
+    \advance\doublecolumnhsize by -.04154\hsize
+    \divide\doublecolumnhsize by 2
+  \hsize = \doublecolumnhsize
+  %
+  % Double the \vsize as well.  (We don't need a separate register here,
+  % since nobody clobbers \vsize.)
+  \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+  \splittopskip=\topskip \splitmaxdepth=\maxdepth
+  % Get the available space for the double columns -- the normal
+  % (undoubled) page height minus any material left over from the
+  % previous page.
+  \dimen@ = \vsize
+  \divide\dimen@ by 2
+  \advance\dimen@ by -\ht\partialpage
+  %
+  % box0 will be the left-hand column, box2 the right.
+  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+  \onepageout\pagesofar
+  \unvbox255
+  \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+  \unvbox\partialpage
+  %
+  \hsize = \doublecolumnhsize
+  \wd0=\hsize \wd2=\hsize
+  \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+  \output = {%
+    % Split the last of the double-column material.  Leave it on the
+    % current page, no automatic page break.
+    \balancecolumns
+    %
+    % If we end up splitting too much material for the current page,
+    % though, there will be another page break right after this \output
+    % invocation ends.  Having called \balancecolumns once, we do not
+    % want to call it again.  Therefore, reset \output to its normal
+    % definition right away.  (We hope \balancecolumns will never be
+    % called on to balance too much material, but if it is, this makes
+    % the output somewhat more palatable.)
+    \global\output = {\onepageout{\pagecontents\PAGE}}%
+  }%
+  \eject
+  \endgroup % started in \begindoublecolumns
+  %
+  % \pagegoal was set to the doubled \vsize above, since we restarted
+  % the current page.  We're now back to normal single-column
+  % typesetting, so reset \pagegoal to the normal \vsize (after the
+  % \endgroup where \vsize got restored).
+  \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+  \dimen@ = \ht0
+  \advance\dimen@ by \topskip
+  \advance\dimen@ by-\baselineskip
+  \divide\dimen@ by 2 % target to split to
+  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+  \splittopskip = \topskip
+  % Loop until we get a decent breakpoint.
+  {%
+    \vbadness = 10000
+    \loop
+      \global\setbox3 = \copy0
+      \global\setbox1 = \vsplit3 to \dimen@
+    \ifdim\ht3>\dimen@
+      \global\advance\dimen@ by 1pt
+    \repeat
+  }%
+  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+  \setbox0=\vbox to\dimen@{\unvbox1}%
+  \setbox2=\vbox to\dimen@{\unvbox3}%
+  %
+  \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number".  We avoid collisions with chapter
+% numbers by starting them at 10000.  (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno        \secno=0
+\newcount\subsecno     \subsecno=0
+\newcount\subsubsecno  \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno  \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+  \ifnum\appendixno=`A A%
+  \else\ifnum\appendixno=`B B%
+  \else\ifnum\appendixno=`C C%
+  \else\ifnum\appendixno=`D D%
+  \else\ifnum\appendixno=`E E%
+  \else\ifnum\appendixno=`F F%
+  \else\ifnum\appendixno=`G G%
+  \else\ifnum\appendixno=`H H%
+  \else\ifnum\appendixno=`I I%
+  \else\ifnum\appendixno=`J J%
+  \else\ifnum\appendixno=`K K%
+  \else\ifnum\appendixno=`L L%
+  \else\ifnum\appendixno=`M M%
+  \else\ifnum\appendixno=`N N%
+  \else\ifnum\appendixno=`O O%
+  \else\ifnum\appendixno=`P P%
+  \else\ifnum\appendixno=`Q Q%
+  \else\ifnum\appendixno=`R R%
+  \else\ifnum\appendixno=`S S%
+  \else\ifnum\appendixno=`T T%
+  \else\ifnum\appendixno=`U U%
+  \else\ifnum\appendixno=`V V%
+  \else\ifnum\appendixno=`W W%
+  \else\ifnum\appendixno=`X X%
+  \else\ifnum\appendixno=`Y Y%
+  \else\ifnum\appendixno=`Z Z%
+  % The \the is necessary, despite appearances, because \appendixletter is
+  % expanded while writing the .toc file.  \char\appendixno is not
+  % expandable, thus it is written literally, thus all appendixes come out
+  % with the same letter (or @) in the toc without it.
+  \else\char\the\appendixno
+  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it.  @section does likewise.
+% However, they are not reliable, because we don't use marks.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achive this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unmlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+  % Compute the abs. sec. level:
+  \absseclevel=#2
+  \advance\absseclevel by \secbase
+  % Make sure \absseclevel doesn't fall outside the range:
+  \ifnum \absseclevel < 0
+    \absseclevel = 0
+  \else
+    \ifnum \absseclevel > 3
+      \absseclevel = 3
+    \fi
+  \fi
+  % The heading type:
+  \def\headtype{#1}%
+  \if \headtype U%
+    \ifnum \absseclevel < \unmlevel
+      \chardef\unmlevel = \absseclevel
+    \fi
+  \else
+    % Check for appendix sections:
+    \ifnum \absseclevel = 0
+      \edef\chapheadtype{\headtype}%
+    \else
+      \if \headtype A\if \chapheadtype N%
+	\errmessage{@appendix... within a non-appendix chapter}%
+      \fi\fi
+    \fi
+    % Check for numbered within unnumbered:
+    \ifnum \absseclevel > \unmlevel
+      \def\headtype{U}%
+    \else
+      \chardef\unmlevel = 3
+    \fi
+  \fi
+  % Now print the heading:
+  \if \headtype U%
+    \ifcase\absseclevel
+	\unnumberedzzz{#3}%
+    \or \unnumberedseczzz{#3}%
+    \or \unnumberedsubseczzz{#3}%
+    \or \unnumberedsubsubseczzz{#3}%
+    \fi
+  \else
+    \if \headtype A%
+      \ifcase\absseclevel
+	  \appendixzzz{#3}%
+      \or \appendixsectionzzz{#3}%
+      \or \appendixsubseczzz{#3}%
+      \or \appendixsubsubseczzz{#3}%
+      \fi
+    \else
+      \ifcase\absseclevel
+	  \chapterzzz{#3}%
+      \or \seczzz{#3}%
+      \or \numberedsubseczzz{#3}%
+      \or \numberedsubsubseczzz{#3}%
+      \fi
+    \fi
+  \fi
+  \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered.  Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v.  By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+  % section resetting is \global in case the chapter is in a group, such
+  % as an @include file.
+  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+    \global\advance\chapno by 1
+  %
+  % Used for \float.
+  \gdef\chaplevelprefix{\the\chapno.}%
+  \resetallfloatnos
+  %
+  \message{\putwordChapter\space \the\chapno}%
+  %
+  % Write the actual heading.
+  \chapmacro{#1}{Ynumbered}{\the\chapno}%
+  %
+  % So @section and the like are numbered underneath this chapter.
+  \global\let\section = \numberedsec
+  \global\let\subsection = \numberedsubsec
+  \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz#1{%
+  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+    \global\advance\appendixno by 1
+  \gdef\chaplevelprefix{\appendixletter.}%
+  \resetallfloatnos
+  %
+  \def\appendixnum{\putwordAppendix\space \appendixletter}%
+  \message{\appendixnum}%
+  %
+  \chapmacro{#1}{Yappendix}{\appendixletter}%
+  %
+  \global\let\section = \appendixsec
+  \global\let\subsection = \appendixsubsec
+  \global\let\subsubsection = \appendixsubsubsec
+}
+
+\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz#1{%
+  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+    \global\advance\unnumberedno by 1
+  %
+  % Since an unnumbered has no number, no prefix for figures.
+  \global\let\chaplevelprefix = \empty
+  \resetallfloatnos
+  %
+  % This used to be simply \message{#1}, but TeX fully expands the
+  % argument to \message.  Therefore, if #1 contained @-commands, TeX
+  % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
+  % expanded @cite (which turns out to cause errors because \cite is meant
+  % to be executed, not expanded).
+  %
+  % Anyway, we don't want the fully-expanded definition of @cite to appear
+  % as a result of the \message, we just want `@cite' itself.  We use
+  % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+  % simply yielding the contents of <toks register>.  (We also do this for
+  % the toc entries.)
+  \toks0 = {#1}%
+  \message{(\the\toks0)}%
+  %
+  \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+  %
+  \global\let\section = \unnumberedsec
+  \global\let\subsection = \unnumberedsubsec
+  \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+  % Well, we could do the following in a group, but that would break
+  % an assumption that \chapmacro is called at the outermost level.
+  % Thus we are safer this way:		--kasal, 24feb04
+  \let\centerparametersmaybe = \centerparameters
+  \unnmhead0{#1}%
+  \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
+  \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz#1{%
+  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
+  \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz#1{%
+  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
+  \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz#1{%
+  \global\subsubsecno=0  \global\advance\subsecno by 1
+  \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz#1{%
+  \global\subsubsecno=0  \global\advance\subsecno by 1
+  \sectionheading{#1}{subsec}{Yappendix}%
+                 {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz#1{%
+  \global\subsubsecno=0  \global\advance\subsecno by 1
+  \sectionheading{#1}{subsec}{Ynothing}%
+                 {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz#1{%
+  \global\advance\subsubsecno by 1
+  \sectionheading{#1}{subsubsec}{Ynumbered}%
+                 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz#1{%
+  \global\advance\subsubsecno by 1
+  \sectionheading{#1}{subsubsec}{Yappendix}%
+                 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz#1{%
+  \global\advance\subsubsecno by 1
+  \sectionheading{#1}{subsubsec}{Ynothing}%
+                 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+%       1) We use \vbox rather than the earlier \line to permit
+%          overlong headings to fold.
+%       2) \hyphenpenalty is set to 10000 because hyphenation in a
+%          heading is obnoxious; this forbids it.
+%       3) Likewise, headings look best if no \parindent is used, and
+%          if justification is not attempted.  Hence \raggedright.
+
+
+\def\majorheading{%
+  {\advance\chapheadingskip by 10pt \chapbreak }%
+  \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                    \parindent=0pt\raggedright
+                    \rm #1\hfill}}%
+  \bigskip \par\penalty 200\relax
+  \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+  \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+  \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+  \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+  \pchapsepmacro
+  {%
+    \chapfonts \rm
+    %
+    % Have to define \thissection before calling \donoderef, because the
+    % xref code eventually uses it.  On the other hand, it has to be called
+    % after \pchapsepmacro, or the headline will change too soon.
+    \gdef\thissection{#1}%
+    \gdef\thischaptername{#1}%
+    %
+    % Only insert the separating space if we have a chapter/appendix
+    % number, and don't print the unnumbered ``number''.
+    \def\temptype{#2}%
+    \ifx\temptype\Ynothingkeyword
+      \setbox0 = \hbox{}%
+      \def\toctype{unnchap}%
+      \gdef\thischapter{#1}%
+    \else\ifx\temptype\Yomitfromtockeyword
+      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+      \def\toctype{omit}%
+      \gdef\thischapter{}%
+    \else\ifx\temptype\Yappendixkeyword
+      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+      \def\toctype{app}%
+      % We don't substitute the actual chapter name into \thischapter
+      % because we don't want its macros evaluated now.  And we don't
+      % use \thissection because that changes with each section.
+      %
+      \xdef\thischapter{\putwordAppendix{} \appendixletter:
+                        \noexpand\thischaptername}%
+    \else
+      \setbox0 = \hbox{#3\enspace}%
+      \def\toctype{numchap}%
+      \xdef\thischapter{\putwordChapter{} \the\chapno:
+                        \noexpand\thischaptername}%
+    \fi\fi\fi
+    %
+    % Write the toc entry for this chapter.  Must come before the
+    % \donoderef, because we include the current node name in the toc
+    % entry, and \donoderef resets it to empty.
+    \writetocentry{\toctype}{#1}{#3}%
+    %
+    % For pdftex, we have to write out the node definition (aka, make
+    % the pdfdest) after any page break, but before the actual text has
+    % been typeset.  If the destination for the pdf outline is after the
+    % text, then jumping from the outline may wind up with the text not
+    % being visible, for instance under high magnification.
+    \donoderef{#2}%
+    %
+    % Typeset the actual heading.
+    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+          \hangindent=\wd0 \centerparametersmaybe
+          \unhbox0 #1\par}%
+  }%
+  \nobreak\bigskip % no page break after a chapter title
+  \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+  \advance\rightskip by 3\rightskip
+  \leftskip = \rightskip
+  \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                       \parindent=0pt\raggedright
+                       \rm #1\hfill}}\bigskip \par\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+                       \parindent=0pt
+                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+\def\CHAPFopen{%
+  \global\let\chapmacro=\chfopen
+  \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.  These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\sectionheading#1#2#3#4{%
+  {%
+    % Switch to the right set of fonts.
+    \csname #2fonts\endcsname \rm
+    %
+    % Insert space above the heading.
+    \csname #2headingbreak\endcsname
+    %
+    % Only insert the space after the number if we have a section number.
+    \def\sectionlevel{#2}%
+    \def\temptype{#3}%
+    %
+    \ifx\temptype\Ynothingkeyword
+      \setbox0 = \hbox{}%
+      \def\toctype{unn}%
+      \gdef\thissection{#1}%
+    \else\ifx\temptype\Yomitfromtockeyword
+      % for @headings -- no section number, don't include in toc,
+      % and don't redefine \thissection.
+      \setbox0 = \hbox{}%
+      \def\toctype{omit}%
+      \let\sectionlevel=\empty
+    \else\ifx\temptype\Yappendixkeyword
+      \setbox0 = \hbox{#4\enspace}%
+      \def\toctype{app}%
+      \gdef\thissection{#1}%
+    \else
+      \setbox0 = \hbox{#4\enspace}%
+      \def\toctype{num}%
+      \gdef\thissection{#1}%
+    \fi\fi\fi
+    %
+    % Write the toc entry (before \donoderef).  See comments in \chfplain.
+    \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+    %
+    % Write the node reference (= pdf destination for pdftex).
+    % Again, see comments in \chfplain.
+    \donoderef{#3}%
+    %
+    % Output the actual section heading.
+    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+          \hangindent=\wd0  % zero if no section number
+          \unhbox0 #1}%
+  }%
+  % Add extra space after the heading -- half of whatever came above it.
+  % Don't allow stretch, though.
+  \kern .5 \csname #2headingskip\endcsname
+  %
+  % Do not let the kern be a potential breakpoint, as it would be if it
+  % was followed by glue.
+  \nobreak
+  %
+  % We'll almost certainly start a paragraph next, so don't let that
+  % glue accumulate.  (Not a breakpoint because it's preceded by a
+  % discardable item.)
+  \vskip-\parskip
+  % 
+  % This is purely so the last item on the list is a known \penalty >
+  % 10000.  This is so \startdefun can avoid allowing breakpoints after
+  % section headings.  Otherwise, it would insert a valid breakpoint between:
+  % 
+  %   @section sec-whatever
+  %   @deffn def-whatever
+  \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this.  The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything.  This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+  \edef\writetoctype{#1}%
+  \ifx\writetoctype\omitkeyword \else
+    \iftocfileopened\else
+      \immediate\openout\tocfile = \jobname.toc
+      \global\tocfileopenedtrue
+    \fi
+    %
+    \iflinks
+      {\atdummies
+       \edef\temp{%
+         \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+       \temp
+      }
+    \fi
+  \fi
+  %
+  % Tell \shipout to create a pdf destination on each page, if we're
+  % writing pdf.  These are used in the table of contents.  We can't
+  % just write one on every page because the title pages are numbered
+  % 1 and 2 (the page numbers aren't printed), and so are the first
+  % two pages of the document.  Thus, we'd have two destinations named
+  % `1', and two named `2'.
+  \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care.  This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+% 
+\def\activecatcodes{%
+  \catcode`\"=\active
+  \catcode`\$=\active
+  \catcode`\<=\active
+  \catcode`\>=\active
+  \catcode`\\=\active
+  \catcode`\^=\active
+  \catcode`\_=\active
+  \catcode`\|=\active
+  \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+  \setupdatafile
+  \activecatcodes
+  \input \jobname.toc
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+  % If @setchapternewpage on, and @headings double, the contents should
+  % start on an odd page, unlike chapters.  Thus, we maintain
+  % \contentsalignmacro in parallel with \pagealignmacro.
+  % From: Torbjorn Granlund <tege@matematik.su.se>
+  \contentsalignmacro
+  \immediate\closeout\tocfile
+  %
+  % Don't need to put `Contents' or `Short Contents' in the headline.
+  % It is abundantly clear what they are.
+  \def\thischapter{}%
+  \chapmacro{#1}{Yomitfromtoc}{}%
+  %
+  \savepageno = \pageno
+  \begingroup                  % Set up to handle contents files properly.
+    \raggedbottom              % Worry more about breakpoints than the bottom.
+    \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+    %
+    % Roman numerals for page numbers.
+    \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+  \startcontents{\putwordTOC}%
+    \openin 1 \jobname.toc
+    \ifeof 1 \else
+      \readtocfile
+    \fi
+    \vfill \eject
+    \contentsalignmacro % in case @setchapternewpage odd is in effect
+    \ifeof 1 \else
+      \pdfmakeoutlines
+    \fi
+    \closein 1
+  \endgroup
+  \lastnegativepageno = \pageno
+  \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+  \startcontents{\putwordShortTOC}%
+    %
+    \let\numchapentry = \shortchapentry
+    \let\appentry = \shortchapentry
+    \let\unnchapentry = \shortunnchapentry
+    % We want a true roman here for the page numbers.
+    \secfonts
+    \let\rm=\shortcontrm \let\bf=\shortcontbf
+    \let\sl=\shortcontsl \let\tt=\shortconttt
+    \rm
+    \hyphenpenalty = 10000
+    \advance\baselineskip by 1pt % Open it up a little.
+    \def\numsecentry##1##2##3##4{}
+    \let\appsecentry = \numsecentry
+    \let\unnsecentry = \numsecentry
+    \let\numsubsecentry = \numsecentry
+    \let\appsubsecentry = \numsecentry
+    \let\unnsubsecentry = \numsecentry
+    \let\numsubsubsecentry = \numsecentry
+    \let\appsubsubsecentry = \numsecentry
+    \let\unnsubsubsecentry = \numsecentry
+    \openin 1 \jobname.toc
+    \ifeof 1 \else
+      \readtocfile
+    \fi
+    \closein 1
+    \vfill \eject
+    \contentsalignmacro % in case @setchapternewpage odd is in effect
+  \endgroup
+  \lastnegativepageno = \pageno
+  \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+  % This space should be enough, since a single number is .5em, and the
+  % widest letter (M) is 1em, at least in the Computer Modern fonts.
+  % But use \hss just in case.
+  % (This space doesn't include the extra space that gets added after
+  % the label; that gets put in by \shortchapentry above.)
+  %
+  % We'd like to right-justify chapter numbers, but that looks strange
+  % with appendix letters.  And right-justifying numbers and
+  % left-justifying letters looks strange when there is less than 10
+  % chapters.  Have to read the whole toc once to know how many chapters
+  % there are before deciding ...
+  \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+  % We use M since it's probably the widest letter.
+  \setbox0 = \hbox{\putwordAppendix{} M}%
+  \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+   \begingroup
+     \chapentryfonts
+     \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+   \endgroup
+   \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+  \secentryfonts \leftskip=\tocindent
+  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+  \subsecentryfonts \leftskip=2\tocindent
+  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+  \subsubsecentryfonts \leftskip=3\tocindent
+  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+   \advance\hsize by -2\dimen2 % Rules.
+   \vbox{%
+      \hrule height\dimen2
+      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
+         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+         \kern3pt\vrule width\dimen2}% Space to right.
+      \hrule height\dimen2}
+    \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex    escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\envdef\tex{%
+  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+  \catcode `\%=14
+  \catcode `\+=\other
+  \catcode `\"=\other
+  \catcode `\|=\other
+  \catcode `\<=\other
+  \catcode `\>=\other
+  \escapechar=`\\
+  %
+  \let\b=\ptexb
+  \let\bullet=\ptexbullet
+  \let\c=\ptexc
+  \let\,=\ptexcomma
+  \let\.=\ptexdot
+  \let\dots=\ptexdots
+  \let\equiv=\ptexequiv
+  \let\!=\ptexexclam
+  \let\i=\ptexi
+  \let\indent=\ptexindent
+  \let\noindent=\ptexnoindent
+  \let\{=\ptexlbrace
+  \let\+=\tabalign
+  \let\}=\ptexrbrace
+  \let\/=\ptexslash
+  \let\*=\ptexstar
+  \let\t=\ptext
+  \let\frenchspacing=\plainfrenchspacing
+  %
+  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+  \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments.  \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical.  We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+  % =10000 instead of <10000 because of a special case in \itemzzz and
+  % \sectionheading, q.v.
+  \ifnum \lastpenalty=10000 \else
+    \advance\envskipamount by \parskip
+    \endgraf
+    \ifdim\lastskip<\envskipamount
+      \removelastskip
+      % it's not a good place to break if the last penalty was \nobreak
+      % or better ...
+      \ifnum\lastpenalty<10000 \penalty-50 \fi
+      \vskip\envskipamount
+    \fi
+  \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+        \ctl\leaders\hrule height\circthick\hfil\ctr
+        \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+        \cbl\leaders\hrule height\circthick\hfil\cbr
+        \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+  \ifhmode\par\fi  % can't be in the midst of a paragraph.
+  \startsavinginserts
+  \lskip=\leftskip \rskip=\rightskip
+  \leftskip=0pt\rightskip=0pt % we want these *outside*.
+  \cartinner=\hsize \advance\cartinner by-\lskip
+  \advance\cartinner by-\rskip
+  \cartouter=\hsize
+  \advance\cartouter by 18.4pt	% allow for 3pt kerns on either
+				% side, and for 6pt waste from
+				% each corner char, and rule thickness
+  \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+  % Flag to tell @lisp, etc., not to narrow margin.
+  \let\nonarrowing = t%
+  \vbox\bgroup
+      \baselineskip=0pt\parskip=0pt\lineskip=0pt
+      \carttop
+      \hbox\bgroup
+	  \hskip\lskip
+	  \vrule\kern3pt
+	  \vbox\bgroup
+	      \kern3pt
+	      \hsize=\cartinner
+	      \baselineskip=\normbskip
+	      \lineskip=\normlskip
+	      \parskip=\normpskip
+	      \vskip -\parskip
+	      \comment % For explanation, see the end of \def\group.
+}
+\def\Ecartouche{%
+              \ifhmode\par\fi
+	      \kern3pt
+	  \egroup
+	  \kern3pt\vrule
+	  \hskip\rskip
+      \egroup
+      \cartbot
+  \egroup
+  \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+  \aboveenvbreak
+  \hfuzz = 12pt % Don't be fussy
+  \sepspaces % Make spaces be word-separators rather than space tokens.
+  \let\par = \lisppar % don't ignore blank lines
+  \obeylines % each line of input is a line of output
+  \parskip = 0pt
+  \parindent = 0pt
+  \emergencystretch = 0pt % don't try to avoid overfull boxes
+  \ifx\nonarrowing\relax
+    \advance \leftskip by \lispnarrowing
+    \exdentamount=\lispnarrowing
+  \else
+    \let\nonarrowing = \relax
+  \fi
+  \let\exdent=\nofillexdent
+}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+%    @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+  \ifx\SETdispenvsize\smallword
+    \smallexamplefonts \rm
+  \fi
+}
+\def\setsmalldispenv{%
+  \ifx\SETdispenvsize\nosmallword
+  \else
+    \smallexamplefonts \rm
+  \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it by one command:
+\def\makedispenv #1#2{
+  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
+  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+  \expandafter\let\csname E#1\endcsname \afterenvbreak
+  \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two synonyms:
+\def\maketwodispenvs #1#2#3{
+  \makedispenv{#1}{#3}
+  \makedispenv{#2}{#3}
+}
+
+% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvs {lisp}{example}{%
+  \nonfillstart
+  \tt
+  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+  \gobble       % eat return
+}
+
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenv {display}{%
+  \nonfillstart
+  \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenv{format}{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \advance\leftskip by 0pt plus 1fill
+  \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.  We keep \parskip nonzero in general, since
+% we're doing normal filling.  So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\envdef\quotation{%
+  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+  \parindent=0pt
+  %
+  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \ifx\nonarrowing\relax
+    \advance\leftskip by \lispnarrowing
+    \advance\rightskip by \lispnarrowing
+    \exdentamount = \lispnarrowing
+  \else
+    \let\nonarrowing = \relax
+  \fi
+  \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+  \par
+  \ifx\quotationauthor\undefined\else
+    % indent a bit.
+    \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+  \fi
+  {\parskip=0pt \afterenvbreak}%
+}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+  \def\temp{#1}%
+  \ifx\temp\empty \else
+    {\bf #1: }%
+  \fi
+}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too.  Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+  \do\ \do\\\do\{\do\}\do\$\do\&%
+  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+  \do\<\do\>\do\|\do\@\do+\do\"%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+  \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% [Knuth] pp. 380,381,391
+% Disable Spanish ligatures ?` and !` of \tt font
+\begingroup
+  \catcode`\`=\active\gdef`{\relax\lq}
+\endgroup
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+  \catcode`\^^I=\active
+  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+  \tt  % easiest (and conventionally used) font for verbatim
+  \def\par{\leavevmode\endgraf}%
+  \catcode`\`=\active
+  \tabeightspaces
+  % Respect line breaks,
+  % print special symbols as themselves, and
+  % make each space count
+  % must do in this order:
+  \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+\begingroup
+  \catcode`\^^I=\active
+  \gdef\tabexpand{%
+    \catcode`\^^I=\active
+    \def^^I{\leavevmode\egroup
+      \dimen0=\wd0 % the width so far, or since the previous tab
+      \divide\dimen0 by\tabw
+      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
+      \wd0=\dimen0 \box0 \starttabbox
+    }%
+  }
+\endgroup
+\def\setupverbatim{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  % Easiest (and conventionally used) font for verbatim
+  \tt
+  \def\par{\leavevmode\egroup\box0\endgraf}%
+  \catcode`\`=\active
+  \tabexpand
+  % Respect line breaks,
+  % print special symbols as themselves, and
+  % make each space count
+  % must do in this order:
+  \obeylines \uncatcodespecials \sepspaces
+  \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters.  Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+%    \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+  \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+%     \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+  \catcode`\ =\active
+  \obeylines %
+  % ignore everything up to the first ^^M, that's the newline at the end
+  % of the @verbatim input line itself.  Otherwise we get an extra blank
+  % line in the output.
+  \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+  % We really want {...\end verbatim} in the body of the macro, but
+  % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+    \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+  {%
+    \makevalueexpandable
+    \setupverbatim
+    \input #1
+    \afterenvbreak
+  }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+  \begingroup
+    \parindent = 0pt  % paragraph indentation looks wrong on title page
+    \scanexp\copyingtext
+  \endgroup
+}
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+% Start the processing of @deffn:
+\def\startdefun{%
+  \ifnum\lastpenalty<10000
+    \medbreak
+  \else
+    % If there are two @def commands in a row, we'll have a \nobreak,
+    % which is there to keep the function description together with its
+    % header.  But if there's nothing but headers, we need to allow a
+    % break somewhere.  Check specifically for penalty 10002, inserted
+    % by \defargscommonending, instead of 10000, since the sectioning
+    % commands also insert a nobreak penalty, and we don't want to allow
+    % a break between a section heading and a defun.
+    % 
+    \ifnum\lastpenalty=10002 \penalty2000 \fi
+    %
+    % Similarly, after a section heading, do not allow a break.
+    % But do insert the glue.
+    \medskip  % preceded by discardable penalty, so not a breakpoint
+  \fi
+  %
+  \parindent=0in
+  \advance\leftskip by \defbodyindent
+  \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+  % First, check whether we are in the right environment:
+  \checkenv#1%
+  %
+  % As above, allow line break if we have multiple x headers in a row.
+  % It's not a great place, though.
+  \ifnum\lastpenalty=10002 \penalty3000 \fi
+  %
+  % And now, it's time to reuse the body of the original defun:
+  \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+  \begingroup
+    % call \deffnheader:
+    #1#2 \endheader
+    % common ending:
+    \interlinepenalty = 10000
+    \advance\rightskip by 0pt plus 1fil
+    \endgraf
+    \nobreak\vskip -\parskip
+    \penalty 10002  % signal to \startdefun and \dodefunx
+    % Some of the @defun-type tags do not enable magic parentheses,
+    % rendering the following check redundant.  But we don't optimize.
+    \checkparencounts
+  \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remainnig is to define \deffnheader.
+%
+\def\makedefun#1{%
+  \expandafter\let\csname E#1\endcsname = \Edefun
+  \edef\temp{\noexpand\domakedefun
+    \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+  \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+  \envdef#1{%
+    \startdefun
+    \parseargusing\activeparens{\printdefunline#3}%
+  }%
+  \def#2{\dodefunx#1}%
+  \def#3%
+}
+
+%%% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+  % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+  \dosubind{fn}{\code{#3}}{#1}%
+  \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+%%% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+  \dosubind{fn}{\code{#4}}{#1}%
+  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+  \dosubind{vr}{\code{#4}}{#1}%
+  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+%%% Type:
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+  \doind{tp}{\code{#2}}%
+  \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+  % Get the values of \leftskip and \rightskip as they were outside the @def...
+  \advance\leftskip by -\defbodyindent
+  %
+  % How we'll format the type name.  Putting it in brackets helps
+  % distinguish it from the body text that may end up on the next line
+  % just below it.
+  \def\temp{#1}%
+  \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+  %
+  % Figure out line sizes for the paragraph shape.
+  % The first line needs space for \box0; but if \rightskip is nonzero,
+  % we need only space for the part of \box0 which exceeds it:
+  \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
+  % The continuations:
+  \dimen2=\hsize  \advance\dimen2 by -\defargsindent
+  % (plain.tex says that \dimen1 should be used only as global.)
+  \parshape 2 0in \dimen0 \defargsindent \dimen2
+  %
+  % Put the type name to the right margin.
+  \noindent
+  \hbox to 0pt{%
+    \hfil\box0 \kern-\hsize
+    % \hsize has to be shortened this way:
+    \kern\leftskip
+    % Intentionally do not respect \rightskip, since we need the space.
+  }%
+  %
+  % Allow all lines to be underfull without complaint:
+  \tolerance=10000 \hbadness=10000
+  \exdentamount=\defbodyindent
+  {%
+    % defun fonts. We use typewriter by default (used to be bold) because:
+    % . we're printing identifiers, they should be in tt in principle.
+    % . in languages with many accents, such as Czech or French, it's
+    %   common to leave accents off identifiers.  The result looks ok in
+    %   tt, but exceedingly strange in rm.
+    % . we don't want -- and --- to be treated as ligatures.
+    % . this still does not fix the ?` and !` ligatures, but so far no
+    %   one has made identifiers using them :).
+    \df \tt
+    \def\temp{#2}% return value type
+    \ifx\temp\empty\else \tclose{\temp} \fi
+    #3% output function name
+  }%
+  {\rm\enskip}% hskip 0.5 em of \tenrm
+  %
+  \boldbrax
+  % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name.  This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable.  Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+  % use sl by default (not ttsl),
+  % tt for the names.
+  \df \sl \hyphenchar\font=0
+  %
+  % On the other hand, if an argument has two dashes (for instance), we
+  % want a way to get ttsl.  Let's try @var for that.
+  \let\var=\ttslanted
+  #1%
+  \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+  \catcode`\(=\active \catcode`\)=\active
+  \catcode`\[=\active \catcode`\]=\active
+  \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc.  For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+  \activeparens
+  \global\let(=\lparen \global\let)=\rparen
+  \global\let[=\lbrack \global\let]=\rbrack
+  \global\let& = \&
+
+  \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+  \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+  \ifampseen
+    % At the first level, print parens in roman,
+    % otherwise use the default font.
+    \ifnum \parencount=1 \rm \fi
+  \else
+    % The \sf parens (in \boldbrax) actually are a little bolder than
+    % the contained text.  This is especially needed for [ and ] .
+    \sf
+  \fi
+}
+\def\infirstlevel#1{%
+  \ifampseen
+    \ifnum\parencount=1
+      #1%
+    \fi
+  \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+  \global\advance\parencount by 1
+  {\parenfont(}%
+  \infirstlevel \bfafterword
+}
+\def\clnr{%
+  {\parenfont)}%
+  \infirstlevel \sl
+  \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+  \global\advance\brackcount by 1
+  {\bf[}%
+}
+\def\rbrb{%
+  {\bf]}%
+  \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+  \ifnum\parencount=0 \else \badparencount \fi
+  \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+\def\badparencount{%
+  \errmessage{Unbalanced parentheses in @def}%
+  \global\parencount=0
+}
+\def\badbrackcount{%
+  \errmessage{Unbalanced square braces in @def}%
+  \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+  \newwrite\macscribble
+  \def\scantokens#1{%
+    \toks0={#1}%
+    \immediate\openout\macscribble=\jobname.tmp
+    \immediate\write\macscribble{\the\toks0}%
+    \immediate\closeout\macscribble
+    \input \jobname.tmp
+  }
+\fi
+
+\def\scanmacro#1{%
+  \begingroup
+    \newlinechar`\^^M
+    \let\xeatspaces\eatspaces
+    % Undo catcode changes of \startcontents and \doprintindex
+    % When called from @insertcopying or (short)caption, we need active
+    % backslash to get it printed correctly.  Previously, we had
+    % \catcode`\\=\other instead.  We'll see whether a problem appears
+    % with macro expansion.				--kasal, 19aug04
+    \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+    % ... and \example
+    \spaceisspace
+    %
+    % Append \endinput to make sure that TeX does not see the ending newline.
+    %
+    % I've verified that it is necessary both for e-TeX and for ordinary TeX
+    %							--kasal, 29nov03
+    \scantokens{#1\endinput}%
+  \endgroup
+}
+
+\def\scanexp#1{%
+  \edef\temp{\noexpand\scanmacro{#1}}%
+  \temp
+}
+
+\newcount\paramno   % Count of parameters
+\newtoks\macname    % Macro name
+\newif\ifrecursive  % Is it recursive?
+
+% List of all defined macros in the form
+%    \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+     \toks0 = \expandafter{\macrolist\definedummyword#1}%
+     \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+%   \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+% 
+\def\cslet#1#2{%
+  \expandafter\let
+  \csname#1\expandafter\endcsname
+  \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\scanctxt{%
+  \catcode`\"=\other
+  \catcode`\+=\other
+  \catcode`\<=\other
+  \catcode`\>=\other
+  \catcode`\@=\other
+  \catcode`\^=\other
+  \catcode`\_=\other
+  \catcode`\|=\other
+  \catcode`\~=\other
+}
+
+\def\scanargctxt{%
+  \scanctxt
+  \catcode`\\=\other
+  \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{%
+  \scanctxt
+  \catcode`\{=\other
+  \catcode`\}=\other
+  \catcode`\^^M=\other
+  \usembodybackslash
+}
+
+\def\macroargctxt{%
+  \scanctxt
+  \catcode`\\=\other
+}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+  \getargs{#1}%           now \macname is the macname and \argl the arglist
+  \ifx\argl\empty       % no arguments
+     \paramno=0%
+  \else
+     \expandafter\parsemargdef \argl;%
+  \fi
+  \if1\csname ismacro.\the\macname\endcsname
+     \message{Warning: redefining \the\macname}%
+  \else
+     \expandafter\ifx\csname \the\macname\endcsname \relax
+     \else \errmessage{Macro name \the\macname\space already defined}\fi
+     \global\cslet{macsave.\the\macname}{\the\macname}%
+     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+     \addtomacrolist{\the\macname}%
+  \fi
+  \begingroup \macrobodyctxt
+  \ifrecursive \expandafter\parsermacbody
+  \else \expandafter\parsemacbody
+  \fi}
+
+\parseargdef\unmacro{%
+  \if1\csname ismacro.#1\endcsname
+    \global\cslet{#1}{macsave.#1}%
+    \global\expandafter\let \csname ismacro.#1\endcsname=0%
+    % Remove the macro name from \macrolist:
+    \begingroup
+      \expandafter\let\csname#1\endcsname \relax
+      \let\definedummyword\unmacrodo
+      \xdef\macrolist{\macrolist}%
+    \endgroup
+  \else
+    \errmessage{Macro #1 not defined}%
+  \fi
+}
+
+% Called by \do from \dounmacro on each macro.  The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+  \ifx #1\relax
+    % remove this
+  \else
+    \noexpand\definedummyword \noexpand#1%
+  \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list.  Set up \paramno and \paramlist
+% so \defmacro knows what to do.  Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX:  let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+  \if#1;\let\next=\relax
+  \else \let\next=\parsemargdefxxx
+    \advance\paramno by 1%
+    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+        {\xeatspaces{\hash\the\paramno}}%
+    \edef\paramlist{\paramlist\hash\the\paramno,}%
+  \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+  \let\hash=##% convert placeholders to macro parameter chars
+  \ifrecursive
+    \ifcase\paramno
+    % 0
+      \expandafter\xdef\csname\the\macname\endcsname{%
+        \noexpand\scanmacro{\temp}}%
+    \or % 1
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \bgroup\noexpand\macroargctxt
+         \noexpand\braceorline
+         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+         \egroup\noexpand\scanmacro{\temp}}%
+    \else % many
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \bgroup\noexpand\macroargctxt
+         \noexpand\csname\the\macname xx\endcsname}%
+      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+      \expandafter\expandafter
+      \expandafter\xdef
+      \expandafter\expandafter
+        \csname\the\macname xxx\endcsname
+          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+    \fi
+  \else
+    \ifcase\paramno
+    % 0
+      \expandafter\xdef\csname\the\macname\endcsname{%
+        \noexpand\norecurse{\the\macname}%
+        \noexpand\scanmacro{\temp}\egroup}%
+    \or % 1
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \bgroup\noexpand\macroargctxt
+         \noexpand\braceorline
+         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+        \egroup
+        \noexpand\norecurse{\the\macname}%
+        \noexpand\scanmacro{\temp}\egroup}%
+    \else % many
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \bgroup\noexpand\macroargctxt
+         \expandafter\noexpand\csname\the\macname xx\endcsname}%
+      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+      \expandafter\expandafter
+      \expandafter\xdef
+      \expandafter\expandafter
+      \csname\the\macname xxx\endcsname
+      \paramlist{%
+          \egroup
+          \noexpand\norecurse{\the\macname}%
+          \noexpand\scanmacro{\temp}\egroup}%
+    \fi
+  \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {.  If so it reads up to the closing }, if not, it reads the whole
+% line.  Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+  \ifx\nchar\bgroup\else
+    \expandafter\parsearg
+  \fi \next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign.  Just make them active and then expand them all to nothing.
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+  {%
+    \expandafter\let\obeyedspace=\empty
+    \addtomacrolist{#1}%
+    \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+  }%
+  \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs    % True if xref values are known.
+\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+  node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references.  The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross,  ,  , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node.  #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+  \ifx\lastnode\empty\else
+    \setref{\lastnode}{#1}%
+    \global\let\lastnode=\empty
+  \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \thissection,
+%                 or the anchor name.
+% 2) NAME-snt   - section number and type, passed as the SNT arg, or
+%                 empty for anchors.
+% 3) NAME-pg    - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat.  In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof   - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+  \pdfmkdest{#1}%
+  \iflinks
+    {%
+      \atdummies  % preserve commands, but don't expand them
+      \edef\writexrdef##1##2{%
+	\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+	  ##1}{##2}}% these are parameters of \writexrdef
+      }%
+      \toks0 = \expandafter{\thissection}%
+      \immediate \writexrdef{title}{\the\toks0 }%
+      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+      \writexrdef{pg}{\folio}% will be written later, during \shipout
+    }%
+  \fi
+}
+
+% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual.  All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+  \unsepspaces
+  \def\printedmanual{\ignorespaces #5}%
+  \def\printedrefname{\ignorespaces #3}%
+  \setbox1=\hbox{\printedmanual\unskip}%
+  \setbox0=\hbox{\printedrefname\unskip}%
+  \ifdim \wd0 = 0pt
+    % No printed node name was explicitly given.
+    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+      % Use the node name inside the square brackets.
+      \def\printedrefname{\ignorespaces #1}%
+    \else
+      % Use the actual chapter/section title appear inside
+      % the square brackets.  Use the real section title if we have it.
+      \ifdim \wd1 > 0pt
+        % It is in another manual, so we don't have it.
+        \def\printedrefname{\ignorespaces #1}%
+      \else
+        \ifhavexrefs
+          % We know the real title if we have the xref values.
+          \def\printedrefname{\refx{#1-title}{}}%
+        \else
+          % Otherwise just copy the Info node name.
+          \def\printedrefname{\ignorespaces #1}%
+        \fi%
+      \fi
+    \fi
+  \fi
+  %
+  % Make link in pdf output.
+  \ifpdf
+    \leavevmode
+    \getfilename{#4}%
+    {\turnoffactive
+     % See comments at \activebackslashdouble.
+     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
+      \backslashparens\pdfxrefdest}%
+     %
+     \ifnum\filenamelength>0
+       \startlink attr{/Border [0 0 0]}%
+         goto file{\the\filename.pdf} name{\pdfxrefdest}%
+     \else
+       \startlink attr{/Border [0 0 0]}%
+         goto name{\pdfmkpgn{\pdfxrefdest}}%
+     \fi
+    }%
+    \linkcolor
+  \fi
+  %
+  % Float references are printed completely differently: "Figure 1.2"
+  % instead of "[somenode], p.3".  We distinguish them by the
+  % LABEL-title being set to a magic string.
+  {%
+    % Have to otherify everything special to allow the \csname to
+    % include an _ in the xref name, etc.
+    \indexnofonts
+    \turnoffactive
+    \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+      \csname XR#1-title\endcsname
+  }%
+  \iffloat\Xthisreftitle
+    % If the user specified the print name (third arg) to the ref,
+    % print it instead of our usual "Figure 1.2".
+    \ifdim\wd0 = 0pt
+      \refx{#1-snt}%
+    \else
+      \printedrefname
+    \fi
+    %
+    % if the user also gave the printed manual name (fifth arg), append
+    % "in MANUALNAME".
+    \ifdim \wd1 > 0pt
+      \space \putwordin{} \cite{\printedmanual}%
+    \fi
+  \else
+    % node/anchor (non-float) references.
+    %
+    % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+    % insert empty discretionaries after hyphens, which means that it will
+    % not find a line break at a hyphen in a node names.  Since some manuals
+    % are best written with fairly long node names, containing hyphens, this
+    % is a loss.  Therefore, we give the text of the node name again, so it
+    % is as if TeX is seeing it for the first time.
+    \ifdim \wd1 > 0pt
+      \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
+    \else
+      % _ (for example) has to be the character _ for the purposes of the
+      % control sequence corresponding to the node, but it has to expand
+      % into the usual \leavevmode...\vrule stuff for purposes of
+      % printing. So we \turnoffactive for the \refx-snt, back on for the
+      % printing, back off for the \refx-pg.
+      {\turnoffactive
+       % Only output a following space if the -snt ref is nonempty; for
+       % @unnumbered and @anchor, it won't be.
+       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+      }%
+      % output the `[mynode]' via a macro so it can be overridden.
+      \xrefprintnodename\printedrefname
+      %
+      % But we always want a comma and a space:
+      ,\space
+      %
+      % output the `page 3'.
+      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+    \fi
+  \fi
+  \endlink
+\endgroup}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output.  It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents.  Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+  \ifnum\secno=0
+    \putwordChapter@tie \the\chapno
+  \else \ifnum\subsecno=0
+    \putwordSection@tie \the\chapno.\the\secno
+  \else \ifnum\subsubsecno=0
+    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+  \else
+    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+  \fi\fi\fi
+}
+\def\Yappendix{%
+  \ifnum\secno=0
+     \putwordAppendix@tie @char\the\appendixno{}%
+  \else \ifnum\subsecno=0
+     \putwordSection@tie @char\the\appendixno.\the\secno
+  \else \ifnum\subsubsecno=0
+    \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+  \else
+    \putwordSection@tie
+      @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+  \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+  {%
+    \indexnofonts
+    \otherbackslash
+    \expandafter\global\expandafter\let\expandafter\thisrefX
+      \csname XR#1\endcsname
+  }%
+  \ifx\thisrefX\relax
+    % If not defined, say something at least.
+    \angleleft un\-de\-fined\angleright
+    \iflinks
+      \ifhavexrefs
+        \message{\linenumber Undefined cross reference `#1'.}%
+      \else
+        \ifwarnedxrefs\else
+          \global\warnedxrefstrue
+          \message{Cross reference values unknown; you must run TeX again.}%
+        \fi
+      \fi
+    \fi
+  \else
+    % It's defined, so just use it.
+    \thisrefX
+  \fi
+  #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.  Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions).  But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+  \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value.
+  %
+  % Was that xref control sequence that we just defined for a float?
+  \expandafter\iffloat\csname XR#1\endcsname
+    % it was a float, and we have the (safe) float type in \iffloattype.
+    \expandafter\let\expandafter\floatlist
+      \csname floatlist\iffloattype\endcsname
+    %
+    % Is this the first time we've seen this float type?
+    \expandafter\ifx\floatlist\relax
+      \toks0 = {\do}% yes, so just \do
+    \else
+      % had it before, so preserve previous elements in list.
+      \toks0 = \expandafter{\floatlist\do}%
+    \fi
+    %
+    % Remember this xref in the control sequence \floatlistFLOATTYPE,
+    % for later use in \listoffloats.
+    \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}%
+  \fi
+}
+
+% Read the last existing aux file, if any.  No error if none exists.
+%
+\def\tryauxfile{%
+  \openin 1 \jobname.aux
+  \ifeof 1 \else
+    \readdatafile{aux}%
+    \global\havexrefstrue
+  \fi
+  \closein 1
+}
+
+\def\setupdatafile{%
+  \catcode`\^^@=\other
+  \catcode`\^^A=\other
+  \catcode`\^^B=\other
+  \catcode`\^^C=\other
+  \catcode`\^^D=\other
+  \catcode`\^^E=\other
+  \catcode`\^^F=\other
+  \catcode`\^^G=\other
+  \catcode`\^^H=\other
+  \catcode`\^^K=\other
+  \catcode`\^^L=\other
+  \catcode`\^^N=\other
+  \catcode`\^^P=\other
+  \catcode`\^^Q=\other
+  \catcode`\^^R=\other
+  \catcode`\^^S=\other
+  \catcode`\^^T=\other
+  \catcode`\^^U=\other
+  \catcode`\^^V=\other
+  \catcode`\^^W=\other
+  \catcode`\^^X=\other
+  \catcode`\^^Z=\other
+  \catcode`\^^[=\other
+  \catcode`\^^\=\other
+  \catcode`\^^]=\other
+  \catcode`\^^^=\other
+  \catcode`\^^_=\other
+  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
+  % supported in the main text, it doesn't seem desirable.  Furthermore,
+  % that is not enough: for node names that actually contain a ^
+  % character, we would end up writing a line like this: 'xrdef {'hat
+  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+  % argument, and \hat is not an expandable control sequence.  It could
+  % all be worked out, but why?  Either we support ^^ or we don't.
+  %
+  % The other change necessary for this was to define \auxhat:
+  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+  % and then to call \auxhat in \setq.
+  %
+  \catcode`\^=\other
+  %
+  % Special characters.  Should be turned off anyway, but...
+  \catcode`\~=\other
+  \catcode`\[=\other
+  \catcode`\]=\other
+  \catcode`\"=\other
+  \catcode`\_=\other
+  \catcode`\|=\other
+  \catcode`\<=\other
+  \catcode`\>=\other
+  \catcode`\$=\other
+  \catcode`\#=\other
+  \catcode`\&=\other
+  \catcode`\%=\other
+  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+  %
+  % This is to support \ in node names and titles, since the \
+  % characters end up in a \csname.  It's easier than
+  % leaving it active and making its active definition an actual \
+  % character.  What I don't understand is why it works in the *value*
+  % of the xrdef.  Seems like it should be a catcode12 \, and that
+  % should not typeset properly.  But it works, so I'm moving on for
+  % now.  --karl, 15jan04.
+  \catcode`\\=\other
+  %
+  % Make the characters 128-255 be printing characters.
+  {%
+    \count1=128
+    \def\loop{%
+      \catcode\count1=\other
+      \advance\count1 by 1
+      \ifnum \count1<256 \loop \fi
+    }%
+  }%
+  %
+  % @ is our escape character in .aux files, and we need braces.
+  \catcode`\{=1
+  \catcode`\}=2
+  \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+  \setupdatafile
+  \input\jobname.#1
+\endgroup}
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes.  Otherwise like plain.
+\gdef\footnote{%
+  \let\indent=\ptexindent
+  \let\noindent=\ptexnoindent
+  \global\advance\footnoteno by \@ne
+  \edef\thisfootno{$^{\the\footnoteno}$}%
+  %
+  % In case the footnote comes at the end of a sentence, preserve the
+  % extra spacing after we do the footnote number.
+  \let\@sf\empty
+  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+  %
+  % Remove inadvertent blank space before typesetting the footnote number.
+  \unskip
+  \thisfootno\@sf
+  \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter.  Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read.  --karl, 16nov96.
+%
+\gdef\dofootnote{%
+  \insert\footins\bgroup
+  % We want to typeset this text as a normal paragraph, even if the
+  % footnote reference occurs in (for example) a display environment.
+  % So reset some parameters.
+  \hsize=\pagewidth
+  \interlinepenalty\interfootnotelinepenalty
+  \splittopskip\ht\strutbox % top baseline for broken footnotes
+  \splitmaxdepth\dp\strutbox
+  \floatingpenalty\@MM
+  \leftskip\z@skip
+  \rightskip\z@skip
+  \spaceskip\z@skip
+  \xspaceskip\z@skip
+  \parindent\defaultparindent
+  %
+  \smallfonts \rm
+  %
+  % Because we use hanging indentation in footnotes, a @noindent appears
+  % to exdent this text, so make it be a no-op.  makeinfo does not use
+  % hanging indentation so @noindent can still be needed within footnote
+  % text after an @example or the like (not that this is good style).
+  \let\noindent = \relax
+  %
+  % Hang the footnote text off the number.  Use \everypar in case the
+  % footnote extends for more than one paragraph.
+  \everypar = {\hang}%
+  \textindent{\thisfootno}%
+  %
+  % Don't crash into the line above the footnote text.  Since this
+  % expands into a box, it must come within the paragraph, lest it
+  % provide a place where TeX can split the footnote.
+  \footstrut
+  \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished.  Otherwise, the insertion
+% would be lost.
+% Similarily, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes.  --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+  \ifx \insert\ptexinsert
+    \let\insert\saveinsert
+  \else
+    \let\checkinserts\relax
+  \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+  \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+  \afterassignment\next
+  % swallow the left brace
+  \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+  \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+    {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+  \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials  %  ;-)
+  \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+  \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+  \next
+}
+\def\newsaveinsX #1{%
+  \csname newbox\endcsname #1%
+  \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+    \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image.  We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front.  If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+  % Do not bother showing banner with epsf.tex v2.7k (available in
+  % doc/epsf.tex and on ctan).
+  \def\epsfannounce{\toks0 = }%
+  \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+  work.  It is also included in the Texinfo distribution, or you can get
+  it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+  \ifx\epsfbox\undefined
+    \ifwarnednoepsf \else
+      \errhelp = \noepsfhelp
+      \errmessage{epsf.tex not found, images will be ignored}%
+      \global\warnednoepsftrue
+    \fi
+  \else
+    \imagexxx #1,,,,,\finish
+  \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing this stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+  \catcode`\^^M = 5     % in case we're inside an example
+  \normalturnoffactive  % allow _ et al. in names
+  % If the image is by itself, center it.
+  \ifvmode
+    \imagevmodetrue
+    \nobreak\bigskip
+    % Usually we'll have text after the image which will insert
+    % \parskip glue, so insert it here too to equalize the space
+    % above and below.
+    \nobreak\vskip\parskip
+    \nobreak
+    \line\bgroup\hss
+  \fi
+  %
+  % Output the image.
+  \ifpdf
+    \dopdfimage{#1}{#2}{#3}%
+  \else
+    % \epsfbox itself resets \epsf?size at each figure.
+    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+    \epsfbox{#1.eps}%
+  \fi
+  %
+  \ifimagevmode \hss \egroup \bigbreak \fi  % space after the image
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc.  We don't actually implement floating yet, we always include the
+% float "here".  But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc.  Can't contain commas.  If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label.  Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored.  It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+  \let\thiscaption=\empty
+  \let\thisshortcaption=\empty
+  %
+  % don't lose footnotes inside @float.
+  %
+  % BEWARE: when the floats start float, we have to issue warning whenever an
+  % insert appears inside a float which could possibly float. --kasal, 26may04
+  %
+  \startsavinginserts
+  %
+  % We can't be used inside a paragraph.
+  \par
+  %
+  \vtop\bgroup
+    \def\floattype{#1}%
+    \def\floatlabel{#2}%
+    \def\floatloc{#3}% we do nothing with this yet.
+    %
+    \ifx\floattype\empty
+      \let\safefloattype=\empty
+    \else
+      {%
+        % the floattype might have accents or other special characters,
+        % but we need to use it in a control sequence name.
+        \indexnofonts
+        \turnoffactive
+        \xdef\safefloattype{\floattype}%
+      }%
+    \fi
+    %
+    % If label is given but no type, we handle that as the empty type.
+    \ifx\floatlabel\empty \else
+      % We want each FLOATTYPE to be numbered separately (Figure 1,
+      % Table 1, Figure 2, ...).  (And if no label, no number.)
+      %
+      \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+      \global\advance\floatno by 1
+      %
+      {%
+        % This magic value for \thissection is output by \setref as the
+        % XREFLABEL-title value.  \xrefX uses it to distinguish float
+        % labels (which have a completely different output format) from
+        % node and anchor labels.  And \xrdef uses it to construct the
+        % lists of floats.
+        %
+        \edef\thissection{\floatmagic=\safefloattype}%
+        \setref{\floatlabel}{Yfloat}%
+      }%
+    \fi
+    %
+    % start with \parskip glue, I guess.
+    \vskip\parskip
+    %
+    % Don't suppress indentation if a float happens to start a section.
+    \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption:    Foo 1.1
+% @float Foo & @caption{Cap}:     Foo: Cap
+% @float Foo & no caption:        Foo
+% @float ,lbl & Caption{Cap}:     1.1: Cap
+% @float ,lbl & no caption:       1.1
+% @float & @caption{Cap}:         Cap
+% @float & no caption:
+%
+\def\Efloat{%
+    \let\floatident = \empty
+    %
+    % In all cases, if we have a float type, it comes first.
+    \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+    %
+    % If we have an xref label, the number comes next.
+    \ifx\floatlabel\empty \else
+      \ifx\floattype\empty \else % if also had float type, need tie first.
+        \appendtomacro\floatident{\tie}%
+      \fi
+      % the number.
+      \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+    \fi
+    %
+    % Start the printed caption with what we've constructed in
+    % \floatident, but keep it separate; we need \floatident again.
+    \let\captionline = \floatident
+    %
+    \ifx\thiscaption\empty \else
+      \ifx\floatident\empty \else
+	\appendtomacro\captionline{: }% had ident, so need a colon between
+      \fi
+      %
+      % caption text.
+      \appendtomacro\captionline{\scanexp\thiscaption}%
+    \fi
+    %
+    % If we have anything to print, print it, with space before.
+    % Eventually this needs to become an \insert.
+    \ifx\captionline\empty \else
+      \vskip.5\parskip
+      \captionline
+      %
+      % Space below caption.
+      \vskip\parskip
+    \fi
+    %
+    % If have an xref label, write the list of floats info.  Do this
+    % after the caption, to avoid chance of it being a breakpoint.
+    \ifx\floatlabel\empty \else
+      % Write the text that goes in the lof to the aux file as
+      % \floatlabel-lof.  Besides \floatident, we include the short
+      % caption if specified, else the full caption if specified, else nothing.
+      {%
+        \atdummies
+        % since we read the caption text in the macro world, where ^^M
+        % is turned into a normal character, we have to scan it back, so
+        % we don't write the literal three characters "^^M" into the aux file.
+	\scanexp{%
+	  \xdef\noexpand\gtemp{%
+	    \ifx\thisshortcaption\empty
+	      \thiscaption
+	    \else
+	      \thisshortcaption
+	    \fi
+	  }%
+	}%
+        \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+	  \ifx\gtemp\empty \else : \gtemp \fi}}%
+      }%
+    \fi
+  \egroup  % end of \vtop
+  %
+  % place the captured inserts
+  %
+  % BEWARE: when the floats start float, we have to issue warning whenever an
+  % insert appears inside a float which could possibly float. --kasal, 26may04
+  %
+  \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+  \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use.  Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+  \ifx#1\relax
+      % Haven't seen this figure type before.
+      \csname newcount\endcsname #1%
+      %
+      % Remember to reset this floatno at the next chap.
+      \expandafter\gdef\expandafter\resetallfloatnos
+        \expandafter{\resetallfloatnos #1=0 }%
+  \fi
+  \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value.  We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1".  We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref.  That is, the magic
+% \thissection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string.  If so, #2 will be the
+% (safe) float type for this float.  We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+  \def\temp{#1}%
+  \def\iffloattype{#2}%
+  \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+  \def\floattype{#1}% floattype
+  {%
+    % the floattype might have accents or other special characters,
+    % but we need to use it in a control sequence name.
+    \indexnofonts
+    \turnoffactive
+    \xdef\safefloattype{\floattype}%
+  }%
+  %
+  % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+  \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+    \ifhavexrefs
+      % if the user said @listoffloats foo but never @float foo.
+      \message{\linenumber No `\safefloattype' floats to list.}%
+    \fi
+  \else
+    \begingroup
+      \leftskip=\tocindent  % indent these entries like a toc
+      \let\do=\listoffloatsdo
+      \csname floatlist\safefloattype\endcsname
+    \endgroup
+  \fi
+}
+
+% This is called on each entry in a list of floats.  We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file.  We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+  % Can't fully expand XR#1-lof because it can contain anything.  Just
+  % pass the control sequence.  On the other hand, XR#1-pg is just the
+  % page number, and we want to fully expand that so we can get a link
+  % in pdf output.
+  \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+  %
+  % use the same \entry macro we use to generate the TOC and index.
+  \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+  \writeentry
+}}
+
+\message{localization,}
+% and i18n.
+
+% @documentlanguage is usually given very early, just after
+% @setfilename.  If done too late, it may not override everything
+% properly.  Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\parseargdef\documentlanguage{%
+  \tex % read txi-??.tex file in plain TeX.
+    % Read the file if it exists.
+    \openin 1 txi-#1.tex
+    \ifeof 1
+      \errhelp = \nolanghelp
+      \errmessage{Cannot read language file txi-#1.tex}%
+    \else
+      \input txi-#1.tex
+    \fi
+    \closein 1
+  \endgroup
+}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty.  Maybe you need to install it?  In the current directory
+should work if nowhere else does.}
+
+
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
+
+
+% Page size parameters.
+%
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything.  We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize.  We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+  \ifx\emergencystretch\thisisundefined
+    % Allow us to assign to \emergencystretch anyway.
+    \def\emergencystretch{\dimen0}%
+  \else
+    \emergencystretch = .15\hsize
+  \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading.  The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+  \voffset = #3\relax
+  \topskip = #6\relax
+  \splittopskip = \topskip
+  %
+  \vsize = #1\relax
+  \advance\vsize by \topskip
+  \outervsize = \vsize
+  \advance\outervsize by 2\topandbottommargin
+  \pageheight = \vsize
+  %
+  \hsize = #2\relax
+  \outerhsize = \hsize
+  \advance\outerhsize by 0.5in
+  \pagewidth = \hsize
+  %
+  \normaloffset = #4\relax
+  \bindingoffset = #5\relax
+  %
+  \ifpdf
+    \pdfpageheight #7\relax
+    \pdfpagewidth #8\relax
+  \fi
+  %
+  \setleading{\textleading}
+  %
+  \parindent = \defaultparindent
+  \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+  \parskip = 3pt plus 2pt minus 1pt
+  \textleading = 13.2pt
+  %
+  % If page is nothing but text, make it come out even.
+  \internalpagesizes{46\baselineskip}{6in}%
+                    {\voffset}{.25in}%
+                    {\bindingoffset}{36pt}%
+                    {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+  \parskip = 2pt plus 1pt
+  \textleading = 12pt
+  %
+  \internalpagesizes{7.5in}{5in}%
+                    {\voffset}{.25in}%
+                    {\bindingoffset}{16pt}%
+                    {9.25in}{7in}%
+  %
+  \lispnarrowing = 0.3in
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+  \parskip = 1.5pt plus 1pt
+  \textleading = 12pt
+  %
+  \internalpagesizes{7.4in}{4.8in}%
+                    {-.2in}{-.4in}%
+                    {0pt}{14pt}%
+                    {9in}{6in}%
+  %
+  \lispnarrowing = 0.25in
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+  \parskip = 3pt plus 2pt minus 1pt
+  \textleading = 13.2pt
+  %
+  % Double-side printing via postscript on Laserjet 4050
+  % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+  % To change the settings for a different printer or situation, adjust
+  % \normaloffset until the front-side and back-side texts align.  Then
+  % do the same for \bindingoffset.  You can set these for testing in
+  % your texinfo source file like this:
+  % @tex
+  % \global\normaloffset = -6mm
+  % \global\bindingoffset = 10mm
+  % @end tex
+  \internalpagesizes{51\baselineskip}{160mm}
+                    {\voffset}{\hoffset}%
+                    {\bindingoffset}{44pt}%
+                    {297mm}{210mm}%
+  %
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+  \parskip = 2pt plus 1pt minus 0.1pt
+  \textleading = 12.5pt
+  %
+  \internalpagesizes{160mm}{120mm}%
+                    {\voffset}{\hoffset}%
+                    {\bindingoffset}{8pt}%
+                    {210mm}{148mm}%
+  %
+  \lispnarrowing = 0.2in
+  \tolerance = 800
+  \hfuzz = 1.2pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = 2mm
+  \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+  \afourpaper
+  \internalpagesizes{237mm}{150mm}%
+                    {\voffset}{4.6mm}%
+                    {\bindingoffset}{7mm}%
+                    {297mm}{210mm}%
+  %
+  % Must explicitly reset to 0 because we call \afourpaper.
+  \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+  \afourpaper
+  \internalpagesizes{241mm}{165mm}%
+                    {\voffset}{-2.95mm}%
+                    {\bindingoffset}{7mm}%
+                    {297mm}{210mm}%
+  \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+  \globaldefs = 1
+  %
+  \parskip = 3pt plus 2pt minus 1pt
+  \setleading{\textleading}%
+  %
+  \dimen0 = #1
+  \advance\dimen0 by \voffset
+  %
+  \dimen2 = \hsize
+  \advance\dimen2 by \normaloffset
+  %
+  \internalpagesizes{#1}{\hsize}%
+                    {\voffset}{\normaloffset}%
+                    {\bindingoffset}{44pt}%
+                    {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}%$ font-lock fix
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise.  Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font.  Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts.  But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
+
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
+{\catcode`\\=\active
+ @gdef@rawbackslash{@let\=@backslashcurfont}
+ @gdef@otherbackslash{@let\=@realbackslash}
+}
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\backslashcurfont}}
+
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{%
+  @let"=@normaldoublequote
+  @let\=@realbackslash
+  @let~=@normaltilde
+  @let^=@normalcaret
+  @let_=@normalunderscore
+  @let|=@normalverticalbar
+  @let<=@normalless
+  @let>=@normalgreater
+  @let+=@normalplus
+  @let$=@normaldollar %$ font-lock fix
+  @unsepspaces
+}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'.  (Thus, \ is not expandable when this is in
+% effect.)
+%
+@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+  @ifx\@eatinput @let\ = @normalbackslash @fi
+  @catcode`+=@active
+  @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+   arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
diff --git a/util-linux-ng-2.17.2/configure b/util-linux-ng-2.17.2/configure
new file mode 100755
index 0000000..9b49cbb
--- /dev/null
+++ b/util-linux-ng-2.17.2/configure
Binary files differ
diff --git a/util-linux-ng-2.17.2/configure.ac b/util-linux-ng-2.17.2/configure.ac
new file mode 100644
index 0000000..1f824f4
--- /dev/null
+++ b/util-linux-ng-2.17.2/configure.ac
@@ -0,0 +1,1052 @@
+AC_INIT(util-linux-ng, 2.17.2, kzak@redhat.com)
+
+AC_PREREQ(2.60)
+
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([check-news -Wall foreign 1.9 dist-bzip2])
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+                            [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+
+AC_CONFIG_SRCDIR(mount/mount.c)
+
+AC_PREFIX_DEFAULT([/usr])
+
+dnl version details from <major>.<minor>[-<suffix>]
+PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
+PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
+                                              | awk -F- '{print $1}')
+PACKAGE_VERSION_RELEASE=0
+
+dnl libblkid version
+LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
+LIBBLKID_DATE="22-Mar-2010"
+LIBBLKID_LT_MAJOR=1
+LIBBLKID_LT_MINOR=1
+LIBBLKID_LT_MICRO=0
+LIBBLKID_VERSION_INFO=`expr $LIBBLKID_LT_MAJOR + $LIBBLKID_LT_MINOR`:$LIBBLKID_LT_MICRO:$LIBBLKID_LT_MINOR
+
+dnl libuuid version
+LIBUUID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
+LIBUUID_LT_MAJOR=1
+LIBUUID_LT_MINOR=3
+LIBUUID_LT_MICRO=0
+LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR
+
+# Check whether exec_prefix=/usr:
+case $exec_prefix:$prefix in
+NONE:NONE | NONE:/usr | /usr:*)
+  AC_MSG_NOTICE([Default --exec-prefix detected.])
+  case $bindir in
+  '${exec_prefix}/bin') bindir=/bin
+    AC_MSG_NOTICE([  --bindir defaults to /bin]) ;;
+  esac
+  case $sbindir in
+  '${exec_prefix}/sbin') sbindir=/sbin
+    AC_MSG_NOTICE([  --sbindir defaults to /sbin]) ;;
+  esac
+  case $libdir in
+  '${exec_prefix}/lib') libdir=/lib
+    AC_MSG_NOTICE([  --libdir defaults to /lib]) ;;
+  esac ;;
+esac
+
+libdirname=`basename "$libdir"`
+AC_SUBST([libdirname])
+
+# The original default values of {bin,sbin,lib}dir
+usrbin_execdir='${exec_prefix}/bin'
+AC_SUBST([usrbin_execdir])
+
+usrsbin_execdir='${exec_prefix}/sbin'
+AC_SUBST([usrsbin_execdir])
+
+usrlib_execdir='${exec_prefix}/'$libdirname
+AC_SUBST([usrlib_execdir])
+
+
+AC_PROG_CC_STDC
+AC_GNU_SOURCE
+AC_CANONICAL_HOST
+AC_C_CONST
+AC_C_VOLATILE
+AC_C_BIGENDIAN
+
+dnl libtool-2
+LT_INIT
+
+PKG_PROG_PKG_CONFIG
+
+GTK_DOC_CHECK([1.10])
+AC_PATH_PROG([XSLTPROC], [xsltproc])
+
+linux_os=no
+case ${host_os} in
+  *linux*)
+    linux_os=yes
+    ;;
+esac
+AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes)
+
+AC_PATH_PROG(PERL, perl)
+
+AC_SYS_LARGEFILE
+
+AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
+#ifdef HAVE_LINUX_COMPILER_H
+#include <linux/compiler.h>
+#endif
+])
+AC_CHECK_HEADERS(
+	[err.h \
+	errno.h \
+	getopt.h \
+	langinfo.h \
+	linux/fd.h \
+	linux/tiocl.h \
+	linux/version.h \
+	locale.h \
+	stdint.h \
+	inttypes.h \
+	pty.h \
+	mntent.h \
+        net/if.h \
+	net/if_dl.h \
+        netinet/in.h \
+	rpcsvc/nfs_prot.h \
+	stdlib.h \
+	sys/disk.h \
+	sys/disklabel.h \
+	sys/ioctl.h \
+	sys/io.h \
+	sys/time.h \
+	sys/mkdev.h \
+	sys/prctl.h \
+	sys/queue.h \
+	sys/sockio.h \
+	sys/socket.h \
+	sys/syscall.h \
+	sys/file.h \
+	sys/ioctl.h \
+	sys/stat.h \
+	sys/types.h \
+	sys/un.h \
+	sys/user.h \
+	sys/resource.h \
+	unistd.h ])
+AC_CHECK_HEADERS([linux/raw.h],
+		 [AM_CONDITIONAL([HAVE_RAW], [true])],
+		 [AM_CONDITIONAL([HAVE_RAW], [false])])
+
+AC_CHECK_DECLS([_NL_TIME_WEEK_1STDAY],[],[],[[#include <langinfo.h>]])
+
+AC_CHECK_DECL([llseek],
+	[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
+			[Define to 1 if have llseek prototype])],
+	[],
+	[#include <unistd.h>])
+
+AC_CHECK_DECL([lseek64],
+	[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
+			[Define to 1 if have lseek64 prototype])],
+	[],
+	[#define _LARGEFILE_SOURCE
+	 #define _LARGEFILE64_SOURCE
+	 #include <unistd.h>])
+
+AC_CHECK_FUNCS(
+	[inet_aton \
+	futimens \
+	fstat64 \
+	fsync \
+	getdomainname \
+	get_current_dir_name \
+	usleep \
+	nanosleep \
+	personality \
+	updwtmp \
+	jrand48 \
+	lchown \
+	llseek \
+	lseek64 \
+	strtoull \
+	sysconf \
+	getdtablesize \
+	getrlimit \
+	srandom \
+	setresgid \
+	setresuid \
+	inotify_init \
+	prctl \
+	posix_fadvise \
+	getmntinfo \
+	__secure_getenv \
+	rpmatch])
+AC_FUNC_FSEEKO
+
+AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
+
+AC_CHECK_MEMBER(struct sockaddr.sa_len,
+		AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
+	[#include <sys/types.h>
+	 #include <sys/socket.h>])
+
+dnl Static compilation
+m4_define([UTIL_STATIC_PROGRAMS], [losetup, mount, umount, fdisk, sfdisk, blkid])
+
+AC_ARG_ENABLE([static-programs],
+  [AS_HELP_STRING([--enable-static-programs=LIST],
+      [link static the programs in LIST (comma-separated,
+      supported for ]m4_defn([UTIL_STATIC_PROGRAMS])[)])])
+
+case $enable_static_programs in
+yes) enable_static_programs=m4_quote(UTIL_STATIC_PROGRAMS) ;;
+no) enable_static_programs= ;;
+esac
+
+dnl Set all the individual AM_CONDITIONALs
+m4_foreach([UTIL_PRG], m4_defn([UTIL_STATIC_PROGRAMS]), [
+  case ,$enable_static_programs, in
+   *,UTIL_PRG,*) static_[]UTIL_PRG=yes ;;
+  esac
+  AM_CONDITIONAL([HAVE_STATIC_]m4_toupper(UTIL_PRG),
+    [test "x$static_[]UTIL_PRG" = xyes])
+])
+
+dnl UTIL_PKG_STATIC(VARIABLE, MODULES)
+dnl ----------------------------------
+AC_DEFUN([UTIL_PKG_STATIC], [
+  if AC_RUN_LOG([pkg-config --exists --print-errors "$2"]); then
+    $1=`pkg-config --libs --static "$2"`
+  else
+    AC_MSG_ERROR([pkg-config description of $2, needed for static build, is not available])
+  fi
+])
+
+dnl UTIL_CHECK_LIB(LIBRARY, FUNCTION, [VARSUFFIX = $1]))
+dnl The VARSUFFIX is optional and overrides the default behaviour. For example:
+dnl     UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX
+dnl     UTIL_CHECK_LIB(yyy, func)      generates have_yyy and HAVE_LIBYYY
+dnl ---------------------------------
+AC_DEFUN([UTIL_CHECK_LIB], [
+  m4_define([suffix], m4_default([$3],$1))
+  [have_]suffix=yes
+  m4_ifdef([$3],
+    [AC_CHECK_LIB([$1], [$2], [AC_DEFINE(AS_TR_CPP([HAVE_LIB]suffix), 1)], [[have_]suffix=no])],
+    [AC_CHECK_LIB([$1], [$2], [], [[have_]suffix=no])])
+  AM_CONDITIONAL(AS_TR_CPP([HAVE_]suffix), [test [$have_]suffix = yes])
+])
+
+dnl UTIL_SET_FLAGS(CFLAGS, CPPFLAGS, LDFLAGS)
+AC_DEFUN([UTIL_SET_FLAGS], [
+  old_CFLAGS="$CFLAGS"
+  old_CPPFLAGS="$CPPFLAGS"
+  old_LDFLAGS="$LDFLAGS"
+  CFLAGS="$CFLAGS $1"
+  CPPFLAGS="$CPPFLAGS $2"
+  LDFLAGS="$LDFLAGS $3"
+])
+
+dnl UTIL_RESTORE_FLAGS()
+AC_DEFUN([UTIL_RESTORE_FLAGS], [
+  CFLAGS="$old_CFLAGS"
+  CPPFLAGS="$old_CPPFLAGS"
+  LDFLAGS="$old_LDFLAGS"
+])
+
+
+AX_CHECK_TLS
+
+AC_ARG_ENABLE([mount],
+  AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
+  [], enable_mount=check
+)
+build_mount=yes
+if test "x$enable_mount" = xcheck; then
+  if test "x$linux_os" = xno; then
+    AC_MSG_WARN([non-linux system; do not build mount utilities])
+    build_mount=no
+  fi
+elif test "x$enable_mount" = xno; then
+    build_mount=no
+fi
+AM_CONDITIONAL(BUILD_MOUNT, test "x$build_mount" = xyes)
+
+
+AC_ARG_ENABLE([fsck],
+  AS_HELP_STRING([--disable-fsck], [do not build fsck]),
+  [], enable_fsck=yes
+)
+AM_CONDITIONAL(BUILD_FSCK, test "x$enable_fsck" = xyes)
+
+
+AC_ARG_ENABLE([libuuid],
+  AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
+  [], enable_libuuid=yes
+)
+AC_SUBST([LIBUUID_VERSION])
+AC_SUBST([LIBUUID_VERSION_INFO])
+AM_CONDITIONAL(BUILD_LIBUUID, test "x$enable_libuuid" = xyes)
+have_uuid=yes
+
+if test "x$enable_libuuid" = xno; then
+  # Check for external (e2fsprogs) libuuid
+  PKG_CHECK_MODULES(UUID, uuid, [have_uuid=yes], [have_uuid=no])
+  if test "x$have_uuid" = xno; then
+    # system without pkg-config or so, try classic check
+    AC_CHECK_LIB(uuid, uuid_is_null, [have_uuid=yes], [have_uuid=no])
+  fi
+  if test "x$have_uuid" = xyes; then
+    UTIL_SET_FLAGS($UUID_CFLAGS, $UUID_CFLAGS, $UUID_LIBS)
+    AC_CHECK_HEADERS([uuid.h uuid/uuid.h], [break], [])
+    UTIL_RESTORE_FLAGS
+  fi
+else
+  # internal library
+  AC_DEFINE(HAVE_UUID_H, 1, [Define to 1 if you have the <uuid.h> header file.])
+fi
+
+if test "x$have_uuid" = xyes; then
+  AC_DEFINE(HAVE_LIBUUID, 1, [Define to 1 if you have the -luuid.])
+else
+  AC_MSG_WARN([uuid library is not found; mkswap(8) will not generate UUIDs])
+fi
+AM_CONDITIONAL(HAVE_UUID, test "x$have_uuid" = xyes)
+# default
+: ${UUID_LIBS='-luuid'}
+
+
+AC_ARG_ENABLE([uuidd],
+  AS_HELP_STRING([--disable-uuidd], [do not build the uuid daemon]),
+  [], enable_uuidd=auto
+)
+
+case "$enable_uuidd:$have_uuid" in
+yes:no)
+  AC_MSG_ERROR([cannot enable uuidd when libuuid is disabled]) ;;
+auto:*)
+  enable_uuidd=$have_uuid ;;
+esac
+if test "x$enable_uuidd" = xyes; then
+  AC_DEFINE(HAVE_UUIDD, 1, [Define to 1 if you want to use uuid daemon.])
+fi
+AM_CONDITIONAL(BUILD_UUIDD, test "x$enable_uuidd" = xyes)
+
+
+AC_ARG_ENABLE([libblkid],
+  AS_HELP_STRING([--disable-libblkid], [do not build libblkid and blkid utilities]),
+  [], enable_libblkid=yes
+)
+AC_SUBST([LIBBLKID_DATE])
+AC_SUBST([LIBBLKID_VERSION])
+AC_SUBST([LIBBLKID_VERSION_INFO])
+AM_CONDITIONAL(BUILD_LIBBLKID, test "x$enable_libblkid" = xyes)
+AC_DEFINE_UNQUOTED(LIBBLKID_VERSION, "$LIBBLKID_VERSION", [libblkid version string])
+AC_DEFINE_UNQUOTED(LIBBLKID_DATE, "$LIBBLKID_DATE", [libblkid date string])
+have_blkid=yes
+
+if test "x$enable_libblkid" = xno; then
+  if test "x$build_mount" = xyes || test "x$enable_fsck" = xyes; then
+    # Check for external (e2fsprogs) libblkid
+    PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [have_blkid=no])
+    if test "x$have_blkid" = xno; then
+      # system without pkg-config or so, try classic check
+      AC_CHECK_LIB(blkid, blkid_get_cache, [have_blkid=yes], [have_blkid=no])
+    fi
+    if test "x$have_blkid" = xyes; then
+      UTIL_SET_FLAGS($BLKID_CFLAGS, $BLKID_CFLAGS, $BLKID_LIBS)
+      AC_CHECK_HEADERS([blkid.h blkid/blkid.h], [break], [])
+      UTIL_RESTORE_FLAGS
+    fi
+    if test -n "$enable_static_programs"; then
+      # TODO check only when mount of fsck are requested
+      UTIL_PKG_STATIC([BLKID_LIBS_STATIC], [blkid])
+    fi
+  fi
+else
+  # internal library
+  AC_DEFINE(HAVE_BLKID_H, 1, [Define to 1 if you have the <blkid.h> header file.])
+  AC_DEFINE(HAVE_LIBBLKID_INTERNAL, 1, [Define to 1 if you have the in-tree libblkid.])
+fi
+
+if test "x$have_blkid" = xyes; then
+  AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.])
+else
+  if test "x$build_mount" = xyes; then
+    AC_MSG_ERROR([libblkid is needed to build util-linux-ng mount])
+  fi
+  if test "x$enable_fsck" = xyes; then
+    AC_MSG_ERROR([libblkid is needed to build util-linux-ng fsck])
+  fi
+fi
+AM_CONDITIONAL(HAVE_BLKID, test "x$have_blkid" = xyes)
+# default
+: ${BLKID_LIBS='-lblkid -luuid'}
+
+AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
+
+UTIL_CHECK_LIB(util, openpty)
+UTIL_CHECK_LIB(termcap, tgetnum)
+
+AM_GNU_GETTEXT_VERSION([0.14.1])
+AM_GNU_GETTEXT([external])
+if test -d "$srcdir/po"
+then
+    ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
+else
+    ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu"
+fi
+
+AC_ARG_WITH([ncurses],
+  AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
+                                    (--without-ncurses disables all ncurses(w) support)]),
+  [], with_ncurses=auto
+)
+AM_CONDITIONAL(HAVE_NCURSES, false)
+
+if test "x$with_ncurses" != xno; then
+  have_ncurses=no
+  AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
+    if test "x$with_ncurses" = xauto; then
+      UTIL_CHECK_LIB(ncursesw, initscr, ncurses)
+      if test "x$have_ncurses" = xyes; then
+        NCURSES_LIBS="-lncursesw"
+      fi
+    fi
+    if test "x$have_ncurses" = xno; then
+      UTIL_CHECK_LIB(ncurses, initscr)
+      if test "x$have_ncurses" = xyes; then
+        NCURSES_LIBS="-lncurses"
+      fi
+    fi
+  ])
+  if test "x$have_ncurses" = xno; then
+    AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
+  fi
+fi
+AC_SUBST([NCURSES_LIBS])
+
+
+AC_ARG_WITH([slang],
+  AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
+  [], with_slang=no
+)
+
+have_tinfo=no
+AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
+AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
+
+use_slang=no
+if test "x$with_slang" = xyes; then
+  AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], [use_slang=yes])
+  if test "x$use_slang" = xno; then
+    AC_MSG_ERROR([slang selected but slcurses.h not found])
+  fi
+fi
+AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
+
+
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#define _XOPEN_SOURCE
+#include <unistd.h>
+]], [[
+char *c = crypt("abc","pw");
+]])],[],[
+  LIBS="$LIBS -lcrypt"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+  #define _XOPEN_SOURCE
+  #include <unistd.h>
+  ]], [[
+  char *c = crypt("abc","pw");
+  ]])],[
+  AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
+  need_libcrypt=yes
+  ],[
+  AC_MSG_ERROR([crypt() is not available])
+  ])
+])
+
+AM_CONDITIONAL(NEED_LIBCRYPT, test "x$need_libcrypt" = xyes)
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+]], [[
+printf(__progname);
+]])],
+[AC_DEFINE(HAVE___PROGNAME, 1, Do we have __progname?)
+])
+
+
+AC_CHECK_TYPES([union semun], [], [], [[
+#include <sys/sem.h>
+]])
+
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <wchar.h>
+#include <wctype.h>
+#include <stdio.h>
+]], [[
+  wchar_t wc;
+  wint_t w;
+  w = fgetwc(stdin);
+  if (w == WEOF) exit(1);
+  wc = w;
+  fputwc(wc,stdout);
+]])],
+[AC_DEFINE(HAVE_WIDECHAR,1,Do we have wide character support?)
+])
+
+
+dnl UTIL_CHECK_SYSCALL(SYSCALL, FALLBACK, ...)
+dnl Only specify FALLBACK if the SYSCALL
+dnl you're checking for is a "newish" one
+dnl -------------------------------------
+AC_DEFUN([UTIL_CHECK_SYSCALL], [
+  dnl This macro uses host_cpu.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([for syscall $1],
+    [util_cv_syscall_$1],
+    [_UTIL_SYSCALL_CHECK_DECL([SYS_$1],
+      [syscall=SYS_$1],
+      [dnl Our libc failed use, so see if we can get the kernel
+      dnl headers to play ball ...
+      _UTIL_SYSCALL_CHECK_DECL([_NR_$1],
+	[syscall=_NR_$1],
+	[
+	  syscall=no
+	  if test "x$linux_os" = xyes; then
+	    case $host_cpu in
+	      _UTIL_CHECK_SYSCALL_FALLBACK(m4_shift($@))
+	    esac
+	  fi
+        ])
+      ])
+    util_cv_syscall_$1=$syscall
+    ])
+  AM_CONDITIONAL([HAVE_]m4_toupper($1), [test "x$util_cv_syscall_$1" != xno])
+  case $util_cv_syscall_$1 in #(
+  no) AC_MSG_WARN([Unable to detect syscall $1.]) ;;
+  SYS_*) ;;
+  *) AC_DEFINE_UNQUOTED([SYS_$1], [$util_cv_syscall_$1],
+	[Fallback syscall number for $1]) ;;
+  esac
+])
+
+dnl _UTIL_SYSCALL_CHECK_DECL(SYMBOL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+dnl Check if SYMBOL is declared, using the headers needed for syscall checks.
+dnl -------------------------------------
+m4_define([_UTIL_SYSCALL_CHECK_DECL],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/syscall.h>
+#include <unistd.h>
+]], [[int test = $1;]])],
+[$2], [$3])
+])
+
+dnl _UTIL_CHECK_SYSCALL_FALLBACK(PATTERN, VALUE, ...)
+dnl Helper macro to create the body for the above `case'.
+dnl -------------------------------------
+m4_define([_UTIL_CHECK_SYSCALL_FALLBACK],
+[m4_ifval([$1],
+  [#(
+  $1) syscall="$2" ;;dnl
+  _UTIL_CHECK_SYSCALL_FALLBACK(m4_shiftn(2, $@))])dnl
+])
+
+
+UTIL_CHECK_SYSCALL([pivot_root])
+UTIL_CHECK_SYSCALL([sched_getaffinity])
+UTIL_CHECK_SYSCALL([ioprio_set],
+  [alpha],    [442],
+  [i*86],     [289],
+  [ia64*],    [1274],
+  [powerpc*], [273],
+  [s390*],    [282],
+  [sparc*],   [196],
+  [sh*],      [288],
+  [x86_64*],  [251])
+UTIL_CHECK_SYSCALL([ioprio_get],
+  [alpha],    [443],
+  [i*86],     [290],
+  [ia64*],    [1275],
+  [powerpc*], [274],
+  [s390*],    [283],
+  [sparc*],   [218],
+  [sh*],      [289],
+  [x86_64*],  [252])
+
+dnl fallocate could be available as libc function or as syscall only
+UTIL_CHECK_SYSCALL([fallocate])
+AC_CHECK_FUNCS([fallocate])
+
+dnl unshare could be available as libc function or as syscall only
+UTIL_CHECK_SYSCALL([unshare])
+AC_CHECK_FUNCS([unshare])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <time.h>
+#include <unistd.h>
+]], [[
+    int a = 0;
+    struct tm *tm = localtime(0);
+    if (a == -1)  /* false */
+        sleep(tm->tm_gmtoff);
+]])],
+[AC_DEFINE(HAVE_TM_GMTOFF,1,[Does struct tm have a field tm_gmtoff?])
+])
+
+AC_CHECK_MEMBERS([struct termios.c_line],,,
+    [[#include <termios.h>]])
+
+AC_CHECK_DECLS([
+ ADDR_NO_RANDOMIZE,
+ FDPIC_FUNCPTRS,
+ MMAP_PAGE_ZERO,
+ ADDR_COMPAT_LAYOUT,
+ READ_IMPLIES_EXEC,
+ ADDR_LIMIT_32BIT,
+ WHOLE_SECONDS,
+ STICKY_TIMEOUTS,
+ ADDR_LIMIT_3GB], [], [], [#include <linux/personality.h>])
+
+AC_CHECK_HEADERS([sys/swap.h])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[
+#ifdef HAVE_SYS_SWAP_H
+# include <sys/swap.h>
+#endif
+#include <unistd.h>
+]],
+[[swapon("/dev/null", 0);]])],
+[AC_DEFINE(SWAPON_HAS_TWO_ARGS, 1, [Is swapon() declared with two parameters?])
+],
+[AC_MSG_NOTICE([Your libc thinks that swapon has 1 arg only.])
+])
+
+
+dnl UTIL_SET_ARCH(ARCHNAME, PATTERN)
+dnl ---------------------------------
+AC_DEFUN([UTIL_SET_ARCH], [
+  cpu_$1=false
+  case "$host" in
+   $2) cpu_$1=true ;;
+  esac
+  AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test "x$cpu_$1" = xtrue])
+])
+
+UTIL_SET_ARCH(I86, i?86-*)
+UTIL_SET_ARCH(86_64, x86_64*)
+UTIL_SET_ARCH(IA64, ia64*)
+UTIL_SET_ARCH(S390, s390*)
+UTIL_SET_ARCH(SPARC, sparc*)
+UTIL_SET_ARCH(PPC, ppc*|powerpc*)
+UTIL_SET_ARCH(M68K, m68*)
+UTIL_SET_ARCH(MIPS, mips*)
+UTIL_SET_ARCH(HPPA, hppa*)
+
+AC_ARG_ENABLE([arch],
+  AS_HELP_STRING([--enable-arch], [do build arch]),
+  [], enable_arch=no
+)
+AM_CONDITIONAL(BUILD_ARCH, test "x$enable_arch" = xyes)
+
+AC_ARG_ENABLE([agetty],
+  AS_HELP_STRING([--disable-agetty], [do not build agetty]),
+  [], enable_agetty=yes
+)
+AM_CONDITIONAL(BUILD_AGETTY, test "x$enable_agetty" = xyes)
+
+AC_ARG_ENABLE([cramfs],
+  AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]),
+  [], enable_cramfs=check
+)
+
+if test "x$enable_cramfs" = xno; then
+  build_cramfs=no
+else
+  build_cramfs=yes
+  dnl Trick: leave the third parameter empty to get the default action.
+  AC_CHECK_LIB(z, crc32, [], build_cramfs=no)
+  case $enable_cramfs:$build_cramfs in
+  yes:no) AC_MSG_ERROR([cramfs selected but libz not found]);;
+  esac
+fi
+AM_CONDITIONAL(BUILD_CRAMFS, test "x$build_cramfs" = xyes)
+
+
+AC_ARG_ENABLE([switch_root],
+  AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
+  [], enable_switch_root=check
+)
+if test "x$enable_switch_root" = xno; then
+  build_switch_root=no
+else
+  build_switch_root=yes
+  case $enable_switch_root:$linux_os in
+  yes:no) AC_MSG_ERROR([switch_root selected for non-linux system]);;
+  check:no) AC_MSG_WARN([non-linux system; do not build switch_root])
+            build_switch_root=no;;
+  esac
+  if test "x$build_switch_root" = xyes; then
+    case $enable_switch_root:$have_openat in
+    yes:no) AC_MSG_ERROR([switch_root selected but openat() function not found]);;
+    check:no) AC_MSG_WARN([openat() function not found; do not build switch_root])
+              build_switch_root=no;;
+    esac
+  fi
+fi
+AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
+
+
+AC_ARG_ENABLE([pivot_root],
+  AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
+  [], enable_pivot_root=check
+)
+if test "x$enable_pivot_root" = xno; then
+  build_pivot_root=no
+else
+  build_pivot_root=yes
+  case $enable_pivot_root:$linux_os in
+  yes:no) AC_MSG_ERROR([pivot_root selected for non-linux system]);;
+  check:no) AC_MSG_WARN([non-linux system; do not build pivot_root])
+            build_pivot_root=no;;
+  esac
+  if test "x$build_pivot_root" = xyes; then
+    case $enable_pivot_root:$util_cv_syscall_pivot_root in
+    yes:no) AC_MSG_ERROR([pivot_root selected but pivot_root syscall not found]);;
+    check:no) AC_MSG_WARN([pivot_root syscall not found; do not build pivot_root])
+              build_pivot_root=no;;
+    esac
+  fi
+fi
+AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes)
+
+
+AC_ARG_ENABLE([fallocate],
+  AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
+  [], enable_fallocate=check
+)
+if test "x$enable_fallocate" = xno; then
+  build_fallocate=no
+else
+  build_fallocate=yes
+  case $enable_fallocate:$linux_os in
+  yes:no) AC_MSG_ERROR([fallocate selected for non-linux system]);;
+  check:no) AC_MSG_WARN([non-linux system; do not build fallocate])
+            build_fallocate=no;;
+  esac
+  if test "x$build_fallocate" = xyes; then
+    case $enable_fallocate:$util_cv_syscall_fallocate in
+    yes:no) AC_MSG_ERROR([fallocate selected but fallocate syscall not found]);;
+    check:no) AC_MSG_WARN([fallocate syscall not found; do not build fallocate])
+              build_fallocate=no;;
+    esac
+  fi
+fi
+AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = xyes)
+
+
+AC_ARG_ENABLE([unshare],
+  AS_HELP_STRING([--disable-unshare], [do not build unshare]),
+  [], enable_unshare=check
+)
+if test "x$enable_unshare" = xno; then
+  build_unshare=no
+else
+  build_unshare=yes
+  case $enable_unshare:$linux_os in
+  yes:no) AC_MSG_ERROR([unshare selected for non-linux system]);;
+  check:no) AC_MSG_WARN([non-linux system; do not build unshare])
+            build_unshare=no;;
+  esac
+  if test "x$build_unshare" = xyes; then
+    case $enable_unshare:$util_cv_syscall_unshare in
+    yes:no) AC_MSG_ERROR([unshare selected but unshare syscall not found]);;
+    check:no) AC_MSG_WARN([unshare syscall not found; do not build unshare])
+              build_unshare=no;;
+    esac
+  fi
+fi
+AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
+
+
+
+AC_ARG_ENABLE([elvtune],
+  AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
+  [], enable_elvtune=no
+)
+AM_CONDITIONAL(BUILD_ELVTUNE, test "x$enable_elvtune" = xyes)
+
+
+AC_ARG_ENABLE([init],
+  AS_HELP_STRING([--enable-init], [build simpleinit, shutdown, initctl]),
+  [], enable_init=no
+)
+AM_CONDITIONAL(BUILD_INIT, test "x$enable_init" = xyes)
+
+
+AC_ARG_ENABLE([kill],
+  AS_HELP_STRING([--enable-kill], [build kill]),
+  [], enable_kill=no
+)
+AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
+
+
+AC_ARG_ENABLE([last],
+  AS_HELP_STRING([--enable-last], [build last]),
+  [], enable_last=no
+)
+AM_CONDITIONAL(BUILD_LAST, test "x$enable_last" = xyes)
+
+
+AC_ARG_ENABLE([mesg],
+  AS_HELP_STRING([--enable-mesg], [build mesg]),
+  [], enable_mesg=no
+)
+AM_CONDITIONAL(BUILD_MESG, test "x$enable_mesg" = xyes)
+
+
+AC_ARG_ENABLE([partx],
+  AS_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
+  [], enable_partx=no
+)
+AM_CONDITIONAL(BUILD_PARTX, test "x$enable_partx" = xyes)
+
+
+AC_ARG_ENABLE([raw],
+  AS_HELP_STRING([--enable-raw], [build raw]),
+  [], enable_raw=no
+)
+AM_CONDITIONAL(BUILD_RAW, test "x$enable_raw" = xyes)
+
+
+AC_ARG_ENABLE([rdev],
+  AS_HELP_STRING([--enable-rdev], [build rdev on i386]),
+  [], enable_rdev=no
+)
+AM_CONDITIONAL(BUILD_RDEV, test "x$enable_rdev" = xyes)
+
+
+AC_ARG_ENABLE([rename],
+  AS_HELP_STRING([--disable-rename], [do not build rename]),
+  [], enable_rename=yes
+)
+AM_CONDITIONAL(BUILD_RENAME, test "x$enable_rename" = xyes)
+
+
+AC_ARG_ENABLE([reset],
+  AS_HELP_STRING([--enable-reset], [build reset]),
+  [], enable_reset=no
+)
+AM_CONDITIONAL(BUILD_RESET, test "x$enable_reset" = xyes)
+
+
+AC_ARG_ENABLE([login-utils],
+  AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, login, newgrp, vipw]),
+  [], enable_login_utils=no
+)
+AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$enable_login_utils" = xyes)
+
+AC_ARG_WITH([pam],
+  [AS_HELP_STRING([--without-pam], [compile login-utils without PAM support])])
+
+AM_CONDITIONAL(HAVE_PAM, false)
+if test "x$enable_login_utils" = xyes && test "x$with_pam" != xno; then
+  AC_CHECK_HEADERS([security/pam_misc.h],
+    [AM_CONDITIONAL(HAVE_PAM, true)],
+    [if test "x$with_pam" = xyes; then
+	AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
+     fi
+    ])
+fi
+
+AC_ARG_WITH([selinux],
+  AS_HELP_STRING([--with-selinux], [compile with SELinux support]),
+  [], with_selinux=no
+)
+
+if test "x$with_selinux" = xno; then
+  AM_CONDITIONAL(HAVE_SELINUX, false)
+else
+  UTIL_CHECK_LIB(selinux, getprevcon)
+  case "$with_selinux:$have_selinux" in
+  yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
+  esac
+fi
+
+if test "x$have_selinux" = xyes; then
+  SELINUX_LIBS="-lselinux -lsepol"
+  SELINUX_LIBS_STATIC="-lselinux -lsepol"
+  old_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $SELINUX_LIBS"
+  # This function is missing in old libselinux 1.xx versions
+  AC_CHECK_FUNCS([security_get_initial_context])
+  LDFLAGS="$old_LDFLAGS"
+fi
+AC_SUBST([SELINUX_LIBS])
+AC_SUBST([SELINUX_LIBS_STATIC])
+
+AC_ARG_WITH([audit],
+  AS_HELP_STRING([--with-audit], [compile with audit support]),
+  [], with_audit=no
+)
+
+if test "x$with_audit" = xno; then
+  AM_CONDITIONAL(HAVE_AUDIT, false)
+else
+  UTIL_CHECK_LIB(audit, audit_log_user_message)
+  case "$with_audit:$have_audit" in
+  yes:no)
+   AC_MSG_ERROR([Audit selected but libaudit not found (or doesn't support audit_log_user_message())])
+   ;;
+  esac
+fi
+
+AC_ARG_ENABLE([schedutils],
+  AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
+  [], enable_schedutils=yes
+)
+AM_CONDITIONAL(BUILD_SCHEDUTILS, test "x$enable_schedutils" = xyes)
+
+
+AC_ARG_ENABLE([wall],
+  AS_HELP_STRING([--disable-wall], [do not build wall]),
+  [], enable_wall=yes
+)
+AM_CONDITIONAL(BUILD_WALL, test "x$enable_wall" = xyes)
+
+
+AC_ARG_ENABLE([write],
+  AS_HELP_STRING([--enable-write], [build write]),
+  [], enable_write=no
+)
+AM_CONDITIONAL(BUILD_WRITE, test "x$enable_write" = xyes)
+
+
+AC_ARG_ENABLE([chsh-only-listed],
+  AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/shells]),
+  [], enable_chsh_only_listed=yes
+)
+
+if test "x$enable_chsh_only_listed" = xyes; then
+  AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
+fi
+
+
+AC_ARG_ENABLE([login-chown-vcs],
+  AS_HELP_STRING([--enable-login-chown-vcs], [let login chown /dev/vcsN]),
+  [], enable_login_chown_vcs=no
+)
+
+if test "x$enable_login_chown_vcs" = xyes; then
+  AC_DEFINE(LOGIN_CHOWN_VCS, 1, [Should login chown /dev/vcsN?])
+fi
+
+
+AC_ARG_ENABLE([login-stat-mail],
+  AS_HELP_STRING([--enable-login-stat-mail], [let login stat() the mailbox]),
+  [], enable_login_stat_mail=no
+)
+
+if test "x$enable_login_stat_mail" = xyes; then
+  AC_DEFINE(LOGIN_STAT_MAIL, 1, [Should login stat() the mailbox?])
+fi
+
+
+AC_ARG_ENABLE([pg-bell],
+  AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
+  [], enable_pg_bell=yes
+)
+
+if test "x$enable_pg_bell" = xyes; then
+  AC_DEFINE(PG_BELL, 1, [Should pg ring the bell on invalid keys?])
+fi
+
+
+AC_ARG_ENABLE([require-password],
+  AS_HELP_STRING([--disable-require-password], [do not require the user to enter the password in chfn and chsh]),
+  [], enable_require_password=yes
+)
+
+if test "x$enable_require_password" = xyes; then
+  AC_DEFINE(REQUIRE_PASSWORD, 1, [Should chfn and chsh require the user to enter the password?])
+fi
+
+
+AC_ARG_ENABLE([use-tty-group],
+  AS_HELP_STRING([--disable-use-tty-group], [do not install wall and write setgid tty]),
+  [], enable_use_tty_group=yes
+)
+AM_CONDITIONAL(USE_TTY_GROUP, test "x$enable_use_tty_group" = xyes)
+
+if test "x$enable_use_tty_group" = xyes; then
+  AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
+fi
+
+AC_ARG_ENABLE([makeinstall-chown],
+  AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
+  [], enable_makeinstall_chown=yes
+)
+AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test "x$enable_makeinstall_chown" = xyes)
+
+AC_ARG_ENABLE([makeinstall-setuid],
+  AS_HELP_STRING([--disable-makeinstall-setuid], [do not do setuid chmod operations during "make install"]),
+  [], enable_makeinstall_setuid=yes
+)
+AM_CONDITIONAL(MAKEINSTALL_DO_SETUID, test "x$enable_makeinstall_setuid" = xyes)
+
+
+AC_ARG_VAR([SUID_CFLAGS],
+	   [CFLAGS used for binaries which are usually with the suid bit])
+AC_ARG_VAR([SUID_LDFLAGS],
+	   [LDFLAGS used for binaries which are usually with the suid bit])
+
+LIBS=""
+
+
+AC_CONFIG_HEADERS(config.h)
+
+AC_CONFIG_FILES([
+disk-utils/Makefile
+fdisk/Makefile
+fsck/Makefile
+getopt/Makefile
+hwclock/Makefile
+include/Makefile
+lib/Makefile
+login-utils/Makefile
+Makefile
+misc-utils/chkdupexe:misc-utils/chkdupexe.pl
+misc-utils/Makefile
+mount/Makefile
+partx/Makefile
+po/Makefile.in
+schedutils/Makefile
+shlibs/blkid/blkid.pc
+shlibs/blkid/Makefile
+shlibs/blkid/docs/Makefile
+shlibs/blkid/docs/version.xml
+shlibs/blkid/src/Makefile
+shlibs/blkid/src/blkid.h
+shlibs/blkid/src/superblocks/Makefile
+shlibs/blkid/src/topology/Makefile
+shlibs/blkid/src/partitions/Makefile
+shlibs/blkid/samples/Makefile
+shlibs/uuid/uuid.pc
+shlibs/uuid/Makefile
+shlibs/uuid/man/Makefile
+shlibs/uuid/src/Makefile
+shlibs/Makefile
+sys-utils/Makefile
+tests/commands.sh
+tests/helpers/Makefile
+tests/Makefile
+text-utils/Makefile
+])
+
+
+AC_OUTPUT
diff --git a/util-linux-ng-2.17.2/disk-utils/Makefile.am b/util-linux-ng-2.17.2/disk-utils/Makefile.am
new file mode 100644
index 0000000..ed0a6e4
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/Makefile.am
@@ -0,0 +1,71 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+utils_common = ../lib/blkdev.c
+if LINUX
+utils_common += ../lib/linux_version.c
+endif
+
+dist_man_MANS = isosize.8 mkfs.8 mkswap.8 \
+           fsck.minix.8 mkfs.minix.8 mkfs.bfs.8
+
+sbin_PROGRAMS = mkfs mkswap fsck.minix mkfs.minix mkfs.bfs
+fsck_minix_SOURCES = fsck.minix.c minix.h
+mkfs_minix_SOURCES = mkfs.minix.c minix.h $(utils_common)
+mkfs_bfs_SOURCES = mkfs.bfs.c $(utils_common)
+
+mkswap_SOURCES = mkswap.c $(utils_common) ../lib/wholedisk.c
+mkswap_LDADD =
+mkswap_CFLAGS = $(AM_CFLAGS)
+
+usrbin_exec_PROGRAMS = isosize
+usrsbin_exec_PROGRAMS =
+
+if LINUX
+dist_man_MANS += fdformat.8 blockdev.8
+sbin_PROGRAMS += blockdev
+usrsbin_exec_PROGRAMS += fdformat
+blockdev_SOURCES = blockdev.c $(utils_common)
+endif
+
+if BUILD_ELVTUNE
+sbin_PROGRAMS += elvtune
+dist_man_MANS += elvtune.8
+elvtune_SOURCES = elvtune.c ../lib/linux_version.c
+endif
+
+if HAVE_RAW
+if BUILD_RAW
+sbin_PROGRAMS += raw
+dist_man_MANS += raw.8
+endif
+endif
+
+if BUILD_CRAMFS
+cramfs_common = $(utils_common) cramfs.h cramfs_common.c cramfs_common.h
+sbin_PROGRAMS += fsck.cramfs mkfs.cramfs
+fsck_cramfs_SOURCES = fsck.cramfs.c $(cramfs_common)
+mkfs_cramfs_SOURCES = mkfs.cramfs.c $(cramfs_common) ../lib/md5.c
+fsck_cramfs_LDADD = -lz
+mkfs_cramfs_LDADD = -lz
+endif
+
+if HAVE_UUID
+if BUILD_LIBUUID
+mkswap_LDADD += $(ul_libuuid_la)
+mkswap_CFLAGS += -I$(ul_libuuid_srcdir)
+else
+mkswap_LDADD += $(UUID_LIBS)
+mkswap_CFLAGS += $(UUID_CFLAGS)
+endif
+endif
+
+if BUILD_LIBBLKID
+# only in-tree libblkid has partitions parsing support
+mkswap_LDADD += $(ul_libblkid_la)
+mkswap_CFLAGS += -I$(ul_libblkid_incdir)
+endif
+
+if HAVE_SELINUX
+mkswap_LDADD += -lselinux
+endif
+
diff --git a/util-linux-ng-2.17.2/disk-utils/Makefile.in b/util-linux-ng-2.17.2/disk-utils/Makefile.in
new file mode 100644
index 0000000..1a0cabf
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/Makefile.in
@@ -0,0 +1,1057 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(dist_man_MANS) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config/include-Makefile.am
+@LINUX_TRUE@am__append_1 = ../lib/linux_version.c
+sbin_PROGRAMS = mkfs$(EXEEXT) mkswap$(EXEEXT) fsck.minix$(EXEEXT) \
+	mkfs.minix$(EXEEXT) mkfs.bfs$(EXEEXT) $(am__EXEEXT_1) \
+	$(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
+usrbin_exec_PROGRAMS = isosize$(EXEEXT)
+usrsbin_exec_PROGRAMS = $(am__EXEEXT_5)
+@LINUX_TRUE@am__append_2 = fdformat.8 blockdev.8
+@LINUX_TRUE@am__append_3 = blockdev
+@LINUX_TRUE@am__append_4 = fdformat
+@BUILD_ELVTUNE_TRUE@am__append_5 = elvtune
+@BUILD_ELVTUNE_TRUE@am__append_6 = elvtune.8
+@BUILD_RAW_TRUE@@HAVE_RAW_TRUE@am__append_7 = raw
+@BUILD_RAW_TRUE@@HAVE_RAW_TRUE@am__append_8 = raw.8
+@BUILD_CRAMFS_TRUE@am__append_9 = fsck.cramfs mkfs.cramfs
+@BUILD_LIBUUID_TRUE@@HAVE_UUID_TRUE@am__append_10 = $(ul_libuuid_la)
+@BUILD_LIBUUID_TRUE@@HAVE_UUID_TRUE@am__append_11 = -I$(ul_libuuid_srcdir)
+@BUILD_LIBUUID_FALSE@@HAVE_UUID_TRUE@am__append_12 = $(UUID_LIBS)
+@BUILD_LIBUUID_FALSE@@HAVE_UUID_TRUE@am__append_13 = $(UUID_CFLAGS)
+
+# only in-tree libblkid has partitions parsing support
+@BUILD_LIBBLKID_TRUE@am__append_14 = $(ul_libblkid_la)
+@BUILD_LIBBLKID_TRUE@am__append_15 = -I$(ul_libblkid_incdir)
+@HAVE_SELINUX_TRUE@am__append_16 = -lselinux
+subdir = disk-utils
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@LINUX_TRUE@am__EXEEXT_1 = blockdev$(EXEEXT)
+@BUILD_ELVTUNE_TRUE@am__EXEEXT_2 = elvtune$(EXEEXT)
+@BUILD_RAW_TRUE@@HAVE_RAW_TRUE@am__EXEEXT_3 = raw$(EXEEXT)
+@BUILD_CRAMFS_TRUE@am__EXEEXT_4 = fsck.cramfs$(EXEEXT) \
+@BUILD_CRAMFS_TRUE@	mkfs.cramfs$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(usrbin_execdir)" \
+	"$(DESTDIR)$(usrsbin_execdir)" "$(DESTDIR)$(man8dir)"
+@LINUX_TRUE@am__EXEEXT_5 = fdformat$(EXEEXT)
+PROGRAMS = $(sbin_PROGRAMS) $(usrbin_exec_PROGRAMS) \
+	$(usrsbin_exec_PROGRAMS)
+am__blockdev_SOURCES_DIST = blockdev.c ../lib/blkdev.c \
+	../lib/linux_version.c
+@LINUX_TRUE@am__objects_1 = linux_version.$(OBJEXT)
+am__objects_2 = blkdev.$(OBJEXT) $(am__objects_1)
+@LINUX_TRUE@am_blockdev_OBJECTS = blockdev.$(OBJEXT) $(am__objects_2)
+blockdev_OBJECTS = $(am_blockdev_OBJECTS)
+blockdev_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am__elvtune_SOURCES_DIST = elvtune.c ../lib/linux_version.c
+@BUILD_ELVTUNE_TRUE@am_elvtune_OBJECTS = elvtune.$(OBJEXT) \
+@BUILD_ELVTUNE_TRUE@	linux_version.$(OBJEXT)
+elvtune_OBJECTS = $(am_elvtune_OBJECTS)
+elvtune_LDADD = $(LDADD)
+fdformat_SOURCES = fdformat.c
+fdformat_OBJECTS = fdformat.$(OBJEXT)
+fdformat_LDADD = $(LDADD)
+am__fsck_cramfs_SOURCES_DIST = fsck.cramfs.c ../lib/blkdev.c \
+	../lib/linux_version.c cramfs.h cramfs_common.c \
+	cramfs_common.h
+@BUILD_CRAMFS_TRUE@am__objects_3 = $(am__objects_2) \
+@BUILD_CRAMFS_TRUE@	cramfs_common.$(OBJEXT)
+@BUILD_CRAMFS_TRUE@am_fsck_cramfs_OBJECTS = fsck.cramfs.$(OBJEXT) \
+@BUILD_CRAMFS_TRUE@	$(am__objects_3)
+fsck_cramfs_OBJECTS = $(am_fsck_cramfs_OBJECTS)
+fsck_cramfs_DEPENDENCIES =
+am_fsck_minix_OBJECTS = fsck.minix.$(OBJEXT)
+fsck_minix_OBJECTS = $(am_fsck_minix_OBJECTS)
+fsck_minix_LDADD = $(LDADD)
+isosize_SOURCES = isosize.c
+isosize_OBJECTS = isosize.$(OBJEXT)
+isosize_LDADD = $(LDADD)
+mkfs_SOURCES = mkfs.c
+mkfs_OBJECTS = mkfs.$(OBJEXT)
+mkfs_LDADD = $(LDADD)
+am__mkfs_bfs_SOURCES_DIST = mkfs.bfs.c ../lib/blkdev.c \
+	../lib/linux_version.c
+am_mkfs_bfs_OBJECTS = mkfs.bfs.$(OBJEXT) $(am__objects_2)
+mkfs_bfs_OBJECTS = $(am_mkfs_bfs_OBJECTS)
+mkfs_bfs_LDADD = $(LDADD)
+am__mkfs_cramfs_SOURCES_DIST = mkfs.cramfs.c ../lib/blkdev.c \
+	../lib/linux_version.c cramfs.h cramfs_common.c \
+	cramfs_common.h ../lib/md5.c
+@BUILD_CRAMFS_TRUE@am_mkfs_cramfs_OBJECTS = mkfs.cramfs.$(OBJEXT) \
+@BUILD_CRAMFS_TRUE@	$(am__objects_3) md5.$(OBJEXT)
+mkfs_cramfs_OBJECTS = $(am_mkfs_cramfs_OBJECTS)
+mkfs_cramfs_DEPENDENCIES =
+am__mkfs_minix_SOURCES_DIST = mkfs.minix.c minix.h ../lib/blkdev.c \
+	../lib/linux_version.c
+am_mkfs_minix_OBJECTS = mkfs.minix.$(OBJEXT) $(am__objects_2)
+mkfs_minix_OBJECTS = $(am_mkfs_minix_OBJECTS)
+mkfs_minix_LDADD = $(LDADD)
+am__mkswap_SOURCES_DIST = mkswap.c ../lib/blkdev.c \
+	../lib/linux_version.c ../lib/wholedisk.c
+@LINUX_TRUE@am__objects_4 = mkswap-linux_version.$(OBJEXT)
+am__objects_5 = mkswap-blkdev.$(OBJEXT) $(am__objects_4)
+am_mkswap_OBJECTS = mkswap-mkswap.$(OBJEXT) $(am__objects_5) \
+	mkswap-wholedisk.$(OBJEXT)
+mkswap_OBJECTS = $(am_mkswap_OBJECTS)
+am__DEPENDENCIES_1 =
+@BUILD_LIBUUID_FALSE@@HAVE_UUID_TRUE@am__DEPENDENCIES_2 =  \
+@BUILD_LIBUUID_FALSE@@HAVE_UUID_TRUE@	$(am__DEPENDENCIES_1)
+mkswap_DEPENDENCIES = $(am__append_10) $(am__DEPENDENCIES_2) \
+	$(am__append_14) $(am__DEPENDENCIES_1)
+mkswap_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mkswap_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+raw_SOURCES = raw.c
+raw_OBJECTS = raw.$(OBJEXT)
+raw_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(blockdev_SOURCES) $(elvtune_SOURCES) fdformat.c \
+	$(fsck_cramfs_SOURCES) $(fsck_minix_SOURCES) isosize.c mkfs.c \
+	$(mkfs_bfs_SOURCES) $(mkfs_cramfs_SOURCES) \
+	$(mkfs_minix_SOURCES) $(mkswap_SOURCES) raw.c
+DIST_SOURCES = $(am__blockdev_SOURCES_DIST) \
+	$(am__elvtune_SOURCES_DIST) fdformat.c \
+	$(am__fsck_cramfs_SOURCES_DIST) $(fsck_minix_SOURCES) \
+	isosize.c mkfs.c $(am__mkfs_bfs_SOURCES_DIST) \
+	$(am__mkfs_cramfs_SOURCES_DIST) $(am__mkfs_minix_SOURCES_DIST) \
+	$(am__mkswap_SOURCES_DIST) raw.c
+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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(dist_man_MANS)
+am__dist_noinst_DATA_DIST = isosize.8 mkfs.8 mkswap.8 fsck.minix.8 \
+	mkfs.minix.8 mkfs.bfs.8 fdformat.8 blockdev.8 elvtune.8 raw.8
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+utils_common = ../lib/blkdev.c $(am__append_1)
+dist_man_MANS = isosize.8 mkfs.8 mkswap.8 fsck.minix.8 mkfs.minix.8 \
+	mkfs.bfs.8 $(am__append_2) $(am__append_6) $(am__append_8)
+fsck_minix_SOURCES = fsck.minix.c minix.h
+mkfs_minix_SOURCES = mkfs.minix.c minix.h $(utils_common)
+mkfs_bfs_SOURCES = mkfs.bfs.c $(utils_common)
+mkswap_SOURCES = mkswap.c $(utils_common) ../lib/wholedisk.c
+mkswap_LDADD = $(am__append_10) $(am__append_12) $(am__append_14) \
+	$(am__append_16)
+mkswap_CFLAGS = $(AM_CFLAGS) $(am__append_11) $(am__append_13) \
+	$(am__append_15)
+@LINUX_TRUE@blockdev_SOURCES = blockdev.c $(utils_common)
+@BUILD_ELVTUNE_TRUE@elvtune_SOURCES = elvtune.c ../lib/linux_version.c
+@BUILD_CRAMFS_TRUE@cramfs_common = $(utils_common) cramfs.h cramfs_common.c cramfs_common.h
+@BUILD_CRAMFS_TRUE@fsck_cramfs_SOURCES = fsck.cramfs.c $(cramfs_common)
+@BUILD_CRAMFS_TRUE@mkfs_cramfs_SOURCES = mkfs.cramfs.c $(cramfs_common) ../lib/md5.c
+@BUILD_CRAMFS_TRUE@fsck_cramfs_LDADD = -lz
+@BUILD_CRAMFS_TRUE@mkfs_cramfs_LDADD = -lz
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign disk-utils/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign disk-utils/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
+$(am__aclocal_m4_deps):
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+install-usrbin_execPROGRAMS: $(usrbin_exec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(usrbin_execdir)" || $(MKDIR_P) "$(DESTDIR)$(usrbin_execdir)"
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(usrbin_execdir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usrbin_execdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-usrbin_execPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(usrbin_execdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(usrbin_execdir)" && rm -f $$files
+
+clean-usrbin_execPROGRAMS:
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+install-usrsbin_execPROGRAMS: $(usrsbin_exec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(usrsbin_execdir)" || $(MKDIR_P) "$(DESTDIR)$(usrsbin_execdir)"
+	@list='$(usrsbin_exec_PROGRAMS)'; test -n "$(usrsbin_execdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(usrsbin_execdir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usrsbin_execdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-usrsbin_execPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(usrsbin_exec_PROGRAMS)'; test -n "$(usrsbin_execdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(usrsbin_execdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(usrsbin_execdir)" && rm -f $$files
+
+clean-usrsbin_execPROGRAMS:
+	@list='$(usrsbin_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+blockdev$(EXEEXT): $(blockdev_OBJECTS) $(blockdev_DEPENDENCIES) 
+	@rm -f blockdev$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(blockdev_OBJECTS) $(blockdev_LDADD) $(LIBS)
+elvtune$(EXEEXT): $(elvtune_OBJECTS) $(elvtune_DEPENDENCIES) 
+	@rm -f elvtune$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(elvtune_OBJECTS) $(elvtune_LDADD) $(LIBS)
+fdformat$(EXEEXT): $(fdformat_OBJECTS) $(fdformat_DEPENDENCIES) 
+	@rm -f fdformat$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fdformat_OBJECTS) $(fdformat_LDADD) $(LIBS)
+fsck.cramfs$(EXEEXT): $(fsck_cramfs_OBJECTS) $(fsck_cramfs_DEPENDENCIES) 
+	@rm -f fsck.cramfs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fsck_cramfs_OBJECTS) $(fsck_cramfs_LDADD) $(LIBS)
+fsck.minix$(EXEEXT): $(fsck_minix_OBJECTS) $(fsck_minix_DEPENDENCIES) 
+	@rm -f fsck.minix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(fsck_minix_OBJECTS) $(fsck_minix_LDADD) $(LIBS)
+isosize$(EXEEXT): $(isosize_OBJECTS) $(isosize_DEPENDENCIES) 
+	@rm -f isosize$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(isosize_OBJECTS) $(isosize_LDADD) $(LIBS)
+mkfs$(EXEEXT): $(mkfs_OBJECTS) $(mkfs_DEPENDENCIES) 
+	@rm -f mkfs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(mkfs_OBJECTS) $(mkfs_LDADD) $(LIBS)
+mkfs.bfs$(EXEEXT): $(mkfs_bfs_OBJECTS) $(mkfs_bfs_DEPENDENCIES) 
+	@rm -f mkfs.bfs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(mkfs_bfs_OBJECTS) $(mkfs_bfs_LDADD) $(LIBS)
+mkfs.cramfs$(EXEEXT): $(mkfs_cramfs_OBJECTS) $(mkfs_cramfs_DEPENDENCIES) 
+	@rm -f mkfs.cramfs$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(mkfs_cramfs_OBJECTS) $(mkfs_cramfs_LDADD) $(LIBS)
+mkfs.minix$(EXEEXT): $(mkfs_minix_OBJECTS) $(mkfs_minix_DEPENDENCIES) 
+	@rm -f mkfs.minix$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(mkfs_minix_OBJECTS) $(mkfs_minix_LDADD) $(LIBS)
+mkswap$(EXEEXT): $(mkswap_OBJECTS) $(mkswap_DEPENDENCIES) 
+	@rm -f mkswap$(EXEEXT)
+	$(AM_V_CCLD)$(mkswap_LINK) $(mkswap_OBJECTS) $(mkswap_LDADD) $(LIBS)
+raw$(EXEEXT): $(raw_OBJECTS) $(raw_DEPENDENCIES) 
+	@rm -f raw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(raw_OBJECTS) $(raw_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blkdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blockdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cramfs_common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elvtune.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdformat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck.cramfs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck.minix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isosize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs.bfs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs.cramfs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs.minix.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkswap-blkdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkswap-linux_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkswap-mkswap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkswap-wholedisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+blkdev.o: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT blkdev.o -MD -MP -MF $(DEPDIR)/blkdev.Tpo -c -o blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/blkdev.Tpo $(DEPDIR)/blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+
+blkdev.obj: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT blkdev.obj -MD -MP -MF $(DEPDIR)/blkdev.Tpo -c -o blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/blkdev.Tpo $(DEPDIR)/blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+
+linux_version.o: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT linux_version.o -MD -MP -MF $(DEPDIR)/linux_version.Tpo -c -o linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/linux_version.Tpo $(DEPDIR)/linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+
+linux_version.obj: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT linux_version.obj -MD -MP -MF $(DEPDIR)/linux_version.Tpo -c -o linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/linux_version.Tpo $(DEPDIR)/linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+
+md5.o: ../lib/md5.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.o -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.o `test -f '../lib/md5.c' || echo '$(srcdir)/'`../lib/md5.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/md5.c' object='md5.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.o `test -f '../lib/md5.c' || echo '$(srcdir)/'`../lib/md5.c
+
+md5.obj: ../lib/md5.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.obj -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.obj `if test -f '../lib/md5.c'; then $(CYGPATH_W) '../lib/md5.c'; else $(CYGPATH_W) '$(srcdir)/../lib/md5.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/md5.c' object='md5.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.obj `if test -f '../lib/md5.c'; then $(CYGPATH_W) '../lib/md5.c'; else $(CYGPATH_W) '$(srcdir)/../lib/md5.c'; fi`
+
+mkswap-mkswap.o: mkswap.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-mkswap.o -MD -MP -MF $(DEPDIR)/mkswap-mkswap.Tpo -c -o mkswap-mkswap.o `test -f 'mkswap.c' || echo '$(srcdir)/'`mkswap.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-mkswap.Tpo $(DEPDIR)/mkswap-mkswap.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mkswap.c' object='mkswap-mkswap.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-mkswap.o `test -f 'mkswap.c' || echo '$(srcdir)/'`mkswap.c
+
+mkswap-mkswap.obj: mkswap.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-mkswap.obj -MD -MP -MF $(DEPDIR)/mkswap-mkswap.Tpo -c -o mkswap-mkswap.obj `if test -f 'mkswap.c'; then $(CYGPATH_W) 'mkswap.c'; else $(CYGPATH_W) '$(srcdir)/mkswap.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-mkswap.Tpo $(DEPDIR)/mkswap-mkswap.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mkswap.c' object='mkswap-mkswap.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-mkswap.obj `if test -f 'mkswap.c'; then $(CYGPATH_W) 'mkswap.c'; else $(CYGPATH_W) '$(srcdir)/mkswap.c'; fi`
+
+mkswap-blkdev.o: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-blkdev.o -MD -MP -MF $(DEPDIR)/mkswap-blkdev.Tpo -c -o mkswap-blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-blkdev.Tpo $(DEPDIR)/mkswap-blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='mkswap-blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+
+mkswap-blkdev.obj: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-blkdev.obj -MD -MP -MF $(DEPDIR)/mkswap-blkdev.Tpo -c -o mkswap-blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-blkdev.Tpo $(DEPDIR)/mkswap-blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='mkswap-blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+
+mkswap-linux_version.o: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-linux_version.o -MD -MP -MF $(DEPDIR)/mkswap-linux_version.Tpo -c -o mkswap-linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-linux_version.Tpo $(DEPDIR)/mkswap-linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='mkswap-linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+
+mkswap-linux_version.obj: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-linux_version.obj -MD -MP -MF $(DEPDIR)/mkswap-linux_version.Tpo -c -o mkswap-linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-linux_version.Tpo $(DEPDIR)/mkswap-linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='mkswap-linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+
+mkswap-wholedisk.o: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-wholedisk.o -MD -MP -MF $(DEPDIR)/mkswap-wholedisk.Tpo -c -o mkswap-wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-wholedisk.Tpo $(DEPDIR)/mkswap-wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='mkswap-wholedisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+
+mkswap-wholedisk.obj: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -MT mkswap-wholedisk.obj -MD -MP -MF $(DEPDIR)/mkswap-wholedisk.Tpo -c -o mkswap-wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/mkswap-wholedisk.Tpo $(DEPDIR)/mkswap-wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='mkswap-wholedisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkswap_CFLAGS) $(CFLAGS) -c -o mkswap-wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man8: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(usrbin_execdir)" "$(DESTDIR)$(usrsbin_execdir)" "$(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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool clean-sbinPROGRAMS \
+	clean-usrbin_execPROGRAMS clean-usrsbin_execPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS install-usrbin_execPROGRAMS \
+	install-usrsbin_execPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man uninstall-sbinPROGRAMS \
+	uninstall-usrbin_execPROGRAMS uninstall-usrsbin_execPROGRAMS
+
+uninstall-man: uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-sbinPROGRAMS clean-usrbin_execPROGRAMS \
+	clean-usrsbin_execPROGRAMS ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-man8 \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-sbinPROGRAMS install-strip install-usrbin_execPROGRAMS \
+	install-usrsbin_execPROGRAMS installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-man uninstall-man8 \
+	uninstall-sbinPROGRAMS uninstall-usrbin_execPROGRAMS \
+	uninstall-usrsbin_execPROGRAMS
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/disk-utils/blockdev.8 b/util-linux-ng-2.17.2/disk-utils/blockdev.8
new file mode 100644
index 0000000..fa01da5
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/blockdev.8
@@ -0,0 +1,93 @@
+.\" -*- nroff -*-
+.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
+.\" Copyright 2007 Karel Zak <kzak@redhat.com>
+.\"
+.\" May be distributed under the GNU General Public License
+.TH BLOCKDEV 8 "Jun 2007" ""
+.SH NAME
+blockdev \- call block device ioctls from the command line
+.SH SYNOPSIS
+.B blockdev
+.RI [ options ]
+.I commands devices
+.br
+.B blockdev
+.B \-\-report
+.RI [ devices ]
+.SH DESCRIPTION
+The utility
+.B blockdev
+allows one to call block device ioctls from the command line.
+.SH OPTIONS
+.TP
+.B \-V
+Print version and exit.
+.TP
+.B \-q
+Be quiet.
+.TP
+.B \-v
+Be verbose.
+.TP
+.B \-\-report
+Print a report for
+.IR devices .
+Note that the partition StartSec is in 512-byte sectors.
+.SH COMMANDS
+.TP
+.B \--setro
+Set read-only.
+.TP
+.B \--setrw
+Set read-write.
+.TP
+.B \--getro
+Get read-only. Print 1 if the device is read-only, 0 otherwise.
+.TP
+.B \--getss
+Print sectorsize in bytes - usually 512.
+.TP
+.B \--getbsz
+Print blocksize in bytes.
+.TP
+.BI \--setbsz " N"
+Set blocksize to
+.I N
+bytes.
+.TP
+.B \--getsize
+Print device size in sectors (BLKGETSIZE). Deprecated in favor of the
+.B \--getsz
+option.
+.TP
+.B \--getsize64
+Print device size in bytes (BLKGETSIZE64)
+.TP
+.B \--getsz
+Get size in 512-byte sectors (BLKGETSIZE64 / 512).
+.TP
+.BI \--setra " N"
+Set readahead to
+.I N
+512-byte sectors.
+.TP
+.B \--getra
+Print readahead (in 512-byte sectors).
+.TP
+.BI \--setfra " N"
+Set filesystem readahead (same like --setra on 2.6 kernels).
+.TP
+.B \--getfra
+Get filesystem readahead.
+.TP
+.B \--flushbufs
+Flush buffers.
+.TP
+.B \--rereadpt
+Reread partition table.
+.SH AUTHOR
+blockdev was written by Andries E. Brouwer.
+.SH AVAILABILITY
+The blockdev command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
+
diff --git a/util-linux-ng-2.17.2/disk-utils/blockdev.c b/util-linux-ng-2.17.2/disk-utils/blockdev.c
new file mode 100644
index 0000000..288c102
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/blockdev.c
@@ -0,0 +1,482 @@
+/*
+ * blockdev.c --- Do various simple block device ioctls from the command line
+ * aeb, 991028
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#include "c.h"
+#include "nls.h"
+#include "blkdev.h"
+
+const char *progname;
+
+
+struct bdc {
+	long		ioc;		/* ioctl code */
+	const char	*iocname;	/* ioctl name (e.g. BLKROSET) */
+	long		argval;		/* default argument */
+
+	const char	*name;		/* --setfoo */
+	const char	*argname;	/* argument name or NULL */
+
+	const char	*help;
+
+	int		argtype;
+	int		flags;
+};
+
+/* command flags */
+enum {
+	FL_NOPTR	= (1 << 1),	/* does not assume pointer (ARG_INT only)*/
+	FL_NORESULT	= (1 << 2)	/* does not return any data */
+};
+
+/* ioctl argument types */
+enum {
+	ARG_NONE,
+	ARG_USHRT,
+	ARG_INT,
+	ARG_UINT,
+	ARG_LONG,
+	ARG_ULONG,
+	ARG_LLONG,
+	ARG_ULLONG
+};
+
+#define IOCTL_ENTRY( io )	.ioc = io, .iocname = # io
+
+struct bdc bdcms[] =
+{
+	{
+		IOCTL_ENTRY(BLKROSET),
+		.name = "--setro",
+		.argtype = ARG_INT,
+		.argval = 1,
+		.flags = FL_NORESULT,
+		.help = N_("set read-only")
+	},{
+		IOCTL_ENTRY(BLKROSET),
+		.name = "--setrw",
+		.argtype = ARG_INT,
+		.argval = 0,
+		.flags = FL_NORESULT,
+		.help = N_("set read-write")
+	},{
+		IOCTL_ENTRY(BLKROGET),
+		.name = "--getro",
+		.argtype = ARG_INT,
+		.argval = -1,
+		.help = N_("get read-only")
+	},{
+		IOCTL_ENTRY(BLKSSZGET),
+		.name = "--getss",
+		.argtype = ARG_INT,
+		.argval = -1,
+		.help = N_("get logical block (sector) size")
+	},{
+		IOCTL_ENTRY(BLKPBSZGET),
+		.name = "--getpbsz",
+		.argtype = ARG_UINT,
+		.argval = -1,
+		.help = N_("get physical block (sector) size")
+	},{
+		IOCTL_ENTRY(BLKIOMIN),
+		.name = "--getiomin",
+		.argtype = ARG_UINT,
+		.argval = -1,
+		.help = N_("get minimum I/O size")
+	},{
+		IOCTL_ENTRY(BLKIOOPT),
+		.name = "--getioopt",
+		.argtype = ARG_UINT,
+		.argval = -1,
+		.help = N_("get optimal I/O size")
+	},{
+		IOCTL_ENTRY(BLKALIGNOFF),
+		.name = "--getalignoff",
+		.argtype = ARG_INT,
+		.argval = -1,
+		.help = N_("get alignment offset")
+	},{
+		IOCTL_ENTRY(BLKSECTGET),
+		.name = "--getmaxsect",
+		.argtype = ARG_USHRT,
+		.argval = -1,
+		.help = N_("get max sectors per request")
+	},{
+		IOCTL_ENTRY(BLKBSZGET),
+		.name = "--getbsz",
+		.argtype = ARG_INT,
+		.argval = -1,
+		.help = N_("get blocksize")
+	},{
+		IOCTL_ENTRY(BLKBSZSET),
+		.name = "--setbsz",
+		.argname = "BLOCKSIZE",
+		.argtype = ARG_INT,
+		.flags = FL_NORESULT,
+	        .help = N_("set blocksize")
+	},{
+		IOCTL_ENTRY(BLKGETSIZE),
+		.name = "--getsize",
+		.argtype = ARG_ULONG,
+		.argval = -1,
+		.help = N_("get 32-bit sector count")
+	},{
+		IOCTL_ENTRY(BLKGETSIZE64),
+		.name = "--getsize64",
+		.argtype = ARG_ULLONG,
+		.argval = -1,
+		.help = N_("get size in bytes")
+	},{
+		IOCTL_ENTRY(BLKRASET),
+		.name = "--setra",
+		.argname = "READAHEAD",
+		.argtype = ARG_INT,
+		.flags = FL_NOPTR | FL_NORESULT,
+		.help = N_("set readahead")
+	},{
+		IOCTL_ENTRY(BLKRAGET),
+		.name = "--getra",
+		.argtype = ARG_LONG,
+		.argval = -1,
+		.help = N_("get readahead")
+	},{
+		IOCTL_ENTRY(BLKFRASET),
+		.name = "--setfra",
+		.argname = "FSREADAHEAD",
+		.argtype = ARG_INT,
+		.flags = FL_NOPTR | FL_NORESULT,
+		.help = N_("set filesystem readahead")
+	},{
+		IOCTL_ENTRY(BLKFRAGET),
+		.name = "--getfra",
+		.argtype = ARG_LONG,
+		.argval = -1,
+		.help = N_("get filesystem readahead")
+	},{
+		IOCTL_ENTRY(BLKFLSBUF),
+		.name = "--flushbufs",
+		.help = N_("flush buffers")
+	},{
+		IOCTL_ENTRY(BLKRRPART),
+		.name = "--rereadpt",
+		.help = N_("reread partition table")
+	}
+};
+
+static void
+usage(void) {
+	int i;
+	fputc('\n', stderr);
+	fprintf(stderr, _("Usage:\n"));
+	fprintf(stderr, "  %s -V\n", progname);
+	fprintf(stderr, _("  %s --report [devices]\n"), progname);
+	fprintf(stderr, _("  %s [-v|-q] commands devices\n"), progname);
+	fputc('\n', stderr);
+
+	fprintf(stderr, _("Available commands:\n"));
+	fprintf(stderr, "\t%-30s %s\n", "--getsz",
+			_("get size in 512-byte sectors"));
+	for (i = 0; i < ARRAY_SIZE(bdcms); i++) {
+		if (bdcms[i].argname)
+			fprintf(stderr, "\t%s %-*s %s\n", bdcms[i].name,
+					(int) (29 - strlen(bdcms[i].name)),
+					bdcms[i].argname, _(bdcms[i].help));
+		else
+			fprintf(stderr, "\t%-30s %s\n", bdcms[i].name,
+					_(bdcms[i].help));
+	}
+	fputc('\n', stderr);
+	exit(1);
+}
+
+static int
+find_cmd(char *s) {
+	int j;
+
+	for (j = 0; j < ARRAY_SIZE(bdcms); j++)
+		if (!strcmp(s, bdcms[j].name))
+			return j;
+	return -1;
+}
+
+void do_commands(int fd, char **argv, int d);
+void report_header(void);
+void report_device(char *device, int quiet);
+void report_all_devices(void);
+
+int
+main(int argc, char **argv) {
+	int fd, d, j, k;
+	char *p;
+
+	/* egcs-2.91.66 is buggy and says:
+	   blockdev.c:93: warning: `d' might be used uninitialized */
+	d = 0;
+
+	progname = argv[0];
+	if ((p = strrchr(progname, '/')) != NULL)
+		progname = p+1;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	if (argc < 2)
+		usage();
+
+	/* -V not together with commands */
+	if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
+		printf("%s (%s)\n", progname, PACKAGE_STRING);
+		exit(0);
+	}
+
+	/* --report not together with other commands */
+	if (!strcmp(argv[1], "--report")) {
+		report_header();
+		if (argc > 2) {
+			for (d = 2; d < argc; d++)
+				report_device(argv[d], 0);
+		} else {
+			report_all_devices();
+		}
+		exit(0);
+	}
+
+	/* do each of the commands on each of the devices */
+	/* devices start after last command */
+	for (d = 1; d < argc; d++) {
+		j = find_cmd(argv[d]);
+		if (j >= 0) {
+			if (bdcms[j].argname)
+				d++;
+			continue;
+		}
+		if (!strcmp(argv[d], "--getsz"))
+			continue;
+		if (!strcmp(argv[d], "--")) {
+			d++;
+			break;
+		}
+		if (argv[d][0] != '-')
+			break;
+	}
+
+	if (d >= argc)
+		usage();
+
+	for (k = d; k < argc; k++) {
+		fd = open(argv[k], O_RDONLY, 0);
+		if (fd < 0) {
+			perror(argv[k]);
+			exit(1);
+		}
+		do_commands(fd, argv, d);
+		close(fd);
+	}
+	return 0;
+}
+
+void
+do_commands(int fd, char **argv, int d) {
+	int res, i, j;
+	int iarg;
+	unsigned int uarg;
+	unsigned short huarg;
+	long larg;
+	long long llarg;
+	unsigned long lu;
+	unsigned long long llu;
+	int verbose = 0;
+
+	for (i = 1; i < d; i++) {
+		if (!strcmp(argv[i], "-v")) {
+			verbose = 1;
+			continue;
+		}
+		if (!strcmp(argv[i], "-q")) {
+			verbose = 0;
+			continue;
+		}
+
+		if (!strcmp(argv[i], "--getsz")) {
+			res = blkdev_get_sectors(fd, &llu);
+			if (res == 0)
+				printf("%lld\n", llu);
+			else
+				exit(1);
+			continue;
+		}
+
+		j = find_cmd(argv[i]);
+		if (j == -1) {
+			fprintf(stderr, _("%s: Unknown command: %s\n"),
+				progname, argv[i]);
+			usage();
+		}
+
+		switch(bdcms[j].argtype) {
+		default:
+		case ARG_NONE:
+			res = ioctl(fd, bdcms[j].ioc, 0);
+			break;
+		case ARG_USHRT:
+			huarg = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &huarg);
+			break;
+		case ARG_INT:
+			if (bdcms[j].argname) {
+				if (i == d-1) {
+					fprintf(stderr, _("%s requires an argument\n"),
+						bdcms[j].name);
+					usage();
+				}
+				iarg = atoi(argv[++i]);
+			} else
+				iarg = bdcms[j].argval;
+
+			res = bdcms[j].flags & FL_NOPTR ?
+					ioctl(fd, bdcms[j].ioc, iarg) :
+					ioctl(fd, bdcms[j].ioc, &iarg);
+			break;
+		case ARG_UINT:
+			uarg = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &uarg);
+			break;
+		case ARG_LONG:
+			larg = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &larg);
+			break;
+		case ARG_LLONG:
+			llarg = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &llarg);
+			break;
+		case ARG_ULONG:
+			lu = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &lu);
+			break;
+		case ARG_ULLONG:
+			llu = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &llu);
+			break;
+		}
+
+		if (res == -1) {
+			perror(bdcms[j].iocname);
+			if (verbose)
+				printf(_("%s failed.\n"), _(bdcms[j].help));
+			exit(1);
+		}
+
+		if (bdcms[j].argtype == ARG_NONE ||
+		    (bdcms[j].flags & FL_NORESULT)) {
+			if (verbose)
+				printf(_("%s succeeded.\n"), _(bdcms[j].help));
+			continue;
+		}
+
+		if (verbose)
+			printf("%s: ", _(bdcms[j].help));
+
+		switch(bdcms[j].argtype) {
+		case ARG_USHRT:
+			printf("%hu\n", huarg);
+			break;
+		case ARG_INT:
+			printf("%d\n", iarg);
+			break;
+		case ARG_UINT:
+			printf("%u\n", uarg);
+			break;
+		case ARG_LONG:
+			printf("%ld\n", larg);
+			break;
+		case ARG_LLONG:
+			printf("%lld\n", llarg);
+			break;
+		case ARG_ULONG:
+			printf("%lu\n", lu);
+			break;
+		case ARG_ULLONG:
+			printf("%llu\n", llu);
+			break;
+		}
+	}
+}
+
+#define PROC_PARTITIONS "/proc/partitions"
+
+void
+report_all_devices(void) {
+	FILE *procpt;
+	char line[200];
+	char ptname[200];
+	char device[210];
+	int ma, mi, sz;
+
+	procpt = fopen(PROC_PARTITIONS, "r");
+	if (!procpt) {
+		fprintf(stderr, _("%s: cannot open %s\n"),
+			progname, PROC_PARTITIONS);
+		exit(1);
+	}
+
+	while (fgets(line, sizeof(line), procpt)) {
+		if (sscanf (line, " %d %d %d %200[^\n ]",
+			    &ma, &mi, &sz, ptname) != 4)
+			continue;
+
+		sprintf(device, "/dev/%s", ptname);
+		report_device(device, 1);
+	}
+
+	fclose(procpt);
+}
+
+void
+report_device(char *device, int quiet) {
+	int fd;
+	int ro, ssz, bsz;
+	long ra;
+	unsigned long long bytes;
+	struct hd_geometry g;
+
+	fd = open(device, O_RDONLY | O_NONBLOCK);
+	if (fd < 0) {
+		if (!quiet)
+			fprintf(stderr, _("%s: cannot open %s\n"),
+				progname, device);
+		return;
+	}
+
+	ro = ssz = bsz = 0;
+	g.start = ra = 0;
+	if (ioctl (fd, BLKROGET, &ro) == 0 &&
+	    ioctl (fd, BLKRAGET, &ra) == 0 &&
+	    ioctl (fd, BLKSSZGET, &ssz) == 0 &&
+	    ioctl (fd, BLKBSZGET, &bsz) == 0 &&
+	    ioctl (fd, HDIO_GETGEO, &g) == 0 &&
+	    blkdev_get_size (fd, &bytes) == 0) {
+		printf("%s %5ld %5d %5d %10ld %15lld   %s\n",
+		       ro ? "ro" : "rw", ra, ssz, bsz, g.start, bytes, device);
+	} else {
+		if (!quiet)
+			fprintf(stderr, _("%s: ioctl error on %s\n"),
+				progname, device);
+	}
+
+	close(fd);
+}
+
+void
+report_header() {
+	printf(_("RO    RA   SSZ   BSZ   StartSec            Size   Device\n"));
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/cramfs.h b/util-linux-ng-2.17.2/disk-utils/cramfs.h
new file mode 100644
index 0000000..34b32ca
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/cramfs.h
@@ -0,0 +1,81 @@
+#ifndef __CRAMFS_H
+#define __CRAMFS_H
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+
+#define CRAMFS_MAGIC		0x28cd3d45	/* some random number */
+#define CRAMFS_SIGNATURE	"Compressed ROMFS"
+
+/*
+ * Width of various bitfields in struct cramfs_inode.
+ * Primarily used to generate warnings in mkcramfs.
+ */
+#define CRAMFS_MODE_WIDTH 16
+#define CRAMFS_UID_WIDTH 16
+#define CRAMFS_SIZE_WIDTH 24
+#define CRAMFS_GID_WIDTH 8
+#define CRAMFS_NAMELEN_WIDTH 6
+#define CRAMFS_OFFSET_WIDTH 26
+
+
+/*
+ * Reasonably terse representation of the inode data.
+ */
+struct cramfs_inode {
+	u32 mode:16, uid:16;
+	/* SIZE for device files is i_rdev */
+	u32 size:24, gid:8;
+	/* NAMELEN is the length of the file name, divided by 4 and
+           rounded up.  (cramfs doesn't support hard links.) */
+	/* OFFSET: For symlinks and non-empty regular files, this
+	   contains the offset (divided by 4) of the file data in
+	   compressed form (starting with an array of block pointers;
+	   see README).  For non-empty directories it is the offset
+	   (divided by 4) of the inode of the first file in that
+	   directory.  For anything else, offset is zero. */
+	u32 namelen:6, offset:26;
+};
+
+struct cramfs_info {
+        u32 crc;
+        u32 edition;
+        u32 blocks;
+        u32 files;
+};
+
+/*
+ * Superblock information at the beginning of the FS.
+ */
+struct cramfs_super {
+	u32 magic;		/* 0x28cd3d45 - random number */
+	u32 size;		/* Not used.  mkcramfs currently
+                                   writes a constant 1<<16 here. */
+	u32 flags;		/* 0 */
+	u32 future;		/* 0 */
+	u8 signature[16];	/* "Compressed ROMFS" */
+	struct cramfs_info fsid;/* unique filesystem info */
+	u8 name[16];		/* user-defined name */
+	struct cramfs_inode root;	/* Root inode data */
+};
+
+#define CRAMFS_FLAG_FSID_VERSION_2      0x00000001      /* fsid version #2 */
+#define CRAMFS_FLAG_SORTED_DIRS         0x00000002      /* sorted dirs */
+#define CRAMFS_FLAG_HOLES               0x00000100      /* support for holes */
+#define CRAMFS_FLAG_WRONG_SIGNATURE     0x00000200      /* reserved */
+#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400      /* shifted root fs */
+
+/*
+ * Valid values in super.flags.  Currently we refuse to mount
+ * if (flags & ~CRAMFS_SUPPORTED_FLAGS).  Maybe that should be
+ * changed to test super.future instead.
+ */
+#define CRAMFS_SUPPORTED_FLAGS (0xff)
+
+/* Uncompression interfaces to the underlying zlib */
+int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
+int cramfs_uncompress_init(void);
+int cramfs_uncompress_exit(void);
+
+#endif
diff --git a/util-linux-ng-2.17.2/disk-utils/cramfs_common.c b/util-linux-ng-2.17.2/disk-utils/cramfs_common.c
new file mode 100644
index 0000000..ffdad9b
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/cramfs_common.c
@@ -0,0 +1,105 @@
+/*
+ * cramfs_common - cramfs common code
+ *
+ * Copyright (c) 2008 Roy Peled, the.roy.peled  -at-  gmail.com
+ * Copyright (c) 2004-2006 by Michael Holzt, kju -at- fqdn.org
+ *
+ * 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.
+ *
+ */
+
+#include <string.h>
+#include "cramfs_common.h"
+#include "../include/bitops.h"
+
+u32 u32_toggle_endianness(int big_endian, u32 what)
+{
+	return big_endian == HOST_IS_BIG_ENDIAN ? what : swab32(what);
+}
+
+void super_toggle_endianness(int big_endian, struct cramfs_super *super)
+{
+	if (big_endian != HOST_IS_BIG_ENDIAN) {
+		super->magic = swab32(super->magic);
+		super->size = swab32(super->size);
+		super->flags = swab32(super->flags);
+		super->future = swab32(super->future);
+		super->fsid.crc = swab32(super->fsid.crc);
+		super->fsid.edition = swab32(super->fsid.edition);
+		super->fsid.blocks = swab32(super->fsid.blocks);
+		super->fsid.files = swab32(super->fsid.files);	
+	}
+}
+
+void inode_toggle_endianness(int input_big_endian, int output_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out)
+{
+	if (input_big_endian == output_big_endian) {
+		memmove(inode_out, inode_in, sizeof(*inode_out));
+	}
+	else {
+		unsigned char inode_out_buf[sizeof(*inode_in)];
+		unsigned char *inode_in_buf = (unsigned char*)inode_in;
+
+		inode_out_buf[0] = inode_in_buf[1]; /* 16 bit: mode */
+		inode_out_buf[1] = inode_in_buf[0];
+
+		inode_out_buf[2] = inode_in_buf[3]; /* 16 bit: uid */
+		inode_out_buf[3] = inode_in_buf[2]; 
+
+		inode_out_buf[4] = inode_in_buf[6]; /* 24 bit: size */
+		inode_out_buf[5] = inode_in_buf[5];
+		inode_out_buf[6] = inode_in_buf[4];
+
+		inode_out_buf[7] = inode_in_buf[7]; /* 8 bit: gid width */
+
+		/* Stop the madness! Outlaw C bitfields! They are unportable and nasty!
+		See for yourself what a mess this is: */
+
+		if (output_big_endian) {
+			inode_out_buf[ 8] = ( (inode_in_buf[ 8]&0x3F) << 2 ) | 
+				( (inode_in_buf[11]&0xC0) >> 6 );
+
+			inode_out_buf[ 9] = ( (inode_in_buf[11]&0x3F) << 2 ) |
+				( (inode_in_buf[10]&0xC0) >> 6 );
+
+			inode_out_buf[10] = ( (inode_in_buf[10]&0x3F) << 2 ) |
+				( (inode_in_buf[ 9]&0xC0) >> 6 );
+
+			inode_out_buf[11] = ( (inode_in_buf[ 9]&0x3F) << 2 ) |
+				( (inode_in_buf[ 8]&0xC0) >> 6 );
+		}
+		else {
+			inode_out_buf[ 8] = ( (inode_in_buf[ 8]&0xFD) >> 2 ) | 
+				( (inode_in_buf[11]&0x03) << 6 );
+
+			inode_out_buf[ 9] = ( (inode_in_buf[11]&0xFD) >> 2 ) | 
+				( (inode_in_buf[10]&0x03) << 6 );
+
+			inode_out_buf[10] = ( (inode_in_buf[10]&0xFD) >> 2 ) | 
+				( (inode_in_buf[ 9]&0x03) << 6 );
+
+			inode_out_buf[11] = ( (inode_in_buf[ 9]&0xFD) >> 2 ) | 
+				( (inode_in_buf[ 8]&0x03) << 6 );
+		}
+
+		memmove(inode_out, inode_out_buf, sizeof(*inode_out));
+	}
+}
+
+void inode_to_host(int from_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out)
+{
+	inode_toggle_endianness(from_big_endian, HOST_IS_BIG_ENDIAN, inode_in, inode_out);
+}
+
+void inode_from_host(int to_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out)
+{
+	inode_toggle_endianness(HOST_IS_BIG_ENDIAN, to_big_endian, inode_in, inode_out);
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/cramfs_common.h b/util-linux-ng-2.17.2/disk-utils/cramfs_common.h
new file mode 100644
index 0000000..6311bce
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/cramfs_common.h
@@ -0,0 +1,37 @@
+/*
+ * cramfs_common - cramfs common code
+ *
+ * Copyright (c) 2008 Roy Peled, the.roy.peled  -at-  gmail
+ * Copyright (c) 2004-2006 by Michael Holzt, kju -at- fqdn.org
+ *
+ * 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.
+ *
+ */
+
+#ifndef __CRAMFS_COMMON_H
+#define __CRAMFS_COMMON_H
+
+#include "cramfs.h"
+
+#ifndef HOST_IS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
+#define HOST_IS_BIG_ENDIAN 1
+#else
+#define HOST_IS_BIG_ENDIAN 0
+#endif
+#endif
+
+u32 u32_toggle_endianness(int big_endian, u32 what);
+void super_toggle_endianness(int from_big_endian, struct cramfs_super *super);
+void inode_to_host(int from_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out);
+void inode_from_host(int to_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out);
+
+#endif
diff --git a/util-linux-ng-2.17.2/disk-utils/elvtune.8 b/util-linux-ng-2.17.2/disk-utils/elvtune.8
new file mode 100644
index 0000000..91cbae8
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/elvtune.8
@@ -0,0 +1,65 @@
+.\" -*- nroff -*-
+.TH ELVTUNE 8 "14 March 2000" "Version 1.0"
+.SH NAME
+elvtune \- I/O elevator tuner
+.SH SYNOPSIS
+.B elvtune
+.RB [ \-r
+.IR r_lat ]
+.RB [ \-w
+.IR w_lat ]
+.RB [ \-b
+.IR b_max ]
+.IR device ...
+.br
+.B elvtune \-h
+.br
+.B elvtune \-v
+.SH DESCRIPTION
+.B elvtune
+allows to tune the I/O elevator per blockdevice queue basis. The
+tuning can be safely done at runtime. Tuning the elevator means
+being able to change disk performance and interactiveness. In the
+output of elvtune the address of the queue tuned will be shown
+and it can be considered as a queue ID.
+For example multiple partitions in the same harddisk will
+share the same queue and so tuning one partition will be
+like tuning the whole HD.
+.SH OPTIONS
+.TP
+.BI -r \ r_lat
+set the max latency that the I/O scheduler will provide on
+each read.
+.TP
+.BI -w \ w_lat
+set the max latency that the I/O scheduler will provide on
+each write.
+.TP
+.BI -b \ b_max
+max coalescing factor allowed on writes when there are reads
+pending in the queue.
+.TP
+.BI -h
+help.
+.TP
+.BI -v
+version.
+.SH NOTE
+Actually the only fields tunable are those relative
+to the IO scheduler. It's not possible to select
+a one-way or two-way elevator yet.
+.PP
+For logical blockdevices like LVM the tuning has to
+be done on the
+.I physical
+devices. Tuning the queue of the LVM logical device
+is useless.
+.SH RETURN VALUE
+0 on success and 1 on failure.
+.SH HISTORY
+Ioctls for tuning elevator behaviour were added in Linux 2.3.99-pre1.
+.SH AUTHORS
+Andrea Arcangeli <andrea@suse.de> SuSE
+.SH AVAILABILITY
+The elvtune command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/elvtune.c b/util-linux-ng-2.17.2/disk-utils/elvtune.c
new file mode 100644
index 0000000..b5bb378
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/elvtune.c
@@ -0,0 +1,168 @@
+/*
+ *  elvtune.c - I/O elevator tuner
+ *
+ *  Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  This file may be redistributed under the terms of the GNU General
+ *  Public License, version 2.
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <getopt.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/utsname.h>
+#include "nls.h"
+#include "blkdev.h"
+#include "linux_version.h"
+
+/* this has to match with the kernel structure */
+/* current version for ac19 and 2.2.16 */
+typedef struct blkelv_ioctl_arg_s {
+	int queue_ID;
+	int read_latency;
+	int write_latency;
+	int max_bomb_segments;
+} blkelv_ioctl_arg_t;
+
+static void
+usage(void) {
+	fprintf(stderr, "elvtune (%s)\n", PACKAGE_STRING);
+	fprintf(stderr, _("usage:\n"));
+	fprintf(stderr, "\telvtune [-r r_lat] [-w w_lat] [-b b_lat]"
+		        " /dev/blkdev1 [/dev/blkdev2...]\n");
+	fprintf(stderr, "\telvtune -h\n");
+	fprintf(stderr, "\telvtune -v\n");
+	fprintf(stderr, _("\tNOTE: elvtune only works with 2.4 kernels\n"));
+	/* (ioctls exist in 2.2.16 - 2.5.57) */
+}
+
+static void
+version(void) {
+	fprintf(stderr, "elvtune (%s)\n", PACKAGE_STRING);
+}
+
+int
+main(int argc, char * argv[]) {
+	int read_value = 0xbeefbeef, write_value = 0xbeefbeef, bomb_value = 0xbeefbeef;
+	int read_set, write_set, bomb_set, set;
+	char * devname;
+	int fd;
+	blkelv_ioctl_arg_t elevator;
+
+	read_set = write_set = bomb_set = set = 0;
+
+	setlocale(LC_MESSAGES, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	for (;;) {
+		int opt;
+
+		opt = getopt(argc, argv, "r:w:b:hv");
+		if (opt == -1)
+			break;
+		switch (opt) {
+		case 'r':
+			read_value = atoi(optarg);
+			read_set = set = 1;
+			break;
+		case 'w':
+			write_value = atoi(optarg);
+			write_set = set = 1;
+			break;
+		case 'b':
+			bomb_value = atoi(optarg);
+			bomb_set = set = 1;
+			break;
+
+		case 'h':
+			usage(), exit(0);
+		case 'v':
+			version(), exit(0);
+
+		case '?':
+		default:
+		case ':':
+			fprintf(stderr, _("parse error\n"));
+			exit(1);
+		}
+	}
+
+	if (optind >= argc)
+		fprintf(stderr, _("missing blockdevice, use -h for help\n")), exit(1);
+
+	while (optind < argc) {
+		devname = argv[optind++];
+
+		fd = open(devname, O_RDONLY|O_NONBLOCK);
+		if (fd < 0) {
+			perror("open");
+			break;
+		}
+
+		/* mmj: If we get EINVAL it's not a 2.4 kernel, so warn about
+		   that and exit. It should return ENOTTY however, so check for
+		   that as well in case it gets corrected in the future */
+
+		if (ioctl(fd, BLKELVGET, &elevator) < 0) {
+			int errsv = errno;
+			perror("ioctl get");
+			if ((errsv == EINVAL || errsv == ENOTTY) &&
+			    get_linux_version() >= KERNEL_VERSION(2,5,58)) {
+				fprintf(stderr,
+					_("\nelvtune is only useful on older "
+					"kernels;\nfor 2.6 use IO scheduler "
+					"sysfs tunables instead..\n"));
+			}
+			break;
+		}
+
+		if (set) {
+			if (read_set)
+				elevator.read_latency = read_value;
+			if (write_set)
+				elevator.write_latency = write_value;
+			if (bomb_set)
+				elevator.max_bomb_segments = bomb_value;
+
+			if (ioctl(fd, BLKELVSET, &elevator) < 0) {
+				perror("ioctl set");
+				break;
+			}
+			if (ioctl(fd, BLKELVGET, &elevator) < 0) {
+				perror("ioctl reget");
+				break;
+			}
+		}
+
+		printf("\n%s elevator ID\t\t%d\n", devname, elevator.queue_ID);
+		printf("\tread_latency:\t\t%d\n", elevator.read_latency);
+		printf("\twrite_latency:\t\t%d\n", elevator.write_latency);
+		printf("\tmax_bomb_segments:\t%d\n\n", elevator.max_bomb_segments);
+
+		if (close(fd) < 0) {
+			perror("close");
+			break;
+		}
+	}
+
+	return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/fdformat.8 b/util-linux-ng-2.17.2/disk-utils/fdformat.8
new file mode 100644
index 0000000..cbfc00c
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/fdformat.8
@@ -0,0 +1,62 @@
+.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
+.\" May be distributed under the GNU General Public License
+.TH FDFORMAT 8 "1 February 1993" "Linux 0.99" "Linux Programmer's Manual"
+.SH NAME
+fdformat \- Low-level formats a floppy disk
+.SH SYNOPSIS
+.B fdformat
+.RB [ \-n ]
+.I device
+.SH DESCRIPTION
+.B fdformat
+does a low level format on a floppy disk.
+.I device
+is usually one of the following (for floppy devices, the major = 2, and the
+minor is shown for informational purposes only):
+.sp
+.nf
+.RS
+/dev/fd0d360  (minor = 4)
+/dev/fd0h1200 (minor = 8)
+/dev/fd0D360  (minor = 12)
+/dev/fd0H360  (minor = 12)
+/dev/fd0D720  (minor = 16)
+/dev/fd0H720  (minor = 16)
+/dev/fd0h360  (minor = 20)
+/dev/fd0h720  (minor = 24)
+/dev/fd0H1440 (minor = 28)
+
+/dev/fd1d360  (minor = 5)
+/dev/fd1h1200 (minor = 9)
+/dev/fd1D360  (minor = 13)
+/dev/fd1H360  (minor = 13)
+/dev/fd1D720  (minor = 17)
+/dev/fd1H720  (minor = 17)
+/dev/fd1h360  (minor = 21)
+/dev/fd1h720  (minor = 25)
+/dev/fd1H1440 (minor = 29)
+.RE
+.fi
+
+The generic floppy devices, /dev/fd0 and /dev/fd1, will fail to work with
+.B fdformat
+when a non-standard format is being used, or if the format has not been
+autodetected earlier.  In this case, use
+.BR setfdprm (8)
+to load the disk parameters.
+
+.SH OPTIONS
+.TP
+.B \-n
+No verify.  This option will disable the verification that is performed
+after the format.
+.SH "SEE ALSO"
+.BR fd (4),
+.BR setfdprm (8),
+.BR mkfs (8),
+.BR emkfs (8)
+.SH AUTHOR
+Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
+.SH AVAILABILITY
+The fdformat command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/fdformat.c b/util-linux-ng-2.17.2/disk-utils/fdformat.c
new file mode 100644
index 0000000..4bbb574
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/fdformat.c
@@ -0,0 +1,152 @@
+/* fdformat.c  -  Low-level formats a floppy disk - Werner Almesberger */
+
+/* 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ * - added Native Language Support
+ * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ & - more i18n/nls translatable strings marked
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <linux/fd.h>
+
+#include "nls.h"
+
+struct floppy_struct param;
+
+#define SECTOR_SIZE 512
+#define PERROR(msg) { perror(msg); exit(1); }
+
+static void format_disk(int ctrl, char *name)
+{
+    struct format_descr descr;
+    int track;
+
+    printf(_("Formatting ... "));
+    fflush(stdout);
+    if (ioctl(ctrl,FDFMTBEG,NULL) < 0) PERROR("\nioctl(FDFMTBEG)");
+    for (track = 0; track < param.track; track++) {
+	descr.track = track;
+	descr.head = 0;
+	if (ioctl(ctrl,FDFMTTRK,(long) &descr) < 0)
+	  PERROR("\nioctl(FDFMTTRK)");
+
+	printf("%3d\b\b\b",track);
+	fflush(stdout);
+	if (param.head == 2) {
+	    descr.head = 1;
+	    if (ioctl(ctrl,FDFMTTRK,(long) &descr) < 0)
+	      PERROR("\nioctl(FDFMTTRK)");
+	}
+    }
+    if (ioctl(ctrl,FDFMTEND,NULL) < 0) PERROR("\nioctl(FDFMTEND)");
+    printf(_("done\n"));
+}
+
+
+static void verify_disk(char *name)
+{
+    unsigned char *data;
+    int fd,cyl_size,cyl,count;
+
+    cyl_size = param.sect*param.head*512;
+    if ((data = (unsigned char *) malloc(cyl_size)) == NULL) PERROR("malloc");
+    printf(_("Verifying ... "));
+    fflush(stdout);
+    if ((fd = open(name,O_RDONLY)) < 0) PERROR(name);
+    for (cyl = 0; cyl < param.track; cyl++) {
+	int read_bytes;
+
+	printf("%3d\b\b\b",cyl);
+	fflush(stdout);
+	read_bytes = read(fd,data,cyl_size);
+	if(read_bytes != cyl_size) {
+	    if(read_bytes < 0)
+		    perror(_("Read: "));
+	    fprintf(stderr,
+		    _("Problem reading cylinder %d, expected %d, read %d\n"),
+		    cyl, cyl_size, read_bytes);
+	    free(data);
+	    exit(1);
+	}
+	for (count = 0; count < cyl_size; count++)
+	    if (data[count] != FD_FILL_BYTE) {
+		printf(_("bad data in cyl %d\nContinuing ... "),cyl);
+		fflush(stdout);
+		break;
+	    }
+    }
+    free(data);
+    printf(_("done\n"));
+    if (close(fd) < 0) PERROR("close");
+}
+
+
+static void usage(char *name)
+{
+    char *this;
+
+    if ((this = strrchr(name,'/')) != NULL) name = this+1;
+    fprintf(stderr,_("usage: %s [ -n ] device\n"),name);
+    exit(1);
+}
+
+
+int main(int argc,char **argv)
+{
+    int ctrl;
+    int verify;
+    struct stat st;
+    char *progname, *p;
+
+    progname = argv[0];
+    if ((p = strrchr(progname, '/')) != NULL)
+	    progname = p+1;
+
+    setlocale(LC_ALL, "");
+    bindtextdomain(PACKAGE, LOCALEDIR);
+    textdomain(PACKAGE);
+
+    if (argc == 2 &&
+	(!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+	    printf(_("%s (%s)\n"), progname, PACKAGE_STRING);
+	    exit(0);
+    }
+
+    verify = 1;
+    if (argc > 1 && argv[1][0] == '-') {
+	if (argv[1][1] != 'n') usage(progname);
+	verify = 0;
+	argc--;
+	argv++;
+    }
+    if (argc != 2) usage(progname);
+    if (stat(argv[1],&st) < 0) PERROR(argv[1]);
+    if (!S_ISBLK(st.st_mode)) {
+	fprintf(stderr,_("%s: not a block device\n"),argv[1]);
+	exit(1);
+	/* do not test major - perhaps this was an USB floppy */
+    }
+    if (access(argv[1],W_OK) < 0) PERROR(argv[1]);
+
+    ctrl = open(argv[1],O_WRONLY);
+    if (ctrl < 0)
+	    PERROR(argv[1]);
+    if (ioctl(ctrl,FDGETPRM,(long) &param) < 0) 
+	    PERROR(_("Could not determine current format type"));
+    printf(_("%s-sided, %d tracks, %d sec/track. Total capacity %d kB.\n"),
+	   (param.head == 2) ? _("Double") : _("Single"),
+	   param.track, param.sect,param.size >> 1);
+    format_disk(ctrl, argv[1]);
+    close(ctrl);
+
+    if (verify)
+	    verify_disk(argv[1]);
+    return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/fsck.cramfs.c b/util-linux-ng-2.17.2/disk-utils/fsck.cramfs.c
new file mode 100644
index 0000000..09953dc
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/fsck.cramfs.c
@@ -0,0 +1,750 @@
+/*
+ * cramfsck - check a cramfs file system
+ *
+ * Copyright (C) 2000-2002 Transmeta Corporation
+ *               2005 Adrian Bunk
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * 1999/12/03: Linus Torvalds (cramfs tester and unarchive program)
+ * 2000/06/03: Daniel Quinlan (CRC and length checking program)
+ * 2000/06/04: Daniel Quinlan (merged programs, added options, support
+ *                            for special files, preserve permissions and
+ *                            ownership, cramfs superblock v2, bogus mode
+ *                            test, pathname length test, etc.)
+ * 2000/06/06: Daniel Quinlan (support for holes, pretty-printing,
+ *                            symlink size test)
+ * 2000/07/11: Daniel Quinlan (file length tests, start at offset 0 or 512,
+ *                            fsck-compatible exit codes)
+ * 2000/07/15: Daniel Quinlan (initial support for block devices)
+ * 2002/01/10: Daniel Quinlan (additional checks, test more return codes,
+ *                            use read if mmap fails, standardize messages)
+ */
+
+/* compile-time options */
+//#define INCLUDE_FS_TESTS	/* include cramfs checking and extraction */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <getopt.h>
+#include <utime.h>
+#include <fcntl.h>
+#include <zlib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <sys/sysmacros.h>	/* for major, minor */
+
+#include "cramfs.h"
+#include "cramfs_common.h"
+#include "nls.h"
+#include "blkdev.h"
+
+static const char *progname = "cramfsck";
+
+static int fd;			/* ROM image file descriptor */
+static char *filename;		/* ROM image filename */
+struct cramfs_super super;	/* just find the cramfs superblock once */
+static int cramfs_is_big_endian = 0;	/* source is big endian */
+static int opt_verbose = 0;	/* 1 = verbose (-v), 2+ = very verbose (-vv) */
+
+char *extract_dir = "";	/* extraction directory (-x) */
+
+/* Exit codes used by fsck-type programs */
+#define FSCK_OK          0	/* No errors */
+#define FSCK_NONDESTRUCT 1	/* File system errors corrected */
+#define FSCK_REBOOT      2	/* System should be rebooted */
+#define FSCK_UNCORRECTED 4	/* File system errors left uncorrected */
+#define FSCK_ERROR       8	/* Operational error */
+#define FSCK_USAGE       16	/* Usage or syntax error */
+#define FSCK_LIBRARY     128	/* Shared library error */
+
+#define PAD_SIZE 512
+
+#ifdef INCLUDE_FS_TESTS
+
+static int opt_extract = 0;	/* extract cramfs (-x) */
+
+static uid_t euid;                     /* effective UID */
+
+/* (cramfs_super + start) <= start_dir < end_dir <= start_data <= end_data */
+static unsigned long start_dir = ~0UL; /* start of first non-root inode */
+static unsigned long end_dir = 0;      /* end of the directory structure */
+static unsigned long start_data = ~0UL;        /* start of the data (256 MB = max) */
+static unsigned long end_data = 0;     /* end of the data */
+
+
+/* Guarantee access to at least 8kB at a time */
+#define ROMBUFFER_BITS	13
+#define ROMBUFFERSIZE	(1 << ROMBUFFER_BITS)
+#define ROMBUFFERMASK	(ROMBUFFERSIZE-1)
+static char read_buffer[ROMBUFFERSIZE * 2];
+static unsigned long read_buffer_block = ~0UL;
+
+static z_stream stream;
+
+/* Prototypes */
+static void expand_fs(char *, struct cramfs_inode *);
+#endif /* INCLUDE_FS_TESTS */
+
+static char *outbuffer;
+
+static size_t page_size;
+
+/* Input status of 0 to print help and exit without an error. */
+static void usage(int status)
+{
+	FILE *stream = status ? stderr : stdout;
+
+	fprintf(stream, _("usage: %s [-hv] [-x dir] file\n"
+		" -h         print this help\n"
+		" -x dir     extract into dir\n"
+		" -v         be more verbose\n"
+		" file       file to test\n"), progname);
+
+	exit(status);
+}
+
+static void die(int status, int syserr, const char *fmt, ...)
+{
+	va_list arg_ptr;
+	int save = errno;
+
+	fflush(0);
+	va_start(arg_ptr, fmt);
+	fprintf(stderr, "%s: ", progname);
+	vfprintf(stderr, fmt, arg_ptr);
+	if (syserr) {
+		fprintf(stderr, ": %s", strerror(save));
+	}
+	fprintf(stderr, "\n");
+	va_end(arg_ptr);
+	exit(status);
+}
+
+int get_superblock_endianness(u32 magic)
+{
+	if (magic == CRAMFS_MAGIC) {
+		cramfs_is_big_endian = HOST_IS_BIG_ENDIAN;
+		return 0;
+	}
+	else if (magic == u32_toggle_endianness(!HOST_IS_BIG_ENDIAN, CRAMFS_MAGIC)) {
+		cramfs_is_big_endian = !HOST_IS_BIG_ENDIAN;
+		return 0;
+	}
+	else {
+		return -1;
+	}
+}
+
+static void test_super(int *start, size_t *length) {
+	struct stat st;
+
+	/* find the physical size of the file or block device */
+	if (stat(filename, &st) < 0) {
+		die(FSCK_ERROR, 1, _("stat failed: %s"), filename);
+	}
+	fd = open(filename, O_RDONLY);
+	if (fd < 0) {
+		die(FSCK_ERROR, 1, _("open failed: %s"), filename);
+	}
+	if (S_ISBLK(st.st_mode)) {
+		unsigned long long bytes;
+		if (blkdev_get_size(fd, &bytes)) {
+			die(FSCK_ERROR, 1, _("ioctl failed: unable to determine device size: %s"), filename);
+		}
+		*length = bytes;
+	}
+	else if (S_ISREG(st.st_mode)) {
+		*length = st.st_size;
+	}
+	else {
+		die(FSCK_ERROR, 0, _("not a block device or file: %s"), filename);
+	}
+
+	if (*length < sizeof(struct cramfs_super)) {
+		die(FSCK_UNCORRECTED, 0, _("file length too short"));
+	}
+
+	/* find superblock */
+	if (read(fd, &super, sizeof(super)) != sizeof(super)) {
+		die(FSCK_ERROR, 1, _("read failed: %s"), filename);
+	}
+	if (get_superblock_endianness(super.magic) != -1) {
+		*start = 0;
+	}
+	else if (*length >= (PAD_SIZE + sizeof(super))) {
+		lseek(fd, PAD_SIZE, SEEK_SET);
+		if (read(fd, &super, sizeof(super)) != sizeof(super)) {
+			die(FSCK_ERROR, 1, _("read failed: %s"), filename);
+		}
+		if (get_superblock_endianness(super.magic) != -1) {
+			*start = PAD_SIZE;
+		}
+		else {
+			die(FSCK_UNCORRECTED, 0, "superblock magic not found");
+		}
+	}
+	else {
+		die(FSCK_UNCORRECTED, 0, _("superblock magic not found"));
+	}
+
+	if (opt_verbose) {
+		printf("cramfs endianness is %s\n", cramfs_is_big_endian ? "big" : "little");
+	}
+
+	super_toggle_endianness(cramfs_is_big_endian, &super);
+	if (super.flags & ~CRAMFS_SUPPORTED_FLAGS) {
+		die(FSCK_ERROR, 0, _("unsupported filesystem features"));
+	}
+	if (super.size < page_size) {
+		die(FSCK_UNCORRECTED, 0, _("superblock size (%d) too small"), super.size);
+	}
+	if (super.flags & CRAMFS_FLAG_FSID_VERSION_2) {
+		if (super.fsid.files == 0) {
+			die(FSCK_UNCORRECTED, 0, _("zero file count"));
+		}
+		if (*length < super.size) {
+			die(FSCK_UNCORRECTED, 0, _("file length too short"));
+		}
+		else if (*length > super.size) {
+			fprintf(stderr, _("warning: file extends past end of filesystem\n"));
+		}
+	}
+	else {
+		fprintf(stderr, _("warning: old cramfs format\n"));
+	}
+}
+
+static void test_crc(int start)
+{
+	void *buf;
+	u32 crc;
+
+	if (!(super.flags & CRAMFS_FLAG_FSID_VERSION_2)) {
+#ifdef INCLUDE_FS_TESTS
+		return;
+#else /* not INCLUDE_FS_TESTS */
+		die(FSCK_USAGE, 0, _("unable to test CRC: old cramfs format"));
+#endif /* not INCLUDE_FS_TESTS */
+	}
+
+	crc = crc32(0L, Z_NULL, 0);
+
+	buf = mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+	if (buf == MAP_FAILED) {
+		buf = mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+		if (buf != MAP_FAILED) {
+			lseek(fd, 0, SEEK_SET);
+			if (read(fd, buf, super.size) < 0)
+				die(FSCK_ERROR, 1, _("read failed: %s"), filename);
+		}
+	}
+	if (buf != MAP_FAILED) {
+		((struct cramfs_super *) (buf+start))->fsid.crc = crc32(0L, Z_NULL, 0);
+		crc = crc32(crc, buf+start, super.size-start);
+		munmap(buf, super.size);
+	}
+	else {
+		int retval;
+		size_t length = 0;
+
+		buf = malloc(4096);
+		if (!buf) {
+			die(FSCK_ERROR, 1, _("malloc failed"));
+		}
+		lseek(fd, start, SEEK_SET);
+		for (;;) {
+			retval = read(fd, buf, 4096);
+			if (retval < 0) {
+				die(FSCK_ERROR, 1, _("read failed: %s"), filename);
+			}
+			else if (retval == 0) {
+				break;
+			}
+			if (length == 0) {
+				((struct cramfs_super *) buf)->fsid.crc = crc32(0L, Z_NULL, 0);
+			}
+			length += retval;
+			if (length > (super.size-start)) {
+				crc = crc32(crc, buf, retval - (length - (super.size-start)));
+				break;
+			}
+			crc = crc32(crc, buf, retval);
+		}
+		free(buf);
+	}
+
+	if (crc != super.fsid.crc) {
+		die(FSCK_UNCORRECTED, 0, _("crc error"));
+	}
+}
+
+#ifdef INCLUDE_FS_TESTS
+static void print_node(char type, struct cramfs_inode *i, char *name)
+{
+	char info[10];
+
+	if (S_ISCHR(i->mode) || (S_ISBLK(i->mode))) {
+		/* major/minor numbers can be as high as 2^12 or 4096 */
+		snprintf(info, 10, "%4d,%4d", major(i->size), minor(i->size));
+	}
+	else {
+		/* size be as high as 2^24 or 16777216 */
+		snprintf(info, 10, "%9d", i->size);
+	}
+
+	printf("%c %04o %s %5d:%-3d %s\n",
+	       type, i->mode & ~S_IFMT, info, i->uid, i->gid,
+	       !*name && type == 'd' ? "/" : name);
+}
+
+/*
+ * Create a fake "blocked" access
+ */
+static void *romfs_read(unsigned long offset)
+{
+	unsigned int block = offset >> ROMBUFFER_BITS;
+	if (block != read_buffer_block) {
+		read_buffer_block = block;
+		lseek(fd, block << ROMBUFFER_BITS, SEEK_SET);
+		read(fd, read_buffer, ROMBUFFERSIZE * 2);
+	}
+	return read_buffer + (offset & ROMBUFFERMASK);
+}
+
+static struct cramfs_inode *cramfs_iget(struct cramfs_inode * i)
+{
+	struct cramfs_inode *inode = malloc(sizeof(struct cramfs_inode));
+
+	if (!inode) {
+		die(FSCK_ERROR, 1, _("malloc failed"));
+	}
+	inode_to_host(cramfs_is_big_endian, i, inode);
+	return inode;
+}
+
+static struct cramfs_inode *iget(unsigned int ino)
+{
+	return cramfs_iget(romfs_read(ino));
+}
+
+static void iput(struct cramfs_inode *inode)
+{
+	free(inode);
+}
+
+/*
+ * Return the offset of the root directory
+ */
+static struct cramfs_inode *read_super(void)
+{
+	struct cramfs_inode * root = cramfs_iget(&super.root);
+	unsigned long offset = root->offset << 2;
+
+	if (!S_ISDIR(root->mode))
+		die(FSCK_UNCORRECTED, 0, _("root inode is not directory"));
+	if (!(super.flags & CRAMFS_FLAG_SHIFTED_ROOT_OFFSET) &&
+	    ((offset != sizeof(struct cramfs_super)) &&
+	     (offset != PAD_SIZE + sizeof(struct cramfs_super))))
+	{
+		die(FSCK_UNCORRECTED, 0, _("bad root offset (%lu)"), offset);
+	}
+	return root;
+}
+
+static int uncompress_block(void *src, int len)
+{
+	int err;
+
+	stream.next_in = src;
+	stream.avail_in = len;
+
+	stream.next_out = (unsigned char *) outbuffer;
+	stream.avail_out = page_size*2;
+
+	inflateReset(&stream);
+
+	if (len > page_size*2) {
+		die(FSCK_UNCORRECTED, 0, _("data block too large"));
+	}
+	err = inflate(&stream, Z_FINISH);
+	if (err != Z_STREAM_END) {
+		die(FSCK_UNCORRECTED, 0, _("decompression error %p(%d): %s"),
+		    zError(err), src, len);
+	}
+	return stream.total_out;
+}
+
+#if !HAVE_LCHOWN
+#define lchown chown
+#endif
+static void do_uncompress(char *path, int fd, unsigned long offset, unsigned long size)
+{
+	unsigned long curr = offset + 4 * ((size + page_size - 1) / page_size);
+
+	do {
+		unsigned long out = page_size;
+		unsigned long next = u32_toggle_endianness(cramfs_is_big_endian, *(u32 *) romfs_read(offset));
+
+		if (next > end_data) {
+			end_data = next;
+		}
+
+		offset += 4;
+		if (curr == next) {
+			if (opt_verbose > 1) {
+				printf(_("  hole at %ld (%zd)\n"), curr, page_size);
+			}
+			if (size < page_size)
+				out = size;
+			memset(outbuffer, 0x00, out);
+		}
+		else {
+			if (opt_verbose > 1) {
+				printf(_("  uncompressing block at %ld to %ld (%ld)\n"), curr, next, next - curr);
+			}
+			out = uncompress_block(romfs_read(curr), next - curr);
+		}
+		if (size >= page_size) {
+			if (out != page_size) {
+				die(FSCK_UNCORRECTED, 0, _("non-block (%ld) bytes"), out);
+			}
+		} else {
+			if (out != size) {
+				die(FSCK_UNCORRECTED, 0, _("non-size (%ld vs %ld) bytes"), out, size);
+			}
+		}
+		size -= out;
+		if (opt_extract) {
+			if (write(fd, outbuffer, out) < 0) {
+				die(FSCK_ERROR, 1, _("write failed: %s"), path);
+			}
+		}
+		curr = next;
+	} while (size);
+}
+
+static void change_file_status(char *path, struct cramfs_inode *i)
+{
+	struct utimbuf epoch = { 0, 0 };
+
+	if (euid == 0) {
+		if (lchown(path, i->uid, i->gid) < 0) {
+			die(FSCK_ERROR, 1, _("lchown failed: %s"), path);
+		}
+		if (S_ISLNK(i->mode))
+			return;
+		if ((S_ISUID | S_ISGID) & i->mode) {
+			if (chmod(path, i->mode) < 0) {
+				die(FSCK_ERROR, 1, _("chown failed: %s"), path);
+			}
+		}
+	}
+	if (S_ISLNK(i->mode))
+		return;
+	if (utime(path, &epoch) < 0) {
+		die(FSCK_ERROR, 1, _("utime failed: %s"), path);
+	}
+}
+
+static void do_directory(char *path, struct cramfs_inode *i)
+{
+	int pathlen = strlen(path);
+	int count = i->size;
+	unsigned long offset = i->offset << 2;
+	char *newpath = malloc(pathlen + 256);
+
+	if (!newpath) {
+		die(FSCK_ERROR, 1, _("malloc failed"));
+	}
+	if (offset == 0 && count != 0) {
+		die(FSCK_UNCORRECTED, 0, _("directory inode has zero offset and non-zero size: %s"), path);
+	}
+	if (offset != 0 && offset < start_dir) {
+		start_dir = offset;
+	}
+	/* TODO: Do we need to check end_dir for empty case? */
+	memcpy(newpath, path, pathlen);
+	newpath[pathlen] = '/';
+	pathlen++;
+	if (opt_verbose) {
+		print_node('d', i, path);
+	}
+	if (opt_extract) {
+		if (mkdir(path, i->mode) < 0) {
+			die(FSCK_ERROR, 1, _("mkdir failed: %s"), path);
+		}
+		change_file_status(path, i);
+	}
+	while (count > 0) {
+		struct cramfs_inode *child = iget(offset);
+		int size;
+		int newlen = child->namelen << 2;
+
+		size = sizeof(struct cramfs_inode) + newlen;
+		count -= size;
+
+		offset += sizeof(struct cramfs_inode);
+
+		memcpy(newpath + pathlen, romfs_read(offset), newlen);
+		newpath[pathlen + newlen] = 0;
+		if (newlen == 0) {
+			die(FSCK_UNCORRECTED, 0, _("filename length is zero"));
+		}
+		if ((pathlen + newlen) - strlen(newpath) > 3) {
+			die(FSCK_UNCORRECTED, 0, _("bad filename length"));
+		}
+		expand_fs(newpath, child);
+
+		offset += newlen;
+
+		if (offset <= start_dir) {
+			die(FSCK_UNCORRECTED, 0, _("bad inode offset"));
+		}
+		if (offset > end_dir) {
+			end_dir = offset;
+		}
+		iput(child); /* free(child) */
+	}
+	free(newpath);
+}
+
+static void do_file(char *path, struct cramfs_inode *i)
+{
+	unsigned long offset = i->offset << 2;
+	int fd = 0;
+
+	if (offset == 0 && i->size != 0) {
+		die(FSCK_UNCORRECTED, 0, _("file inode has zero offset and non-zero size"));
+	}
+	if (i->size == 0 && offset != 0) {
+		die(FSCK_UNCORRECTED, 0, _("file inode has zero size and non-zero offset"));
+	}
+	if (offset != 0 && offset < start_data) {
+		start_data = offset;
+	}
+	if (opt_verbose) {
+		print_node('f', i, path);
+	}
+	if (opt_extract) {
+		fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, i->mode);
+		if (fd < 0) {
+			die(FSCK_ERROR, 1, _("open failed: %s"), path);
+		}
+	}
+	if (i->size) {
+		do_uncompress(path, fd, offset, i->size);
+	}
+	if (opt_extract) {
+		close(fd);
+		change_file_status(path, i);
+	}
+}
+
+static void do_symlink(char *path, struct cramfs_inode *i)
+{
+	unsigned long offset = i->offset << 2;
+	unsigned long curr = offset + 4;
+	unsigned long next = u32_toggle_endianness(cramfs_is_big_endian, *(u32 *) romfs_read(offset));
+	unsigned long size;
+
+	if (offset == 0) {
+		die(FSCK_UNCORRECTED, 0, _("symbolic link has zero offset"));
+	}
+	if (i->size == 0) {
+		die(FSCK_UNCORRECTED, 0, _("symbolic link has zero size"));
+	}
+
+	if (offset < start_data) {
+		start_data = offset;
+	}
+	if (next > end_data) {
+		end_data = next;
+	}
+
+	size = uncompress_block(romfs_read(curr), next - curr);
+	if (size != i->size) {
+		die(FSCK_UNCORRECTED, 0, _("size error in symlink: %s"), path);
+	}
+	outbuffer[size] = 0;
+	if (opt_verbose) {
+		char *str;
+
+		asprintf(&str, "%s -> %s", path, outbuffer);
+		print_node('l', i, str);
+		if (opt_verbose > 1) {
+			printf(_("  uncompressing block at %ld to %ld (%ld)\n"), curr, next, next - curr);
+		}
+		free(str);
+	}
+	if (opt_extract) {
+		if (symlink(outbuffer, path) < 0) {
+			die(FSCK_ERROR, 1, _("symlink failed: %s"), path);
+		}
+		change_file_status(path, i);
+	}
+}
+
+static void do_special_inode(char *path, struct cramfs_inode *i)
+{
+	dev_t devtype = 0;
+	char type;
+
+	if (i->offset) {	/* no need to shift offset */
+		die(FSCK_UNCORRECTED, 0, _("special file has non-zero offset: %s"), path);
+	}
+	if (S_ISCHR(i->mode)) {
+		devtype = i->size;
+		type = 'c';
+	}
+	else if (S_ISBLK(i->mode)) {
+		devtype = i->size;
+		type = 'b';
+	}
+	else if (S_ISFIFO(i->mode)) {
+		if (i->size != 0) {
+			die(FSCK_UNCORRECTED, 0, _("fifo has non-zero size: %s"), path);
+		}
+		type = 'p';
+	}
+	else if (S_ISSOCK(i->mode)) {
+		if (i->size != 0) {
+			die(FSCK_UNCORRECTED, 0, _("socket has non-zero size: %s"), path);
+		}
+		type = 's';
+	}
+	else {
+		die(FSCK_UNCORRECTED, 0, _("bogus mode: %s (%o)"), path, i->mode);
+		return;		/* not reached */
+	}
+
+	if (opt_verbose) {
+		print_node(type, i, path);
+	}
+
+	if (opt_extract) {
+		if (mknod(path, i->mode, devtype) < 0) {
+			die(FSCK_ERROR, 1, _("mknod failed: %s"), path);
+		}
+		change_file_status(path, i);
+	}
+}
+
+static void expand_fs(char *path, struct cramfs_inode *inode)
+{
+	if (S_ISDIR(inode->mode)) {
+		do_directory(path, inode);
+	}
+	else if (S_ISREG(inode->mode)) {
+		do_file(path, inode);
+	}
+	else if (S_ISLNK(inode->mode)) {
+		do_symlink(path, inode);
+	}
+	else {
+		do_special_inode(path, inode);
+	}
+}
+
+static void test_fs(int start)
+{
+	struct cramfs_inode *root;
+
+	root = read_super();
+	umask(0);
+	euid = geteuid();
+	stream.next_in = NULL;
+	stream.avail_in = 0;
+	inflateInit(&stream);
+	expand_fs(extract_dir, root);
+	inflateEnd(&stream);
+	if (start_data != ~0UL) {
+		if (start_data < (sizeof(struct cramfs_super) + start)) {
+			die(FSCK_UNCORRECTED, 0, _("directory data start (%ld) < sizeof(struct cramfs_super) + start (%ld)"), start_data, sizeof(struct cramfs_super) + start);
+		}
+		if (end_dir != start_data) {
+			die(FSCK_UNCORRECTED, 0, _("directory data end (%ld) != file data start (%ld)"), end_dir, start_data);
+		}
+	}
+	if (super.flags & CRAMFS_FLAG_FSID_VERSION_2) {
+		if (end_data > super.size) {
+			die(FSCK_UNCORRECTED, 0, _("invalid file data offset"));
+		}
+	}
+	iput(root);		/* free(root) */
+}
+#endif /* INCLUDE_FS_TESTS */
+
+int main(int argc, char **argv)
+{
+	int c;			/* for getopt */
+	int start = 0;
+	size_t length = 0;
+
+	setlocale(LC_MESSAGES, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	page_size = getpagesize();
+
+	if (argc)
+		progname = argv[0];
+
+	outbuffer = malloc(page_size * 2);
+	if (!outbuffer)
+		die(FSCK_ERROR, 1, _("failed to allocate outbuffer"));
+
+	/* command line options */
+	while ((c = getopt(argc, argv, "hx:v")) != EOF) {
+		switch (c) {
+		case 'h':
+			usage(FSCK_OK);
+		case 'x':
+#ifdef INCLUDE_FS_TESTS
+			opt_extract = 1;
+			extract_dir = optarg;
+			break;
+#else /* not INCLUDE_FS_TESTS */
+			die(FSCK_USAGE, 0, _("compiled without -x support"));
+#endif /* not INCLUDE_FS_TESTS */
+		case 'v':
+			opt_verbose++;
+			break;
+		}
+	}
+
+	if ((argc - optind) != 1)
+		usage(FSCK_USAGE);
+	filename = argv[optind];
+
+	test_super(&start, &length);
+	test_crc(start);
+#ifdef INCLUDE_FS_TESTS
+	test_fs(start);
+#endif /* INCLUDE_FS_TESTS */
+
+	if (opt_verbose) {
+		printf("%s: OK\n", filename);
+	}
+
+	exit(FSCK_OK);
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/fsck.minix.8 b/util-linux-ng-2.17.2/disk-utils/fsck.minix.8
new file mode 100644
index 0000000..5aeab5c
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/fsck.minix.8
@@ -0,0 +1,136 @@
+.\" Copyright 1992, 1993, 1994 Rickard E. Faith (faith@cs.unc.edu)
+.\" May be freely distributed.
+.\" " for hilit19
+.TH FSCK 8 "2 July 1996" "Util-Linux 2.6" "Linux Programmer's Manual"
+.SH NAME
+fsck.minix \- a file system consistency checker for Linux
+.SH SYNOPSIS
+.B fsck.minix
+.RB [ \-larvsmf ]
+.I device
+.SH DESCRIPTION
+.B fsck.minix
+performs a consistency check for the Linux MINIX filesystem.  The current
+version supports the 14 character and 30 character filename options.
+
+The program
+assumes the file system is quiescent.
+.B fsck.minix
+should not be used on a mounted device unless you can be sure nobody is
+writing to it (and remember that the kernel can write to it when it
+searches for files).
+
+The device will usually have the following form:
+.nf
+.RS
+/dev/hda[1-63] (IDE disk 1)
+/dev/hdb[1-63] (IDE disk 2)
+/dev/sda[1-15] (SCSI disk 1)
+/dev/sdb[1-15] (SCSI disk 2)
+.RE
+.fi
+
+If the file system was changed (i.e., repaired), then
+.B fsck.minix
+will print "FILE SYSTEM HAS CHANGED" and will
+.BR sync (2)
+three times before exiting.  Since Linux does not currently have raw
+devices, there is
+.I no
+need to reboot at this time.
+.SH WARNING
+.B fsck.minix
+should
+.B not
+be used on a mounted filesystem.  Using
+.B fsck.minix
+on a mounted filesystem is very dangerous, due to the possibility that
+deleted files are still in use, and can seriously damage a perfectly good
+filesystem!  If you absolutely have to run
+.B fsck.minix
+on a mounted filesystem (i.e., the root filesystem), make sure nothing is
+writing to the disk, and that no files are "zombies" waiting for deletion.
+.SH OPTIONS
+.TP
+.B \-l
+Lists all filenames
+.TP
+.B \-r
+Performs interactive repairs
+.TP
+.B \-a
+Performs automatic repairs (this option implies
+.BR \-r ),
+and serves to answer all of the questions asked with the default.  Note
+that this can be extremely dangerous in the case of extensive file system
+damage.
+.TP
+.B \-v
+Verbose
+.TP
+.B \-s
+Outputs super-block information
+.TP
+.B \-m
+Activates MINIX-like "mode not cleared" warnings
+.TP
+.B \-f
+Force file system check even if the file system was marked as valid (this
+marking is done by the kernel when the file system is unmounted).
+.SH "SEE ALSO"
+.BR fsck (8),
+.BR fsck.ext (8),
+.BR fsck.ext2 (8),
+.BR fsck.xiafs (8),
+.BR mkfs (8),
+.BR mkfs.minix (8),
+.BR mkfs.ext (8),
+.BR mkfs.ext2 (8),
+.BR mkfs.xiafs (8),
+.BR reboot (8)
+.SH DIAGNOSTICS
+There are numerous diagnostic messages.  The ones mentioned here are the
+most commonly seen in normal usage.
+
+If the device does not exist,
+.B fsck.minix
+will print "unable to read super block".  If the device exists, but is not
+a MINIX file system,
+.B fsck.minix
+will print "bad magic number in super-block".
+.SH "EXIT CODES"
+The exit code returned by
+.B fsck.minix
+is the sum of the following:
+.IP 0
+No errors
+.IP 3
+File system errors corrected, system should be rebooted if file system was
+mounted
+.IP 4
+File system errors left uncorrected
+.IP 8
+Operational error
+.IP 16
+Usage or syntax error
+.PP
+In point of fact, only 0, 3, 4, 7, 8, and 16 can ever be returned.
+.SH AUTHOR
+Linus Torvalds (torvalds@cs.helsinki.fi)
+.br
+Error code values by Rik Faith (faith@cs.unc.edu)
+.br
+Added support for file system valid flag: Dr. Wettstein
+(greg%wind.uucp@plains.nodak.edu)
+.br
+Check to prevent fsck of mounted filesystem added by Daniel Quinlan
+(quinlan@yggdrasil.com)
+.br
+Minix v2 fs support by Andreas Schwab
+(schwab@issan.informatik.uni-dortmund.de), updated by Nicolai
+Langfeldt (janl@math.uio.no)
+.br
+Portability patch by Russell King (rmk@ecs.soton.ac.uk).
+.SH AVAILABILITY
+The fsck.minix command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/fsck.minix.c b/util-linux-ng-2.17.2/disk-utils/fsck.minix.c
new file mode 100644
index 0000000..0ce7196
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/fsck.minix.c
@@ -0,0 +1,1412 @@
+/*
+ * fsck.minix.c - a file system consistency checker for Linux.
+ *
+ * (C) 1991, 1992 Linus Torvalds. This file may be redistributed
+ * as per the GNU copyleft.
+ */
+
+/*
+ * 09.11.91  -  made the first rudimetary functions
+ *
+ * 10.11.91  -  updated, does checking, no repairs yet.
+ *		Sent out to the mailing-list for testing.
+ *
+ * 14.11.91  -	Testing seems to have gone well. Added some
+ *		correction-code, and changed some functions.
+ *
+ * 15.11.91  -  More correction code. Hopefully it notices most
+ *		cases now, and tries to do something about them.
+ *
+ * 16.11.91  -  More corrections (thanks to Mika Jalava). Most
+ *		things seem to work now. Yeah, sure.
+ *
+ *
+ * 19.04.92  -	Had to start over again from this old version, as a
+ *		kernel bug ate my enhanced fsck in february.
+ *
+ * 28.02.93  -	added support for different directory entry sizes..
+ *
+ * Sat Mar  6 18:59:42 1993, faith@cs.unc.edu: Output namelen with
+ *                           super-block information
+ *
+ * Sat Oct  9 11:17:11 1993, faith@cs.unc.edu: make exit status conform
+ *                           to that required by fsutil
+ *
+ * Mon Jan  3 11:06:52 1994 - Dr. Wettstein (greg%wind.uucp@plains.nodak.edu)
+ *			      Added support for file system valid flag.  Also
+ *			      added program_version variable and output of
+ *			      program name and version number when program
+ *			      is executed.
+ *
+ * 30.10.94 - added support for v2 filesystem
+ *            (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de)
+ *
+ * 10.12.94  -  added test to prevent checking of mounted fs adapted
+ *              from Theodore Ts'o's (tytso@athena.mit.edu) e2fsck
+ *              program.  (Daniel Quinlan, quinlan@yggdrasil.com)
+ *
+ * 01.07.96  - Fixed the v2 fs stuff to use the right #defines and such
+ *	       for modern libcs (janl@math.uio.no, Nicolai Langfeldt)
+ *
+ * 02.07.96  - Added C bit fiddling routines from rmk@ecs.soton.ac.uk 
+ *             (Russell King).  He made them for ARM.  It would seem
+ *	       that the ARM is powerful enough to do this in C whereas
+ *             i386 and m64k must use assembly to get it fast >:-)
+ *	       This should make minix fsck systemindependent.
+ *	       (janl@math.uio.no, Nicolai Langfeldt)
+ *
+ * 04.11.96  - Added minor fixes from Andreas Schwab to avoid compiler
+ *             warnings.  Added mc68k bitops from 
+ *	       Joerg Dorchain <dorchain@mpi-sb.mpg.de>.
+ *
+ * 06.11.96  - Added v2 code submitted by Joerg Dorchain, but written by
+ *             Andreas Schwab.
+ *
+ * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ * - added Native Language Support
+ *
+ * 2008-04-06 James Youngman <jay@gnu.org>
+ * - Issue better error message if we fail to open the device.
+ * - Restore terminal state if we get a fatal signal.
+ *
+ *
+ * I've had no time to add comments - hopefully the function names
+ * are comments enough. As with all file system checkers, this assumes
+ * the file system is quiescent - don't use it on a mounted device
+ * unless you can be sure nobody is writing to it (and remember that the
+ * kernel can write to it when it searches for files).
+ *
+ * Usuage: fsck [-larvsm] device
+ *	-l for a listing of all the filenames
+ *	-a for automatic repairs (not implemented)
+ *	-r for repairs (interactive) (not implemented)
+ *	-v for verbose (tells how many files)
+ *	-s for super-block info
+ *	-m for minix-like "mode not cleared" warnings
+ *	-f force filesystem check even if filesystem marked as valid
+ *
+ * The device may be a block device or a image of one, but this isn't
+ * enforced (but it's not much fun on a character device :-). 
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <mntent.h>
+#include <sys/stat.h>
+#include <signal.h>
+
+#include "minix.h"
+#include "nls.h"
+#include "pathnames.h"
+#include "bitops.h"
+
+#define ROOT_INO 1
+
+#define UPPER(size,n) ((size+((n)-1))/(n))
+#define INODE_SIZE (sizeof(struct minix_inode))
+#define INODE_SIZE2 (sizeof(struct minix2_inode))
+#define INODE_BLOCKS UPPER(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \
+				    : MINIX_INODES_PER_BLOCK))
+#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE)
+
+#define BITS_PER_BLOCK (BLOCK_SIZE<<3)
+
+static char * program_name = "fsck.minix";
+static char * device_name = NULL;
+static int IN;
+static int repair=0, automatic=0, verbose=0, list=0, show=0, warn_mode=0, 
+	force=0;
+static int directory=0, regular=0, blockdev=0, chardev=0, links=0,
+		symlinks=0, total=0;
+
+static int changed = 0; /* flags if the filesystem has been changed */
+static int errors_uncorrected = 0; /* flag if some error was not corrected */
+static int dirsize = 16;
+static int namelen = 14;
+static int version2 = 0;
+static struct termios termios;
+static volatile sig_atomic_t termios_set = 0;
+
+/* File-name data */
+#define MAX_DEPTH 50
+static int name_depth = 0;
+static char name_list[MAX_DEPTH][NAME_MAX+1];
+/* Copy of the previous, just for error reporting - see get_current_name */
+/* This is a waste of 12kB or so. */
+static char current_name[MAX_DEPTH*(NAME_MAX+1)+1];
+
+static char * inode_buffer = NULL;
+#define Inode (((struct minix_inode *) inode_buffer)-1)
+#define Inode2 (((struct minix2_inode *) inode_buffer)-1)
+
+static char *super_block_buffer;
+#define Super (*(struct minix_super_block *)super_block_buffer)
+#define INODES ((unsigned long)Super.s_ninodes)
+#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones))
+#define IMAPS ((unsigned long)Super.s_imap_blocks)
+#define ZMAPS ((unsigned long)Super.s_zmap_blocks)
+#define FIRSTZONE ((unsigned long)Super.s_firstdatazone)
+#define ZONESIZE ((unsigned long)Super.s_log_zone_size)
+#define MAXSIZE ((unsigned long)Super.s_max_size)
+#define MAGIC (Super.s_magic)
+#define NORM_FIRSTZONE (2+IMAPS+ZMAPS+INODE_BLOCKS)
+
+static char *inode_map;
+static char *zone_map;
+
+static unsigned char * inode_count = NULL;
+static unsigned char * zone_count = NULL;
+
+static void recursive_check(unsigned int ino);
+static void recursive_check2(unsigned int ino);
+
+#define inode_in_use(x) (isset(inode_map,(x)) != 0)
+#define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1) != 0)
+
+#define mark_inode(x) (setbit(inode_map,(x)),changed=1)
+#define unmark_inode(x) (clrbit(inode_map,(x)),changed=1)
+
+#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1),changed=1)
+#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1)
+
+static void
+reset(void) {
+	if (termios_set)
+		tcsetattr(0, TCSANOW, &termios);
+}
+
+
+static void
+fatalsig(int sig) {
+	/* We received a fatal signal.  Reset the terminal.
+	 * Also reset the signal handler and re-send the signal,
+	 * so that the parent process knows which signal actually
+	 * caused our death.
+	 */
+	signal(sig, SIG_DFL);
+	reset();
+	raise(sig);
+}
+
+static void
+leave(int status) {
+        reset();
+	exit(status);
+}
+
+static void
+usage(void) {
+	fprintf(stderr,
+		_("Usage: %s [-larvsmf] /dev/name\n"),
+		program_name);
+	leave(16);
+}
+
+static void die(const char *fmt, ...)
+	__attribute__ ((__format__ (__printf__, 1, 2)));
+
+static void
+die(const char *fmt, ...) {
+	va_list ap;
+
+	fprintf(stderr, "%s: ", program_name);
+	va_start(ap, fmt);
+	vfprintf(stderr, fmt, ap);
+	va_end (ap);
+	fputc('\n', stderr);
+	leave(8);
+}
+
+/*
+ * This simply goes through the file-name data and prints out the
+ * current file.
+ */
+static void
+get_current_name(void) {
+	int i = 0, ct;
+	char *p, *q;
+
+	q = current_name;
+	while (i < name_depth) {
+		p = name_list[i++];
+		ct = namelen;
+		*q++ = '/';
+		while (ct-- && *p)
+			*q++ = *p++;
+	}
+	if (i == 0)
+		*q++ = '/';
+	*q = 0;
+}
+
+static int
+ask(const char * string, int def) {
+	int c;
+
+	if (!repair) {
+		printf("\n");
+		errors_uncorrected = 1;
+		return 0;
+	}
+	if (automatic) {
+		printf("\n");
+		if (!def)
+		      errors_uncorrected = 1;
+		return def;
+	}
+	printf(def?"%s (y/n)? ":"%s (n/y)? ",string);
+	for (;;) {
+		fflush(stdout);
+		if ((c=getchar())==EOF) {
+		        if (!def)
+			      errors_uncorrected = 1;
+			return def;
+		}
+		c=toupper(c);
+		if (c == 'Y') {
+			def = 1;
+			break;
+		} else if (c == 'N') {
+			def = 0;
+			break;
+		} else if (c == ' ' || c == '\n')
+			break;
+	}
+	if (def)
+		printf("y\n");
+	else {
+		printf("n\n");
+		errors_uncorrected = 1;
+	     }
+	return def;
+}
+
+/*
+ * Make certain that we aren't checking a filesystem that is on a
+ * mounted partition.  Code adapted from e2fsck, Copyright (C) 1993,
+ * 1994 Theodore Ts'o.  Also licensed under GPL.
+ */
+static void
+check_mount(void) {
+	FILE * f;
+	struct mntent * mnt;
+	int cont;
+	int fd;
+
+	if ((f = setmntent (_PATH_MOUNTED, "r")) == NULL)
+		return;
+	while ((mnt = getmntent (f)) != NULL)
+		if (strcmp (device_name, mnt->mnt_fsname) == 0)
+			break;
+	endmntent (f);
+	if (!mnt)
+		return;
+
+	/*
+	 * If the root is mounted read-only, then /etc/mtab is
+	 * probably not correct; so we won't issue a warning based on
+	 * it.
+	 */
+	fd = open(_PATH_MOUNTED, O_RDWR);
+	if (fd < 0 && errno == EROFS)
+		return;
+	else
+		close(fd);
+	
+	printf (_("%s is mounted.	 "), device_name);
+	if (isatty(0) && isatty(1))
+		cont = ask(_("Do you really want to continue"), 0);
+	else
+		cont = 0;
+	if (!cont) {
+		printf (_("check aborted.\n"));
+		exit (0);
+	}
+	return;
+}
+
+/*
+ * check_zone_nr checks to see that *nr is a valid zone nr. If it
+ * isn't, it will possibly be repaired. Check_zone_nr sets *corrected
+ * if an error was corrected, and returns the zone (0 for no zone
+ * or a bad zone-number).
+ */
+static int
+check_zone_nr(unsigned short * nr, int * corrected) {
+	if (!*nr)
+		return 0;
+
+	if (*nr < FIRSTZONE) {
+		get_current_name();
+		printf(_("Zone nr < FIRSTZONE in file `%s'."),
+		       current_name);
+	} else if (*nr >= ZONES) {
+		get_current_name();
+		printf(_("Zone nr >= ZONES in file `%s'."),
+		       current_name);
+	} else
+		return *nr;
+
+	if (ask(_("Remove block"),1)) {
+		*nr = 0;
+		*corrected = 1;
+	}
+	return 0;
+}
+
+static int
+check_zone_nr2 (unsigned int *nr, int *corrected) {
+	if (!*nr)
+		return 0;
+
+	if (*nr < FIRSTZONE) {
+		get_current_name();
+		printf (_("Zone nr < FIRSTZONE in file `%s'."),
+			current_name);
+	} else if (*nr >= ZONES) {
+		get_current_name();
+		printf (_("Zone nr >= ZONES in file `%s'."),
+			current_name);
+	} else
+		return *nr;
+
+	if (ask (_("Remove block"), 1)) {
+		*nr = 0;
+		*corrected = 1;
+	}
+	return 0;
+}
+
+/*
+ * read-block reads block nr into the buffer at addr.
+ */
+static void
+read_block(unsigned int nr, char * addr) {
+	if (!nr) {
+		memset(addr,0,BLOCK_SIZE);
+		return;
+	}
+	if (BLOCK_SIZE*nr != lseek(IN, BLOCK_SIZE*nr, SEEK_SET)) {
+		get_current_name();
+		printf(_("Read error: unable to seek to block in file '%s'\n"),
+		       current_name);
+		memset(addr,0,BLOCK_SIZE);
+		errors_uncorrected = 1;
+	} else if (BLOCK_SIZE != read(IN, addr, BLOCK_SIZE)) {
+		get_current_name();
+		printf(_("Read error: bad block in file '%s'\n"),
+		       current_name);
+		memset(addr,0,BLOCK_SIZE);
+		errors_uncorrected = 1;
+	}
+}
+
+/*
+ * write_block writes block nr to disk.
+ */
+static void
+write_block(unsigned int nr, char * addr) {
+	if (!nr)
+		return;
+	if (nr < FIRSTZONE || nr >= ZONES) {
+		printf(_("Internal error: trying to write bad block\n"
+		"Write request ignored\n"));
+		errors_uncorrected = 1;
+		return;
+	}
+	if (BLOCK_SIZE*nr != lseek(IN, BLOCK_SIZE*nr, SEEK_SET))
+		die(_("seek failed in write_block"));
+	if (BLOCK_SIZE != write(IN, addr, BLOCK_SIZE)) {
+		get_current_name();
+		printf(_("Write error: bad block in file '%s'\n"),
+		       current_name);
+		errors_uncorrected = 1;
+	}
+}
+
+/*
+ * map-block calculates the absolute block nr of a block in a file.
+ * It sets 'changed' if the inode has needed changing, and re-writes
+ * any indirect blocks with errors.
+ */
+static int
+map_block(struct minix_inode * inode, unsigned int blknr) {
+	unsigned short ind[BLOCK_SIZE>>1];
+	unsigned short dind[BLOCK_SIZE>>1];
+	int blk_chg, block, result;
+
+	if (blknr<7)
+		return check_zone_nr(inode->i_zone + blknr, &changed);
+	blknr -= 7;
+	if (blknr<512) {
+		block = check_zone_nr(inode->i_zone + 7, &changed);
+		read_block(block, (char *) ind);
+		blk_chg = 0;
+		result = check_zone_nr(blknr + ind, &blk_chg);
+		if (blk_chg)
+			write_block(block, (char *) ind);
+		return result;
+	}
+	blknr -= 512;
+	block = check_zone_nr(inode->i_zone + 8, &changed);
+	read_block(block, (char *) dind);
+	blk_chg = 0;
+	result = check_zone_nr(dind + (blknr/512), &blk_chg);
+	if (blk_chg)
+		write_block(block, (char *) dind);
+	block = result;
+	read_block(block, (char *) ind);
+	blk_chg = 0;
+	result = check_zone_nr(ind + (blknr%512), &blk_chg);
+	if (blk_chg)
+		write_block(block, (char *) ind);
+	return result;
+}
+
+static int
+map_block2 (struct minix2_inode *inode, unsigned int blknr) {
+  	unsigned int ind[BLOCK_SIZE >> 2];
+	unsigned int dind[BLOCK_SIZE >> 2];
+	unsigned int tind[BLOCK_SIZE >> 2];
+	int blk_chg, block, result;
+
+	if (blknr < 7)
+		return check_zone_nr2 (inode->i_zone + blknr, &changed);
+	blknr -= 7;
+	if (blknr < 256) {
+		block = check_zone_nr2 (inode->i_zone + 7, &changed);
+		read_block (block, (char *) ind);
+		blk_chg = 0;
+		result = check_zone_nr2 (blknr + ind, &blk_chg);
+		if (blk_chg)
+			write_block (block, (char *) ind);
+		return result;
+	}
+	blknr -= 256;
+	if (blknr >= 256 * 256) {
+		block = check_zone_nr2 (inode->i_zone + 8, &changed);
+		read_block (block, (char *) dind);
+		blk_chg = 0;
+		result = check_zone_nr2 (dind + blknr / 256, &blk_chg);
+		if (blk_chg)
+			write_block (block, (char *) dind);
+		block = result;
+		read_block (block, (char *) ind);
+		blk_chg = 0;
+		result = check_zone_nr2 (ind + blknr % 256, &blk_chg);
+		if (blk_chg)
+			write_block (block, (char *) ind);
+		return result;
+	}
+	blknr -= 256 * 256;
+	block = check_zone_nr2 (inode->i_zone + 9, &changed);
+	read_block (block, (char *) tind);
+	blk_chg = 0;
+	result = check_zone_nr2 (tind + blknr / (256 * 256), &blk_chg);
+	if (blk_chg)
+		write_block (block, (char *) tind);
+	block = result;
+	read_block (block, (char *) dind);
+	blk_chg = 0;
+	result = check_zone_nr2 (dind + (blknr / 256) % 256, &blk_chg);
+	if (blk_chg)
+		write_block (block, (char *) dind);
+	block = result;
+	read_block (block, (char *) ind);
+	blk_chg = 0;
+	result = check_zone_nr2 (ind + blknr % 256, &blk_chg);
+	if (blk_chg)
+		write_block (block, (char *) ind);
+	return result;
+}
+
+static void
+write_super_block(void) {
+	/*
+	 * Set the state of the filesystem based on whether or not there
+	 * are uncorrected errors.  The filesystem valid flag is
+	 * unconditionally set if we get this far.
+	 */
+	Super.s_state |= MINIX_VALID_FS;
+	if ( errors_uncorrected )
+		Super.s_state |= MINIX_ERROR_FS;
+	else
+		Super.s_state &= ~MINIX_ERROR_FS;
+	
+	if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
+		die(_("seek failed in write_super_block"));
+	if (BLOCK_SIZE != write(IN, super_block_buffer, BLOCK_SIZE))
+		die(_("unable to write super-block"));
+
+	return;
+}
+
+static void
+write_tables(void) {
+	write_super_block();
+
+	if (IMAPS*BLOCK_SIZE != write(IN,inode_map,IMAPS*BLOCK_SIZE))
+		die(_("Unable to write inode map"));
+	if (ZMAPS*BLOCK_SIZE != write(IN,zone_map,ZMAPS*BLOCK_SIZE))
+		die(_("Unable to write zone map"));
+	if (INODE_BUFFER_SIZE != write(IN,inode_buffer,INODE_BUFFER_SIZE))
+		die(_("Unable to write inodes"));
+}
+
+static void
+get_dirsize (void) {
+	int block;
+	char blk[BLOCK_SIZE];
+	int size;
+
+	if (version2)
+		block = Inode2[ROOT_INO].i_zone[0];
+	else
+		block = Inode[ROOT_INO].i_zone[0];
+	read_block (block, blk);
+	for (size = 16; size < BLOCK_SIZE; size <<= 1) {
+		if (strcmp (blk + size + 2, "..") == 0) {
+			dirsize = size;
+			namelen = size - 2;
+			return;
+		}
+	}
+	/* use defaults */
+}
+
+static void
+read_superblock(void) {
+	if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
+		die(_("seek failed"));
+
+	super_block_buffer = calloc(1, BLOCK_SIZE);
+	if (!super_block_buffer)
+		die(_("unable to alloc buffer for superblock"));
+
+	if (BLOCK_SIZE != read(IN, super_block_buffer, BLOCK_SIZE))
+		die(_("unable to read super block"));
+	if (MAGIC == MINIX_SUPER_MAGIC) {
+		namelen = 14;
+		dirsize = 16;
+		version2 = 0;
+	} else if (MAGIC == MINIX_SUPER_MAGIC2) {
+		namelen = 30;
+		dirsize = 32;
+		version2 = 0;
+	} else if (MAGIC == MINIX2_SUPER_MAGIC) {
+		namelen = 14;
+		dirsize = 16;
+		version2 = 1;
+	} else if (MAGIC == MINIX2_SUPER_MAGIC2) {
+		namelen = 30;
+		dirsize = 32;
+		version2 = 1;
+	} else
+		die(_("bad magic number in super-block"));
+	if (ZONESIZE != 0 || BLOCK_SIZE != 1024)
+		die(_("Only 1k blocks/zones supported"));
+	if (IMAPS * BLOCK_SIZE * 8 < INODES + 1)
+		die(_("bad s_imap_blocks field in super-block"));
+	if (ZMAPS * BLOCK_SIZE * 8 < ZONES - FIRSTZONE + 1)
+		die(_("bad s_zmap_blocks field in super-block"));
+}
+
+static void
+read_tables(void) {
+	inode_map = malloc(IMAPS * BLOCK_SIZE);
+	if (!inode_map)
+		die(_("Unable to allocate buffer for inode map"));
+	zone_map = malloc(ZMAPS * BLOCK_SIZE);
+	if (!inode_map)
+		die(_("Unable to allocate buffer for zone map"));
+	memset(inode_map,0,sizeof(inode_map));
+	memset(zone_map,0,sizeof(zone_map));
+	inode_buffer = malloc(INODE_BUFFER_SIZE);
+	if (!inode_buffer)
+		die(_("Unable to allocate buffer for inodes"));
+	inode_count = malloc(INODES + 1);
+	if (!inode_count)
+		die(_("Unable to allocate buffer for inode count"));
+	zone_count = malloc(ZONES);
+	if (!zone_count)
+		die(_("Unable to allocate buffer for zone count"));
+	if (IMAPS*BLOCK_SIZE != read(IN,inode_map,IMAPS*BLOCK_SIZE))
+		die(_("Unable to read inode map"));
+	if (ZMAPS*BLOCK_SIZE != read(IN,zone_map,ZMAPS*BLOCK_SIZE))
+		die(_("Unable to read zone map"));
+	if (INODE_BUFFER_SIZE != read(IN,inode_buffer,INODE_BUFFER_SIZE))
+		die(_("Unable to read inodes"));
+	if (NORM_FIRSTZONE != FIRSTZONE) {
+		printf(_("Warning: Firstzone != Norm_firstzone\n"));
+		errors_uncorrected = 1;
+	}
+	get_dirsize ();
+	if (show) {
+		printf(_("%ld inodes\n"),INODES);
+		printf(_("%ld blocks\n"),ZONES);
+		printf(_("Firstdatazone=%ld (%ld)\n"),FIRSTZONE,NORM_FIRSTZONE);
+		printf(_("Zonesize=%d\n"),BLOCK_SIZE<<ZONESIZE);
+		printf(_("Maxsize=%ld\n"),MAXSIZE);
+		printf(_("Filesystem state=%d\n"), Super.s_state);
+		printf(_("namelen=%d\n\n"),namelen);
+	}
+}
+
+static struct minix_inode *
+get_inode(unsigned int nr) {
+	struct minix_inode * inode;
+
+	if (!nr || nr > INODES)
+		return NULL;
+	total++;
+	inode = Inode + nr;
+	if (!inode_count[nr]) {
+		if (!inode_in_use(nr)) {
+			get_current_name();
+			printf(_("Inode %d marked unused, "
+				 "but used for file '%s'\n"),
+			       nr, current_name);
+			if (repair) {
+				if (ask(_("Mark in use"),1))
+					mark_inode(nr);
+			} else {
+			        errors_uncorrected = 1;
+			}
+		}
+		if (S_ISDIR(inode->i_mode))
+			directory++;
+		else if (S_ISREG(inode->i_mode))
+			regular++;
+		else if (S_ISCHR(inode->i_mode))
+			chardev++;
+		else if (S_ISBLK(inode->i_mode))
+			blockdev++;
+		else if (S_ISLNK(inode->i_mode))
+			symlinks++;
+		else if (S_ISSOCK(inode->i_mode))
+			;
+		else if (S_ISFIFO(inode->i_mode))
+			;
+		else {
+                        get_current_name();
+                        printf(_("The file `%s' has mode %05o\n"),
+			       current_name, inode->i_mode);
+                }
+
+	} else
+		links++;
+	if (!++inode_count[nr]) {
+		printf(_("Warning: inode count too big.\n"));
+		inode_count[nr]--;
+		errors_uncorrected = 1;
+	}
+	return inode;
+}
+
+static struct minix2_inode *
+get_inode2 (unsigned int nr) {
+	struct minix2_inode *inode;
+
+	if (!nr || nr > INODES)
+		return NULL;
+	total++;
+	inode = Inode2 + nr;
+	if (!inode_count[nr]) {
+		if (!inode_in_use (nr)) {
+			get_current_name();
+			printf (_("Inode %d marked unused, "
+				  "but used for file '%s'\n"),
+				nr, current_name);
+			if (repair) {
+				if (ask (_("Mark in use"), 1))
+					mark_inode (nr);
+				else
+					errors_uncorrected = 1;
+			}
+		}
+		if (S_ISDIR (inode->i_mode))
+			directory++;
+		else if (S_ISREG (inode->i_mode))
+			regular++;
+		else if (S_ISCHR (inode->i_mode))
+			chardev++;
+		else if (S_ISBLK (inode->i_mode))
+			blockdev++;
+		else if (S_ISLNK (inode->i_mode))
+			symlinks++;
+		else if (S_ISSOCK (inode->i_mode));
+		else if (S_ISFIFO (inode->i_mode));
+		else {
+			get_current_name ();
+			printf (_("The file `%s' has mode %05o\n"),
+				current_name, inode->i_mode);
+		}
+	} else
+		links++;
+	if (!++inode_count[nr]) {
+		printf (_("Warning: inode count too big.\n"));
+		inode_count[nr]--;
+		errors_uncorrected = 1;
+	}
+	return inode;
+}
+
+static void
+check_root(void) {
+	struct minix_inode * inode = Inode + ROOT_INO;
+
+	if (!inode || !S_ISDIR(inode->i_mode))
+		die(_("root inode isn't a directory"));
+}
+
+static void
+check_root2 (void) {
+	struct minix2_inode *inode = Inode2 + ROOT_INO;
+
+	if (!inode || !S_ISDIR (inode->i_mode))
+		die(_("root inode isn't a directory"));
+}
+
+static int
+add_zone(unsigned short * znr, int * corrected) {
+	int result;
+	int block;
+
+	result = 0;
+	block = check_zone_nr(znr, corrected);
+	if (!block)
+		return 0;
+	if (zone_count[block]) {
+		get_current_name();
+		printf(_("Block has been used before. Now in file `%s'."),
+		       current_name);
+		if (ask(_("Clear"),1)) {
+			*znr = 0;
+			block = 0;
+			*corrected = 1;
+		}
+	}
+	if (!block)
+		return 0;
+	if (!zone_in_use(block)) {
+		get_current_name();
+		printf(_("Block %d in file `%s' is marked not in use."),
+		       block, current_name);
+		if (ask(_("Correct"),1))
+			mark_zone(block);
+	}
+	if (!++zone_count[block])
+		zone_count[block]--;
+	return block;
+}
+
+static int
+add_zone2 (unsigned int *znr, int *corrected) {
+	int result;
+	int block;
+
+	result = 0;
+	block = check_zone_nr2 (znr, corrected);
+	if (!block)
+		return 0;
+	if (zone_count[block]) {
+		get_current_name();
+		printf (_("Block has been used before. Now in file `%s'."),
+			current_name);
+		if (ask (_("Clear"), 1)) {
+			*znr = 0;
+			block = 0;
+			*corrected = 1;
+		}
+	}
+	if (!block)
+		return 0;
+	if (!zone_in_use (block)) {
+		get_current_name();
+		printf (_("Block %d in file `%s' is marked not in use."),
+			block, current_name);
+		if (ask (_("Correct"), 1))
+			mark_zone (block);
+	}
+	if (!++zone_count[block])
+		zone_count[block]--;
+	return block;
+}
+
+static void
+add_zone_ind(unsigned short * znr, int * corrected) {
+	static char blk[BLOCK_SIZE];
+	int i, chg_blk=0;
+	int block;
+
+	block = add_zone(znr, corrected);
+	if (!block)
+		return;
+	read_block(block, blk);
+	for (i=0 ; i < (BLOCK_SIZE>>1) ; i++)
+		add_zone(i + (unsigned short *) blk, &chg_blk);
+	if (chg_blk)
+		write_block(block, blk);
+}
+
+static void
+add_zone_ind2 (unsigned int *znr, int *corrected) {
+	static char blk[BLOCK_SIZE];
+	int i, chg_blk = 0;
+	int block;
+
+	block = add_zone2 (znr, corrected);
+	if (!block)
+		return;
+	read_block (block, blk);
+	for (i = 0; i < BLOCK_SIZE >> 2; i++)
+		add_zone2 (i + (unsigned int *) blk, &chg_blk);
+	if (chg_blk)
+		write_block (block, blk);
+}
+
+static void
+add_zone_dind(unsigned short * znr, int * corrected) {
+	static char blk[BLOCK_SIZE];
+	int i, blk_chg=0;
+	int block;
+
+	block = add_zone(znr, corrected);
+	if (!block)
+		return;
+	read_block(block, blk);
+	for (i=0 ; i < (BLOCK_SIZE>>1) ; i++)
+		add_zone_ind(i + (unsigned short *) blk, &blk_chg);
+	if (blk_chg)
+		write_block(block, blk);
+}
+
+static void
+add_zone_dind2 (unsigned int *znr, int *corrected) {
+	static char blk[BLOCK_SIZE];
+	int i, blk_chg = 0;
+	int block;
+
+	block = add_zone2 (znr, corrected);
+	if (!block)
+		return;
+	read_block (block, blk);
+	for (i = 0; i < BLOCK_SIZE >> 2; i++)
+		add_zone_ind2 (i + (unsigned int *) blk, &blk_chg);
+	if (blk_chg)
+		write_block (block, blk);
+}
+
+static void
+add_zone_tind2 (unsigned int *znr, int *corrected) {
+	static char blk[BLOCK_SIZE];
+	int i, blk_chg = 0;
+	int block;
+
+	block = add_zone2 (znr, corrected);
+	if (!block)
+		return;
+	read_block (block, blk);
+	for (i = 0; i < BLOCK_SIZE >> 2; i++)
+		add_zone_dind2 (i + (unsigned int *) blk, &blk_chg);
+	if (blk_chg)
+		write_block (block, blk);
+}
+
+static void
+check_zones(unsigned int i) {
+	struct minix_inode * inode;
+
+	if (!i || i > INODES)
+		return;
+	if (inode_count[i] > 1)	/* have we counted this file already? */
+		return;
+	inode = Inode + i;
+	if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode) &&
+	    !S_ISLNK(inode->i_mode))
+		return;
+	for (i=0 ; i<7 ; i++)
+		add_zone(i + inode->i_zone, &changed);
+	add_zone_ind(7 + inode->i_zone, &changed);
+	add_zone_dind(8 + inode->i_zone, &changed);
+}
+
+static void
+check_zones2 (unsigned int i) {
+	struct minix2_inode *inode;
+
+	if (!i || i > INODES)
+		return;
+	if (inode_count[i] > 1)	/* have we counted this file already? */
+		return;
+	inode = Inode2 + i;
+	if (!S_ISDIR (inode->i_mode) && !S_ISREG (inode->i_mode)
+	    && !S_ISLNK (inode->i_mode))
+		return;
+	for (i = 0; i < 7; i++)
+		add_zone2 (i + inode->i_zone, &changed);
+	add_zone_ind2 (7 + inode->i_zone, &changed);
+	add_zone_dind2 (8 + inode->i_zone, &changed);
+	add_zone_tind2 (9 + inode->i_zone, &changed);
+}
+
+static void
+check_file(struct minix_inode * dir, unsigned int offset) {
+	static char blk[BLOCK_SIZE];
+	struct minix_inode * inode;
+	int ino;
+	char * name;
+	int block;
+
+	block = map_block(dir,offset/BLOCK_SIZE);
+	read_block(block, blk);
+	name = blk + (offset % BLOCK_SIZE) + 2;
+	ino = * (unsigned short *) (name-2);
+	if (ino > INODES) {
+		get_current_name();
+		printf(_("The directory '%s' contains a bad inode number "
+			 "for file '%.*s'."),
+		       current_name, namelen, name);
+		if (ask(_(" Remove"),1)) {
+			*(unsigned short *)(name-2) = 0;
+			write_block(block, blk);
+		}
+		ino = 0;
+	}	
+	if (name_depth < MAX_DEPTH)
+		strncpy (name_list[name_depth], name, namelen);
+	name_depth++;
+	inode = get_inode(ino);
+	name_depth--;
+	if (!offset) {
+		if (!inode || strcmp(".",name)) {
+			get_current_name();
+			printf(_("%s: bad directory: '.' isn't first\n"),
+			       current_name);
+			errors_uncorrected = 1;
+		} else return;
+	}
+	if (offset == dirsize) {
+		if (!inode || strcmp("..",name)) {
+			get_current_name();
+			printf(_("%s: bad directory: '..' isn't second\n"),
+			       current_name);
+			errors_uncorrected = 1;
+		} else return;
+	}
+	if (!inode)
+		return;
+	if (name_depth < MAX_DEPTH)
+		strncpy(name_list[name_depth], name, namelen);
+	name_depth++;	
+	if (list) {
+		if (verbose)
+			printf("%6d %07o %3d ", ino,
+			       inode->i_mode, inode->i_nlinks);
+		get_current_name();
+		printf("%s", current_name);
+		if (S_ISDIR(inode->i_mode))
+			printf(":\n");
+		else
+			printf("\n");
+	}
+	check_zones(ino);
+	if (inode && S_ISDIR(inode->i_mode))
+		recursive_check(ino);
+	name_depth--;
+	return;
+}
+
+static void
+check_file2 (struct minix2_inode *dir, unsigned int offset) {
+	static char blk[BLOCK_SIZE];
+	struct minix2_inode *inode;
+	int ino;
+	char *name;
+	int block;
+
+	block = map_block2 (dir, offset / BLOCK_SIZE);
+	read_block (block, blk);
+	name = blk + (offset % BLOCK_SIZE) + 2;
+	ino = *(unsigned short *) (name - 2);
+	if (ino > INODES) {
+		get_current_name();
+		printf(_("The directory '%s' contains a bad inode number "
+			 "for file '%.*s'."),
+			  current_name, namelen, name);
+		if (ask (_(" Remove"), 1)) {
+			*(unsigned short *) (name - 2) = 0;
+			write_block (block, blk);
+		}
+		ino = 0;
+	}
+	if (name_depth < MAX_DEPTH)
+		strncpy (name_list[name_depth], name, namelen);
+	name_depth++;
+	inode = get_inode2 (ino);
+	name_depth--;
+	if (!offset) {
+		if (!inode || strcmp (".", name)) {
+			get_current_name ();
+			printf (_("%s: bad directory: '.' isn't first\n"),
+				current_name);
+			errors_uncorrected = 1;
+		} else
+			return;
+	}
+	if (offset == dirsize) {
+		if (!inode || strcmp ("..", name)) {
+			get_current_name ();
+			printf (_("%s: bad directory: '..' isn't second\n"),
+				current_name);
+			errors_uncorrected = 1;
+		} else
+			return;
+	}
+	if (!inode)
+		return;
+	name_depth++;
+	if (list) {
+		if (verbose)
+			printf ("%6d %07o %3d ", ino, inode->i_mode,
+				inode->i_nlinks);
+		get_current_name ();
+		printf("%s", current_name);
+		if (S_ISDIR (inode->i_mode))
+			printf (":\n");
+		else
+			printf ("\n");
+	}
+	check_zones2 (ino);
+	if (inode && S_ISDIR (inode->i_mode))
+		recursive_check2 (ino);
+	name_depth--;
+	return;
+}
+
+static void
+recursive_check(unsigned int ino) {
+	struct minix_inode * dir;
+	unsigned int offset;
+
+	dir = Inode + ino;
+	if (!S_ISDIR(dir->i_mode))
+		die(_("internal error"));
+	if (dir->i_size < 2 * dirsize) {
+		get_current_name();
+		printf(_("%s: bad directory: size < 32"),
+		       current_name);
+		errors_uncorrected = 1;
+	}
+	for (offset = 0 ; offset < dir->i_size ; offset += dirsize)
+		check_file(dir,offset);
+}
+
+static void
+recursive_check2 (unsigned int ino) {
+	struct minix2_inode *dir;
+	unsigned int offset;
+
+	dir = Inode2 + ino;
+	if (!S_ISDIR (dir->i_mode))
+		die(_("internal error"));
+	if (dir->i_size < 2 * dirsize) {
+		get_current_name ();
+		printf (_("%s: bad directory: size < 32"),
+			current_name);
+		errors_uncorrected = 1;
+	}
+	for (offset = 0; offset < dir->i_size; offset += dirsize)
+		check_file2 (dir, offset);
+}
+
+static int
+bad_zone(int i) {
+	char buffer[1024];
+
+	if (BLOCK_SIZE*i != lseek(IN, BLOCK_SIZE*i, SEEK_SET))
+		die(_("seek failed in bad_zone"));
+	return (BLOCK_SIZE != read(IN, buffer, BLOCK_SIZE));
+}
+
+static void
+check_counts(void) {
+	int i;
+
+	for (i=1 ; i <= INODES ; i++) {
+		if (!inode_in_use(i) && Inode[i].i_mode && warn_mode) {
+			printf(_("Inode %d mode not cleared."),i);
+			if (ask(_("Clear"),1)) {
+				Inode[i].i_mode = 0;
+				changed = 1;
+			}
+		}
+		if (!inode_count[i]) {
+			if (!inode_in_use(i))
+				continue;
+			printf(_("Inode %d not used, marked used in the bitmap."),i);
+			if (ask(_("Clear"),1))
+				unmark_inode(i);
+			continue;
+		}
+		if (!inode_in_use(i)) {
+			printf(_("Inode %d used, marked unused in the bitmap."),
+				i);
+			if (ask(_("Set"),1))
+				mark_inode(i);
+		}
+		if (Inode[i].i_nlinks != inode_count[i]) {
+			printf(_("Inode %d (mode = %07o), i_nlinks=%d, counted=%d."),
+				i,Inode[i].i_mode,Inode[i].i_nlinks,inode_count[i]);
+			if (ask(_("Set i_nlinks to count"),1)) {
+				Inode[i].i_nlinks=inode_count[i];
+				changed=1;
+			}
+		}
+	}
+	for (i=FIRSTZONE ; i < ZONES ; i++) {
+		if (zone_in_use(i) == zone_count[i])
+			continue;
+		if (!zone_count[i]) {
+			if (bad_zone(i))
+				continue;
+			printf(_("Zone %d: marked in use, no file uses it."),i);
+			if (ask(_("Unmark"),1))
+				unmark_zone(i);
+			continue;
+		}
+		if (zone_in_use(i))
+			printf(_("Zone %d: in use, counted=%d\n"),
+			       i, zone_count[i]);
+		else
+			printf(_("Zone %d: not in use, counted=%d\n"),
+			       i, zone_count[i]);
+	}
+}
+
+static void
+check_counts2 (void) {
+	int i;
+
+	for (i = 1; i <= INODES; i++) {
+		if (!inode_in_use (i) && Inode2[i].i_mode && warn_mode) {
+			printf (_("Inode %d mode not cleared."), i);
+			if (ask (_("Clear"), 1)) {
+				Inode2[i].i_mode = 0;
+				changed = 1;
+			}
+		}
+		if (!inode_count[i]) {
+			if (!inode_in_use (i))
+				continue;
+			printf (_("Inode %d not used, marked used in the bitmap."), i);
+			if (ask (_("Clear"), 1))
+				unmark_inode (i);
+			continue;
+		}
+		if (!inode_in_use (i)) {
+			printf (_("Inode %d used, marked unused in the bitmap."), i);
+			if (ask (_("Set"), 1))
+				mark_inode (i);
+		}
+		if (Inode2[i].i_nlinks != inode_count[i]) {
+			printf (_("Inode %d (mode = %07o), i_nlinks=%d, counted=%d."),
+				i, Inode2[i].i_mode, Inode2[i].i_nlinks, inode_count[i]);
+			if (ask (_("Set i_nlinks to count"), 1)) {
+				Inode2[i].i_nlinks = inode_count[i];
+				changed = 1;
+			}
+		}
+	}
+	for (i = FIRSTZONE; i < ZONES; i++) {
+		if (zone_in_use (i) == zone_count[i])
+			continue;
+		if (!zone_count[i]) {
+			if (bad_zone (i))
+				continue;
+			printf (_("Zone %d: marked in use, no file uses it."),
+				i);
+			if (ask (_("Unmark"), 1))
+				unmark_zone (i);
+			continue;
+		}
+		if (zone_in_use (i))
+			printf (_("Zone %d: in use, counted=%d\n"),
+				i, zone_count[i]);
+		else
+			printf (_("Zone %d: not in use, counted=%d\n"),
+				i, zone_count[i]);
+	}
+}
+
+static void
+check(void) {
+	memset(inode_count,0,(INODES + 1) * sizeof(*inode_count));
+	memset(zone_count,0,ZONES*sizeof(*zone_count));
+	check_zones(ROOT_INO);
+	recursive_check(ROOT_INO);
+	check_counts();
+}
+
+static void
+check2 (void) {
+	memset (inode_count, 0, (INODES + 1) * sizeof (*inode_count));
+	memset (zone_count, 0, ZONES * sizeof (*zone_count));
+	check_zones2 (ROOT_INO);
+	recursive_check2 (ROOT_INO);
+	check_counts2 ();
+}
+
+int
+main(int argc, char ** argv) {
+	struct termios tmp;
+	int count;
+	int retcode = 0;
+	char *p;
+
+	program_name = (argc && *argv) ? argv[0] : "fsck.minix";
+	if ((p = strrchr(program_name, '/')) != NULL)
+		program_name = p+1;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	if (argc == 2 &&
+	    (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+		printf(_("%s (%s)\n"), program_name, PACKAGE_STRING);
+		exit(0);
+	}
+
+	if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
+		die(_("bad inode size"));
+	if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
+		die(_("bad v2 inode size"));
+
+	while (argc-- > 1) {
+		argv++;
+		if (argv[0][0] != '-') {
+			if (device_name)
+				usage();
+			else
+				device_name = argv[0];
+		} else while (*++argv[0])
+			switch (argv[0][0]) {
+				case 'l': list=1; break;
+				case 'a': automatic=1; repair=1; break;
+				case 'r': automatic=0; repair=1; break;
+				case 'v': verbose=1; break;
+				case 's': show=1; break;
+				case 'm': warn_mode=1; break;
+				case 'f': force=1; break;
+				default: usage();
+			}
+	}
+	if (!device_name)
+		usage();
+	check_mount();		/* trying to check a mounted filesystem? */
+	if (repair && !automatic) {
+		if (!isatty(0) || !isatty(1))
+			die(_("need terminal for interactive repairs"));
+	}
+	IN = open(device_name,repair?O_RDWR:O_RDONLY);
+	if (IN < 0)
+		die(_("unable to open '%s': %s"), device_name, strerror(errno));
+	for (count=0 ; count<3 ; count++)
+		sync();
+	read_superblock();
+
+	/*
+	 * Determine whether or not we should continue with the checking.
+	 * This is based on the status of the filesystem valid and error
+	 * flags and whether or not the -f switch was specified on the 
+	 * command line.
+	 */
+	if ( !(Super.s_state & MINIX_ERROR_FS) && 
+	      (Super.s_state & MINIX_VALID_FS) && 
+	      !force ) {
+		if (repair)
+			printf(_("%s is clean, no check.\n"), device_name);
+		return retcode;
+	}
+	else if (force)
+		printf(_("Forcing filesystem check on %s.\n"), device_name);
+	else if (repair)
+		printf(_("Filesystem on %s is dirty, needs checking.\n"),\
+			device_name);
+
+	read_tables();
+
+	/* Restore the terminal state on fatal signals.
+	 * We don't do this for SIGALRM, SIGUSR1 or SIGUSR2.
+	 */
+	signal(SIGINT, fatalsig);
+	signal(SIGQUIT, fatalsig);
+	signal(SIGTERM, fatalsig);
+
+	if (repair && !automatic) {
+		tcgetattr(0,&termios);
+		tmp = termios;
+		tmp.c_lflag &= ~(ICANON|ECHO);
+		tcsetattr(0,TCSANOW,&tmp);
+		termios_set = 1;
+	}
+
+	if (version2) {
+		check_root2 ();
+		check2 ();
+	} else {
+		check_root();
+		check();
+	}
+	if (verbose) {
+		int i, free;
+
+		for (i=1,free=0 ; i <= INODES ; i++)
+			if (!inode_in_use(i))
+				free++;
+		printf(_("\n%6ld inodes used (%ld%%)\n"),(INODES-free),
+			100*(INODES-free)/INODES);
+		for (i=FIRSTZONE,free=0 ; i < ZONES ; i++)
+			if (!zone_in_use(i))
+				free++;
+		printf(_("%6ld zones used (%ld%%)\n"),(ZONES-free),
+			100*(ZONES-free)/ZONES);
+		printf(_("\n%6d regular files\n"
+		"%6d directories\n"
+		"%6d character device files\n"
+		"%6d block device files\n"
+		"%6d links\n"
+		"%6d symbolic links\n"
+		"------\n"
+		"%6d files\n"),
+		regular,directory,chardev,blockdev,
+		links-2*directory+1,symlinks,total-2*directory+1);
+	}
+	if (changed) {
+		write_tables();
+		printf(_(	"----------------------------\n"
+			"FILE SYSTEM HAS BEEN CHANGED\n"
+			"----------------------------\n"));
+		for (count=0 ; count<3 ; count++)
+			sync();
+	}
+	else if ( repair )
+		write_super_block();
+	
+	if (repair && !automatic)
+		tcsetattr(0,TCSANOW,&termios);
+
+	if (changed)
+	      retcode += 3;
+	if (errors_uncorrected)
+	      retcode += 4;
+	return retcode;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/isosize.8 b/util-linux-ng-2.17.2/disk-utils/isosize.8
new file mode 100644
index 0000000..ea878cf
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/isosize.8
@@ -0,0 +1,37 @@
+.TH ISOSIZE "8" "December 2000" "sg3_utils-0.91" SG_UTILS
+.SH NAME
+isosize \- outputs the length of an iso9660 file system
+.SH SYNOPSIS
+.B isosize
+.RB [ \-x ]
+.RB [ \-d
+.IR <num> ]
+.IR <iso9660_image_file> ...
+.SH DESCRIPTION
+.\" Add any additional description here
+.PP
+This command outputs the length of an iso9660 file system that
+is contained in given file. That file may be a normal file or
+a block device (e.g. /dev/hdd or /dev/sr0). In the absence of
+any switches (or errors) it will output the size of the iso9660
+file system in bytes. This can now be a large number (>> 4 GB).
+.TP
+.B \-x
+output in humanly readable form the block count and the block
+size. Output uses the term "sectors" for "blocks".
+.TP
+.BI \-d\  <num>
+only has affect when
+.B \-x
+is not given. The number output (if no errors)
+is the iso9660 file size in bytes divided by
+.IR <num> .
+So if
+.I <num>
+is the block size then the output number will be the block count.
+.PP
+The size of the file (or block device) holding a iso9660 file
+system can be marginally larger than the actual size of the
+iso9660 file system. One reason for this is that cd writers
+are allowed to add "run out" sectors at the end of a iso9660
+image.
diff --git a/util-linux-ng-2.17.2/disk-utils/isosize.c b/util-linux-ng-2.17.2/disk-utils/isosize.c
new file mode 100644
index 0000000..3f22ab8
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/isosize.c
@@ -0,0 +1,220 @@
+/*
+ * isosize.c - Andries Brouwer, 000608
+ *
+ * use header info to find size of iso9660 file system
+ * output a number - useful in scripts
+ *
+ * Synopsis:
+ *    isosize [-x] [-d <num>] <filename>
+ *        where "-x" gives length in sectors and sector size while
+ *              without this argument the size is given in bytes
+ *        without "-x" gives length in bytes unless "-d <num>" is
+ *		given. In the latter case the length in bytes divided
+ *		by <num> is given
+ *
+ *  Version 2.03 2000/12/21
+ *     - add "-d <num>" option and use long long to fix things > 2 GB
+ *  Version 2.02 2000/10/11
+ *     - error messages on IO failures [D. Gilbert]
+ *
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "nls.h"
+
+#define ISODCL(from, to) (to - from + 1)
+
+int xflag;
+
+static int
+isonum_721 (unsigned char * p) {
+        return ((p[0] & 0xff)
+                | ((p[1] & 0xff) << 8));
+}
+
+static int
+isonum_722 (unsigned char * p) {
+        return ((p[1] & 0xff)
+                | ((p[0] & 0xff) << 8));
+}
+
+static int
+isonum_723 (unsigned char * p) {
+        int le = isonum_721 (p);
+        int be = isonum_722 (p+2);
+        if (xflag && le != be)
+		/* translation is useless */
+                fprintf(stderr, "723error: le=%d be=%d\n", le, be);
+        return (le);
+}
+
+static int
+isonum_731 (unsigned char * p) {
+    return ((p[0] & 0xff)
+            | ((p[1] & 0xff) << 8)
+            | ((p[2] & 0xff) << 16)
+            | ((p[3] & 0xff) << 24));
+}
+
+static int
+isonum_732 (unsigned char * p) {
+    return ((p[3] & 0xff)
+            | ((p[2] & 0xff) << 8)
+            | ((p[1] & 0xff) << 16)
+            | ((p[0] & 0xff) << 24));
+}
+
+
+static int
+isonum_733 (unsigned char * p) {
+    int le = isonum_731 (p);
+    int be = isonum_732 (p+4);
+    if (xflag && le != be)
+	    /* translation is useless */
+            fprintf(stderr, "733error: le=%d be=%d\n", le, be);
+    return (le);
+}
+
+struct iso_primary_descriptor {
+    unsigned char type                      [ISODCL (  1,   1)]; /* 711 */
+    unsigned char id                        [ISODCL (  2,   6)];
+    unsigned char version                   [ISODCL (  7,   7)]; /* 711 */
+    unsigned char unused1                   [ISODCL (  8,   8)];
+    unsigned char system_id                 [ISODCL (  9,  40)]; /* auchars */
+    unsigned char volume_id                 [ISODCL ( 41,  72)]; /* duchars */
+    unsigned char unused2                   [ISODCL ( 73,  80)];
+    unsigned char volume_space_size         [ISODCL ( 81,  88)]; /* 733 */
+    unsigned char unused3                   [ISODCL ( 89, 120)];
+    unsigned char volume_set_size           [ISODCL (121, 124)]; /* 723 */
+    unsigned char volume_sequence_number    [ISODCL (125, 128)]; /* 723 */
+    unsigned char logical_block_size        [ISODCL (129, 132)]; /* 723 */
+    unsigned char path_table_size           [ISODCL (133, 140)]; /* 733 */
+    unsigned char type_l_path_table         [ISODCL (141, 144)]; /* 731 */
+    unsigned char opt_type_l_path_table     [ISODCL (145, 148)]; /* 731 */
+    unsigned char type_m_path_table         [ISODCL (149, 152)]; /* 732 */
+    unsigned char opt_type_m_path_table     [ISODCL (153, 156)]; /* 732 */
+    unsigned char root_directory_record     [ISODCL (157, 190)]; /* 9.1 */
+    unsigned char volume_set_id             [ISODCL (191, 318)]; /* duchars */
+    unsigned char publisher_id              [ISODCL (319, 446)]; /* achars */
+    unsigned char preparer_id               [ISODCL (447, 574)]; /* achars */
+    unsigned char application_id            [ISODCL (575, 702)]; /* achars */
+    unsigned char copyright_file_id         [ISODCL (703, 739)]; /* 7.5 dchars */
+    unsigned char abstract_file_id          [ISODCL (740, 776)]; /* 7.5 dchars */
+    unsigned char bibliographic_file_id     [ISODCL (777, 813)]; /* 7.5 dchars */
+    unsigned char creation_date             [ISODCL (814, 830)]; /* 8.4.26.1 */
+    unsigned char modification_date         [ISODCL (831, 847)]; /* 8.4.26.1 */
+    unsigned char expiration_date           [ISODCL (848, 864)]; /* 8.4.26.1 */
+    unsigned char effective_date            [ISODCL (865, 881)]; /* 8.4.26.1 */
+    unsigned char file_structure_version    [ISODCL (882, 882)]; /* 711 */
+    unsigned char unused4                   [ISODCL (883, 883)];
+    unsigned char application_data          [ISODCL (884, 1395)];
+    unsigned char unused5                   [ISODCL (1396, 2048)];
+};
+
+const char *progname;
+int divisor = 0;
+
+static void
+isosize(char *filenamep) {
+	int fd, nsecs, ssize;
+	struct iso_primary_descriptor ipd;
+
+	if ((fd = open(filenamep, O_RDONLY)) < 0) {
+		perror(filenamep);
+		fprintf(stderr, _("%s: failed to open: %s\n"),
+			progname, filenamep);
+		exit(1);
+	}
+	if (lseek(fd, 16 << 11, 0) == (off_t)-1) {
+		perror("lseek");
+		fprintf(stderr, _("%s: seek error on %s\n"),
+			progname, filenamep);
+		exit(1);
+	}
+	if (read(fd, &ipd, sizeof(ipd)) < 0) {
+		perror("read");
+		fprintf(stderr, _("%s: read error on %s\n"),
+			progname, filenamep);
+		exit(1);
+	}
+
+	nsecs = isonum_733(ipd.volume_space_size);
+	ssize = isonum_723(ipd.logical_block_size); /* nowadays always 2048 */
+
+	if (xflag) {
+		printf (_("sector count: %d, sector size: %d\n"),
+			nsecs, ssize);
+	} else {
+		long long product = nsecs;
+
+		if (divisor == 0)
+			printf ("%lld\n", product * ssize);
+		else if (divisor == ssize)
+			printf ("%d\n", nsecs);
+		else
+			printf ("%lld\n", (product * ssize) / divisor);
+	}
+
+	close(fd);
+}
+
+int
+main(int argc, char * argv[]) {
+	int j, ct;
+	char *p;
+
+	progname = argv[0];
+	if ((p = strrchr(progname, '/')) != NULL)
+		progname = p+1;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	if (argc >= 2 &&
+	    (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+		printf(_("%s (%s)\n"), progname, PACKAGE_STRING);
+		exit(0);
+	}
+
+	for (;;) {
+		int opt;
+
+		opt = getopt(argc, argv, "xd:");
+		if (opt == -1)
+			break;
+		switch (opt) {
+		case 'd':
+			divisor = atoi(optarg);
+			break;
+		case 'x':
+			xflag = 1;
+			break;
+		default:
+			fprintf(stderr,
+				_("%s: option parse error\n"), progname);
+			exit(1);
+		}
+	}
+
+	ct = argc - optind;
+
+	if (ct <= 0) {
+		fprintf(stderr, _("Usage: %s [-x] [-d <num>] iso9660-image\n"),
+			progname);
+		exit(1);
+	}
+
+	for (j = optind; j < argc; j++) {
+		if (ct > 1)
+			printf("%s: ", argv[j]);
+		isosize(argv[j]);
+	}
+
+	return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/minix.h b/util-linux-ng-2.17.2/disk-utils/minix.h
new file mode 100644
index 0000000..638565e
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/minix.h
@@ -0,0 +1,63 @@
+#ifdef KERNEL_INCLUDES_ARE_CLEAN
+
+#include <linux/fs.h>
+#include <linux/minix_fs.h>
+
+#else
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+
+struct minix_inode {
+        u16 i_mode;
+        u16 i_uid;
+        u32 i_size;
+        u32 i_time;
+        u8  i_gid;
+        u8  i_nlinks;
+        u16 i_zone[9];
+};
+
+struct minix2_inode {
+        u16 i_mode;
+        u16 i_nlinks;
+        u16 i_uid;
+        u16 i_gid;
+        u32 i_size;
+        u32 i_atime;
+        u32 i_mtime;
+        u32 i_ctime;
+        u32 i_zone[10];
+};
+
+struct minix_super_block {
+        u16 s_ninodes;
+        u16 s_nzones;
+        u16 s_imap_blocks;
+        u16 s_zmap_blocks;
+        u16 s_firstdatazone;
+        u16 s_log_zone_size;
+        u32 s_max_size;
+        u16 s_magic;
+        u16 s_state;
+        u32 s_zones;
+};
+
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+
+#define NAME_MAX         255   /* # chars in a file name */
+
+#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
+#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
+
+#define MINIX_VALID_FS               0x0001          /* Clean fs. */
+#define MINIX_ERROR_FS               0x0002          /* fs has errors. */
+
+#define MINIX_SUPER_MAGIC    0x137F          /* original minix fs */
+#define MINIX_SUPER_MAGIC2   0x138F          /* minix fs, 30 char names */
+#define MINIX2_SUPER_MAGIC   0x2468	     /* minix V2 fs */
+#define MINIX2_SUPER_MAGIC2  0x2478	     /* minix V2 fs, 30 char names */
+
+#endif /* KERNEL_INCLUDES_ARE_CLEAN */
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.8 b/util-linux-ng-2.17.2/disk-utils/mkfs.8
new file mode 100644
index 0000000..80bfcb9
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.8
@@ -0,0 +1,114 @@
+.\" -*- nroff -*-
+.TH MKFS 8 "Jun 1995" "Version 1.9"
+.SH NAME
+mkfs \- build a Linux file system
+.SH SYNOPSIS
+.B mkfs
+.RB [ \-V ]
+.RB [ \-t
+.IR fstype ]
+.RI [ fs-options ]
+.I filesys
+.RI [ blocks ]
+.SH DESCRIPTION
+.B mkfs
+is used to build a Linux file system on a device, usually
+a hard disk partition.
+.I filesys
+is either the device name (e.g.
+.IR /dev/hda1 ,
+.IR /dev/sdb2 ),
+or a regular file that shall contain the file system.
+.I blocks
+is the number of blocks to be used for the file system.
+.PP
+The exit code returned by
+.B mkfs
+is 0 on success and 1 on failure.
+.PP
+In actuality,
+.B mkfs
+is simply a front-end for the various file system builders
+(\fBmkfs.\fIfstype\fR)
+available under Linux.
+The file system-specific builder is searched for in a number
+of directories like perhaps
+.IR /sbin ,
+.IR /sbin/fs ,
+.IR /sbin/fs.d ,
+.IR /etc/fs ,
+.I /etc
+(the precise list is defined at compile time but at least
+contains
+.I /sbin
+and
+.IR /sbin/fs ),
+and finally in the directories
+listed in the PATH environment variable.
+Please see the file system-specific builder manual pages for
+further details.
+.SH OPTIONS
+.TP
+.B -V
+Produce verbose output, including all file system-specific commands
+that are executed.
+Specifying this option more than once inhibits execution of any
+file system-specific commands.
+This is really only useful for testing.
+.TP
+.BI -t \ fstype
+Specifies the type of file system to be built.
+If not specified, the default file system type
+(currently ext2) is used.
+.TP
+.I fs-options
+File system-specific options to be passed to the real file
+system builder.
+Although not guaranteed, the following options are supported
+by most file system builders.
+.TP
+.B -c
+Check the device for bad blocks before building the file system.
+.TP
+.BI -l \ filename
+Read the bad blocks list from
+.I filename
+.TP
+.B -v
+Produce verbose output.
+.SH BUGS
+All generic options must precede and not be combined with
+file system-specific options.
+Some file system-specific programs do not support the
+.I -v
+(verbose) option, nor return meaningful exit codes.
+Also, some file system-specific programs do not automatically
+detect the device size and require the
+.I blocks
+parameter to be specified.
+.SH AUTHORS
+David Engel (david@ods.com)
+.br
+Fred N. van Kempen (waltje@uwalt.nl.mugnet.org)
+.br
+Ron Sommeling (sommel@sci.kun.nl)
+.br
+The manual page was shamelessly adapted from Remy Card's version
+for the ext2 file system.
+.SH SEE ALSO
+.BR fs (5),
+.BR badblocks (8),
+.BR fsck (8),
+.BR mkdosfs (8),
+.BR mke2fs (8),
+.BR mkfs.bfs (8),
+.BR mkfs.ext2 (8),
+.BR mkfs.ext3 (8),
+.BR mkfs.minix (8),
+.BR mkfs.msdos (8),
+.BR mkfs.vfat (8),
+.BR mkfs.xfs (8),
+.BR mkfs.xiafs (8)
+.SH AVAILABILITY
+The mkfs command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.bfs.8 b/util-linux-ng-2.17.2/disk-utils/mkfs.bfs.8
new file mode 100644
index 0000000..d120506
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.bfs.8
@@ -0,0 +1,48 @@
+.\" Copyright 1999 Andries E. Brouwer (aeb@cwi.nl)
+.\" May be freely distributed.
+.TH MKFS.BFS 8 "12 Sept 1999" "Util-linux 2.9x" "Linux System Administrator's Manual"
+.SH NAME
+mkfs.bfs \- make an SCO bfs filesystem
+.SH SYNOPSIS
+.B mkfs.bfs
+.RB [ \-N
+.IR nr-of-inodes ]
+.RB [ \-V
+.IR volume-name ]
+.RB [ \-F
+.IR fsname ]
+.I device
+.RI [ size-in-blocks ]
+.SH DESCRIPTION
+.B mkfs.bfs
+creates an SCO bfs file-system on a block device
+(usually a disk partition or a file accessed via the loop device).
+
+The
+.I size-in-blocks
+parameter is the desired size of the file system, in blocks.
+If nothing is specified, the entire partition will be used.
+.SH OPTIONS
+.TP
+.B \-N
+Specify the desired number of inodes (at most 512).
+If nothing is specified some default number in the range 48-512 is picked
+depending on the size of the partition.
+.TP
+.BI \-V " volume-label"
+Specify the volume label. I have no idea if/where this is used.
+.TP
+.BI \-F " fsname"
+Specify the fsname. I have no idea if/where this is used.
+.TP
+.B \-v
+Be verbose.
+.SH "EXIT CODES"
+The exit code returned by
+.B mkfs.bfs
+is 0 when all went well, and 1 when something went wrong.
+.SH "SEE ALSO"
+.BR mkfs (8).
+.SH AVAILABILITY
+The mkfs.bfs command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.bfs.c b/util-linux-ng-2.17.2/disk-utils/mkfs.bfs.c
new file mode 100644
index 0000000..58f5352
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.bfs.c
@@ -0,0 +1,285 @@
+/*
+ *  mkfs.bfs - Create SCO BFS filesystem - aeb, 1999-09-07
+ *
+ *  Usage: mkfs.bfs [-N nr-of-inodes] [-V volume-name] [-F fsname] device
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <time.h>
+#include "nls.h"
+#include "blkdev.h"
+
+#define BFS_ROOT_INO		2
+#define BFS_NAMELEN		14
+#define BFS_BLOCKSIZE		512
+#define BFS_SUPER_MAGIC		0x1badface
+
+/* superblock - 512 bytes */
+struct bfssb {
+        unsigned int s_magic;
+        unsigned int s_start;	  /* byte offset of start of data */
+        unsigned int s_end;       /* sizeof(slice)-1 */
+
+        /* for recovery during compaction */
+        int s_from, s_to;         /* src and dest block of current transfer */
+        int s_backup_from, s_backup_to;
+
+        /* labels - may well contain garbage */
+        char s_fsname[6];
+        char s_volume[6];
+        char s_pad[472];
+};
+
+/* inode - 64 bytes */
+struct bfsi {
+        unsigned short i_ino;
+        unsigned char i_pad1[2];
+        unsigned long i_first_block;
+        unsigned long i_last_block;
+        unsigned long i_bytes_to_end;
+        unsigned long i_type;           /* 1: file, 2: the unique dir */
+        unsigned long i_mode;
+        unsigned long i_uid, i_gid;
+        unsigned long i_nlinks;
+        unsigned long i_atime, i_mtime, i_ctime;
+        unsigned char i_pad2[16];
+};
+
+#define BFS_DIR_TYPE	2
+
+/* directory entry - 16 bytes */
+struct bfsde {
+        unsigned short d_ino;
+        char d_name[BFS_NAMELEN];
+};
+
+
+static char *progname;
+
+static void
+fatal(char *s, ...) {
+    va_list p;
+
+    va_start(p, s);
+    fflush(stdout);
+    fprintf(stderr, "\n%s: ", progname);
+    vfprintf(stderr, s, p);
+    va_end(p);
+    fprintf(stderr, "\n");
+    exit(1);
+}
+
+static void
+usage(void) {
+	fprintf(stderr, _(
+		"Usage: %s [-v] [-N nr-of-inodes] [-V volume-name]\n"
+		"       [-F fsname] device [block-count]\n"),
+		progname);
+	exit(1);
+}
+
+int
+main(int argc, char *argv[]) {
+	char *device, *volume, *fsname;
+	int inodes;
+	unsigned long long total_blocks, ino_bytes, ino_blocks, data_blocks;
+	unsigned long long user_specified_total_blocks = 0;
+	int verbose = 0;
+	int fd;
+	struct bfssb sb;
+	struct bfsi ri;
+	struct bfsde de;
+	struct stat statbuf;
+	time_t now;
+	int c, i, len;
+	char *p;
+
+	progname = argv[0];
+	if ((p = strrchr(progname, '/')) != NULL)
+		progname = p+1;
+
+	if (argc < 2)
+		usage();
+
+	if (argc == 2 &&
+	    (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+		printf(_("%s (%s)\n"), progname, PACKAGE_STRING);
+		exit(0);
+	}
+
+	volume = fsname = "      ";	/* is there a default? */
+	inodes = 0;
+
+	while ((c = getopt(argc, argv, "vF:N:V:cl:")) != -1) {
+		switch (c) {
+		case 'N':
+			inodes = atol(optarg);
+			break;
+
+		case 'V':
+			len = strlen(optarg);
+			if (len <= 0 || len > 6)
+				fatal(_("volume name too long"));
+			volume = strdup(optarg);
+			break;
+
+		case 'F':
+			len = strlen(optarg);
+			if (len <= 0 || len > 6)
+				fatal(_("fsname name too long"));
+			fsname = strdup(optarg);
+			break;
+
+		case 'v':
+			verbose = 1;
+			break;
+
+			/* when called via mkfs we may get options c,l,v */
+		case 'c':
+		case 'l':
+			break;
+
+		default:
+			usage();
+		}
+	}
+
+	if (optind == argc)
+		usage();
+
+	device = argv[optind++];
+
+	if (stat(device, &statbuf) == -1) {
+		perror(device);
+		fatal(_("cannot stat device %s"), device);
+	}
+
+	if (!S_ISBLK(statbuf.st_mode))
+		fatal(_("%s is not a block special device"), device);
+
+	fd = open(device, O_RDWR | O_EXCL);
+	if (fd == -1) {
+		perror(device);
+		fatal(_("cannot open %s"), device);
+	}
+
+	if (optind == argc-1)
+		user_specified_total_blocks = atoll(argv[optind]);
+	else if (optind != argc)
+		usage();
+
+	if (blkdev_get_sectors(fd, &total_blocks) == -1) {
+		if (!user_specified_total_blocks) {
+			perror("blkdev_get_sectors");
+			fatal(_("cannot get size of %s"), device);
+		}
+		total_blocks = user_specified_total_blocks;
+	} else if (user_specified_total_blocks) {
+		if (user_specified_total_blocks > total_blocks)
+			fatal(_("blocks argument too large, max is %llu"),
+			      total_blocks);
+		total_blocks = user_specified_total_blocks;
+	}
+
+	if (!inodes) {
+		/* pick some reasonable default */
+		inodes = 8*(total_blocks/800);
+		if (inodes < 48)
+			inodes = 48;
+		if (inodes > 512)
+			inodes = 512;
+	} else {
+		/* believe the user */
+		if (inodes > 512)
+			fatal(_("too many inodes - max is 512"));
+	}
+
+	ino_bytes = inodes * sizeof(struct bfsi);
+	ino_blocks = (ino_bytes + BFS_BLOCKSIZE - 1) / BFS_BLOCKSIZE;
+	data_blocks = total_blocks - ino_blocks - 1;
+
+	/* mimic the behaviour of SCO's mkfs - maybe this limit is needed */
+	if (data_blocks < 32)
+		fatal(_("not enough space, need at least %llu blocks"),
+		      ino_blocks + 33);
+
+	memset(&sb, 0, sizeof(sb));
+	sb.s_magic = BFS_SUPER_MAGIC;
+	sb.s_start = ino_bytes + sizeof(struct bfssb);
+	sb.s_end = total_blocks * BFS_BLOCKSIZE - 1;
+	sb.s_from = sb.s_to = sb.s_backup_from = sb.s_backup_to = -1;
+	memcpy(sb.s_fsname, fsname, 6);
+	memcpy(sb.s_volume, volume, 6);
+
+	if (verbose) {
+		fprintf(stderr, _("Device: %s\n"), device);
+		fprintf(stderr, _("Volume: <%-6s>\n"), volume);
+		fprintf(stderr, _("FSname: <%-6s>\n"), fsname);
+		fprintf(stderr, _("BlockSize: %d\n"), BFS_BLOCKSIZE);
+		if (ino_blocks==1)
+			fprintf(stderr, _("Inodes: %d (in 1 block)\n"),
+				inodes);
+		else
+			fprintf(stderr, _("Inodes: %d (in %lld blocks)\n"),
+				inodes, ino_blocks);
+		fprintf(stderr, _("Blocks: %lld\n"), total_blocks);
+		fprintf(stderr, _("Inode end: %d, Data end: %d\n"),
+			sb.s_start-1, sb.s_end);
+	}
+
+	if (write(fd, &sb, sizeof(sb)) != sizeof(sb))
+		fatal(_("error writing superblock"));
+
+	memset(&ri, 0, sizeof(ri));
+	ri.i_ino = BFS_ROOT_INO;
+	ri.i_first_block = 1 + ino_blocks;
+	ri.i_last_block = ri.i_first_block +
+		(inodes * sizeof(de) - 1) / BFS_BLOCKSIZE;
+	ri.i_bytes_to_end = ri.i_first_block * BFS_BLOCKSIZE
+		+ 2 * sizeof(struct bfsde) - 1;
+	ri.i_type = BFS_DIR_TYPE;
+	ri.i_mode = S_IFDIR | 0755; 	/* or just 0755 */
+	ri.i_uid = 0;
+	ri.i_gid = 1;			/* random */
+	ri.i_nlinks = 2;
+	time(&now);
+	ri.i_atime = now;
+	ri.i_mtime = now;
+	ri.i_ctime = now;
+
+	if (write(fd, &ri, sizeof(ri)) != sizeof(ri))
+		fatal(_("error writing root inode"));
+
+	memset(&ri, 0, sizeof(ri));
+	for (i=1; i<inodes; i++)
+		if (write(fd, &ri, sizeof(ri)) != sizeof(ri))
+			fatal(_("error writing inode"));
+
+	if (lseek(fd, (1 + ino_blocks)*BFS_BLOCKSIZE, SEEK_SET) == -1)
+		fatal(_("seek error"));
+
+	memset(&de, 0, sizeof(de));
+	de.d_ino = BFS_ROOT_INO;
+	memcpy(de.d_name, ".", 1);
+	if (write(fd, &de, sizeof(de)) != sizeof(de))
+		fatal(_("error writing . entry"));
+
+	memcpy(de.d_name, "..", 2);
+	if (write(fd, &de, sizeof(de)) != sizeof(de))
+		fatal(_("error writing .. entry"));
+
+	if (close(fd) == -1) {
+		perror(device);
+		fatal(_("error closing %s"), device);
+	}
+
+	return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.c b/util-linux-ng-2.17.2/disk-utils/mkfs.c
new file mode 100644
index 0000000..120da06
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.c
@@ -0,0 +1,116 @@
+/*
+ * mkfs		A simple generic frontend for the for the mkfs program
+ *		under Linux.  See the manual page for details.
+ *
+ * Usage:	mkfs [-V] [-t fstype] [fs-options] device [size]
+ *
+ * Authors:	David Engel, <david@ods.com>
+ *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *		Ron Sommeling, <sommel@sci.kun.nl>
+ *
+ * Mon Jul  1 18:52:58 1996: janl@math.uio.no (Nicolai Langfeldt):
+ *	Incorporated fix by Jonathan Kamens <jik@annex-1-slip-jik.cam.ov.com>
+ * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ * - added Native Language Support
+ *	
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <getopt.h>
+#include <nls.h>
+
+#ifndef DEFAULT_FSTYPE
+# define DEFAULT_FSTYPE		"ext2"
+#endif
+
+#define SEARCH_PATH	"PATH=/sbin:/sbin/fs:/sbin/fs.d:/etc/fs:/etc"
+#define PROGNAME	"mkfs.%s"
+
+
+int main(int argc, char *argv[])
+{
+  char *progname;	/* name of executable to be called */
+  char *fstype = NULL;
+  int i, more = 0, verbose = 0;
+  char *oldpath, *newpath;
+  char *program_name, *p;
+
+  program_name = argv[0];
+  if ((p = strrchr(program_name, '/')) != NULL)
+	  program_name = p+1;
+
+  setlocale(LC_ALL, "");
+  bindtextdomain(PACKAGE, LOCALEDIR);
+  textdomain(PACKAGE);
+
+  if (argc == 2 &&
+      (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+	  printf(_("%s (%s)\n"), program_name, PACKAGE_STRING);
+	  exit(0);
+  }
+
+  /* Check commandline options. */
+  opterr = 0;
+  while ((more == 0) && ((i = getopt(argc, argv, "Vt:")) != -1))
+    switch (i) {
+    case 'V':
+      verbose++;
+      break;
+    case 't':
+      fstype = optarg;
+      break;
+    default:
+      optind--;
+      more = 1;
+      break;		/* start of specific arguments */
+    }
+  if (optind == argc) {
+    fprintf(stderr,
+      _("Usage: mkfs [-V] [-t fstype] [fs-options] device [size]\n"));
+    return -1;
+  }
+  
+  /* If -t wasn't specified, use the default */
+  if (fstype == NULL)
+    fstype = DEFAULT_FSTYPE;
+
+  /* Set PATH and program name */
+  oldpath = getenv("PATH");
+  if (!oldpath)
+	  oldpath = "/bin";
+
+  newpath = (char *) malloc(strlen(oldpath) + sizeof(SEARCH_PATH) + 3);
+  if (!newpath) {
+    fprintf(stderr, _("%s: Out of memory!\n"), "mkfs");
+    exit(1);
+  }
+  sprintf(newpath, "%s:%s\n", SEARCH_PATH, oldpath);
+  putenv(newpath);
+
+  progname = (char *) malloc(sizeof(PROGNAME) + strlen(fstype) + 1);
+  if (!progname) {
+    fprintf(stderr, _("%s: Out of memory!\n"), "mkfs");
+    exit(1);
+  }
+  sprintf(progname, PROGNAME, fstype);
+  argv[--optind] = progname;
+
+  if (verbose) {
+    printf(_("mkfs (%s)\n"), PACKAGE_STRING);
+    i = optind;
+    while (argv[i])
+      printf("%s ", argv[i++]);
+    printf("\n");
+    if (verbose > 1)
+      return 0;
+  }
+
+  /* Execute the program */
+  execvp(progname, argv+optind);
+  perror(progname);
+  return 1;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.cramfs.c b/util-linux-ng-2.17.2/disk-utils/mkfs.cramfs.c
new file mode 100644
index 0000000..4ffa908
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.cramfs.c
@@ -0,0 +1,975 @@
+/*
+ * mkcramfs - make a cramfs file system
+ *
+ * Copyright (C) 1999-2002 Transmeta Corporation
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/*
+ * Old version would die on largish filesystems. Change to mmap the
+ * files one by one instaed of all simultaneously. - aeb, 2002-11-01
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <getopt.h>
+#include <stdarg.h>
+#include <zlib.h>
+
+#include "cramfs.h"
+#include "cramfs_common.h"
+#include "md5.h"
+#include "nls.h"
+
+/* Exit codes used by mkfs-type programs */
+#define MKFS_OK          0     /* No errors */
+#define MKFS_ERROR       8     /* Operational error */
+#define MKFS_USAGE       16    /* Usage or syntax error */
+
+/* The kernel only supports PAD_SIZE of 0 and 512. */
+#define PAD_SIZE 512
+
+static const char *progname = "mkcramfs";
+static int verbose = 0;
+
+static unsigned int blksize; /* settable via -b option */
+static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
+static int image_length = 0;
+static int cramfs_is_big_endian = 0; /* target is big endian */
+
+/*
+ * If opt_holes is set, then mkcramfs can create explicit holes in the
+ * data, which saves 26 bytes per hole (which is a lot smaller a
+ * saving than for most filesystems).
+ *
+ * Note that kernels up to at least 2.3.39 don't support cramfs holes,
+ * which is why this is turned off by default.
+ */
+static int opt_edition = 0;
+static int opt_errors = 0;
+static int opt_holes = 0;
+static int opt_pad = 0;
+static char *opt_image = NULL;
+static char *opt_name = NULL;
+
+static int warn_dev = 0;
+static int warn_gid = 0;
+static int warn_namelen = 0;
+static int warn_skip = 0;
+static int warn_size = 0;
+static int warn_uid = 0;
+
+#ifndef MIN
+# define MIN(_a,_b) ((_a) < (_b) ? (_a) : (_b))
+#endif
+
+/* entry.flags */
+#define CRAMFS_EFLAG_MD5	1
+#define CRAMFS_EFLAG_INVALID	2
+
+/* In-core version of inode / directory entry. */
+struct entry {
+	/* stats */
+	unsigned char *name;
+	unsigned int mode, size, uid, gid;
+	unsigned char md5sum[16];
+	unsigned char flags;	   /* CRAMFS_EFLAG_* */
+
+	/* FS data */
+	char *path;
+	int fd;			    /* temporarily open files while mmapped */
+        struct entry *same;	    /* points to other identical file */
+        unsigned int offset;        /* pointer to compressed data in archive */
+	unsigned int dir_offset;    /* offset of directory entry in archive */
+
+	/* organization */
+	struct entry *child;	    /* NULL for non-directory and empty dir */
+	struct entry *next;
+};
+
+/*
+ * Width of various bitfields in struct cramfs_inode.
+ * Used only to generate warnings.
+ */
+#define CRAMFS_SIZE_WIDTH 24
+#define CRAMFS_UID_WIDTH 16
+#define CRAMFS_GID_WIDTH 8
+#define CRAMFS_OFFSET_WIDTH 26
+
+/* Input status of 0 to print help and exit without an error. */
+static void
+usage(int status) {
+	FILE *stream = status ? stderr : stdout;
+
+	fprintf(stream,
+		_("usage: %s [-h] [-v] [-b blksize] [-e edition] [-N endian] [-i file] "
+		  "[-n name] dirname outfile\n"
+		  " -h         print this help\n"
+		  " -v         be verbose\n"
+		  " -E         make all warnings errors "
+		    "(non-zero exit status)\n"
+		  " -b blksize use this blocksize, must equal page size\n"
+		  " -e edition set edition number (part of fsid)\n"
+		  " -N endian  set cramfs endianness (big|little|host), default host\n"
+		  " -i file    insert a file image into the filesystem "
+		    "(requires >= 2.4.0)\n"
+		  " -n name    set name of cramfs filesystem\n"
+		  " -p         pad by %d bytes for boot code\n"
+		  " -s         sort directory entries (old option, ignored)\n"
+		  " -z         make explicit holes (requires >= 2.3.39)\n"
+		  " dirname    root of the filesystem to be compressed\n"
+		  " outfile    output file\n"),
+		progname, PAD_SIZE);
+
+	exit(status);
+}
+
+/* malloc or die */
+static void *
+xmalloc (size_t size) {
+	void *t = malloc(size);
+	if (t == NULL) {
+		perror(NULL);
+		exit(8);	/* out of memory */
+	}
+	return t;
+}
+
+static char *
+do_mmap(char *path, unsigned int size, unsigned int mode){
+	int fd;
+	char *start;
+
+	if (!size)
+		return NULL;
+
+	if (S_ISLNK(mode)) {
+		start = xmalloc(size);
+		if (readlink(path, start, size) < 0) {
+			perror(path);
+			warn_skip = 1;
+			start = NULL;
+		}
+		return start;
+	}
+
+	fd = open(path, O_RDONLY);
+	if (fd < 0) {
+		perror(path);
+		warn_skip = 1;
+		return NULL;
+	}
+
+	start = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
+	if (-1 == (int) (long) start) {
+		perror("mmap");
+		exit(8);
+	}
+	close(fd);
+
+	return start;
+}
+
+static void
+do_munmap(char *start, unsigned int size, unsigned int mode){
+	if (S_ISLNK(mode))
+		free(start);
+	else
+		munmap(start, size);
+}
+
+/* compute md5sums, so that we do not have to compare every pair of files */
+static void
+mdfile(struct entry *e) {
+	MD5_CTX ctx;
+	char *start;
+
+	start = do_mmap(e->path, e->size, e->mode);
+	if (start == NULL) {
+		e->flags |= CRAMFS_EFLAG_INVALID;
+	} else {
+		MD5Init(&ctx);
+		MD5Update(&ctx, (unsigned char *) start, e->size);
+		MD5Final(e->md5sum, &ctx);
+
+		do_munmap(start, e->size, e->mode);
+
+		e->flags |= CRAMFS_EFLAG_MD5;
+	}
+}
+
+/* md5 digests are equal; files are almost certainly the same,
+   but just to be sure, do the comparison */
+static int
+identical_file(struct entry *e1, struct entry *e2){
+	char *start1, *start2;
+	int equal;
+
+	start1 = do_mmap(e1->path, e1->size, e1->mode);
+	if (!start1)
+		return 0;
+	start2 = do_mmap(e2->path, e2->size, e2->mode);
+	if (!start2)
+		return 0;
+	equal = !memcmp(start1, start2, e1->size);
+	do_munmap(start1, e1->size, e1->mode);
+	do_munmap(start2, e2->size, e2->mode);
+	return equal;
+}
+
+/*
+ * The longest file name component to allow for in the input directory tree.
+ * Ext2fs (and many others) allow up to 255 bytes.  A couple of filesystems
+ * allow longer (e.g. smbfs 1024), but there isn't much use in supporting
+ * >255-byte names in the input directory tree given that such names get
+ * truncated to 255 bytes when written to cramfs.
+ */
+#define MAX_INPUT_NAMELEN 255
+
+static int find_identical_file(struct entry *orig, struct entry *new, loff_t *fslen_ub)
+{
+        if (orig == new)
+		return 1;
+        if (!orig)
+		return 0;
+        if (orig->size == new->size && orig->path) {
+		if (!orig->flags)
+			mdfile(orig);
+		if (!new->flags)
+			mdfile(new);
+
+		if ((orig->flags & CRAMFS_EFLAG_MD5) &&
+		    (new->flags & CRAMFS_EFLAG_MD5) &&
+		    !memcmp(orig->md5sum, new->md5sum, 16) &&
+		    identical_file(orig, new)) {
+			new->same = orig;
+			*fslen_ub -= new->size;
+			return 1;
+		}
+        }
+        return find_identical_file(orig->child, new, fslen_ub) ||
+                   find_identical_file(orig->next, new, fslen_ub);
+}
+
+static void eliminate_doubles(struct entry *root, struct entry *orig, loff_t *fslen_ub) {
+        if (orig) {
+                if (orig->size && orig->path)
+			find_identical_file(root,orig, fslen_ub);
+                eliminate_doubles(root,orig->child, fslen_ub);
+                eliminate_doubles(root,orig->next, fslen_ub);
+        }
+}
+
+/*
+ * We define our own sorting function instead of using alphasort which
+ * uses strcoll and changes ordering based on locale information.
+ */
+static int cramsort (const struct dirent **a, const struct dirent **b)
+{
+	return strcmp((*a)->d_name, (*b)->d_name);
+}
+
+static unsigned int parse_directory(struct entry *root_entry, const char *name, struct entry **prev, loff_t *fslen_ub)
+{
+	struct dirent **dirlist;
+	int totalsize = 0, dircount, dirindex;
+	char *path, *endpath;
+	size_t len = strlen(name);
+
+	/* Set up the path. */
+	/* TODO: Reuse the parent's buffer to save memcpy'ing and duplication. */
+	path = xmalloc(len + 1 + MAX_INPUT_NAMELEN + 1);
+	memcpy(path, name, len);
+	endpath = path + len;
+	*endpath = '/';
+	endpath++;
+
+        /* read in the directory and sort */
+        dircount = scandir(name, &dirlist, 0, cramsort);
+
+	if (dircount < 0) {
+		perror(name);
+		exit(8);
+	}
+
+	/* process directory */
+	for (dirindex = 0; dirindex < dircount; dirindex++) {
+		struct dirent *dirent;
+		struct entry *entry;
+		struct stat st;
+		int size;
+		size_t namelen;
+
+		dirent = dirlist[dirindex];
+
+		/* Ignore "." and ".." - we won't be adding them
+		   to the archive */
+		if (dirent->d_name[0] == '.') {
+			if (dirent->d_name[1] == '\0')
+				continue;
+			if (dirent->d_name[1] == '.') {
+				if (dirent->d_name[2] == '\0')
+					continue;
+			}
+		}
+		namelen = strlen(dirent->d_name);
+		if (namelen > MAX_INPUT_NAMELEN) {
+			fprintf(stderr,
+				_("Very long (%zu bytes) filename `%s' found.\n"
+				  " Please increase MAX_INPUT_NAMELEN in "
+				  "mkcramfs.c and recompile.  Exiting.\n"),
+				namelen, dirent->d_name);
+			exit(8);
+		}
+		memcpy(endpath, dirent->d_name, namelen + 1);
+
+		if (lstat(path, &st) < 0) {
+			perror(endpath);
+			warn_skip = 1;
+			continue;
+		}
+		entry = calloc(1, sizeof(struct entry));
+		if (!entry) {
+			perror(NULL);
+			exit(8);
+		}
+		entry->name = (unsigned char *)strdup(dirent->d_name);
+		if (!entry->name) {
+			perror(NULL);
+			exit(8);
+		}
+		if (namelen > 255) {
+			/* Can't happen when reading from ext2fs. */
+
+			/* TODO: we ought to avoid chopping in half
+			   multi-byte UTF8 characters. */
+			entry->name[namelen = 255] = '\0';
+			warn_namelen = 1;
+		}
+		entry->mode = st.st_mode;
+		entry->size = st.st_size;
+		entry->uid = st.st_uid;
+		if (entry->uid >= 1 << CRAMFS_UID_WIDTH)
+			warn_uid = 1;
+		entry->gid = st.st_gid;
+		if (entry->gid >= 1 << CRAMFS_GID_WIDTH)
+			/* TODO: We ought to replace with a default
+                           gid instead of truncating; otherwise there
+                           are security problems.  Maybe mode should
+                           be &= ~070.  Same goes for uid once Linux
+                           supports >16-bit uids. */
+			warn_gid = 1;
+		size = sizeof(struct cramfs_inode) + ((namelen + 3) & ~3);
+		*fslen_ub += size;
+		if (S_ISDIR(st.st_mode)) {
+			entry->size = parse_directory(root_entry, path, &entry->child, fslen_ub);
+		} else if (S_ISREG(st.st_mode)) {
+			entry->path = strdup(path);
+			if (entry->size) {
+				if (entry->size >= (1 << CRAMFS_SIZE_WIDTH)) {
+					warn_size = 1;
+					entry->size = (1 << CRAMFS_SIZE_WIDTH) - 1;
+				}
+			}
+		} else if (S_ISLNK(st.st_mode)) {
+			entry->path = strdup(path);
+		} else if (S_ISFIFO(st.st_mode) || S_ISSOCK(st.st_mode)) {
+			/* maybe we should skip sockets */
+			entry->size = 0;
+		} else {
+			entry->size = st.st_rdev;
+			if (entry->size & -(1<<CRAMFS_SIZE_WIDTH))
+				warn_dev = 1;
+		}
+
+		if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
+			int blocks = ((entry->size - 1) / blksize + 1);
+
+			/* block pointers & data expansion allowance + data */
+			if (entry->size)
+				*fslen_ub += (4+26)*blocks + entry->size + 3;
+                }
+
+		/* Link it into the list */
+		*prev = entry;
+		prev = &entry->next;
+		totalsize += size;
+	}
+	free(path);
+	free(dirlist);		/* allocated by scandir() with malloc() */
+	return totalsize;
+}
+
+/* Returns sizeof(struct cramfs_super), which includes the root inode. */
+static unsigned int write_superblock(struct entry *root, char *base, int size)
+{
+	struct cramfs_super *super = (struct cramfs_super *) base;
+	unsigned int offset = sizeof(struct cramfs_super) + image_length;
+
+	if (opt_pad) {
+		offset += opt_pad;
+	}
+
+	super->magic = CRAMFS_MAGIC;
+	super->flags = CRAMFS_FLAG_FSID_VERSION_2 | CRAMFS_FLAG_SORTED_DIRS;
+	if (opt_holes)
+		super->flags |= CRAMFS_FLAG_HOLES;
+	if (image_length > 0)
+		super->flags |= CRAMFS_FLAG_SHIFTED_ROOT_OFFSET;
+	super->size = size;
+	memcpy(super->signature, CRAMFS_SIGNATURE, sizeof(super->signature));
+
+	super->fsid.crc = crc32(0L, Z_NULL, 0);
+	super->fsid.edition = opt_edition;
+	super->fsid.blocks = total_blocks;
+	super->fsid.files = total_nodes;
+
+	memset(super->name, 0x00, sizeof(super->name));
+	if (opt_name)
+		strncpy((char *)super->name, opt_name, sizeof(super->name));
+	else
+		strncpy((char *)super->name, "Compressed", sizeof(super->name));
+
+	super->root.mode = root->mode;
+	super->root.uid = root->uid;
+	super->root.gid = root->gid;
+	super->root.size = root->size;
+	super->root.offset = offset >> 2;
+
+	super_toggle_endianness(cramfs_is_big_endian, super);
+	inode_from_host(cramfs_is_big_endian, &super->root, &super->root);
+
+	return offset;
+}
+
+static void set_data_offset(struct entry *entry, char *base, unsigned long offset)
+{
+	struct cramfs_inode *inode = (struct cramfs_inode *) (base + entry->dir_offset);
+	inode_to_host(cramfs_is_big_endian, inode, inode);
+	if (offset >= (1 << (2 + CRAMFS_OFFSET_WIDTH))) {
+		fprintf(stderr, _("filesystem too big.  Exiting.\n"));
+		exit(8);
+	}
+	inode->offset = (offset >> 2);
+	inode_from_host(cramfs_is_big_endian, inode, inode);
+}
+
+
+/*
+ * We do a width-first printout of the directory
+ * entries, using a stack to remember the directories
+ * we've seen.
+ */
+static unsigned int write_directory_structure(struct entry *entry, char *base, unsigned int offset)
+{
+	int stack_entries = 0;
+	int stack_size = 64;
+	struct entry **entry_stack;
+
+	entry_stack = xmalloc(stack_size * sizeof(struct entry *));
+
+	for (;;) {
+		int dir_start = stack_entries;
+		while (entry) {
+			struct cramfs_inode *inode =
+				(struct cramfs_inode *) (base + offset);
+			size_t len = strlen((const char *)entry->name);
+
+			entry->dir_offset = offset;
+
+			inode->mode = entry->mode;
+			inode->uid = entry->uid;
+			inode->gid = entry->gid;
+			inode->size = entry->size;
+			inode->offset = 0;
+			/* Non-empty directories, regfiles and symlinks will
+			   write over inode->offset later. */
+
+			offset += sizeof(struct cramfs_inode);
+			total_nodes++;	/* another node */
+			memcpy(base + offset, entry->name, len);
+			/* Pad up the name to a 4-byte boundary */
+			while (len & 3) {
+				*(base + offset + len) = '\0';
+				len++;
+			}
+			inode->namelen = len >> 2;
+			offset += len;
+
+			if (verbose)
+				printf("  %s\n", entry->name);
+			if (entry->child) {
+				if (stack_entries >= stack_size) {
+					stack_size *= 2;
+					entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *));
+					if (!entry_stack) {
+						perror(NULL);
+						exit(8);        /* out of memory */
+					}
+				}
+				entry_stack[stack_entries] = entry;
+				stack_entries++;
+			}
+			inode_from_host(cramfs_is_big_endian, inode, inode);
+			entry = entry->next;
+		}
+
+		/*
+		 * Reverse the order the stack entries pushed during
+                 * this directory, for a small optimization of disk
+                 * access in the created fs.  This change makes things
+                 * `ls -UR' order.
+		 */
+		{
+			struct entry **lo = entry_stack + dir_start;
+			struct entry **hi = entry_stack + stack_entries;
+			struct entry *tmp;
+
+			while (lo < --hi) {
+				tmp = *lo;
+				*lo++ = *hi;
+				*hi = tmp;
+			}
+		}
+
+		/* Pop a subdirectory entry from the stack, and recurse. */
+		if (!stack_entries)
+			break;
+		stack_entries--;
+		entry = entry_stack[stack_entries];
+
+		set_data_offset(entry, base, offset);
+		if (verbose)
+			printf("'%s':\n", entry->name);
+		entry = entry->child;
+	}
+	free(entry_stack);
+	return offset;
+}
+
+static int is_zero(unsigned char const *begin, unsigned len)
+{
+	if (opt_holes)
+		/* Returns non-zero iff the first LEN bytes from BEGIN are
+		   all NULs. */
+		return (len-- == 0 ||
+			(begin[0] == '\0' &&
+			 (len-- == 0 ||
+			  (begin[1] == '\0' &&
+			   (len-- == 0 ||
+			    (begin[2] == '\0' &&
+			     (len-- == 0 ||
+			      (begin[3] == '\0' &&
+			       memcmp(begin, begin + 4, len) == 0))))))));
+	else
+		/* Never create holes. */
+		return 0;
+}
+
+/*
+ * One 4-byte pointer per block and then the actual blocked
+ * output. The first block does not need an offset pointer,
+ * as it will start immediately after the pointer block;
+ * so the i'th pointer points to the end of the i'th block
+ * (i.e. the start of the (i+1)'th block or past EOF).
+ *
+ * Note that size > 0, as a zero-sized file wouldn't ever
+ * have gotten here in the first place.
+ */
+static unsigned int
+do_compress(char *base, unsigned int offset, unsigned char const *name,
+	    char *path, unsigned int size, unsigned int mode)
+{
+	unsigned long original_size, original_offset, new_size, blocks, curr;
+	long change;
+	char *start;
+	Bytef *p;
+
+	/* get uncompressed data */
+	start = do_mmap(path, size, mode);
+	if (start == NULL)
+		return offset;
+	p = (Bytef *) start;
+
+	original_size = size;
+	original_offset = offset;
+	blocks = (size - 1) / blksize + 1;
+	curr = offset + 4 * blocks;
+
+	total_blocks += blocks;
+
+	do {
+		uLongf len = 2 * blksize;
+		uLongf input = size;
+		if (input > blksize)
+			input = blksize;
+		size -= input;
+		if (!is_zero (p, input)) {
+			compress((Bytef *)(base + curr), &len, p, input);
+			curr += len;
+		}
+		p += input;
+
+		if (len > blksize*2) {
+			/* (I don't think this can happen with zlib.) */
+			printf(_("AIEEE: block \"compressed\" to > "
+				 "2*blocklength (%ld)\n"),
+			       len);
+			exit(8);
+		}
+
+		*(u32 *) (base + offset) = u32_toggle_endianness(cramfs_is_big_endian, curr);
+		offset += 4;
+	} while (size);
+
+	do_munmap(start, original_size, mode);
+
+	curr = (curr + 3) & ~3;
+	new_size = curr - original_offset;
+	/* TODO: Arguably, original_size in these 2 lines should be
+	   st_blocks * 512.  But if you say that, then perhaps
+	   administrative data should also be included in both. */
+	change = new_size - original_size;
+	if (verbose)
+		printf(_("%6.2f%% (%+ld bytes)\t%s\n"),
+		       (change * 100) / (double) original_size, change, name);
+
+	return curr;
+}
+
+
+/*
+ * Traverse the entry tree, writing data for every item that has
+ * non-null entry->path (i.e. every symlink and non-empty
+ * regfile).
+ */
+static unsigned int
+write_data(struct entry *entry, char *base, unsigned int offset) {
+	struct entry *e;
+
+	for (e = entry; e; e = e->next) {
+		if (e->path) {
+                        if (e->same) {
+                                set_data_offset(e, base, e->same->offset);
+                                e->offset = e->same->offset;
+                        } else if (e->size) {
+                                set_data_offset(e, base, offset);
+                                e->offset = offset;
+                                offset = do_compress(base, offset, e->name,
+						     e->path, e->size,e->mode);
+                        }
+		} else if (e->child)
+			offset = write_data(e->child, base, offset);
+	}
+	return offset;
+}
+
+static unsigned int write_file(char *file, char *base, unsigned int offset)
+{
+	int fd;
+	char *buf;
+
+	fd = open(file, O_RDONLY);
+	if (fd < 0) {
+		perror(file);
+		exit(8);
+	}
+	buf = mmap(NULL, image_length, PROT_READ, MAP_PRIVATE, fd, 0);
+	memcpy(base + offset, buf, image_length);
+	munmap(buf, image_length);
+	close (fd);
+	/* Pad up the image_length to a 4-byte boundary */
+	while (image_length & 3) {
+		*(base + offset + image_length) = '\0';
+		image_length++;
+	}
+	return (offset + image_length);
+}
+
+/*
+ * Maximum size fs you can create is roughly 256MB.  (The last file's
+ * data must begin within 256MB boundary but can extend beyond that.)
+ *
+ * Note that if you want it to fit in a ROM then you're limited to what the
+ * hardware and kernel can support (64MB?).
+ */
+static unsigned int
+maxfslen(void) {
+	return (((1 << CRAMFS_OFFSET_WIDTH) - 1) << 2)    /* offset */
+		+ (1 << CRAMFS_SIZE_WIDTH) - 1            /* filesize */
+		+ (1 << CRAMFS_SIZE_WIDTH) * 4 / blksize; /* block pointers */
+}
+
+/*
+ * Usage:
+ *
+ *      mkcramfs directory-name outfile
+ *
+ * where "directory-name" is simply the root of the directory
+ * tree that we want to generate a compressed filesystem out
+ * of.
+ */
+int main(int argc, char **argv)
+{
+	struct stat st;		/* used twice... */
+	struct entry *root_entry;
+	char *rom_image;
+	ssize_t offset, written;
+	int fd;
+	/* initial guess (upper-bound) of required filesystem size */
+	loff_t fslen_ub = sizeof(struct cramfs_super);
+	unsigned int fslen_max;
+	char const *dirname, *outfile;
+	u32 crc = crc32(0L, Z_NULL, 0);
+	int c;
+	cramfs_is_big_endian = HOST_IS_BIG_ENDIAN; /* default is to use host order */
+
+	blksize = getpagesize();
+	total_blocks = 0;
+
+	if (argc) {
+		char *p;
+		progname = argv[0];
+		if ((p = strrchr(progname, '/')) != NULL)
+			progname = p+1;
+	}
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	/* command line options */
+	while ((c = getopt(argc, argv, "hb:Ee:i:n:N:psVvz")) != EOF) {
+		switch (c) {
+		case 'h':
+			usage(0);
+		case 'b':
+			blksize = atoi(optarg);
+			if (blksize <= 0)
+				usage(1);
+			break;
+		case 'E':
+			opt_errors = 1;
+			break;
+		case 'e':
+			opt_edition = atoi(optarg);
+			break;
+		case 'N':
+			if (strcmp(optarg, "big") == 0)  {
+				cramfs_is_big_endian = 1;
+			}
+			else if (strcmp(optarg, "little") == 0) {
+				cramfs_is_big_endian = 0;
+			}
+			else if (strcmp(optarg, "host") == 0);	/* default */
+			else 	{
+				perror("invalid endianness given. Must be 'big', 'little', or 'host'");
+				exit(16);
+			}
+
+			break;
+		case 'i':
+			opt_image = optarg;
+			if (lstat(opt_image, &st) < 0) {
+				perror(opt_image);
+				exit(16);
+			}
+			image_length = st.st_size; /* may be padded later */
+			fslen_ub += (image_length + 3); /* 3 is for padding */
+			break;
+		case 'n':
+			opt_name = optarg;
+			break;
+		case 'p':
+			opt_pad = PAD_SIZE;
+			fslen_ub += PAD_SIZE;
+			break;
+		case 's':
+			/* old option, ignored */
+			break;
+		case 'V':
+			printf(_("%s (%s)\n"),
+			       progname, PACKAGE_STRING);
+			exit(0);
+		case 'v':
+			verbose = 1;
+			break;
+		case 'z':
+			opt_holes = 1;
+			break;
+		}
+	}
+
+	if ((argc - optind) != 2)
+		usage(16);
+	dirname = argv[optind];
+	outfile = argv[optind + 1];
+
+	if (stat(dirname, &st) < 0) {
+		perror(dirname);
+		exit(16);
+	}
+	fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+
+	root_entry = calloc(1, sizeof(struct entry));
+	if (!root_entry) {
+		perror(NULL);
+		exit(8);
+	}
+	root_entry->mode = st.st_mode;
+	root_entry->uid = st.st_uid;
+	root_entry->gid = st.st_gid;
+
+	root_entry->size = parse_directory(root_entry, dirname, &root_entry->child, &fslen_ub);
+
+	/* always allocate a multiple of blksize bytes because that's
+           what we're going to write later on */
+	fslen_ub = ((fslen_ub - 1) | (blksize - 1)) + 1;
+	fslen_max = maxfslen();
+
+	if (fslen_ub > fslen_max) {
+		fprintf(stderr,
+			_("warning: guestimate of required size (upper bound) "
+			  "is %lldMB, but maximum image size is %uMB.  "
+			  "We might die prematurely.\n"),
+			(long long)fslen_ub >> 20,
+			fslen_max >> 20);
+		fslen_ub = fslen_max;
+	}
+
+        /* find duplicate files */
+        eliminate_doubles(root_entry,root_entry, &fslen_ub);
+
+	/* TODO: Why do we use a private/anonymous mapping here
+           followed by a write below, instead of just a shared mapping
+           and a couple of ftruncate calls?  Is it just to save us
+           having to deal with removing the file afterwards?  If we
+           really need this huge anonymous mapping, we ought to mmap
+           in smaller chunks, so that the user doesn't need nn MB of
+           RAM free.  If the reason is to be able to write to
+           un-mmappable block devices, then we could try shared mmap
+           and revert to anonymous mmap if the shared mmap fails. */
+	rom_image = mmap(NULL,
+			 fslen_ub?fslen_ub:1,
+			 PROT_READ | PROT_WRITE,
+			 MAP_PRIVATE | MAP_ANONYMOUS,
+			 -1, 0);
+
+	if (-1 == (int) (long) rom_image) {
+		perror(_("ROM image map"));
+		exit(8);
+	}
+
+	/* Skip the first opt_pad bytes for boot loader code */
+	offset = opt_pad;
+	memset(rom_image, 0x00, opt_pad);
+
+	/* Skip the superblock and come back to write it later. */
+	offset += sizeof(struct cramfs_super);
+
+	/* Insert a file image. */
+	if (opt_image) {
+		if (verbose)
+			printf(_("Including: %s\n"), opt_image);
+		offset = write_file(opt_image, rom_image, offset);
+	}
+
+	offset = write_directory_structure(root_entry->child, rom_image, offset);
+	if (verbose)
+		printf(_("Directory data: %zd bytes\n"), offset);
+
+	offset = write_data(root_entry, rom_image, offset);
+
+	/* We always write a multiple of blksize bytes, so that
+           losetup works. */
+	offset = ((offset - 1) | (blksize - 1)) + 1;
+	if (verbose)
+		printf(_("Everything: %zd kilobytes\n"), offset >> 10);
+
+	/* Write the superblock now that we can fill in all of the fields. */
+	write_superblock(root_entry, rom_image+opt_pad, offset);
+	if (verbose)
+		printf(_("Super block: %zd bytes\n"),
+		       sizeof(struct cramfs_super));
+
+	/* Put the checksum in. */
+	crc = crc32(crc, (unsigned char *) (rom_image+opt_pad), (offset-opt_pad));
+	((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = u32_toggle_endianness(cramfs_is_big_endian, crc);
+	if (verbose)
+		printf(_("CRC: %x\n"), crc);
+
+	/* Check to make sure we allocated enough space. */
+	if (fslen_ub < offset) {
+		fprintf(stderr,
+			_("not enough space allocated for ROM image "
+			  "(%lld allocated, %zu used)\n"),
+			(long long) fslen_ub, offset);
+		exit(8);
+	}
+
+	written = write(fd, rom_image, offset);
+	if (written < 0) {
+		perror(_("ROM image"));
+		exit(8);
+	}
+	if (offset != written) {
+		fprintf(stderr, _("ROM image write failed (%zd %zd)\n"),
+			written, offset);
+		exit(8);
+	}
+
+	/* (These warnings used to come at the start, but they scroll off the
+           screen too quickly.) */
+	if (warn_namelen) /* (can't happen when reading from ext2fs) */
+		fprintf(stderr, /* bytes, not chars: think UTF8. */
+			_("warning: filenames truncated to 255 bytes.\n"));
+	if (warn_skip)
+		fprintf(stderr,
+			_("warning: files were skipped due to errors.\n"));
+	if (warn_size)
+		fprintf(stderr,
+			_("warning: file sizes truncated to %luMB "
+			  "(minus 1 byte).\n"),
+			1L << (CRAMFS_SIZE_WIDTH - 20));
+	if (warn_uid) /* (not possible with current Linux versions) */
+		fprintf(stderr,
+			_("warning: uids truncated to %u bits.  "
+			  "(This may be a security concern.)\n"),
+			CRAMFS_UID_WIDTH);
+	if (warn_gid)
+		fprintf(stderr,
+			_("warning: gids truncated to %u bits.  "
+			  "(This may be a security concern.)\n"),
+			CRAMFS_GID_WIDTH);
+	if (warn_dev)
+		fprintf(stderr,
+			_("WARNING: device numbers truncated to %u bits.  "
+			  "This almost certainly means\n"
+			  "that some device files will be wrong.\n"),
+			CRAMFS_OFFSET_WIDTH);
+	if (opt_errors &&
+	    (warn_namelen|warn_skip|warn_size|warn_uid|warn_gid|warn_dev))
+		exit(8);
+	return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.minix.8 b/util-linux-ng-2.17.2/disk-utils/mkfs.minix.8
new file mode 100644
index 0000000..0261037
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.minix.8
@@ -0,0 +1,80 @@
+.\" Copyright 1992, 1993, 1994 Rickard E. Faith (faith@cs.unc.edu)
+.\" May be freely distributed.
+.TH MKFS.MINIX 8 "2 July 1996" "Util-linux 2.6" "Linux System Administrator's Manual"
+.SH NAME
+mkfs.minix \- make a Linux MINIX filesystem
+.SH SYNOPSIS
+.B mkfs.minix
+.RB [ \-c | \-l
+.IR filename ]
+.RB [ \-n
+.IR namelength ]
+.RB [ \-i
+.IR inodecount ]
+.RB [ \-v ]
+.I device
+.RI [ size-in-blocks ]
+.SH DESCRIPTION
+.B mkfs.minix
+creates a Linux MINIX file-system on a device (usually a disk partition).
+
+The
+.I device
+is usually of the following form:
+
+.nf
+.RS
+/dev/hda[1-8] (IDE disk 1)
+/dev/hdb[1-8] (IDE disk 2)
+/dev/sda[1-8] (SCSI disk 1)
+/dev/sdb[1-8] (SCSI disk 2)
+.RE
+.fi
+
+The
+.I size-in-blocks
+parameter is the desired size of the file system, in blocks.
+It is present only for backwards compatibility.
+If omitted the size will be determined automatically.
+Only block counts strictly greater than 10 and strictly less than
+65536 are allowed.
+.SH OPTIONS
+.TP
+.B \-c
+Check the device for bad blocks before creating the file system.  If any
+are found, the count is printed.
+.TP
+.BI \-n " namelength"
+Specify the maximum length of filenames.
+Currently, the only allowable values are 14 and 30.
+The default is 30. Note that kernels older than 0.99p7
+only accept namelength 14.
+.TP
+.BI \-i " inodecount"
+Specify the number of inodes for the filesystem.
+.TP
+.BI \-l " filename"
+Read the bad blocks list from
+.IR filename .
+The file has one bad block number per line.  The count of bad blocks read
+is printed.
+.TP
+.B \-v
+Make a Minix version 2 filesystem.
+.SH "EXIT CODES"
+The exit code returned by
+.B mkfs.minix
+is one of the following:
+.IP 0
+No errors
+.IP 8
+Operational error
+.IP 16
+Usage or syntax error
+.SH "SEE ALSO"
+.BR mkfs (8),
+.BR fsck (8),
+.BR reboot (8)
+.SH AVAILABILITY
+The mkfs.minix command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/mkfs.minix.c b/util-linux-ng-2.17.2/disk-utils/mkfs.minix.c
new file mode 100644
index 0000000..c52afbd
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkfs.minix.c
@@ -0,0 +1,689 @@
+/*
+ * mkfs.minix.c - make a linux (minix) file-system.
+ *
+ * (C) 1991 Linus Torvalds. This file may be redistributed as per
+ * the Linux copyright.
+ */
+
+/*
+ * DD.MM.YY
+ *
+ * 24.11.91  -	Time began. Used the fsck sources to get started.
+ *
+ * 25.11.91  -	Corrected some bugs. Added support for ".badblocks"
+ *		The algorithm for ".badblocks" is a bit weird, but
+ *		it should work. Oh, well.
+ *
+ * 25.01.92  -	Added the -l option for getting the list of bad blocks
+ *		out of a named file. (Dave Rivers, rivers@ponds.uucp)
+ *
+ * 28.02.92  -	Added %-information when using -c.
+ *
+ * 28.02.93  -	Added support for other namelengths than the original
+ *		14 characters so that I can test the new kernel routines..
+ *
+ * 09.10.93  -	Make exit status conform to that required by fsutil
+ *		(Rik Faith, faith@cs.unc.edu)
+ *
+ * 31.10.93  -	Added inode request feature, for backup floppies: use
+ *		32 inodes, for a news partition use more.
+ *		(Scott Heavner, sdh@po.cwru.edu)
+ *
+ * 03.01.94  -	Added support for file system valid flag.
+ *		(Dr. Wettstein, greg%wind.uucp@plains.nodak.edu)
+ *
+ * 30.10.94  -  Added support for v2 filesystem
+ *		(Andreas Schwab, schwab@issan.informatik.uni-dortmund.de)
+ * 
+ * 09.11.94  -	Added test to prevent overwrite of mounted fs adapted
+ *		from Theodore Ts'o's (tytso@athena.mit.edu) mke2fs
+ *		program.  (Daniel Quinlan, quinlan@yggdrasil.com)
+ *
+ * 03.20.95  -	Clear first 512 bytes of filesystem to make certain that
+ *		the filesystem is not misidentified as a MS-DOS FAT filesystem.
+ *		(Daniel Quinlan, quinlan@yggdrasil.com)
+ *
+ * 02.07.96  -  Added small patch from Russell King to make the program a
+ *		good deal more portable (janl@math.uio.no)
+ *
+ * Usage:  mkfs [-c | -l filename ] [-v] [-nXX] [-iXX] device [size-in-blocks]
+ *
+ *	-c for readablility checking (SLOW!)
+ *      -l for getting a list of bad blocks from a file.
+ *	-n for namelength (currently the kernel only uses 14 or 30)
+ *	-i for number of inodes
+ *	-v for v2 filesystem
+ *
+ * The device may be a block device or a image of one, but this isn't
+ * enforced (but it's not much fun on a character device :-). 
+ */
+
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
+#include <string.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <sys/stat.h>
+#include <mntent.h>
+#include <getopt.h>
+
+#include "blkdev.h"
+#include "minix.h"
+#include "nls.h"
+#include "pathnames.h"
+#include "bitops.h"
+
+#define MINIX_ROOT_INO 1
+#define MINIX_BAD_INO 2
+
+#define TEST_BUFFER_BLOCKS 16
+#define MAX_GOOD_BLOCKS 512
+
+#define UPPER(size,n) ((size+((n)-1))/(n))
+#define INODE_SIZE (sizeof(struct minix_inode))
+
+#define INODE_SIZE2 (sizeof(struct minix2_inode))
+#define INODE_BLOCKS UPPER(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \
+				    : MINIX_INODES_PER_BLOCK))
+#define INODE_BUFFER_SIZE (INODE_BLOCKS * BLOCK_SIZE)
+
+#define BITS_PER_BLOCK (BLOCK_SIZE<<3)
+
+static char * program_name = "mkfs";
+static char * device_name = NULL;
+static int DEV = -1;
+static unsigned long long BLOCKS = 0;
+static int check = 0;
+static int badblocks = 0;
+static int namelen = 30;	/* default (changed to 30, per Linus's
+				   suggestion, Sun Nov 21 08:05:07 1993) */
+static int dirsize = 32;
+static int magic = MINIX_SUPER_MAGIC2;
+static int version2 = 0;
+
+static char root_block[BLOCK_SIZE] = "\0";
+
+static char * inode_buffer = NULL;
+#define Inode (((struct minix_inode *) inode_buffer)-1)
+#define Inode2 (((struct minix2_inode *) inode_buffer)-1)
+
+static char *super_block_buffer;
+static char boot_block_buffer[512];
+#define Super (*(struct minix_super_block *)super_block_buffer)
+#define INODES ((unsigned long)Super.s_ninodes)
+#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones))
+#define IMAPS ((unsigned long)Super.s_imap_blocks)
+#define ZMAPS ((unsigned long)Super.s_zmap_blocks)
+#define FIRSTZONE ((unsigned long)Super.s_firstdatazone)
+#define ZONESIZE ((unsigned long)Super.s_log_zone_size)
+#define MAXSIZE ((unsigned long)Super.s_max_size)
+#define MAGIC (Super.s_magic)
+#define NORM_FIRSTZONE (2+IMAPS+ZMAPS+INODE_BLOCKS)
+
+static char *inode_map;
+static char *zone_map;
+
+static unsigned short good_blocks_table[MAX_GOOD_BLOCKS];
+static int used_good_blocks = 0;
+static unsigned long req_nr_inodes = 0;
+
+#define zone_in_use(x) (isset(zone_map,(x)-FIRSTZONE+1) != 0)
+
+#define mark_inode(x) (setbit(inode_map,(x)))
+#define unmark_inode(x) (clrbit(inode_map,(x)))
+
+#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1))
+#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1))
+
+static void
+die(char *str) {
+	fprintf(stderr, "%s: ", program_name);
+	fprintf(stderr, str, device_name);
+	fprintf(stderr, "\n");
+	exit(8);
+}
+
+static void
+usage(void) {
+	fprintf(stderr, "%s (%s)\n", program_name, PACKAGE_STRING);
+	fprintf(stderr,
+		_("Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"),
+		  program_name);
+	exit(16);
+}
+
+/*
+ * Check to make certain that our new filesystem won't be created on
+ * an already mounted partition.  Code adapted from mke2fs, Copyright
+ * (C) 1994 Theodore Ts'o.  Also licensed under GPL.
+ */
+static void
+check_mount(void) {
+	FILE * f;
+	struct mntent * mnt;
+
+	if ((f = setmntent (_PATH_MOUNTED, "r")) == NULL)
+		return;
+	while ((mnt = getmntent (f)) != NULL)
+		if (strcmp (device_name, mnt->mnt_fsname) == 0)
+			break;
+	endmntent (f);
+	if (!mnt)
+		return;
+
+	die(_("%s is mounted; will not make a filesystem here!"));
+}
+
+static void
+write_tables(void) {
+	/* Mark the super block valid. */
+	Super.s_state |= MINIX_VALID_FS;
+	Super.s_state &= ~MINIX_ERROR_FS;
+
+	if (lseek(DEV, 0, SEEK_SET))
+		die(_("seek to boot block failed in write_tables"));
+	if (512 != write(DEV, boot_block_buffer, 512))
+		die(_("unable to clear boot sector"));
+	if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET))
+		die(_("seek failed in write_tables"));
+	if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE))
+		die(_("unable to write super-block"));
+	if (IMAPS*BLOCK_SIZE != write(DEV,inode_map,IMAPS*BLOCK_SIZE))
+		die(_("unable to write inode map"));
+	if (ZMAPS*BLOCK_SIZE != write(DEV,zone_map,ZMAPS*BLOCK_SIZE))
+		die(_("unable to write zone map"));
+	if (INODE_BUFFER_SIZE != write(DEV,inode_buffer,INODE_BUFFER_SIZE))
+		die(_("unable to write inodes"));
+	
+}
+
+static void
+write_block(int blk, char * buffer) {
+	if (blk*BLOCK_SIZE != lseek(DEV, blk*BLOCK_SIZE, SEEK_SET))
+		die(_("seek failed in write_block"));
+	if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE))
+		die(_("write failed in write_block"));
+}
+
+static int
+get_free_block(void) {
+	int blk;
+
+	if (used_good_blocks+1 >= MAX_GOOD_BLOCKS)
+		die(_("too many bad blocks"));
+	if (used_good_blocks)
+		blk = good_blocks_table[used_good_blocks-1]+1;
+	else
+		blk = FIRSTZONE;
+	while (blk < ZONES && zone_in_use(blk))
+		blk++;
+	if (blk >= ZONES)
+		die(_("not enough good blocks"));
+	good_blocks_table[used_good_blocks] = blk;
+	used_good_blocks++;
+	return blk;
+}
+
+static void
+mark_good_blocks(void) {
+	int blk;
+
+	for (blk=0 ; blk < used_good_blocks ; blk++)
+		mark_zone(good_blocks_table[blk]);
+}
+
+static inline int
+next(int zone) {
+	if (!zone)
+		zone = FIRSTZONE-1;
+	while (++zone < ZONES)
+		if (zone_in_use(zone))
+			return zone;
+	return 0;
+}
+
+static void
+make_bad_inode(void) {
+	struct minix_inode * inode = &Inode[MINIX_BAD_INO];
+	int i,j,zone;
+	int ind=0,dind=0;
+	unsigned short ind_block[BLOCK_SIZE>>1];
+	unsigned short dind_block[BLOCK_SIZE>>1];
+
+#define NEXT_BAD (zone = next(zone))
+
+	if (!badblocks)
+		return;
+	mark_inode(MINIX_BAD_INO);
+	inode->i_nlinks = 1;
+	inode->i_time = time(NULL);
+	inode->i_mode = S_IFREG + 0000;
+	inode->i_size = badblocks*BLOCK_SIZE;
+	zone = next(0);
+	for (i=0 ; i<7 ; i++) {
+		inode->i_zone[i] = zone;
+		if (!NEXT_BAD)
+			goto end_bad;
+	}
+	inode->i_zone[7] = ind = get_free_block();
+	memset(ind_block,0,BLOCK_SIZE);
+	for (i=0 ; i<512 ; i++) {
+		ind_block[i] = zone;
+		if (!NEXT_BAD)
+			goto end_bad;
+	}
+	inode->i_zone[8] = dind = get_free_block();
+	memset(dind_block,0,BLOCK_SIZE);
+	for (i=0 ; i<512 ; i++) {
+		write_block(ind,(char *) ind_block);
+		dind_block[i] = ind = get_free_block();
+		memset(ind_block,0,BLOCK_SIZE);
+		for (j=0 ; j<512 ; j++) {
+			ind_block[j] = zone;
+			if (!NEXT_BAD)
+				goto end_bad;
+		}
+	}
+	die(_("too many bad blocks"));
+end_bad:
+	if (ind)
+		write_block(ind, (char *) ind_block);
+	if (dind)
+		write_block(dind, (char *) dind_block);
+}
+
+static void
+make_bad_inode2 (void) {
+	struct minix2_inode *inode = &Inode2[MINIX_BAD_INO];
+	int i, j, zone;
+	int ind = 0, dind = 0;
+	unsigned long ind_block[BLOCK_SIZE >> 2];
+	unsigned long dind_block[BLOCK_SIZE >> 2];
+
+	if (!badblocks)
+		return;
+	mark_inode (MINIX_BAD_INO);
+	inode->i_nlinks = 1;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = time (NULL);
+	inode->i_mode = S_IFREG + 0000;
+	inode->i_size = badblocks * BLOCK_SIZE;
+	zone = next (0);
+	for (i = 0; i < 7; i++) {
+		inode->i_zone[i] = zone;
+		if (!NEXT_BAD)
+			goto end_bad;
+	}
+	inode->i_zone[7] = ind = get_free_block ();
+	memset (ind_block, 0, BLOCK_SIZE);
+	for (i = 0; i < 256; i++) {
+		ind_block[i] = zone;
+		if (!NEXT_BAD)
+			goto end_bad;
+	}
+	inode->i_zone[8] = dind = get_free_block ();
+	memset (dind_block, 0, BLOCK_SIZE);
+	for (i = 0; i < 256; i++) {
+		write_block (ind, (char *) ind_block);
+		dind_block[i] = ind = get_free_block ();
+		memset (ind_block, 0, BLOCK_SIZE);
+		for (j = 0; j < 256; j++) {
+			ind_block[j] = zone;
+			if (!NEXT_BAD)
+				goto end_bad;
+		}
+	}
+	/* Could make triple indirect block here */
+	die (_("too many bad blocks"));
+ end_bad:
+	if (ind)
+		write_block (ind, (char *) ind_block);
+	if (dind)
+		write_block (dind, (char *) dind_block);
+}
+
+static void
+make_root_inode(void) {
+	struct minix_inode * inode = &Inode[MINIX_ROOT_INO];
+
+	mark_inode(MINIX_ROOT_INO);
+	inode->i_zone[0] = get_free_block();
+	inode->i_nlinks = 2;
+	inode->i_time = time(NULL);
+	if (badblocks)
+		inode->i_size = 3*dirsize;
+	else {
+		root_block[2*dirsize] = '\0';
+		root_block[2*dirsize+1] = '\0';
+		inode->i_size = 2*dirsize;
+	}
+	inode->i_mode = S_IFDIR + 0755;
+	inode->i_uid = getuid();
+	if (inode->i_uid)
+		inode->i_gid = getgid();
+	write_block(inode->i_zone[0],root_block);
+}
+
+static void
+make_root_inode2 (void) {
+	struct minix2_inode *inode = &Inode2[MINIX_ROOT_INO];
+
+	mark_inode (MINIX_ROOT_INO);
+	inode->i_zone[0] = get_free_block ();
+	inode->i_nlinks = 2;
+	inode->i_atime = inode->i_mtime = inode->i_ctime = time (NULL);
+	if (badblocks)
+		inode->i_size = 3 * dirsize;
+	else {
+		root_block[2 * dirsize] = '\0';
+		root_block[2 * dirsize + 1] = '\0';
+		inode->i_size = 2 * dirsize;
+	}
+	inode->i_mode = S_IFDIR + 0755;
+	inode->i_uid = getuid();
+	if (inode->i_uid)
+		inode->i_gid = getgid();
+	write_block (inode->i_zone[0], root_block);
+}
+
+static void
+setup_tables(void) {
+	int i;
+	unsigned long inodes;
+
+	super_block_buffer = calloc(1, BLOCK_SIZE);
+	if (!super_block_buffer)
+		die(_("unable to alloc buffer for superblock"));
+
+	memset(boot_block_buffer,0,512);
+	Super.s_magic = magic;
+	Super.s_log_zone_size = 0;
+	Super.s_max_size = version2 ? 0x7fffffff : (7+512+512*512)*1024;
+	if (version2)
+		Super.s_zones = BLOCKS;
+	else
+		Super.s_nzones = BLOCKS;
+
+/* some magic nrs: 1 inode / 3 blocks */
+	if ( req_nr_inodes == 0 ) 
+		inodes = BLOCKS/3;
+	else
+		inodes = req_nr_inodes;
+	/* Round up inode count to fill block size */
+	if (version2)
+		inodes = ((inodes + MINIX2_INODES_PER_BLOCK - 1) &
+			  ~(MINIX2_INODES_PER_BLOCK - 1));
+	else
+		inodes = ((inodes + MINIX_INODES_PER_BLOCK - 1) &
+			  ~(MINIX_INODES_PER_BLOCK - 1));
+	if (inodes > 65535)
+		inodes = 65535;
+	Super.s_ninodes = inodes;
+
+	/* The old code here
+	 * ZMAPS = 0;
+	 * while (ZMAPS != UPPER(BLOCKS - NORM_FIRSTZONE + 1,BITS_PER_BLOCK))
+	 *	  ZMAPS = UPPER(BLOCKS - NORM_FIRSTZONE + 1,BITS_PER_BLOCK);
+	 * was no good, since it may loop. - aeb
+	 */
+	Super.s_imap_blocks = UPPER(INODES + 1, BITS_PER_BLOCK);
+	Super.s_zmap_blocks = UPPER(BLOCKS - (1+IMAPS+INODE_BLOCKS),
+				    BITS_PER_BLOCK+1);
+	Super.s_firstdatazone = NORM_FIRSTZONE;
+
+	inode_map = malloc(IMAPS * BLOCK_SIZE);
+	zone_map = malloc(ZMAPS * BLOCK_SIZE);
+	if (!inode_map || !zone_map)
+		die(_("unable to allocate buffers for maps"));
+	memset(inode_map,0xff,IMAPS * BLOCK_SIZE);
+	memset(zone_map,0xff,ZMAPS * BLOCK_SIZE);
+	for (i = FIRSTZONE ; i<ZONES ; i++)
+		unmark_zone(i);
+	for (i = MINIX_ROOT_INO ; i<=INODES ; i++)
+		unmark_inode(i);
+	inode_buffer = malloc(INODE_BUFFER_SIZE);
+	if (!inode_buffer)
+		die(_("unable to allocate buffer for inodes"));
+	memset(inode_buffer,0,INODE_BUFFER_SIZE);
+	printf(_("%ld inodes\n"),INODES);
+	printf(_("%ld blocks\n"),ZONES);
+	printf(_("Firstdatazone=%ld (%ld)\n"),FIRSTZONE,NORM_FIRSTZONE);
+	printf(_("Zonesize=%d\n"),BLOCK_SIZE<<ZONESIZE);
+	printf(_("Maxsize=%ld\n\n"),MAXSIZE);
+}
+
+/*
+ * Perform a test of a block; return the number of
+ * blocks readable/writeable.
+ */
+static long
+do_check(char * buffer, int try, unsigned int current_block) {
+	long got;
+	
+	/* Seek to the correct loc. */
+	if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) !=
+		       current_block * BLOCK_SIZE ) {
+		 die(_("seek failed during testing of blocks"));
+	}
+
+
+	/* Try the read */
+	got = read(DEV, buffer, try * BLOCK_SIZE);
+	if (got < 0) got = 0;	
+	if (got & (BLOCK_SIZE - 1 )) {
+		printf(_("Weird values in do_check: probably bugs\n"));
+	}
+	got /= BLOCK_SIZE;
+	return got;
+}
+
+static unsigned int currently_testing = 0;
+
+static void
+alarm_intr(int alnum) {
+	if (currently_testing >= ZONES)
+		return;
+	signal(SIGALRM,alarm_intr);
+	alarm(5);
+	if (!currently_testing)
+		return;
+	printf("%d ...", currently_testing);
+	fflush(stdout);
+}
+
+static void
+check_blocks(void) {
+	int try,got;
+	static char buffer[BLOCK_SIZE * TEST_BUFFER_BLOCKS];
+
+	currently_testing=0;
+	signal(SIGALRM,alarm_intr);
+	alarm(5);
+	while (currently_testing < ZONES) {
+		if (lseek(DEV,currently_testing*BLOCK_SIZE,SEEK_SET) !=
+		currently_testing*BLOCK_SIZE)
+			die(_("seek failed in check_blocks"));
+		try = TEST_BUFFER_BLOCKS;
+		if (currently_testing + try > ZONES)
+			try = ZONES-currently_testing;
+		got = do_check(buffer, try, currently_testing);
+		currently_testing += got;
+		if (got == try)
+			continue;
+		if (currently_testing < FIRSTZONE)
+			die(_("bad blocks before data-area: cannot make fs"));
+		mark_zone(currently_testing);
+		badblocks++;
+		currently_testing++;
+	}
+	if (badblocks > 1)
+		printf(_("%d bad blocks\n"), badblocks);
+	else if (badblocks == 1)
+		printf(_("one bad block\n"));
+}
+
+static void
+get_list_blocks(char *filename) {
+	FILE *listfile;
+	unsigned long blockno;
+
+	listfile = fopen(filename,"r");
+	if (listfile == NULL)
+		die(_("can't open file of bad blocks"));
+
+	while (!feof(listfile)) {
+		if (fscanf(listfile,"%ld\n", &blockno) != 1) {
+			printf(_("badblock number input error on line %d\n"), badblocks + 1);
+			die(_("cannot read badblocks file"));
+		}
+		mark_zone(blockno);
+		badblocks++;
+	}
+	fclose(listfile);
+
+	if(badblocks > 1)
+		printf(_("%d bad blocks\n"), badblocks);
+	else if (badblocks == 1)
+		printf(_("one bad block\n"));
+}
+
+int
+main(int argc, char ** argv) {
+  int i;
+  char * tmp;
+  struct stat statbuf;
+  char * listfile = NULL;
+  char * p;
+
+  if (argc && *argv)
+    program_name = *argv;
+  if ((p = strrchr(program_name, '/')) != NULL)
+    program_name = p+1;
+
+  setlocale(LC_ALL, "");
+  bindtextdomain(PACKAGE, LOCALEDIR);
+  textdomain(PACKAGE);
+
+  if (argc == 2 &&
+      (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+	  printf(_("%s (%s)\n"), program_name, PACKAGE_STRING);
+	  exit(0);
+  }
+
+  if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
+    die(_("bad inode size"));
+  if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
+    die(_("bad inode size"));
+
+  opterr = 0;
+  while ((i = getopt(argc, argv, "ci:l:n:v")) != -1)
+    switch (i) {
+      case 'c':
+	check=1; break;
+      case 'i':
+	req_nr_inodes = (unsigned long) atol(optarg);
+	break;
+      case 'l':
+	listfile = optarg; break;
+      case 'n':
+	i = strtoul(optarg,&tmp,0);
+	if (*tmp)
+	  usage();
+	if (i == 14)
+	  magic = MINIX_SUPER_MAGIC;
+	else if (i == 30)
+	  magic = MINIX_SUPER_MAGIC2;
+	else
+	  usage();
+	namelen = i;
+	dirsize = i+2;
+	break;
+      case 'v':
+	version2 = 1;
+	break;
+      default:
+	usage();
+    }
+  argc -= optind;
+  argv += optind;
+  if (argc > 0 && !device_name) {
+    device_name = argv[0];
+    argc--;
+    argv++;
+  }
+  if (argc > 0) {
+     BLOCKS = strtol(argv[0],&tmp,0);
+     if (*tmp) {
+       printf(_("strtol error: number of blocks not specified"));
+       usage();
+     }
+  }
+
+  if (!device_name) {
+    usage();
+  }
+  check_mount();		/* is it already mounted? */
+  tmp = root_block;
+  *(short *)tmp = 1;
+  strcpy(tmp+2,".");
+  tmp += dirsize;
+  *(short *)tmp = 1;
+  strcpy(tmp+2,"..");
+  tmp += dirsize;
+  *(short *)tmp = 2;
+  strcpy(tmp+2,".badblocks");
+  if (stat(device_name, &statbuf) < 0)
+    die(_("unable to stat %s"));
+  if (S_ISBLK(statbuf.st_mode))
+    DEV = open(device_name,O_RDWR | O_EXCL);
+  else
+    DEV = open(device_name,O_RDWR);
+  if (DEV<0)
+    die(_("unable to open %s"));
+  if (S_ISBLK(statbuf.st_mode)) {
+    int sectorsize;
+
+    if (blkdev_get_sector_size(DEV, &sectorsize) == -1)
+	    die(_("cannot determine sector size for %s"));
+    if (BLOCK_SIZE < sectorsize)
+	    die(_("block size smaller than physical sector size of %s"));
+    if (!BLOCKS) {
+	    if (blkdev_get_size(DEV, &BLOCKS) == -1)
+		die(_("cannot determine size of %s"));
+	    BLOCKS /= BLOCK_SIZE;
+    }
+  } else if (!S_ISBLK(statbuf.st_mode)) {
+    if (!BLOCKS)
+	    BLOCKS = statbuf.st_size / BLOCK_SIZE;
+    check=0;
+  } else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
+    die(_("will not try to make filesystem on '%s'"));
+  if (BLOCKS < 10)
+	  die(_("number of blocks too small"));
+  if (version2) {
+    if (namelen == 14)
+      magic = MINIX2_SUPER_MAGIC;
+    else
+      magic = MINIX2_SUPER_MAGIC2;
+  } else
+    if (BLOCKS > 65535)
+      BLOCKS = 65535;
+  setup_tables();
+  if (check)
+    check_blocks();
+  else if (listfile)
+    get_list_blocks(listfile);
+  if (version2) {
+    make_root_inode2 ();
+    make_bad_inode2 ();
+  } else {
+      make_root_inode();
+      make_bad_inode();
+  }
+  mark_good_blocks();
+  write_tables();
+  return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/mkswap.8 b/util-linux-ng-2.17.2/disk-utils/mkswap.8
new file mode 100644
index 0000000..cdb2a44
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkswap.8
@@ -0,0 +1,155 @@
+.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
+.\"
+.\" May be distributed under the GNU General Public License
+.\" Rewritten for 2.1.117, aeb, 981010.
+.\"
+.TH MKSWAP 8 "13 March 2009" "Linux" "Linux Programmer's Manual"
+.SH NAME
+mkswap \- set up a Linux swap area
+.SH SYNOPSIS
+.B mkswap
+.RB [ \-c ]
+.RB [ \-f ]
+.RB [ \-p
+.IR PSZ ]
+.RB [ \-L
+.IR label ]
+.RB [ \-U
+.IR uuid ]
+.I device
+.RI [ size ]
+.SH DESCRIPTION
+.B mkswap
+sets up a Linux swap area on a device or in a file.
+
+The
+.I device
+argument will usually be a disk partition (something like
+.IR /dev/sdb7 )
+but can also be a file.
+The Linux kernel does not look at partition Id's, but
+many installation scripts will assume that partitions
+of hex type 82 (LINUX_SWAP) are meant to be swap partitions.
+(\fBWarning: Solaris also uses this type. Be careful not to kill
+your Solaris partitions.\fP)
+
+The
+.I size
+parameter is superfluous but retained for backwards compatibility.
+(It specifies the desired size of the swap area in 1024-byte blocks.
+.B mkswap
+will use the entire partition or file if it is omitted.
+Specifying it is unwise - a typo may destroy your disk.)
+
+The
+.I PSZ
+parameter specifies the page size to use. It is almost always
+unnecessary (even unwise) to specify it, but certain old libc
+versions lie about the page size, so it is possible that
+.B mkswap
+gets it wrong. The symptom is that a subsequent
+.B swapon
+fails because no swap signature is found. Typical values for
+.I PSZ
+are 4096 or 8192.
+
+After creating the swap area, you need the
+.B swapon
+command to start using it. Usually swap areas are listed in
+.I /etc/fstab
+so that they can be taken into use at boot time by a
+.B swapon -a
+command in some boot script.
+
+.SH WARNING
+The swap header does not touch the first block. A boot loader or disk label
+can be there, but it is not recommended setup. The recommended setup is to
+use a separate partition for a Linux swap area.
+
+.B mkswap like many others mkfs-like utils erases the first block to remove
+.B old on-disk filesystems.
+
+.B mkswap
+refuses to erase the first block on a device with a disk
+label (SUN, BSD, ...) or on whole disk (e.g. /dev/sda).
+
+.SH OPTIONS
+.TP
+.B \-c
+Check the device (if it is a block device) for bad blocks
+before creating the swap area.
+If any are found, the count is printed.
+.TP
+.B \-f
+Force - go ahead even if the command is stupid.
+This allows the creation of a swap area larger than the file
+or partition it resides on.
+
+Without this option
+.B mkswap
+will refuse to erase the first block on a device with a partition table or on
+whole disk (e.g. /dec/sda).
+.TP
+.BI \-p \ PSZ
+Specify the page size to use.
+.TP
+.BI \-L \ label
+Specify a label, to allow swapon by label.
+(Only for new style swap areas.)
+.TP
+.BR \-v0 , \ \-v1
+Specify the swap space version. This option is deprecated and \-v1 is
+supported only.
+
+The kernel has not supported v0 swap space format since 2.5.22. The new version
+v1 is supported since 2.1.117.
+
+.TP
+.BI \-U \ uuid
+Specify the uuid to use. The default is to generate UUIDs.
+
+.SH NOTES
+The maximum useful size of a swap area depends on the architecture and
+the kernel version.
+It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB on sparc, 512MiB on mips,
+128GiB on alpha and 3TiB on sparc64. For kernels after 2.3.3 there is no
+such limitation.
+
+Note that before 2.1.117 the kernel allocated one byte for each page,
+while it now allocates two bytes, so that taking a swap area of 2 GiB
+in use might require 2 MiB of kernel memory.
+
+Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10).
+The areas in use can be seen in the file
+.I /proc/swaps
+(since 2.1.25).
+
+.B mkswap
+refuses areas smaller than 10 pages.
+
+If you don't know the page size that your machine uses, you may be
+able to look it up with "cat /proc/cpuinfo" (or you may not -
+the contents of this file depend on architecture and kernel version).
+
+To setup a swap file, it is necessary to create that file before
+initializing it with
+.BR mkswap ,
+e.g. using a command like
+
+.nf
+.RS
+# dd if=/dev/zero of=swapfile bs=1024 count=65536
+.RE
+.fi
+
+Note that a swap file must not contain any holes (so, using
+.BR cp (1)
+to create the file is not acceptable).
+
+
+.SH "SEE ALSO"
+.BR fdisk (8),
+.BR swapon (8)
+.SH AVAILABILITY
+The mkswap command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/mkswap.c b/util-linux-ng-2.17.2/disk-utils/mkswap.c
new file mode 100644
index 0000000..1c72d07
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/mkswap.c
@@ -0,0 +1,713 @@
+/*
+ * mkswap.c - set up a linux swap device
+ *
+ * (C) 1991 Linus Torvalds. This file may be redistributed as per
+ * the Linux copyright.
+ */
+
+/*
+ * 20.12.91  -	time began. Got VM working yesterday by doing this by hand.
+ *
+ * Usage: mkswap [-c] [-vN] [-f] device [size-in-blocks]
+ *
+ *	-c   for readability checking. (Use it unless you are SURE!)
+ *	-vN  for swap areas version N. (Only N=0,1 known today.)
+ *      -f   for forcing swap creation even if it would smash partition table.
+ *
+ * The device may be a block device or an image of one, but this isn't
+ * enforced (but it's not much fun on a character device :-).
+ *
+ * Patches from jaggy@purplet.demon.co.uk (Mike Jagdis) to make the
+ * size-in-blocks parameter optional added Wed Feb  8 10:33:43 1995.
+ *
+ * Version 1 swap area code (for kernel 2.1.117), aeb, 981010.
+ *
+ * Sparc fixes, jj@ultra.linux.cz (Jakub Jelinek), 981201 - mangled by aeb.
+ * V1_MAX_PAGES fixes, jj, 990325.
+ * sparc64 fixes, jj, 000219.
+ *
+ * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ * - added Native Language Support
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <mntent.h>
+#include <sys/utsname.h>
+#include <sys/stat.h>
+#include <errno.h>
+#ifdef HAVE_LIBSELINUX
+#include <selinux/selinux.h>
+#include <selinux/context.h>
+#endif
+
+#include "linux_version.h"
+#include "swapheader.h"
+#include "xstrncpy.h"
+#include "nls.h"
+#include "blkdev.h"
+#include "pathnames.h"
+#include "wholedisk.h"
+
+#ifdef HAVE_LIBUUID
+# ifdef HAVE_UUID_UUID_H
+#  include <uuid/uuid.h>
+# else
+#  include <uuid.h>
+# endif
+#endif
+
+#ifdef HAVE_LIBBLKID_INTERNAL
+# include <blkid.h>
+#endif
+
+static char * program_name = "mkswap";
+static char * device_name = NULL;
+static int DEV = -1;
+static unsigned long long PAGES = 0;
+static unsigned long badpages = 0;
+static int check = 0;
+
+#define SELINUX_SWAPFILE_TYPE	"swapfile_t"
+
+#ifdef __sparc__
+# ifdef __arch64__
+#  define is_sparc64() 1
+#  define is_be64() 1
+# else /* sparc32 */
+static int
+is_sparc64(void) {
+	struct utsname un;
+	static int sparc64 = -1;
+
+	if (sparc64 != -1) return sparc64;
+	sparc64 = 0;
+
+	if (uname(&un) < 0) return 0;
+	if (! strcmp(un.machine, "sparc64")) {
+		sparc64 = 1;
+		return 1;
+	}
+	if (strcmp(un.machine, "sparc"))
+		return 0; /* Should not happen */
+
+#ifdef HAVE_PERSONALITY
+	{
+		extern int personality(unsigned long);
+		int oldpers;
+#define PERS_LINUX          0x00000000
+#define PERS_LINUX_32BIT    0x00800000
+#define PERS_LINUX32        0x00000008
+
+		oldpers = personality(PERS_LINUX_32BIT);
+		if (oldpers != -1) {
+			if (personality(PERS_LINUX) != -1) {
+				uname(&un);
+				if (! strcmp(un.machine, "sparc64")) {
+					sparc64 = 1;
+					oldpers = PERS_LINUX32;
+				}
+			}
+			personality(oldpers);
+		}
+	}
+#endif
+
+	return sparc64;
+}
+#  define is_be64() is_sparc64()
+# endif /* sparc32 */
+#else /* !sparc */
+# define is_be64() 0
+#endif
+
+/*
+ * The definition of the union swap_header uses the kernel constant PAGE_SIZE.
+ * Unfortunately, on some architectures this depends on the hardware model, and
+ * can only be found at run time -- we use getpagesize(), so that we do not
+ * need separate binaries e.g. for sun4, sun4c/d/m and sun4u.
+ *
+ * Even more unfortunately, getpagesize() does not always return the right
+ * information. For example, libc4, libc5 and glibc 2.0 do not use the system
+ * call but invent a value themselves (EXEC_PAGESIZE or NBPG * CLSIZE or NBPC),
+ * and thus it may happen that e.g. on a sparc kernel PAGE_SIZE=4096 and
+ * getpagesize() returns 8192.
+ *
+ * What to do? Let us allow the user to specify the pagesize explicitly.
+ *
+ */
+static int user_pagesize;
+static int pagesize;
+static unsigned long *signature_page = NULL;
+struct swap_header_v1 *p;
+
+static void
+init_signature_page(void) {
+
+	int kernel_pagesize = pagesize = getpagesize();
+
+	if (user_pagesize) {
+		if ((user_pagesize & (user_pagesize-1)) ||
+		    user_pagesize < 1024) {
+			fprintf(stderr, _("Bad user-specified page size %d\n"),
+				user_pagesize);
+			exit(1);
+		}
+		pagesize = user_pagesize;
+	}
+
+	if (user_pagesize && user_pagesize != kernel_pagesize)
+		fprintf(stderr, _("Using user-specified page size %d, "
+				  "instead of the system value %d\n"),
+				pagesize, kernel_pagesize);
+
+	signature_page = (unsigned long *) malloc(pagesize);
+	memset(signature_page, 0, pagesize);
+	p = (struct swap_header_v1 *) signature_page;
+}
+
+static void
+deinit_signature_page(void) {
+	free(signature_page);
+}
+
+static void
+write_signature(char *sig) {
+	char *sp = (char *) signature_page;
+
+	strncpy(sp+pagesize-10, sig, 10);
+}
+
+static void
+write_uuid_and_label(unsigned char *uuid, char *volume_name) {
+	struct swap_header_v1_2 *h;
+
+	/* Sanity check */
+	if (sizeof(struct swap_header_v1) !=
+	    sizeof(struct swap_header_v1_2)) {
+		fprintf(stderr,
+			_("Bad swap header size, no label written.\n"));
+		return;
+	}
+
+	h = (struct swap_header_v1_2 *) signature_page;
+	if (uuid)
+		memcpy(h->uuid, uuid, sizeof(h->uuid));
+	if (volume_name) {
+		xstrncpy(h->volume_name, volume_name, sizeof(h->volume_name));
+		if (strlen(volume_name) > strlen(h->volume_name))
+			fprintf(stderr, _("Label was truncated.\n"));
+	}
+	if (uuid || volume_name) {
+		if (volume_name)
+			printf("LABEL=%s, ", h->volume_name);
+		else
+			printf(_("no label, "));
+#ifdef HAVE_LIBUUID
+		if (uuid) {
+			char uuid_string[37];
+			uuid_unparse(uuid, uuid_string);
+			printf("UUID=%s\n", uuid_string);
+		} else
+#endif
+			printf(_("no uuid\n"));
+	}
+}
+
+/*
+ * Find out what the maximum amount of swap space is that the kernel will
+ * handle.  This wouldn't matter if the kernel just used as much of the
+ * swap space as it can handle, but until 2.3.4 it would return an error
+ * to swapon() if the swapspace was too large.
+ */
+/* Before 2.2.0pre9 */
+#define V1_OLD_MAX_PAGES	((0x7fffffff / pagesize) - 1)
+/* Since 2.2.0pre9, before 2.3.4:
+   error if nr of pages >= SWP_OFFSET(SWP_ENTRY(0,~0UL))
+   with variations on
+	#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
+	#define SWP_OFFSET(entry) ((entry) >> 8)
+   on the various architectures. Below the result - yuk.
+
+   Machine	pagesize	SWP_ENTRY	SWP_OFFSET	bound+1	oldbound+2
+   i386		2^12		o<<8		e>>8		1<<24	1<<19
+   mips		2^12		o<<15		e>>15		1<<17	1<<19
+   alpha	2^13		o<<40		e>>40		1<<24	1<<18
+   m68k		2^12		o<<12		e>>12		1<<20	1<<19
+   sparc	2^{12,13}	(o&0x3ffff)<<9	(e>>9)&0x3ffff	1<<18	1<<{19,18}
+   sparc64	2^13		o<<13		e>>13		1<<51	1<<18
+   ppc		2^12		o<<8		e>>8		1<<24	1<<19
+   armo		2^{13,14,15}	o<<8		e>>8		1<<24	1<<{18,17,16}
+   armv		2^12		o<<9		e>>9		1<<23	1<<19
+
+   assuming that longs have 64 bits on alpha and sparc64 and 32 bits elsewhere.
+
+   The bad part is that we need to know this since the kernel will
+   refuse a swap space if it is too large.
+*/
+/* patch from jj - why does this differ from the above? */
+/* 32bit kernels have a second limitation of 2GB, sparc64 is limited by
+   the size of virtual address space allocation for vmalloc */
+#if defined(__alpha__)
+#define V1_MAX_PAGES           ((1 << 24) - 1)
+#elif defined(__mips__)
+#define V1_MAX_PAGES           ((1 << 17) - 1)
+#elif defined(__sparc__)
+#define V1_MAX_PAGES           (is_sparc64() ? ((3 << 29) - 1) : ((1 << 18) - 1))
+#elif defined(__ia64__)
+/*
+ * The actual size will depend on the amount of virtual address space
+ * available to vmalloc the swap map.
+ */
+#define V1_MAX_PAGES          ((1UL << 54) - 1)
+#else
+#define V1_MAX_PAGES           V1_OLD_MAX_PAGES
+#endif
+/* man page now says:
+The maximum useful size of a swap area now depends on the architecture.
+It is roughly 2GB on i386, PPC, m68k, ARM, 1GB on sparc, 512MB on mips,
+128GB on alpha and 3TB on sparc64.
+*/
+
+#define MAX_BADPAGES	((pagesize-1024-128*sizeof(int)-10)/sizeof(int))
+#define MIN_GOODPAGES	10
+
+static void
+usage(void) {
+	fprintf(stderr,
+		_("Usage: %s [-c] [-pPAGESZ] [-L label] [-U UUID] /dev/name [blocks]\n"),
+		program_name);
+	exit(1);
+}
+
+static void
+die(const char *str) {
+	fprintf(stderr, "%s: %s\n", program_name, str);
+	exit(1);
+}
+
+static void
+page_bad(int page) {
+	if (badpages == MAX_BADPAGES)
+		die(_("too many bad pages"));
+	p->badpages[badpages] = page;
+	badpages++;
+}
+
+static void
+check_blocks(void) {
+	unsigned int current_page;
+	int do_seek = 1;
+	char *buffer;
+
+	buffer = malloc(pagesize);
+	if (!buffer)
+		die(_("Out of memory"));
+	current_page = 0;
+	while (current_page < PAGES) {
+		if (do_seek && lseek(DEV,current_page*pagesize,SEEK_SET) !=
+		    current_page*pagesize)
+			die(_("seek failed in check_blocks"));
+		if ((do_seek = (pagesize != read(DEV, buffer, pagesize))))
+			page_bad(current_page);
+		current_page++;
+	}
+	if (badpages == 1)
+		printf(_("one bad page\n"));
+	else if (badpages > 1)
+		printf(_("%lu bad pages\n"), badpages);
+	free(buffer);
+}
+
+/* return size in pages */
+static unsigned long long
+get_size(const char  *file) {
+	int	fd;
+	unsigned long long size;
+
+	fd = open(file, O_RDONLY);
+	if (fd < 0) {
+		perror(file);
+		exit(1);
+	}
+	if (blkdev_get_size(fd, &size) == 0)
+		size /= pagesize;
+	else
+		size = blkdev_find_size(fd) / pagesize;
+
+	close(fd);
+	return size;
+}
+
+static int
+isnzdigit(char c) {
+	return (c >= '1' && c <= '9');
+}
+
+
+/*
+ * Check to make certain that our new filesystem won't be created on
+ * an already mounted partition.  Code adapted from mke2fs, Copyright
+ * (C) 1994 Theodore Ts'o.  Also licensed under GPL.
+ * (C) 2006 Karel Zak -- port to mkswap
+ */
+static int
+check_mount(void) {
+	FILE * f;
+	struct mntent * mnt;
+
+	if ((f = setmntent (_PATH_MOUNTED, "r")) == NULL)
+		return 0;
+	while ((mnt = getmntent (f)) != NULL)
+		if (strcmp (device_name, mnt->mnt_fsname) == 0)
+			break;
+	endmntent (f);
+	if (!mnt)
+		return 0;
+	return 1;
+}
+
+
+static int
+write_all(int fd, const void *buf, size_t count) {
+	while(count) {
+		ssize_t tmp;
+
+		errno = 0;
+		tmp = write(fd, buf, count);
+		if (tmp > 0) {
+			count -= tmp;
+			if (count)
+				buf += tmp;
+		} else if (errno != EINTR && errno != EAGAIN)
+			return -1;
+	}
+	return 0;
+}
+
+static void
+zap_bootbits(int fd, const char *devname, int force)
+{
+	char *type = NULL;
+	int whole = 0;
+	int zap = 1;
+
+	if (!force) {
+		if (lseek(fd, 0, SEEK_SET) != 0)
+	                die(_("unable to rewind swap-device"));
+
+		if (is_whole_disk_fd(fd, devname)) {
+			/* don't zap bootbits on whole disk -- we know nothing
+			 * about bootloaders on the device */
+			whole = 1;
+			zap = 0;
+		} else {
+#ifdef HAVE_LIBBLKID_INTERNAL
+			blkid_probe pr = blkid_new_probe();
+			if (!pr)
+				die(_("unable to alloc new libblkid probe"));
+			if (blkid_probe_set_device(pr, fd, 0, 0))
+				die(_("unable to assign device to liblkid probe"));
+
+			blkid_probe_enable_partitions(pr, 1);
+			blkid_probe_enable_superblocks(pr, 0);
+
+			if (blkid_do_fullprobe(pr) == 0)
+				blkid_probe_lookup_value(pr, "PTTYPE",
+						(const char **) &type, NULL);
+			if (type) {
+				type = strdup(type);
+				zap = 0;
+			}
+			blkid_free_probe(pr);
+#else
+			/* don't zap if compiled without libblkid */
+			zap = 0;
+#endif
+		}
+	}
+
+	if (zap) {
+		char buf[1024];
+
+		if (lseek(fd, 0, SEEK_SET) != 0)
+	                die(_("unable to rewind swap-device"));
+
+		memset(buf, 0, sizeof(buf));
+		if (write_all(fd, buf, sizeof(buf)))
+			die(_("unable to erase bootbits sectors"));
+		return;
+	}
+
+	fprintf(stderr, _("%s: %s: warning: don't erase bootbits sectors\n"),
+		program_name, devname);
+	if (type)
+		fprintf(stderr, _("        (%s partition table detected). "), type);
+	else if (whole)
+		fprintf(stderr, _("        on whole disk. "));
+	else
+		fprintf(stderr, _("        (compiled without libblkid). "));
+	fprintf(stderr, "Use -f to force.\n");
+}
+
+int
+main(int argc, char ** argv) {
+	struct stat statbuf;
+	int i;
+	unsigned long long maxpages;
+	unsigned long long goodpages;
+	unsigned long long sz;
+	off_t offset;
+	int force = 0;
+	int version = 1;
+	char *block_count = 0;
+	char *pp;
+	char *opt_label = NULL;
+	unsigned char *uuid = NULL;
+#ifdef HAVE_LIBUUID
+	const char *opt_uuid = NULL;
+	uuid_t uuid_dat;
+#endif
+
+	program_name = (argc && *argv) ? argv[0] : "mkswap";
+	if ((pp = strrchr(program_name, '/')) != NULL)
+		program_name = pp+1;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	if (argc == 2 &&
+	    (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) {
+		printf(_("%s (%s)\n"), program_name, PACKAGE_STRING);
+		exit(0);
+	}
+
+	for (i=1; i<argc; i++) {
+		if (argv[i][0] == '-') {
+			switch (argv[i][1]) {
+				case 'c':
+					check=1;
+					break;
+				case 'f':
+					force=1;
+					break;
+				case 'p':
+					pp = argv[i]+2;
+					if (!*pp && i+1 < argc)
+						pp = argv[++i];
+					if (isnzdigit(*pp))
+						user_pagesize = atoi(pp);
+					else
+						usage();
+					break;
+			        case 'L':
+					pp = argv[i]+2;
+					if (!*pp && i+1 < argc)
+						pp = argv[++i];
+					opt_label = pp;
+				        break;
+				case 'v':
+					version = atoi(argv[i]+2);
+					break;
+				case 'U':
+#ifdef HAVE_LIBUUID
+					opt_uuid = argv[i]+2;
+					if (!*opt_uuid && i+1 < argc)
+						opt_uuid = argv[++i];
+#else
+					fprintf(stderr, _("%1$s: warning: ignore -U (UUIDs are unsupported by %1$s)\n"),
+						program_name);
+#endif
+					break;
+				default:
+					usage();
+			}
+		} else if (!device_name) {
+			device_name = argv[i];
+		} else if (!block_count) {
+			block_count = argv[i];
+		} else
+			usage();
+	}
+
+	if (version != 1) {
+		fprintf(stderr, _("%s: does not support swapspace version %d.\n"),
+			program_name, version);
+		exit(EXIT_FAILURE);
+	}
+
+#ifdef HAVE_LIBUUID
+	if(opt_uuid) {
+		if (uuid_parse(opt_uuid, uuid_dat) != 0)
+			die(_("error: UUID parsing failed"));
+	} else
+		uuid_generate(uuid_dat);
+	uuid = uuid_dat;
+#endif
+
+	init_signature_page();	/* get pagesize */
+	atexit(deinit_signature_page);
+
+	if (!device_name) {
+		fprintf(stderr,
+			_("%s: error: Nowhere to set up swap on?\n"),
+			program_name);
+		usage();
+	}
+	if (block_count) {
+		/* this silly user specified the number of blocks
+		   explicitly */
+		char *tmp;
+		int blocks_per_page = pagesize/1024;
+		PAGES = strtoull(block_count,&tmp,0)/blocks_per_page;
+		if (*tmp)
+			usage();
+	}
+	sz = get_size(device_name);
+	if (!PAGES) {
+		PAGES = sz;
+	} else if (PAGES > sz && !force) {
+		fprintf(stderr,
+			_("%s: error: "
+			  "size %llu KiB is larger than device size %llu KiB\n"),
+			program_name,
+			PAGES*(pagesize/1024), sz*(pagesize/1024));
+		exit(1);
+	}
+
+	if (PAGES < MIN_GOODPAGES) {
+		fprintf(stderr,
+			_("%s: error: swap area needs to be at least %ld KiB\n"),
+			program_name, (long)(MIN_GOODPAGES * pagesize/1024));
+		usage();
+	}
+
+#ifdef __linux__
+	if (get_linux_version() >= KERNEL_VERSION(2,3,4))
+		maxpages = UINT_MAX + 1ULL;
+	else if (get_linux_version() >= KERNEL_VERSION(2,2,1))
+		maxpages = V1_MAX_PAGES;
+	else
+#endif
+		maxpages = V1_OLD_MAX_PAGES;
+
+	if (PAGES > maxpages) {
+		PAGES = maxpages;
+		fprintf(stderr,
+			_("%s: warning: truncating swap area to %llu KiB\n"),
+			program_name, PAGES * pagesize / 1024);
+	}
+
+	if (stat(device_name, &statbuf) < 0) {
+		perror(device_name);
+		exit(EXIT_FAILURE);
+	}
+	if (S_ISBLK(statbuf.st_mode))
+		DEV = open(device_name, O_RDWR | O_EXCL);
+	else
+		DEV = open(device_name, O_RDWR);
+
+	if (DEV < 0) {
+		perror(device_name);
+		exit(1);
+	}
+
+	/* Want a block device. Probably not /dev/hda or /dev/hdb. */
+	if (!S_ISBLK(statbuf.st_mode))
+		check=0;
+	else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) {
+		fprintf(stderr,
+			_("%s: error: "
+			  "will not try to make swapdevice on '%s'\n"),
+			program_name, device_name);
+		exit(1);
+	} else if (check_mount()) {
+		fprintf(stderr,
+			_("%s: error: "
+			  "%s is mounted; will not make swapspace.\n"),
+			program_name, device_name);
+		exit(1);
+	}
+
+	if (check)
+		check_blocks();
+
+	zap_bootbits(DEV, device_name, force);
+
+	p->version = 1;
+	p->last_page = PAGES-1;
+	p->nr_badpages = badpages;
+
+	if (badpages > PAGES - MIN_GOODPAGES)
+		die(_("Unable to set up swap-space: unreadable"));
+
+	goodpages = PAGES - badpages - 1;
+	printf(_("Setting up swapspace version 1, size = %llu KiB\n"),
+		goodpages * pagesize / 1024);
+
+	write_signature("SWAPSPACE2");
+	write_uuid_and_label(uuid, opt_label);
+
+	offset = 1024;
+	if (lseek(DEV, offset, SEEK_SET) != offset)
+		die(_("unable to rewind swap-device"));
+	if (write_all(DEV, (char *) signature_page + offset,
+				    pagesize - offset) == -1) {
+		fprintf(stderr, _("%s: %s: unable to write signature page: %s"),
+			program_name, device_name, strerror(errno));
+		exit(1);
+	}
+
+	/*
+	 * A subsequent swapon() will fail if the signature
+	 * is not actually on disk. (This is a kernel bug.)
+	 */
+#ifdef HAVE_FSYNC
+	if (fsync(DEV))
+		 die(_("fsync failed"));
+#endif
+
+#ifdef HAVE_LIBSELINUX
+	if (S_ISREG(statbuf.st_mode) && is_selinux_enabled() > 0) {
+		security_context_t context_string;
+		security_context_t oldcontext;
+		context_t newcontext;
+
+		if (fgetfilecon(DEV, &oldcontext) < 0) {
+			if (errno != ENODATA) {
+				fprintf(stderr, _("%s: %s: unable to obtain selinux file label: %s\n"),
+						program_name, device_name,
+						strerror(errno));
+				exit(1);
+			}
+			if (matchpathcon(device_name, statbuf.st_mode, &oldcontext))
+				die(_("unable to matchpathcon()"));
+		}
+		if (!(newcontext = context_new(oldcontext)))
+			die(_("unable to create new selinux context"));
+		if (context_type_set(newcontext, SELINUX_SWAPFILE_TYPE))
+			die(_("couldn't compute selinux context"));
+
+		context_string = context_str(newcontext);
+
+		if (strcmp(context_string, oldcontext)!=0) {
+			if (fsetfilecon(DEV, context_string)) {
+				fprintf(stderr, _("%s: unable to relabel %s to %s: %s\n"),
+						program_name, device_name,
+						context_string,
+						strerror(errno));
+				exit(1);
+			}
+		}
+		context_free(newcontext);
+		freecon(oldcontext);
+	}
+#endif
+	return 0;
+}
diff --git a/util-linux-ng-2.17.2/disk-utils/raw.8 b/util-linux-ng-2.17.2/disk-utils/raw.8
new file mode 100644
index 0000000..72bb17c
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/raw.8
@@ -0,0 +1,94 @@
+.\" -*- nroff -*-
+.TH RAW 8 "Aug 1999" "Version 0.1"
+.SH NAME
+raw \- bind a Linux raw character device
+.SH SYNOPSIS
+.B raw
+.I /dev/raw/raw<N> <major> <minor>
+.PP
+.B raw
+.I /dev/raw/raw<N> /dev/<blockdev>
+.PP
+.B raw
+.B \-q
+.I /dev/raw/raw<N>
+.PP
+.B raw
+.B \-qa
+.SH DESCRIPTION
+.B raw
+is used to bind a Linux raw character device to a block device.  Any
+block device may be used: at the time of binding, the device driver does
+not even have to be accessible (it may be loaded on demand as a kernel
+module later).
+.PP
+.B raw
+is used in two modes: it either sets raw device bindings, or it queries
+existing bindings.  When setting a raw device,
+.I /dev/raw/raw<N>
+is the device name of an existing raw device node in the filesystem.
+The block device to which it is to be bound can be specified either in
+terms of its
+.I major
+and
+.I minor
+device numbers, or as a path name
+.I /dev/<blockdev>
+to an existing block device file.
+.PP
+The bindings already in existence can be queried with the 
+.I \-q
+option, with is used either with a raw device filename to query that one
+device, or with the 
+.I \-a
+option to query all bound raw devices.
+.PP
+Unbinding can be done by specifying major and minor 0.
+.PP
+Once bound to a block device, a raw device can be opened, read and
+written, just like the block device it is bound to.  However, the raw
+device does not behave exactly like the block device.  In particular,
+access to the raw device bypasses the kernel's block buffer cache
+entirely: all I/O is done directly to and from the address space of the
+process performing the I/O.  If the underlying block device driver can
+support DMA, then no data copying at all is required to complete the
+I/O.
+.PP
+Because raw I/O involves direct hardware access to a process's memory, a
+few extra restrictions must be observed.  All I/Os must be correctly
+aligned in memory and on disk: they must start at a sector offset on
+disk, they must be an exact number of sectors long, and the data buffer
+in virtual memory must also be aligned to a multiple of the sector
+size.  The sector size is 512 bytes for most devices.
+.SH OPTIONS
+.TP
+.B -q
+Set query mode.
+.B raw
+will query an existing binding instead of setting a new one.
+.TP
+.B -a
+With
+.B -q
+, specifies that all bound raw devices should be queried.
+.TP
+.B -h
+provides a usage summary.
+.SH BUGS
+The Linux
+.B dd
+(1) command should be used without bs= option or the blocksize needs to be a
+multiple of the sector size of the device (512 bytes usually) otherwise it
+will fail with "Invalid Argument" messages (EINVAL).
+
+.PP
+Raw I/O devices do not maintain cache coherency with the Linux block
+device buffer cache.  If you use raw I/O to overwrite data already in
+the buffer cache, the buffer cache will no longer correspond to the
+contents of the actual storage device underneath.  This is deliberate,
+but is regarded either a bug or a feature depending on who you ask!
+.SH AUTHOR
+Stephen Tweedie (sct@redhat.com)
+.SH AVAILABILITY
+The raw command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/disk-utils/raw.c b/util-linux-ng-2.17.2/disk-utils/raw.c
new file mode 100644
index 0000000..f634b60
--- /dev/null
+++ b/util-linux-ng-2.17.2/disk-utils/raw.c
@@ -0,0 +1,265 @@
+/*
+ * raw.c: User mode tool to bind and query raw character devices.
+ *
+ * Stephen Tweedie, 1999, 2000
+ *
+ * This file may be redistributed under the terms of the GNU General
+ * Public License, version 2.
+ * 
+ * Copyright Red Hat Software, 1999, 2000
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
+#include <linux/raw.h>
+#include <linux/major.h>
+#include "nls.h"
+
+
+#define RAWDEVDIR "/dev/raw/"
+#define RAWDEVCTL RAWDEVDIR "rawctl"
+/* deprecated */
+#define RAWDEVCTL_OLD "/dev/rawctl"
+
+
+#define RAW_NR_MINORS 8192
+
+char *	progname;
+int	do_query = 0;
+int	do_query_all = 0;
+
+int	master_fd;
+int	raw_minor;
+
+void open_raw_ctl(void);
+int  query(int minor, const char *raw_name, int quiet);
+int  bind (int minor, int block_major, int block_minor);
+
+
+static void usage(int err)
+{
+	fprintf(stderr,
+		_("Usage:\n"
+		"  %s " RAWDEVDIR "rawN <major> <minor>\n"
+		"  %s " RAWDEVDIR "rawN /dev/<blockdev>\n"
+		"  %s -q " RAWDEVDIR "rawN\n"
+		"  %s -qa\n"),
+		progname, progname, progname, progname);
+	exit(err);
+}
+
+
+int main(int argc, char *argv[])
+{
+	int  c;
+	char * raw_name;
+	char * block_name;
+	int  err;
+	int  block_major, block_minor;
+	int  i, rc;
+
+	struct stat statbuf;
+
+	setlocale(LC_MESSAGES, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	progname = argv[0];
+
+	while ((c = getopt(argc, argv, "ahq")) != -1) {
+		switch (c) {
+		case 'a':
+			do_query_all = 1;
+			break;
+		case 'h':
+			usage(0);
+		case 'q':
+			do_query = 1;
+			break;
+		default:
+			usage(1);
+		}
+	}
+
+	/*
+	 * Check for, and open, the master raw device, /dev/raw
+	 */
+
+	open_raw_ctl();
+
+	if (do_query_all) {
+		if (optind < argc)
+			usage(1);
+		for (i = 1; i < RAW_NR_MINORS; i++)
+			query(i, NULL, 1);
+		exit(0);
+	}
+
+	/*
+	 * It's a bind or a single query.  Either way we need a raw device.
+	 */
+
+	if (optind >= argc)
+		usage(1);
+	raw_name = argv[optind++];
+
+	/*
+	 * try to check the device name before stat(), because on systems with
+	 * udev the raw0 causes a create udev event for char 162/0, which
+	 * causes udev to *remove* /dev/rawctl
+	 */
+	rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
+	if (rc != 1)
+		usage(1);
+
+	if (raw_minor == 0) {
+		fprintf (stderr,
+			_("Device '%s' is control raw dev "
+			"(use raw<N> where <N> is greater than zero)\n"),
+			raw_name);
+		exit(2);
+	}
+
+	if (do_query)
+		return query(raw_minor, raw_name, 0);
+
+	/*
+	 * It's not a query, so we still have some parsing to do.  Have
+	 * we been given a block device filename or a major/minor pair?
+	 */
+
+	switch (argc - optind) {
+	case 1:
+		block_name = argv[optind];
+		err = stat(block_name, &statbuf);
+		if (err) {
+			fprintf (stderr,
+				 _("Cannot locate block device '%s' (%s)\n"),
+				 block_name, strerror(errno));
+			exit(2);
+		}
+
+		if (!S_ISBLK(statbuf.st_mode)) {
+			fprintf (stderr, _("Device '%s' is not a block dev\n"),
+				 block_name);
+			exit(2);
+		}
+
+		block_major = major(statbuf.st_rdev);
+		block_minor = minor(statbuf.st_rdev);
+		break;
+
+	case 2:
+		block_major = strtol(argv[optind], 0, 0);
+		block_minor = strtol(argv[optind+1], 0, 0);
+		break;
+
+	default:
+		block_major = block_minor = 0; /* just to keep gcc happy */
+		usage(1);
+	}
+
+	return bind(raw_minor, block_major, block_minor);
+	return 0;
+
+}
+
+
+void open_raw_ctl(void)
+{
+	int errsv;
+
+	master_fd = open(RAWDEVCTL, O_RDWR, 0);
+	if (master_fd < 0) {
+		errsv = errno;
+		master_fd = open(RAWDEVCTL_OLD, O_RDWR, 0);
+		if (master_fd < 0) {
+			fprintf (stderr,
+				 _("Cannot open master raw device '"
+				 RAWDEVCTL
+				 "' (%s)\n"), strerror(errsv));
+			exit(2);
+		}
+	}
+}
+
+int query(int minor, const char *raw_name, int quiet)
+{
+	struct raw_config_request rq;
+	static int has_worked = 0;
+	int err;
+
+	if (raw_name) {
+		struct stat statbuf;
+
+		err = stat(raw_name, &statbuf);
+		if (err) {
+			fprintf (stderr, _("Cannot locate raw device '%s' (%s)\n"),
+				 raw_name, strerror(errno));
+			exit(2);
+		}
+
+		if (!S_ISCHR(statbuf.st_mode)) {
+			fprintf (stderr, _("Raw device '%s' is not a character dev\n"),
+				 raw_name);
+			exit(2);
+		}
+		if (major(statbuf.st_rdev) != RAW_MAJOR) {
+			fprintf (stderr, _("Device '%s' is not a raw dev\n"),
+				 raw_name);
+			exit(2);
+		}
+		minor = minor(statbuf.st_rdev);
+	}
+
+	rq.raw_minor = minor;
+	err = ioctl(master_fd, RAW_GETBIND, &rq);
+	if (err < 0) {
+		if (quiet && errno == ENODEV)
+			return 3;
+		if (has_worked && errno == EINVAL)
+			return 0;
+		fprintf (stderr,
+			 _("Error querying raw device (%s)\n"),
+			 strerror(errno));
+		exit(3);
+	}
+	/* If one query has worked, mark that fact so that we don't
+	 * report spurious fatal errors if raw(8) has been built to
+	 * support more raw minor numbers than the kernel has. */
+	has_worked = 1;
+	if (quiet && !rq.block_major && !rq.block_minor)
+		return 0;
+	printf (_(RAWDEVDIR "raw%d:	bound to major %d, minor %d\n"),
+		minor, (int) rq.block_major, (int) rq.block_minor);
+	return 0;
+}
+
+int bind(int minor, int block_major, int block_minor)
+{
+	struct raw_config_request rq;
+	int err;
+
+	rq.raw_minor   = minor;
+	rq.block_major = block_major;
+	rq.block_minor = block_minor;
+	err = ioctl(master_fd, RAW_SETBIND, &rq);
+	if (err < 0) {
+		fprintf (stderr,
+			 _("Error setting raw device (%s)\n"),
+			 strerror(errno));
+		exit(3);
+	}
+	printf (_(RAWDEVDIR "raw%d:	bound to major %d, minor %d\n"),
+		raw_minor, (int) rq.block_major, (int) rq.block_minor);
+	return 0;
+}
+
diff --git a/util-linux-ng-2.17.2/docs/v2.13-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.13-ReleaseNotes
new file mode 100644
index 0000000..efd5d68
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.13-ReleaseNotes
@@ -0,0 +1,460 @@
+
+Util-linux-ng 2.13 Release Notes  (28-Aug-2007)
+===============================================
+
+Release highlights:
+------------------
+
+ mount(8) doesn't include NFS client code anymore. Don't forget to
+ install nfs-utils 1.1.0 or newer with /sbin/[u]mount.{nfs,nfs4}.
+
+ mount(8) doesn't include filesystem detection code anymore. You
+ have to compile --with-fsprobe={blkid,volume_id}, and libblkid
+ (e2fsprogs) or libvolume_id (udev >= v110) is required.
+
+ mount(8) supports new relatime, context, fscontext, and defcontext
+ mount options.
+
+ losetup(8) supports command line option "-a" to list all used loop
+ devices, '-s' to print a device name if "-f" and a file argument
+ are present, and "-r" to create a read-only loop device.
+
+ fdisk(8) Sun label support has been improved. fdisk(8) is also able
+ to warn about detected GPT (fdisk doesn't support GPT).
+
+ taskset(1) is independent on hardcoded NR_CPUS. chrt(1) supports
+ SCHED_BATCH scheduling policy.
+
+ The package build system is now based on autotools. The build system
+ supports  separate CFLAGS and LDFLAGS for suid programs (SUID_CFLAGS,
+ SUID_LDFLAGS). For more details see the README file
+
+ hwclock(8) supports command line option --rtc=<path> and /dev/rtc0
+ device. --systohc functionality has been improved, and it doesn't cause
+ a 500ms inaccuracy each time it is used.
+
+ Audit system support (--with-audit) has been added to hwclock(8) and
+ login(1).
+
+ SELinux support (--with-selinux) has been added to mkswap(8) and
+ mount(8).
+
+ setarch(8) upstream has been merged with util-linux-ng.
+
+ rtcwake(8) command has been added to util-linux-ng.
+
+ arch(1) is deprecated in favor of "uname -m" or arch(1) from coreutils
+ (>= 6.9+). The util-linux-ng package doesn't build arch by default,
+ you have to use the option --enable-arch.
+
+
+Fixed security issues:
+---------------------
+
+ CVE-2007-0822 - mount(8) allows local users to trigger a NULL
+                 dereference and an application crash
+ CVE-2006-7108 - login(1) omits PAM account validation when auth is
+                 skipped
+
+
+Changelog:
+---------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/
+
+
+agetty:
+   - 8 bit characters on the Linux console lead to input corruption  [Samuel Thibault]
+   - add 'O' escape code to display domain name  [Karel Zak]
+   - check gethostname() return value  [Karel Zak]
+   - fix short malloc in initstring handling  [LaMont Jones]
+blockdev:
+   - add BLKFRAGET/BLKFRASET ioctls  [Karel Zak]
+   - cleanup usage() and update man page  [Karel Zak]
+   - fix "blockdev --getsz" for large devices  [Karel Zak]
+   - use LU and LLU for BLKGETSIZE and BLKGETSIZE64  [Karel Zak]
+build-sys:
+   - add ${AC,AP,AM,AH}_OPTS to autogen.sh  [Karel Zak]
+   - add AC_GNU_SOURCE  [Karel Zak]
+   - add Automake option dist-bzip2  [Stepan Kasal]
+   - add --disable-makeinstall-chown  [Karel Zak]
+   - add missing files  [Karel Zak]
+   - add SUID_CFLAGS  [Karel Zak]
+   - add SUID_LDFLAGS  [Stepan Kasal]
+   - add support for audit  [Karel Zak]
+   - add warning when libuuid is not found  [Karel Zak]
+   - amend .gitignore  [Stepan Kasal]
+   - call automake after autoconf  [Stepan Kasal]
+   - cleanup architecture conditionals  [Karel Zak]
+   - cleanup sys-utils/ rdev symlinks  [Karel Zak]
+   - configure.am selinux support cleanup  [Karel Zak]
+   - declare SUID_CFLAGS and SUID_LDFLAGS as precious  [Stepan Kasal]
+   - do not build convenience libraries in lib/  [Stepan Kasal]
+   - do not kick off AM_CFLAGS by SUID_CFLAGS  [Stepan Kasal]
+   - do not play with DEFS, use AM_CPPFLAGS  [Stepan Kasal]
+   - do not set with_foo twice  [Stepan Kasal]
+   - do not use internal Autoconf variables  [Stepan Kasal]
+   - do not use wildcards in EXTRA_DIST  [Stepan Kasal]
+   - factor out common parts from mount/Makefile.am  [Stepan Kasal]
+   - fix directories in EXTRA_DIST  [Karel Zak]
+   - fix HAVE_NCURSES  [Karel Zak]
+   - fix ifdef ENABLE_WIDECHAR usage  [Karel Zak]
+   - fix linking when ncurses is built with --with-termlib=tinfo  [Arkadiusz Miskiewicz]
+   - fix README filenames and add missing files to EXTRA_DISTs  [Karel Zak]
+   - fix the example configure call in README  [Stepan Kasal]
+   - fix the final message of autogen.sh  [Stepan Kasal]
+   - in configure.ac, change "po" -> "$srcdir/po"  [Stepan Kasal]
+   - in the clean targets use "find ... | xargs rm -f"  [Stepan Kasal]
+   - let configure instantiate the misc-utils/*.pl scripts  [Stepan Kasal]
+   - make the getopt example directory relative to datadir  [Stepan Kasal]
+   - merge adjacent AC_CONFIG_HEADERS and AC_CONFIG_FUNCS calls  [Stepan Kasal]
+   - minor fixes in configure.in  [Karel Zak]
+   - missing header when NLS is disabled  [Gabriel Barazer]
+   - mount/Makefile.am tiny cleanup II  [Stepan Kasal]
+   - mount/Makefile.am tiny cleanup  [Stepan Kasal]
+   - move -D flags to *_CPPFLAGS  [Stepan Kasal]
+   - move the optimization flags to AM_CFLAGS  [Stepan Kasal]
+   - --prefix defaults to /usr  [Stepan Kasal]
+   - release++  [Karel Zak]
+   - remove aclocal.m4 from SCM  [Karel Zak]
+   - remove AC_PROG_RANLIB  [Stepan Kasal]
+   - remove asm/page.h test  [Karel Zak]
+   - remove config.h.in from VCS  [Stepan Kasal]
+   - remove config/include-Makefile.am from EXTRA_DIST  [Stepan Kasal]
+   - remove DEFAULT_INCLUDES workaround  [Karel Zak]
+   - remove -fomit-frame-pointer  [Karel Zak]
+   - remove generated autotools stuff from git  [Karel Zak]
+   - remove libtool  [Karel Zak]
+   - remove "make mrproper", git-clean is good enough  [Karel Zak]
+   - remove po/Makevars.template from EXTRA_DIST  [Stepan Kasal]
+   - remove swapargs.h, move the tests to main configure.ac  [Stepan Kasal]
+   - rename to -ng, change maintainer name  [Karel Zak]
+   - replace AC_TRY_* by AC_*_IFELSE  [Stepan Kasal]
+   - s/AC_HELP_STRING/AS_HELP_STRING/  [Stepan Kasal]
+   - set DISTCHECK_CONFIGURE_FLAGS in top-level makefile  [Stepan Kasal]
+   - simplify "clean" in tests/Makefile.am  [Stepan Kasal]
+   - update po/POTFILES.in  [Stepan Kasal]
+   - use dist_example_DATA  [Stepan Kasal]
+   - use dist_noinst_DATA to work around the bug with dist_man_MANS  [Stepan Kasal]
+   - use dist_noinst_HEADERS in include/Makefile.am  [Stepan Kasal]
+   - use dist_usrbinexec_SCRIPTS in misc-utils/Makefile.am  [Stepan Kasal]
+cal:
+   - add test code  [Karel Zak]
+   - fix a segfault and -3m highlighting  [Karel Zak]
+   - ifdef cleanup, non-curses/tempcap code fixes  [Karel Zak]
+   - widechar code cleanup  [Karel Zak]
+cfdisk:
+   - build-sys defines HAVE_RPMATCH, not HAVE_rpmatch  [Karel Zak]
+   - fix stupid typo in GPT checker call  [Karel Zak]
+chsh:
+   - don't use empty shell field in /etc/passwd  [Karel Zak]
+   - remove tailing wihit-spaces and use PATH_BSHELL  [Karel Zak]
+col:
+   - getwchar() errors shouldn't be hidden  [Karel Zak]
+cytune:
+   - make the oneliner more specific the cyclades hw in question  [Justin B Rye]
+   - remove linux/tty.h inclusion  [Karel Zak]
+ddate:
+   - fix compiler warnings  [Karel Zak]
+disk-utils:
+   - fix libuuid usage in mkswap  [Matthias Koenig]
+   - let mkfs tools open with O_EXCL  [Matthias Koenig]
+docs:
+   - add DEPRECATED to EXTRA_DIST  [Karel Zak]
+   - add note about http //translationproject.org  [Karel Zak]
+   - add rdev(8) between deprecated utils  [Karel Zak]
+   - add README.licensing  [Karel Zak]
+   - add release notes  [Karel Zak]
+   - add the DEPRECATED file  [Karel Zak]
+   - clean up TODO file and add a new resuest for 2.14  [Karel Zak]
+   - fix authorship of 8-bit cleanup agetty patch  [Karel Zak]
+   - fix BSD licence name in README.licensing  [Karel Zak]
+   - fix info about devel/master branchs  [Karel Zak]
+   - fix URL and typos in README.devel  [Karel Zak]
+   - remove deprecated section from README  [Karel Zak]
+   - update release notes  [Karel Zak]
+fdisk:
+   - Makefile.am refactoring  [Karel Zak]
+   - add GPT detection code  [Karel Zak]
+   - add MAC label detection  [Karel Zak]
+   - add support for udev persistent device names  [Matthias Koenig]
+   - check returns in fdisk from partition changes  [Mike Frysinger]
+   - cleanup full disk detection code  [Karel Zak]
+   - cleanup partname.c  [Karel Zak]
+   - do not complain about regular files  [H. Peter Anvin]
+   - fix "differ in signedness" compiler warnings  [Karel Zak]
+   - fix "type qualifiers ignored on function return type"  [Karel Zak]
+   - many significant improvements and fixes to Sun label handling  [David Miller]
+   - move duplicate stuff from fdisk*label.h to fdisk.h  [Karel Zak]
+   - use unsigned long long instead int for sectors  [Karel Zak]
+   - when generating a DOS disk label, give it an ID  [H. Peter Anvin]
+getopt:
+   - remove old unused files  [Karel Zak]
+hexdump:
+   - don't use memset with zero lenght  [Karel Zak]
+hwclock:
+   - add --rtc=<path> option and support for /dev/rtc0  [Karel Zak]
+   - add support for audit system  [Karel Zak]
+   - fix --systohc sets clock 0.5 seconds slow  [Karel Zak]
+   - make ggc happy and check return values from fgets, read and write  [Karel Zak]
+   - remove tailing white-spaces and clean up clock.h  [Karel Zak]
+ionice:
+   - clean up error handling  [Matthias Koenig]
+   - cleanup usage for idle class  [Matthias Koenig]
+   - fix ionice build on sparc  [David Miller]
+   - prefer SYS_ioprio_{set,get} from glibc to hardcoded version  [Karel Zak]
+ipcs:
+   - add new tests for ipcs limits  [Karel Zak]
+   - add regression test for output headers  [Karel Zak]
+   - fix typo in Semaphore headers  [Karel Zak]
+   - max total shared memory in kbytes instead pages  [Karel Zak]
+logger:
+   - use snprintf instead of sprintf in logger.c  [LaMont Jones]
+login:
+   - add audit support  [Karel Zak]
+   - add IPv6 support  [Karel Zak]
+   - add regression test for IP address checking code  [Karel Zak]
+   - attempt to run if it has no read/write access to its terminal  [Jason Vas Dias]
+   - close PAM session after failed pam_setcred  [Steve Grubb]
+   - improve work with signals  [Karel Zak]
+   - keep syslog useful for end of PAM session.  [Karel Zak]
+   - login's timeout can fail  [Jason Vas Dias]
+   - omits PAM account validation when auth is skipped (CVE-2006-7108)  [Karel Zak]
+   - remove triiling white-spaces  [Karel Zak]
+   - replace /usr/spool/mail with /var/spool/main in man page  [Karel Zak]
+   - update 32bit utmp correctly on 64bit system  [Karel Zak]
+lomount.c:
+   - don't use mlockall if CRYPT_NONE  [Masatake YAMATO]
+look:
+   - fix problem with !isalnum() words  [Karel Zak]
+   - man page clarification  [Pádraig Brady]
+   - remove tailing white-spaces  [Karel Zak]
+losetup:
+   - add -a option to list all used loop devices  [Karel Zak]
+   - add a new option -s  [Karel Zak]
+   - add long options and fix man page  [Karel Zak]
+   - add support read-only loops  [Karel Zak]
+   - add to man page info about deprecated cryptoloop  [Karel Zak]
+man pages:
+   - add "AVAILABILITY" section  [Karel Zak]
+   - cleanup of chrt.1 and taskset.1  [LaMont Jones]
+mcookie:
+   - remove non-linux code  [Karel Zak]
+misc-util:
+   - new rtcwake command  [Bernhard Walle]
+misc-utils:
+   - add scriptreplay manpage  [Matthias Koenig]
+   - remove old cal test  [Karel Zak]
+mkfs:
+   - remove nonsense from man page  [Karel Zak]
+mkfs.cramfs:
+   - cleanup HAVE_ macros usage  [Karel Zak]
+   - fix a way how mkfs works with empty files  [Karel Zak]
+   - remove hardcoded limit for directories  [Karel Zak]
+mkswap:
+   - add regression test  [Karel Zak]
+   - automatically add selinux label to swapfile  [Karel Zak]
+   - avoid mkswap usage on already mounted device  [Karel Zak]
+   - default to V1 in any case  [Matthias Koenig]
+   - fix signedness problems and remove obsolete code  [Karel Zak]
+   - gcc happy  unsigned long usage  [Karel Zak]
+more:
+   - fix file descriptor leak  [Steve Grubb]
+   - fix underlining for multibyte chars  [Karel Zak]
+mount:
+   - add acl option documentation for ext3 and reiserfs  [Matthias Koenig]
+   - add note about /etc/mtab unreliability to mount.8  [Karel Zak]
+   - add note about fcntl/ioctl unreliability on NFS to mount.8  [Karel Zak]
+   - add -s and -f and note to man page for external mount helpers  [Karel Zak]
+   - add simple (printf-like) debug routine and --debug option  [Karel Zak]
+   - add support for context, fscontext and defcontext selinux mount options  [Karel Zak]
+   - add support for mixed usage of SPECes  [Karel Zak]
+   - add support for mtab "uhelper" option  [Karel Zak]
+   - avoid duplicate entries in mtab when mount -f  [Karel Zak]
+   - avoid duplicates for root fs in mtab  [Matthias Koenig]
+   - call /sbin/mount.<type> also when mounting without "-t"  [Karel Zak]
+   - clean up getfs* (fstab.c) interface  [Karel Zak]
+   - clean up info about NFS in mount.8  [Karel Zak]
+   - doesn't rpc_pipefs and nfsd on umount -a  [Karel Zak]
+   - do not treat arm/sparc specially.  [Mike Frysinger]
+   - don't umount sysfs when running umount -a  [Mike Frysinger]
+   - fix -f -o remount  [Karel Zak]
+   - fix -fv so that it doesn't incorrectly spit out an error that nothing was done.  [Mike Frysinger]
+   - fix has_* functions (CVE-2007-0822)  [Karel Zak]
+   - fix incorrect behavior when more than one fs type is specified  [Attila Áfra]
+   - fix list logic in update_mtab  [Karel Zak]
+   - fix memory usage in update_mtab  [Mike Frysinger]
+   - fix mtab_lock  [Karel Zak]
+   - fix typo in error message  [Karel Zak]
+   - free loop device on failure  [Sascha Sommer]
+   - fsprobe  add libvolume_id support  [Karel Zak]
+   - fsprobe  add libvolume_id support to configure.ac  [Karel Zak]
+   - fsprobe  make fsprobe_get_devname functions more generic  [Karel Zak]
+   - fsprobe  remove mount_guess_fstype.{c,h}  [Karel Zak]
+   - fsprobe  remove non-blkid code  [Karel Zak]
+   - fsprobe  rename files to fsprobe_*  [Karel Zak]
+   - fsprobe  rename the rest of API routines to fsprobe_*  [Karel Zak]
+   - fsprobe  use blkid cache only when really necessary  [Karel Zak]
+   - getfs_* (fstab) interface has to work with canonicalize()  [Karel Zak]
+   - kill mount_guess_rootdev  [Stepan Kasal]
+   - loop device race condition  [Matthias Koenig]
+   - mention hfsplus in mount manpage  [LaMont Jones]
+   - needs to handle special mountprog even on guessed file systems.  [Karel Zak]
+   - parse SPEC before search in fstab  [Karel Zak]
+   - relative atime support  [Valerie Henson]
+   - remove all NFS code  [Karel Zak]
+   - remove nfsmount() from sundries.h  [Karel Zak]
+   - rewrite getfs_by_specdir() without mem leaks  [Karel Zak]
+   - shared-subtree support  [Karel Zak]
+   - should set proper permissions on locktime  [Flávio Leitner]
+   - update mtab correctly when mount --move  [Karel Zak]
+   - update xfs mount options  [Matthias Koenig]
+   - use encoded labels for volume_id  [Kay Sievers]
+   - use growable string for options  [Karel Zak]
+   - use loop= option when mounting by /sbin/mount.<type>  [Karel Zak]
+   - use realloc for xstrconcat functions  [Karel Zak]
+   - use verbose mode instead debug mode  [Karel Zak]
+namei:
+   - fix logic and infinite loop of symlinks  [Karel Zak]
+   - new regression test  [Karel Zak]
+newgrp:
+   - add support for /etc/gshadow  [Karel Zak]
+   - check result from getgrnam() more carefully  [Karel Zak]
+partx:
+   - add man pages for addpart, delpart and partx  [Karel Zak]
+po:
+   - gettextizing some overlooked messages.  [Benno Schulenberg]
+   - rename mount/mntent.c to mount/mount_mntent.c  [Karel Zak]
+   - typo in french translation of mount error.  [Mike Frysinger]
+   - update cs.po (from translationproject.org)  [Petr Pisar]
+   - update de.po (from translationproject.org)  [Michael Piefel]
+   - update nl.po (from translationproject.org)  [Benno Schulenberg]
+   - update sv.po (from translationproject.org)  [Daniel Nylander]
+   - update vi.po (from translationproject.org)  [Phan Vinh Thinh]
+   - vipw doesn't use rpmatch, all translations have to use y/n  [Karel Zak]
+raw:
+   - add file with udev rule example  [Karel Zak]
+   - don't accept raw0 as a target name  [Karel Zak]
+   - move the raw command to /sbin  [Karel Zak]
+   - update man page (about dd and O_DIRECT)  [Karel Zak]
+rdev:
+   - should be delivered on amd64 as well as i386.  [LaMont Jones]
+readprofile:
+   - fix on ppc64  [Matthias Koenig]
+schedutils:
+   - add support for SCHED_BATCH  [Karel Zak]
+   - define SCHED_BATCH when compile with old glibc  [Karel Zak]
+   - fix chrt docs and pid=0 usage  [Matthias Koenig]
+   - remove extra hyptens from man pages  [Karel Zak]
+script:
+   - fix race conditions  [Karel Zak]
+   - improve quiet mode  [Karel Zak]
+setarch:
+   - add NLS support  [Karel Zak]
+   - add --3gb option fot compatibility with Debian linux{32,64} command  [Karel Zak, LaMont Jones]
+   - add __alpha__ support  [Balint Cristian]
+   - add parisc/parisc64 support  [LaMont Jones]
+   - add sparc32bash alias to keep compatibility with sparc32  [Dennis Gilmore]
+   - cleanup licensing note  [Karel Zak]
+   - finish adding parisc support  [Karel Zak, LaMont Jones]
+sfdisk:
+   - fix "differ in signedness" compiler warnings  [Karel Zak]
+   - fix "may be used uninitialized" compiler warnings  [Karel Zak]
+   - setting default geometry values  [Luciano Chavez]
+swapoff:
+   - correctly handle UUID= and LABEL= identifiers  [LaMont Jones]
+swapon:
+   - cleanup PATH_ macros and tailing white-spaces  [Karel Zak]
+   - cleanup fsprobe_*() usage  [Karel Zak]
+   - does not correctly deal with symlinks  [Marco d'Itri]
+   - fix swapon headers and syscalls  [Mike Frysinger]
+   - simplify an #if  [Stepan Kasal]
+sys-utils:
+   - add arch(1) back to the official tree  [Karel Zak]
+   - add note about obsolete ramsize option to rdev.8  [Karel Zak]
+   - added setarch command  [Karel Zak]
+   - fix man page headers  [Karel Zak]
+   - move some man pages from category 8 to 1  [Karel Zak]
+taskset:
+   - check for existence of sched_getaffinity  [Mike Frysinger]
+   - independent of hardcoded NR_CPUS max.  [Cliff Wickman]
+tests:
+   - add basic infrastructure for regression tests  [Karel Zak]
+   - add cal -1 test  [Karel Zak]
+   - add cal -3 test  [Karel Zak]
+   - add cal -y test  [Karel Zak]
+   - add expected outputs for cramfs  [Karel Zak]
+   - add functions for label, uuid and fstype detection  [Karel Zak]
+   - add hwclock systohc test  [Karel Zak]
+   - add library for LD_PRELOAD to manipulate with time() in tests  [Karel Zak]
+   - add license notices, change from gplv2-only to gplv2-or-later  [Karel Zak]
+   - add lock_mtab() performance and reliability test  [Karel Zak]
+   - add look test for words with separator  [Karel Zak]
+   - add missing header  [Matthias Koenig]
+   - add mkfs.cramfs tests  [Karel Zak]
+   - add more variants to {mount,fstab}-by-{label,uuid,devname}  [Karel Zak]
+   - add mount by devname from fstab  [Karel Zak]
+   - add mount by devname test  [Karel Zak]
+   - add mount by devname with label in fstab  [Karel Zak]
+   - add mount by devname with uuid in fstab  [Karel Zak]
+   - add mount by label from fstab test  [Karel Zak]
+   - add mount by LABEL test  [Karel Zak]
+   - add mount by label with devname in fstab  [Karel Zak]
+   - add mount by label with uuid in fstab  [Karel Zak]
+   - add mount by UUID from fstab test  [Karel Zak]
+   - add mount by UUID test  [Karel Zak]
+   - add mount by uuid with devname in fstab  [Karel Zak]
+   - add mount by uuid with label in fstab  [Karel Zak]
+   - add mount /dev/symlink test  [Karel Zak]
+   - add mount --move test  [Karel Zak]
+   - add mount -o remount test  [Karel Zak]
+   - add return code  [Karel Zak]
+   - add script(1) race condition test  [Karel Zak]
+   - add simple helper that returns info about system  [Karel Zak]
+   - add support for fstab modification  [Karel Zak]
+   - add support for suid programs  [Karel Zak]
+   - add swapon by devname test  [Karel Zak]
+   - add swapon by UUID test  [Karel Zak]
+   - add test for /sbin/mount.<type> call  [Karel Zak]
+   - add ts_log and --verbose support  [Karel Zak]
+   - add ts_ok and ts_failed  [Karel Zak]
+   - cleanup blkid cache after test device deinitialization  [Karel Zak]
+   - code refactoring -- new ts_device_init function  [Karel Zak]
+   - code refactoring -- new ts_skip_nonroot function  [Karel Zak]
+   - code refactoring -- new ts_udev_loop_support function  [Karel Zak]
+   - enable mtablock test when uid=0 only  [Karel Zak]
+   - fix argv[] usage in mnt_test_sysinfo.c  [Karel Zak]
+   - fix dependence on blkid  [Karel Zak]
+   - fix Makefile.am (add missing tests)  [Karel Zak]
+   - fix ts_fstab_add function  [Karel Zak]
+   - fix ULONG_MAX usage on 32bit machines  [Karel Zak]
+   - "if [...]" clean up  [Karel Zak]
+   - make clean need to remove diffs and outputs  [Karel Zak]
+   - pass all arguments to ts_init, add ts_has_option function  [Karel Zak]
+   - refresh mtablock output in expected/ directory  [Karel Zak]
+   - remove dependence on helpers/libpreload-time.so  [Karel Zak]
+   - simplify devices usage  [Karel Zak]
+   - use $AWK based on configure results  [Karel Zak]
+   - use relative paths when sourcing files  [Mike Frysinger]
+text-utils:
+   - fix the more command compilation against termcap  [Karel Zak]
+tools:
+   - add codecheck-config that checks for {HAVE,ENABLE}_ orphans  [Karel Zak]
+vipw:
+   - fix permissions (600->400) for edited /etc/[g]shodow files  [Karel Zak]
+wall:
+   - fix O_NONBLOCK usage  [Alan Curry]
+   - remove deprecated sigsetmask() from wall  [Karel Zak]
+   - remove unwanted newlines from wall  [Karel Zak]
+whereis:
+   - add lib64 paths  [Karel Zak]
+
+- Clean up pagesize/PAGE_SIZE usage.  [Karel Zak]
+- also search for __stext in readprofile  [Mike Frysinger]
+- check exit status of autotools  [Mike Frysinger]
+- clean up realpath.[ch] includes and macros  [Karel Zak]
+- execl() should be use NULL not 0  [Karel Zak]
+- manpage typos  [LaMont Jones]
+- remove hardcoded package name from some utils  [Karel Zak]
+
diff --git a/util-linux-ng-2.17.2/docs/v2.14-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.14-ReleaseNotes
new file mode 100644
index 0000000..1c92a82
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.14-ReleaseNotes
@@ -0,0 +1,418 @@
+
+Util-linux-ng 2.14 Release Notes (09-Jun-2008)
+==============================================
+
+Release highlights
+------------------
+
+ mount(8) supports new "nofail" mount option.
+
+ mount(8) supports auto-destruction of loop devices.
+
+ losetup(8) supports new command line option "-j" to show status of all
+ loop devices associated with given file.
+
+ losetup(8) supports unlimited number of loop devices.
+
+ losetup(8) supports new command line option "--sizelimit" to set data end.
+
+ ldattach(8) command has been added to util-linux-ng. The ldattach
+ daemon opens the specified device file and attaches the line discipline
+ to it for processing of the sent and/or received data.
+
+ setterm(8) supports new command line option "-blank [force|poke]" for
+ TIOCL_{BLANKED,BLANK}SCREEN.
+
+ tailf(8) has been reimplemented to use inotify.
+
+ tailf(8) supports new command line option "-n" to specifying output lines.
+
+ mkswap(8) supports new command line option "-U" to set UUID explicitly.
+
+ fdisk(8) has been fixed to calculate partition size in 2^N.
+
+ cal(8) supports highlighting an arbitrary date.
+
+ agetty(8) makes username-in-uppercase feature optional (off by default).
+ Users who use uppercase-only terminals need to use the option "-U" now.
+
+ losetup(8), mount(8), umount(8), fdisk(8) and sfdisk(8) support static
+ linking when compiled with --enable-static-programs.
+
+ hwclock(8) supports new command line option "adjfile" to override
+ the default /etc/adjtime.
+
+ scriptreplay(1) command has been re-written from Perl to C.
+
+
+Deprecated
+----------
+
+ The losetup(8) '-s' option (introduced by util-linux-ng-2.13) is deprecated
+ now.  This short form of the option '--show' could be in collision with
+ Loop-AES losetup implementation where the same option is used for the loop
+ sizelimit.
+
+
+Fixed security issues
+---------------------
+
+ CVE-2008-1926 - audit log injection via login
+
+		 The problem was originally reported for OpenSSH few months
+                 ago (CVE-2007-3102). The login(1) is affected by the same
+                 bug when built with the option "--with-audit".
+
+
+Stable maintenance releases between v2.13 and v2.14
+---------------------------------------------------
+
+util-linux-ng 2.13.1.1 [22-Apr-2008]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1.1-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1.1-ChangeLog
+
+util-linux-ng 2.13.1 [16-Jan-2008]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1-ChangeLog
+
+
+ChangeLog between v2.13 and v2.14
+---------------------------------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/
+
+agetty:
+   - cleanup MAXHOSTNAMELEN  [Karel Zak]
+   - make username-in-uppercase feature optional (off by default.)  [Hamish Coleman]
+   - non-linux support (use pathnames.h)  [Karel Zak]
+   - replace termio with termios interface  [Samuel Thibault]
+   - ungettextize several debugging messages.  [Benno Schulenberg]
+blockdev:
+   - add --getsz to blockdev.8  [Karel Zak]
+   - add missing description about option --report in manpage  [Li Zefan]
+   - fix  opened file leaving unclosed  [lizf]
+   - use lib/blkdev.c, fix --report  [Karel Zak]
+build-sys:
+   - add --enable-static-programs  [Stepan Kasal, Karel Zak]
+   - add AC_CANONICAL_HOST  [Miklos Szeredi]
+   - add VARSUFFIX to UTIL_CHECK_LIB  [Karel Zak]
+   - add err.h check  [Karel Zak]
+   - add support ionice for Super-H architecture  [Karel Zak]
+   - add v2.14 to NEWS  [Karel Zak]
+   - autogen.sh reports versions of autotools now  [Karel Zak]
+   - build arch(1) during distcheck  [Stepan Kasal]
+   - cleanup "x$foo" usage  [Karel Zak]
+   - cleanup disk-utils/Makefile.am (use $utils_common)  [Karel Zak]
+   - cleanup usage of linux/major.h  [Samuel Thibault]
+   - disable syscall fallbacks for non-linux systems  [Karel Zak]
+   - do not add -luuid to BLKID_LIBS  [Stepan Kasal]
+   - fix missing deps for swapon  [Matthias Koenig]
+   - ignore a bunch of generated files, mostly binaries  [James Youngman]
+   - nls/locale handling in util-linux-ng general  [Mike Frysinger]
+   - non-linux support  [Samuel Thibault]
+   - release++  [Karel Zak]
+   - remove errs.h  [Karel Zak]
+   - remove files that are no longer delivered from git  [LaMont Jones]
+   - remove hardcoded _GNU_SOURCE  [Karel Zak]
+   - remove unnecessary check-local target from login-utils/  [Karel Zak]
+   - set AC_PREREQ to 2.60, increment version to 2.14  [Karel Zak]
+   - simplify code around RDEV_LINKS and SETARCH_LINKS  [Stepan Kasal]
+   - unify method for checking system calls and fallback handling  [Mike Frysinger, Stepan Kasal]
+   - update .gitignore files  [Karel Zak]
+   - use dist_man_MANS instead of man_MANS  [Stepan Kasal]
+   - use ncursesw (wide version) when possibe  [Karel Zak, Mike Frysinger]
+   - use pkg-config to find the libs for static build  [Stepan Kasal]
+   - use portable $(VAR =) instead of gmake-specific $(addsuffix)  [Stepan Kasal]
+cal:
+   - add description about option -V to manpage  [Li Zefan]
+   - add support for highlighting an arbitrary date  [Pádraig Brady]
+   - avoid -Wformat warnings  [Jim Meyering]
+   - fix weekday alignment for certain locales  [Pádraig Brady]
+   - replace errs.h with libc err.h  [Karel Zak]
+   - use HAVE_LIB{NCURSES,NCURSESW} instead HAVE_NCURSES  [Karel Zak]
+cfdisk:
+   - define portable {DEFAULT,ALTERNATE}_DEVICE  [Samuel Thibault]
+   - display cylinders beyond 1024  [Peter Breitenlohner]
+   - slightly increase the size of menu buttons  [Benno Schulenberg]
+   - translate partition-type names when they are printed.  [Benno Schulenberg]
+chfn:
+   - add pam_end() call and cleanup PAM code  [Karel Zak]
+   - fix compiler warnings in selinux stuff  [Karel Zak]
+chfn, chsh, login:
+   - collapsing three similar messages into a single one  [Benno Schulenberg]
+chsh:
+   - should use pam_end function to terminate the PAM transaction  [Yu Zhiguo, Karel Zak]
+column:
+   - replace errs.h with libc err.h  [Karel Zak]
+ddate:
+   - 11th, 12th and 13th of month  [Volker Schatz]
+docs:
+   - add a note about minix v3 to TODO file  [Karel Zak]
+   - add info about .bugfix releases and branches  [Karel Zak]
+   - add note about incorrect tag 2.13.1  [Karel Zak]
+   - add note about losetup --sizelimit to ReleaseNotes  [Karel Zak]
+   - add note about static linking  [Karel Zak]
+   - add v2.14 ReleaseNotes  [Karel Zak]
+   - cleanup DEPRECATED file  [Karel Zak]
+   - cleanup README.devel, add note about coding style and Signed-off-by  [Karel Zak]
+   - fix ChangeLog URL  [Pascal Terjan]
+   - fix stable branche name in README.devel  [Karel Zak]
+   - mark vipw(1) is deprecated in favor of vipw from shadow-utils  [Karel Zak]
+   - refresh TODO list  [Karel Zak]
+   - remove date from ReleasNotes  [Karel Zak]
+   - tweak a few messages for clarity  [Benno Schulenberg]
+   - update AUTHORS file  [Karel Zak]
+   - update TODO file  [Karel Zak]
+   - update v2.14 ReleaseNotes  [Karel Zak]
+   - we already rewrote the scriptreplay script; remove that TODO entry  [James Youngman]
+elvtune:
+   - use get_linux_version()  [Karel Zak]
+fdformat:
+   - install to /usr/sbin instead to /usr/bin  [Karel Zak]
+fdisk:
+   - better fallback for get_random_id()  [H. Peter Anvin]
+   - calculate +size{K,M,G} in 2^N  [Karel Zak]
+   - cleanup BLK* ioctls usage  [Karel Zak]
+   - doesn't recognize the VMware ESX partitions  [Karel Zak]
+   - doing useless ioctl when editing an image  [Pascal Terjan]
+   - fix building for AVR32 and CRIS  [Imre Kaloz]
+   - fix typo  [Karel Zak]
+   - message tweak  [Karel Zak]
+   - non-linux support (MAXPATHLEN)  [Karel Zak]
+   - non-linux support (use standard uintxy_t instead __uxy)  [Samuel Thibault]
+   - use more readable "GPT" name rather than "EFI GPT"  [Robert Millan]
+   - use swab macros from bitops.h  [Karel Zak]
+flock:
+   - typo in man page  [A. Costa]
+fsck.cramfs:
+   - clean up gcc warnings  [Randy Dunlap]
+fsck.minix:
+   - correct the error message given when we can't open the device  [James Youngman]
+   - reset the terminal state if we are killed by a fatal signal  [James Youngman]
+getopt:
+   - fix path to examples in getopt.1  [Karel Zak]
+   - install example scripts as SCRIPTS, not DATA  [Peter Breitenlohner]
+hwclock:
+   - add --adjfile=path option  [Karel Zak]
+   - check for ENODEV  [David Woodhouse]
+   - do not create a zero adjfile  [Alain Guibert]
+   - fix --rtc option  [Matthias Koenig, Karel Zak]
+include:
+   - <stdint.h> provides everything  [Samuel Thibault]
+   - add bitops.h with swab{16,32,64} macros  [Karel Zak]
+   - add mount paths to pathnames.h  [Karel Zak]
+   - cleanup pathnames.h  [Karel Zak]
+ionice:
+   - add a note about permissions to ionice.1  [Karel Zak]
+   - update man page to reflect IDLE class change in  2.6.25  [Karel Zak]
+ipcs:
+   - add information about POSIX compatibility to ipcs.1  [Karel Zak]
+kill:
+   - man page is missing a description of "kill -0"  [Karel Zak]
+ldattach:
+   - add NLS support  [Karel Zak]
+   - new command  [Tilman Schmidt]
+   - use glibc termios  [Karel Zak]
+lib:
+   - add blkdev.{c,h}  [Stefan Krah, Karel Zak]
+   - add linux_version.{c,h}  [Stefan Krah]
+login:
+   - audit log injection attack via login  [Steve Grubb]
+   - fix a small memory leak and remove unnecessary zeroing  [Karel Zak]
+   - login segfaults on EOF (rh#298461)  [Karel Zak]
+   - replace termio with termios interface  [Samuel Thibault]
+   - rewrite is_local() to remove limits on line length  [James Youngman]
+login-utils:
+   - cleanup strlen() and fgets() usage  [James Youngman]
+losetup:
+   - add --associated option  [Karel Zak]
+   - add --sizelimit option  [Shachar Shemesh]
+   - canonicalize loopfile name  [Karel Zak, Matthias Koenig]
+   - clean up gcc warnings  [Randy Dunlap]
+   - fix errno usage  [Karel Zak]
+   - fix typo in losetup.8  [Karel Zak]
+   - mark the option -s as deprecated  [Karel Zak]
+   - remove duplicate xstrdup() and error()  [Karel Zak]
+   - split help message into two smaller parts  [Benno Schulenberg]
+   - support unlimited number of loops  [Karel Zak]
+   - use standard uintxy_t types (struct loop_info64)  [Samuel Thibault]
+mesg:
+   - replace errs.h with libc err.h  [Karel Zak]
+mkfs.cramfs:
+   - clean up gcc warnings  [Randy Dunlap, Karel Zak]
+   - remove unused header file  [lizf]
+   - switch on localization.  [Benno Schulenberg]
+mkfs.minix:
+   - add sectorsize check  [Matthias Koenig]
+   - clean up gcc warnings  [Karel Zak]
+   - clean up gcc warnings  [Randy Dunlap]
+   - device size cleanup  [Matthias Koenig]
+mkswap:
+   - BLKGETSIZE cleanup  [Karel Zak]
+   - cleanup kB vs. KiB usage in error messages  [Karel Zak]
+   - fix compiler warnings  [Karel Zak]
+   - linux_version() code consolidation  [Karel Zak]
+   - possible to crash with SELinux relabeling support  [KaiGai Kohei]
+   - set UUID for swap space (add -U option)  [Martin Schulze]
+   - set errno=0 in write_all()  [Karel Zak]
+   - when writing the signature page, handle EINTR returns  [Karel Zak]
+more:
+   - cleanup gcc warnings  [Randy Dunlap]
+   - non-linux support  [Samuel Thibault]
+   - replace CBAUD with cfgetispeed()  [Samuel Thibault]
+   - use HAVE_WIDECHAR instead ENABLE_WIDECHAR  [Karel Zak]
+mount:
+   - "can't create lock file" message sometimes means failure, sometimes not  [Mark McLoughlin]
+   - "nofail" mount option  [Matthias Koenig, Karel Zak]
+   - -L|-U segfault when label or uuid doesn't exist  [Karel Zak]
+   - add more details to the --version output  [Karel Zak]
+   - add support for sizelimit= mount option (for loop mounts)  [Shachar Shemesh]
+   - allow auto-destruction of loop devices  [Bernardo Innocenti]
+   - chain of symlinks to fstab causes use of pointer after free  [Norbert Buchmuller]
+   - clean up gcc warnings (mount_mntent.c)  [Randy Dunlap]
+   - clean up global variables  [Karel Zak]
+   - cleanup "none" fstype usage  [Karel Zak]
+   - cleanup KERNEL_VERSION, remove my_dev_t.h  [Karel Zak]
+   - cleanup canonicalize() usage  [Karel Zak]
+   - cleanup error() and die()  [Karel Zak]
+   - cleanup usage of _PATH_*  [Karel Zak]
+   - doesn't drop privileges properly when calling helpers  [Ludwig Nussel]
+   - don't call canonicalize(SPEC) for cifs, smbfs and nfs  [Karel Zak]
+   - don't canonicalize LABEL= or UUID= spec  [Karel Zak]
+   - drop the part always true from a while condition  [Pascal Terjan]
+   - fix a small typo in mount.8  [Christophe Blaess]
+   - fix fd leak  [Matthias Koenig]
+   - fix typo in mount.8  [Karel Zak]
+   - hint about helper program if device doesn't exist  [Karel Zak]
+   - improve chmod & chown usage and clean up gcc warnings (fstab.c)  [Karel Zak]
+   - improve error message when helper program not present  [LaMont Jones]
+   - prevent loop mounting the same file twice  [Karel Zak, Matthias Koenig]
+   - remount doesn't care about loop=  [Karel Zak]
+   - remove MS_{REPLACE,AFTER,BEFORE,OVER}  [Karel Zak]
+   - remove built-in support for background mounts  [Karel Zak]
+   - remove redundant fflush  [Karel Zak]
+   - remove set_proc_name()  [Karel Zak]
+   - remove useless if-before-my_free, define my_free as a macro  [Karel Zak]
+   - use MNTTYPE_SWAP (from mntent.h)  [Karel Zak]
+   - use atexit() rather than (*at_die)()  [Karel Zak]
+   - use blkdev_get_size()  [Karel Zak]
+   - use canonicalize in getfs_by_devname  [Karel Zak]
+namei:
+   - add to identify FIFO (named pipe) and update manpage  [Li Zefan]
+   - cleanup tailing white-spaces  [Karel Zak]
+   - non-linux support (get_current_dir_name() and PATH_MAX)  [Karel Zak, Samuel Thibault]
+partx:
+   - fix compiler warnings  [Karel Zak]
+   - use swab macros from bitops.h  [Karel Zak]
+pg:
+   - fix segfault on search  [Rajeev V. Pillai]
+po:
+   - add eu.po (from translationproject.org)  [Mikel Olasagasti]
+   - add pl.po (from translationproject.org)  [Andrzej Krzysztofowicz]
+   - fix typo in de.po  [Karel Zak]
+   - merge changes  [Karel Zak]
+   - update POTFILES.in  [Karel Zak]
+   - update ca.po (from translationproject.org)  [Josep Puigdemont]
+   - update cs.po (from translationproject.org)  [Petr Pisar]
+   - update da.po (from translationproject.org)  [Claus Hindsgaul]
+   - update de.po (from translationproject.org)  [Michael Piefel]
+   - update es.po (from translationproject.org)  [Santiago Vila Doncel]
+   - update et.po (from translationproject.org)  [Meelis Roos]
+   - update fi.po (from translationproject.org)  [Lauri Nurmi]
+   - update fr.po (from translationproject.org)  [Michel Robitaille]
+   - update hu.po (from translationproject.org)  [Gabor Kelemen]
+   - update id.po (from translationproject.org)  [Arif E. Nugroho]
+   - update it.po (from translationproject.org)  [Marco Colombo]
+   - update ja.po (from translationproject.org)  [Daisuke Yamashita]
+   - update nl.po (from translationproject.org)  [Benno Schulenberg]
+   - update po files  [Karel Zak]
+   - update pt_BR.po (from translationproject.org)  [Rodrigo Stulzer Lopes]
+   - update ru.po (from translationproject.org)  [Pavel Maryanov]
+   - update sl.po (from translationproject.org)  [Simon Mihevc]
+   - update sv.po (from translationproject.org)  [Daniel Nylander]
+   - update tr.po (from translationproject.org)  [Nilgün Belma Bugüner]
+   - update uk.po (from translationproject.org)  [Maxim V. Dziumanenko]
+   - update vi.po (from translationproject.org)  [Clytie Siddall]
+rename:
+   - add description about option -V to manpage  [Li Zefan]
+   - remove useless variable  [Li Zefan]
+renice:
+   - detect errors in arguments, add -v, -h and long options  [LaMont Jones, Karel Zak]
+rev:
+   - use warn() in errs.h  [Li Zefan]
+rtcwake:
+   - fix UTC time usage  [David Brownell]
+   - fix the default mode to "standby"  [Paulius Zaleckas]
+   - fix typo  [Karel Zak]
+   - fix typo SATE -> STATE  [Mike Frysinger]
+   - fix verbose message  [Karel Zak]
+   - include libgen.h for basename prototype  [Mike Frysinger]
+   - misc cleanups  [David Brownell]
+script:
+   - cleanup gcc warnings  [Randy Dunlap]
+   - cleanup includes  [Samuel Thibault]
+   - dies on SIGWINCH  [Karel Zak]
+   - read returns a size_t  [James Youngman]
+scriptreplay:
+   - gettextize a forgotten messages  [Karel Zak]
+   - rewrite in C  [Karel Zak, James Youngman]
+setarch:
+   - add fallback for linux/personality  [Karel Zak]
+   - add long options to setarch and update manpage  [Karel Zak, Li Zefan]
+   - add missing alpha subarchs  [Oliver Falk]
+   - adding groff symlinks to setarch manual page  [Arkadiusz Miskiewicz]
+   - fix compiler warning  [LaMont Jones]
+   - generate groff links in a better way  [Karel Zak]
+   - provide backwards compatibility  [Dmitry V. Levin]
+   - tweak the help text, and gettextize a forgotten message  [Benno Schulenberg]
+setterm:
+   - add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN  [Samuel Thibault, Karel Zak]
+   - dump by TIOCLINUX is deprecated since linux 1.1.92.  [Karel Zak]
+   - opened file leaving unclosed  [Karel Zak, lizf]
+   - remove unnecessaty ifndef TCGETS  [Samuel Thibault]
+sfdisk:
+   - allow partitioning drives of over 2^31 sectors.  [Kunihiko IMAI]
+   - cleanup 83 gcc warnings  [Randy Dunlap]
+   - opened files leaving unclosed  [Karel Zak, Li Zefan]
+   - remove unnecessary linux/unistd.h  [Samuel Thibault]
+   - use get_linux_version()  [Karel Zak]
+shutdown:
+   - use _PATH_MOUNTED instead of _PATH_MTAB  [Stepan Kasal]
+swapon:
+   - Reinitialize software suspend areas to avoid future corruption.  [Kees Cook, Karel Zak]
+   - add sundries.h  [Karel Zak]
+   - clean up gcc warnings  [Randy Dunlap]
+   - cleanup usage output  [Karel Zak]
+   - cleanup usage()  [Karel Zak]
+   - fix swsuspend detection  [Karel Zak]
+   - fix typo in usage()  [Karel Zak]
+   - readjust the usage summaries  [Benno Schulenberg]
+   - remove unnecessary myrealpath() call  [Karel Zak]
+sys-utils:
+   - correct setarch.8 manpage link creation  [Frédéric Bothamy]
+tailf:
+   - add option -n to specifying output lines  [Li Zefan]
+   - clean up gcc warnings & fix use of errno  [Karel Zak]
+   - inotify based reimplementation  [Karel Zak]
+   - non-linux support  [Samuel Thibault]
+   - opened file leaving unclosed  [lizf]
+   - replace errs.h with libc err.h  [Karel Zak]
+tests:
+   - add "sort" to cramfs test  [Karel Zak]
+   - add test for include/pathnames.h  [Karel Zak]
+   - add ts-mount-noncanonical  [Karel Zak]
+   - exactly define a time format in ls -l output  [Karel Zak]
+   - fix blkid cache usage  [Karel Zak]
+   - move test_bkdev to lib/  [Karel Zak]
+   - redirect libblkid cache to BLKID_FILE  [Karel Zak]
+   - rename test_sysinfo, remove tailing white-spaces  [Karel Zak]
+   - use losetup -s  [Karel Zak]
+umount:
+   - add hint about lsof & fuser  [Karel Zak]
+   - don't print duplicate error messages  [Karel Zak]
+   - use atexit() rather than (*at_die)()  [Karel Zak]
+wall:
+   - cleanup MAXHOSTNAMELEN  [Karel Zak]
diff --git a/util-linux-ng-2.17.2/docs/v2.15-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.15-ReleaseNotes
new file mode 100644
index 0000000..56b10b6
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.15-ReleaseNotes
@@ -0,0 +1,675 @@
+
+Util-linux-ng 2.15 Release Notes (05-May-2009)
+==============================================
+
+Release highlights
+------------------
+
+mkswap(8):
+  - mkswap like many others mkfs-like utils ERASES THE FIRST BLOCKS on 
+    the device to remove old on-disk filesystems. mkswap refuses to 
+    erase the first block on a device with a disk label (SUN, BSD, ...)
+    or on whole disk (e.g. /dev/sda).
+
+  - DOES NOT SUPPORT v0 SWAP SPACE any more. The kernel has not
+    supported v0 swap space format since 2.5.22. The new version v1 is 
+    supported since 2.1.117.
+
+swapon(8):
+  - supports new command line option "-f/--fixpg" to reinitialize the
+    swap space with a wrong pagesize. As swap format depends on the pagesize
+    being used, it may happen that the pagesize of the swap space and the
+    current pagesize differ.
+
+login(1):
+  - requires /etc/pam.d/remote when compiled with PAM support and
+    executed with "-h <hostname>" option. The "-h" option is used by other
+    servers (i.e., telnetd(8)) to pass the name of the remote host to login.
+
+cal(1):
+  - determines the first day of week from the locale.
+
+libblkid, blkid(8) and findfs(8):
+  The libblkid library has been moved from e2fsprogs to util-linux-ng. The 
+  library has been extended and now includes:
+  
+    - low-level probing API that is useful for example for udev rules
+      (cmdline: blkid -p -o udev <device>)
+
+    - very high-level API that provides portable interface for LABELs and
+      UUIDs evaluation on 2.4, 2.6 and udev-based system. It's recommended
+      to use "blkid -L|-U" in your scripts rather than directly read 
+      /dev/disk/by-* symlinks.
+
+    - the old ABI and API is backwardly compatible with the current version
+      from e2fsprogs.
+
+  All utils (mount, swapon, fsck, ...) in the package is possible to link 
+  against this new library, or the old version from e2fsprogs, or 
+  libvolume_id from udev package.
+
+  The default is still libblkid from e2fsprogs. The new library could be 
+  enabled by "--with-fsprobe=builtin" configure option.
+
+  The libvolume_id from udev and vol_id command is deprecated now.
+
+fsck(8):
+  - has been moved to from e2fsprogs to util-linux-ng.
+
+dmesg(1)
+  - supports new command line option "-r" to print the raw message buffer
+    (i.e. don’t strip the log level prefixes).
+
+flock(1):
+  - allows lock directory
+
+fsck.cramfs:
+  - automatically detects the image endianness, and can work on images of 
+    either endianness.
+
+mkfs.cramfs:
+  - now accepts a new optional parameter (-N) that allows creating 
+    the cramfs image in either endianness.
+
+renice(1):
+  - supports new command line option "-n" for compatibility with POSIX
+
+hwclock(8)
+  - supports new command line option "--systz" to reset the System Time
+    based on the current timezone. Since the system clock time is already
+    set from the hardware clock by the kernel (when compiled with 
+    CONFIG_RTC_HCTOSYS), there's no particular need to read the hardware
+    clock again.
+
+ionice(1):
+  - supports new command line option "-t" option to ignore failure to set
+    requested priority.  This might be of use in case something (selinux,
+    old kernel, etc.) does not allow the requested scheduling priority 
+    to be set.
+
+  - the command line option "-p" handles multiple PIDs now.
+
+losetup(8):
+  - detaches more devices by "-d <loop> [<loop> ..]"
+
+ipcmk(1):
+  - this NEW COMMAND allows to create ad-hoc IPC resources.
+
+lscpu(1):
+  - this NEW COMMAND gathers CPU architecture information like number
+    of CPUs, threads, cores, sock, NUMA nodes, information about CPU 
+    caches, information about hypervisor and virtualization support, 
+    ..etc. and prints it in human-readable or parse-able format.
+
+namei(1):
+  - supports new command line options --owners, --long and --vertical
+    to print ls(1)-like output.
+
+
+Stable maintenance releases between v2.14 and v2.15
+---------------------------------------------------
+
+util-linux-ng 2.14.1 [10-Aug-2008]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14.1-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14.1-ChangeLog
+
+util-linux-ng 2.14.2 [09-Feb-2009]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14.2-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/v2.14.2-ChangeLog
+
+
+ChangeLog between v2.14 and v2.15
+---------------------------------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/
+
+addpart:
+   - 512-byte sectors in code, bytes in man-page  [Karel Zak]
+agetty:
+   - IUCLC and OLCUC are Linux extensions  [Aurelien Jarno]
+   - check for termios.c_line struct member by autoconf  [Karel Zak]
+   - sys/types.h and time.h are included more than once  [Karel Zak]
+blkid:
+   - Give a priority bonus to "leaf" devicemapper devices  [Theodore Ts'o]
+   - LSI MegaRAID  [Karel Zak]
+   - NVIDIA raid  [Karel Zak]
+   - Optimize devicemapper support  [Theodore Ts'o]
+   - Promise raid  [Karel Zak]
+   - Refuse to create a device structure for a non-existent device  [Theodore Ts'o]
+   - Unexport the private symbol blkid_devdirs  [Theodore Ts'o]
+   - add  to reiser  [Karel Zak]
+   - add -L -U options (evaluation API)  [root]
+   - add -p and low-probe mode to blkid binary  [Karel Zak]
+   - add Christoph's note about libdisk to TODO  [Karel Zak]
+   - add DDF raid  [Karel Zak]
+   - add DEBUG_LOWPROBE, cleanup a little debug stuff  [Karel Zak]
+   - add GFS and GFS2  [Karel Zak]
+   - add GFS2 UUID support  [Karel Zak]
+   - add GFS2 reg. test  [Karel Zak]
+   - add HFS and HFS+  [Karel Zak]
+   - add HPFS  [Karel Zak]
+   - add HTFS  [Karel Zak]
+   - add ISW raid  [Karel Zak]
+   - add JMicron RAID  [Karel Zak]
+   - add LUKS support  [Karel Zak]
+   - add LVM2 support and a fix _sprintf_uuid() bug  [Karel Zak]
+   - add Linux RAID  [Karel Zak]
+   - add Silicon Image Medlay RAID  [Karel Zak]
+   - add TODO file  [Karel Zak]
+   - add TODO hint about DM devnames in sysfs  [Karel Zak]
+   - add TODO hint about blkid_parse_tag_string()  [Karel Zak]
+   - add TODO note about blkid_evaluate_spec_to_buffer()  [Karel Zak]
+   - add UDF support  [Karel Zak]
+   - add UFS  [Karel Zak]
+   - add VFAT support  [Karel Zak]
+   - add VIA RAID  [Karel Zak]
+   - add ZSF support  [Andreas Dilger]
+   - add ZSF test  [Karel Zak]
+   - add __attribute__ ((format))  [Karel Zak]
+   - add a note to TODO list  [Karel Zak]
+   - add adaptec raid  [Karel Zak]
+   - add basic configure.ac stuff and blkid.pc  [Karel Zak]
+   - add blkid_do_safeprobe()  [Karel Zak]
+   - add blkid_evaluate_spec()  [Karel Zak]
+   - add blkid_probe_get_sb() macro  [Karel Zak]
+   - add btrfs support  [Karel Zak]
+   - add cmdline interface for blkid_probe_filter_usage()  [Karel Zak]
+   - add ddf raid regression test  [Karel Zak]
+   - add ext{2,3,4,4devel} support  [Karel Zak]
+   - add fallback to ext4 for 2.6.29+ kernels if ext2 is not present  [Theodore Ts'o]
+   - add findfs(8)  [Karel Zak]
+   - add highpoint{37x,45x} RAIDs  [Karel Zak]
+   - add hpfs regression test  [Karel Zak]
+   - add iso9600  [Karel Zak]
+   - add jfs  [Karel Zak]
+   - add low level probing API  [Karel Zak]
+   - add lvm1  [Karel Zak]
+   - add lvm2 reg.test  [Karel Zak]
+   - add minix  [Karel Zak]
+   - add missing blkidP.h to Makefile.am  [Karel Zak]
+   - add missing hfs.c  [Karel Zak]
+   - add netware (NSS)  [Karel Zak]
+   - add netware regression test  [Karel Zak]
+   - add new options to blkid.8 and help output  [Karel Zak]
+   - add new requirements to TODO list  [Karel Zak]
+   - add ocfs and oracleasm  [Karel Zak]
+   - add ocfs2 version  [Karel Zak]
+   - add proper copying info  [Karel Zak]
+   - add reg.tests for HFS and HFS+  [Karel Zak]
+   - add romfs  [Karel Zak]
+   - add squashfs  [Karel Zak]
+   - add support for /etc/blkid.conf file  [Karel Zak]
+   - add sysv and xenix  [Karel Zak]
+   - add tst_types.c to Makefile.am  [Karel Zak]
+   - add udev ID_FS_* output to blkid binary  [Karel Zak]
+   - add udev string encoding routines  [Karel Zak]
+   - add uuid and version support to gfs2  [Karel Zak]
+   - add version and probe FSInfo  [Karel Zak]
+   - add version support to LVM2  [Karel Zak]
+   - add vol_id call to blkid regression test  [Karel Zak]
+   - add vxfs  [Karel Zak]
+   - add xfs  [Karel Zak]
+   - blkdev size fallback  [Karel Zak]
+   - blkid.static make target  [Karel Zak]
+   - blkid_evaluate_spec() shouldn't ignore $BLKID_FILE  [Karel Zak]
+   - check calloc() return value  [Karel Zak]
+   - check idinfo[] index  [Karel Zak]
+   - clean up man pages  [Karel Zak]
+   - cleanup _LOGPROBE debug messages  [Karel Zak]
+   - cleanup starts of probing files  [Karel Zak]
+   - compile TEST_PROGRAMs  [Karel Zak]
+   - correctly initialize magics[] arrays  [Karel Zak]
+   - create basic directories  [Karel Zak]
+   - don't dereference NULL upon slashless module dependency line  [Jim Meyering]
+   - fix ..._strncpy_uuid  [Karel Zak]
+   - fix a syntax nit  [Karel Zak]
+   - fix blkid_do_probe()  [Karel Zak]
+   - fix blkid_probe_sprintf_version() usage  [Karel Zak]
+   - fix blkid_safe_string()  [Karel Zak]
+   - fix exit codes in blkid(8)  [Scott James Remnant]
+   - fix ext2 SEC_TYPE  [Karel Zak]
+   - fix file descriptor leak when checking for a module  [Karel Zak]
+   - fix gcc warning in blkid_get_cache_filename()  [Karel Zak]
+   - fix hedeader in ntfs.c  [Karel Zak]
+   - fix highpoint37x offset  [Karel Zak]
+   - fix low-probe mode return codes  [Karel Zak]
+   - fix non-udev low-probe mode output  [Karel Zak]
+   - fix ocfs2 detection  [Karel Zak]
+   - fix typo (syntax error)  [Karel Zak]
+   - fix udev output  [Karel Zak]
+   - fix xfs label  [Karel Zak]
+   - hfs - do not set UUID for emtpy finder info  [Kay Sievers]
+   - hfs - use proper native UUID format  [Kay Sievers]
+   - improve ddf detection  [Karel Zak]
+   - linux_raid - fix logic for volumes with size == 0  [Karel Zak]
+   - merge libblkid code from e2fsprogs/lib/blkid  [Karel Zak]
+   - minor changes to library build system  [Karel Zak]
+   - netware SB has to be packed  [Karel Zak]
+   - optimize for string UUIDs  [Karel Zak]
+   - re-order list of filesystems  [Karel Zak]
+   - recognize ext3 with test_fs set as ext3  [Eric Sandeen]
+   - recognize ext4(dev) without journal  [Eric Sandeen]
+   - refresh TODO file  [Karel Zak]
+   - remove blkid_types.h  [Karel Zak]
+   - remove unnecessary debug message  [Karel Zak]
+   - remove unnecessary ifdef __cplusplus  [Karel Zak]
+   - remove unused stuff from Makefile  [Karel Zak]
+   - remove useless if-before-free tests  [Jim Meyering]
+   - remove whole-disk entries from cache when partitions are found  [Eric Sandeen]
+   - rename blkid_debug_init to blkid_init_debug  [Karel Zak]
+   - rename blkid_evaluate_spec to blkid_evaluate_tag  [Karel Zak]
+   - set size for non-blkdevs, add blkid_probe_strcpy_uuid()  [Karel Zak]
+   - split SONAME and LIBBLKID_VERSION  [Karel Zak]
+   - start to use ABI versioning  [Karel Zak]
+   - support detection of multiple signatures  [Karel Zak]
+   - support via raid version 2  [Sven Jost]
+   - update TODO  [Karel Zak]
+   - update gitignore  [Karel Zak]
+   - use "char **" rather than "unsigned char **"  [Karel Zak]
+   - use /dev/mapper/<name> rather than /dev/dm-<N>  [Karel Zak]
+   - use /sys/block/dm-<N>/dm/name  [Karel Zak]
+   - use Requires.private and fix the include directory  [Karel Zak]
+   - use blkid_probe_strcpy_uuid() for luks  [Karel Zak]
+   - use posix uint32_t in ocfs superblock  [Karel Zak]
+   - use posix uintXX_t in lvm code  [Karel Zak]
+   - use sizeof() for hfs uuid  [Karel Zak]
+   - vfat - fix declaration  [Kay Sievers]
+blkis:
+   - fix detection of ext4dev as ext4  [Eric Sandeen]
+blockdev:
+   - add note that the StartSec is in 512-byte sectors  [Karel Zak]
+   - fix possible buffer overflow  [Karel Zak]
+build-sys:
+   - add $usrlibexecdir and fix paths for [/usr]/lib64  [Karel Zak]
+   - add --disable-mount  [Alon Bar-Lev]
+   - add --with=fsprobe=builtin  [Karel Zak]
+   - add -luuid to BLKID_LIBS  [Karel Zak]
+   - add fsck binary to .gitignore  [Karel Zak]
+   - add missing AC_C_BIGENDIAN  [Karel Zak]
+   - add missing files to include/Makefile.am  [Karel Zak]
+   - add temporary libtool *.m4 stuff  [Karel Zak]
+   - cleanup --with-fsprobe help string  [Karel Zak]
+   - cleanup sys-utils/Makefile.am  [Karel Zak]
+   - define libdir  [Karel Zak]
+   - fix bugs detected by "make distcheck"  [Karel Zak]
+   - libtoolize by libtool-2  [Karel Zak]
+   - libtoolize mount/Makefile.am  [Karel Zak]
+   - move pivot_root(8) to sys-utils  [Karel Zak]
+   - refresh generated libtool-2 stuff  [Karel Zak]
+   - release++ (v2.15-rc1)  [Karel Zak]
+   - release++ (v2.15-rc2)  [Karel Zak]
+   - remove use of devmapper library  [Karel Zak]
+   - tgets is not in ncurses but in tinfo  [Arkadiusz Miskiewicz]
+   - use pkg-config for blkid and volume_id  [Karel Zak]
+cal:
+   - determine the first day of week from the locale  [Pádraig Brady]
+   - remove gcc-ism from nl_langinfo() call  [Karel Zak]
+cfdisk:
+   - accept yes/no as fallback  [Matthias Koenig]
+   - fix "cannot seek on disk drive" bug  [Karel Zak]
+chfn:
+   - several strings without gettext calls  [Karel Zak]
+chrt:
+   - add NLS support, clean error messages and return codes  [Karel Zak]
+   - add a comment about non POSIX 1003.1b attributes in chrt.1  [Aurelien Jarno]
+   - output buglet when reporting scheduling class  [Karel Zak]
+   - support CFS SCHED_IDLE priority and document it  [Martin Steigerwald]
+disk-utils:
+   - clean up code, use blkdev_* functions  [Samuel Thibault]
+   - include fcntl.h directly (mkfs.cramfs, raw)  [maximilian attems]
+   - s/MOUNTED/_PATH_MOUNTED/  [maximilian attems]
+dmesg:
+   - Add -r (raw) option.  [Adam Jackson]
+   - nuke old glibc 5 support  [maximilian attems]
+docs:
+   - TODO: add request to use nl_langinfo()  [Karel Zak]
+   - TODO update  [Karel Zak]
+   - add a note about /proc/sys/kernel/random/uuid  [Karel Zak]
+   - add a note about kpartx to TODO  [Karel Zak]
+   - add entry about /proc/partitions parsing  [Karel Zak]
+   - add feature-requests from RH bugzilla to TODO list  [Karel Zak]
+   - add suggestion about TZ=UTC to TODO file  [Karel Zak]
+   - fix typo, cal(8) --> cal(1)  [Karel Zak]
+   - update AUTHORS file  [Karel Zak]
+   - update TODO list  [Karel Zak]
+   - update v2.15 ReleaseNotes  [Karel Zak]
+elvtune:
+   - add NLS support  [Pedro Ribeiro]
+fdisk:
+   - (and partx) remove BLKGETLASTSECT  [Karel Zak]
+   - add 0xaf HFS / HFS partition type  [Karel Zak]
+   - add some missing includes  [Matthias Koenig]
+   - cannot create partition with starting beyond 1 TB  [Karel Zak]
+   - cleanup _PATH_DEV_* macros  [Karel Zak]
+   - doesn't handle large (4KiB) sectors properly  [Eric Sandeen]
+   - don't check for GPT when asked for disk size only  [Karel Zak]
+   - don't use get_linux_version() for non-linux  [Samuel Thibault]
+   - exit(3) needs stdlib.h include  [maximilian attems]
+   - fix man page typo  [Karel Zak]
+   - fix max. ptname  [Karel Zak]
+   - non-linux support (BLK* and HDIO_*)  [Samuel Thibault]
+   - read /proc/partitions in more robust way  [Karel Zak]
+   - remove obsolete information from man page  [Karel Zak]
+   - remove unnecessary gettext call  [Karel Zak]
+   - rename ENABLE_CMDTAGQ macro  [Karel Zak]
+   - round reported sizes rather than truncate  [Karel Zak]
+   - several strings without gettext calls  [Pedro Ribeiro]
+   - suggest partprobe(8) and kpartx(8) when BLKRRPART failed  [Vincent Deffontaines, Karel Zak]
+   - support "-b 4096" option  [Karel Zak]
+   - support +cylinder notation  [Karel Zak]
+   - use real sector size in verify() and warn_cylinders()  [Karel Zak]
+   - warn users about 2.2TB dos partition limit  [Karel Zak]
+flock:
+   - Allow lock directory  [Alexey Gladkov]
+   - add NLS support, remove tailing white-spaces  [Karel Zak]
+   - fix printf format error in usage()  [Karel Zak]
+   - segfaults when file name is not given  [Karel Zak]
+fsck:
+   - cosmetic changes (NLS, paths, ...)  [Karel Zak]
+   - link with generic fsprobe wrapper  [Karel Zak]
+   - move fsck from e2fsprogs to util-linux-ng  [Karel Zak]
+   - remove  from warning message  [Karel Zak]
+   - remove useless if-before-free tests  [Karel Zak]
+fsck.cramfs:
+   - add NLS support  [Pedro Ribeiro]
+   - fix compiler warning  [Karel Zak]
+   - segfault with INCLUDE_FS_TESTS and no -x option  [Karel Zak]
+fsck.minix:
+   - add regression test  [Karel Zak]
+getopt:
+   - remove unnecessary ifdefs  [Karel Zak]
+   - remove useless if-before-free tests  [Karel Zak]
+hwclock:
+   - add --systz option to set system clock from itself  [Scott James Remnant]
+   - always reads hardware clock  [Karel Zak]
+   - cleanup help output and man page  [Karel Zak]
+   - clock.h is included more than once  [Karel Zak]
+   - delay loop in set_hardware_clock_exact  [Kalev Soikonen]
+   - don't open /dev/rtc repeatedly  [Karel Zak]
+   - omit warning about drift if --noadjfile given  [Matthias Koenig]
+   - read_hardware_clock_rtc() need to return error codes  [Karel Zak]
+   - remove "cli" and "sti" from i386 CMOS code  [Karel Zak]
+   - remove x86_64-specific bogon  [David Brownell]
+   - several strings without gettext calls  [Pedro Ribeiro]
+   - unshadow a diagnostic printf  [Kalev Soikonen]
+   - use carefully synchronize_to_clock_tick() return codes  [Karel Zak]
+   - use time limit for synchronization busy wait  [Karel Zak]
+include:
+   - add missing files to Makefile.am  [Karel Zak]
+   - bitops - explicitly include endian.h  [Karel Zak]
+   - move swapheader.h to include  [Matthias Koenig]
+   - swapheader.h is missing in Makefile.am  [Karel Zak]
+   - use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN  [Karel Zak]
+ionice:
+   - Extend the man page to explain the "none" class and cpu-nice inheritance  [Jakob Unterwurzacher]
+   - a little cleanup of "none" description  [Karel Zak]
+   - add -t option  [Lubomir Kundrak]
+   - add strtol() checks, cleanup usage text and man page  [Karel Zak]
+   - change Jens Axboe's email  [Karel Zak]
+   - cleanup error messages, add NLS support  [Karel Zak]
+   - cleanup man page  [Karel Zak]
+   - fix typo in manpage  [Karel Zak]
+   - let -p handle multiple PIDs  [Stephan Maka]
+ipcmk:
+   - add NLS support  [Karel Zak]
+   - fix error codes and error messages  [Karel Zak]
+   - new command  [Hayden James]
+ipcs:
+   - adjust some field positions and widths for correct alignment  [Benno Schulenberg]
+   - fix exit codes, remove tailing white-spaces  [Karel Zak]
+   - ungettextize the spacing of the table headers  [Benno Schulenberg]
+ldattach:
+   - don't compile for non-linux systems  [Samuel Thibault]
+lib:
+   - add __BYTE_ORDER to md5.c  [Karel Zak]
+   - add is_whole_disk() from fdisk code  [Karel Zak]
+   - add pttype.c for PT types detection  [Karel Zak]
+   - add test_ismounted for regression test  [Karel Zak]
+   - blkdev.c clean up, non-linux support  [Samuel Thibault]
+   - do not include <linux/fd.h> in ismounted.c  [Aurelien Jarno]
+   - fix fsprobe wrapper (const char * is nonsense)  [Karel Zak]
+   - fsprobe - fix gcc warning  [Karel Zak]
+   - gcc warning in fix fsprobe  [Karel Zak]
+   - make open_device() optional in fsprobe.c  [Karel Zak]
+   - pttype  add BSD subpartitions support  [Karel Zak]
+   - pttype  fix DOS detection  [Karel Zak]
+   - pttype - extend the API to work with file descriptors  [Karel Zak]
+   - wholedisk - extend API, add test program  [Karel Zak]
+   - pttype - fix typo  [Karel Zak]
+logger:
+   - several strings without gettext calls  [Pedro Ribeiro]
+login:
+   - cleanup includes  [Karel Zak]
+   - fix compiler warning (int32 time() arg)  [Karel Zak]
+   - fix warning "dereferencing type-punned pointer will break strict-aliasing rules"  [Karel Zak]
+   - remove "switching users" nonsense from man page  [Karel Zak]
+   - use "remote" as a PAM service name for "login -h"  [Karel Zak]
+   - use open(2) rather then access(2) for $HOME/.hushlogin  [Karel Zak]
+login-utils:
+   - several strings without gettext calls  [Pedro Ribeiro]
+losetup:
+   - add warning about read-only mode  [Karel Zak]
+   - clean up code around LO_FLAGS_AUTOCLEAR  [Karel Zak]
+   - cleanup man page  [Karel Zak]
+   - detach more devices by "-d <loop> [<loop> ..]"  [Karel Zak]
+   - looplist_* refactoring, remove scandir()  [Karel Zak]
+   - missing EBUSY error hint message  [Karel Zak]
+   - mount endless loop hang  [Karel Zak]
+   - remove dependence on minor numbers  [Karel Zak]
+   - several strings without gettext strings  [Pedro Ribeiro]
+   - try to set up loop readonly if EACCES  [Matthias Koenig]
+lscpu:
+   - --sysroot option and stable cache output  [Cai Qian]
+   - add Hypervisor detection  [Karel Zak, Ky Srinivasan]
+   - new command  [Cai Qian, Karel Zak]
+   - regression tests  [Cai Qian]
+   - return EXIT_SUCCESS at the end  [Matthias Koenig]
+misc-utils:
+   - write include signal.h directly  [maximilian attems]
+mkfs.cramfs:
+   - add endianness support to cramfs tools  [Roy Peled]
+   - lower memory requirements for layouts with duplicate files  [Roy Peled]
+   - several strings without gettext calls  [Pedro Ribeiro]
+mkfs.minix:
+   - (and fsck) rename bitops.h  [Karel Zak]
+   - add regression test  [Karel Zak]
+   - fix size detection  [Matthias Koenig]
+   - remove local implementation of {set,clr}bit  [Karel Zak]
+mkswap:
+   - clean up man page  [Karel Zak]
+   - handle 2^32 pages  [Hugh Dickins]
+   - non-linux support  [Samuel Thibault]
+   - remove v0 swap space support  [Karel Zak]
+   - zap bootbits  [Karel Zak]
+more:
+   - dont use a.out.h  [Mike Frysinger]
+   - minor fixes to magic()  [James Youngman]
+mount:
+   - Add strictatime support  [Matthew Garrett]
+   - add docs about utf8=0 for vfat  [Karel Zak]
+   - add i_version support  [Karel Zak]
+   - add info about /proc/mounts to mount.1  [Karel Zak]
+   - add info about semantics of read-only mount to mount.8  [Karel Zak]
+   - add info about tz=UTC option for FAT to mount.8  [Karel Zak]
+   - add norealtime to mount.8  [Karel Zak]
+   - add rootcontext= SELinux mount option  [Karel Zak]
+   - add shortoptions for bind, move and rbind  [maximilian attems]
+   - clean up SPEC canonicalization  [Karel Zak]
+   - cleans up mount(8) troff markup  [Sam Varshavchik]
+   - create separate section for fs-independent options in mount.8  [Karel Zak]
+   - document newinstance and ptmxmode options to devpts  [Sukadev Bhattiprolu]
+   - finalize support of quoted LABELs/UUIDs  [Karel Zak]
+   - fix gcc warning (variable used uninitialized)  [Karel Zak]
+   - fix mount_static_LDADD  [Karel Zak]
+   - fix typo  [Guan Xin]
+   - fix typo  [Karel Zak]
+   - fix typo in volume_id code  [Karel Zak]
+   - generic blkid/volume_id wrapper, use blkid_evaluate_*  [Karel Zak]
+   - inform about UID and eUID when verbose > 2  [Karel Zak]
+   - make file_t SELinux warning optional and shorter  [Karel Zak]
+   - move realpath.c code to lib/  [Karel Zak]
+   - mtab created multiple times with -a option  [Karel Zak]
+   - non-setuid (POSIX file capabilities) support  [Karel Zak]
+   - remove link to namesys.com  [Karel Zak]
+   - remove spurious newline from mount.8  [Mike Frysinger]
+   - remove useless if-before-free tests  [Karel Zak]
+   - reorder list of options in mount.8  [Karel Zak]
+   - retry on ENOMEDIUM  [Matthias Koenig]
+   - s/MOUNTED/_PATH_MOUNTED/  [maximilian attems]
+   - suggest to use blockdev --setro rather than losetup  [Karel Zak]
+   - sundries.h add klibc support  [maximilian attems]
+   - sync FAT info in mount.8 with Documentation/filesystems/vfat.txt  [Karel Zak]
+   - sync tmpfs info in mount.8 with Documentation/filesystems/tmpfs.txt  [Karel Zak]
+   - use subsections in mount.8 DESCRIPTION  [Karel Zak]
+   - warn on "file_t" selinux context  [Karel Zak]
+namei:
+   - add --owners and --long options  [Karel Zak]
+   - add --vertical option  [Karel Zak]
+   - add missing options to namei.1  [Karel Zak]
+   - don't duplicate '/' directory  [Karel Zak]
+   - fix buffer overflow  [Karel Zak]
+   - new re-written version  [Karel Zak]
+partx:
+   - convert hard sector size to 512-byte sectors  [Karel Zak]
+   - don't duplicate lib/blkdev.c code  [Karel Zak]
+   - don't redeclare daddr_t  [maximilian attems]
+   - use ioctls from lib/blkdev.c  [Karel Zak]
+pg:
+   - add gettext call for the help string  [Karel Zak]
+   - several strings without gettext calls  [Pedro Ribeiro]
+pivot_root:
+   - clean up  [Karel Zak]
+po:
+   - add zh_CN.po (from translationproject.org)  [Ray Wang]
+   - merge changes  [Karel Zak]
+   - rewrite update-potfiles script  [Karel Zak]
+   - update POTFILES.in  [Karel Zak]
+   - update cs.po (from translationproject.org)  [Petr Pisar]
+   - update fi.po (from translationproject.org)  [Lauri Nurmi]
+   - update fr.po (from translationproject.org)  [Nicolas Provost]
+   - update id.po (from translationproject.org)  [Arif E. Nugroho]
+   - update ja.po (from translationproject.org)  [Makoto Kato]
+   - update list of .c files  [Karel Zak]
+   - update nl.po (from translationproject.org)  [Benno Schulenberg]
+   - update vi.po (from translationproject.org)  [Clytie Siddall]
+raw:
+   - add NLS support  [Pedro Ribeiro]
+   - default to /dev/raw/rawctl  [Karel Zak]
+rdev:
+   - cleanup includes  [Karel Zak]
+readprofile:
+   - several strings without gettext calls  [Pedro Ribeiro]
+renice:
+   - add -n option for compatibility with POSIX  [Karel Zak]
+rtcwake:
+   - add mising .RE to the man page  [Karel Zak]
+   - cleanup return codes  [Karel Zak]
+   - explain supported modes in rtcwake.8  [Karel Zak]
+   - prefer RTC_WKALM_SET over RTC_ALM_SET  [Gabriel Burt]
+   - support not suspending  [Marco d'Itri]
+script:
+   - don't flush input when starting script  [Andrew McGill]
+scriptreplay:
+   - new implementation is out-of-sync  [Karel Zak]
+selinux:
+   - is_selinux_enabled() returns 0, 1 and -1  [Karel Zak]
+setterm:
+   - fix -blank man page  [Karel Zak]
+sfdisk:
+   - fix Compilation Error  [CAI Qian]
+   - fix possible buffer overflow  [Karel Zak]
+   - print version should end with a newline  [Denis ChengRq]
+simmpleinit:
+   - fix gcc warning (buffer size in read())  [Karel Zak]
+simpleinit:
+   - cleanup gettext calls, use snprintf()  [Karel Zak]
+swapon:
+   - -a has to complain, fix leaks  [Karel Zak]
+   - add -f/--fixpgsz option  [Karel Zak]
+   - add error messages for lseek and write  [Karel Zak]
+   - add generic swap_get_header()  [Karel Zak]
+   - add swap format detection and pagesize check  [Matthias Koenig, Olaf Hering]
+   - cleanup man page  [Karel Zak]
+   - do_swapon() refactoring (move stat() checks)  [Karel Zak]
+   - do_swapon() refactoring (split into two functions)  [Karel Zak]
+   - fix typo s/warn/warnx/  [Karel Zak]
+   - fix wording in man page  [Karel Zak]
+   - rewrite SWSUSPEND signature rather than exec mkswap  [Karel Zak]
+   - simplify spec to devname conversion  [Karel Zak]
+   - use err.h stuff  [Karel Zak]
+tailf:
+   - unistd.h is included more than once  [Karel Zak]
+tests:
+   - add "byte-order" to helpers/test_sysinfo  [Karel Zak]
+   - add ./run.sh <component>  [Karel Zak]
+   - add MD5 regression test  [Karel Zak]
+   - add fsck ismounted reg.test  [Karel Zak]
+   - add libblkid regression tests (images from e2fsprogs)  [Karel Zak]
+   - add lscpu(1) test for fullvirt. Xen x86_64  [Karel Zak]
+   - add lscpu(1) test for paravirt. Xen i386  [Karel Zak]
+   - add md5 regression test  [Karel Zak]
+   - add mk-lscpu-input.sh  [Karel Zak]
+   - add support for subdirs to basic test functions  [Karel Zak]
+   - add support for subtests  [Karel Zak]
+   - add swabN() regression test  [Karel Zak]
+   - check also for /dev/loop/X  [Karel Zak]
+   - chmod -x ts/lscpu/mk-input.sh  [Karel Zak]
+   - clean up the testing scripts  [Américo Wang]
+   - cleanup lscpu reg.tests  [Karel Zak]
+   - cleanup ts/bitops  [Karel Zak]
+   - cleanup ts/cal scripts  [Karel Zak]
+   - cleanup ts/col scripts  [Karel Zak]
+   - cleanup ts/cramfs/fsck-endianness  [Karel Zak]
+   - cleanup ts/cramfs/mkfs-endianness  [Karel Zak]
+   - cleanup ts/hwclock  [Karel Zak]
+   - cleanup ts/ipcs  [Karel Zak]
+   - cleanup ts/login  [Karel Zak]
+   - cleanup ts/look  [Karel Zak]
+   - cleanup ts/md5  [Karel Zak]
+   - cleanup ts/minix  [Karel Zak]
+   - cleanup ts/mount  [Karel Zak]
+   - cleanup ts/namei  [Karel Zak]
+   - cleanup ts/paths  [Karel Zak]
+   - cleanup ts/script  [Karel Zak]
+   - cleanup ts/swapon  [Karel Zak]
+   - create expected/$(component)/$(testname)  [Karel Zak]
+   - create subdirs for test scripts  [Karel Zak]
+   - detect libvolume_id when mount(8) is compiled  [Karel Zak]
+   - disable blkid tests when blkid(8) is not compiled  [Karel Zak]
+   - disable suid mount test  [Karel Zak]
+   - fix -regex in run.sh  [Karel Zak]
+   - fix TS_* paths  [Karel Zak]
+   - fix file name is too long (max 99) - gtar  [Karel Zak]
+   - fix output string  [Karel Zak]
+   - fix the final message for subtests  [Karel Zak]
+   - fix typo in low-probe test  [Karel Zak]
+   - fix typo in lscpu test  [Karel Zak]
+   - move some generic stuff from ts_init() to a new ts_init_env()  [Karel Zak]
+   - refresh Makefile.am (add missing lscpu tests)  [Karel Zak]
+   - refresh and cleanup cramfs/mkfs  [root]
+   - refresh cal(1) expected outputs  [Karel Zak]
+   - refresh expected mount(8) outputs  [Karel Zak]
+   - refresh ipcs expected outputs  [Karel Zak]
+   - remove input directory  [Karel Zak]
+   - remove obsolete stuff from Makefile.am  [Karel Zak]
+   - remove unexpected exit from *_subtest functions  [Karel Zak]
+   - remove useless return value checks in testing scripts  [Américo Wang]
+   - update namei reg.test  [Karel Zak]
+   - we needn't blkid.sh  [Karel Zak]
+tools:
+   - add checkconfig to top-level Makefile  [Karel Zak]
+   - add checkincludes.pl (from linux kernel)  [Karel Zak]
+   - rename codecheck-config to checkconfig.sh  [Karel Zak]
+umount:
+   - check for overlaid mounts  [Guan Xin]
+   - cleanup gefs_by_specdir()  [Karel Zak]
+   - improve "-d" option for autoclear loops  [Karel Zak]
+   - no checking mount point removal  [Guan Xin]
+whereis:
+   - include dirent.h instead sys/dir.h  [maximilian attems]
+write:
+   - doesn't check for tty group  [Karel Zak]
+
diff --git a/util-linux-ng-2.17.2/docs/v2.16-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.16-ReleaseNotes
new file mode 100644
index 0000000..b204c64
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.16-ReleaseNotes
@@ -0,0 +1,182 @@
+
+Util-linux-ng 2.16 Release Notes (15-Jul-2009)
+==============================================
+
+Release highlights
+------------------
+
+libuuid, uuidgen(1) and uuidd(8):
+  - the libuuid library has been moved from e2fsprogs to util-linux-ng
+
+switch_root:
+  - this NEW COMMAND allows to switch to another filesystem as the root
+    of the mount tree.
+
+mount, umount, fsck:
+  - DOES NOT SUPPORT linking against obsolete libvolume_id (from udev)
+
+libblkid:
+  - development files (.so, .a, ...) have been moved from /lib to /usr/lib.
+
+
+Stable maintenance releases between v2.15 and v2.16
+---------------------------------------------------
+
+util-linux-ng 2.15.1 [10-Jun-2009]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/v2.15.1-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/v2.15.1-ChangeLog
+
+
+ChangeLog between v2.15 and v2.16
+---------------------------------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/
+
+
+build-sys:
+   - add --disable-libblkid, remove volume_id support  [Karel Zak]
+   - add --disable-switch_root  [Karel Zak]
+   - add --disable-tls  [Karel Zak]
+   - add --disable-uuidd  [Karel Zak]
+   - add UTIL_{SET,RESTORE}_FLAGS  [Karel Zak]
+   - check for openat() and linux for switch_root  [Karel Zak]
+   - cleanup libuuid stuff  [Karel Zak]
+   - complete /libs to /shlibs rename  [Karel Zak]
+   - enable fsck by default  [Karel Zak]
+   - fix "make -C" bug  [Karel Zak]
+   - fix --disable-uuidd  [Karel Zak]
+   - fix blkid.h include for old e2fsprogs  [Karel Zak]
+   - fix exec/data install hooks  [Karel Zak]
+   - fix headers in mkswap and libblkid  [Karel Zak]
+   - fix libuuid Makefile.am  [Karel Zak]
+   - fix libuuid and libblkid version-info  [Karel Zak]
+   - fix typo from 30688dde55f637c9b984809c685b61378b82805f  [Robert Förster]
+   - improve $libdirname definition  [Karel Zak]
+   - improve symlinks creation in shlibs/  [Karel Zak]
+   - release++ (v2.16-rc1)  [Karel Zak]
+   - release++ (v2.16-rc2)  [Karel Zak]
+   - rename /libs to /shlibs  [Karel Zak]
+   - rename to _execdir  [Karel Zak]
+   - reverse shlibs installation  [Kay Sievers]
+buildsys:
+   - move $usr{bin,sbin,lib}execdir definition to ./configure  [Karel Zak]
+cal:
+   - Highlight today even when month or year specified  [Rajeev V. Pillai]
+   - uClibc has langinfo.h but not _NL_TIME_WEEK_1STDAY.  [Tom Prince]
+chrt:
+   - don't assume SCHED_BATCH and SCHED_IDLE exist  [Aurelien Jarno]
+docs:
+   - add missing commands/projects to AUTHORS file  [Karel Zak]
+   - add v2.16 ReleaseNotes  [Karel Zak]
+   - refresh TODO list  [Karel Zak]
+   - remove example.files/rc[.local]  [Karel Zak]
+   - remove obsolete information from fstab example  [Karel Zak]
+   - update AUTHORS file  [Karel Zak]
+   - update v2.16 ReleaseNotes  [Karel Zak]
+   - update v2.16-ReleaseNotes  [Karel Zak]
+fdisk:
+   - (and cfdisk) fix to be consistent about maximum heads  [Chris Webb]
+   - add simple test for doslabel stuff  [Zdenek Behan]
+hwclock:
+   - fix mismatched popen/fclose.  [John Keeping]
+include:
+   - clean up _PATH_DEV_* macros  [Karel Zak]
+   - fix _PATH_DEV  [Karel Zak]
+ionice:
+   - Allow setting the none class  [Jakob Unterwurzacher]
+ldattach:
+   - add N_PPS support  [Tilman Schmidt]
+libblkid:
+   - add device-mapper snapshot cow device probe  [Milan Broz]
+   - add install-hook for libuuid.[a,so] devel files  [Karel Zak]
+   - add stdarg.h to blkidP.h  [Karel Zak]
+   - blkid_do_safeprobe() has to be tolerant to RAIDs  [Karel Zak]
+   - cleanup debug messages and return codes in blkid_do_probe()  [Karel Zak]
+   - don't require udev symlinks verification for non-root users  [Karel Zak]
+   - fix "hangs forever with partition type mdraid"  [Karel Zak]
+   - fix #ifdefs readability  [Karel Zak]
+   - fix $libdir in blkid.pc  [Karel Zak]
+   - fix LVM1 probe  [Milan Broz]
+   - fix reiserfs name  [Karel Zak]
+   - make libuuid optional  [Karel Zak]
+   - move to misc-utils/ directory  [Karel Zak]
+   - update man page  [Karel Zak]
+libuuid:
+   - add --disable-libuuid and LIBUUID_VERSION  [Karel Zak]
+   - add .gitignore  [Karel Zak]
+   - add info about u-l-ng to man pages  [Karel Zak]
+   - add install-hook for libuuid.[a,so] devel files  [Karel Zak]
+   - Don't run uuidd if it would fail due to permission problems  [Theodore Ts'o]
+   - fix $libdir in uuid.pc  [Karel Zak]
+   - fix parallel building  [Karel Zak]
+   - generate uuid_generate_{random,time}.3 man page links [Karel Zak]
+   - import UUID library from e2fsprogs  [Karel Zak]
+   - Make sure fd's 0, 1, and 2 are valid before exec'ing uuidd  [Theodore Ts'o]
+   - move clock state file from /var/lib to /var/run  [Karel Zak]
+libuuid, uuidd:
+   - Avoid infinite loop while reading from the socket fd  [Theodore Ts'o]
+losetup:
+   - add --set-capacity  [Karel Zak]
+   - fix return codes of functions arounf is_associated()  [Karel Zak]
+   - handle symlinks in /dev/loop/  [Mike Frysinger]
+   - suggest to use modprobe rather than insmod in losetup.8  [Karel Zak]
+lscpu:
+   - fix cpuid code on x86/PIC  [Mike Frysinger]
+mount:
+   - (and fsck) remove libvolume_id support  [Karel Zak]
+   - a little clean up info about loopdevs in man page  [Karel Zak]
+   - add ext4 to mount.8  [Karel Zak]
+   - add ext4 to the list of filesystems in mount.8  [Karel Zak]
+   - add info about obsolete vfat options to mount.8  [Karel Zak]
+   - allow loop suid umount  [Kay Sievers]
+   - cleanup notes about -l option in mount.8  [Karel Zak]
+   - fix undefined reference to `security_get_initial_context'  [Karel Zak]
+   - move MS_{PROPAGATION,BIND,MOVE} detection  [Karel Zak]
+   - use "none" fstype for MS_PROPAGATION mounts  [Karel Zak]
+   - use TAG parsing function from libblkid  [Karel Zak]
+   - when a remount to rw fails, quit and return an error  [Valerie Aurora]
+po:
+   - fix typo in French translation  [Olivier Blin]
+   - merge changes  [Karel Zak]
+   - refresh POTFILES.in  [Karel Zak]
+   - update cs.po (from translationproject.org)  [Petr Pisar]
+   - update fi.po (from translationproject.org)  [Lauri Nurmi]
+   - update fr.po (from translationproject.org)  [Nicolas Provost]
+   - update vi.po (from translationproject.org)  [Clytie Siddall]
+raw:
+   - Use the RAW_SETBIND ioctl without stat'ing the raw# file  [Jeff Mahoney]
+   - undeprecate raw  [Karel Zak]
+switch_root:
+   - add man page  [Karel Zak]
+   - add subroot support  [Daniel Drake]
+   - clean up argv[] usage, add -h and -V  [Karel Zak]
+   - do recursiveRemove after our root is moved to avoid races.  [Peter Jones]
+   - fix coding style  [Karel Zak]
+   - fork before cleaning up the filesystem.  [Peter Jones]
+   - new command  [Karel Zak]
+   - rewrite to use fstatat() and unlinkat()  [Karel Zak]
+   - use err.h, clean up return codes  [Karel Zak]
+   - use file descriptor instead of path for recursiveRemove()  [Peter Jones]
+   - use snprintf() rather tan str{cpy,cat}()  [Karel Zak]
+tests:
+   - add functions for work withdisk images  [Karel Zak]
+   - add mdraid libblkid test  [Karel Zak]
+   - don't run some mount tests for non-root users  [Karel Zak]
+   - fix 'delete extended partition' checksum  [Karel Zak]
+   - fix reiserfs test  [Karel Zak]
+   - fix script that creates lscpu dumps  [Karel Zak]
+   - move lscpu /proc and /sys dumps to tarballs  [Karel Zak]
+   - remove broken Xen dumps for lscpu  [Karel Zak]
+umount:
+   - clean up help output  [Karel Zak]
+uuidd:
+   - Avoid closing the server socket when calling create_daemon()  [Theodore Ts'o]
+   - fix $PIDFILE in uuidd.rc  [Karel Zak]
+   - init /var/run/uuidd, add option for on-demand mode to .rc file  [Karel Zak]
+   - move uuidd files from /var/lib/libuuid to /var/run/uuidd  [Karel Zak]
+   - move uuidd.rc to misc-utils directory  [Karel Zak]
+   - new command (UUID daemon from e2fsprogs)  [Karel Zak]
+uuidgen:
+   - new command (from e2fsprogs)  [Karel Zak]
diff --git a/util-linux-ng-2.17.2/docs/v2.17-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.17-ReleaseNotes
new file mode 100644
index 0000000..874622b
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.17-ReleaseNotes
@@ -0,0 +1,526 @@
+Util-linux-ng 2.17 Release Notes (08-Jan-2010)
+==============================================
+
+Release highlights
+------------------
+
+fallocate:
+  - this NEW COMMAND is a command line interface to fallocate 
+    Linux syscall and allows to preallocate blocks to a file.
+
+unshare
+  - this NEW COMMAND is a command line interface to unshare Linux syscall 
+    and allows to run program with some namespaces unshared from parent.
+
+wipefs
+  - this NEW COMMAND is based on libblkid and allows to remove filesystem
+    or RAID signatures from a device.
+
+libblkid:
+  - libblkid allows to gather information about block device topology,
+    currently supported methods are:
+
+      * ioctl - supported since kernel 2.6.32
+      * sysfs - supported since kernel 2.6.31
+      * fallback for DM, MD, LVM and EVMS on old kernels (base on code 
+        from xfsprogs/libdisk)
+
+    The topology support is mostly designed for mkfs programs or partitioning
+    tools (already used in mkfs.xfs, mkex2fs, libparted and fdisk)
+    
+  - libblkid supports partition tables parsing (currently supported are
+    aix, bsd, dos, mac, gpt, minix, sgi, solaris, sun and unixware). This 
+    functionality is designed for mkfs programs, DeviceKits, [k]partx or so.
+
+  - libblkid API documentation is available at
+    http://ftp.kernel.org/pub/linux/utils/util-linux-ng/libblkid-docs/
+
+blockdev:
+   - supports all new topology ioctls
+
+fdisk:
+   - the fdisk command aligns newly created partitions to minimum_io_size
+     boundary ("minimum_io_size" is physical sector size or stripe chunk
+     size on RAIDs).
+
+   - the fdisk command supports disks with alignment_offset now.
+
+
+Stable maintenance releases between v2.16 and v2.17
+---------------------------------------------------
+
+util-linux-ng 2.16.1 [07-Sep-2009]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.1-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.1-ChangeLog
+
+util-linux-ng 2.16.2 [30-Nov-2009]
+
+ * ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.2-ReleaseNotes
+   ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.16/v2.16.2-ChangeLog
+
+
+ChangeLog between v2.16 and v2.17
+---------------------------------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/
+
+addpart:
+   - addpart.8 formatting  [Peter Breitenlohner]
+blkid:
+   - add ID_FS_AMBIVALENT for udev output  [Karel Zak]
+   - add pretty output, document -L incompatibility with e2fsprogs  [Karel Zak]
+   - allow to use -s <TAG> for low-level probing (-p mode)  [Karel Zak]
+blockdev:
+   - add support for uint and ushort ioctls  [Karel Zak]
+   - add topology ioctls support  [Karel Zak]
+   - blockdev.8 formatting  [Peter Breitenlohner]
+   - fix topology ioctls  [Karel Zak]
+   - refactoring (better commands definition)  [Karel Zak]
+   - use c.h  [Karel Zak]
+build-sys:
+   - add --disable-makeinstall-setuid  [Karel Zak]
+   - add HAVE_LIBBLKID_INTERNAL  [Karel Zak]
+   - check for pkg-config before gtk-doc  [Karel Zak]
+   - check for union semun instead of using _SEM_SEMUN_UNDEFINED  [Guillem Jover]
+   - clean up gtk-doc stuff  [Karel Zak]
+   - clean up gtk-doc usage  [Karel Zak]
+   - cleanup --disable-{fallocate,pivot_root,unshare}  [Karel Zak]
+   - cleanup AM_CFLAGS usage  [Karel Zak]
+   - cleanup static building  [Karel Zak]
+   - detect if const is available  [Guillem Jover]
+   - detect if volatile is available  [Guillem Jover]
+   - don't distribute generated *.pc files  [Karel Zak]
+   - don't distribute generated blkid.h  [Karel Zak]
+   - enable silent rules if automake >= 1.11  [Guillem Jover]
+   - fix (official) gtk-doc.make  [Karel Zak]
+   - fix BUILD_PIVOT_ROOT condition  [Karel Zak]
+   - fix blkid CFLAGS in fdisk/Makefile.am  [Karel Zak]
+   - fix out-of-source build  [Karel Zak]
+   - release++ (v2.17-rc1)  [Karel Zak]
+   - release++ (v2.17-rc2)  [Karel Zak]
+   - release++ (v2.17-rc3)  [Karel Zak]
+   - remove LT_STATIC_LDFLAGS  [Karel Zak]
+   - remove gtkdocize from autogen.sh  [Karel Zak]
+   - remove obsolete --with-fsprobe from distcheck flags  [Karel Zak]
+   - rewrite TLS detection  [Karel Zak]
+cal:
+   - cal.1 formatting  [Peter Breitenlohner]
+   - fix (harmless) typo  [Peter Breitenlohner]
+   - fix broken computation for Sep 1752  [Peter Breitenlohner]
+   - remove obsolete <localeinfo.h> include  [Guillem Jover]
+   - use c.h  [Karel Zak]
+cfdisk:
+   - cfdisk.8 formatting  [Peter Breitenlohner]
+   - more key alternatives  [Jan Sarenik]
+chfn:
+   - chfn.1 formatting  [Peter Breitenlohner]
+chrt:
+   - use c.h  [Karel Zak]
+chsh:
+   - chsh.1 formatting  [Peter Breitenlohner]
+ctrlaltdel:
+   - ctrlaltdel.8 formatting  [Peter Breitenlohner]
+cytune:
+   - cytune.8 missing description of `-S', formatting  [Peter Breitenlohner]
+ddate:
+   - ddate.1 formatting  [Peter Breitenlohner]
+delpart:
+   - delpart.8 formatting  [Peter Breitenlohner]
+dmesg:
+   - add -r to help output  [Karel Zak]
+   - dmesg.1 formatting  [Peter Breitenlohner]
+   - fix typo in man page  [Ken Kopin]
+docs:
+   - README width and language correction  [Jan Sarenik]
+   - add 'unshare' and 'wipefs' to AUTHORS  [Karel Zak]
+   - add LGPLv2+ to list of licenses  [Karel Zak]
+   - add ngettext() into TODO file  [Karel Zak]
+   - add v2.17 ReleaseNotes  [Karel Zak]
+   - update "The Perfect Patch" URL  [Karel Zak]
+   - update AUTHORS file  [Karel Zak]
+   - update TODO  [Karel Zak]
+   - update TODO file  [Karel Zak]
+   - update TODO list  [Karel Zak]
+   - update v2.17 ReleaseNotes  [Karel Zak]
+elvtune:
+   - elvtune.8 formatting  [Peter Breitenlohner]
+fallocate:
+   - check for ERANGE errors  [Karel Zak]
+   - new command  [Karel Zak, Eric Sandeen]
+fdformat:
+   - fdformat.8 formatting  [Peter Breitenlohner]
+   - fix memory leak in verify_disk()  [Cristian Rodríguez]
+fdisk:
+   - add basic routines for LBA alignment  [Karel Zak]
+   - add regression test listing empty/nonsense images  [Zdenek Behan]
+   - align end of partition when defined by +size{K,M,G}  [Karel Zak]
+   - check for partition boundary  [Karel Zak]
+   - fdisk.8 formatting  [Peter Breitenlohner]
+   - fix strict-aliasing bugs  [Karel Zak]
+   - offer aligned first sector  [Karel Zak]
+   - print info and recommendations about alignment  [Karel Zak]
+   - read topology info from libblkid  [Karel Zak]
+   - sgi label - remove duplicate swab16swab[16,32]() definitions  [Karel Zak]
+   - sleep-after-sync and fsync usage  [Karel Zak]
+   - use c.h  [Karel Zak]
+   - use minimal_io_size for the first partition  [Karel Zak]
+findfs:
+   - fix typo in findfs.8  [Karel Zak]
+flock:
+   - fix hang when parent ignores SIGCHLD  [Mike Frysinger]
+fsck:
+   - document fsck behavior wrt nofail option and fstype 'auto'  [Ludwig Nussel]
+   - fsck.8 formatting  [Peter Breitenlohner]
+   - honor nofail option in fsck  [Ludwig Nussel]
+fsck.minix:
+   - fix broken zone checking  [Karel Zak]
+   - fix strict-aliasing bugs  [Karel Zak]
+   - fsck.minix.8 formatting  [Peter Breitenlohner]
+fstab:
+   - fstab.5 formatting  [Peter Breitenlohner]
+getopt:
+   - getopt.1 formatting  [Peter Breitenlohner]
+hexdump:
+   - bug in hexdump when offset == file length  [Américo Wang]
+   - hexdump.1 erroneous .Nm ""  [Peter Breitenlohner]
+hwclock:
+   - do not access hardware clock when using --systz  [Scott James Remnant]
+   - hwclock.8 formatting  [Peter Breitenlohner]
+   - set kernel timezone with --systz --utc  [Scott James Remnant]
+   - use c.h  [Karel Zak]
+   - use time limit for KDGHWCLK busy wait  [Karel Zak]
+include:
+   - add c.h with fundamental C definitions  [Karel Zak]
+   - use c.h in canonicalize.h  [Karel Zak]
+initctl:
+   - fix strict-aliasing bugs  [Karel Zak]
+   - initctl.8 formatting  [Peter Breitenlohner]
+ionice:
+   - add a note about none class and CFQ  [Karel Zak]
+   - ionice.1 formatting  [Peter Breitenlohner]
+ipcmk:
+   - ipcmk.1 formatting  [Peter Breitenlohner]
+ipcrm:
+   - ipcrm.1 formatting  [Peter Breitenlohner]
+ipcs:
+   - ipcs.1 formatting  [Peter Breitenlohner]
+   - use __GLIBC__ instead of obsolete __GNU_LIBRARY__  [Guillem Jover]
+isosize:
+   - isosize.8 formatting  [Peter Breitenlohner]
+kill:
+   - kill.1 formatting  [Peter Breitenlohner]
+   - use c.h  [Karel Zak]
+last:
+   - fix utmp.ut_time usage  [Karel Zak]
+   - last.1 formatting  [Peter Breitenlohner]
+ldattach:
+   - ldattach.8 formatting  [Peter Breitenlohner]
+   - use c.h  [Karel Zak]
+lib:
+   - add a generic crc32()  [Karel Zak]
+   - bug (typo) in function MD5Final()  [Karel Zak]
+   - fix file descriptor leak in is_mounted()  [Theodore Ts'o]
+   - fix lib/Makefile.am (remove pttype.c)  [Karel Zak]
+   - import whole ismounted.c code from e2fsprogs  [Karel Zak]
+   - remove pttype.c  [Karel Zak]
+libblkid:
+   - DRBD support for blkid  [Bastian Friedrich]
+   - add *.ko.gz support to modules.dep parser  [Karel Zak]
+   - add AIX partitions support  [Karel Zak]
+   - add BLKID_SUBLKS_* flags  [Karel Zak]
+   - add BLKID_{VERSION,DATE} to blkid.h  [Karel Zak]
+   - add BSD partitions support  [Karel Zak]
+   - add DM topology support (for old kernels)  [Karel Zak]
+   - add EFI GPT partitions support  [Karel Zak]
+   - add EVMS topology support (for old kernels)  [Karel Zak]
+   - add LVM topology support (for old kernels)  [Karel Zak]
+   - add MAC partitions support  [Karel Zak]
+   - add MD topology support (for old kernels)  [Karel Zak]
+   - add MINIX partitions support  [Karel Zak]
+   - add MS-DOS partitions support  [Karel Zak]
+   - add SGI partitions support  [Karel Zak]
+   - add SOLARIS-X86 partitions support  [Karel Zak]
+   - add SUN partitions support  [Karel Zak]
+   - add UBI volume support  [Corentin Chary]
+   - add UBIFS support  [Corentin Chary]
+   - add UNIXWARE partitions support  [Karel Zak]
+   - add a probe for bfs  [Christoph Hellwig]
+   - add blkid_devno_to_wholedisk()  [Karel Zak]
+   - add blkid_driver_has_major()  [Karel Zak]
+   - add blkid_new_probe_from_filename()  [Karel Zak]
+   - add blkid_partition_get_type_string()  [Karel Zak]
+   - add blkid_probe_get_{size,sectorsize,devno}  [Karel Zak]
+   - add blkit_[un]ref() to TODO  [Karel Zak]
+   - add chain structs  [Karel Zak]
+   - add functions for chain tags  [Karel Zak]
+   - add generic filter functions  [Karel Zak]
+   - add generic function for binary data  [Karel Zak]
+   - add missing comments  [Karel Zak]
+   - add missing comments to probe.c  [Karel Zak]
+   - add missing packed attributes  [Karel Zak]
+   - add mkfs sample  [Karel Zak]
+   - add note about UUID_SUB, increment number of superblock values  [Karel Zak]
+   - add partitions filter routines  [Karel Zak]
+   - add partitions parsing support  [Karel Zak]
+   - add partitions sample  [Karel Zak]
+   - add private blkid_topology_set_*() functions  [Karel Zak]
+   - add samples/topology.c  [Karel Zak]
+   - add sector size funcs to blkid.h.in  [Karel Zak]
+   - add superblocks chain  [Karel Zak]
+   - add superblocks filter functions  [Karel Zak]
+   - add superblocks.c sample  [Karel Zak]
+   - add support for SBMAGIC and SBMAGIC_OFFSET  [Karel Zak]
+   - add support for VMFS (VMware File System)  [Mike Hommey]
+   - add support for topology ioctls  [Karel Zak]
+   - add test cases for VMFS  [Mike Hommey]
+   - add topology support  [Karel Zak]
+   - allow linking with uClibc  [Daniel Mierswa]
+   - allow to change dimension of probing area  [Karel Zak]
+   - allow to read in sectors  [Karel Zak]
+   - allows more probing methods for topology chain  [Karel Zak]
+   - announce Joliet extension  [Maxim Levitsky]
+   - cleanup blkid_probe_set_device()  [Karel Zak]
+   - cleanup topology fallback  [Karel Zak]
+   - convert GPT partition LBA to 512-byte sectors  [Karel Zak]
+   - cosmetic change in topology sample  [Karel Zak]
+   - create a generic blkid_encode_to_utf8()  [Karel Zak]
+   - create a generic blkid_unparse_uuid()  [Karel Zak]
+   - does not return useless binary data  [Karel Zak]
+   - don't return empty LABELs  [Karel Zak]
+   - don't scan private /dev/.udev directory  [Karel Zak]
+   - fix Adaptec RAID detection  [Karel Zak]
+   - fix FALSE definition  [Karel Zak]
+   - fix FAT super block definition  [Lawrence Rust]
+   - fix NTFS non-ASCII labels  [Karel Zak]
+   - fix UFS detection  [Karel Zak]
+   - fix blkid_devno_to_wholedisk()  [Karel Zak]
+   - fix blkid_do_probe() to work properly with chains  [Karel Zak]
+   - fix blkid_fstatat() code  [Karel Zak]
+   - fix blkid_probe_set_utf8label() call for Joliet  [Karel Zak]
+   - fix buffer overflow in blkid_encode_string()  [Florian Zumbiehl]
+   - fix cache->probe memory leak  [Karel Zak]
+   - fix ext2 detection on systems with ext4 only  [Karel Zak]
+   - fix gcc warning (warn_unused_result)  [Karel Zak]
+   - fix highpoint37x detection  [Karel Zak]
+   - fix non-magic FAT detection  [Karel Zak]
+   - fix probing for binary interface  [Karel Zak]
+   - fix segfault in blkid_do_probe()  [Karel Zak]
+   - fix the default cache file path  [Karel Zak]
+   - fix topology information values  [Eric Sandeen]
+   - fix typo (swsupend -> swsuspend)  [Karel Zak]
+   - fix typo s/Hihg/High/  [Jim Meyering]
+   - fix warning message in mkfs sample  [Karel Zak]
+   - gtkdocize (API docs generated by gtk-docs)  [Karel Zak]
+   - minor changes to dm topology code  [Karel Zak]
+   - minor changes to samples  [Karel Zak]
+   - minor fix in topology sample  [Karel Zak]
+   - move FS/raid stuff to superblocks directory  [Karel Zak]
+   - move blkid_known_fstype() to superblocks.c  [Karel Zak]
+   - move filter macros to header file  [Karel Zak]
+   - prefer ISO9660 PVD Label to Joliet Label  [Karel Zak]
+   - properly reset position in probing chains  [Karel Zak]
+   - refresh blkid.{h,sym}  [Karel Zak]
+   - remove duplicate debug message  [Karel Zak]
+   - remove superblock functions from probe.c  [Karel Zak]
+   - rename highpoint RAIDs to hpt{37,45}x_raid_member  [Karel Zak]
+   - return first detected crypto device  [Scott James Remnant]
+   - topology - add logical and physical sector size  [Karel Zak]
+   - topology - ignore non-blockdevs  [Karel Zak]
+   - trim tailing whitespace from unicode LABELs  [Karel Zak]
+   - update docs/.gitignore  [Karel Zak]
+   - use BLKSSZGET for GPT sectors  [Karel Zak]
+   - use blkid_new_probe_from_filename() in docs  [Karel Zak]
+   - use c.h  [Karel Zak]
+   - use c.h in samples  [Karel Zak]
+   - use chains in blkid_do_{safe,full,}_probe()  [Karel Zak]
+   - use chains in prober (de)initialization  [Karel Zak]
+   - use fstatat(), improve readdir() usage  [Karel Zak]
+   - use private {lookup,get}_value functions  [Karel Zak]
+   - use superblock filter functions  [Karel Zak]
+   - use superblocks.h  [Karel Zak]
+   - use the new API in whole u-l-ng  [Karel Zak]
+libuuid:
+   - remove .UE macro from libuuid man pages.  [Milan Broz]
+line:
+   - remove deprecated #ident directive  [Karel Zak]
+losetup:
+   - losetup.8 formatting  [Peter Breitenlohner]
+   - remove unused macro  [Karel Zak]
+lscpu:
+   - add {32,64}-bit CPU modes detection  [Karel Zak]
+   - lscpu.1 formatting  [Peter Breitenlohner]
+mcookie:
+   - mcookie.1 formatting  [Peter Breitenlohner]
+mesg:
+   - mesg.1 formatting  [Peter Breitenlohner]
+mkfs:
+   - mkfs.8 incomplete sentence and formatting  [Peter Breitenlohner]
+mkfs.bfs:
+   - mkfs.bfs.8 formatting  [Peter Breitenlohner]
+mkfs.cramfs:
+   - fix gcc warning (incompatible pointer type)  [Karel Zak]
+mkfs.minix:
+   - fix strict-aliasing bugs  [Karel Zak]
+   - mkfs.minix.8 formatting  [Peter Breitenlohner]
+mkswap:
+   - fix memory leaks, cleanup check_blocks()  [Karel Zak]
+   - mkswap.8 formatting  [Peter Breitenlohner]
+   - restore device argument in mkswap.8 synopsis  [Peter Breitenlohner]
+   - unbreak -c ("check") option.  [Peter De Wachter]
+   - use libblkid to detect PT  [Karel Zak]
+more:
+   - limited line buffer length results in corrupted UTF-8 text  [Karel Zak]
+   - more.1 formatting  [Peter Breitenlohner]
+mount:
+   - add --no-canonicalize option  [Karel Zak]
+   - add a note about /dev/disk/by-* to mount.8  [Karel Zak]
+   - add a note about bind-dir remounts  [Karel Zak]
+   - add info about ext{3,4} barriers to mount.8  [Karel Zak]
+   - add long options to mount.8  [Karel Zak]
+   - add squashfs to mount.8  [Karel Zak]
+   - add ubifs to the mount.8 man page  [Sebastian Andrzej Siewior]
+   - and libblkid  covert /dev/dm-N to /dev/mapper/<name>  [Karel Zak]
+   - better --move description  [Karel Zak]
+   - check for unsuccessful read-only bind mounts  [Karel Zak]
+   - disable --no-canonicalize for non-root users  [Karel Zak]
+   - document changed semantics of tmpfs size option in mount.8  [kevin.granade@gmail.com]
+   - fix mount.8, xfs attr2 is enabled by default  [Karel Zak]
+   - fix reference to samba-client in mount.8  [Karel Zak]
+   - fix typo in mount.8  [Karel Zak]
+   - mention mtab for single mount point mount in mount.8  [Peter Volkov]
+   - more explicitly explain 'strictatime' in mount.8  [Karel Zak]
+   - more verbose "mount  only root can do that" message  [Karel Zak]
+   - mount.8 formatting  [Peter Breitenlohner]
+   - move info about devices to the top of mount.8  [Karel Zak]
+   - update list of pseudo filesystems  [Karel Zak]
+namei:
+   - better mount points detection  [Karel Zak]
+   - fix alone symlink evaluation  [Karel Zak]
+   - gater information about / (root)  [Karel Zak]
+   - namei.1 formatting  [Peter Breitenlohner]
+   - use c.h  [Karel Zak]
+newgrp:
+   - newgrp.1 formatting  [Peter Breitenlohner]
+   - use c.h, remove tailing whitespace  [Karel Zak]
+partx:
+   - partx.8 formatting  [Peter Breitenlohner]
+   - use c.h  [Karel Zak]
+   - work properly with 512 sectors (dos PT)  [Karel Zak]
+pg:
+   - command enters infinite loop  [Mike Frysinger]
+   - compiler warning with NLS disabled  [Peter Breitenlohner]
+   - pg.1 formatting  [Peter Breitenlohner]
+pivot_root:
+   - pivot_root.8 formatting  [Peter Breitenlohner]
+po:
+   - fix grammar glitch in german translation  [Hendrik Lönngren]
+   - fix msgid bugs  [Karel Zak]
+   - merge changes  [Karel Zak]
+   - update POTFILES.in  [Karel Zak]
+   - update cs.po (from translationproject.org)  [Petr Pisar]
+   - update eu.po (from translationproject.org)  [Mikel Olasagasti Uranga]
+   - update eu.po (from translationproject.org)  [Mikel Olasagasti]
+   - update fi.po (from translationproject.org)  [Lauri Nurmi]
+   - update fr.po (from translationproject.org)  [Nicolas Provost]
+   - update id.po (from translationproject.org)  [Arif E. Nugroho]
+   - update ja.po (from translationproject.org)  [Makoto Kato]
+   - update pl.po (from translationproject.org)  [Jakub Bogusz]
+   - update po/POTFILES.in  [Karel Zak]
+   - update vi.po (from translationproject.org)  [Clytie Siddall]
+   - update zh_CN.po (from translationproject.org)  [Ray Wang]
+rdev:
+   - rdev.8 formatting  [Peter Breitenlohner]
+readprofile:
+   - readprofile.1 formatting  [Peter Breitenlohner]
+rename:
+   - rename.1 formatting  [Peter Breitenlohner]
+renice:
+   - renice.1 formatting  [Peter Breitenlohner]
+reset:
+   - reset.1 formatting  [Peter Breitenlohner]
+rtcwake:
+   - add S5 support  [Karel Zak]
+   - ignore the tm_isdst field returned from the RTC  [Paul Fox]
+   - rtcwake.8 formatting  [Peter Breitenlohner]
+scriptreplay:
+   - fix typo in error message  [Karel Zak]
+   - scriptreplay.1 formatting  [Peter Breitenlohner]
+setarch:
+   - setarch.8 formatting  [Peter Breitenlohner]
+setsid:
+   - setsid.1 formatting  [Peter Breitenlohner]
+setterm:
+   - setterm.1 formatting  [Peter Breitenlohner]
+   - use c.h, remove tailing whitespace  [Karel Zak]
+sfdisk:
+   - confused about disk size  [Karel Zak]
+   - dump has to be $LANG insensitive  [Karel Zak]
+   - sfdisk.8 formatting  [Peter Breitenlohner]
+   - use c.h, remove obsolete #ifdefs  [Karel Zak]
+shutdown:
+   - shutdown.8 formatting  [Peter Breitenlohner]
+simpleinit:
+   - simpleinit.8 formatting  [Peter Breitenlohner]
+swapon:
+   - fix typo on swapon.8 manpage  [Florentin Duneau]
+   - handle <=linux-2.6.19 bug in /proc/swaps  [Mike Frysinger]
+   - more robust progname probing  [Karel Zak]
+   - swapon.8 formatting  [Peter Breitenlohner]
+switch_root:
+   - add note about subroots to switch_root.8  [Karel Zak]
+   - remove TIOCSCTTY and setsid()  [Karel Zak]
+   - switch_root.8 formatting  [Peter Breitenlohner]
+tailf:
+   - fix printf format  [Mike Frysinger]
+   - report inotify_add_watch() problems  [Karel Zak]
+tests:
+   - add BFS libblkid regression test  [Karel Zak]
+   - add NTFS blkid test  [Karel Zak]
+   - add UBIFS test image to blkid test suite  [Corentin Chary]
+   - add UFS test image for libblkid  [Karel Zak]
+   - add VIA RAID test image for libblkid  [Karel Zak]
+   - add adaptec RAID test  [Karel Zak]
+   - add blkid regression tests for ISO9660  [Karel Zak]
+   - add hpt37x RAID test  [Karel Zak]
+   - add hpt45x RAID test  [Karel Zak]
+   - add isw RAID test  [Karel Zak]
+   - add jmicron RAID test  [Karel Zak]
+   - add lsi RAID test  [Karel Zak]
+   - add nvidia RAID test  [Karel Zak]
+   - add partitions probing test  [Karel Zak]
+   - add promise RAID test  [Karel Zak]
+   - add silicon RAID test  [Karel Zak]
+   - fdisk doslabel test also checks changing partition type  [Zdenek Behan]
+   - fdisk doslabel test also checks setting partition active  [Zdenek Behan]
+   - refresh GPT regression test  [Karel Zak]
+   - refresh lscpu tests  [Karel Zak]
+   - remove vol_id from tests  [Karel Zak]
+   - rename blkid/images to blkid/images-fs  [Karel Zak]
+   - swapon workaround for libtool wrapper  [Karel Zak]
+   - test for basic functionality of sun labels  [Zdenek Behan]
+   - update fsck.ismounted test  [Karel Zak]
+tunelp:
+   - tunelp.8 formatting  [Peter Breitenlohner]
+ul:
+   - ul.1 erroneous .SH instead of .Sh  [Peter Breitenlohner]
+umount:
+   - add --no-canonicalize  [Karel Zak]
+   - umount.8 command line for umount helpers, formatting  [Peter Breitenlohner]
+unshare:
+   - new command  [Mikhail Gusarov]
+uuidd:
+   - uuidd.8 formatting  [Peter Breitenlohner]
+uuidgen:
+   - uuidgen.1 formatting  [Peter Breitenlohner]
+vipw:
+   - vipw.8 remove erroneous empty line, formatting  [Peter Breitenlohner]
+whereis:
+   - whereis.1 formatting  [Peter Breitenlohner]
+wipefs:
+   - fix coding style  [Karel Zak]
+   - new command  [Karel Zak]
+   - remove obsolete comment  [Karel Zak]
+write:
+   - write.1 formatting  [Peter Breitenlohner]
diff --git a/util-linux-ng-2.17.2/docs/v2.17.1-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.17.1-ReleaseNotes
new file mode 100644
index 0000000..0d85d5f
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.17.1-ReleaseNotes
@@ -0,0 +1,111 @@
+Util-linux-ng 2.17.1 Release Notes
+==================================
+
+Release highlights
+------------------
+
+fdisk:
+   - supports new command line option "-c" to disable DOS-compatible mode from
+     command line.
+
+     The DOS-compatible mode is DEPRECATED and will be disabled by default
+     in the next major release. Currently, the DOS mode is enabled by default
+     for backward compatibility only. 
+
+     The cylinders as display units are DEPRECATED. It's recommended to use
+     "-u" command line option or "u" fdisk command and use sectors as display
+     units.
+
+   Note that the new support for 4K-sector disks is useless in DOS-compatible
+   mode. The fdisk command prints warning(s) when startup in DOS mode.
+
+
+Changes since v2.17
+-------------------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/
+
+
+blkid:
+   - add newline when only one value is printed  [Karel Zak]
+   - fix #ifdef HAVE_TERMIO[S]_H  [Karel Zak]
+   - probe for PT, don't probe for FS on small whole-disks  [Karel Zak]
+   - report open() errors in low-level probing  [Karel Zak]
+build-sys:
+   - add missing tests for libuuid and libblkid  [Karel Zak]
+   - release++ (v2.17.1-rc1)  [Karel Zak]
+   - remove duplicate #includes  [Karel Zak]
+cal:
+   - fix first day of the week calculation on BE systems  [Karel Zak]
+cfdisk:
+   - set '[New]' as default item on menu for non allocated space instead of '[Help]'.  [Francesco Cosoleto]
+   - set '[Quit]' as default menu item on first run instead of '[Bootable]'.  [Francesco Cosoleto]
+docs:
+   - add v2.17.1 ReleaseNotes  [Karel Zak]
+   - update AUTHORS file  [Karel Zak]
+fdisk:
+   - add -c option (switch off DOS mode)  [Karel Zak]
+   - cleanup alignment, default to 1MiB offset  [Karel Zak]
+   - cleanup help, add -h option  [Karel Zak]
+   - cleanup warnings  [Karel Zak]
+   - don't check alignment_offset against geometry  [Karel Zak]
+   - don't include scsi.h  [Karel Zak]
+   - don't use 1MiB grain on small devices  [Karel Zak]
+   - fallback for topology values  [Karel Zak]
+   - fix ALIGN_UP  [Karel Zak]
+   - fix check_alignment()  [Karel Zak]
+   - fix default first sector  [Karel Zak]
+   - swap VTOC values for warning messages  [Karel Zak]
+   - use "optimal I/O size" in warnings  [Karel Zak]
+   - use 1MiB offset and grain always when possible  [Karel Zak]
+   - use more elegant way to count and check alignment  [Karel Zak]
+   - use optimal_io_size  [Karel Zak]
+include:
+   - add min/max macros  [Karel Zak]
+libblkid:
+   - add minimal sizes for OCFS and GFS  [Karel Zak]
+   - add sanity checks for FAT to DOS PT parser  [Karel Zak]
+   - call read() per FAT root dir entry  [Karel Zak]
+   - disable read-ahead when probing device files  [Linus Torvalds]
+   - don't call read() per FAT dir-entry on large disks  [Karel Zak]
+   - don't probe for GPT and Unixware PT on floppies  [Karel Zak]
+   - don't return error on empty files  [Karel Zak]
+   - fix ZSF detection  [Andreas Dilger]
+   - fix segfault in drdb  [Matthias König]
+   - more robust minix probing  [Karel Zak]
+   - read whole SB buffer (69kB) on large disks  [Karel Zak]
+   - read() optimization for small devices  [Karel Zak]
+   - restrict RAID/FS proving for small devices (1.4MiB)  [Karel Zak]
+   - rewrite blkid_probe_get_buffer()  [Karel Zak]
+   - set minimal size for jfs, reiser, swap and zfs  [Karel Zak]
+login:
+   - check that after tty reopen we still work with a terminal  [Karel Zak]
+   - don't link PAMed version with libcrypt  [Karel Zak]
+   - use fd instead of pathname for update tty's owner and permissions  [Yann Droneaud]
+mount:
+   - advise users to use "modprobe", not "insmod"  [Karel Zak]
+   - update documentation about barrier mount options  [Jan Kara]
+   - warn users that mtab is read-only  [Karel Zak]
+namei:
+   - fix man page formatting  [Vladimir Brednikov]
+po:
+   - merge changes  [Karel Zak]
+   - update cs.po (from translationproject.org)  [Petr Pisar]
+   - update eu.po (from translationproject.org)  [Mikel Olasagasti Uranga]
+   - update id.po (from translationproject.org)  [Arif E. Nugroho]
+   - update pl.po (from translationproject.org)  [Jakub Bogusz]
+   - update vi.po (from translationproject.org)  [Clytie Siddall]
+sfdisk:
+   - make sure writes make it to disk in write_partitions()  [Bryn M. Reeves]
+swapon:
+   - fix swapsize calculation  [Karel Zak]
+tests:
+   - add fdisk alignment tests  [Karel Zak]
+   - fix RAIDs tests  [Karel Zak]
+   - fix and update old fdisk tests  [Karel Zak]
+   - update FS test images  [Karel Zak]
+   - update fdisk tests  [Karel Zak]
+   - update fdisk tests (add whitespaces)  [Karel Zak]
+wipefs:
+   - ignore devices with partition table  [Karel Zak]
diff --git a/util-linux-ng-2.17.2/docs/v2.17.2-ReleaseNotes b/util-linux-ng-2.17.2/docs/v2.17.2-ReleaseNotes
new file mode 100644
index 0000000..42a425e
--- /dev/null
+++ b/util-linux-ng-2.17.2/docs/v2.17.2-ReleaseNotes
@@ -0,0 +1,41 @@
+Util-linux-ng 2.17.2 Release Notes
+==================================
+
+Changes since v2.17.1
+---------------------
+
+ For more details see ChangeLog files at:
+ ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/
+
+
+docs:
+   - fix small typo in v2.17.1-ReleaseNotes  [Karel Zak]
+   - update AUTHORS file  [Karel Zak]
+fdisk:
+   - fix -b <sectorsize>  [Karel Zak]
+ionice:
+   - fix typo  [Pierre Hauweele]
+lib:
+   - add #ifndef around min() max() macros  [Karel Zak]
+libblkid:
+   - fix display of device size  [Karel Zak]
+   - fix infinite loop when probe chain bails out early  [Colin Watson]
+   - more robust minix probing  [Karel Zak]
+   - remove "0x" prefix from DRBD UUID  [Karel Zak]
+   - reset BLKID_TINY_DEV flag in blkid_probe_set_device  [Pascal Terjan]
+   - support alignment_offset=-1  [Karel Zak]
+lscpu:
+   - fix cpuid opcode detection  [Henne Vogelsang]
+mount:
+   - more explicitly explain fstab usage in mount.8  [Karel Zak]
+   - posix option of vfat is obsolete  [Yoshihiro Takahashi]
+   - properly ignore comments in /etc/filesystems  [Mike Frysinger]
+po:
+   - merge changes  [Karel Zak]
+   - update ja.po (from translationproject.org)  [Makoto Kato]
+   - update pl.po (from translationproject.org)  [Jakub Bogusz]
+   - update vi.po (from translationproject.org)  [Clytie Siddall]
+swapon:
+   - remove " (deleted)" from filenames from /proc/swaps  [Karel Zak]
+wipefs:
+   - cleanup usage() and man page  [Karel Zak]
diff --git a/util-linux-ng-2.17.2/example.files/filesystems b/util-linux-ng-2.17.2/example.files/filesystems
new file mode 100644
index 0000000..74e1b51
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/filesystems
@@ -0,0 +1,19 @@
+	ext2
+	vfat
+	umsdos
+	msdos
+	iso9660
+	minix
+	ntfs
+	hpfs
+	ufs
+	sysv
+	romfs
+	reiserfs
+nodev	autofs
+nodev	proc
+nodev	smbfs
+nodev	nfs
+nodev	coda
+nodev	devpts
+nodev	devfs
diff --git a/util-linux-ng-2.17.2/example.files/fstab b/util-linux-ng-2.17.2/example.files/fstab
new file mode 100644
index 0000000..eeb72f1
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/fstab
@@ -0,0 +1,21 @@
+# /etc/fstab
+# static file system information
+#
+# This file is not used by the kernel, but rather by mount(8) and umount(8)
+# (and some day fsck(8)).  Comment lines have "#" in the first column.
+#
+# For more information see fstab(5) man page.
+#
+
+# device	directory	type	options		freq pass
+/dev/sda2	/		ext2	defaults        1    1
+none		/proc		proc	defaults        0    0
+/dev/sdb1	none		swap	defaults        0    0
+/dev/sdb2	/var		ext2	defaults        1    1
+/dev/sdc1	/usr		ext2	defaults        1    1
+/dev/sdc3	/usr/src	ext2	defaults        1    1
+/dev/sdc2	/home		ext2	defaults        1    1
+/dev/sdc4	/playpen	ext2	defaults        1    1
+
+/dev/sda1       /dos            msdos   noexec,conv=binary,gid=20,umask=007 0 0
+/dev/sdb3       /dos/usr        msdos   noexec,conv=binary,gid=20,umask=007 0 0
diff --git a/util-linux-ng-2.17.2/example.files/inittab b/util-linux-ng-2.17.2/example.files/inittab
new file mode 100644
index 0000000..2095190
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/inittab
@@ -0,0 +1,10 @@
+# inittab
+# Format:
+# ttyline:termcap-entry:getty-command
+tty1:linux:/sbin/getty 9600 tty1
+tty2:linux:/sbin/getty 9600 tty2
+tty3:linux:/sbin/getty 9600 tty3
+tty4:linux:/sbin/getty 9600 tty4
+tty5:linux:/sbin/getty 9600 tty5
+tty6:linux:/sbin/getty 9600 tty6
+ttyS1:vt100:/sbin/getty -Lh 19200 ttyS1
diff --git a/util-linux-ng-2.17.2/example.files/issue b/util-linux-ng-2.17.2/example.files/issue
new file mode 100644
index 0000000..4ad1ec5
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/issue
@@ -0,0 +1,3 @@
+
+Welcome to winter, an i486 running BOGUS Release 1.0.1 Linux 1.1.90
+
diff --git a/util-linux-ng-2.17.2/example.files/issue0 b/util-linux-ng-2.17.2/example.files/issue0
new file mode 100644
index 0000000..285f71a
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/issue0
@@ -0,0 +1 @@
+This is \n (\s \m \r) \d
diff --git a/util-linux-ng-2.17.2/example.files/motd b/util-linux-ng-2.17.2/example.files/motd
new file mode 100644
index 0000000..842a6f3
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/motd
@@ -0,0 +1,10 @@
+
+       |^^^^^^|
+       |      |        _____________________ 
+       |      |       /                     \
+       | (o)(o)      |                       |
+      @      _)      |     BOGUS man!!       |
+       | ,___|     ,,|                       |
+       |   /   ..''  |                       |
+      /____\          \_____________________/
+
diff --git a/util-linux-ng-2.17.2/example.files/securetty b/util-linux-ng-2.17.2/example.files/securetty
new file mode 100644
index 0000000..d874765
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/securetty
@@ -0,0 +1,5 @@
+tty1
+tty2
+tty3
+tty4
+ttyS1
diff --git a/util-linux-ng-2.17.2/example.files/shells b/util-linux-ng-2.17.2/example.files/shells
new file mode 100644
index 0000000..14b99f1
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/shells
@@ -0,0 +1,4 @@
+/bin/sh
+/bin/bash
+/bin/csh
+/bin/tcsh
diff --git a/util-linux-ng-2.17.2/example.files/udev-raw.rules b/util-linux-ng-2.17.2/example.files/udev-raw.rules
new file mode 100644
index 0000000..2279c91
--- /dev/null
+++ b/util-linux-ng-2.17.2/example.files/udev-raw.rules
@@ -0,0 +1,11 @@
+# This file and interface are deprecated.
+# Applications needing raw device access should open regular
+# block devices with O_DIRECT.
+#
+# Enter raw device bindings here.
+#
+# An example would be:
+#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
+# to bind /dev/raw/raw1 to /dev/sda, or
+#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
+# to bind /dev/raw/raw2 to the device with major 8, minor 1.
diff --git a/util-linux-ng-2.17.2/fdisk/Makefile.am b/util-linux-ng-2.17.2/fdisk/Makefile.am
new file mode 100644
index 0000000..5496e24
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/Makefile.am
@@ -0,0 +1,70 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+EXTRA_DIST = README.fdisk README.cfdisk sfdisk.examples partitiontype.c
+
+fdisk_common = i386_sys_types.c common.h gpt.c gpt.h \
+	../lib/blkdev.c ../lib/wholedisk.c
+
+if LINUX
+fdisk_common += ../lib/linux_version.c
+endif
+
+if !ARCH_M68K
+
+sbin_PROGRAMS = fdisk
+dist_man_MANS = fdisk.8
+fdisk_SOURCES = fdisk.c fdiskbsdlabel.c fdisksgilabel.c \
+	fdisksunlabel.c fdiskaixlabel.c fdiskmaclabel.c partname.c \
+	fdisk.h fdisksunlabel.h fdisksgilabel.h fdiskaixlabel.h \
+	fdiskbsdlabel.h fdiskmaclabel.h $(fdisk_common)
+
+cflags_fdisk = $(AM_CFLAGS)
+ldadd_fdisk =
+
+if BUILD_LIBBLKID
+# only in-tree libblkid has topology support
+ldadd_fdisk += $(ul_libblkid_la)
+cflags_fdisk += -I$(ul_libblkid_incdir)
+endif
+
+if HAVE_STATIC_FDISK
+sbin_PROGRAMS += fdisk.static
+fdisk_static_SOURCES = $(fdisk_SOURCES)
+fdisk_static_LDFLAGS = -all-static
+fdisk_static_CFLAGS = $(cflags_fdisk)
+fdisk_static_LDADD = $(ldadd_fdisk)
+endif
+
+fdisk_CFLAGS = $(cflags_fdisk)
+fdisk_LDADD = $(ldadd_fdisk)
+
+
+if !ARCH_SPARC
+
+sbin_PROGRAMS += sfdisk
+dist_man_MANS += sfdisk.8
+sfdisk_SOURCES = sfdisk.c partname.c $(fdisk_common)
+
+if HAVE_STATIC_SFDISK
+sbin_PROGRAMS += sfdisk.static
+sfdisk_static_SOURCES = $(sfdisk_SOURCES)
+sfdisk_static_LDFLAGS = -all-static
+endif
+
+if USE_SLANG
+sbin_PROGRAMS += cfdisk
+dist_man_MANS += cfdisk.8
+cfdisk_SOURCES = cfdisk.c $(fdisk_common)
+cfdisk_LDADD = -lslang
+else
+if HAVE_NCURSES
+sbin_PROGRAMS += cfdisk
+dist_man_MANS += cfdisk.8
+cfdisk_SOURCES = cfdisk.c $(fdisk_common)
+cfdisk_LDADD = @NCURSES_LIBS@
+endif
+endif
+
+endif # !ARCH_SPARC
+endif # !ARCH_M68K
+
diff --git a/util-linux-ng-2.17.2/fdisk/Makefile.in b/util-linux-ng-2.17.2/fdisk/Makefile.in
new file mode 100644
index 0000000..4a648ef
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/Makefile.in
@@ -0,0 +1,1281 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(dist_man_MANS) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config/include-Makefile.am
+@LINUX_TRUE@am__append_1 = ../lib/linux_version.c
+@ARCH_M68K_FALSE@sbin_PROGRAMS = fdisk$(EXEEXT) $(am__EXEEXT_1) \
+@ARCH_M68K_FALSE@	$(am__EXEEXT_2) $(am__EXEEXT_3) \
+@ARCH_M68K_FALSE@	$(am__EXEEXT_4) $(am__EXEEXT_5)
+
+# only in-tree libblkid has topology support
+@ARCH_M68K_FALSE@@BUILD_LIBBLKID_TRUE@am__append_2 = $(ul_libblkid_la)
+@ARCH_M68K_FALSE@@BUILD_LIBBLKID_TRUE@am__append_3 = -I$(ul_libblkid_incdir)
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@am__append_4 = fdisk.static
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@am__append_5 = sfdisk
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@am__append_6 = sfdisk.8
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@am__append_7 = sfdisk.static
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@am__append_8 = cfdisk
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@am__append_9 = cfdisk.8
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@am__append_10 = cfdisk
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@am__append_11 = cfdisk.8
+subdir = fdisk
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@am__EXEEXT_1 = fdisk.static$(EXEEXT)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@am__EXEEXT_2 = sfdisk$(EXEEXT)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@am__EXEEXT_3 = sfdisk.static$(EXEEXT)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@am__EXEEXT_4 = cfdisk$(EXEEXT)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@am__EXEEXT_5 = cfdisk$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
+PROGRAMS = $(sbin_PROGRAMS)
+am__cfdisk_SOURCES_DIST = cfdisk.c i386_sys_types.c common.h gpt.c \
+	gpt.h ../lib/blkdev.c ../lib/wholedisk.c \
+	../lib/linux_version.c
+@LINUX_TRUE@am__objects_1 = linux_version.$(OBJEXT)
+am__objects_2 = i386_sys_types.$(OBJEXT) gpt.$(OBJEXT) \
+	blkdev.$(OBJEXT) wholedisk.$(OBJEXT) $(am__objects_1)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@am_cfdisk_OBJECTS = cfdisk.$(OBJEXT) \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@	$(am__objects_2)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@am_cfdisk_OBJECTS = cfdisk.$(OBJEXT) \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@	$(am__objects_2)
+cfdisk_OBJECTS = $(am_cfdisk_OBJECTS)
+cfdisk_DEPENDENCIES =
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am__fdisk_SOURCES_DIST = fdisk.c fdiskbsdlabel.c fdisksgilabel.c \
+	fdisksunlabel.c fdiskaixlabel.c fdiskmaclabel.c partname.c \
+	fdisk.h fdisksunlabel.h fdisksgilabel.h fdiskaixlabel.h \
+	fdiskbsdlabel.h fdiskmaclabel.h i386_sys_types.c common.h \
+	gpt.c gpt.h ../lib/blkdev.c ../lib/wholedisk.c \
+	../lib/linux_version.c
+@LINUX_TRUE@am__objects_3 = fdisk-linux_version.$(OBJEXT)
+am__objects_4 = fdisk-i386_sys_types.$(OBJEXT) fdisk-gpt.$(OBJEXT) \
+	fdisk-blkdev.$(OBJEXT) fdisk-wholedisk.$(OBJEXT) \
+	$(am__objects_3)
+@ARCH_M68K_FALSE@am_fdisk_OBJECTS = fdisk-fdisk.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk-fdiskbsdlabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk-fdisksgilabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk-fdisksunlabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk-fdiskaixlabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk-fdiskmaclabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk-partname.$(OBJEXT) $(am__objects_4)
+fdisk_OBJECTS = $(am_fdisk_OBJECTS)
+@ARCH_M68K_FALSE@fdisk_DEPENDENCIES = $(ldadd_fdisk)
+fdisk_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(fdisk_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+am__fdisk_static_SOURCES_DIST = fdisk.c fdiskbsdlabel.c \
+	fdisksgilabel.c fdisksunlabel.c fdiskaixlabel.c \
+	fdiskmaclabel.c partname.c fdisk.h fdisksunlabel.h \
+	fdisksgilabel.h fdiskaixlabel.h fdiskbsdlabel.h \
+	fdiskmaclabel.h i386_sys_types.c common.h gpt.c gpt.h \
+	../lib/blkdev.c ../lib/wholedisk.c ../lib/linux_version.c
+@LINUX_TRUE@am__objects_5 = fdisk_static-linux_version.$(OBJEXT)
+am__objects_6 = fdisk_static-i386_sys_types.$(OBJEXT) \
+	fdisk_static-gpt.$(OBJEXT) fdisk_static-blkdev.$(OBJEXT) \
+	fdisk_static-wholedisk.$(OBJEXT) $(am__objects_5)
+@ARCH_M68K_FALSE@am__objects_7 = fdisk_static-fdisk.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk_static-fdiskbsdlabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk_static-fdisksgilabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk_static-fdisksunlabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk_static-fdiskaixlabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk_static-fdiskmaclabel.$(OBJEXT) \
+@ARCH_M68K_FALSE@	fdisk_static-partname.$(OBJEXT) \
+@ARCH_M68K_FALSE@	$(am__objects_6)
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@am_fdisk_static_OBJECTS =  \
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@	$(am__objects_7)
+fdisk_static_OBJECTS = $(am_fdisk_static_OBJECTS)
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@fdisk_static_DEPENDENCIES =  \
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@	$(ldadd_fdisk)
+fdisk_static_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(fdisk_static_CFLAGS) \
+	$(CFLAGS) $(fdisk_static_LDFLAGS) $(LDFLAGS) -o $@
+am__sfdisk_SOURCES_DIST = sfdisk.c partname.c i386_sys_types.c \
+	common.h gpt.c gpt.h ../lib/blkdev.c ../lib/wholedisk.c \
+	../lib/linux_version.c
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@am_sfdisk_OBJECTS =  \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@	sfdisk.$(OBJEXT) \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@	partname.$(OBJEXT) \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@	$(am__objects_2)
+sfdisk_OBJECTS = $(am_sfdisk_OBJECTS)
+sfdisk_LDADD = $(LDADD)
+am__sfdisk_static_SOURCES_DIST = sfdisk.c partname.c i386_sys_types.c \
+	common.h gpt.c gpt.h ../lib/blkdev.c ../lib/wholedisk.c \
+	../lib/linux_version.c
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@am__objects_8 = sfdisk.$(OBJEXT) \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@	partname.$(OBJEXT) \
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@	$(am__objects_2)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@am_sfdisk_static_OBJECTS = $(am__objects_8)
+sfdisk_static_OBJECTS = $(am_sfdisk_static_OBJECTS)
+sfdisk_static_LDADD = $(LDADD)
+sfdisk_static_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(sfdisk_static_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(cfdisk_SOURCES) $(fdisk_SOURCES) $(fdisk_static_SOURCES) \
+	$(sfdisk_SOURCES) $(sfdisk_static_SOURCES)
+DIST_SOURCES = $(am__cfdisk_SOURCES_DIST) $(am__fdisk_SOURCES_DIST) \
+	$(am__fdisk_static_SOURCES_DIST) $(am__sfdisk_SOURCES_DIST) \
+	$(am__sfdisk_static_SOURCES_DIST)
+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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(dist_man_MANS)
+am__dist_noinst_DATA_DIST = fdisk.8 sfdisk.8 cfdisk.8
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+EXTRA_DIST = README.fdisk README.cfdisk sfdisk.examples partitiontype.c
+fdisk_common = i386_sys_types.c common.h gpt.c gpt.h ../lib/blkdev.c \
+	../lib/wholedisk.c $(am__append_1)
+@ARCH_M68K_FALSE@dist_man_MANS = fdisk.8 $(am__append_6) \
+@ARCH_M68K_FALSE@	$(am__append_9) $(am__append_11)
+@ARCH_M68K_FALSE@fdisk_SOURCES = fdisk.c fdiskbsdlabel.c fdisksgilabel.c \
+@ARCH_M68K_FALSE@	fdisksunlabel.c fdiskaixlabel.c fdiskmaclabel.c partname.c \
+@ARCH_M68K_FALSE@	fdisk.h fdisksunlabel.h fdisksgilabel.h fdiskaixlabel.h \
+@ARCH_M68K_FALSE@	fdiskbsdlabel.h fdiskmaclabel.h $(fdisk_common)
+
+@ARCH_M68K_FALSE@cflags_fdisk = $(AM_CFLAGS) $(am__append_3)
+@ARCH_M68K_FALSE@ldadd_fdisk = $(am__append_2)
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@fdisk_static_SOURCES = $(fdisk_SOURCES)
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@fdisk_static_LDFLAGS = -all-static
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@fdisk_static_CFLAGS = $(cflags_fdisk)
+@ARCH_M68K_FALSE@@HAVE_STATIC_FDISK_TRUE@fdisk_static_LDADD = $(ldadd_fdisk)
+@ARCH_M68K_FALSE@fdisk_CFLAGS = $(cflags_fdisk)
+@ARCH_M68K_FALSE@fdisk_LDADD = $(ldadd_fdisk)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@sfdisk_SOURCES = sfdisk.c partname.c $(fdisk_common)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@sfdisk_static_SOURCES = $(sfdisk_SOURCES)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@sfdisk_static_LDFLAGS = -all-static
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@cfdisk_SOURCES = cfdisk.c $(fdisk_common)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@cfdisk_SOURCES = cfdisk.c $(fdisk_common)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@cfdisk_LDADD = @NCURSES_LIBS@
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@cfdisk_LDADD = -lslang
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fdisk/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign fdisk/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
+$(am__aclocal_m4_deps):
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+cfdisk$(EXEEXT): $(cfdisk_OBJECTS) $(cfdisk_DEPENDENCIES) 
+	@rm -f cfdisk$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(cfdisk_OBJECTS) $(cfdisk_LDADD) $(LIBS)
+fdisk$(EXEEXT): $(fdisk_OBJECTS) $(fdisk_DEPENDENCIES) 
+	@rm -f fdisk$(EXEEXT)
+	$(AM_V_CCLD)$(fdisk_LINK) $(fdisk_OBJECTS) $(fdisk_LDADD) $(LIBS)
+fdisk.static$(EXEEXT): $(fdisk_static_OBJECTS) $(fdisk_static_DEPENDENCIES) 
+	@rm -f fdisk.static$(EXEEXT)
+	$(AM_V_CCLD)$(fdisk_static_LINK) $(fdisk_static_OBJECTS) $(fdisk_static_LDADD) $(LIBS)
+sfdisk$(EXEEXT): $(sfdisk_OBJECTS) $(sfdisk_DEPENDENCIES) 
+	@rm -f sfdisk$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(sfdisk_OBJECTS) $(sfdisk_LDADD) $(LIBS)
+sfdisk.static$(EXEEXT): $(sfdisk_static_OBJECTS) $(sfdisk_static_DEPENDENCIES) 
+	@rm -f sfdisk.static$(EXEEXT)
+	$(AM_V_CCLD)$(sfdisk_static_LINK) $(sfdisk_static_OBJECTS) $(sfdisk_static_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blkdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfdisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-blkdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-fdisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-fdiskaixlabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-fdiskbsdlabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-fdiskmaclabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-fdisksgilabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-fdisksunlabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-gpt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-i386_sys_types.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-linux_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-partname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk-wholedisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-blkdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-fdisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-fdiskaixlabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-fdiskbsdlabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-fdiskmaclabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-fdisksgilabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-fdisksunlabel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-gpt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-i386_sys_types.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-linux_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-partname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdisk_static-wholedisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386_sys_types.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/partname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfdisk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wholedisk.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+blkdev.o: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT blkdev.o -MD -MP -MF $(DEPDIR)/blkdev.Tpo -c -o blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/blkdev.Tpo $(DEPDIR)/blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+
+blkdev.obj: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT blkdev.obj -MD -MP -MF $(DEPDIR)/blkdev.Tpo -c -o blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/blkdev.Tpo $(DEPDIR)/blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+
+wholedisk.o: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT wholedisk.o -MD -MP -MF $(DEPDIR)/wholedisk.Tpo -c -o wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/wholedisk.Tpo $(DEPDIR)/wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='wholedisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+
+wholedisk.obj: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT wholedisk.obj -MD -MP -MF $(DEPDIR)/wholedisk.Tpo -c -o wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/wholedisk.Tpo $(DEPDIR)/wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='wholedisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+
+linux_version.o: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT linux_version.o -MD -MP -MF $(DEPDIR)/linux_version.Tpo -c -o linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/linux_version.Tpo $(DEPDIR)/linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+
+linux_version.obj: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT linux_version.obj -MD -MP -MF $(DEPDIR)/linux_version.Tpo -c -o linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/linux_version.Tpo $(DEPDIR)/linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+
+fdisk-fdisk.o: fdisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdisk.o -MD -MP -MF $(DEPDIR)/fdisk-fdisk.Tpo -c -o fdisk-fdisk.o `test -f 'fdisk.c' || echo '$(srcdir)/'`fdisk.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdisk.Tpo $(DEPDIR)/fdisk-fdisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisk.c' object='fdisk-fdisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdisk.o `test -f 'fdisk.c' || echo '$(srcdir)/'`fdisk.c
+
+fdisk-fdisk.obj: fdisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdisk.obj -MD -MP -MF $(DEPDIR)/fdisk-fdisk.Tpo -c -o fdisk-fdisk.obj `if test -f 'fdisk.c'; then $(CYGPATH_W) 'fdisk.c'; else $(CYGPATH_W) '$(srcdir)/fdisk.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdisk.Tpo $(DEPDIR)/fdisk-fdisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisk.c' object='fdisk-fdisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdisk.obj `if test -f 'fdisk.c'; then $(CYGPATH_W) 'fdisk.c'; else $(CYGPATH_W) '$(srcdir)/fdisk.c'; fi`
+
+fdisk-fdiskbsdlabel.o: fdiskbsdlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdiskbsdlabel.o -MD -MP -MF $(DEPDIR)/fdisk-fdiskbsdlabel.Tpo -c -o fdisk-fdiskbsdlabel.o `test -f 'fdiskbsdlabel.c' || echo '$(srcdir)/'`fdiskbsdlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdiskbsdlabel.Tpo $(DEPDIR)/fdisk-fdiskbsdlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskbsdlabel.c' object='fdisk-fdiskbsdlabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdiskbsdlabel.o `test -f 'fdiskbsdlabel.c' || echo '$(srcdir)/'`fdiskbsdlabel.c
+
+fdisk-fdiskbsdlabel.obj: fdiskbsdlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdiskbsdlabel.obj -MD -MP -MF $(DEPDIR)/fdisk-fdiskbsdlabel.Tpo -c -o fdisk-fdiskbsdlabel.obj `if test -f 'fdiskbsdlabel.c'; then $(CYGPATH_W) 'fdiskbsdlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskbsdlabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdiskbsdlabel.Tpo $(DEPDIR)/fdisk-fdiskbsdlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskbsdlabel.c' object='fdisk-fdiskbsdlabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdiskbsdlabel.obj `if test -f 'fdiskbsdlabel.c'; then $(CYGPATH_W) 'fdiskbsdlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskbsdlabel.c'; fi`
+
+fdisk-fdisksgilabel.o: fdisksgilabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdisksgilabel.o -MD -MP -MF $(DEPDIR)/fdisk-fdisksgilabel.Tpo -c -o fdisk-fdisksgilabel.o `test -f 'fdisksgilabel.c' || echo '$(srcdir)/'`fdisksgilabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdisksgilabel.Tpo $(DEPDIR)/fdisk-fdisksgilabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksgilabel.c' object='fdisk-fdisksgilabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdisksgilabel.o `test -f 'fdisksgilabel.c' || echo '$(srcdir)/'`fdisksgilabel.c
+
+fdisk-fdisksgilabel.obj: fdisksgilabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdisksgilabel.obj -MD -MP -MF $(DEPDIR)/fdisk-fdisksgilabel.Tpo -c -o fdisk-fdisksgilabel.obj `if test -f 'fdisksgilabel.c'; then $(CYGPATH_W) 'fdisksgilabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksgilabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdisksgilabel.Tpo $(DEPDIR)/fdisk-fdisksgilabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksgilabel.c' object='fdisk-fdisksgilabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdisksgilabel.obj `if test -f 'fdisksgilabel.c'; then $(CYGPATH_W) 'fdisksgilabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksgilabel.c'; fi`
+
+fdisk-fdisksunlabel.o: fdisksunlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdisksunlabel.o -MD -MP -MF $(DEPDIR)/fdisk-fdisksunlabel.Tpo -c -o fdisk-fdisksunlabel.o `test -f 'fdisksunlabel.c' || echo '$(srcdir)/'`fdisksunlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdisksunlabel.Tpo $(DEPDIR)/fdisk-fdisksunlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksunlabel.c' object='fdisk-fdisksunlabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdisksunlabel.o `test -f 'fdisksunlabel.c' || echo '$(srcdir)/'`fdisksunlabel.c
+
+fdisk-fdisksunlabel.obj: fdisksunlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdisksunlabel.obj -MD -MP -MF $(DEPDIR)/fdisk-fdisksunlabel.Tpo -c -o fdisk-fdisksunlabel.obj `if test -f 'fdisksunlabel.c'; then $(CYGPATH_W) 'fdisksunlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksunlabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdisksunlabel.Tpo $(DEPDIR)/fdisk-fdisksunlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksunlabel.c' object='fdisk-fdisksunlabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdisksunlabel.obj `if test -f 'fdisksunlabel.c'; then $(CYGPATH_W) 'fdisksunlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksunlabel.c'; fi`
+
+fdisk-fdiskaixlabel.o: fdiskaixlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdiskaixlabel.o -MD -MP -MF $(DEPDIR)/fdisk-fdiskaixlabel.Tpo -c -o fdisk-fdiskaixlabel.o `test -f 'fdiskaixlabel.c' || echo '$(srcdir)/'`fdiskaixlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdiskaixlabel.Tpo $(DEPDIR)/fdisk-fdiskaixlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskaixlabel.c' object='fdisk-fdiskaixlabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdiskaixlabel.o `test -f 'fdiskaixlabel.c' || echo '$(srcdir)/'`fdiskaixlabel.c
+
+fdisk-fdiskaixlabel.obj: fdiskaixlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdiskaixlabel.obj -MD -MP -MF $(DEPDIR)/fdisk-fdiskaixlabel.Tpo -c -o fdisk-fdiskaixlabel.obj `if test -f 'fdiskaixlabel.c'; then $(CYGPATH_W) 'fdiskaixlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskaixlabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdiskaixlabel.Tpo $(DEPDIR)/fdisk-fdiskaixlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskaixlabel.c' object='fdisk-fdiskaixlabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdiskaixlabel.obj `if test -f 'fdiskaixlabel.c'; then $(CYGPATH_W) 'fdiskaixlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskaixlabel.c'; fi`
+
+fdisk-fdiskmaclabel.o: fdiskmaclabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdiskmaclabel.o -MD -MP -MF $(DEPDIR)/fdisk-fdiskmaclabel.Tpo -c -o fdisk-fdiskmaclabel.o `test -f 'fdiskmaclabel.c' || echo '$(srcdir)/'`fdiskmaclabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdiskmaclabel.Tpo $(DEPDIR)/fdisk-fdiskmaclabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskmaclabel.c' object='fdisk-fdiskmaclabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdiskmaclabel.o `test -f 'fdiskmaclabel.c' || echo '$(srcdir)/'`fdiskmaclabel.c
+
+fdisk-fdiskmaclabel.obj: fdiskmaclabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-fdiskmaclabel.obj -MD -MP -MF $(DEPDIR)/fdisk-fdiskmaclabel.Tpo -c -o fdisk-fdiskmaclabel.obj `if test -f 'fdiskmaclabel.c'; then $(CYGPATH_W) 'fdiskmaclabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskmaclabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-fdiskmaclabel.Tpo $(DEPDIR)/fdisk-fdiskmaclabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskmaclabel.c' object='fdisk-fdiskmaclabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-fdiskmaclabel.obj `if test -f 'fdiskmaclabel.c'; then $(CYGPATH_W) 'fdiskmaclabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskmaclabel.c'; fi`
+
+fdisk-partname.o: partname.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-partname.o -MD -MP -MF $(DEPDIR)/fdisk-partname.Tpo -c -o fdisk-partname.o `test -f 'partname.c' || echo '$(srcdir)/'`partname.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-partname.Tpo $(DEPDIR)/fdisk-partname.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='partname.c' object='fdisk-partname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-partname.o `test -f 'partname.c' || echo '$(srcdir)/'`partname.c
+
+fdisk-partname.obj: partname.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-partname.obj -MD -MP -MF $(DEPDIR)/fdisk-partname.Tpo -c -o fdisk-partname.obj `if test -f 'partname.c'; then $(CYGPATH_W) 'partname.c'; else $(CYGPATH_W) '$(srcdir)/partname.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-partname.Tpo $(DEPDIR)/fdisk-partname.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='partname.c' object='fdisk-partname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-partname.obj `if test -f 'partname.c'; then $(CYGPATH_W) 'partname.c'; else $(CYGPATH_W) '$(srcdir)/partname.c'; fi`
+
+fdisk-i386_sys_types.o: i386_sys_types.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-i386_sys_types.o -MD -MP -MF $(DEPDIR)/fdisk-i386_sys_types.Tpo -c -o fdisk-i386_sys_types.o `test -f 'i386_sys_types.c' || echo '$(srcdir)/'`i386_sys_types.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-i386_sys_types.Tpo $(DEPDIR)/fdisk-i386_sys_types.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='i386_sys_types.c' object='fdisk-i386_sys_types.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-i386_sys_types.o `test -f 'i386_sys_types.c' || echo '$(srcdir)/'`i386_sys_types.c
+
+fdisk-i386_sys_types.obj: i386_sys_types.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-i386_sys_types.obj -MD -MP -MF $(DEPDIR)/fdisk-i386_sys_types.Tpo -c -o fdisk-i386_sys_types.obj `if test -f 'i386_sys_types.c'; then $(CYGPATH_W) 'i386_sys_types.c'; else $(CYGPATH_W) '$(srcdir)/i386_sys_types.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-i386_sys_types.Tpo $(DEPDIR)/fdisk-i386_sys_types.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='i386_sys_types.c' object='fdisk-i386_sys_types.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-i386_sys_types.obj `if test -f 'i386_sys_types.c'; then $(CYGPATH_W) 'i386_sys_types.c'; else $(CYGPATH_W) '$(srcdir)/i386_sys_types.c'; fi`
+
+fdisk-gpt.o: gpt.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-gpt.o -MD -MP -MF $(DEPDIR)/fdisk-gpt.Tpo -c -o fdisk-gpt.o `test -f 'gpt.c' || echo '$(srcdir)/'`gpt.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-gpt.Tpo $(DEPDIR)/fdisk-gpt.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gpt.c' object='fdisk-gpt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-gpt.o `test -f 'gpt.c' || echo '$(srcdir)/'`gpt.c
+
+fdisk-gpt.obj: gpt.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-gpt.obj -MD -MP -MF $(DEPDIR)/fdisk-gpt.Tpo -c -o fdisk-gpt.obj `if test -f 'gpt.c'; then $(CYGPATH_W) 'gpt.c'; else $(CYGPATH_W) '$(srcdir)/gpt.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-gpt.Tpo $(DEPDIR)/fdisk-gpt.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gpt.c' object='fdisk-gpt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-gpt.obj `if test -f 'gpt.c'; then $(CYGPATH_W) 'gpt.c'; else $(CYGPATH_W) '$(srcdir)/gpt.c'; fi`
+
+fdisk-blkdev.o: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-blkdev.o -MD -MP -MF $(DEPDIR)/fdisk-blkdev.Tpo -c -o fdisk-blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-blkdev.Tpo $(DEPDIR)/fdisk-blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='fdisk-blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+
+fdisk-blkdev.obj: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-blkdev.obj -MD -MP -MF $(DEPDIR)/fdisk-blkdev.Tpo -c -o fdisk-blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-blkdev.Tpo $(DEPDIR)/fdisk-blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='fdisk-blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+
+fdisk-wholedisk.o: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-wholedisk.o -MD -MP -MF $(DEPDIR)/fdisk-wholedisk.Tpo -c -o fdisk-wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-wholedisk.Tpo $(DEPDIR)/fdisk-wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='fdisk-wholedisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+
+fdisk-wholedisk.obj: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-wholedisk.obj -MD -MP -MF $(DEPDIR)/fdisk-wholedisk.Tpo -c -o fdisk-wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-wholedisk.Tpo $(DEPDIR)/fdisk-wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='fdisk-wholedisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+
+fdisk-linux_version.o: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-linux_version.o -MD -MP -MF $(DEPDIR)/fdisk-linux_version.Tpo -c -o fdisk-linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-linux_version.Tpo $(DEPDIR)/fdisk-linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='fdisk-linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+
+fdisk-linux_version.obj: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -MT fdisk-linux_version.obj -MD -MP -MF $(DEPDIR)/fdisk-linux_version.Tpo -c -o fdisk-linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk-linux_version.Tpo $(DEPDIR)/fdisk-linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='fdisk-linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_CFLAGS) $(CFLAGS) -c -o fdisk-linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+
+fdisk_static-fdisk.o: fdisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdisk.o -MD -MP -MF $(DEPDIR)/fdisk_static-fdisk.Tpo -c -o fdisk_static-fdisk.o `test -f 'fdisk.c' || echo '$(srcdir)/'`fdisk.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdisk.Tpo $(DEPDIR)/fdisk_static-fdisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisk.c' object='fdisk_static-fdisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdisk.o `test -f 'fdisk.c' || echo '$(srcdir)/'`fdisk.c
+
+fdisk_static-fdisk.obj: fdisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdisk.obj -MD -MP -MF $(DEPDIR)/fdisk_static-fdisk.Tpo -c -o fdisk_static-fdisk.obj `if test -f 'fdisk.c'; then $(CYGPATH_W) 'fdisk.c'; else $(CYGPATH_W) '$(srcdir)/fdisk.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdisk.Tpo $(DEPDIR)/fdisk_static-fdisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisk.c' object='fdisk_static-fdisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdisk.obj `if test -f 'fdisk.c'; then $(CYGPATH_W) 'fdisk.c'; else $(CYGPATH_W) '$(srcdir)/fdisk.c'; fi`
+
+fdisk_static-fdiskbsdlabel.o: fdiskbsdlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdiskbsdlabel.o -MD -MP -MF $(DEPDIR)/fdisk_static-fdiskbsdlabel.Tpo -c -o fdisk_static-fdiskbsdlabel.o `test -f 'fdiskbsdlabel.c' || echo '$(srcdir)/'`fdiskbsdlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdiskbsdlabel.Tpo $(DEPDIR)/fdisk_static-fdiskbsdlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskbsdlabel.c' object='fdisk_static-fdiskbsdlabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdiskbsdlabel.o `test -f 'fdiskbsdlabel.c' || echo '$(srcdir)/'`fdiskbsdlabel.c
+
+fdisk_static-fdiskbsdlabel.obj: fdiskbsdlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdiskbsdlabel.obj -MD -MP -MF $(DEPDIR)/fdisk_static-fdiskbsdlabel.Tpo -c -o fdisk_static-fdiskbsdlabel.obj `if test -f 'fdiskbsdlabel.c'; then $(CYGPATH_W) 'fdiskbsdlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskbsdlabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdiskbsdlabel.Tpo $(DEPDIR)/fdisk_static-fdiskbsdlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskbsdlabel.c' object='fdisk_static-fdiskbsdlabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdiskbsdlabel.obj `if test -f 'fdiskbsdlabel.c'; then $(CYGPATH_W) 'fdiskbsdlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskbsdlabel.c'; fi`
+
+fdisk_static-fdisksgilabel.o: fdisksgilabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdisksgilabel.o -MD -MP -MF $(DEPDIR)/fdisk_static-fdisksgilabel.Tpo -c -o fdisk_static-fdisksgilabel.o `test -f 'fdisksgilabel.c' || echo '$(srcdir)/'`fdisksgilabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdisksgilabel.Tpo $(DEPDIR)/fdisk_static-fdisksgilabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksgilabel.c' object='fdisk_static-fdisksgilabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdisksgilabel.o `test -f 'fdisksgilabel.c' || echo '$(srcdir)/'`fdisksgilabel.c
+
+fdisk_static-fdisksgilabel.obj: fdisksgilabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdisksgilabel.obj -MD -MP -MF $(DEPDIR)/fdisk_static-fdisksgilabel.Tpo -c -o fdisk_static-fdisksgilabel.obj `if test -f 'fdisksgilabel.c'; then $(CYGPATH_W) 'fdisksgilabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksgilabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdisksgilabel.Tpo $(DEPDIR)/fdisk_static-fdisksgilabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksgilabel.c' object='fdisk_static-fdisksgilabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdisksgilabel.obj `if test -f 'fdisksgilabel.c'; then $(CYGPATH_W) 'fdisksgilabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksgilabel.c'; fi`
+
+fdisk_static-fdisksunlabel.o: fdisksunlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdisksunlabel.o -MD -MP -MF $(DEPDIR)/fdisk_static-fdisksunlabel.Tpo -c -o fdisk_static-fdisksunlabel.o `test -f 'fdisksunlabel.c' || echo '$(srcdir)/'`fdisksunlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdisksunlabel.Tpo $(DEPDIR)/fdisk_static-fdisksunlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksunlabel.c' object='fdisk_static-fdisksunlabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdisksunlabel.o `test -f 'fdisksunlabel.c' || echo '$(srcdir)/'`fdisksunlabel.c
+
+fdisk_static-fdisksunlabel.obj: fdisksunlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdisksunlabel.obj -MD -MP -MF $(DEPDIR)/fdisk_static-fdisksunlabel.Tpo -c -o fdisk_static-fdisksunlabel.obj `if test -f 'fdisksunlabel.c'; then $(CYGPATH_W) 'fdisksunlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksunlabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdisksunlabel.Tpo $(DEPDIR)/fdisk_static-fdisksunlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdisksunlabel.c' object='fdisk_static-fdisksunlabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdisksunlabel.obj `if test -f 'fdisksunlabel.c'; then $(CYGPATH_W) 'fdisksunlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdisksunlabel.c'; fi`
+
+fdisk_static-fdiskaixlabel.o: fdiskaixlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdiskaixlabel.o -MD -MP -MF $(DEPDIR)/fdisk_static-fdiskaixlabel.Tpo -c -o fdisk_static-fdiskaixlabel.o `test -f 'fdiskaixlabel.c' || echo '$(srcdir)/'`fdiskaixlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdiskaixlabel.Tpo $(DEPDIR)/fdisk_static-fdiskaixlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskaixlabel.c' object='fdisk_static-fdiskaixlabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdiskaixlabel.o `test -f 'fdiskaixlabel.c' || echo '$(srcdir)/'`fdiskaixlabel.c
+
+fdisk_static-fdiskaixlabel.obj: fdiskaixlabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdiskaixlabel.obj -MD -MP -MF $(DEPDIR)/fdisk_static-fdiskaixlabel.Tpo -c -o fdisk_static-fdiskaixlabel.obj `if test -f 'fdiskaixlabel.c'; then $(CYGPATH_W) 'fdiskaixlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskaixlabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdiskaixlabel.Tpo $(DEPDIR)/fdisk_static-fdiskaixlabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskaixlabel.c' object='fdisk_static-fdiskaixlabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdiskaixlabel.obj `if test -f 'fdiskaixlabel.c'; then $(CYGPATH_W) 'fdiskaixlabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskaixlabel.c'; fi`
+
+fdisk_static-fdiskmaclabel.o: fdiskmaclabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdiskmaclabel.o -MD -MP -MF $(DEPDIR)/fdisk_static-fdiskmaclabel.Tpo -c -o fdisk_static-fdiskmaclabel.o `test -f 'fdiskmaclabel.c' || echo '$(srcdir)/'`fdiskmaclabel.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdiskmaclabel.Tpo $(DEPDIR)/fdisk_static-fdiskmaclabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskmaclabel.c' object='fdisk_static-fdiskmaclabel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdiskmaclabel.o `test -f 'fdiskmaclabel.c' || echo '$(srcdir)/'`fdiskmaclabel.c
+
+fdisk_static-fdiskmaclabel.obj: fdiskmaclabel.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-fdiskmaclabel.obj -MD -MP -MF $(DEPDIR)/fdisk_static-fdiskmaclabel.Tpo -c -o fdisk_static-fdiskmaclabel.obj `if test -f 'fdiskmaclabel.c'; then $(CYGPATH_W) 'fdiskmaclabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskmaclabel.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-fdiskmaclabel.Tpo $(DEPDIR)/fdisk_static-fdiskmaclabel.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fdiskmaclabel.c' object='fdisk_static-fdiskmaclabel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-fdiskmaclabel.obj `if test -f 'fdiskmaclabel.c'; then $(CYGPATH_W) 'fdiskmaclabel.c'; else $(CYGPATH_W) '$(srcdir)/fdiskmaclabel.c'; fi`
+
+fdisk_static-partname.o: partname.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-partname.o -MD -MP -MF $(DEPDIR)/fdisk_static-partname.Tpo -c -o fdisk_static-partname.o `test -f 'partname.c' || echo '$(srcdir)/'`partname.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-partname.Tpo $(DEPDIR)/fdisk_static-partname.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='partname.c' object='fdisk_static-partname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-partname.o `test -f 'partname.c' || echo '$(srcdir)/'`partname.c
+
+fdisk_static-partname.obj: partname.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-partname.obj -MD -MP -MF $(DEPDIR)/fdisk_static-partname.Tpo -c -o fdisk_static-partname.obj `if test -f 'partname.c'; then $(CYGPATH_W) 'partname.c'; else $(CYGPATH_W) '$(srcdir)/partname.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-partname.Tpo $(DEPDIR)/fdisk_static-partname.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='partname.c' object='fdisk_static-partname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-partname.obj `if test -f 'partname.c'; then $(CYGPATH_W) 'partname.c'; else $(CYGPATH_W) '$(srcdir)/partname.c'; fi`
+
+fdisk_static-i386_sys_types.o: i386_sys_types.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-i386_sys_types.o -MD -MP -MF $(DEPDIR)/fdisk_static-i386_sys_types.Tpo -c -o fdisk_static-i386_sys_types.o `test -f 'i386_sys_types.c' || echo '$(srcdir)/'`i386_sys_types.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-i386_sys_types.Tpo $(DEPDIR)/fdisk_static-i386_sys_types.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='i386_sys_types.c' object='fdisk_static-i386_sys_types.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-i386_sys_types.o `test -f 'i386_sys_types.c' || echo '$(srcdir)/'`i386_sys_types.c
+
+fdisk_static-i386_sys_types.obj: i386_sys_types.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-i386_sys_types.obj -MD -MP -MF $(DEPDIR)/fdisk_static-i386_sys_types.Tpo -c -o fdisk_static-i386_sys_types.obj `if test -f 'i386_sys_types.c'; then $(CYGPATH_W) 'i386_sys_types.c'; else $(CYGPATH_W) '$(srcdir)/i386_sys_types.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-i386_sys_types.Tpo $(DEPDIR)/fdisk_static-i386_sys_types.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='i386_sys_types.c' object='fdisk_static-i386_sys_types.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-i386_sys_types.obj `if test -f 'i386_sys_types.c'; then $(CYGPATH_W) 'i386_sys_types.c'; else $(CYGPATH_W) '$(srcdir)/i386_sys_types.c'; fi`
+
+fdisk_static-gpt.o: gpt.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-gpt.o -MD -MP -MF $(DEPDIR)/fdisk_static-gpt.Tpo -c -o fdisk_static-gpt.o `test -f 'gpt.c' || echo '$(srcdir)/'`gpt.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-gpt.Tpo $(DEPDIR)/fdisk_static-gpt.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gpt.c' object='fdisk_static-gpt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-gpt.o `test -f 'gpt.c' || echo '$(srcdir)/'`gpt.c
+
+fdisk_static-gpt.obj: gpt.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-gpt.obj -MD -MP -MF $(DEPDIR)/fdisk_static-gpt.Tpo -c -o fdisk_static-gpt.obj `if test -f 'gpt.c'; then $(CYGPATH_W) 'gpt.c'; else $(CYGPATH_W) '$(srcdir)/gpt.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-gpt.Tpo $(DEPDIR)/fdisk_static-gpt.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gpt.c' object='fdisk_static-gpt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-gpt.obj `if test -f 'gpt.c'; then $(CYGPATH_W) 'gpt.c'; else $(CYGPATH_W) '$(srcdir)/gpt.c'; fi`
+
+fdisk_static-blkdev.o: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-blkdev.o -MD -MP -MF $(DEPDIR)/fdisk_static-blkdev.Tpo -c -o fdisk_static-blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-blkdev.Tpo $(DEPDIR)/fdisk_static-blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='fdisk_static-blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-blkdev.o `test -f '../lib/blkdev.c' || echo '$(srcdir)/'`../lib/blkdev.c
+
+fdisk_static-blkdev.obj: ../lib/blkdev.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-blkdev.obj -MD -MP -MF $(DEPDIR)/fdisk_static-blkdev.Tpo -c -o fdisk_static-blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-blkdev.Tpo $(DEPDIR)/fdisk_static-blkdev.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/blkdev.c' object='fdisk_static-blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-blkdev.obj `if test -f '../lib/blkdev.c'; then $(CYGPATH_W) '../lib/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/../lib/blkdev.c'; fi`
+
+fdisk_static-wholedisk.o: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-wholedisk.o -MD -MP -MF $(DEPDIR)/fdisk_static-wholedisk.Tpo -c -o fdisk_static-wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-wholedisk.Tpo $(DEPDIR)/fdisk_static-wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='fdisk_static-wholedisk.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-wholedisk.o `test -f '../lib/wholedisk.c' || echo '$(srcdir)/'`../lib/wholedisk.c
+
+fdisk_static-wholedisk.obj: ../lib/wholedisk.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-wholedisk.obj -MD -MP -MF $(DEPDIR)/fdisk_static-wholedisk.Tpo -c -o fdisk_static-wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-wholedisk.Tpo $(DEPDIR)/fdisk_static-wholedisk.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/wholedisk.c' object='fdisk_static-wholedisk.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-wholedisk.obj `if test -f '../lib/wholedisk.c'; then $(CYGPATH_W) '../lib/wholedisk.c'; else $(CYGPATH_W) '$(srcdir)/../lib/wholedisk.c'; fi`
+
+fdisk_static-linux_version.o: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-linux_version.o -MD -MP -MF $(DEPDIR)/fdisk_static-linux_version.Tpo -c -o fdisk_static-linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-linux_version.Tpo $(DEPDIR)/fdisk_static-linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='fdisk_static-linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-linux_version.o `test -f '../lib/linux_version.c' || echo '$(srcdir)/'`../lib/linux_version.c
+
+fdisk_static-linux_version.obj: ../lib/linux_version.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -MT fdisk_static-linux_version.obj -MD -MP -MF $(DEPDIR)/fdisk_static-linux_version.Tpo -c -o fdisk_static-linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fdisk_static-linux_version.Tpo $(DEPDIR)/fdisk_static-linux_version.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/linux_version.c' object='fdisk_static-linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fdisk_static_CFLAGS) $(CFLAGS) -c -o fdisk_static-linux_version.obj `if test -f '../lib/linux_version.c'; then $(CYGPATH_W) '../lib/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/../lib/linux_version.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man8: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(sbindir)" "$(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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool clean-sbinPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-sbinPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-man8 install-pdf install-pdf-am install-ps \
+	install-ps-am install-sbinPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-man uninstall-man8 \
+	uninstall-sbinPROGRAMS
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/fdisk/README.cfdisk b/util-linux-ng-2.17.2/fdisk/README.cfdisk
new file mode 100644
index 0000000..5241ad1
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/README.cfdisk
@@ -0,0 +1,45 @@
+Announcing the new curses based fdisk program... cfdisk
+
+cfdisk is a curses based disk drive partitioning program that can
+create partitions for a wide variety of operating systems including
+Linux, MS-DOS and OS/2.  cfdisk was inspired by the fdisk program, by
+A. V. Le Blanc (LeBlanc@mcc.ac.uk).  I hope that this program will be
+useful to both new and old Linux users, and I hope it will make the
+installation process easier.
+
+
+                           **** WARNING ****
+If you write a bad partition table to disk, it may destroy data and
+partitions.
+
+
+You can FTP cfdisk from ftp.cs.unc.edu in the /pub/martin/linux
+directory.
+
+I would also like comments (good and bad) on the user interface, logic
+and ease of use.  If you have any suggestions for improvements, I
+would be happy to hear them.
+
+My e-mail address is martin@cs.unc.edu.
+
+-------------------------------------------------------------------
+
+    Copyright (C) 1994 Kevin E. Martin (martin@cs.unc.edu)
+
+cfdisk 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.
+
+cfdisk 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 cfdisk; if not, write to the Free Software Foundation,
+Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+___
+Kevin E. Martin               University of North Carolina at Chapel Hill
+martin@cs.unc.edu                          Department of Computer Science
diff --git a/util-linux-ng-2.17.2/fdisk/README.fdisk b/util-linux-ng-2.17.2/fdisk/README.fdisk
new file mode 100644
index 0000000..69cfff6
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/README.fdisk
@@ -0,0 +1,583 @@
+`fdisk': the Linux partition table editor
+=========================================
+
+`fdisk' is the Linux partition table editor.  In this section we
+examine this utility and try to describe it thoroughly enough so that
+anyone can use it.
+
+* Contents:
+
+* Disks and how they are described.
+* Dividing up your disk.
+* The `fdisk' command.
+* Deleting and adding partitions.
+* Active flags and system types.
+* Extra commands for experts.
+* Warnings for `fdisk' users.
+
+
+Disks and how they are described
+--------------------------------
+
+A typical disk consists physically of one or more circular objects
+called "platters", which rotate about a central axis.  Devices called
+"heads" move to specified places on the disk surface to read or write
+information.  There is usually one head on each side of every platter,
+and all these heads are attached to a comb-like controller arm which
+moves all of them at the same time, either closer to the centre of the
+disk, or closer to the outer edge.
+
+Suppose the arm is in one position, putting an area of the disk
+surface within reach of one or another of the heads.  This total area,
+everything that is accessible without moving the arm, is called a
+"cylinder".  (A cylinder is a barrel-shaped cross section of a disk,
+consisting of a circular strip from each side of each platter.)  The
+part of a cylinder that one head can read or write without moving is
+called a "track".
+
+Each track is divided into several pie-shaped slices called
+"sectors", which are the smallest parts of the disk which can be read
+or written at a time.  The sectors on one disk are usually all the same
+size.
+
+In fact, there are not always two heads to every platter, there are
+some disks which do not have the same amount of data in every cylinder,
+and there may be disks which do not have the same amount of data in
+every sector.  These features are usually hidden on PCs by the
+controller card or the BIOS, which map the physical geometry of a disk
+onto a logical geometry, which is what is actually used to access the
+disk.
+
+The numbers which describe the "geometry" of a disk are
+
+  1. The number of cylinders it contains.
+
+  2. The number of tracks per cylinder, which is the number of heads.
+
+  3. The number of sectors per track.
+
+  4. The number of bytes per sector.
+
+These numbers vary from disk to disk, but a typical PC disk might
+have about 1000 cylinders, half a dozen heads, and 15 or 20 sectors per
+track, with each sector containing 512 bytes or characters; such a disk
+contains 40 to 60 megabytes of data.  A "double density" floppy disk
+contains 40 cylinders, with 2 heads (2 tracks per cylinder), and with 9
+sectors per track; such a disk contains 360 kilobytes, or 360 * 1024
+characters.  A "high density" 3.5 inch floppy contains 80 cylinders,
+with 2 heads and 18 sectors per track, or 1.44 megabytes, or 1440 *
+1024 characters.
+
+The exact size of a track or cylinder in bytes varies from one disk
+to another.  This `fdisk' for Linux deals mainly with cylinders, since
+this is the best unit to use when allocating space for partitions.  It
+reports partition sizes in "blocks" of 1024 bytes, or 2 sectors, since
+`mkswap' and the various `mkfs' programs require this number.  A block
+is the smallest amount of space which can be set aside for a file in
+the current file systems.
+
+An operating system, such as Linux or DOS or OS/2, may use a disk in
+any way that it wishes, but if two operating systems share the same
+disk, they must agree on who owns what, or else one will interfere with
+the other (that is, by damaging the other's files).  A "partition" is a
+section of a hard disk which is handled as a unit by all operating
+systems which can access the disk.  The standard way to define
+partitions (for the moment) is the "partition table", a list of
+information which is stored in parts of the disk that don't belong to
+any of the systems using the disk.  The beginning of the partition
+table is stored in the disk's primary boot sector, and the rest is
+stored in a chain of sectors scattered throughout the disk.
+
+The first sector on the disk is called the "primary boot block" or
+"primary boot sector" because (1) it comes first, before other, similar
+sectors; (2) it tells where the other, similar sectors are found, so
+that it is logically `prior' to them; and (3) it usually contains code
+which is executed when the system boots up.  This sector contains a
+table describing at most four partitions.  These areas are called
+"primary partitions".
+
+The partition table in the primary boot sector may also describe at
+most one "extended partition".  This is a large area of the disk,
+usually containing all the space which is not in any primary partition.
+Within this space we can set aside other areas which are called
+"logical partitions", because they look almost exactly like primary
+partitions.  In fact, the main difference between them is that we can
+boot from primary partitions, while we cannot boot from logical
+partitions.  This happens because the address of a primary partition is
+in a fixed place, whereas the address of a secondary partition is not,
+so we require a more complicated process to discover it, one which is
+too difficult for most primary boot programs.
+
+
+Dividing up your disk
+---------------------
+
+It is a good idea to plan ahead before you start creating partitions
+on your disk.  If you set aside a partition for some purpose, it is not
+easy to change its size: you must backup all the data from the partition,
+whether to floppies, to another partition, to another hard disk, or
+somewhere else; then you must edit the table which describes this
+partition, so changing its size; then you must reboot and initialise
+the new partition, formatting it, for example, under DOS, or running
+`mkfs' under Linux; finally you can copy all the data back.  It is
+possible, if you have several partitions, to copy data back and forth
+between them while you change their sizes, but this is a bit risky and
+time consuming.  It is better to plan ahead what you will need, since
+it is hard to change it afterwards.
+
+Many people with large disks and recent versions of DOS have their
+entire file system on one large partition.  They usually ask, `Isn't
+there any way I can reformat my disk without copying everything off?'
+There is no way to do it using standard DOS utilities, and there is no
+truly safe way to do it using commercial software, because, if you make
+a mistake, you will lose the entire contents of your disk.  If you are
+going to back up your disk anyway, you might as well copy the data back
+safely.  The Linux FAQ contains references to tools and procedures
+which will allow you to do this, if you dare.
+
+DOS and Linux both allow you to access several partitions on a
+single disk; on DOS these are treated as if they were separate disks or
+drives, and under Linux they are treated as different "devices".
+
+You can have up to 64 partitions on a single IDE disk, or up to 16
+partitions on a single SCSI disk, at least as far as Linux is
+concerned; in practice you will rarely want so many.  The maximum size
+of a Linux file system on a single partition depends on the type of
+file system you use.  Minix file systems are limited to 64 megabytes.
+You may have all of your Linux files in a single partition, or you may
+have two, three, or more Linux file systems.  Similarly you may have
+one or more DOS partitions.  If you have several small partitions, you
+run much less risk of losing all your files if your disk gets
+corrupted.  On the other hand, you may run out of space on a small
+partition more easily.
+
+Under DOS, you must refer to each partition by a separate drive
+letter, but all partitions are automatically accessible.  Under Linux
+only the root partition is automatically accessible, but once we mount
+another partition, it is indistinguishable from the rest of the file
+system.  Disks are usually mounted by a command in one of the system
+startup files, `/etc/rc', so you need not worry about having to do it
+yourself whenever you boot the system.  But even ordinary users may
+be allowed to mount removable hard disks and floppy disks.
+
+Linux requires at least one partition, which is the `root' of the
+file system.  You may prefer to have a separate partition for `/usr',
+which contains most of the executable files, or for `/home', which
+contains most of your private files.  You may also wish to set aside a
+partition to use for swap space, depending on the amount of memory your
+PC has.  You will certainly need swap space if you have less than 4 MB
+of RAM and wish to compile anything substantial.  You can reserve swap
+space in a file, but you need a partition big enough to hold it, and
+this will probably be less efficient than having a partition devoted to
+swap.
+
+The disk space you need for Linux is discussed in README.prepare.
+
+Are you going to boot Linux from the hard disk, or will you boot
+from a floppy?  Some boot programs place severe restrictions on where
+the boot partition can be.  LILO is more relaxed about this, but does
+require either the Master Boot Record on your first hard disk, or the
+boot record on one of the first four partitions on your first hard disk.
+
+If you have an extended partition with logical partitions in it, you
+can have only three primary partitions containing data.
+
+
+The `fdisk' command
+-------------------
+
+Every operating system, whether DOS, OS/2, or Linux, should provide
+its own utility for editing hard disk partition tables.  At least four
+of these utilities have been called `fdisk', for `Fixed DISK setup
+program', where `fixed' means `not removable'.  I believe the first PC
+program named `fdisk' came from Microsoft in about 1985; before that
+time disks were too small to divide into separate sections.
+
+Every operating system has its own peculiarities.  Normally you
+should set up a partition for the use of one operating system by using
+its own `fdisk' program.  Do not use the Linux `fdisk' to create
+partitions for DOS or for any system other than Linux; otherwise you
+may have problems.
+
+An `fdisk' program performs two functions: it reports how the disk is
+configured, and it changes that configuration by adding or deleting
+partitions.  Most `fdisk' programs can also change other information in
+partition tables.
+
+This `fdisk' for Linux operates on one hard disk at a time.  If you
+give the command
+
+     fdisk
+
+it reports on, and is able to change, `/dev/hda', the first hard
+disk.  (If you have no `/dev/hda', `fdisk' uses `/dev/sda' as the
+default device.) To look at or change the second hard disk, `/dev/hdb',
+give the command
+
+     fdisk /dev/hdb
+
+To look at or change the first SCSI disk, give the command
+
+     fdisk /dev/sda
+
+There are some special forms of the `fdisk' command.  One of them,
+suggested by Jim Winstead, simply lists all partitions on all available
+disks:
+
+     fdisk -l     (where `l' is a letter, not the digit `1')
+
+The option `-v' is provided to list the current version of the
+`fdisk' command.  Finally, there is an option `-s' which is not really
+intended for interactive use.  It causes fdisk to print the size of a
+partition in blocks of 1024 bytes as follows:
+
+     fdisk -s /dev/hda7
+     39934
+
+Because this is intended to be used by `mkfs' and `mkswap' programs,
+it does not return the size of extended partitions or of partitions
+whose system type code is less than 10 (hexadecimal a).  If you start
+`fdisk' without using one of these special options, it responds by
+asking for a command:
+
+     Command (m for help): _
+
+Each `fdisk' command consists of a single letter, which must be
+followed by <RETURN> before it is obeyed.  Upper and lower case are not
+distinguished.  Anything you type after the first character is ignored.
+Give the command `m', and you should see this menu:
+      Command action
+         a   toggle a bootable flag
+         d   delete a partition
+         l   list known partition types
+         m   print this menu
+         n   add a new partition
+         p   print the partition table
+         q   quit without saving changes
+         t   change a partition's system id
+         u   change display/entry units
+         v   verify the partition table
+         w   write table to disk and exit
+         x   extra functionality (experts only)
+     
+      Command (m for help): _
+
+The simplest commands are Print, Verify, and Quit.  On a small disk, the
+Print command might produce a display like this one:
+
+     Disk /dev/hda: 5 heads, 17 sectors, 977 cylinders
+     Units = cylinders of 85 * 512 bytes
+     
+        Device Boot  Begin   Start     End  Blocks   Id  System
+     /dev/hda1   *       1       1     236   10021+   1  DOS 12-bit FAT
+     /dev/hda2         837     837     977    5992+   5  Extended
+     /dev/hda3   *     237     237     836   25500   83  Linux native
+     /dev/hda5         837     837     936    4249+  82  Linux swap
+     /dev/hda6         942     942     977    1522    1  DOS 12-bit FAT
+
+There are 5 partitions reported; `/dev/hda4' does not appear because
+it is not allocated.  Partitions 1 and 3 are flagged as bootable.  The
+size of each partition is reported in 1 kilobyte blocks; hence the
+primary Linux partition, partition 3, is 25 1/2 megabytes in size.  The
+`+' after three of the sizes warns that these partitions contain an odd
+number of sectors: Linux normally allocates filespace in 1 kilobyte
+blocks, so the extra sector in partition 5 is wasted.  Id numbers are
+reported in hexadecimal and explained in English.
+
+The display/entry units may be either cylinders or sectors.  The
+default is cylinders, but changing the units makes the print command
+display the following table for the system reported above:
+
+     Disk /dev/hda: 5 heads, 17 sectors, 977 cylinders
+     Units = sectors of 1 * 512 bytes
+     
+        Device Boot  Begin   Start     End  Blocks   Id  System
+     /dev/hda1   *       1      17   20059   10021+   1  DOS 12-bit FAT
+     /dev/hda2       71060   71060   83044    5992+   5  Extended
+     /dev/hda3   *   20060   20060   71059   25500   83  Linux native
+     /dev/hda5       71061   71061   79559    4249+  82  Linux swap
+     /dev/hda6       79985   80001   83044    1522    1  DOS 12-bit FAT
+
+The start of data in both DOS partitions is 16 sectors after the
+beginning of the partition: this is one reason why you should use DOS's
+own `FDISK' to create DOS partitions.  Changing the units to sectors
+also affects the way in which the new partition command asks for the
+beginning and end of a new partition.
+
+*Warning*: it is dangerous to create a new partition when the
+display/entry units are sectors.
+
+The Verify command is useful because
+
+  1. It warns you if anything is wrong.  *Always* do a Verify command
+     to check your work before writing any changes to disk.
+
+  2. It reports how many unallocated sectors there are on the disk.
+
+The Quit command is also useful.  `fdisk' does not actually change
+any data on your disk unless you give a Write command.  If you are
+unhappy about any changes you may have made, give the Quit command, and
+your disk will remain as it was before you ran `fdisk'.  You can also
+interrupt `fdisk' with `CTRL-C'.
+
+
+Deleting and adding partitions
+------------------------------
+
+Deleting a partition is simple.  Give the Delete command by typing
+`d'.  `fdisk' asks:
+
+     Partition number (1-6): _
+
+Once you get this far, you must either delete a partition or
+interrupt the program with `CTRL-C' (or whatever your current interrupt
+character is).  Note:
+
+  1. You may delete a nonexistent partition.  You will get a warning
+     message.
+
+  2. You may delete an extended partition.  This has the side effect of
+     deleting all partitions greater than or equal to 5.
+
+  3. You may delete a logical partition.  In that case, all partitions
+     above it are renumbered at once.  For example, if you delete
+     partition 5, then partition 6 becomes known as partition 5, and
+     partition 7 as partition 6.
+
+Adding a partition is just a bit more complicated.  Give the New
+command by typing `n'.  `fdisk' allows you to
+
+  1. Create a primary partition, if there is a free slot in the primary
+     partition table.
+
+  2. Create an extended partition if there is a free slot in the
+     primary partition table, and if there is no extended partition.
+
+  3. Create a logical partition if an extended partition exists.
+
+If more than one of these actions is possible, you will be asked to
+select Primary, Extended, or Logical, depending on what is currently
+permissible.  Before you create a primary or an extended partition, you
+are asked what slot it is to have in the table (1-4).
+
+You may not add a primary or an extended partition if the selected
+slot in the primary partition table is already occupied: in that case
+you simply return to the main menu.  You are not allowed to add a new
+primary partition unless there are sectors available outside the
+extended partition.  You are not allowed to add a new logical partition
+unless there are sectors available inside the extended partition.
+
+If space is available, you are prompted for the first cylinder:
+
+     First cylinder ([237]-977): _
+
+The limits are the lowest and the highest cylinders in which sectors
+are available in the appropriate part of the disk.  The square-bracketed
+number is what you'll get if you simply press enter.  Not all numbers in
+this range are necessarily available: they may fall inside an existing
+partition.  If you select a cylinder which is already in use, you are
+told off and prompted again for the first cylinder.  After selecting the
+first cylinder, you are prompted again:
+
+     Last cylinder or +size or +sizeM or +sizeK (237-[836]): _
+
+The limits are the cylinder you have chosen as the first cylinder,
+and the highest cylinder which contains a legitimate upper boundary for
+the new partition.  The square-bracketed number is what you'll get if
+you simply press enter. In other words, all numbers in the given range are
+legitimate, unlike those in the first range of cylinders.  You may also
+specify the size of a partition in megabytes, kilobytes, or in the
+current units (cylinders or sectors).  A plus sign `+' indicates that
+your answer is a size rather than a boundary, and the suffix `m' or `k'
+(upper or lower case) indicates that the size is not given in units of
+sectors or cyliners, but in megabytes or kilobytes respectively.  Thus
+possible answers to the last cylinder request above are
+
+700
+     Make cylinder 700 the last cylinder in the partition.
+
++300
+     Make cylinder 237 + 300 = 537 the last cylinder in the partition.
+
++15m
+     Make the partition at least 15 megabytes in size.
+
++12500k
+     Make the partition at least 12,500 kilobytes in size.
+
+If you specify a size which is too large or an end which is out of
+range, fdisk complains and repeats the prompt.
+
+Adding or deleting partitions has no effect unless you subsequently
+give the Write command.  Please remember to give the Verify command
+first, just before giving the Write command: this is a safety
+precaution.  After giving the Write command, you will see this message:
+
+     The partition table has been altered!
+     Calling ioctl() to re-read partition table.
+     Syncing disks.
+
+If there are no further messages, the kernel has successfully copied
+the information from the partition table into its own internal table.
+But sometimes you will see a message like this one:
+
+     Re-read table failed with error 16: Device or resource busy.
+     Reboot your system to ensure the partition table is updated.
+
+In this case, depending on what you have changed in the partition
+table, it may be dangerous to continue working without rebooting,
+since you may lose or corrupt your data.
+
+
+Here are some important things to note:
+
+  1. Before you reboot, you *may* run `fdisk' again, either to manage
+     another disk, or to make additional changes to the same disk, or
+     just to check that the changes have been made as you expected.
+     This is true even after you receive the message warning you to
+     reboot.
+
+  2. It is not a good idea to run any of the programs `mkfs', `mkswap',
+     `mount', or `swapon' if you have received the warning message but
+     have not rebooted.  In this case it is dangerous to run any program,
+     but these in particular may cause serious damage to the data on your
+     disk, including the partition tables themselves.
+
+
+Active flags and system types
+-----------------------------
+
+The active flag is a bit in the partition table entry which marks a
+partition as bootable.  This is important to some primary boot sector
+programs, which will not boot from an unflagged partition.  Other such
+programs do not allow more than one partition to be flagged.  Some,
+like LILO, ignore the flags completely.  I prefer to flag all bootable
+partitions as active so that they stand out on the menu which `fdisk'
+lists.  Fdisk prints a star after the name of a partition's device file
+if its active flag is set.
+
+The Active command changes, or toggles, a partition's active flag.
+Give the Active command, and select a partition by number.  If it was
+marked inactive, it will be flagged as active; if it was flagged as
+active, it will be marked inactive.  You may set the active flag on an
+extended or logical partition, though the meaning of such a flag is by
+no means clear.  This can be used to install LILO as a secondary boot
+loader to boot a Linux which lives on a second hard disk.
+
+The Type command changes the ID number which describes what type a
+partition is.  `fdisk' currently recognises 30 system IDs, in the sense
+that it prints a string for each of them, but it allows you to change
+any system ID to any other, with the following exceptions: you may not
+change any partition to or from the type Extended, and you may not
+change a partition whose type is Empty (0) to any other type.  You may,
+however, change the type of any data partition to 0, which is
+equivalent to deleting it.
+
+The new system ID or type code is a hexadecimal number.  There are
+two ways of listing the numbers which `fdisk' recognises: use the List
+command, which prints the list, or use the Type command, which, when it
+prompts you for the code, says
+
+     Hex code (type L to list codes): _
+
+where the upper case `L' is used for clarity.  The codes printed are:
+Some of these numbers are a trifle uncertain.  By default `fdisk' uses
+a type of 83.  It used to use 81, the type code used by the MINIX
+`fdisk'.  It seemed prudent to change the default since (a) many Linux
+`minix' file systems are no longer compatible with MINIX, (b) the ext2
+file system, a native Linux file system, is fairly stable, as is the
+Xia file system, and (c) the number 81 causes problems with DR-DOS.
+Linux does not usually care what values you use for type codes, but
+other systems, in particular DOS, OS/2, and DR-DOS, may.
+
+The value of 82 for Linux swap partitions is my own invention, and
+is intended to give some recognisable distinction to the partitions
+when the values are displayed in hexadecimal.
+
+New active flags and new system type codes are not written to the
+disk until you exit from `fdisk' with the Write command, as described
+above, in the section on deleting and adding partitions.
+
+
+Extra commands for experts
+--------------------------
+
+The eXtra command `x' puts `fdisk' into `expert' mode, in which a
+slightly different set of commands is available.  The Active, Delete,
+List, New, Type, Verify, and `eXpert' commands are not available in
+expert mode.  The commands Write and Quit are available as in ordinary
+mode, the Print command is available, but produces output in a slightly
+different format, and of course the Menu command prints the expert
+menu.  There are several new commands.
+
+  1. The Return command brings you back to the main menu.
+
+  2. The Extended command prints the list of table entries which point
+     to other tables.  Ordinary users do not need this information.
+     The data is shown as it is stored.  The same format is used for
+     the expert Print command.
+
+  3. The dangerous Begin command allows you to move the start of data
+     in a partition away from its beginning.  Other systems create
+     partitions with this format, and it is sometimes useful to be able
+     to reproduce it.
+
+  4. The slightly dangerous Cylinders command allows you to change the
+     available number of cylinders.  For SCSI disk owners, note that we
+     require not the actual number of physical cylinders, but the
+     number of logical cylinders used by DOS and other operating
+     systems.
+
+  5. The extremely dangerous Heads and Sectors commands allow you to
+     change the number of heads and sectors.  It should not be
+     necessary to use these commands unless you have a SCSI disk, whose
+     geometry Linux is not always able to determine.  SCSI disk owners
+     note that we need not the actual number of heads or of sectors per
+     track, but the number believed to exist by DOS and other operating
+     systems.  *Warning*: If you set either of these numbers to a bad
+     value, you may lose all data on your disk.
+
+Always, after giving any of the commands Begin, Cylinder, Heads, or
+Sectors, you should Return to the main menu and give the Verify command.
+
+
+Warnings for `fdisk' users
+--------------------------
+
+In general, you should not use this `fdisk' program to create
+partitions for other operating systems, only for Linux.  Nor should you
+use `fdisk' commands from other operating systems to create partitions
+for Linux.
+
+DR-DOS 5.0 and 6.0 are reported to have difficulties with partition
+ID codes of 80 or more.  The Linux `fdisk' used to set the system type
+of new partitions to hexadecimal 81.  DR-DOS seems to confuse this with
+hexadecimal 1, a DOS code.  The values 82 for swap and 83 for file
+systems should not cause problems with DR-DOS.  If they do, you may use
+the `fdisk' command `t' to change the system code of any Linux
+partitions to some number less than hexadecimal 80; I suggest 42 and 43
+for the moment.
+
+Partitioning a hard disk may destroy data which is on that disk if you
+are not careful.  Go slowly, write down a description of the partition
+tables before you changed them, and always verify before you write.
+
+Most operating systems and utilities expect that all partitions begin and
+end at cylinder boundaries.  This version of `fdisk' does so by default,
+but you can use it to create partitions which begin or end anywhere.
+This does not normally affect Linux, but it is very dangerous, as other
+operating systems (including DOS) may try to `correct' the partition
+boundaries.
+
+It is dangerous to create a new partition when the display/entry
+units are sectors.
+
+The Verify command warns you if anything is wrong.  *Always* give a
+Verify command before writing any changes to disk.
+
+If you set the disk geometry (tracks per cylinder, or sectors per
+track) to an incorrect value, you may lose all data on your disk.
+
+Do create BSD/SUN and/or IRIX/SGI disk labels only when you are sure
+that you want them.  Both features are intended to allow you READing
+those labels and prevent unintentional formatting of these disks.
diff --git a/util-linux-ng-2.17.2/fdisk/cfdisk.8 b/util-linux-ng-2.17.2/fdisk/cfdisk.8
new file mode 100644
index 0000000..703ee19
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/cfdisk.8
@@ -0,0 +1,446 @@
+.\" cfdisk.8 -- man page for cfdisk
+.\" Copyright 1994 Kevin E. Martin (martin@cs.unc.edu)
+.\"
+.\" Permission is granted to make and distribute verbatim copies of this
+.\" manual provided the copyright notice and this permission notice are
+.\" preserved on all copies.
+.\"
+.\" Permission is granted to copy and distribute modified versions of this
+.\" manual under the conditions for verbatim copying, provided that the
+.\" entire resulting derived work is distributed under the terms of a
+.\" permission notice identical to this one.
+.\"
+.\" " for hilit mode
+.TH CFDISK 8 "3 June 1995" "The BOGUS Linux Release" "Linux Programmer's Manual"
+.SH NAME
+cfdisk \- Curses based disk partition table manipulator for Linux
+.SH SYNOPSIS
+.B cfdisk
+.RB [ \-agvz ]
+.RB [ \-c
+.IR cylinders ]
+.RB [ \-h
+.IR heads ]
+.RB [ \-s
+.IR sectors-per-track ]
+.RB [ \-P
+.IR opt ]
+.RI [ device ]
+.SH DESCRIPTION
+.B cfdisk
+is a curses based program for partitioning any hard disk drive.
+Typical values of the
+.I device
+argument are:
+.sp
+.nf
+.RS
+/dev/hda [default]
+/dev/hdb
+/dev/sda
+/dev/sdb
+/dev/sdc
+/dev/sdd
+.RE
+.fi
+
+In order to write the partition table
+.B cfdisk
+needs something called the `geometry' of the disk: the number
+of `heads' and the number of `sectors per track'. Linux does not
+use any geometry, so if the disk will not be accessed by other
+operating systems, you can safely accept the defaults that
+.B cfdisk
+chooses for you. The geometry used by
+.B cfdisk
+is found as follows. First the partition table is examined,
+to see what geometry was used by the previous program that
+changed it. If the partition table is empty, or contains garbage,
+or does not point at a consistent geometry, the kernel is
+asked for advice. If nothing works 255 heads and 63 sectors/track
+is assumed. The geometry can be overridden on the command line
+or by use of the `g' command. When partitioning an empty large modern
+disk, picking 255 heads and 63 sectors/track is always a good idea.
+There is no need to set the number of cylinders, since
+.B cfdisk
+knows the disk size.
+
+Next,
+.B cfdisk
+tries to read the current partition table from the disk drive.  If it
+is unable to figure out the partition table, an error is displayed and
+the program will exit.  This might also be caused by incorrect
+geometry information, and can be overridden on the command line.
+Another way around this problem is with the
+.B \-z
+option.  This will ignore the partition table on the disk.
+
+The main display is composed of four sections, from top to bottom: the
+header, the partitions, the command line and a warning line.  The
+header contains the program name and version number followed by the
+disk drive and its geometry.  The partitions section always displays
+the current partition table.  The command line is the place where
+commands and text are entered.  The available commands are usually
+displayed in brackets.  The warning line is usually empty except when
+there is important information to be displayed.  The current partition
+is highlighted with reverse video (or an arrow if the
+.B \-a
+option is given).  All partition specific commands apply to the
+current partition.
+
+The format of the partition table in the partitions section is, from
+left to right: Name, Flags, Partition Type, Filesystem Type and Size.
+The name is the partition device name.  The flags can be
+.IR Boot ,
+which designates a bootable partition or
+.IR NC ,
+which stands for "Not Compatible with DOS or OS/2".  DOS, OS/2 and
+possibly other operating systems require the first sector of the first
+partition on the disk and all logical partitions to begin on the
+second head.  This wastes the second through the last sector of the
+first track of the first head (the first sector is taken by the
+partition table itself).
+.B cfdisk
+allows you to recover these "lost" sectors with the maximize command
+.RB ( m ).
+.I Note:
+.BR fdisk (8)
+and some early versions of DOS create all partitions with the number
+of sectors already maximized.  For more information, see the maximize
+command below.  The partition type can be one of
+.IR Primary " or " Logical .
+For unallocated space on the drive, the partition type can also be
+.IR Pri/Log ,
+or empty (if the space is unusable).  The filesystem type section
+displays the name of the filesystem used on the partition, if known.
+If it is unknown, then
+.I Unknown
+and the hex value of the filesystem type are displayed.  A special
+case occurs when there are sections of the disk drive that cannot be
+used (because all of the primary partitions are used).  When this is
+detected, the filesystem type is displayed as
+.IR Unusable .
+The size field displays the size of the partition in megabytes (by
+default).  It can also display the size in sectors and cylinders (see
+the change units command below).  If an asterisk
+.RB ( * )
+appears after the size, this means that the partition is not aligned
+on cylinder boundaries.
+.SH "DOS 6.x WARNING"
+
+The DOS 6.x FORMAT command looks for some information in the first
+sector of the data area of the partition, and treats this information
+as more reliable than the information in the partition table.  DOS
+FORMAT expects DOS FDISK to clear the first 512 bytes of the data area
+of a partition whenever a size change occurs.  DOS FORMAT will look at
+this extra information even if the /U flag is given -- we consider
+this a bug in DOS FORMAT and DOS FDISK.
+
+The bottom line is that if you use cfdisk or fdisk to change the size of a
+DOS partition table entry, then you must also use
+.B dd
+to zero the first 512 bytes of that partition before using DOS FORMAT to
+format the partition.  For example, if you were using cfdisk to make a DOS
+partition table entry for /dev/hda1, then (after exiting fdisk or cfdisk
+and rebooting Linux so that the partition table information is valid) you
+would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero
+the first 512 bytes of the partition. Note:
+
+.B BE EXTREMELY CAREFUL
+if you use the
+.B dd
+command, since a small typo can make all of the data on your disk useless.
+
+For best results, you should always use an OS-specific partition table
+program.  For example, you should make DOS partitions with the DOS FDISK
+program and Linux partitions with the Linux fdisk or Linux cfdisk program.
+
+.SH COMMANDS
+.B cfdisk
+commands can be entered by pressing the desired key (pressing
+.I Enter
+after the command is not necessary).  Here is a list of the available
+commands:
+.TP
+.B b
+Toggle bootable flag of the current partition.  This allows you to
+select which primary partition is bootable on the drive.
+.TP
+.B d
+Delete the current partition.  This will convert the current partition
+into free space and merge it with any free space immediately
+surrounding the current partition.  A partition already marked as free
+space or marked as unusable cannot be deleted.
+.TP
+.B g
+Change the disk geometry (cylinders, heads, or sectors-per-track).
+.B WARNING:
+This option should only be used by people who know what they are
+doing.  A command line option is also available to change the disk
+geometry.  While at the change disk geometry command line, you can
+choose to change cylinders
+.RB ( c ),
+heads
+.RB ( h ),
+and sectors per track
+.RB ( s ).
+The default value will be printed at the prompt which you can accept
+by simply pressing the
+.I Enter
+key, or you can exit without changes by pressing the
+.I ESC
+key.  If you want to change the default value, simply enter the
+desired value and press
+.IR Enter .
+The altered disk parameter values do not take effect until you return
+to the main menu (by pressing
+.IR Enter " or " ESC
+at the change disk geometry command line).  If you change the geometry
+such that the disk appears larger, the extra sectors are added at the
+end of the disk as free space.  If the disk appears smaller, the
+partitions that are beyond the new last sector are deleted and the
+last partition on the drive (or the free space at the end of the
+drive) is made to end at the new last sector.
+.TP
+.B h
+Print the help screen.
+.TP
+.B m
+Maximize disk usage of the current partition.  This command will
+recover the unused space between the partition table and the
+beginning of the partition, but at the cost of making the partition
+incompatible with DOS, OS/2 and possibly other operating systems.
+This option will toggle between maximal disk usage and DOS, OS/2,
+etc. compatible disk usage.  The default when creating a partition is
+to create DOS, OS/2, etc. compatible partitions.
+.TP
+.B n
+Create new partition from free space.  If the partition type is
+.IR Primary " or " Logical ,
+a partition of that type will be created, but if the partition type is
+.IR Pri/Log ,
+you will be prompted for the type you want to create.  Be aware that
+(1) there are only four slots available for primary partitions and (2)
+since there can be only one extended partition, which contains all of
+the logical drives, all of the logical drives must be contiguous (with
+no intervening primary partition).
+.B cfdisk
+next prompts you for the size of the partition you want to create.
+The default size, equal to the entire free space of the current
+partition, is displayed in megabytes.  You can either press the
+.I Enter
+key to accept the default size or enter a different size at the
+prompt.
+.B cfdisk
+accepts size entries in megabytes
+.RB ( M )
+[default], kilobytes
+.RB ( K ),
+cylinders
+.RB ( C )
+and sectors
+.RB ( S )
+by entering the number immediately followed by one of
+.RB ( M ", " K ", " C " or " S ).
+If the partition fills the free space available, the partition is
+created and you are returned to the main command line.  Otherwise, the
+partition can be created at the beginning or the end of the free
+space, and
+.B cfdisk
+will ask you to choose where to place the partition.  After the
+partition is created,
+.B cfdisk
+automatically adjusts the other partitions' partition types if all of
+the primary partitions are used.
+.TP
+.B p
+Print the partition table to the screen or to a file. There are
+several different formats for the partition that you can choose from:
+.sp
+.RS
+.TP
+.B r
+Raw data format (exactly what would be written to disk)
+.TP
+.B s
+Partition table in sector order format
+.TP
+.B t
+Partition table in raw format
+.RE
+
+.RS
+The
+.I raw data format
+will print the sectors that would be written to disk if a
+.BR w rite
+command is selected.  First, the primary partition table is printed,
+followed by the partition tables associated with each logical
+partition.  The data is printed in hex byte by byte with 16 bytes per
+line.
+
+The
+.I partition table in sector order format
+will print the partition table ordered by sector number.  The fields,
+from left to right, are the number of the partition, the partition
+type, the first sector, the last sector, the offset from the first
+sector of the partition to the start of the data, the length of the
+partition, the filesystem type (with the hex value in parenthesis),
+and the flags (with the hex value in parenthesis).  In addition to the
+primary and logical partitions, free and unusable space is printed and
+the extended partition is printed before the first logical partition.
+
+If a partition does not start or end on a cylinder boundary or if the
+partition length is not divisible by the cylinder size, an asterisk
+.RB ( * )
+is printed after the non-aligned sector number/count.  This usually
+indicates that a partition was created by an operating system that
+either does not align partitions to cylinder boundaries or that used
+different disk geometry information.  If you know the disk geometry of
+the other operating system, you could enter the geometry information
+with the change geometry command
+.RB ( g ).
+
+For the first partition on the disk and for all logical partitions, if
+the offset from the beginning of the partition is not equal to the
+number of sectors per track (i.e., the data does not start on the
+first head), a number sign
+.RB ( # )
+is printed after the offset.  For the remaining partitions, if the
+offset is not zero, a number sign will be printed after the offset.
+This corresponds to the
+.I NC
+flag in the partitions section of the main display.
+
+The
+.I partition table in raw format
+will print the partition table ordered by partition number.  It will
+leave out all free and unusable space.  The fields, from left to
+right, are the number of the partition, the flags (in hex), the
+starting head, sector and cylinder, the filesystem ID (in hex), the
+ending head, sector and cylinder, the starting sector in the partition
+and the number of sectors in the partition.  The information in this
+table can be directly translated to the
+.IR "raw data format" .
+
+The partition table entries only have 10 bits available to represent
+the starting and ending cylinders.  Thus, when the absolute starting
+(ending) sector number is on a cylinder greater than 1023, the maximal
+values for starting (ending) head, sector and cylinder are printed.
+This is the method used by OS/2, and thus fixes the problems
+associated with OS/2's fdisk rewriting the partition table when it is
+not in this format.  Since Linux and OS/2 use absolute sector counts,
+the values in the starting and ending head, sector and cylinder are
+not used.
+.RE
+.TP
+.B q
+Quit program.  This will exit the program without writing any data to
+disk.
+.TP
+.B t
+Change the filesystem type.  By default, new partitions are created as
+.I Linux
+partitions, but since
+.B cfdisk
+can create partitions for other operating systems, change partition
+type allows you to enter the hex value of the filesystem you desire.
+A list of the know filesystem types is displayed.  You can type in the
+filesystem type at the prompt or accept the default filesystem type
+.RI [ Linux ].
+.TP
+.B u
+Change units of the partition size display.  It will rotate through
+megabytes, sectors and cylinders.
+.TP
+.B W
+Write partition table to disk (must enter an upper case W).  Since
+this might destroy data on the disk, you must either confirm or deny
+the write by entering `yes' or `no'.  If you enter `yes',
+.B cfdisk
+will write the partition table to disk and the tell the kernel to re-read the
+partition table from the disk.  The re-reading of the partition table does not
+work in some cases, for example for device-mapper devices.  In
+particular case you need to inform kernel about new
+partitions by
+.B partprobe(8),
+.B kpartx(8)
+or reboot the system.
+.TP
+.I Up Arrow
+.TP
+.I Down Arrow
+Move cursor to the previous or next partition.  If there are more
+partitions than can be displayed on a screen, you can display the next
+(previous) set of partitions by moving down (up) at the last (first)
+partition displayed on the screen.
+.TP
+.I CTRL-L
+Redraws the screen.  In case something goes wrong and you cannot read
+anything, you can refresh the screen from the main command line.
+.TP
+.B ?
+Print the help screen.
+
+.RE
+All of the commands can be entered with either upper or lower case
+letters (except for
+.BR W rites).
+When in a sub-menu or at a prompt to enter a filename, you can hit the
+.I ESC
+key to return to the main command line.
+.SH OPTIONS
+.TP
+.B \-a
+Use an arrow cursor instead of reverse video for highlighting the
+current partition.
+.TP
+.B \-g
+Do not use the geometry given by the disk driver, but try to
+guess a geometry from the partition table.
+.TP
+.B \-v
+Print the version number and copyright.
+.TP
+.B \-z
+Start with zeroed partition table.  This option is useful when you
+want to repartition your entire disk.
+.I Note:
+this option does not zero the partition table on the disk; rather, it
+simply starts the program without reading the existing partition
+table.
+.TP
+.BI \-c " cylinders"
+.TP
+.BI \-h " heads"
+.TP
+.BI \-s " sectors-per-track"
+Override the number of cylinders, heads and sectors per track read
+from the BIOS.  If your BIOS or adapter does not supply this
+information or if it supplies incorrect information, use these options
+to set the disk geometry values.
+.TP
+.BI \-P " opt"
+Prints the partition table in specified formats.
+.I opt
+can be one or more of "r", "s" or "t".  See the
+.BR p rint
+command (above) for more information on the print formats.
+.SH "EXIT STATUS"
+0: No errors; 1: Invocation error; 2: I/O error;
+3: cannot get geometry; 4: bad partition table on disk.
+.SH "SEE ALSO"
+.BR fdisk (8),
+.BR sfdisk (8),
+.BR mkfs (8),
+.BR parted (8),
+.BR partprobe (8),
+.BR kpartx(8)
+.SH BUGS
+The current version does not support multiple disks.
+.SH AUTHOR
+Kevin E. Martin (martin@cs.unc.edu)
+
+.SH AVAILABILITY
+The cfdisk command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/fdisk/cfdisk.c b/util-linux-ng-2.17.2/fdisk/cfdisk.c
new file mode 100644
index 0000000..4fb4152
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/cfdisk.c
@@ -0,0 +1,3031 @@
+/****************************************************************************
+ *
+ *     CFDISK
+ *
+ * cfdisk is a curses based disk drive partitioning program that can
+ * create partitions for a wide variety of operating systems including
+ * Linux, MS-DOS and OS/2.
+ *
+ * cfdisk was inspired by the fdisk program, by A. V. Le Blanc
+ * (LeBlanc@mcc.ac.uk).
+ *
+ *     Copyright (C) 1994 Kevin E. Martin (martin@cs.unc.edu)
+ *
+ * cfdisk 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.
+ *
+ * cfdisk 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 cfdisk; if not, write to the Free Software Foundation,
+ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Created:	Fri Jan 28 22:46:58 1994, martin@cs.unc.edu
+ * >2GB patches: Sat Feb 11 09:08:10 1995, faith@cs.unc.edu
+ * Prettier menus: Sat Feb 11 09:08:25 1995, Janne Kukonlehto
+ *                                           <jtklehto@stekt.oulu.fi>
+ * Versions 0.8e-p: aeb@cwi.nl
+ * Rebaptised 2.9p, following util-linux versioning.
+ *
+ *  Recognition of NTFS / HPFS difference inspired by patches
+ *  from Marty Leisner <leisner@sdsp.mc.xerox.com>
+ *  Exit codes by Enrique Zanardi <ezanardi@ull.es>:
+ *     0: all went well
+ *     1: command line error, out of memory
+ *     2: hardware problems [Cannot open/seek/read/write disk drive].
+ *     3: ioctl(fd, HDIO_GETGEO,...) failed. (Probably it is not a disk.)
+ *     4: bad partition table on disk. [Bad primary/logical partition].
+ *
+ * Sat, 23 Jan 1999 19:34:45 +0100 <Vincent.Renardias@ldsol.com>
+ *  Internationalized + provided initial French translation.
+ * Sat Mar 20 09:26:34 EST 1999 <acme@conectiva.com.br>
+ *  Some more i18n.
+ * Sun Jul 18 03:19:42 MEST 1999 <aeb@cwi.nl>
+ *  Terabyte-sized disks.
+ * Sat Jun 30 05:23:19 EST 2001 <nathans@sgi.com>
+ *  XFS label recognition.
+ * Thu Nov 22 15:42:56 CET 2001 <flavio.stanchina@tin.it>
+ *  ext3 and ReiserFS recognition.
+ * Sun Oct 12 17:43:43 CEST 2003 <flavio.stanchina@tin.it>
+ *  JFS recognition; ReiserFS label recognition.
+ *
+ ****************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <errno.h>
+#include <getopt.h>
+#include <fcntl.h>
+#ifdef HAVE_SLCURSES_H
+#include <slcurses.h>
+#elif defined(HAVE_SLANG_SLCURSES_H)
+#include <slang/slcurses.h>
+#elif defined(HAVE_NCURSES_H)
+#include <ncurses.h>
+#elif defined(HAVE_NCURSES_NCURSES_H)
+#include <ncurses/ncurses.h>
+#endif
+#include <signal.h>
+#include <math.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+
+#include "nls.h"
+#include "blkdev.h"
+#include "xstrncpy.h"
+#include "common.h"
+#include "gpt.h"
+
+#ifdef __GNU__
+#define DEFAULT_DEVICE "/dev/hd0"
+#define ALTERNATE_DEVICE "/dev/sd0"
+#elif defined(__FreeBSD__)
+#define DEFAULT_DEVICE "/dev/ad0"
+#define ALTERNATE_DEVICE "/dev/da0"
+#else
+#define DEFAULT_DEVICE "/dev/hda"
+#define ALTERNATE_DEVICE "/dev/sda"
+#endif
+
+/* With K=1024 we have `binary' megabytes, gigabytes, etc.
+   Some misguided hackers like that.
+   With K=1000 we have MB and GB that follow the standards
+   [SI, ATA, IEEE etc] and the disk manufacturers and the law. */
+#define K	1000
+
+#define LINE_LENGTH 80
+#define MAXIMUM_PARTS 60
+
+#define SECTOR_SIZE 512
+
+#define MAX_HEADS 256
+#define MAX_SECTORS 63
+
+#define ACTIVE_FLAG 0x80
+#define PART_TABLE_FLAG0 0x55
+#define PART_TABLE_FLAG1 0xAA
+
+#define UNUSABLE -1
+#define FREE_SPACE     0x00
+#define DOS_EXTENDED   0x05
+#define OS2_OR_NTFS    0x07
+#define WIN98_EXTENDED 0x0f
+#define LINUX_EXTENDED 0x85
+#define LINUX_MINIX    0x81
+#define LINUX_SWAP     0x82
+#define LINUX          0x83
+
+#define PRI_OR_LOG -1
+#define PRIMARY -2
+#define LOGICAL -3
+
+#define COL_ID_WIDTH 25
+
+#define CR '\015'
+#define ESC '\033'
+#define DEL '\177'
+#define BELL '\007'
+#define TAB '\011'
+#define REDRAWKEY '\014'	/* ^L */
+#define UPKEY '\020'		/* ^P */
+#define UPKEYVI '\153'		/* k */
+#define DOWNKEY '\016'		/* ^N */
+#define DOWNKEYVI '\152'	/* j */
+
+/* Display units */
+#define GIGABYTES 1
+#define MEGABYTES 2
+#define SECTORS 3
+#define CYLINDERS 4
+
+#define GS_DEFAULT -1
+#define GS_ESCAPE -2
+
+#define PRINT_RAW_TABLE 1
+#define PRINT_SECTOR_TABLE 2
+#define PRINT_PARTITION_TABLE 4
+
+#define IS_PRIMARY(p) ((p) >= 0 && (p) < 4)
+#define IS_LOGICAL(p) ((p) > 3)
+
+#define round_int(d) ((double)((int)(d+0.5)))
+#define ceiling(d) ((double)(((d) != (int)(d)) ? (int)(d+1.0) : (int)(d)))
+
+struct partition {
+        unsigned char boot_ind;         /* 0x80 - active */
+        unsigned char head;             /* starting head */
+        unsigned char sector;           /* starting sector */
+        unsigned char cyl;              /* starting cylinder */
+        unsigned char sys_ind;          /* What partition type */
+        unsigned char end_head;         /* end head */
+        unsigned char end_sector;       /* end sector */
+        unsigned char end_cyl;          /* end cylinder */
+        unsigned char start4[4];        /* starting sector counting from 0 */
+        unsigned char size4[4];         /* nr of sectors in partition */
+};
+
+int heads = 0;
+int sectors = 0;
+long long cylinders = 0;
+int cylinder_size = 0;		/* heads * sectors */
+long long total_size = 0;	/* actual_size rounded down */
+long long actual_size = 0;	/* (in 512-byte sectors) - set using ioctl */
+				/* explicitly given user values */
+int user_heads = 0, user_sectors = 0;
+long long user_cylinders = 0;
+				/* kernel values; ignore the cylinders */
+int kern_heads = 0, kern_sectors = 0;
+				/* partition-table derived values */
+int pt_heads = 0, pt_sectors = 0;
+
+
+static void
+set_hsc0(unsigned char *h, unsigned char *s, int *c, long long sector) {
+	*s = sector % sectors + 1;
+	sector /= sectors;
+	*h = sector % heads;
+	sector /= heads;
+	*c = sector;
+}
+
+static void
+set_hsc(unsigned char *h, unsigned char *s, unsigned char *c,
+	long long sector) {
+	int cc;
+
+	if (sector >= 1024*cylinder_size)
+		sector = 1024*cylinder_size - 1;
+	set_hsc0(h, s, &cc, sector);
+	*c = cc & 0xFF;
+	*s |= (cc >> 2) & 0xC0;
+}
+
+static void
+set_hsc_begin(struct partition *p, long long sector) {
+	set_hsc(& p->head, & p->sector, & p->cyl, sector);
+}
+
+static void
+set_hsc_end(struct partition *p, long long sector) {
+	set_hsc(& p->end_head, & p->end_sector, & p->end_cyl, sector);
+}
+
+#define is_extended(x)	((x) == DOS_EXTENDED || (x) == WIN98_EXTENDED || \
+			 (x) == LINUX_EXTENDED)
+
+#define is_dos_partition(x) ((x) == 1 || (x) == 4 || (x) == 6)
+#define may_have_dos_label(x) (is_dos_partition(x) \
+   || (x) == 7 || (x) == 0xb || (x) == 0xc || (x) == 0xe \
+   || (x) == 0x11 || (x) == 0x14 || (x) == 0x16 || (x) == 0x17)
+
+/* start_sect and nr_sects are stored little endian on all machines */
+/* moreover, they are not aligned correctly */
+static void
+store4_little_endian(unsigned char *cp, unsigned int val) {
+	cp[0] = (val & 0xff);
+	cp[1] = ((val >> 8) & 0xff);
+	cp[2] = ((val >> 16) & 0xff);
+	cp[3] = ((val >> 24) & 0xff);
+}
+
+static unsigned int
+read4_little_endian(unsigned char *cp) {
+	return (unsigned int)(cp[0]) + ((unsigned int)(cp[1]) << 8)
+		+ ((unsigned int)(cp[2]) << 16)
+		+ ((unsigned int)(cp[3]) << 24);
+}
+
+static void
+set_start_sect(struct partition *p, unsigned int start_sect) {
+	store4_little_endian(p->start4, start_sect);
+}
+
+static unsigned int
+get_start_sect(struct partition *p) {
+	return read4_little_endian(p->start4);
+}
+
+static void
+set_nr_sects(struct partition *p, unsigned int nr_sects) {
+	store4_little_endian(p->size4, nr_sects);
+}
+
+static unsigned int
+get_nr_sects(struct partition *p) {
+	return read4_little_endian(p->size4);
+}
+
+#define ALIGNMENT 2
+typedef union {
+    struct {
+	unsigned char align[ALIGNMENT];
+	unsigned char b[SECTOR_SIZE];
+    } c;
+    struct {
+	unsigned char align[ALIGNMENT];
+	unsigned char buffer[0x1BE];
+	struct partition part[4];
+	unsigned char magicflag[2];
+    } p;
+} partition_table;
+
+typedef struct {
+    long long first_sector;	/* first sector in partition */
+    long long last_sector;	/* last sector in partition */
+    long offset;		/* offset from first sector to start of data */
+    int flags;		/* active == 0x80 */
+    int id;		/* filesystem type */
+    int num;		/* number of partition -- primary vs. logical */
+#define LABELSZ 16
+    char volume_label[LABELSZ+1];
+#define OSTYPESZ 8
+    char ostype[OSTYPESZ+1];
+#define FSTYPESZ 8
+    char fstype[FSTYPESZ+1];
+} partition_info;
+
+char *disk_device = DEFAULT_DEVICE;
+int fd;
+int changed = FALSE;
+int opened = FALSE;
+int opentype;
+int curses_started = 0;
+
+partition_info p_info[MAXIMUM_PARTS];
+partition_info ext_info;
+int num_parts = 0;
+
+int logical = 0;
+long long logical_sectors[MAXIMUM_PARTS];
+
+__sighandler_t old_SIGINT, old_SIGTERM;
+
+int arrow_cursor = FALSE;
+int display_units = MEGABYTES;
+int zero_table = FALSE;
+int use_partition_table_geometry = FALSE;
+int print_only = 0;
+
+/* Curses screen information */
+int cur_part = 0;
+int warning_last_time = FALSE;
+int defined = FALSE;
+int COLUMNS = 80;
+int NUM_ON_SCREEN = 1;
+
+/* Y coordinates */
+int HEADER_START = 0;
+int DISK_TABLE_START = 6;
+int WARNING_START = 23;
+int COMMAND_LINE_Y = 21;
+
+/* X coordinates */
+int NAME_START = 4;
+int FLAGS_START = 16;
+int PTYPE_START = 28;
+int FSTYPE_START = 38;
+int LABEL_START = 54;
+int SIZE_START = 68;
+int COMMAND_LINE_X = 5;
+
+static void die_x(int ret);
+static void draw_screen(void);
+
+/* Guaranteed alloc */
+static void *
+xmalloc (size_t size) {
+     void *t;
+
+     if (size == 0)
+          return NULL;
+
+     t = malloc (size);
+     if (t == NULL) {
+          fprintf (stderr, _("%s: Out of memory!\n"), "cfdisk");
+	  die_x(1);
+     }
+     return t;
+}
+
+/* Some libc's have their own basename() */
+static char *
+my_basename(char *devname) {
+    char *s = strrchr(devname, '/');
+    return s ? s+1 : devname;
+}
+
+static char *
+partition_type_name(unsigned char type) {
+    struct systypes *s = i386_sys_types;
+
+    while(s->name && s->type != type)
+	    s++;
+    return s->name;
+}
+
+static char *
+partition_type_text(int i) {
+    if (p_info[i].id == UNUSABLE)
+	 return _("Unusable");
+    else if (p_info[i].id == FREE_SPACE)
+	 return _("Free Space");
+    else if (p_info[i].id == LINUX) {
+	 if (!strcmp(p_info[i].fstype, "ext2"))
+	      return _("Linux ext2");
+	 else if (!strcmp(p_info[i].fstype, "ext3"))
+	      return _("Linux ext3");
+	 else if (!strcmp(p_info[i].fstype, "xfs"))
+	      return _("Linux XFS");
+	 else if (!strcmp(p_info[i].fstype, "jfs"))
+	      return _("Linux JFS");
+	 else if (!strcmp(p_info[i].fstype, "reiserfs"))
+	      return _("Linux ReiserFS");
+	 else
+	      return _("Linux");
+    } else if (p_info[i].id == OS2_OR_NTFS) {
+	 if (!strncmp(p_info[i].fstype, "HPFS", 4))
+	      return _("OS/2 HPFS");
+	 else if (!strncmp(p_info[i].ostype, "OS2", 3))
+	      return _("OS/2 IFS");
+	 else if (!p_info[i].ostype)
+	      return p_info[i].ostype;
+	 else
+	      return _("NTFS");
+    } else
+	 return _(partition_type_name(p_info[i].id));
+}
+
+static void
+fdexit(int ret) {
+    if (opened) {
+	if (changed)
+		fsync(fd);
+	close(fd);
+    }
+    if (changed) {
+	fprintf(stderr, _("Disk has been changed.\n"));
+#if 0
+	fprintf(stderr, _("Reboot the system to ensure the partition "
+			"table is correctly updated.\n"));
+#endif
+
+	fprintf( stderr, _("\nWARNING: If you have created or modified any\n"
+		         "DOS 6.x partitions, please see the cfdisk manual\n"
+		         "page for additional information.\n") );
+    }
+
+    exit(ret);
+}
+
+static int
+get_string(char *str, int len, char *def) {
+    unsigned char c;
+    int i = 0;
+    int x, y;
+    int use_def = FALSE;
+
+    getyx(stdscr, y, x);
+    clrtoeol();
+
+    str[i] = 0;
+
+    if (def != NULL) {
+	mvaddstr(y, x, def);
+	move(y, x);
+	use_def = TRUE;
+    }
+
+    refresh();
+    while ((c = getch()) != '\n' && c != CR) {
+	switch (c) {
+	case ESC:
+	    move(y, x);
+	    clrtoeol();
+	    refresh();
+	    return GS_ESCAPE;
+	case DEL:
+	case '\b':
+	    if (i > 0) {
+		str[--i] = 0;
+		mvaddch(y, x+i, ' ');
+		move(y, x+i);
+	    } else if (use_def) {
+		clrtoeol();
+		use_def = FALSE;
+	    } else
+		putchar(BELL);
+	    break;
+	default:
+	    if (i < len && isprint(c)) {
+		mvaddch(y, x+i, c);
+		if (use_def) {
+		    clrtoeol();
+		    use_def = FALSE;
+		}
+		str[i++] = c;
+		str[i] = 0;
+	    } else
+		putchar(BELL);
+	}
+	refresh();
+    }
+
+    if (use_def)
+	return GS_DEFAULT;
+    else
+	return i;
+}
+
+static void
+clear_warning(void) {
+    int i;
+
+    if (!curses_started || !warning_last_time)
+	return;
+
+    move(WARNING_START,0);
+    for (i = 0; i < COLS; i++)
+	addch(' ');
+
+    warning_last_time = FALSE;
+}
+
+static void
+print_warning(char *s) {
+    if (!curses_started) {
+	 fprintf(stderr, "%s\n", s);
+    } else {
+	mvaddstr(WARNING_START, (COLS-strlen(s))/2, s);
+	putchar(BELL); /* CTRL-G */
+
+	warning_last_time = TRUE;
+    }
+}
+
+static void
+fatal(char *s, int ret) {
+    char *err1 = _("FATAL ERROR");
+    char *err2 = _("Press any key to exit cfdisk");
+
+    if (curses_started) {
+	 char *str = xmalloc(strlen(s) + strlen(err1) + strlen(err2) + 10);
+
+	 sprintf(str, "%s: %s", err1, s);
+	 if (strlen(str) > COLS)
+	     str[COLS] = 0;
+	 mvaddstr(WARNING_START, (COLS-strlen(str))/2, str);
+	 sprintf(str, "%s", err2);
+	 if (strlen(str) > COLS)
+	     str[COLS] = 0;
+	 mvaddstr(WARNING_START+1, (COLS-strlen(str))/2, str);
+	 putchar(BELL); /* CTRL-G */
+	 refresh();
+	 (void)getch();
+	 die_x(ret);
+    } else {
+	 fprintf(stderr, "%s: %s\n", err1, s);
+	 exit(ret);
+    }
+}
+
+static void
+die(int dummy) {
+    die_x(0);
+}
+
+static void
+die_x(int ret) {
+    signal(SIGINT, old_SIGINT);
+    signal(SIGTERM, old_SIGTERM);
+#if defined(HAVE_SLCURSES_H) || defined(HAVE_SLANG_SLCURSES_H)
+    SLsmg_gotorc(LINES-1, 0);
+    SLsmg_refresh();
+#else
+    mvcur(0, COLS-1, LINES-1, 0);
+#endif
+    nl();
+    endwin();
+    printf("\n");
+    fdexit(ret);
+}
+
+static void
+read_sector(unsigned char *buffer, long long sect_num) {
+    if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
+	fatal(_("Cannot seek on disk drive"), 2);
+    if (read(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
+	fatal(_("Cannot read disk drive"), 2);
+}
+
+static void
+write_sector(unsigned char *buffer, long long sect_num) {
+    if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
+	fatal(_("Cannot seek on disk drive"), 2);
+    if (write(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
+	fatal(_("Cannot write disk drive"), 2);
+}
+
+static void
+dos_copy_to_info(char *to, int tosz, char *from, int fromsz) {
+     int i;
+
+     for(i=0; i<tosz && i<fromsz && isascii(from[i]); i++)
+	  to[i] = from[i];
+     to[i] = 0;
+}
+
+static void
+get_dos_label(int i) {
+	char sector[128];
+#define DOS_OSTYPE_OFFSET 3
+#define DOS_LABEL_OFFSET 43
+#define DOS_FSTYPE_OFFSET 54
+#define DOS_OSTYPE_SZ 8
+#define DOS_LABEL_SZ 11
+#define DOS_FSTYPE_SZ 8
+	long long offset;
+
+	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE;
+	if (lseek(fd, offset, SEEK_SET) == offset
+	    && read(fd, &sector, sizeof(sector)) == sizeof(sector)) {
+		dos_copy_to_info(p_info[i].ostype, OSTYPESZ,
+				 sector+DOS_OSTYPE_OFFSET, DOS_OSTYPE_SZ);
+		dos_copy_to_info(p_info[i].volume_label, LABELSZ,
+				 sector+DOS_LABEL_OFFSET, DOS_LABEL_SZ);
+		dos_copy_to_info(p_info[i].fstype, FSTYPESZ,
+				 sector+DOS_FSTYPE_OFFSET, DOS_FSTYPE_SZ);
+	}
+}
+
+#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
+#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
+struct reiserfs_super_block {
+	char s_dummy0[52];
+	char s_magic [10];
+	char s_dummy1[38];
+	u_char s_label[16];
+};
+#define REISERFSLABELSZ sizeof(reiserfsb.s_label)
+
+static int
+has_reiserfs_magic_string(const struct reiserfs_super_block *rs, int *is_3_6) {
+	if (!strncmp(rs->s_magic, REISERFS_SUPER_MAGIC_STRING,
+		     strlen(REISERFS_SUPER_MAGIC_STRING))) {
+		*is_3_6 = 0;
+		return 1;
+	}
+	if (!strncmp(rs->s_magic, REISER2FS_SUPER_MAGIC_STRING,
+		     strlen(REISER2FS_SUPER_MAGIC_STRING))) {
+		*is_3_6 = 1;
+		return 1;
+	}
+	return 0;
+}
+
+static void
+get_linux_label(int i) {
+
+#define EXT2LABELSZ 16
+#define EXT2_SUPER_MAGIC 0xEF53
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+	struct ext2_super_block {
+		char  s_dummy0[56];
+		unsigned char  s_magic[2];
+		char  s_dummy1[34];
+		unsigned char  s_feature_compat[4];
+		char  s_dummy2[24];
+		char  s_volume_name[EXT2LABELSZ];
+		char  s_last_mounted[64];
+		char  s_dummy3[824];
+	} e2fsb;
+
+#define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
+	struct reiserfs_super_block reiserfsb;
+	int reiserfs_is_3_6;
+
+#define JFS_SUPER1_OFF	0x8000
+#define JFS_MAGIC	"JFS1"
+#define JFSLABELSZ	16
+	struct jfs_super_block {
+		char    s_magic[4];
+		u_char  s_version[4];
+		u_char  s_dummy1[93];
+		char    s_fpack[11];
+		u_char  s_dummy2[24];
+		u_char  s_uuid[16];
+		char    s_label[JFSLABELSZ];
+	} jfsb;
+
+#define XFS_SUPER_MAGIC "XFSB"
+#define XFSLABELSZ 12
+	struct xfs_super_block {
+		unsigned char   s_magic[4];
+		unsigned char   s_dummy0[104];
+		unsigned char   s_fname[XFSLABELSZ];
+		unsigned char   s_dummy1[904];
+	} xfsb;
+
+	char *label;
+	long long offset;
+	int j;
+
+	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+		+ 1024;
+	if (lseek(fd, offset, SEEK_SET) == offset
+	    && read(fd, &e2fsb, sizeof(e2fsb)) == sizeof(e2fsb)
+	    && e2fsb.s_magic[0] + (e2fsb.s_magic[1]<<8) == EXT2_SUPER_MAGIC) {
+		label = e2fsb.s_volume_name;
+		for(j=0; j<EXT2LABELSZ && j<LABELSZ && isprint(label[j]); j++)
+			p_info[i].volume_label[j] = label[j];
+		p_info[i].volume_label[j] = 0;
+		/* ext2 or ext3? */
+		if (e2fsb.s_feature_compat[0]&EXT3_FEATURE_COMPAT_HAS_JOURNAL)
+			strncpy(p_info[i].fstype, "ext3", FSTYPESZ);
+		else
+			strncpy(p_info[i].fstype, "ext2", FSTYPESZ);
+		return;
+	}
+
+	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0;
+	if (lseek(fd, offset, SEEK_SET) == offset
+	    && read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb)
+	    && !strncmp((char *) xfsb.s_magic, XFS_SUPER_MAGIC, 4)) {
+		label = (char *) xfsb.s_fname;
+		for(j=0; j<XFSLABELSZ && j<LABELSZ && isprint(label[j]); j++)
+			p_info[i].volume_label[j] = label[j];
+		p_info[i].volume_label[j] = 0;
+		strncpy(p_info[i].fstype, "xfs", FSTYPESZ);
+		return;
+	}
+
+	/* jfs? */
+	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+		+ JFS_SUPER1_OFF;
+	if (lseek(fd, offset, SEEK_SET) == offset
+	    && read(fd, &jfsb, sizeof(jfsb)) == sizeof(jfsb)
+	    && !strncmp(jfsb.s_magic, JFS_MAGIC, strlen(JFS_MAGIC))) {
+		label = jfsb.s_label;
+		for(j=0; j<JFSLABELSZ && j<LABELSZ && isprint(label[j]); j++)
+			p_info[i].volume_label[j] = label[j];
+		p_info[i].volume_label[j] = 0;
+		strncpy(p_info[i].fstype, "jfs", FSTYPESZ);
+		return;
+	}
+
+	/* reiserfs? */
+	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+		+ REISERFS_DISK_OFFSET_IN_BYTES;
+	if (lseek(fd, offset, SEEK_SET) == offset
+	    && read(fd, &reiserfsb, sizeof(reiserfsb)) == sizeof(reiserfsb)
+	    && has_reiserfs_magic_string(&reiserfsb, &reiserfs_is_3_6)) {
+		if (reiserfs_is_3_6) {
+			/* label only on version 3.6 onward */
+			label = (char *) reiserfsb.s_label;
+			for(j=0; j<REISERFSLABELSZ && j<LABELSZ &&
+				    isprint(label[j]); j++)
+				p_info[i].volume_label[j] = label[j];
+			p_info[i].volume_label[j] = 0;
+		}
+		strncpy(p_info[i].fstype, "reiserfs", FSTYPESZ);
+		return;
+	}
+}
+
+static void
+check_part_info(void) {
+    int i, pri = 0, log = 0;
+
+    for (i = 0; i < num_parts; i++)
+	if (p_info[i].id > 0 && IS_PRIMARY(p_info[i].num))
+	    pri++;
+	else if (p_info[i].id > 0 && IS_LOGICAL(p_info[i].num))
+	    log++;
+    if (is_extended(ext_info.id)) {
+	if (log > 0)
+	    pri++;
+	else {
+	    ext_info.first_sector = 0;
+	    ext_info.last_sector = 0;
+	    ext_info.offset = 0;
+	    ext_info.flags = 0;
+	    ext_info.id = FREE_SPACE;
+	    ext_info.num = PRIMARY;
+	}
+    }
+
+    if (pri >= 4) {
+	for (i = 0; i < num_parts; i++)
+	    if (p_info[i].id == FREE_SPACE || p_info[i].id == UNUSABLE) {
+		if (is_extended(ext_info.id)) {
+		    if (p_info[i].first_sector >= ext_info.first_sector &&
+			p_info[i].last_sector <= ext_info.last_sector) {
+			p_info[i].id = FREE_SPACE;
+			p_info[i].num = LOGICAL;
+		    } else if (i > 0 &&
+			       p_info[i-1].first_sector >=
+			       ext_info.first_sector &&
+			       p_info[i-1].last_sector <=
+			       ext_info.last_sector) {
+			p_info[i].id = FREE_SPACE;
+			p_info[i].num = LOGICAL;
+		    } else if (i < num_parts-1 &&
+			       p_info[i+1].first_sector >=
+			       ext_info.first_sector &&
+			       p_info[i+1].last_sector <=
+			       ext_info.last_sector) {
+			p_info[i].id = FREE_SPACE;
+			p_info[i].num = LOGICAL;
+		    } else
+			p_info[i].id = UNUSABLE;
+		} else /* if (!is_extended(ext_info.id)) */
+		    p_info[i].id = UNUSABLE;
+	    } else /* if (p_info[i].id > 0) */
+		while (0); /* Leave these alone */
+    } else { /* if (pri < 4) */
+	for (i = 0; i < num_parts; i++) {
+	    if (p_info[i].id == UNUSABLE)
+		p_info[i].id = FREE_SPACE;
+	    if (p_info[i].id == FREE_SPACE) {
+		if (is_extended(ext_info.id)) {
+		    if (p_info[i].first_sector >= ext_info.first_sector &&
+			p_info[i].last_sector <= ext_info.last_sector)
+			p_info[i].num = LOGICAL;
+		    else if (i > 0 &&
+			     p_info[i-1].first_sector >=
+			     ext_info.first_sector &&
+			     p_info[i-1].last_sector <=
+			     ext_info.last_sector)
+			p_info[i].num = PRI_OR_LOG;
+		    else if (i < num_parts-1 &&
+			     p_info[i+1].first_sector >=
+			     ext_info.first_sector &&
+			     p_info[i+1].last_sector <=
+			     ext_info.last_sector)
+			p_info[i].num = PRI_OR_LOG;
+		    else
+			p_info[i].num = PRIMARY;
+		} else /* if (!is_extended(ext_info.id)) */
+		    p_info[i].num = PRI_OR_LOG;
+	    } else /* if (p_info[i].id > 0) */
+		while (0); /* Leave these alone */
+	}
+    }
+}
+
+static void
+remove_part(int i) {
+    int p;
+
+    for (p = i; p < num_parts; p++)
+	p_info[p] = p_info[p+1];
+
+    num_parts--;
+    if (cur_part == num_parts)
+	cur_part--;
+}
+
+static void
+insert_empty_part(int i, long long first, long long last) {
+    int p;
+
+    for (p = num_parts; p > i; p--)
+	 p_info[p] = p_info[p-1];
+
+    p_info[i].first_sector = first;
+    p_info[i].last_sector = last;
+    p_info[i].offset = 0;
+    p_info[i].flags = 0;
+    p_info[i].id = FREE_SPACE;
+    p_info[i].num = PRI_OR_LOG;
+    p_info[i].volume_label[0] = 0;
+    p_info[i].fstype[0] = 0;
+    p_info[i].ostype[0] = 0;
+
+    num_parts++;
+}
+
+static void
+del_part(int i) {
+    int num = p_info[i].num;
+
+    if (i > 0 && (p_info[i-1].id == FREE_SPACE ||
+		  p_info[i-1].id == UNUSABLE)) {
+	/* Merge with previous partition */
+	p_info[i-1].last_sector = p_info[i].last_sector;
+	remove_part(i--);
+    }
+
+    if (i < num_parts - 1 && (p_info[i+1].id == FREE_SPACE ||
+			      p_info[i+1].id == UNUSABLE)) {
+	/* Merge with next partition */
+	p_info[i+1].first_sector = p_info[i].first_sector;
+	remove_part(i);
+    }
+
+    if (i > 0)
+	p_info[i].first_sector = p_info[i-1].last_sector + 1;
+    else
+	p_info[i].first_sector = 0;
+
+    if (i < num_parts - 1)
+	p_info[i].last_sector = p_info[i+1].first_sector - 1;
+    else
+	p_info[i].last_sector = total_size - 1;
+
+    p_info[i].offset = 0;
+    p_info[i].flags = 0;
+    p_info[i].id = FREE_SPACE;
+    p_info[i].num = PRI_OR_LOG;
+
+    if (IS_LOGICAL(num)) {
+	/* We have a logical partition --> shrink the extended partition
+	 * if (1) this is the first logical drive, or (2) this is the
+	 * last logical drive; and if there are any other logical drives
+	 * then renumber the ones after "num".
+	 */
+	if (i == 0 || (i > 0 && IS_PRIMARY(p_info[i-1].num))) {
+	    ext_info.first_sector = p_info[i].last_sector + 1;
+	    ext_info.offset = 0;
+	}
+	if (i == num_parts-1 ||
+	    (i < num_parts-1 && IS_PRIMARY(p_info[i+1].num)))
+	    ext_info.last_sector = p_info[i].first_sector - 1;
+	for (i = 0; i < num_parts; i++)
+	    if (p_info[i].num > num)
+		p_info[i].num--;
+    }
+
+    /* Clean up the rest of the partitions */
+    check_part_info();
+}
+
+static int
+add_part(int num, int id, int flags, long long first, long long last,
+	 long long offset, int want_label, char **errmsg) {
+    int i, pri = 0, log = 0;
+
+    if (num_parts == MAXIMUM_PARTS) {
+	*errmsg = _("Too many partitions");
+	return -1;
+    }
+
+    if (first < 0) {
+	*errmsg = _("Partition begins before sector 0");
+	return -1;
+    }
+
+    if (last < 0) {
+	*errmsg = _("Partition ends before sector 0");
+	return -1;
+    }
+
+    if (first >= total_size) {
+	*errmsg = _("Partition begins after end-of-disk");
+	return -1;
+    }
+
+    if (last >= actual_size) {
+	*errmsg = _("Partition ends after end-of-disk");
+	return -1;
+    }
+
+    if (last >= total_size) {
+	*errmsg = _("Partition ends in the final partial cylinder");
+	return -1;
+    }
+
+    for (i = 0; i < num_parts; i++) {
+	if (p_info[i].id > 0 && IS_PRIMARY(p_info[i].num))
+	    pri++;
+	else if (p_info[i].id > 0 && IS_LOGICAL(p_info[i].num))
+	    log++;
+    }
+    if (is_extended(ext_info.id) && log > 0)
+	pri++;
+
+    if (IS_PRIMARY(num)) {
+	if (pri >= 4) {
+	    return -1;		/* no room for more */
+	} else
+	    pri++;
+    }
+
+    for (i = 0; i < num_parts && p_info[i].last_sector < first; i++);
+
+    if (i < num_parts && p_info[i].id != FREE_SPACE) {
+	 if (last < p_info[i].first_sector)
+	      *errmsg = _("logical partitions not in disk order");
+	 else if (first + offset <= p_info[i].last_sector &&
+		  p_info[i].first_sector + p_info[i].offset <= last)
+	      *errmsg = _("logical partitions overlap");
+	 else
+	      /* the enlarged logical partition starts at the
+		 partition table sector that defines it */
+	      *errmsg = _("enlarged logical partitions overlap");
+	 return -1;
+    }
+
+    if (i == num_parts || last > p_info[i].last_sector) {
+	return -1;
+    }
+
+    if (is_extended(id)) {
+	if (ext_info.id != FREE_SPACE) {
+	    return -1;		/* second extended */
+	}
+	else if (IS_PRIMARY(num)) {
+	    ext_info.first_sector = first;
+	    ext_info.last_sector = last;
+	    ext_info.offset = offset;
+	    ext_info.flags = flags;
+	    ext_info.id = id;
+	    ext_info.num = num;
+	    ext_info.volume_label[0] = 0;
+	    ext_info.fstype[0] = 0;
+	    ext_info.ostype[0] = 0;
+	    return 0;
+	} else {
+	    return -1;		/* explicit extended logical */
+	}
+    }
+
+    if (IS_LOGICAL(num)) {
+	if (!is_extended(ext_info.id)) {
+	    print_warning(_("!!!! Internal error creating logical "
+			  "drive with no extended partition !!!!"));
+	} else {
+	    /* We might have a logical partition outside of the extended
+	     * partition's range --> we have to extend the extended
+	     * partition's range to encompass this new partition, but we
+	     * must make sure that there are no primary partitions between
+	     * it and the closest logical drive in extended partition.
+	     */
+	    if (first < ext_info.first_sector) {
+		if (i < num_parts-1 && IS_PRIMARY(p_info[i+1].num)) {
+		    print_warning(_("Cannot create logical drive here -- would create two extended partitions"));
+		    return -1;
+		} else {
+		    if (first == 0) {
+			ext_info.first_sector = 0;
+			ext_info.offset = first = offset;
+		    } else {
+			ext_info.first_sector = first;
+		    }
+		}
+	    } else if (last > ext_info.last_sector) {
+		if (i > 0 && IS_PRIMARY(p_info[i-1].num)) {
+		    print_warning(_("Cannot create logical drive here -- would create two extended partitions"));
+		    return -1;
+		} else {
+		    ext_info.last_sector = last;
+		}
+	    }
+	}
+    }
+
+    if (first != p_info[i].first_sector &&
+	!(IS_LOGICAL(num) && first == offset)) {
+	insert_empty_part(i, p_info[i].first_sector, first-1);
+	i++;
+    }
+
+    if (last != p_info[i].last_sector)
+	insert_empty_part(i+1, last+1, p_info[i].last_sector);
+
+    p_info[i].first_sector = first;
+    p_info[i].last_sector = last;
+    p_info[i].offset = offset;
+    p_info[i].flags = flags;
+    p_info[i].id = id;
+    p_info[i].num = num;
+    p_info[i].volume_label[0] = 0;
+    p_info[i].fstype[0] = 0;
+    p_info[i].ostype[0] = 0;
+    if (want_label) {
+	 if (may_have_dos_label(id))
+	      get_dos_label(i);
+	 else if (id == LINUX)
+	      get_linux_label(i);
+    }
+
+    check_part_info();
+
+    return 0;
+}
+
+static int
+find_primary(void) {
+    int num = 0, cur = 0;
+
+    while (cur < num_parts && IS_PRIMARY(num))
+	if ((p_info[cur].id > 0 && p_info[cur].num == num) ||
+	    (is_extended(ext_info.id) && ext_info.num == num)) {
+	    num++;
+	    cur = 0;
+	} else
+	    cur++;
+
+    if (!IS_PRIMARY(num))
+	return -1;
+    else
+	return num;
+}
+
+static int
+find_logical(int i) {
+    int num = -1;
+    int j;
+
+    for (j = i; j < num_parts && num == -1; j++)
+	if (p_info[j].id > 0 && IS_LOGICAL(p_info[j].num))
+	    num = p_info[j].num;
+
+    if (num == -1) {
+	num = 4;
+	for (j = 0; j < num_parts; j++)
+	    if (p_info[j].id > 0 && p_info[j].num == num)
+		num++;
+    }
+
+    return num;
+}
+
+/*
+ * Command menu support by Janne Kukonlehto <jtklehto@phoenix.oulu.fi>
+ * September 1994
+ */
+
+/* Constants for menuType parameter of menuSelect function */
+#define MENU_HORIZ 1
+#define MENU_VERT 2
+#define MENU_ACCEPT_OTHERS 4
+#define MENU_BUTTON 8
+/* Miscellenous constants */
+#define MENU_SPACING 2
+#define MENU_MAX_ITEMS 256 /* for simpleMenu function */
+#define MENU_UP 1
+#define MENU_DOWN 2
+#define MENU_RIGHT 3
+#define MENU_LEFT 4
+
+struct MenuItem
+{
+    int key; /* Keyboard shortcut; if zero, then there is no more items in the menu item table */
+    char *name; /* Item name, should be eight characters with current implementation */
+    char *desc; /* Item description to be printed when item is selected */
+};
+
+/*
+ * Actual function which prints the button bar and highlights the active button
+ * Should not be called directly. Call function menuSelect instead.
+ */
+
+static int
+menuUpdate( int y, int x, struct MenuItem *menuItems, int itemLength,
+	    char *available, int menuType, int current ) {
+    int i, lmargin = x, ymargin = y;
+    char *mcd;
+
+    /* Print available buttons */
+    move( y, x ); clrtoeol();
+
+    for( i = 0; menuItems[i].key; i++ ) {
+        char buff[20];
+        int lenName;
+	const char *mi;
+
+        /* Search next available button */
+        while( menuItems[i].key && !strchr(available, menuItems[i].key) )
+            i++;
+
+        if( !menuItems[i].key ) break; /* No more menu items */
+
+        /* If selected item is not available and we have bypassed it,
+	   make current item selected */
+        if( current < i && menuItems[current].key < 0 ) current = i;
+
+        /* If current item is selected, highlight it */
+        if( current == i ) /*attron( A_REVERSE )*/ standout ();
+
+        /* Print item */
+	/* Because of a bug in gettext() we must not translate empty strings */
+	if (menuItems[i].name[0])
+		mi = _(menuItems[i].name);
+	else
+		mi = "";
+        lenName = strlen( mi );
+#if 0
+        if(lenName > itemLength || lenName >= sizeof(buff))
+            print_warning(_("Menu item too long. Menu may look odd."));
+#endif
+	if (lenName >= sizeof(buff)) {	/* truncate ridiculously long string */
+	    xstrncpy(buff, mi, sizeof(buff));
+	} else if (lenName >= itemLength) {
+            snprintf(buff, sizeof(buff),
+		     (menuType & MENU_BUTTON) ? "[%s]" : "%s", mi);
+	} else {
+            snprintf(buff, sizeof(buff),
+		     (menuType & MENU_BUTTON) ? "[%*s%-*s]" : "%*s%-*s",
+		     (itemLength - lenName) / 2, "",
+		     (itemLength - lenName + 1) / 2 + lenName, mi);
+	}
+        mvaddstr( y, x, buff );
+
+        /* Lowlight after selected item */
+        if( current == i ) /*attroff( A_REVERSE )*/ standend ();
+
+        /* Calculate position for the next item */
+        if( menuType & MENU_VERT )
+        {
+            y += 1;
+            if( y >= WARNING_START )
+            {
+                y = ymargin;
+                x += itemLength + MENU_SPACING;
+                if( menuType & MENU_BUTTON ) x += 2;
+            }
+        }
+        else
+        {
+            x += itemLength + MENU_SPACING;
+            if( menuType & MENU_BUTTON ) x += 2;
+            if( x > COLUMNS - lmargin - 12 )
+            {
+                x = lmargin;
+                y ++ ;
+            }
+        }
+    }
+
+    /* Print the description of selected item */
+    mcd = _(menuItems[current].desc);
+    mvaddstr( WARNING_START + 1, (COLUMNS - strlen( mcd )) / 2, mcd );
+    return y;
+}
+
+/* This function takes a list of menu items, lets the user choose one *
+ * and returns the keyboard shortcut value of the selected menu item  */
+
+static int
+menuSelect( int y, int x, struct MenuItem *menuItems, int itemLength,
+	    char *available, int menuType, int menuDefault ) {
+    int i, ylast = y, key = 0, current = menuDefault;
+
+    if( !( menuType & ( MENU_HORIZ | MENU_VERT ) ) ) {
+        print_warning(_("Menu without direction. Defaulting to horizontal."));
+        menuType |= MENU_HORIZ;
+    }
+
+    /* Make sure that the current is one of the available items */
+    while( !strchr(available, menuItems[current].key) ) {
+        current ++ ;
+        if( !menuItems[current].key ) current = 0;
+    }
+
+    /* Repeat until allowable choice has been made */
+    while( !key ) {
+        /* Display the menu and read a command */
+        ylast = menuUpdate( y, x, menuItems, itemLength, available,
+			    menuType, current );
+        refresh();
+        key = getch();
+
+        /* Clear out all prompts and such */
+        clear_warning();
+        for (i = y; i < ylast; i++) {
+            move(i, x);
+            clrtoeol();
+        }
+        move( WARNING_START + 1, 0 );
+        clrtoeol();
+
+        /* Cursor keys - possibly split by slow connection */
+        if( key == ESC ) {
+            /* Check whether this is a real ESC or one of extended keys */
+            /*nodelay(stdscr, TRUE);*/
+            key = getch();
+            /*nodelay(stdscr, FALSE);*/
+
+            if( key == /*ERR*/ ESC ) {
+                /* This is a real ESC */
+                key = ESC;
+            }
+            if(key == '[' || key == 'O') {
+                /* This is one extended keys */
+		key = getch();
+
+                switch(key) {
+                    case 'A': /* Up arrow */
+			key = MENU_UP;
+                        break;
+                    case 'B': /* Down arrow */
+                        key = MENU_DOWN;
+                        break;
+                    case 'C': /* Right arrow */
+                        key = MENU_RIGHT;
+                        break;
+                    case 'D': /* Left arrow */
+                    case 'Z': /* Shift Tab */
+                        key = MENU_LEFT;
+                        break;
+		    default:
+			key = 0;
+                }
+            }
+        }
+
+        /* Enter equals the keyboard shortcut of current menu item */
+        if (key == CR)
+            key = menuItems[current].key;
+
+	/* Give alternatives for arrow keys in case the window manager
+	   swallows these */
+	if (key == TAB)
+	    key = MENU_RIGHT;
+        if (key == UPKEY || key == UPKEYVI)	/* ^P or k */
+	    key = MENU_UP;
+	if (key == DOWNKEY || key == DOWNKEYVI)	/* ^N or j */
+	    key = MENU_DOWN;
+
+	if (key == MENU_UP) {
+	    if( menuType & MENU_VERT ) {
+                do {
+                    current -- ;
+                    if( current < 0 )
+			while( menuItems[current+1].key )
+			    current ++ ;
+                } while( !strchr( available, menuItems[current].key ));
+                key = 0;
+            }
+	}
+
+	if (key == MENU_DOWN) {
+            if( menuType & MENU_VERT ) {
+                do {
+                    current ++ ;
+		    if( !menuItems[current].key ) current = 0 ;
+		} while( !strchr( available, menuItems[current].key ));
+		key = 0;
+	    }
+	}
+
+	if (key == MENU_RIGHT) {
+	    if( menuType & MENU_HORIZ ) {
+		do {
+		    current ++ ;
+		    if( !menuItems[current].key )
+			current = 0 ;
+		} while( !strchr( available, menuItems[current].key ));
+		key = 0;
+	    }
+	}
+
+	if (key == MENU_LEFT) {
+	     if( menuType & MENU_HORIZ ) {
+		 do {
+		     current -- ;
+		     if( current < 0 ) {
+			 while( menuItems[current + 1].key )
+			      current ++ ;
+		     }
+		 } while( !strchr( available, menuItems[current].key ));
+		 key = 0;
+	     }
+	}
+
+        /* Should all keys to be accepted? */
+        if( key && (menuType & MENU_ACCEPT_OTHERS) ) break;
+
+        /* Is pressed key among acceptable ones? */
+        if( key && (strchr(available, tolower(key)) || strchr(available, key)))
+	    break;
+
+        /* The key has not been accepted so far -> let's reject it */
+        if (key) {
+            key = 0;
+            putchar( BELL );
+            print_warning(_("Illegal key"));
+        }
+    }
+
+    /* Clear out prompts and such */
+    clear_warning();
+    for( i = y; i <= ylast; i ++ ) {
+        move( i, x );
+        clrtoeol();
+    }
+    move( WARNING_START + 1, 0 );
+    clrtoeol();
+    return key;
+}
+
+/* A function which displays "Press a key to continue"                  *
+ * and waits for a keypress.                                            *
+ * Perhaps calling function menuSelect is a bit overkill but who cares? */
+
+static void
+menuContinue(void) {
+    static struct MenuItem menuContinueBtn[]=
+    {
+        { 'c', "", N_("Press a key to continue") },
+        { 0, NULL, NULL }
+    };
+
+    menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X,
+	menuContinueBtn, 0, "c", MENU_HORIZ | MENU_ACCEPT_OTHERS, 0 );
+}
+
+/* Function menuSelect takes way too many parameters  *
+ * Luckily, most of time we can do with this function */
+
+static int
+menuSimple(struct MenuItem *menuItems, int menuDefault) {
+    int i, j, itemLength = 0;
+    char available[MENU_MAX_ITEMS];
+
+    for(i = 0; menuItems[i].key; i++)
+    {
+        j = strlen( _(menuItems[i].name) );
+        if( j > itemLength ) itemLength = j;
+        available[i] = menuItems[i].key;
+    }
+    available[i] = 0;
+    return menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuItems, itemLength,
+        available, MENU_HORIZ | MENU_BUTTON, menuDefault);
+}
+
+/* End of command menu support code */
+
+static void
+new_part(int i) {
+    char response[LINE_LENGTH], def[LINE_LENGTH];
+    char c;
+    long long first = p_info[i].first_sector;
+    long long last = p_info[i].last_sector;
+    long long offset = 0;
+    int flags = 0;
+    int id = LINUX;
+    int num = -1;
+    long long num_sects = last - first + 1;
+    int len, ext, j;
+    char *errmsg;
+    double sectors_per_MB = K*K / 512.0;
+
+    if (p_info[i].num == PRI_OR_LOG) {
+        static struct MenuItem menuPartType[]=
+        {
+            { 'p', N_("Primary"), N_("Create a new primary partition") },
+            { 'l', N_("Logical"), N_("Create a new logical partition") },
+            { ESC, N_("Cancel"), N_("Don't create a partition") },
+            { 0, NULL, NULL }
+        };
+
+	c = menuSimple( menuPartType, 0 );
+	if (toupper(c) == 'P')
+	    num = find_primary();
+	else if (toupper(c) == 'L')
+	    num = find_logical(i);
+	else
+	    return;
+    } else if (p_info[i].num == PRIMARY)
+	num = find_primary();
+    else if (p_info[i].num == LOGICAL)
+	num = find_logical(i);
+    else
+	print_warning(_("!!! Internal error !!!"));
+
+    snprintf(def, sizeof(def), "%.2f", num_sects/sectors_per_MB);
+    mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X, _("Size (in MB): "));
+    if ((len = get_string(response, LINE_LENGTH, def)) <= 0 &&
+	len != GS_DEFAULT)
+	return;
+    else if (len > 0) {
+#define num_cyls(bytes) (round_int(bytes/SECTOR_SIZE/cylinder_size))
+	for (j = 0;
+	     j < len-1 && (isdigit(response[j]) || response[j] == '.');
+	     j++);
+	if (toupper(response[j]) == 'K') {
+	    num_sects = num_cyls(atof(response)*K)*cylinder_size;
+	} else if (toupper(response[j]) == 'M') {
+	    num_sects = num_cyls(atof(response)*K*K)*cylinder_size;
+	} else if (toupper(response[j]) == 'G') {
+	    num_sects = num_cyls(atof(response)*K*K*K)*cylinder_size;
+	} else if (toupper(response[j]) == 'C') {
+	    num_sects = round_int(atof(response))*cylinder_size;
+	} else if (toupper(response[j]) == 'S') {
+	    num_sects = round_int(atof(response));
+	} else {
+	    num_sects = num_cyls(atof(response)*K*K)*cylinder_size;
+	}
+    }
+
+    if (num_sects <= 0 ||
+	num_sects > p_info[i].last_sector - p_info[i].first_sector + 1)
+	return;
+
+    move( COMMAND_LINE_Y, COMMAND_LINE_X ); clrtoeol();
+    if (num_sects < p_info[i].last_sector - p_info[i].first_sector + 1) {
+	/* Determine where inside free space to put partition.
+	 */
+	static struct MenuItem menuPlace[]=
+	{
+	    { 'b', N_("Beginning"), N_("Add partition at beginning of free space") },
+	    { 'e', N_("End"), N_("Add partition at end of free space") },
+	    { ESC, N_("Cancel"), N_("Don't create a partition") },
+	    { 0, NULL, NULL }
+	};
+	c = menuSimple( menuPlace, 0 );
+	if (toupper(c) == 'B')
+	    last = first + num_sects - 1;
+	else if (toupper(c) == 'E')
+	    first = last - num_sects + 1;
+	else
+	    return;
+    }
+
+    if (IS_LOGICAL(num) && !is_extended(ext_info.id)) {
+	/* We want to add a logical partition, but need to create an
+	 * extended partition first.
+	 */
+	if ((ext = find_primary()) < 0) {
+	    print_warning(_("No room to create the extended partition"));
+	    return;
+	}
+	errmsg = 0;
+	if (add_part(ext, DOS_EXTENDED, 0, first, last,
+		     (first == 0 ? sectors : 0), 0, &errmsg) && errmsg)
+		print_warning(errmsg);
+	first = ext_info.first_sector + ext_info.offset;
+    }
+
+    /* increment number of all partitions past this one */
+    if (IS_LOGICAL(num)) {
+#if 0
+	/* original text - ok, but fails when partitions not in disk order */
+	for (j = i; j < num_parts; j++)
+	    if (p_info[j].id > 0 && IS_LOGICAL(p_info[j].num))
+		p_info[j].num++;
+#else
+	/* always ok */
+	for (j = 0; j < num_parts; j++)
+	    if (p_info[j].id > 0 && p_info[j].num >= num)
+		p_info[j].num++;
+#endif
+    }
+
+    /* Now we have a complete partition to ourselves */
+    if (first == 0 || IS_LOGICAL(num))
+	offset = sectors;
+
+    errmsg = 0;
+    if (add_part(num, id, flags, first, last, offset, 0, &errmsg) && errmsg)
+	    print_warning(errmsg);
+}
+
+static void
+get_kernel_geometry(void) {
+#ifdef HDIO_GETGEO
+    struct hd_geometry geometry;
+
+    if (!ioctl(fd, HDIO_GETGEO, &geometry)) {
+	kern_heads = geometry.heads;
+	kern_sectors = geometry.sectors;
+    }
+#endif
+}
+
+static int
+said_yes(char answer) {
+#ifdef HAVE_RPMATCH
+	char reply[2];
+	int yn;
+
+	reply[0] = answer;
+	reply[1] = 0;
+	yn = rpmatch(reply);	/* 1: yes, 0: no, -1: ? */
+	if (yn >= 0)
+		return yn;
+#endif
+	return (answer == 'y' || answer == 'Y');
+}
+
+static void
+get_partition_table_geometry(partition_table *bufp) {
+	struct partition *p;
+	int i,h,s,hh,ss;
+	int first = TRUE;
+	int bad = FALSE;
+
+	for (i=0; i<66; i++)
+		if (bufp->c.b[446+i])
+			goto nonz;
+
+	/* zero table */
+	if (!curses_started) {
+		fatal(_("No partition table.\n"), 3);
+		return;
+	} else {
+		mvaddstr(WARNING_START, 0,
+			 _("No partition table. Starting with zero table."));
+		putchar(BELL);
+		refresh();
+		zero_table = TRUE;
+		return;
+	}
+ nonz:
+	if (bufp->p.magicflag[0] != PART_TABLE_FLAG0 ||
+	    bufp->p.magicflag[1] != PART_TABLE_FLAG1) {
+		if (!curses_started)
+			fatal(_("Bad signature on partition table"), 3);
+
+		/* Matthew Wilcox */
+		mvaddstr(WARNING_START, 0,
+			 _("Unknown partition table type"));
+		mvaddstr(WARNING_START+1, 0,
+			 _("Do you wish to start with a zero table [y/N] ?"));
+		putchar(BELL);
+		refresh();
+		{
+			int cont = getch();
+			if (cont == EOF || !said_yes(cont))
+				die_x(3);
+		}
+		zero_table = TRUE;
+		return;
+	}
+
+	hh = ss = 0;
+	for (i=0; i<4; i++) {
+		p = &(bufp->p.part[i]);
+		if (p->sys_ind != 0) {
+			h = p->end_head + 1;
+			s = (p->end_sector & 077);
+			if (first) {
+				hh = h;
+				ss = s;
+				first = FALSE;
+			} else if (hh != h || ss != s)
+				bad = TRUE;
+		}
+	}
+
+	if (!first && !bad) {
+		pt_heads = hh;
+		pt_sectors = ss;
+	}
+}
+
+static void
+decide_on_geometry(void) {
+    heads = (user_heads ? user_heads :
+	     pt_heads ? pt_heads :
+	     kern_heads ? kern_heads : 255);
+    sectors = (user_sectors ? user_sectors :
+	       pt_sectors ? pt_sectors :
+	       kern_sectors ? kern_sectors : 63);
+    cylinder_size = heads*sectors;
+    cylinders = actual_size/cylinder_size;
+    if (user_cylinders > 0)
+	    cylinders = user_cylinders;
+
+    total_size = cylinder_size*cylinders;
+    if (total_size > actual_size)
+	    print_warning(_("You specified more cylinders than fit on disk"));
+}
+
+static void
+clear_p_info(void) {
+    num_parts = 1;
+    p_info[0].first_sector = 0;
+    p_info[0].last_sector = total_size - 1;
+    p_info[0].offset = 0;
+    p_info[0].flags = 0;
+    p_info[0].id = FREE_SPACE;
+    p_info[0].num = PRI_OR_LOG;
+
+    ext_info.first_sector = 0;
+    ext_info.last_sector = 0;
+    ext_info.offset = 0;
+    ext_info.flags = 0;
+    ext_info.id = FREE_SPACE;
+    ext_info.num = PRIMARY;
+}
+
+static void
+fill_p_info(void) {
+    int pn, i;
+    long long bs, bsz;
+    unsigned long long llsectors;
+    struct partition *p;
+    partition_table buffer;
+    partition_info tmp_ext = { 0, 0, 0, 0, FREE_SPACE, PRIMARY };
+
+    if ((fd = open(disk_device, O_RDWR)) < 0) {
+	 if ((fd = open(disk_device, O_RDONLY)) < 0)
+	      fatal(_("Cannot open disk drive"), 2);
+	 opentype = O_RDONLY;
+	 print_warning(_("Opened disk read-only - you have no permission to write"));
+	 if (curses_started) {
+	      refresh();
+	      getch();
+	      clear_warning();
+	 }
+    } else
+	 opentype = O_RDWR;
+    opened = TRUE;
+
+    if (gpt_probe_signature_fd(fd)) {
+	 print_warning(_("Warning!!  Unsupported GPT (GUID Partition Table) detected. Use GNU Parted."));
+	 refresh();
+	 getch();
+	 clear_warning();
+    }
+
+#ifdef BLKFLSBUF
+    /* Blocks are visible in more than one way:
+       e.g. as block on /dev/hda and as block on /dev/hda3
+       By a bug in the Linux buffer cache, we will see the old
+       contents of /dev/hda when the change was made to /dev/hda3.
+       In order to avoid this, discard all blocks on /dev/hda.
+       Note that partition table blocks do not live in /dev/hdaN,
+       so this only plays a role if we want to show volume labels. */
+    ioctl(fd, BLKFLSBUF);	/* ignore errors */
+				/* e.g. Permission Denied */
+#endif
+
+    if (blkdev_get_sectors(fd, &llsectors) == -1)
+	    fatal(_("Cannot get disk size"), 3);
+    actual_size = llsectors;
+
+    read_sector(buffer.c.b, 0);
+
+    get_kernel_geometry();
+
+    if (!zero_table || use_partition_table_geometry)
+	get_partition_table_geometry(& buffer);
+
+    decide_on_geometry();
+
+    clear_p_info();
+
+    if (!zero_table) {
+	char *errmsg = "";
+
+	for (i = 0; i < 4; i++) {
+	    p = & buffer.p.part[i];
+	    bs = get_start_sect(p);
+	    bsz = get_nr_sects(p);
+
+	    if (p->sys_ind > 0 &&
+		add_part(i, p->sys_ind, p->boot_ind,
+			 ((bs <= sectors) ? 0 : bs), bs + bsz - 1,
+			 ((bs <= sectors) ? bs : 0), 1, &errmsg)) {
+		    char *bad = _("Bad primary partition");
+		    char *msg = (char *) xmalloc(strlen(bad) + strlen(errmsg) + 30);
+		    sprintf(msg, "%s %d: %s", bad, i, errmsg);
+		    fatal(msg, 4);
+	    }
+	    if (is_extended(buffer.p.part[i].sys_ind))
+		tmp_ext = ext_info;
+	}
+
+	if (is_extended(tmp_ext.id)) {
+	    ext_info = tmp_ext;
+	    logical_sectors[logical] =
+		 ext_info.first_sector + ext_info.offset;
+	    read_sector(buffer.c.b, logical_sectors[logical++]);
+	    i = 4;
+	    do {
+		for (pn = 0;
+		     pn < 4 && (!buffer.p.part[pn].sys_ind ||
+			       is_extended(buffer.p.part[pn].sys_ind));
+		     pn++);
+
+		if (pn < 4) {
+			p = & buffer.p.part[pn];
+			bs = get_start_sect(p);
+			bsz = get_nr_sects(p);
+
+			if (add_part(i++, p->sys_ind, p->boot_ind,
+			     logical_sectors[logical-1],
+			     logical_sectors[logical-1] + bs + bsz - 1,
+			     bs, 1, &errmsg)) {
+				char *bad = _("Bad logical partition");
+				char *msg = (char *) xmalloc(strlen(bad) + strlen(errmsg) + 30);
+				sprintf(msg, "%s %d: %s", bad, i, errmsg);
+				fatal(msg, 4);
+			}
+		}
+
+		for (pn = 0;
+		     pn < 4 && !is_extended(buffer.p.part[pn].sys_ind);
+		     pn++);
+		if (pn < 4) {
+			p = & buffer.p.part[pn];
+			bs = get_start_sect(p);
+			logical_sectors[logical] = ext_info.first_sector
+				+ ext_info.offset + bs;
+			read_sector(buffer.c.b, logical_sectors[logical++]);
+		}
+	    } while (pn < 4 && logical < MAXIMUM_PARTS-4);
+	}
+    }
+}
+
+static void
+fill_part_table(struct partition *p, partition_info *pi) {
+    long long begin;
+
+    p->boot_ind = pi->flags;
+    p->sys_ind = pi->id;
+    begin = pi->first_sector + pi->offset;
+    if (IS_LOGICAL(pi->num))
+	set_start_sect(p,pi->offset);
+    else
+	set_start_sect(p,begin);
+    set_nr_sects(p, pi->last_sector - begin + 1);
+    set_hsc_begin(p, begin);
+    set_hsc_end(p, pi->last_sector);
+}
+
+static void
+fill_primary_table(partition_table *buffer) {
+    int i;
+
+    /* Zero out existing table */
+    for (i = 0x1BE; i < SECTOR_SIZE; i++)
+	buffer->c.b[i] = 0;
+
+    for (i = 0; i < num_parts; i++)
+	if (IS_PRIMARY(p_info[i].num))
+	    fill_part_table(&(buffer->p.part[p_info[i].num]), &(p_info[i]));
+
+    if (is_extended(ext_info.id))
+	fill_part_table(&(buffer->p.part[ext_info.num]), &ext_info);
+
+    buffer->p.magicflag[0] = PART_TABLE_FLAG0;
+    buffer->p.magicflag[1] = PART_TABLE_FLAG1;
+}
+
+static void
+fill_logical_table(partition_table *buffer, partition_info *pi) {
+    struct partition *p;
+    int i;
+
+    for (i = 0; i < logical && pi->first_sector != logical_sectors[i]; i++);
+    if (i == logical || buffer->p.magicflag[0] != PART_TABLE_FLAG0
+	             || buffer->p.magicflag[1] != PART_TABLE_FLAG1)
+	for (i = 0; i < SECTOR_SIZE; i++)
+	    buffer->c.b[i] = 0;
+
+    /* Zero out existing table */
+    for (i = 0x1BE; i < SECTOR_SIZE; i++)
+	buffer->c.b[i] = 0;
+
+    fill_part_table(&(buffer->p.part[0]), pi);
+
+    for (i = 0;
+	 i < num_parts && pi->num != p_info[i].num - 1;
+	 i++);
+
+    if (i < num_parts) {
+	p = &(buffer->p.part[1]);
+	pi = &(p_info[i]);
+
+	p->boot_ind = 0;
+	p->sys_ind = DOS_EXTENDED;
+	set_start_sect(p, pi->first_sector - ext_info.first_sector - ext_info.offset);
+	set_nr_sects(p, pi->last_sector - pi->first_sector + 1);
+	set_hsc_begin(p, pi->first_sector);
+	set_hsc_end(p, pi->last_sector);
+    }
+
+    buffer->p.magicflag[0] = PART_TABLE_FLAG0;
+    buffer->p.magicflag[1] = PART_TABLE_FLAG1;
+}
+
+static void
+write_part_table(void) {
+    int i, ct, done = FALSE, len;
+    partition_table buffer;
+    struct stat s;
+    int is_bdev;
+    char response[LINE_LENGTH];
+
+    if (opentype == O_RDONLY) {
+	 print_warning(_("Opened disk read-only - you have no permission to write"));
+	 refresh();
+	 getch();
+	 clear_warning();
+	 return;
+    }
+
+    is_bdev = 0;
+    if(fstat(fd, &s) == 0 && S_ISBLK(s.st_mode))
+	 is_bdev = 1;
+
+    if (is_bdev) {
+	 print_warning(_("Warning!!  This may destroy data on your disk!"));
+
+	 while (!done) {
+	      mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		       _("Are you sure you want to write the partition table "
+		       "to disk? (yes or no): "));
+	      len = get_string(response, LINE_LENGTH, NULL);
+	      clear_warning();
+	      if (len == GS_ESCAPE)
+		   return;
+	      else if (strcasecmp(response, _("no")) == 0 ||
+		       strcasecmp(response, "no") == 0) {
+		   print_warning(_("Did not write partition table to disk"));
+		   return;
+	      } else if (strcasecmp(response, _("yes")) == 0 ||
+			 strcasecmp(response, "yes") == 0)
+		   done = TRUE;
+	      else
+		   print_warning(_("Please enter `yes' or `no'"));
+	 }
+
+	 clear_warning();
+	 print_warning(_("Writing partition table to disk..."));
+	 refresh();
+    }
+
+    read_sector(buffer.c.b, 0);
+    fill_primary_table(&buffer);
+    write_sector(buffer.c.b, 0);
+
+    for (i = 0; i < num_parts; i++)
+	if (IS_LOGICAL(p_info[i].num)) {
+	    read_sector(buffer.c.b, p_info[i].first_sector);
+	    fill_logical_table(&buffer, &(p_info[i]));
+	    write_sector(buffer.c.b, p_info[i].first_sector);
+	}
+
+    if (is_bdev) {
+#ifdef BLKRRPART
+	 sync();
+	 if (!ioctl(fd,BLKRRPART))
+	      changed = TRUE;
+#endif
+	 sync();
+
+	 clear_warning();
+	 if (changed)
+	      print_warning(_("Wrote partition table to disk"));
+	 else
+	      print_warning(_("Wrote partition table, but re-read table failed.  Run partprobe(8), kpartx(8) or reboot to update table."));
+    } else
+	 print_warning(_("Wrote partition table to disk"));
+
+    /* Check: unique bootable primary partition? */
+    ct = 0;
+    for (i = 0; i < num_parts; i++)
+	if (IS_PRIMARY(i) && p_info[i].flags == ACTIVE_FLAG)
+	    ct++;
+    if (ct == 0)
+	print_warning(_("No primary partitions are marked bootable. DOS MBR cannot boot this."));
+    if (ct > 1)
+	print_warning(_("More than one primary partition is marked bootable. DOS MBR cannot boot this."));
+}
+
+static void
+fp_printf(FILE *fp, char *format, ...) {
+    va_list args;
+    char buf[1024];
+    int y, x;
+
+    va_start(args, format);
+    vsnprintf(buf, sizeof(buf), format, args);
+    va_end(args);
+
+    if (fp == NULL) {
+	/* The following works best if the string to be printed has at
+           most only one newline. */
+	printw("%s", buf);
+	getyx(stdscr, y, x);
+	if (y >= COMMAND_LINE_Y-2) {
+	    menuContinue();
+	    erase();
+	    move(0, 0);
+	}
+    } else
+	fprintf(fp, "%s", buf);
+}
+
+#define MAX_PER_LINE 16
+static void
+print_file_buffer(FILE *fp, unsigned char *buffer) {
+    int i,l;
+
+    for (i = 0, l = 0; i < SECTOR_SIZE; i++, l++) {
+	if (l == 0)
+	    fp_printf(fp, "0x%03X:", i);
+	fp_printf(fp, " %02X", buffer[i]);
+	if (l == MAX_PER_LINE - 1) {
+	    fp_printf(fp, "\n");
+	    l = -1;
+	}
+    }
+    if (l > 0)
+	fp_printf(fp, "\n");
+    fp_printf(fp, "\n");
+}
+
+static void
+print_raw_table(void) {
+    int i, to_file;
+    partition_table buffer;
+    char fname[LINE_LENGTH];
+    FILE *fp;
+
+    if (print_only) {
+	fp = stdout;
+	to_file = TRUE;
+    } else {
+	mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		 _("Enter filename or press RETURN to display on screen: "));
+
+	if ((to_file = get_string(fname, LINE_LENGTH, NULL)) < 0)
+	    return;
+
+	if (to_file) {
+	    if ((fp = fopen(fname, "w")) == NULL) {
+		char errstr[LINE_LENGTH];
+		snprintf(errstr, sizeof(errstr),
+			 _("Cannot open file '%s'"), fname);
+		print_warning(errstr);
+		return;
+	    }
+	} else {
+	    fp = NULL;
+	    erase();
+	    move(0, 0);
+	}
+    }
+
+    fp_printf(fp, _("Disk Drive: %s\n"), disk_device);
+
+    fp_printf(fp, _("Sector 0:\n"));
+    read_sector(buffer.c.b, 0);
+    fill_primary_table(&buffer);
+    print_file_buffer(fp, buffer.c.b);
+
+    for (i = 0; i < num_parts; i++)
+	if (IS_LOGICAL(p_info[i].num)) {
+	    fp_printf(fp, _("Sector %d:\n"), p_info[i].first_sector);
+	    read_sector(buffer.c.b, p_info[i].first_sector);
+	    fill_logical_table(&buffer, &(p_info[i]));
+	    print_file_buffer(fp, buffer.c.b);
+	}
+
+    if (to_file) {
+	if (!print_only)
+	    fclose(fp);
+    } else {
+        menuContinue();
+    }
+}
+
+static void
+print_p_info_entry(FILE *fp, partition_info *p) {
+    long long size;
+    char part_str[40];
+
+    if (p->id == UNUSABLE)
+	fp_printf(fp, _("   None   "));
+    else if (p->id == FREE_SPACE && p->num == PRI_OR_LOG)
+	fp_printf(fp, _("   Pri/Log"));
+    else if (p->id == FREE_SPACE && p->num == PRIMARY)
+	fp_printf(fp, _("   Primary"));
+    else if (p->id == FREE_SPACE && p->num == LOGICAL)
+	fp_printf(fp, _("   Logical"));
+    else
+	fp_printf(fp, "%2d %-7.7s", p->num+1,
+		  IS_LOGICAL(p->num) ? _("Logical") : _("Primary"));
+
+    fp_printf(fp, " ");
+
+    fp_printf(fp, "%11lld%c", p->first_sector,
+	      ((p->first_sector/cylinder_size) !=
+	       ((float)p->first_sector/cylinder_size) ?
+	       '*' : ' '));
+
+    fp_printf(fp, "%11lld%c", p->last_sector,
+	      (((p->last_sector+1)/cylinder_size) !=
+	       ((float)(p->last_sector+1)/cylinder_size) ?
+	       '*' : ' '));
+
+    fp_printf(fp, "%6ld%c", p->offset,
+	      ((((p->first_sector == 0 || IS_LOGICAL(p->num)) &&
+		 (p->offset != sectors)) ||
+		(p->first_sector != 0 && IS_PRIMARY(p->num) &&
+		 p->offset != 0)) ?
+	       '#' : ' '));
+
+    size = p->last_sector - p->first_sector + 1;
+    fp_printf(fp, "%11lld%c", size,
+	      ((size/cylinder_size) != ((float)size/cylinder_size) ?
+	       '*' : ' '));
+
+    /* fp_printf(fp, " "); */
+
+    if (p->id == UNUSABLE)
+	sprintf(part_str, "%.15s", _("Unusable"));
+    else if (p->id == FREE_SPACE)
+	sprintf(part_str, "%.15s", _("Free Space"));
+    else if (partition_type_name(p->id))
+	sprintf(part_str, "%.15s (%02X)", _(partition_type_name(p->id)), p->id);
+    else
+	sprintf(part_str, "%.15s (%02X)", _("Unknown"), p->id);
+    fp_printf(fp, "%-20.20s", part_str);
+
+    fp_printf(fp, " ");
+
+    if (p->flags == ACTIVE_FLAG)
+	fp_printf(fp, _("Boot"), p->flags);
+    else if (p->flags != 0)
+	fp_printf(fp, _("(%02X)"), p->flags);
+    else
+	fp_printf(fp, _("None"), p->flags);
+
+    fp_printf(fp, "\n");
+}
+
+static void
+print_p_info(void) {
+    char fname[LINE_LENGTH];
+    FILE *fp;
+    int i, to_file, pext = is_extended(ext_info.id);
+
+    if (print_only) {
+	fp = stdout;
+	to_file = TRUE;
+    } else {
+	mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		 _("Enter filename or press RETURN to display on screen: "));
+
+	if ((to_file = get_string(fname, LINE_LENGTH, NULL)) < 0)
+	    return;
+
+	if (to_file) {
+	    if ((fp = fopen(fname, "w")) == NULL) {
+		char errstr[LINE_LENGTH];
+		snprintf(errstr, LINE_LENGTH, _("Cannot open file '%s'"), fname);
+		print_warning(errstr);
+		return;
+	    }
+	} else {
+	    fp = NULL;
+	    erase();
+	    move(0, 0);
+	}
+    }
+
+    fp_printf(fp, _("Partition Table for %s\n"), disk_device);
+    fp_printf(fp, "\n");
+    fp_printf(fp, _("               First       Last\n"));
+    fp_printf(fp, _(" # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag\n"));
+    fp_printf(fp, _("-- ------- ----------- ----------- ------ ----------- -------------------- ----\n"));
+
+    for (i = 0; i < num_parts; i++) {
+	if (pext && (p_info[i].first_sector >= ext_info.first_sector)) {
+	    print_p_info_entry(fp,&ext_info);
+	    pext = FALSE;
+	}
+	print_p_info_entry(fp, &(p_info[i]));
+    }
+
+    if (to_file) {
+	if (!print_only)
+	    fclose(fp);
+    } else {
+        menuContinue();
+    }
+}
+
+static void
+print_part_entry(FILE *fp, int num, partition_info *pi) {
+    long long first = 0, start = 0, end = 0, size = 0;
+    unsigned char ss, es, sh, eh;
+    int sc, ec;
+    int flags = 0, id = 0;
+
+    ss = sh = es = eh = 0;
+    sc = ec = 0;
+
+    if (pi != NULL) {
+	flags = pi->flags;
+	id = pi->id;
+
+	if (IS_LOGICAL(num))
+	    first = pi->offset;
+	else
+	    first = pi->first_sector + pi->offset;
+
+	start = pi->first_sector + pi->offset;
+	end = pi->last_sector;
+	size = end - start + 1;
+
+	set_hsc0(&sh, &ss, &sc, start);
+	set_hsc0(&eh, &es, &ec, end);
+    }
+
+    fp_printf(fp, "%2d  0x%02X %4d %4d %5d 0x%02X %4d %4d %5d %11lld %11lld\n",
+	      num+1, flags, sh, ss, sc, id, eh, es, ec, first, size);
+}
+
+
+static void
+print_part_table(void) {
+    int i, j, to_file;
+    char fname[LINE_LENGTH];
+    FILE *fp;
+
+    if (print_only) {
+	fp = stdout;
+	to_file = TRUE;
+    } else {
+	mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		 _("Enter filename or press RETURN to display on screen: "));
+
+	if ((to_file = get_string(fname, LINE_LENGTH, NULL)) < 0)
+	    return;
+
+	if (to_file) {
+	    if ((fp = fopen(fname, "w")) == NULL) {
+		char errstr[LINE_LENGTH];
+		snprintf(errstr, LINE_LENGTH, _("Cannot open file '%s'"), fname);
+		print_warning(errstr);
+		return;
+	    }
+	} else {
+	    fp = NULL;
+	    erase();
+	    move(0, 0);
+	}
+    }
+
+    fp_printf(fp, _("Partition Table for %s\n"), disk_device);
+    fp_printf(fp, "\n");
+    /* Three-line heading. Read "Start Sector" etc vertically. */
+    fp_printf(fp, _("         ---Starting----      ----Ending-----    Start     Number of\n"));
+    fp_printf(fp, _(" # Flags Head Sect  Cyl   ID  Head Sect  Cyl     Sector    Sectors\n"));
+    fp_printf(fp, _("-- ----- ---- ---- ----- ---- ---- ---- ----- ----------- -----------\n"));
+
+    for (i = 0; i < 4; i++) {
+	for (j = 0;
+	     j < num_parts && (p_info[j].id <= 0 || p_info[j].num != i);
+	     j++);
+	if (j < num_parts) {
+	    print_part_entry(fp, i, &(p_info[j]));
+	} else if (is_extended(ext_info.id) && ext_info.num == i) {
+	    print_part_entry(fp, i, &ext_info);
+	} else {
+	    print_part_entry(fp, i, NULL);
+	}
+    }
+
+    for (i = 0; i < num_parts; i++)
+	if (IS_LOGICAL(p_info[i].num))
+	    print_part_entry(fp, p_info[i].num, &(p_info[i]));
+
+    if (to_file) {
+	if (!print_only)
+	    fclose(fp);
+    } else {
+        menuContinue();
+    }
+}
+
+static void
+print_tables(void) {
+    int done = FALSE;
+
+    static struct MenuItem menuFormat[]=
+    {
+        { 'r', N_("Raw"), N_("Print the table using raw data format") },
+        { 's', N_("Sectors"), N_("Print the table ordered by sectors") },
+        { 't', N_("Table"), N_("Just print the partition table") },
+        { ESC, N_("Cancel"), N_("Don't print the table") },
+        { 0, NULL, NULL }
+    };
+
+    while (!done)
+	switch ( toupper(menuSimple( menuFormat, 2)) ) {
+	case 'R':
+	    print_raw_table();
+	    done = TRUE;
+	    break;
+	case 'S':
+	    print_p_info();
+	    done = TRUE;
+	    break;
+	case 'T':
+	    print_part_table();
+	    done = TRUE;
+	    break;
+	case ESC:
+	    done = TRUE;
+	    break;
+	}
+}
+
+#define END_OF_HELP "EOHS!"
+static void
+display_help(void) {
+    char *help_text[] = {
+	N_("Help Screen for cfdisk"),
+	"",
+	N_("This is cfdisk, a curses based disk partitioning program, which"),
+	N_("allows you to create, delete and modify partitions on your hard"),
+	N_("disk drive."),
+	"",
+	N_("Copyright (C) 1994-1999 Kevin E. Martin & aeb"),
+	"",
+	N_("Command      Meaning"),
+	N_("-------      -------"),
+	N_("  b          Toggle bootable flag of the current partition"),
+	N_("  d          Delete the current partition"),
+	N_("  g          Change cylinders, heads, sectors-per-track parameters"),
+	N_("             WARNING: This option should only be used by people who"),
+	N_("             know what they are doing."),
+	N_("  h          Print this screen"),
+	N_("  m          Maximize disk usage of the current partition"),
+	N_("             Note: This may make the partition incompatible with"),
+	N_("             DOS, OS/2, ..."),
+	N_("  n          Create new partition from free space"),
+	N_("  p          Print partition table to the screen or to a file"),
+	N_("             There are several different formats for the partition"),
+	N_("             that you can choose from:"),
+	N_("                r - Raw data (exactly what would be written to disk)"),
+	N_("                s - Table ordered by sectors"),
+	N_("                t - Table in raw format"),
+	N_("  q          Quit program without writing partition table"),
+	N_("  t          Change the filesystem type"),
+	N_("  u          Change units of the partition size display"),
+	N_("             Rotates through MB, sectors and cylinders"),
+	N_("  W          Write partition table to disk (must enter upper case W)"),
+        N_("             Since this might destroy data on the disk, you must"),
+	N_("             either confirm or deny the write by entering `yes' or"),
+	N_("             `no'"),
+	N_("Up Arrow     Move cursor to the previous partition"),
+	N_("Down Arrow   Move cursor to the next partition"),
+	N_("CTRL-L       Redraws the screen"),
+	N_("  ?          Print this screen"),
+	"",
+	N_("Note: All of the commands can be entered with either upper or lower"),
+	N_("case letters (except for Writes)."),
+	END_OF_HELP
+    };
+
+    int cur_line = 0;
+    FILE *fp = NULL;
+
+    erase();
+    move(0, 0);
+    while (strcmp(help_text[cur_line], END_OF_HELP)) {
+	if (help_text[cur_line][0])
+	    fp_printf(fp, "%s\n", _(help_text[cur_line]));
+	else
+	    fp_printf(fp, "\n");
+	cur_line++;
+    }
+    menuContinue();
+}
+
+static int
+change_geometry(void) {
+    int ret_val = FALSE;
+    int done = FALSE;
+    char def[LINE_LENGTH];
+    char response[LINE_LENGTH];
+    long long tmp_val;
+    int i;
+
+    while (!done) {
+        static struct MenuItem menuGeometry[]=
+        {
+            { 'c', N_("Cylinders"), N_("Change cylinder geometry") },
+            { 'h', N_("Heads"), N_("Change head geometry") },
+            { 's', N_("Sectors"), N_("Change sector geometry") },
+            { 'd', N_("Done"), N_("Done with changing geometry") },
+            { 0, NULL, NULL }
+        };
+	move(COMMAND_LINE_Y, COMMAND_LINE_X);
+	clrtoeol();
+	refresh();
+
+	clear_warning();
+
+	switch (toupper( menuSimple(menuGeometry, 3) )) {
+	case 'C':
+	    sprintf(def, "%llu", actual_size/cylinder_size);
+	    mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		     _("Enter the number of cylinders: "));
+	    i = get_string(response, LINE_LENGTH, def);
+	    if (i == GS_DEFAULT) {
+		user_cylinders = actual_size/cylinder_size;
+		ret_val = TRUE;
+	    } else if (i > 0) {
+		tmp_val = atoll(response);
+		if (tmp_val > 0) {
+		    user_cylinders = tmp_val;
+		    ret_val = TRUE;
+		} else
+		    print_warning(_("Illegal cylinders value"));
+	    }
+	    break;
+	case 'H':
+	    sprintf(def, "%d", heads);
+	    mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		     _("Enter the number of heads: "));
+	    if (get_string(response, LINE_LENGTH, def) > 0) {
+		tmp_val = atoll(response);
+		if (tmp_val > 0 && tmp_val <= MAX_HEADS) {
+		    user_heads = tmp_val;
+		    ret_val = TRUE;
+		} else
+		    print_warning(_("Illegal heads value"));
+	    }
+	    break;
+	case 'S':
+	    sprintf(def, "%d", sectors);
+	    mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X,
+		     _("Enter the number of sectors per track: "));
+	    if (get_string(response, LINE_LENGTH, def) > 0) {
+		tmp_val = atoll(response);
+		if (tmp_val > 0 && tmp_val <= MAX_SECTORS) {
+		    user_sectors = tmp_val;
+		    ret_val = TRUE;
+		} else
+		    print_warning(_("Illegal sectors value"));
+	    }
+	    break;
+	case ESC:
+	case 'D':
+	    done = TRUE;
+	    break;
+	default:
+	    putchar(BELL);
+	    break;
+	}
+
+	if (ret_val) {
+	    decide_on_geometry();
+	    draw_screen();
+	}
+    }
+
+    if (ret_val) {
+	long long disk_end;
+
+	disk_end = total_size-1;
+
+	if (p_info[num_parts-1].last_sector > disk_end) {
+	    while (p_info[num_parts-1].first_sector > disk_end) {
+		if (p_info[num_parts-1].id == FREE_SPACE ||
+		    p_info[num_parts-1].id == UNUSABLE)
+		    remove_part(num_parts-1);
+		else
+		    del_part(num_parts-1);
+	    }
+
+	    p_info[num_parts-1].last_sector = disk_end;
+
+	    if (ext_info.last_sector > disk_end)
+		ext_info.last_sector = disk_end;
+	} else if (p_info[num_parts-1].last_sector < disk_end) {
+	    if (p_info[num_parts-1].id == FREE_SPACE ||
+		p_info[num_parts-1].id == UNUSABLE) {
+		p_info[num_parts-1].last_sector = disk_end;
+	    } else {
+		insert_empty_part(num_parts,
+				  p_info[num_parts-1].last_sector+1,
+				  disk_end);
+	    }
+	}
+
+	/* Make sure the partitions are correct */
+	check_part_info();
+    }
+
+    return ret_val;
+}
+
+static void
+change_id(int i) {
+    char id[LINE_LENGTH], def[LINE_LENGTH];
+    int num_types = 0;
+    int num_across, num_down;
+    int len, new_id = ((p_info[i].id == LINUX) ? LINUX_SWAP : LINUX);
+    int y_start, y_end, row, row_min, row_max, row_offset, j, needmore;
+
+    for (j = 1; i386_sys_types[j].name; j++) ;
+    num_types = j-1;		/* do not count the Empty type */
+
+    num_across = COLS/COL_ID_WIDTH;
+    num_down = (((float)num_types)/num_across + 1);
+    y_start = COMMAND_LINE_Y - 1 - num_down;
+    if (y_start < 1) {
+	y_start = 1;
+	y_end = COMMAND_LINE_Y - 2;
+    } else {
+	if (y_start > DISK_TABLE_START+cur_part+4)
+	    y_start = DISK_TABLE_START+cur_part+4;
+	y_end = y_start + num_down - 1;
+    }
+
+    row_min = 1;
+    row_max = COMMAND_LINE_Y - 2;
+    row_offset = 0;
+    do {
+	for (j = y_start - 1; j <= y_end + 1; j++) {
+	    move(j, 0);
+	    clrtoeol();
+	}
+	needmore = 0;
+	for (j = 1; i386_sys_types[j].name; j++) {
+	    row = y_start + (j-1) % num_down - row_offset;
+	    if (row >= row_min && row <= row_max) {
+		move(row, ((j-1)/num_down)*COL_ID_WIDTH + 1);
+		printw("%02X %-20.20s",
+		       i386_sys_types[j].type,
+		       _(i386_sys_types[j].name));
+	    }
+	    if (row > row_max)
+		needmore = 1;
+	}
+	if (needmore)
+		menuContinue();
+	row_offset += (row_max - row_min + 1);
+    } while(needmore);
+
+    sprintf(def, "%02X", new_id);
+    mvaddstr(COMMAND_LINE_Y, COMMAND_LINE_X, _("Enter filesystem type: "));
+    if ((len = get_string(id, 2, def)) <= 0 && len != GS_DEFAULT)
+	return;
+
+    if (len != GS_DEFAULT) {
+	if (!isxdigit(id[0]))
+	    return;
+	new_id = (isdigit(id[0]) ? id[0] - '0' : tolower(id[0]) - 'a' + 10);
+	if (len == 2) {
+	    if (isxdigit(id[1]))
+		new_id = new_id*16 +
+		    (isdigit(id[1]) ? id[1] - '0' : tolower(id[1]) - 'a' + 10);
+	    else
+		return;
+	}
+    }
+
+    if (new_id == 0)
+	print_warning(_("Cannot change FS Type to empty"));
+    else if (is_extended(new_id))
+	print_warning(_("Cannot change FS Type to extended"));
+    else
+	p_info[i].id = new_id;
+}
+
+static void
+draw_partition(int i) {
+    int j;
+    int y = i + DISK_TABLE_START + 2 - (cur_part/NUM_ON_SCREEN)*NUM_ON_SCREEN;
+    char *t;
+    long long size;
+    double fsize;
+
+    if (!arrow_cursor) {
+	move(y, 0);
+	for (j = 0; j < COLS; j++)
+	    addch(' ');
+    }
+
+    if (p_info[i].id > 0) {
+	char *dbn = my_basename(disk_device);
+	int l = strlen(dbn);
+	int digit_last = isdigit(dbn[l-1]);
+
+	mvprintw(y, NAME_START,
+		 "%s%s%d", dbn, (digit_last ? "p" : ""),
+		 p_info[i].num+1);
+	if (p_info[i].flags) {
+	    if (p_info[i].flags == ACTIVE_FLAG)
+		mvaddstr(y, FLAGS_START, _("Boot"));
+	    else
+		mvprintw(y, FLAGS_START, _("Unk(%02X)"), p_info[i].flags);
+	    if (p_info[i].first_sector == 0 || IS_LOGICAL(p_info[i].num)) {
+		if (p_info[i].offset != sectors)
+		    addstr(_(", NC"));
+	    } else {
+		if (p_info[i].offset != 0)
+		    addstr(_(", NC"));
+	    }
+	} else {
+	    if (p_info[i].first_sector == 0 || IS_LOGICAL(p_info[i].num)) {
+		if (p_info[i].offset != sectors)
+		    mvaddstr(y, FLAGS_START, _("NC"));
+	    } else {
+		if (p_info[i].offset != 0)
+		    mvaddstr(y, FLAGS_START, _("NC"));
+	    }
+	}
+    }
+    mvaddstr(y, PTYPE_START,
+	     (p_info[i].id == UNUSABLE ? "" :
+	      (IS_LOGICAL(p_info[i].num) ? _("Logical") :
+	       (p_info[i].num >= 0 ? _("Primary") :
+		(p_info[i].num == PRI_OR_LOG ? _("Pri/Log") :
+		 (p_info[i].num == PRIMARY ? _("Primary") : _("Logical")))))));
+
+    t = partition_type_text(i);
+    if (t)
+	 mvaddstr(y, FSTYPE_START, t);
+    else
+	 mvprintw(y, FSTYPE_START, _("Unknown (%02X)"), p_info[i].id);
+
+    if (p_info[i].volume_label[0]) {
+	int l = strlen(p_info[i].volume_label);
+	int s = SIZE_START-5-l;
+	mvprintw(y, (s > LABEL_START) ? LABEL_START : s,
+		 " [%s]  ", p_info[i].volume_label);
+    }
+
+    size = p_info[i].last_sector - p_info[i].first_sector + 1;
+    fsize = (double) size * SECTOR_SIZE;
+    if (display_units == SECTORS)
+	mvprintw(y, SIZE_START, "%11lld", size);
+    else if (display_units == CYLINDERS)
+	mvprintw(y, SIZE_START, "%11lld", size/cylinder_size);
+    else if (display_units == MEGABYTES)
+	mvprintw(y, SIZE_START, "%11.2f", ceiling((100*fsize)/(K*K))/100);
+    else if (display_units == GIGABYTES)
+	mvprintw(y, SIZE_START, "%11.2f", ceiling((100*fsize)/(K*K*K))/100);
+    if (size % cylinder_size != 0 ||
+	p_info[i].first_sector % cylinder_size != 0)
+	mvprintw(y, COLUMNS-1, "*");
+}
+
+static void
+init_const(void) {
+    if (!defined) {
+	NAME_START = (((float)NAME_START)/COLUMNS)*COLS;
+	FLAGS_START = (((float)FLAGS_START)/COLUMNS)*COLS;
+	PTYPE_START = (((float)PTYPE_START)/COLUMNS)*COLS;
+	FSTYPE_START = (((float)FSTYPE_START)/COLUMNS)*COLS;
+	LABEL_START = (((float)LABEL_START)/COLUMNS)*COLS;
+	SIZE_START = (((float)SIZE_START)/COLUMNS)*COLS;
+	COMMAND_LINE_X = (((float)COMMAND_LINE_X)/COLUMNS)*COLS;
+
+	COMMAND_LINE_Y = LINES - 4;
+	WARNING_START = LINES - 2;
+
+	if ((NUM_ON_SCREEN = COMMAND_LINE_Y - DISK_TABLE_START - 3) <= 0)
+	    NUM_ON_SCREEN = 1;
+
+	COLUMNS = COLS;
+	defined = TRUE;
+    }
+}
+
+static void
+draw_screen(void) {
+    int i;
+    char *line;
+
+    line = (char *) xmalloc((COLS+1)*sizeof(char));
+
+    if (warning_last_time) {
+	for (i = 0; i < COLS; i++) {
+	    move(WARNING_START, i);
+	    line[i] = inch();
+	}
+	line[COLS] = 0;
+    }
+
+    erase();
+
+    if (warning_last_time)
+	mvaddstr(WARNING_START, 0, line);
+
+
+    snprintf(line, COLS+1, "cfdisk (%s)", PACKAGE_STRING);
+    mvaddstr(HEADER_START, (COLS-strlen(line))/2, line);
+    snprintf(line, COLS+1, _("Disk Drive: %s"), disk_device);
+    mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line);
+    {
+	    long long bytes = actual_size*(long long) SECTOR_SIZE;
+	    long long megabytes = bytes/(K*K);
+
+	    if (megabytes < 10000)
+		    sprintf(line, _("Size: %lld bytes, %lld MB"),
+			    bytes, megabytes);
+	    else
+		    sprintf(line, _("Size: %lld bytes, %lld.%lld GB"),
+			    bytes, megabytes/K, (10*megabytes/K)%10);
+    }
+    mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line);
+    snprintf(line, COLS+1, _("Heads: %d   Sectors per Track: %d   Cylinders: %lld"),
+	    heads, sectors, cylinders);
+    mvaddstr(HEADER_START+4, (COLS-strlen(line))/2, line);
+
+    mvaddstr(DISK_TABLE_START, NAME_START, _("Name"));
+    mvaddstr(DISK_TABLE_START, FLAGS_START, _("Flags"));
+    mvaddstr(DISK_TABLE_START, PTYPE_START-1, _("Part Type"));
+    mvaddstr(DISK_TABLE_START, FSTYPE_START, _("FS Type"));
+    mvaddstr(DISK_TABLE_START, LABEL_START+1, _("[Label]"));
+    if (display_units == SECTORS)
+	mvaddstr(DISK_TABLE_START, SIZE_START, _("    Sectors"));
+    else if (display_units == CYLINDERS)
+	mvaddstr(DISK_TABLE_START, SIZE_START, _("  Cylinders"));
+    else if (display_units == MEGABYTES)
+	mvaddstr(DISK_TABLE_START, SIZE_START, _("  Size (MB)"));
+    else if (display_units == GIGABYTES)
+	mvaddstr(DISK_TABLE_START, SIZE_START, _("  Size (GB)"));
+
+    move(DISK_TABLE_START+1, 1);
+    for (i = 1; i < COLS-1; i++)
+	addch('-');
+
+    if (NUM_ON_SCREEN >= num_parts)
+	for (i = 0; i < num_parts; i++)
+	    draw_partition(i);
+    else
+	for (i = (cur_part/NUM_ON_SCREEN)*NUM_ON_SCREEN;
+	     i < NUM_ON_SCREEN + (cur_part/NUM_ON_SCREEN)*NUM_ON_SCREEN &&
+	     i < num_parts;
+	     i++)
+	    draw_partition(i);
+
+    free(line);
+}
+
+static int
+draw_cursor(int move) {
+    if (move != 0 && (cur_part + move < 0 || cur_part + move >= num_parts))
+	return -1;
+
+    if (arrow_cursor)
+	mvaddstr(DISK_TABLE_START + cur_part + 2
+		 - (cur_part/NUM_ON_SCREEN)*NUM_ON_SCREEN, 0, "   ");
+    else
+	draw_partition(cur_part);
+
+    cur_part += move;
+
+    if (((cur_part - move)/NUM_ON_SCREEN)*NUM_ON_SCREEN !=
+	(cur_part/NUM_ON_SCREEN)*NUM_ON_SCREEN)
+	draw_screen();
+
+    if (arrow_cursor)
+	mvaddstr(DISK_TABLE_START + cur_part + 2
+		 - (cur_part/NUM_ON_SCREEN)*NUM_ON_SCREEN, 0, "-->");
+    else {
+	standout();
+	draw_partition(cur_part);
+	standend();
+    }
+
+    return 0;
+}
+
+static void
+do_curses_fdisk(void) {
+    int done = FALSE;
+    char command;
+    int is_first_run = TRUE;
+
+    static struct MenuItem menuMain[] = {
+        { 'b', N_("Bootable"), N_("Toggle bootable flag of the current partition") },
+        { 'd', N_("Delete"), N_("Delete the current partition") },
+        { 'g', N_("Geometry"), N_("Change disk geometry (experts only)") },
+        { 'h', N_("Help"), N_("Print help screen") },
+        { 'm', N_("Maximize"), N_("Maximize disk usage of the current partition (experts only)") },
+        { 'n', N_("New"), N_("Create new partition from free space") },
+        { 'p', N_("Print"), N_("Print partition table to the screen or to a file") },
+        { 'q', N_("Quit"), N_("Quit program without writing partition table") },
+        { 't', N_("Type"), N_("Change the filesystem type (DOS, Linux, OS/2 and so on)") },
+        { 'u', N_("Units"), N_("Change units of the partition size display (MB, sect, cyl)") },
+        { 'W', N_("Write"), N_("Write partition table to disk (this might destroy data)") },
+        { 0, NULL, NULL }
+    };
+    curses_started = 1;
+    initscr();
+    init_const();
+
+    old_SIGINT = signal(SIGINT, die);
+    old_SIGTERM = signal(SIGTERM, die);
+#ifdef DEBUG
+    signal(SIGINT, old_SIGINT);
+    signal(SIGTERM, old_SIGTERM);
+#endif
+
+    cbreak();
+    noecho();
+    nonl();
+
+    fill_p_info();
+
+    draw_screen();
+
+    while (!done) {
+	char *s;
+
+	(void)draw_cursor(0);
+
+	if (p_info[cur_part].id == FREE_SPACE) {
+	    s = ((opentype == O_RDWR) ? "hnpquW" : "hnpqu");
+	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
+	        s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 5);
+	} else if (p_info[cur_part].id > 0) {
+	    s = ((opentype == O_RDWR) ? "bdhmpqtuW" : "bdhmpqtu");
+	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
+	        s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, is_first_run ? 7 : 0);
+	} else {
+	    s = ((opentype == O_RDWR) ? "hpquW" : "hpqu");
+	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
+	        s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0);
+	}
+	is_first_run = FALSE;
+	switch ( command ) {
+	case 'B':
+	case 'b':
+	    if (p_info[cur_part].id > 0)
+		p_info[cur_part].flags ^= 0x80;
+	    else
+		print_warning(_("Cannot make this partition bootable"));
+	    break;
+	case 'D':
+	case 'd':
+	    if (p_info[cur_part].id > 0) {
+		del_part(cur_part);
+		if (cur_part >= num_parts)
+		    cur_part = num_parts - 1;
+		draw_screen();
+	    } else
+		print_warning(_("Cannot delete an empty partition"));
+	    break;
+	case 'G':
+	case 'g':
+	    if (change_geometry())
+		draw_screen();
+	    break;
+	case 'M':
+	case 'm':
+	    if (p_info[cur_part].id > 0) {
+		if (p_info[cur_part].first_sector == 0 ||
+		    IS_LOGICAL(p_info[cur_part].num)) {
+		    if (p_info[cur_part].offset == sectors)
+			p_info[cur_part].offset = 1;
+		    else
+			p_info[cur_part].offset = sectors;
+		    draw_screen();
+		} else if (p_info[cur_part].offset != 0)
+		    p_info[cur_part].offset = 0;
+		else
+		    print_warning(_("Cannot maximize this partition"));
+	    } else
+		print_warning(_("Cannot maximize this partition"));
+	    break;
+	case 'N':
+	case 'n':
+	    if (p_info[cur_part].id == FREE_SPACE) {
+		new_part(cur_part);
+		draw_screen();
+	    } else if (p_info[cur_part].id == UNUSABLE)
+		print_warning(_("This partition is unusable"));
+	    else
+		print_warning(_("This partition is already in use"));
+	    break;
+	case 'P':
+	case 'p':
+	    print_tables();
+	    draw_screen();
+	    break;
+	case 'Q':
+	case 'q':
+	    done = TRUE;
+	    break;
+	case 'T':
+	case 't':
+	    if (p_info[cur_part].id > 0) {
+		change_id(cur_part);
+		draw_screen();
+	    } else
+		print_warning(_("Cannot change the type of an empty partition"));
+	    break;
+	case 'U':
+	case 'u':
+	    if (display_units == GIGABYTES)
+		display_units = MEGABYTES;
+	    else if (display_units == MEGABYTES)
+		display_units = SECTORS;
+	    else if (display_units == SECTORS)
+		display_units = CYLINDERS;
+	    else if (display_units == CYLINDERS)
+		display_units = MEGABYTES; 	/* not yet GIGA */
+	    draw_screen();
+	    break;
+	case 'W':
+	    write_part_table();
+	    break;
+	case 'H':
+	case 'h':
+	case '?':
+	    display_help();
+	    draw_screen();
+	    break;
+	case MENU_UP : /* Up arrow */
+	    if (!draw_cursor(-1))
+		command = 0;
+	    else
+		print_warning(_("No more partitions"));
+	    break;
+	case MENU_DOWN : /* Down arrow */
+	    if (!draw_cursor(1))
+		command = 0;
+	    else
+		print_warning(_("No more partitions"));
+	    break;
+	case REDRAWKEY:
+	    clear();
+	    draw_screen();
+	    break;
+	default:
+	    print_warning(_("Illegal command"));
+	    putchar(BELL); /* CTRL-G */
+	}
+    }
+
+    die_x(0);
+}
+
+static void
+copyright(void) {
+    fprintf(stderr, _("Copyright (C) 1994-2002 Kevin E. Martin & aeb\n"));
+}
+
+static void
+usage(char *prog_name) {
+    /* Unfortunately, xgettext does not handle multi-line strings */
+    /* so, let's use explicit \n's instead */
+    fprintf(stderr, _("\n"
+"Usage:\n"
+"Print version:\n"
+"        %s -v\n"
+"Print partition table:\n"
+"        %s -P {r|s|t} [options] device\n"
+"Interactive use:\n"
+"        %s [options] device\n"
+"\n"
+"Options:\n"
+"-a: Use arrow instead of highlighting;\n"
+"-z: Start with a zero partition table, instead of reading the pt from disk;\n"
+"-c C -h H -s S: Override the kernel's idea of the number of cylinders,\n"
+"                the number of heads and the number of sectors/track.\n\n"),
+    prog_name, prog_name, prog_name);
+
+    copyright();
+}
+
+int
+main(int argc, char **argv)
+{
+    int c;
+    int i, len;
+
+    setlocale(LC_ALL, "");
+    bindtextdomain(PACKAGE, LOCALEDIR);
+    textdomain(PACKAGE);
+
+    while ((c = getopt(argc, argv, "ac:gh:s:vzP:")) != -1)
+	switch (c) {
+	case 'a':
+	    arrow_cursor = TRUE;
+	    break;
+	case 'c':
+	    user_cylinders = cylinders = atoll(optarg);
+	    if (cylinders <= 0) {
+		fprintf(stderr, "%s: %s\n", argv[0], _("Illegal cylinders value"));
+		exit(1);
+	    }
+	    break;
+	case 'g':
+	    use_partition_table_geometry = TRUE;
+	    break;
+	case 'h':
+	    user_heads = heads = atoi(optarg);
+	    if (heads <= 0 || heads > MAX_HEADS) {
+		fprintf(stderr, "%s: %s\n", argv[0], _("Illegal heads value"));
+		exit(1);
+	    }
+	    break;
+	case 's':
+	    user_sectors = sectors = atoi(optarg);
+	    if (sectors <= 0 || sectors > MAX_SECTORS) {
+		fprintf(stderr, "%s: %s\n", argv[0], _("Illegal sectors value"));
+		exit(1);
+	    }
+	    break;
+	case 'v':
+	    fprintf(stderr, "cfdisk (%s)\n", PACKAGE_STRING);
+	    copyright();
+	    exit(0);
+	case 'z':
+	    zero_table = TRUE;
+	    break;
+	case 'P':
+	    len = strlen(optarg);
+	    for (i = 0; i < len; i++) {
+		switch (optarg[i]) {
+		case 'r':
+		    print_only |= PRINT_RAW_TABLE;
+		    break;
+		case 's':
+		    print_only |= PRINT_SECTOR_TABLE;
+		    break;
+		case 't':
+		    print_only |= PRINT_PARTITION_TABLE;
+		    break;
+		default:
+		    usage(argv[0]);
+		    exit(1);
+		}
+	    }
+	    break;
+	default:
+	    usage(argv[0]);
+	    exit(1);
+	}
+
+    if (argc-optind == 1)
+	disk_device = argv[optind];
+    else if (argc-optind != 0) {
+	usage(argv[0]);
+	exit(1);
+    } else if ((fd = open(DEFAULT_DEVICE, O_RDONLY)) < 0)
+	disk_device = ALTERNATE_DEVICE;
+    else close(fd);
+
+    if (print_only) {
+	fill_p_info();
+	if (print_only & PRINT_RAW_TABLE)
+	    print_raw_table();
+	if (print_only & PRINT_SECTOR_TABLE)
+	    print_p_info();
+	if (print_only & PRINT_PARTITION_TABLE)
+	    print_part_table();
+    } else
+	do_curses_fdisk();
+
+    return 0;
+}
diff --git a/util-linux-ng-2.17.2/fdisk/common.h b/util-linux-ng-2.17.2/fdisk/common.h
new file mode 100644
index 0000000..352b9a5
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/common.h
@@ -0,0 +1,15 @@
+#ifndef FDISK_COMMON_H
+#define FDISK_COMMON_H
+
+/* common stuff for fdisk, cfdisk, sfdisk */
+
+struct systypes {
+	unsigned char type;
+	char *name;
+};
+
+extern struct systypes i386_sys_types[];
+
+extern char *partname(char *dev, int pno, int lth);
+
+#endif /* FDISK_COMMON_H */
diff --git a/util-linux-ng-2.17.2/fdisk/fdisk.8 b/util-linux-ng-2.17.2/fdisk/fdisk.8
new file mode 100644
index 0000000..30dc967
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisk.8
@@ -0,0 +1,275 @@
+.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
+.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
+.\" May be distributed under the GNU General Public License
+.TH FDISK 8 "11 June 1998" "Linux 2.0" "Linux Programmer's Manual"
+.SH NAME
+fdisk \- Partition table manipulator for Linux
+.SH SYNOPSIS
+.B fdisk
+.RB [ \-uc ]
+.RB [ \-b
+.IR sectorsize ]
+.RB [ \-C
+.IR cyls ]
+.RB [ \-H
+.IR heads ]
+.RB [ \-S
+.IR sects ]
+.I device
+.sp
+.B fdisk \-l
+.RB [ \-u ]
+.RI [ device ...]
+.sp
+.B fdisk \-s
+.IR partition ...
+.sp
+.B fdisk \-v
+.sp
+.B fdisk \-h
+.SH DESCRIPTION
+Hard disks can be divided into one or more logical disks called
+.IR partitions .
+This division is described in the
+.I "partition table"
+found in sector 0 of the disk.
+
+In the BSD world one talks about `disk slices' and a `disklabel'.
+
+Linux needs at least one partition, namely for its root file system.
+It can use swap files and/or swap partitions, but the latter are more
+efficient. So, usually one will want a second Linux partition
+dedicated as swap partition.
+On Intel compatible hardware, the BIOS that boots the system
+can often only access the first 1024 cylinders of the disk.
+For this reason people with large disks often create a third partition,
+just a few MB large, typically mounted on
+.IR /boot ,
+to store the kernel image and a few auxiliary files needed at boot time,
+so as to make sure that this stuff is accessible to the BIOS.
+There may be reasons of security, ease of administration and backup,
+or testing, to use more than the minimum number of partitions.
+
+.B fdisk
+(in the first form of invocation)
+is a menu driven program for creation and manipulation of
+partition tables.
+It understands DOS type partition tables and BSD or SUN type disklabels.
+
+.B fdisk
+doesn't understand GUID Partition Table (GPT) and
+it is not designed for large partitions. In particular case use more advanced GNU
+.BR parted (8).
+
+The
+.I device
+is usually /dev/sda, /dev/sdb or so. A device name refers to the entire disk.
+The old systems without libata (a library used inside the Linux kernel to
+support ATA host controllers and devices) make a difference between IDE and
+SCSI disks. In such a case the device name will be /dev/hd* (IDE) or /dev/sd*
+(SCSI).
+
+The
+.I partition
+is a
+.I device
+name followed by a partition number.  For example,
+.B /dev/sda1
+is the first partition on the first hard disk in the system.
+See also Linux kernel documentation (the Documentation/devices.txt file).
+
+A BSD/SUN type disklabel can describe 8 partitions,
+the third of which should be a `whole disk' partition.
+Do not start a partition that actually uses its first sector
+(like a swap partition) at cylinder 0, since that will
+destroy the disklabel.
+
+An IRIX/SGI type disklabel can describe 16 partitions,
+the eleventh of which should be an entire `volume' partition,
+while the ninth should be labeled `volume header'.
+The volume header will also cover the partition table, i.e.,
+it starts at block zero and extends by default over five cylinders.
+The remaining space in the volume header may be used by header
+directory entries.  No partitions may overlap with the volume header.
+Also do not change its type and make some file system on it, since
+you will lose the partition table.  Use this type of label only when
+working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.
+
+A DOS type partition table can describe an unlimited number
+of partitions. In sector 0 there is room for the description
+of 4 partitions (called `primary'). One of these may be an
+extended partition; this is a box holding logical partitions,
+with descriptors found in a linked list of sectors, each
+preceding the corresponding logical partitions.
+The four primary partitions, present or not, get numbers 1-4.
+Logical partitions start numbering from 5.
+
+In a DOS type partition table the starting offset and the size
+of each partition is stored in two ways: as an absolute number
+of sectors (given in 32 bits) and as a Cylinders/Heads/Sectors
+triple (given in 10+8+6 bits). The former is OK - with 512-byte
+sectors this will work up to 2 TB. The latter has two different
+problems. First of all, these C/H/S fields can be filled only
+when the number of heads and the number of sectors per track
+are known. Secondly, even if we know what these numbers should be,
+the 24 bits that are available do not suffice.
+DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S.
+
+If possible,
+.B fdisk
+will obtain the disk geometry automatically.  This is not
+necessarily the physical disk geometry (indeed, modern disks do not
+really have anything like a physical geometry, certainly not something
+that can be described in simplistic Cylinders/Heads/Sectors form),
+but is the disk geometry that MS-DOS uses for the partition table.
+
+Usually all goes well by default, and there are no problems if
+Linux is the only system on the disk. However, if the disk has
+to be shared with other operating systems, it is often a good idea
+to let an fdisk from another operating system make at least one
+partition. When Linux boots it looks at the partition table, and
+tries to deduce what (fake) geometry is required for good
+cooperation with other systems.
+
+Whenever a partition table is printed out, a consistency check is performed
+on the partition table entries.  This check verifies that the physical and
+logical start and end points are identical, and that the partition starts
+and ends on a cylinder boundary (except for the first partition).
+
+Some versions of MS-DOS create a first partition which does not begin
+on a cylinder boundary, but on sector 2 of the first cylinder.
+Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but
+this is unlikely to cause difficulty unless you have OS/2 on your machine.
+
+A sync() and a BLKRRPART ioctl() (reread partition table from disk)
+are performed before exiting when the partition table has been updated.
+Long ago it used to be necessary to reboot after the use of fdisk.
+I do not think this is the case anymore - indeed, rebooting too quickly
+might cause loss of not-yet-written data. Note that both the kernel
+and the disk hardware may buffer data.
+
+.SH "DOS 6.x WARNING"
+
+The DOS 6.x FORMAT command looks for some information in the first
+sector of the data area of the partition, and treats this information
+as more reliable than the information in the partition table.  DOS
+FORMAT expects DOS FDISK to clear the first 512 bytes of the data area
+of a partition whenever a size change occurs.  DOS FORMAT will look at
+this extra information even if the /U flag is given -- we consider
+this a bug in DOS FORMAT and DOS FDISK.
+
+The bottom line is that if you use cfdisk or fdisk to change the size of a
+DOS partition table entry, then you must also use
+.B dd
+to zero the first 512 bytes of that partition before using DOS FORMAT to
+format the partition.  For example, if you were using cfdisk to make a DOS
+partition table entry for /dev/sda1, then (after exiting fdisk or cfdisk
+and rebooting Linux so that the partition table information is valid) you
+would use the command "dd if=/dev/zero of=/dev/sda1 bs=512 count=1" to zero
+the first 512 bytes of the partition.
+
+.B BE EXTREMELY CAREFUL
+if you use the
+.B dd
+command, since a small typo can make all of the data on your disk useless.
+
+For best results, you should always use an OS-specific partition table
+program.  For example, you should make DOS partitions with the DOS FDISK
+program and Linux partitions with the Linux fdisk or Linux cfdisk program.
+
+.SH OPTIONS
+.TP
+.BI "\-b " sectorsize
+Specify the sector size of the disk. Valid values are 512, 1024, 2048 or 4096.
+(Recent kernels know the sector size. Use this only on old kernels or
+to override the kernel's ideas.) Since util-linux-ng 2.17 fdisk differentiates
+between logical and physical sector size. This option changes both sector sizes to
+.IB sectorsize .
+.TP
+.BI \-h
+Print help and then exit.
+.TP
+.BI \-c
+Switch off DOS-compatible mode. (Recommended)
+.TP
+.BI "\-C " cyls
+Specify the number of cylinders of the disk.
+I have no idea why anybody would want to do so.
+.TP
+.BI "\-H " heads
+Specify the number of heads of the disk. (Not the physical number,
+of course, but the number used for partition tables.)
+Reasonable values are 255 and 16.
+.TP
+.BI "\-S " sects
+Specify the number of sectors per track of the disk.
+(Not the physical number, of course, but the number used for
+partition tables.)
+A reasonable value is 63.
+.TP
+.B \-l
+List the partition tables for the specified devices and then exit.
+If no devices are given, those mentioned in
+.I /proc/partitions
+(if that exists) are used.
+.TP
+.B \-u
+When listing partition tables, give sizes in sectors instead
+of cylinders.
+.TP
+.BI "\-s " partition
+The
+.I size
+of the partition (in blocks) is printed on the standard output.
+.TP
+.B \-v
+Print version number of
+.B fdisk
+program and exit.
+.SH BUGS
+There are several *fdisk programs around.
+Each has its problems and strengths.
+Try them in the order
+.BR cfdisk ,
+.BR fdisk ,
+.BR sfdisk .
+(Indeed,
+.B cfdisk
+is a beautiful program that has strict requirements on
+the partition tables it accepts, and produces high quality partition
+tables. Use it if you can.
+.B fdisk
+is a buggy program that does fuzzy things - usually it happens to
+produce reasonable results. Its single advantage is that it has
+some support for BSD disk labels and other non-DOS partition tables.
+Avoid it if you can.
+.B sfdisk
+is for hackers only - the user interface is terrible, but it is
+more correct than fdisk and more powerful than both fdisk and cfdisk.
+Moreover, it can be used noninteractively.)
+.PP
+These days there also is
+.BR parted .
+The cfdisk interface is nicer, but parted does much more: it not only
+resizes partitions, but also the filesystems that live in them.
+.PP
+The IRIX/SGI type disklabel is currently not supported by the kernel.
+Moreover, IRIX/SGI header directories are not fully supported yet.
+.PP
+The option `dump partition table to file' is missing.
+.\" .SH AUTHORS
+.\" A. V. Le Blanc (LeBlanc@mcc.ac.uk)
+.\" Bernhard Fastenrath (fasten@informatik.uni-bonn.de)
+.\" Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+.\" Andreas Neuper (ANeuper@GUUG.de)
+.\" and many others.
+.SH "SEE ALSO"
+.BR cfdisk (8),
+.BR sfdisk (8),
+.BR mkfs (8),
+.BR parted (8),
+.BR partprobe (8),
+.BR kpartx (8)
+.SH AVAILABILITY
+The fdisk command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/fdisk/fdisk.c b/util-linux-ng-2.17.2/fdisk/fdisk.c
new file mode 100644
index 0000000..1d7196e
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisk.c
@@ -0,0 +1,3114 @@
+/* fdisk.c -- Partition table manipulator for Linux.
+ *
+ * Copyright (C) 1992  A. V. Le Blanc (LeBlanc@mcc.ac.uk)
+ *
+ * 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 1 or
+ * (at your option) any later version.
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <setjmp.h>
+#include <errno.h>
+#include <getopt.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <time.h>
+#include <limits.h>
+
+#include "nls.h"
+#include "blkdev.h"
+#include "common.h"
+#include "fdisk.h"
+#include "wholedisk.h"
+
+#include "fdisksunlabel.h"
+#include "fdisksgilabel.h"
+#include "fdiskaixlabel.h"
+#include "fdiskmaclabel.h"
+
+#ifdef HAVE_LINUX_COMPILER_H
+#include <linux/compiler.h>
+#endif
+#ifdef HAVE_LINUX_BLKPG_H
+#include <linux/blkpg.h>
+#endif
+#ifdef HAVE_LIBBLKID_INTERNAL
+#include <blkid.h>
+#endif
+
+#include "gpt.h"
+
+static void delete_partition(int i);
+
+#define hex_val(c)	({ \
+				char _c = (c); \
+				isdigit(_c) ? _c - '0' : \
+				tolower(_c) + 10 - 'a'; \
+			})
+
+
+#define LINE_LENGTH	800
+#define pt_offset(b, n)	((struct partition *)((b) + 0x1be + \
+				(n) * sizeof(struct partition)))
+#define sector(s)	((s) & 0x3f)
+#define cylinder(s, c)	((c) | (((s) & 0xc0) << 2))
+
+#define hsc2sector(h,s,c) (sector(s) - 1 + sectors * \
+				((h) + heads * cylinder(s,c)))
+#define set_hsc(h,s,c,sector) { \
+				s = sector % sectors + 1;	\
+				sector /= sectors;	\
+				h = sector % heads;	\
+				sector /= heads;	\
+				c = sector & 0xff;	\
+				s |= (sector >> 2) & 0xc0;	\
+			}
+
+/* A valid partition table sector ends in 0x55 0xaa */
+static unsigned int
+part_table_flag(unsigned char *b) {
+	return ((unsigned int) b[510]) + (((unsigned int) b[511]) << 8);
+}
+
+int
+valid_part_table_flag(unsigned char *b) {
+	return (b[510] == 0x55 && b[511] == 0xaa);
+}
+
+static void
+write_part_table_flag(unsigned char *b) {
+	b[510] = 0x55;
+	b[511] = 0xaa;
+}
+
+/* start_sect and nr_sects are stored little endian on all machines */
+/* moreover, they are not aligned correctly */
+static void
+store4_little_endian(unsigned char *cp, unsigned int val) {
+	cp[0] = (val & 0xff);
+	cp[1] = ((val >> 8) & 0xff);
+	cp[2] = ((val >> 16) & 0xff);
+	cp[3] = ((val >> 24) & 0xff);
+}
+
+static unsigned int
+read4_little_endian(const unsigned char *cp) {
+	return (unsigned int)(cp[0]) + ((unsigned int)(cp[1]) << 8)
+		+ ((unsigned int)(cp[2]) << 16)
+		+ ((unsigned int)(cp[3]) << 24);
+}
+
+static void
+set_start_sect(struct partition *p, unsigned int start_sect) {
+	store4_little_endian(p->start4, start_sect);
+}
+
+unsigned long long
+get_start_sect(struct partition *p) {
+	return read4_little_endian(p->start4);
+}
+
+static void
+set_nr_sects(struct partition *p, unsigned long long nr_sects) {
+	store4_little_endian(p->size4, nr_sects);
+}
+
+unsigned long long
+get_nr_sects(struct partition *p) {
+	return read4_little_endian(p->size4);
+}
+
+static ssize_t
+xread(int fd, void *buf, size_t count) {
+        char *p = buf;
+        ssize_t out = 0;
+        ssize_t rv;
+
+        while (count) {
+                rv = read(fd, p, count);
+                if (rv == -1) {
+                        if (errno == EINTR || errno == EAGAIN)
+                                continue;
+                        return out ? out : -1; /* Error */
+                } else if (rv == 0) {
+                        return out; /* EOF */
+                }
+
+                p += rv;
+                out += rv;
+                count -= rv;
+        }
+
+        return out;
+}
+
+static unsigned int
+get_random_id(void) {
+	int fd;
+	unsigned int v;
+	ssize_t rv = -1;
+	struct timeval tv;
+
+	fd = open("/dev/urandom", O_RDONLY);
+	if (fd >= 0) {
+	        rv = xread(fd, &v, sizeof v);
+		close(fd);
+	}
+
+	if (rv == sizeof v)
+		return v;
+
+	/* Fallback: sucks, but better than nothing */
+	gettimeofday(&tv, NULL);
+	return (unsigned int)(tv.tv_sec + (tv.tv_usec << 12) + getpid());
+}
+
+/* normally O_RDWR, -l option gives O_RDONLY */
+static int type_open = O_RDWR;
+
+/*
+ * Raw disk label. For DOS-type partition tables the MBR,
+ * with descriptions of the primary partitions.
+ */
+unsigned char *MBRbuffer;
+
+/*
+ * per partition table entry data
+ *
+ * The four primary partitions have the same sectorbuffer (MBRbuffer)
+ * and have NULL ext_pointer.
+ * Each logical partition table entry has two pointers, one for the
+ * partition and one link to the next one.
+ */
+struct pte {
+	struct partition *part_table;	/* points into sectorbuffer */
+	struct partition *ext_pointer;	/* points into sectorbuffer */
+	char changed;			/* boolean */
+	unsigned long long offset;	/* disk sector number */
+	unsigned char *sectorbuffer;	/* disk sector contents */
+} ptes[MAXIMUM_PARTS];
+
+char	*disk_device,			/* must be specified */
+	*line_ptr,			/* interactive input */
+	line_buffer[LINE_LENGTH];
+
+int	fd,				/* the disk */
+	ext_index,			/* the prime extended partition */
+	listing = 0,			/* no aborts for fdisk -l */
+	nowarn = 0,			/* no warnings for fdisk -l/-s */
+	dos_compatible_flag = ~0,
+	dos_changed = 0,
+	partitions = 4;			/* maximum partition + 1 */
+
+unsigned int	user_cylinders, user_heads, user_sectors;
+unsigned int	pt_heads, pt_sectors;
+unsigned int	kern_heads, kern_sectors;
+
+unsigned long long sector_offset = 1, extended_offset = 0, sectors;
+
+unsigned int	heads,
+	cylinders,
+	sector_size = DEFAULT_SECTOR_SIZE,
+	sector_factor = 1,
+	user_set_sector_size = 0,
+	units_per_sector = 1,
+	display_in_cyl_units = 1;
+
+unsigned long long total_number_of_sectors;	/* (!) 512-byte sectors */
+unsigned long grain = DEFAULT_SECTOR_SIZE,
+	      io_size = DEFAULT_SECTOR_SIZE,
+	      min_io_size = DEFAULT_SECTOR_SIZE,
+	      phy_sector_size = DEFAULT_SECTOR_SIZE,
+	      alignment_offset;
+int has_topology;
+
+#define dos_label (!sun_label && !sgi_label && !aix_label && !mac_label && !osf_label)
+int	sun_label = 0;			/* looking at sun disklabel */
+int	sgi_label = 0;			/* looking at sgi disklabel */
+int	aix_label = 0;			/* looking at aix disklabel */
+int	osf_label = 0;			/* looking at OSF/1 disklabel */
+int	mac_label = 0;			/* looking at mac disklabel */
+int	possibly_osf_label = 0;
+
+jmp_buf listingbuf;
+
+void fatal(enum failure why) {
+	char	error[LINE_LENGTH],
+		*message = error;
+	int	rc = EXIT_FAILURE;
+
+	if (listing) {
+		close(fd);
+		longjmp(listingbuf, 1);
+	}
+
+	switch (why) {
+		case help:
+			rc = EXIT_SUCCESS;
+		case usage: message = _(
+"Usage:\n"
+" fdisk [options] <disk>    change partition table\n"
+" fdisk [options] -l <disk> list partition table(s)\n"
+" fdisk -s <partition>      give partition size(s) in blocks\n"
+"\nOptions:\n"
+" -b <size>                 sector size (512, 1024, 2048 or 4096)\n"
+" -c                        switch off DOS-compatible mode\n"
+" -h                        print help\n"
+" -u <size>                 give sizes in sectors instead of cylinders\n"
+" -v                        print version\n"
+" -C <number>               specify the number of cylinders\n"
+" -H <number>               specify the number of heads\n"
+" -S <number>               specify the number of sectors per track\n"
+"\n");
+			break;
+		case unable_to_open:
+			snprintf(error, sizeof(error),
+				 _("Unable to open %s\n"), disk_device);
+			break;
+		case unable_to_read:
+			snprintf(error, sizeof(error),
+				 _("Unable to read %s\n"), disk_device);
+			break;
+		case unable_to_seek:
+			snprintf(error, sizeof(error),
+				_("Unable to seek on %s\n"),disk_device);
+			break;
+		case unable_to_write:
+			snprintf(error, sizeof(error),
+				_("Unable to write %s\n"), disk_device);
+			break;
+		case ioctl_error:
+			snprintf(error, sizeof(error),
+				 _("BLKGETSIZE ioctl failed on %s\n"),
+				disk_device);
+			break;
+		case out_of_memory:
+			message = _("Unable to allocate any more memory\n");
+			break;
+		default:
+			message = _("Fatal error\n");
+	}
+
+	fputc('\n', stderr);
+	fputs(message, stderr);
+	exit(rc);
+}
+
+static void
+seek_sector(int fd, unsigned long long secno) {
+	off_t offset = (off_t) secno * sector_size;
+	if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
+		fatal(unable_to_seek);
+}
+
+static void
+read_sector(int fd, unsigned long long secno, unsigned char *buf) {
+	seek_sector(fd, secno);
+	if (read(fd, buf, sector_size) != sector_size)
+		fatal(unable_to_read);
+}
+
+static void
+write_sector(int fd, unsigned long long secno, unsigned char *buf) {
+	seek_sector(fd, secno);
+	if (write(fd, buf, sector_size) != sector_size)
+		fatal(unable_to_write);
+}
+
+/* Allocate a buffer and read a partition table sector */
+static void
+read_pte(int fd, int pno, unsigned long long offset) {
+	struct pte *pe = &ptes[pno];
+
+	pe->offset = offset;
+	pe->sectorbuffer = malloc(sector_size);
+	if (!pe->sectorbuffer)
+		fatal(out_of_memory);
+	read_sector(fd, offset, pe->sectorbuffer);
+	pe->changed = 0;
+	pe->part_table = pe->ext_pointer = NULL;
+}
+
+static unsigned long long
+get_partition_start(struct pte *pe) {
+	return pe->offset + get_start_sect(pe->part_table);
+}
+
+struct partition *
+get_part_table(int i) {
+	return ptes[i].part_table;
+}
+
+void
+set_all_unchanged(void) {
+	int i;
+
+	for (i = 0; i < MAXIMUM_PARTS; i++)
+		ptes[i].changed = 0;
+}
+
+void
+set_changed(int i) {
+	ptes[i].changed = 1;
+}
+
+static int
+is_garbage_table(void) {
+	int i;
+
+	for (i = 0; i < 4; i++) {
+		struct pte *pe = &ptes[i];
+		struct partition *p = pe->part_table;
+
+		if (p->boot_ind != 0 && p->boot_ind != 0x80)
+			return 1;
+	}
+	return 0;
+}
+
+/*
+ * Avoid warning about DOS partitions when no DOS partition was changed.
+ * Here a heuristic "is probably dos partition".
+ * We might also do the opposite and warn in all cases except
+ * for "is probably nondos partition".
+ */
+static int
+is_dos_partition(int t) {
+	return (t == 1 || t == 4 || t == 6 ||
+		t == 0x0b || t == 0x0c || t == 0x0e ||
+		t == 0x11 || t == 0x12 || t == 0x14 || t == 0x16 ||
+		t == 0x1b || t == 0x1c || t == 0x1e || t == 0x24 ||
+		t == 0xc1 || t == 0xc4 || t == 0xc6);
+}
+
+static void
+menu(void) {
+	if (sun_label) {
+	   puts(_("Command action"));
+	   puts(_("   a   toggle a read only flag"));		/* sun */
+	   puts(_("   b   edit bsd disklabel"));
+	   puts(_("   c   toggle the mountable flag"));		/* sun */
+	   puts(_("   d   delete a partition"));
+	   puts(_("   l   list known partition types"));
+	   puts(_("   m   print this menu"));
+	   puts(_("   n   add a new partition"));
+	   puts(_("   o   create a new empty DOS partition table"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   s   create a new empty Sun disklabel"));	/* sun */
+	   puts(_("   t   change a partition's system id"));
+	   puts(_("   u   change display/entry units"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	   puts(_("   x   extra functionality (experts only)"));
+	}
+	else if (sgi_label) {
+	   puts(_("Command action"));
+	   puts(_("   a   select bootable partition"));    /* sgi flavour */
+	   puts(_("   b   edit bootfile entry"));          /* sgi */
+	   puts(_("   c   select sgi swap partition"));    /* sgi flavour */
+	   puts(_("   d   delete a partition"));
+	   puts(_("   l   list known partition types"));
+	   puts(_("   m   print this menu"));
+	   puts(_("   n   add a new partition"));
+	   puts(_("   o   create a new empty DOS partition table"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   s   create a new empty Sun disklabel"));	/* sun */
+	   puts(_("   t   change a partition's system id"));
+	   puts(_("   u   change display/entry units"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	}
+	else if (aix_label || mac_label) {
+	   puts(_("Command action"));
+	   puts(_("   m   print this menu"));
+	   puts(_("   o   create a new empty DOS partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   s   create a new empty Sun disklabel"));	/* sun */
+	}
+	else {
+	   puts(_("Command action"));
+	   puts(_("   a   toggle a bootable flag"));
+	   puts(_("   b   edit bsd disklabel"));
+	   puts(_("   c   toggle the dos compatibility flag"));
+	   puts(_("   d   delete a partition"));
+	   puts(_("   l   list known partition types"));
+	   puts(_("   m   print this menu"));
+	   puts(_("   n   add a new partition"));
+	   puts(_("   o   create a new empty DOS partition table"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   s   create a new empty Sun disklabel"));	/* sun */
+	   puts(_("   t   change a partition's system id"));
+	   puts(_("   u   change display/entry units"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	   puts(_("   x   extra functionality (experts only)"));
+	}
+}
+
+static void
+xmenu(void) {
+	if (sun_label) {
+	   puts(_("Command action"));
+	   puts(_("   a   change number of alternate cylinders"));      /*sun*/
+	   puts(_("   c   change number of cylinders"));
+	   puts(_("   d   print the raw data in the partition table"));
+	   puts(_("   e   change number of extra sectors per cylinder"));/*sun*/
+	   puts(_("   h   change number of heads"));
+	   puts(_("   i   change interleave factor"));			/*sun*/
+	   puts(_("   o   change rotation speed (rpm)"));		/*sun*/
+	   puts(_("   m   print this menu"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   r   return to main menu"));
+	   puts(_("   s   change number of sectors/track"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	   puts(_("   y   change number of physical cylinders"));	/*sun*/
+	}
+	else if (sgi_label) {
+	   puts(_("Command action"));
+	   puts(_("   b   move beginning of data in a partition")); /* !sun */
+	   puts(_("   c   change number of cylinders"));
+	   puts(_("   d   print the raw data in the partition table"));
+	   puts(_("   e   list extended partitions"));		/* !sun */
+	   puts(_("   g   create an IRIX (SGI) partition table"));/* sgi */
+	   puts(_("   h   change number of heads"));
+	   puts(_("   m   print this menu"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   r   return to main menu"));
+	   puts(_("   s   change number of sectors/track"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	}
+	else if (aix_label || mac_label) {
+	   puts(_("Command action"));
+	   puts(_("   b   move beginning of data in a partition")); /* !sun */
+	   puts(_("   c   change number of cylinders"));
+	   puts(_("   d   print the raw data in the partition table"));
+	   puts(_("   e   list extended partitions"));		/* !sun */
+	   puts(_("   g   create an IRIX (SGI) partition table"));/* sgi */
+	   puts(_("   h   change number of heads"));
+	   puts(_("   m   print this menu"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   r   return to main menu"));
+	   puts(_("   s   change number of sectors/track"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	}
+	else {
+	   puts(_("Command action"));
+	   puts(_("   b   move beginning of data in a partition")); /* !sun */
+	   puts(_("   c   change number of cylinders"));
+	   puts(_("   d   print the raw data in the partition table"));
+	   puts(_("   e   list extended partitions"));		/* !sun */
+	   puts(_("   f   fix partition order"));		/* !sun, !aix, !sgi */
+	   puts(_("   g   create an IRIX (SGI) partition table"));/* sgi */
+	   puts(_("   h   change number of heads"));
+	   puts(_("   i   change the disk identifier")); /* dos only */
+	   puts(_("   m   print this menu"));
+	   puts(_("   p   print the partition table"));
+	   puts(_("   q   quit without saving changes"));
+	   puts(_("   r   return to main menu"));
+	   puts(_("   s   change number of sectors/track"));
+	   puts(_("   v   verify the partition table"));
+	   puts(_("   w   write table to disk and exit"));
+	}
+}
+
+static int
+get_sysid(int i) {
+	return (
+		sun_label ? sun_get_sysid(i) :
+		sgi_label ? sgi_get_sysid(i) :
+		ptes[i].part_table->sys_ind);
+}
+
+static struct systypes *
+get_sys_types(void) {
+	return (
+		sun_label ? sun_sys_types :
+		sgi_label ? sgi_sys_types :
+		i386_sys_types);
+}
+
+char *partition_type(unsigned char type)
+{
+	int i;
+	struct systypes *types = get_sys_types();
+
+	for (i=0; types[i].name; i++)
+		if (types[i].type == type)
+			return _(types[i].name);
+
+	return NULL;
+}
+
+void list_types(struct systypes *sys)
+{
+	unsigned int last[4], done = 0, next = 0, size;
+	int i;
+
+	for (i = 0; sys[i].name; i++);
+	size = i;
+
+	for (i = 3; i >= 0; i--)
+		last[3 - i] = done += (size + i - done) / (i + 1);
+	i = done = 0;
+
+	do {
+		printf("%c%2x  %-15.15s", i ? ' ' : '\n',
+		        sys[next].type, _(sys[next].name));
+ 		next = last[i++] + done;
+		if (i > 3 || next >= last[i]) {
+			i = 0;
+			next = ++done;
+		}
+	} while (done < last[0]);
+	putchar('\n');
+}
+
+static int
+is_cleared_partition(struct partition *p) {
+	return !(!p || p->boot_ind || p->head || p->sector || p->cyl ||
+		 p->sys_ind || p->end_head || p->end_sector || p->end_cyl ||
+		 get_start_sect(p) || get_nr_sects(p));
+}
+
+static void
+clear_partition(struct partition *p) {
+	if (!p)
+		return;
+	p->boot_ind = 0;
+	p->head = 0;
+	p->sector = 0;
+	p->cyl = 0;
+	p->sys_ind = 0;
+	p->end_head = 0;
+	p->end_sector = 0;
+	p->end_cyl = 0;
+	set_start_sect(p,0);
+	set_nr_sects(p,0);
+}
+
+static void
+set_partition(int i, int doext, unsigned long long start,
+	      unsigned long long stop, int sysid) {
+	struct partition *p;
+	unsigned long long offset;
+
+	if (doext) {
+		p = ptes[i].ext_pointer;
+		offset = extended_offset;
+	} else {
+		p = ptes[i].part_table;
+		offset = ptes[i].offset;
+	}
+	p->boot_ind = 0;
+	p->sys_ind = sysid;
+	set_start_sect(p, start - offset);
+	set_nr_sects(p, stop - start + 1);
+	if (dos_compatible_flag && (start/(sectors*heads) > 1023))
+		start = heads*sectors*1024 - 1;
+	set_hsc(p->head, p->sector, p->cyl, start);
+	if (dos_compatible_flag && (stop/(sectors*heads) > 1023))
+		stop = heads*sectors*1024 - 1;
+	set_hsc(p->end_head, p->end_sector, p->end_cyl, stop);
+	ptes[i].changed = 1;
+}
+
+static int
+test_c(char **m, char *mesg) {
+	int val = 0;
+	if (!*m)
+		fprintf(stderr, _("You must set"));
+	else {
+		fprintf(stderr, " %s", *m);
+		val = 1;
+	}
+	*m = mesg;
+	return val;
+}
+
+#define alignment_required	(grain != sector_size)
+
+static int
+lba_is_aligned(unsigned long long lba)
+{
+	unsigned int granularity = max(phy_sector_size, min_io_size);
+	unsigned long long offset = (lba << 9) & (granularity - 1);
+
+	return !((granularity + alignment_offset - offset) & (granularity - 1));
+}
+
+#define ALIGN_UP	1
+#define ALIGN_DOWN	2
+#define ALIGN_NEAREST	3
+
+static unsigned long long
+align_lba(unsigned long long lba, int direction)
+{
+	unsigned long long res;
+
+	if (lba_is_aligned(lba))
+		res = lba;
+	else {
+		unsigned long long sects_in_phy = grain / sector_size;
+
+		if (lba < sector_offset)
+			res = sector_offset;
+
+		else if (direction == ALIGN_UP)
+			res = ((lba + sects_in_phy) / sects_in_phy) * sects_in_phy;
+
+		else if (direction == ALIGN_DOWN)
+			res = (lba / sects_in_phy) * sects_in_phy;
+
+		else /* ALIGN_NEAREST */
+			res = ((lba + sects_in_phy / 2) / sects_in_phy) * sects_in_phy;
+
+		if (alignment_offset && !lba_is_aligned(res) &&
+		    res > alignment_offset / sector_size) {
+			/*
+			 * apply alignment_offset
+			 *
+			 * On disk with alignment compensation physical blocks starts
+			 * at LBA < 0 (usually LBA -1). It means we have to move LBA
+			 * according the offset to be on the physical boundary.
+			 */
+			/* fprintf(stderr, "LBA: %llu apply alignment_offset\n", res); */
+			res -= (max(phy_sector_size, min_io_size) -
+					alignment_offset) / sector_size;
+
+			if (direction == ALIGN_UP && res < lba)
+				res += sects_in_phy;
+		}
+	}
+
+	/***
+	 fprintf(stderr, "LBA %llu (%s) --align-(%s)--> %llu (%s)\n",
+				lba,
+				lba_is_aligned(lba) ? "OK" : "FALSE",
+				direction == ALIGN_UP ?   "UP     " :
+				direction == ALIGN_DOWN ? "DOWN   " : "NEAREST",
+				res,
+				lba_is_aligned(res) ? "OK" : "FALSE");
+	***/
+	return res;
+}
+
+static unsigned long long
+align_lba_in_range(	unsigned long long lba,
+			unsigned long long start,
+			unsigned long long stop)
+{
+	start = align_lba(start, ALIGN_UP);
+	stop = align_lba(stop, ALIGN_DOWN);
+
+	lba = align_lba(lba, ALIGN_NEAREST);
+
+	if (lba < start)
+		return start;
+	else if (lba > stop)
+		return stop;
+	return lba;
+}
+
+static int
+warn_geometry(void) {
+	char *m = NULL;
+	int prev = 0;
+
+	if (sgi_label)	/* cannot set cylinders etc anyway */
+		return 0;
+	if (!heads)
+		prev = test_c(&m, _("heads"));
+	if (!sectors)
+		prev = test_c(&m, _("sectors"));
+	if (!cylinders)
+		prev = test_c(&m, _("cylinders"));
+	if (!m)
+		return 0;
+	fprintf(stderr,
+		_("%s%s.\nYou can do this from the extra functions menu.\n"),
+		prev ? _(" and ") : " ", m);
+	return 1;
+}
+
+void update_units(void)
+{
+	int cyl_units = heads * sectors;
+
+	if (display_in_cyl_units && cyl_units)
+		units_per_sector = cyl_units;
+	else
+		units_per_sector = 1; 	/* in sectors */
+}
+
+static void
+warn_limits(void) {
+	if (total_number_of_sectors > UINT_MAX && !nowarn) {
+		int giga = (total_number_of_sectors << 9) / 1000000000;
+		int hectogiga = (giga + 50) / 100;
+
+		fprintf(stderr, _("\n"
+"WARNING: The size of this disk is %d.%d TB (%llu bytes).\n"
+"DOS partition table format can not be used on drives for volumes\n"
+"larger than (%llu bytes) for %d-byte sectors. Use parted(1) and GUID \n"
+"partition table format (GPT).\n\n"),
+			hectogiga / 10, hectogiga % 10,
+			total_number_of_sectors << 9,
+			(unsigned long long ) UINT_MAX * sector_size,
+			sector_size);
+	}
+}
+
+static void
+warn_alignment(void) {
+	if (nowarn)
+		return;
+
+	if (sector_size != phy_sector_size)
+		fprintf(stderr, _("\n"
+"The device presents a logical sector size that is smaller than\n"
+"the physical sector size. Aligning to a physical sector (or optimal\n"
+"I/O) size boundary is recommended, or performance may be impacted.\n"));
+
+	if (dos_compatible_flag) {
+		fprintf(stderr, _("\n"
+"WARNING: DOS-compatible mode is deprecated. It's strongly recommended to\n"
+"         switch off the mode (command 'c')"));
+
+		if (display_in_cyl_units)
+			fprintf(stderr, _(" and change display units to\n"
+"         sectors (command 'u').\n"));
+		else
+			fprintf(stderr, ".\n");
+
+	 } else if (display_in_cyl_units)
+		fprintf(stderr, _("\n"
+"WARNING: cylinders as display units are deprecated. Use command 'u' to\n"
+"         change units to sectors.\n"));
+
+}
+
+static void
+read_extended(int ext) {
+	int i;
+	struct pte *pex;
+	struct partition *p, *q;
+
+	ext_index = ext;
+	pex = &ptes[ext];
+	pex->ext_pointer = pex->part_table;
+
+	p = pex->part_table;
+	if (!get_start_sect(p)) {
+		fprintf(stderr,
+			_("Bad offset in primary extended partition\n"));
+		return;
+	}
+
+	while (IS_EXTENDED (p->sys_ind)) {
+		struct pte *pe = &ptes[partitions];
+
+		if (partitions >= MAXIMUM_PARTS) {
+			/* This is not a Linux restriction, but
+			   this program uses arrays of size MAXIMUM_PARTS.
+			   Do not try to `improve' this test. */
+			struct pte *pre = &ptes[partitions-1];
+
+			fprintf(stderr,
+				_("Warning: omitting partitions after #%d.\n"
+				  "They will be deleted "
+				  "if you save this partition table.\n"),
+				partitions);
+			clear_partition(pre->ext_pointer);
+			pre->changed = 1;
+			return;
+		}
+
+		read_pte(fd, partitions, extended_offset + get_start_sect(p));
+
+		if (!extended_offset)
+			extended_offset = get_start_sect(p);
+
+		q = p = pt_offset(pe->sectorbuffer, 0);
+		for (i = 0; i < 4; i++, p++) if (get_nr_sects(p)) {
+			if (IS_EXTENDED (p->sys_ind)) {
+				if (pe->ext_pointer)
+					fprintf(stderr,
+						_("Warning: extra link "
+						  "pointer in partition table"
+						  " %d\n"), partitions + 1);
+				else
+					pe->ext_pointer = p;
+			} else if (p->sys_ind) {
+				if (pe->part_table)
+					fprintf(stderr,
+						_("Warning: ignoring extra "
+						  "data in partition table"
+						  " %d\n"), partitions + 1);
+				else
+					pe->part_table = p;
+			}
+		}
+
+		/* very strange code here... */
+		if (!pe->part_table) {
+			if (q != pe->ext_pointer)
+				pe->part_table = q;
+			else
+				pe->part_table = q + 1;
+		}
+		if (!pe->ext_pointer) {
+			if (q != pe->part_table)
+				pe->ext_pointer = q;
+			else
+				pe->ext_pointer = q + 1;
+		}
+
+		p = pe->ext_pointer;
+		partitions++;
+	}
+
+	/* remove empty links */
+ remove:
+	for (i = 4; i < partitions; i++) {
+		struct pte *pe = &ptes[i];
+
+		if (!get_nr_sects(pe->part_table) &&
+		    (partitions > 5 || ptes[4].part_table->sys_ind)) {
+			printf(_("omitting empty partition (%d)\n"), i+1);
+			delete_partition(i);
+			goto remove; 	/* numbering changed */
+		}
+	}
+}
+
+static void
+dos_write_mbr_id(unsigned char *b, unsigned int id) {
+	store4_little_endian(&b[440], id);
+}
+
+static unsigned int
+dos_read_mbr_id(const unsigned char *b) {
+	return read4_little_endian(&b[440]);
+}
+
+static void
+dos_print_mbr_id(void) {
+	printf(_("Disk identifier: 0x%08x\n"), dos_read_mbr_id(MBRbuffer));
+}
+
+static void
+dos_set_mbr_id(void) {
+	unsigned long new_id;
+	char *ep;
+	char ps[64];
+
+	snprintf(ps, sizeof ps, _("New disk identifier (current 0x%08x): "),
+		 dos_read_mbr_id(MBRbuffer));
+
+	if (read_chars(ps) == '\n')
+		return;
+
+	new_id = strtoul(line_ptr, &ep, 0);
+	if (*ep != '\n')
+		return;
+
+	dos_write_mbr_id(MBRbuffer, new_id);
+	dos_print_mbr_id();
+}
+
+static void
+create_doslabel(void) {
+	unsigned int id = get_random_id();
+
+	fprintf(stderr,
+	_("Building a new DOS disklabel with disk identifier 0x%08x.\n"
+	  "Changes will remain in memory only, until you decide to write them.\n"
+	  "After that, of course, the previous content won't be recoverable.\n\n"),
+		id);
+	sun_nolabel();  /* otherwise always recognised as sun */
+	sgi_nolabel();  /* otherwise always recognised as sgi */
+	mac_label = aix_label = osf_label = possibly_osf_label = 0;
+	partitions = 4;
+
+	/* Zero out the MBR buffer */
+	extended_offset = 0;
+	set_all_unchanged();
+	set_changed(0);
+	get_boot(create_empty_dos);
+
+	/* Generate an MBR ID for this disk */
+	dos_write_mbr_id(MBRbuffer, id);
+
+	/* Mark it bootable (unfortunately required) */
+	write_part_table_flag(MBRbuffer);
+}
+
+static void
+get_topology(int fd) {
+	int arg;
+#ifdef HAVE_LIBBLKID_INTERNAL
+	blkid_probe pr;
+
+	pr = blkid_new_probe();
+	if (pr && blkid_probe_set_device(pr, fd, 0, 0) == 0) {
+		blkid_topology tp = blkid_probe_get_topology(pr);
+
+		if (tp) {
+			min_io_size = blkid_topology_get_minimum_io_size(tp);
+			io_size = blkid_topology_get_optimal_io_size(tp);
+			phy_sector_size = blkid_topology_get_physical_sector_size(tp);
+			alignment_offset = blkid_topology_get_alignment_offset(tp);
+
+			/* We assume that the device provides topology info if
+			 * optimal_io_size is set or alignment_offset is set or
+			 * minimum_io_size is not power of 2.
+			 *
+			 * See also update_sector_offset().
+			 */
+			if (io_size || alignment_offset ||
+			    (min_io_size & (min_io_size - 1)))
+				has_topology = 1;
+			if (!io_size)
+				/* optimal IO is optional, default to minimum IO */
+				io_size = min_io_size;
+		}
+	}
+	blkid_free_probe(pr);
+#endif
+
+	if (user_set_sector_size)
+		/* fdisk since 2.17 differentiate between logical and physical
+		 * sectors size. For backward compatibility the
+		 *    fdisk -b <sectorsize>
+		 * changes both, logical and physical sector size.
+		 */
+		phy_sector_size = sector_size;
+
+	else if (blkdev_get_sector_size(fd, &arg) == 0) {
+		sector_size = arg;
+
+		if (!phy_sector_size)
+			phy_sector_size = sector_size;
+	}
+
+	if (!min_io_size)
+		min_io_size = phy_sector_size;
+	if (!io_size)
+		io_size = min_io_size;
+
+	if (sector_size != DEFAULT_SECTOR_SIZE)
+		printf(_("Note: sector size is %d (not %d)\n"),
+		       sector_size, DEFAULT_SECTOR_SIZE);
+}
+
+static void
+get_kernel_geometry(int fd) {
+#ifdef HDIO_GETGEO
+	struct hd_geometry geometry;
+
+	if (!ioctl(fd, HDIO_GETGEO, &geometry)) {
+		kern_heads = geometry.heads;
+		kern_sectors = geometry.sectors;
+		/* never use geometry.cylinders - it is truncated */
+	}
+#endif
+}
+
+static void
+get_partition_table_geometry(void) {
+	unsigned char *bufp = MBRbuffer;
+	struct partition *p;
+	int i, h, s, hh, ss;
+	int first = 1;
+	int bad = 0;
+
+	if (!(valid_part_table_flag(bufp)))
+		return;
+
+	hh = ss = 0;
+	for (i=0; i<4; i++) {
+		p = pt_offset(bufp, i);
+		if (p->sys_ind != 0) {
+			h = p->end_head + 1;
+			s = (p->end_sector & 077);
+			if (first) {
+				hh = h;
+				ss = s;
+				first = 0;
+			} else if (hh != h || ss != s)
+				bad = 1;
+		}
+	}
+
+	if (!first && !bad) {
+		pt_heads = hh;
+		pt_sectors = ss;
+	}
+}
+
+/*
+ * Sets LBA of the first partition
+ */
+void
+update_sector_offset(void)
+{
+	grain = io_size;
+
+	if (dos_compatible_flag)
+		sector_offset = sectors;	/* usually 63 sectors */
+	else {
+		/*
+		 * Align the begin of partitions to:
+		 *
+		 * a) topology
+		 *  a2) alignment offset
+		 *  a1) or physical sector (minimal_io_size, aka "grain")
+		 *
+		 * b) or default to 1MiB (2048 sectrors, Windows Vista default)
+		 *
+		 * c) or for very small devices use 1 phy.sector
+		 */
+		unsigned long long x = 0;
+
+		if (has_topology) {
+			if (alignment_offset)
+				x = alignment_offset;
+			else if (io_size > 2048 * 512)
+				x = io_size;
+		}
+		/* default to 1MiB */
+		if (!x)
+			x = 2048 * 512;
+
+		sector_offset = x / sector_size;
+
+		/* don't use huge offset on small devices */
+		if (total_number_of_sectors <= sector_offset * 4)
+			sector_offset = phy_sector_size / sector_size;
+
+		/* use 1MiB grain always when possible */
+		if (grain < 2048 * 512)
+			grain = 2048 * 512;
+
+		/* don't use huge grain on small devices */
+		if (total_number_of_sectors <= (grain * 4 / sector_size))
+			grain = phy_sector_size;
+	}
+}
+
+void
+get_geometry(int fd, struct geom *g) {
+	unsigned long long llcyls;
+
+	get_topology(fd);
+	sector_factor = sector_size / 512;
+	guess_device_type(fd);
+	heads = cylinders = sectors = 0;
+	kern_heads = kern_sectors = 0;
+	pt_heads = pt_sectors = 0;
+
+	get_kernel_geometry(fd);
+	get_partition_table_geometry();
+
+	heads = user_heads ? user_heads :
+		pt_heads ? pt_heads :
+		kern_heads ? kern_heads : 255;
+	sectors = user_sectors ? user_sectors :
+		pt_sectors ? pt_sectors :
+		kern_sectors ? kern_sectors : 63;
+
+	if (blkdev_get_sectors(fd, &total_number_of_sectors) == -1)
+		total_number_of_sectors = 0;
+
+	update_sector_offset();
+
+	llcyls = total_number_of_sectors / (heads * sectors * sector_factor);
+	cylinders = llcyls;
+	if (cylinders != llcyls)	/* truncated? */
+		cylinders = ~0;
+	if (!cylinders)
+		cylinders = user_cylinders;
+
+	if (g) {
+		g->heads = heads;
+		g->sectors = sectors;
+		g->cylinders = cylinders;
+	}
+}
+
+/*
+ * Please, always use allocated buffer if you want to cast the buffer to
+ * any struct -- cast non-allocated buffer to any struct is against
+ * strict-aliasing rules.  --kzak 16-Oct-2009
+ */
+static void init_mbr_buffer(void)
+{
+	if (MBRbuffer)
+		return;
+
+	MBRbuffer = calloc(1, MAX_SECTOR_SIZE);
+	if (!MBRbuffer)
+		fatal(out_of_memory);
+}
+
+void zeroize_mbr_buffer(void)
+{
+	if (MBRbuffer)
+		memset(MBRbuffer, 0, MAX_SECTOR_SIZE);
+}
+
+/*
+ * Read MBR.  Returns:
+ *   -1: no 0xaa55 flag present (possibly entire disk BSD)
+ *    0: found or created label
+ *    1: I/O error
+ */
+int
+get_boot(enum action what) {
+	int i;
+
+	partitions = 4;
+	ext_index = 0;
+	extended_offset = 0;
+
+	for (i = 0; i < 4; i++) {
+		struct pte *pe = &ptes[i];
+
+		pe->part_table = pt_offset(MBRbuffer, i);
+		pe->ext_pointer = NULL;
+		pe->offset = 0;
+		pe->sectorbuffer = MBRbuffer;
+		pe->changed = (what == create_empty_dos);
+	}
+
+	if (what == create_empty_sun && check_sun_label())
+		return 0;
+
+	memset(MBRbuffer, 0, 512);
+
+	if (what == create_empty_dos)
+		goto got_dos_table;		/* skip reading disk */
+
+	if ((fd = open(disk_device, type_open)) < 0) {
+	    if ((fd = open(disk_device, O_RDONLY)) < 0) {
+		if (what == try_only)
+		    return 1;
+		fatal(unable_to_open);
+	    } else
+		printf(_("You will not be able to write "
+			 "the partition table.\n"));
+	}
+
+	if (512 != read(fd, MBRbuffer, 512)) {
+		if (what == try_only)
+			return 1;
+		fatal(unable_to_read);
+	}
+
+	get_geometry(fd, NULL);
+
+	update_units();
+
+	if (check_sun_label())
+		return 0;
+
+	if (check_sgi_label())
+		return 0;
+
+	if (check_aix_label())
+		return 0;
+
+	if (check_mac_label())
+		return 0;
+
+	if (check_osf_label()) {
+		possibly_osf_label = 1;
+		if (!valid_part_table_flag(MBRbuffer)) {
+			osf_label = 1;
+			return 0;
+		}
+		printf(_("This disk has both DOS and BSD magic.\n"
+			 "Give the 'b' command to go to BSD mode.\n"));
+	}
+
+got_dos_table:
+
+	if (!valid_part_table_flag(MBRbuffer)) {
+		switch(what) {
+		case fdisk:
+			fprintf(stderr,
+				_("Device contains neither a valid DOS "
+				  "partition table, nor Sun, SGI or OSF "
+				  "disklabel\n"));
+#ifdef __sparc__
+			create_sunlabel();
+#else
+			create_doslabel();
+#endif
+			return 0;
+		case require:
+			return -1;
+		case try_only:
+		        return -1;
+		case create_empty_dos:
+		case create_empty_sun:
+			break;
+		default:
+			fprintf(stderr, _("Internal error\n"));
+			exit(1);
+		}
+	}
+
+	for (i = 0; i < 4; i++) {
+		struct pte *pe = &ptes[i];
+
+		if (IS_EXTENDED (pe->part_table->sys_ind)) {
+			if (partitions != 4)
+				fprintf(stderr, _("Ignoring extra extended "
+					"partition %d\n"), i + 1);
+			else
+				read_extended(i);
+		}
+	}
+
+	for (i = 3; i < partitions; i++) {
+		struct pte *pe = &ptes[i];
+
+		if (!valid_part_table_flag(pe->sectorbuffer)) {
+			fprintf(stderr,
+				_("Warning: invalid flag 0x%04x of partition "
+				"table %d will be corrected by w(rite)\n"),
+				part_table_flag(pe->sectorbuffer), i + 1);
+			pe->changed = 1;
+		}
+	}
+
+	warn_geometry();
+	warn_limits();
+	warn_alignment();
+
+	return 0;
+}
+
+/* read line; return 0 or first char */
+int
+read_line(void)
+{
+	static int got_eof = 0;
+
+	line_ptr = line_buffer;
+	if (!fgets(line_buffer, LINE_LENGTH, stdin)) {
+		if (feof(stdin))
+			got_eof++; 	/* user typed ^D ? */
+		if (got_eof >= 3) {
+			fflush(stdout);
+			fprintf(stderr, _("\ngot EOF thrice - exiting..\n"));
+			exit(1);
+		}
+		return 0;
+	}
+	while (*line_ptr && !isgraph(*line_ptr))
+		line_ptr++;
+	return *line_ptr;
+}
+
+char
+read_char(char *mesg)
+{
+	do {
+		fputs(mesg, stdout);
+		fflush (stdout);	 /* requested by niles@scyld.com */
+	} while (!read_line());
+	return *line_ptr;
+}
+
+char
+read_chars(char *mesg)
+{
+        fputs(mesg, stdout);
+	fflush (stdout);	/* niles@scyld.com */
+        if (!read_line()) {
+		*line_ptr = '\n';
+		line_ptr[1] = 0;
+	}
+	return *line_ptr;
+}
+
+int
+read_hex(struct systypes *sys)
+{
+        int hex;
+
+        while (1)
+        {
+           read_char(_("Hex code (type L to list codes): "));
+           if (tolower(*line_ptr) == 'l')
+               list_types(sys);
+	   else if (isxdigit (*line_ptr))
+	   {
+	      hex = 0;
+	      do
+		 hex = hex << 4 | hex_val(*line_ptr++);
+	      while (isxdigit(*line_ptr));
+	      return hex;
+	   }
+        }
+}
+
+static unsigned int
+read_int_sx(unsigned int low, unsigned int dflt, unsigned int high,
+	 unsigned int base, char *mesg, int *suffix)
+{
+	unsigned int i;
+	int default_ok = 1;
+	static char *ms = NULL;
+	static int mslen = 0;
+
+	if (!ms || strlen(mesg)+100 > mslen) {
+		mslen = strlen(mesg)+200;
+		if (!(ms = realloc(ms,mslen)))
+			fatal(out_of_memory);
+	}
+
+	if (dflt < low || dflt > high)
+		default_ok = 0;
+
+	if (default_ok)
+		snprintf(ms, mslen, _("%s (%u-%u, default %u): "),
+			 mesg, low, high, dflt);
+	else
+		snprintf(ms, mslen, "%s (%u-%u): ",
+			 mesg, low, high);
+
+	while (1) {
+		int use_default = default_ok;
+
+		/* ask question and read answer */
+		while (read_chars(ms) != '\n' && !isdigit(*line_ptr)
+		       && *line_ptr != '-' && *line_ptr != '+')
+			continue;
+
+		if (*line_ptr == '+' || *line_ptr == '-') {
+			int minus = (*line_ptr == '-');
+			int absolute = 0;
+			int suflen;
+
+			i = atoi(line_ptr+1);
+
+			while (isdigit(*++line_ptr))
+				use_default = 0;
+
+			suflen = strlen(line_ptr) - 1;
+
+			while(isspace(*(line_ptr + suflen)))
+				*(line_ptr + suflen--) = '\0';
+
+			if ((*line_ptr == 'C' || *line_ptr == 'c') &&
+			    *(line_ptr + 1) == '\0') {
+				/*
+				 * Cylinders
+				 */
+				if (!display_in_cyl_units)
+					i *= heads * sectors;
+			} else if (*line_ptr &&
+				   *(line_ptr + 1) == 'B' &&
+				   *(line_ptr + 2) == '\0') {
+				/*
+				 * 10^N
+				 */
+				if (*line_ptr == 'K')
+					absolute = 1000;
+				else if (*line_ptr == 'M')
+					absolute = 1000000;
+				else if (*line_ptr == 'G')
+					absolute = 1000000000;
+				else
+					absolute = -1;
+			} else if (*line_ptr &&
+				   *(line_ptr + 1) == '\0') {
+				/*
+				 * 2^N
+				 */
+				if (*line_ptr == 'K')
+					absolute = 1 << 10;
+				else if (*line_ptr == 'M')
+					absolute = 1 << 20;
+				else if (*line_ptr == 'G')
+					absolute = 1 << 30;
+				else
+					absolute = -1;
+			} else if (*line_ptr != '\0')
+				absolute = -1;
+
+			if (absolute == -1)  {
+				printf(_("Unsupported suffix: '%s'.\n"), line_ptr);
+				printf(_("Supported: 10^N: KB (KiloByte), MB (MegaByte), GB (GigaByte)\n"
+					 "            2^N: K  (KibiByte), M  (MebiByte), G  (GibiByte)\n"));
+				continue;
+			}
+
+			if (absolute && i) {
+				unsigned long long bytes;
+				unsigned long unit;
+
+				bytes = (unsigned long long) i * absolute;
+				unit = sector_size * units_per_sector;
+				bytes += unit/2;	/* round */
+				bytes /= unit;
+				i = bytes;
+				if (suffix)
+					*suffix = absolute;
+			}
+			if (minus)
+				i = -i;
+			i += base;
+		} else {
+			i = atoi(line_ptr);
+			while (isdigit(*line_ptr)) {
+				line_ptr++;
+				use_default = 0;
+			}
+		}
+		if (use_default)
+			printf(_("Using default value %u\n"), i = dflt);
+		if (i >= low && i <= high)
+			break;
+		else
+			printf(_("Value out of range.\n"));
+	}
+	return i;
+}
+
+/*
+ * Print the message MESG, then read an integer in LOW..HIGH.
+ * If the user hits Enter, DFLT is returned, provided that is in LOW..HIGH.
+ * Answers like +10 are interpreted as offsets from BASE.
+ *
+ * There is no default if DFLT is not between LOW and HIGH.
+ */
+unsigned int
+read_int(unsigned int low, unsigned int dflt, unsigned int high,
+	 unsigned int base, char *mesg)
+{
+	return read_int_sx(low, dflt, high, base, mesg, NULL);
+}
+
+
+int
+get_partition(int warn, int max) {
+	struct pte *pe;
+	int i;
+
+	i = read_int(1, 0, max, 0, _("Partition number")) - 1;
+	pe = &ptes[i];
+
+	if (warn) {
+		if ((!sun_label && !sgi_label && !pe->part_table->sys_ind)
+		    || (sun_label &&
+			(!sunlabel->partitions[i].num_sectors ||
+			 !sunlabel->part_tags[i].tag))
+		    || (sgi_label && (!sgi_get_num_sectors(i)))
+		   )
+			fprintf(stderr,
+				_("Warning: partition %d has empty type\n"),
+				i+1);
+	}
+	return i;
+}
+
+static int
+get_existing_partition(int warn, int max) {
+	int pno = -1;
+	int i;
+
+	for (i = 0; i < max; i++) {
+		struct pte *pe = &ptes[i];
+		struct partition *p = pe->part_table;
+
+		if (p && !is_cleared_partition(p)) {
+			if (pno >= 0)
+				goto not_unique;
+			pno = i;
+		}
+	}
+	if (pno >= 0) {
+		printf(_("Selected partition %d\n"), pno+1);
+		return pno;
+	}
+	printf(_("No partition is defined yet!\n"));
+	return -1;
+
+ not_unique:
+	return get_partition(warn, max);
+}
+
+static int
+get_nonexisting_partition(int warn, int max) {
+	int pno = -1;
+	int i;
+
+	for (i = 0; i < max; i++) {
+		struct pte *pe = &ptes[i];
+		struct partition *p = pe->part_table;
+
+		if (p && is_cleared_partition(p)) {
+			if (pno >= 0)
+				goto not_unique;
+			pno = i;
+		}
+	}
+	if (pno >= 0) {
+		printf(_("Selected partition %d\n"), pno+1);
+		return pno;
+	}
+	printf(_("All primary partitions have been defined already!\n"));
+	return -1;
+
+ not_unique:
+	return get_partition(warn, max);
+}
+
+const char *
+str_units(int n) {	/* n==1: use singular */
+	if (n == 1)
+		return display_in_cyl_units ? _("cylinder") : _("sector");
+	else
+		return display_in_cyl_units ? _("cylinders") : _("sectors");
+}
+
+void change_units(void)
+{
+	display_in_cyl_units = !display_in_cyl_units;
+	update_units();
+	printf(_("Changing display/entry units to %s\n"),
+		str_units(PLURAL));
+}
+
+static void
+toggle_active(int i) {
+	struct pte *pe = &ptes[i];
+	struct partition *p = pe->part_table;
+
+	if (IS_EXTENDED (p->sys_ind) && !p->boot_ind)
+		fprintf(stderr,
+			_("WARNING: Partition %d is an extended partition\n"),
+			i + 1);
+	p->boot_ind = (p->boot_ind ? 0 : ACTIVE_FLAG);
+	pe->changed = 1;
+}
+
+static void
+toggle_dos_compatibility_flag(void) {
+	dos_compatible_flag = ~dos_compatible_flag;
+	if (dos_compatible_flag)
+		printf(_("DOS Compatibility flag is set\n"));
+	else
+		printf(_("DOS Compatibility flag is not set\n"));
+
+	update_sector_offset();
+}
+
+static void
+delete_partition(int i) {
+	struct pte *pe = &ptes[i];
+	struct partition *p = pe->part_table;
+	struct partition *q = pe->ext_pointer;
+
+/* Note that for the fifth partition (i == 4) we don't actually
+ * decrement partitions.
+ */
+
+	if (warn_geometry())
+		return;		/* C/H/S not set */
+	pe->changed = 1;
+
+	if (sun_label) {
+		sun_delete_partition(i);
+		return;
+	}
+
+	if (sgi_label) {
+		sgi_delete_partition(i);
+		return;
+	}
+
+	if (i < 4) {
+		if (IS_EXTENDED (p->sys_ind) && i == ext_index) {
+			partitions = 4;
+			ptes[ext_index].ext_pointer = NULL;
+			extended_offset = 0;
+		}
+		clear_partition(p);
+		return;
+	}
+
+	if (!q->sys_ind && i > 4) {
+		/* the last one in the chain - just delete */
+		--partitions;
+		--i;
+		clear_partition(ptes[i].ext_pointer);
+		ptes[i].changed = 1;
+	} else {
+		/* not the last one - further ones will be moved down */
+		if (i > 4) {
+			/* delete this link in the chain */
+			p = ptes[i-1].ext_pointer;
+			*p = *q;
+			set_start_sect(p, get_start_sect(q));
+			set_nr_sects(p, get_nr_sects(q));
+			ptes[i-1].changed = 1;
+		} else if (partitions > 5) {    /* 5 will be moved to 4 */
+			/* the first logical in a longer chain */
+			struct pte *pe = &ptes[5];
+
+			if (pe->part_table) /* prevent SEGFAULT */
+				set_start_sect(pe->part_table,
+					       get_partition_start(pe) -
+					       extended_offset);
+			pe->offset = extended_offset;
+			pe->changed = 1;
+		}
+
+		if (partitions > 5) {
+			partitions--;
+			while (i < partitions) {
+				ptes[i] = ptes[i+1];
+				i++;
+			}
+		} else
+			/* the only logical: clear only */
+			clear_partition(ptes[i].part_table);
+	}
+}
+
+static void
+change_sysid(void) {
+	char *temp;
+	int i, sys, origsys;
+	struct partition *p;
+
+	/* If sgi_label then don't use get_existing_partition,
+	   let the user select a partition, since get_existing_partition()
+	   only works for Linux like partition tables. */
+	if (!sgi_label) {
+		i = get_existing_partition(0, partitions);
+	} else {
+		i = get_partition(0, partitions);
+	}
+
+	if (i == -1)
+		return;
+	p = ptes[i].part_table;
+	origsys = sys = get_sysid(i);
+
+	/* if changing types T to 0 is allowed, then
+	   the reverse change must be allowed, too */
+	if (!sys && !sgi_label && !sun_label && !get_nr_sects(p))
+                printf(_("Partition %d does not exist yet!\n"), i + 1);
+        else while (1) {
+		sys = read_hex (get_sys_types());
+
+		if (!sys && !sgi_label && !sun_label) {
+			printf(_("Type 0 means free space to many systems\n"
+			       "(but not to Linux). Having partitions of\n"
+			       "type 0 is probably unwise. You can delete\n"
+			       "a partition using the `d' command.\n"));
+			/* break; */
+		}
+
+		if (!sun_label && !sgi_label) {
+			if (IS_EXTENDED (sys) != IS_EXTENDED (p->sys_ind)) {
+				printf(_("You cannot change a partition into"
+				       " an extended one or vice versa\n"
+				       "Delete it first.\n"));
+				break;
+			}
+		}
+
+                if (sys < 256) {
+			if (sun_label && i == 2 && sys != SUN_TAG_BACKUP)
+				printf(_("Consider leaving partition 3 "
+				       "as Whole disk (5),\n"
+				       "as SunOS/Solaris expects it and "
+				       "even Linux likes it.\n\n"));
+			if (sgi_label && ((i == 10 && sys != ENTIRE_DISK)
+					  || (i == 8 && sys != 0)))
+				printf(_("Consider leaving partition 9 "
+				       "as volume header (0),\nand "
+				       "partition 11 as entire volume (6), "
+				       "as IRIX expects it.\n\n"));
+                        if (sys == origsys)
+				break;
+			if (sun_label) {
+				ptes[i].changed = sun_change_sysid(i, sys);
+			} else
+			if (sgi_label) {
+				ptes[i].changed = sgi_change_sysid(i, sys);
+			} else {
+				p->sys_ind = sys;
+				ptes[i].changed = 1;
+			}
+			temp = partition_type(sys) ? : _("Unknown");
+			if (ptes[i].changed)
+				printf (_("Changed system type of partition %d "
+				        "to %x (%s)\n"), i + 1, sys, temp);
+			else
+				printf (_("System type of partition %d is unchanged: "
+				        "%x (%s)\n"), i + 1, sys, temp);
+			if (is_dos_partition(origsys) ||
+			    is_dos_partition(sys))
+				dos_changed = 1;
+                        break;
+                }
+        }
+}
+
+/* check_consistency() and long2chs() added Sat Mar 6 12:28:16 1993,
+ * faith@cs.unc.edu, based on code fragments from pfdisk by Gordon W. Ross,
+ * Jan.  1990 (version 1.2.1 by Gordon W. Ross Aug. 1990; Modified by S.
+ * Lubkin Oct.  1991). */
+
+static void
+long2chs(ulong ls, unsigned int *c, unsigned int *h, unsigned int *s) {
+	int spc = heads * sectors;
+
+	*c = ls / spc;
+	ls = ls % spc;
+	*h = ls / sectors;
+	*s = ls % sectors + 1;	/* sectors count from 1 */
+}
+
+static void check_consistency(struct partition *p, int partition) {
+	unsigned int pbc, pbh, pbs;	/* physical beginning c, h, s */
+	unsigned int pec, peh, pes;	/* physical ending c, h, s */
+	unsigned int lbc, lbh, lbs;	/* logical beginning c, h, s */
+	unsigned int lec, leh, les;	/* logical ending c, h, s */
+
+	if (!dos_compatible_flag)
+		return;
+
+	if (!heads || !sectors || (partition >= 4))
+		return;		/* do not check extended partitions */
+
+/* physical beginning c, h, s */
+	pbc = (p->cyl & 0xff) | ((p->sector << 2) & 0x300);
+	pbh = p->head;
+	pbs = p->sector & 0x3f;
+
+/* physical ending c, h, s */
+	pec = (p->end_cyl & 0xff) | ((p->end_sector << 2) & 0x300);
+	peh = p->end_head;
+	pes = p->end_sector & 0x3f;
+
+/* compute logical beginning (c, h, s) */
+	long2chs(get_start_sect(p), &lbc, &lbh, &lbs);
+
+/* compute logical ending (c, h, s) */
+	long2chs(get_start_sect(p) + get_nr_sects(p) - 1, &lec, &leh, &les);
+
+/* Same physical / logical beginning? */
+	if (cylinders <= 1024 && (pbc != lbc || pbh != lbh || pbs != lbs)) {
+		printf(_("Partition %d has different physical/logical "
+			"beginnings (non-Linux?):\n"), partition + 1);
+		printf(_("     phys=(%d, %d, %d) "), pbc, pbh, pbs);
+		printf(_("logical=(%d, %d, %d)\n"),lbc, lbh, lbs);
+	}
+
+/* Same physical / logical ending? */
+	if (cylinders <= 1024 && (pec != lec || peh != leh || pes != les)) {
+		printf(_("Partition %d has different physical/logical "
+			"endings:\n"), partition + 1);
+		printf(_("     phys=(%d, %d, %d) "), pec, peh, pes);
+		printf(_("logical=(%d, %d, %d)\n"),lec, leh, les);
+	}
+
+#if 0
+/* Beginning on cylinder boundary? */
+	if (pbh != !pbc || pbs != 1) {
+		printf(_("Partition %i does not start on cylinder "
+			"boundary:\n"), partition + 1);
+		printf(_("     phys=(%d, %d, %d) "), pbc, pbh, pbs);
+		printf(_("should be (%d, %d, 1)\n"), pbc, !pbc);
+	}
+#endif
+
+/* Ending on cylinder boundary? */
+	if (peh != (heads - 1) || pes != sectors) {
+		printf(_("Partition %i does not end on cylinder boundary.\n"),
+			partition + 1);
+#if 0
+		printf(_("     phys=(%d, %d, %d) "), pec, peh, pes);
+		printf(_("should be (%d, %d, %d)\n"),
+		pec, heads - 1, sectors);
+#endif
+	}
+}
+
+static void
+check_alignment(unsigned long long lba, int partition)
+{
+	if (!lba_is_aligned(lba))
+		printf(_("Partition %i does not start on physical sector boundary.\n"),
+			partition + 1);
+}
+
+static void
+list_disk_geometry(void) {
+	long long bytes = (total_number_of_sectors << 9);
+	long megabytes = bytes/1000000;
+
+	if (megabytes < 10000)
+		printf(_("\nDisk %s: %ld MB, %lld bytes\n"),
+		       disk_device, megabytes, bytes);
+	else {
+		long hectomega = (megabytes + 50) / 100;
+		printf(_("\nDisk %s: %ld.%ld GB, %lld bytes\n"),
+		       disk_device, hectomega / 10, hectomega % 10, bytes);
+	}
+	printf(_("%d heads, %llu sectors/track, %d cylinders"),
+	       heads, sectors, cylinders);
+	if (units_per_sector == 1)
+		printf(_(", total %llu sectors"),
+		       total_number_of_sectors / sector_factor);
+	printf("\n");
+	printf(_("Units = %s of %d * %d = %d bytes\n"),
+	       str_units(PLURAL),
+	       units_per_sector, sector_size, units_per_sector * sector_size);
+
+	printf(_("Sector size (logical/physical): %u bytes / %lu bytes\n"),
+				sector_size, phy_sector_size);
+	printf(_("I/O size (minimum/optimal): %lu bytes / %lu bytes\n"),
+				min_io_size, io_size);
+	if (alignment_offset)
+		printf(_("Alignment offset: %lu bytes\n"), alignment_offset);
+	if (dos_label)
+		dos_print_mbr_id();
+	printf("\n");
+}
+
+/*
+ * Check whether partition entries are ordered by their starting positions.
+ * Return 0 if OK. Return i if partition i should have been earlier.
+ * Two separate checks: primary and logical partitions.
+ */
+static int
+wrong_p_order(int *prev) {
+	struct pte *pe;
+	struct partition *p;
+	unsigned int last_p_start_pos = 0, p_start_pos;
+	int i, last_i = 0;
+
+	for (i = 0 ; i < partitions; i++) {
+		if (i == 4) {
+			last_i = 4;
+			last_p_start_pos = 0;
+		}
+		pe = &ptes[i];
+		if ((p = pe->part_table)->sys_ind) {
+			p_start_pos = get_partition_start(pe);
+
+			if (last_p_start_pos > p_start_pos) {
+				if (prev)
+					*prev = last_i;
+				return i;
+			}
+
+			last_p_start_pos = p_start_pos;
+			last_i = i;
+		}
+	}
+	return 0;
+}
+
+/*
+ * Fix the chain of logicals.
+ * extended_offset is unchanged, the set of sectors used is unchanged
+ * The chain is sorted so that sectors increase, and so that
+ * starting sectors increase.
+ *
+ * After this it may still be that cfdisk doesnt like the table.
+ * (This is because cfdisk considers expanded parts, from link to
+ * end of partition, and these may still overlap.)
+ * Now
+ *   sfdisk /dev/hda > ohda; sfdisk /dev/hda < ohda
+ * may help.
+ */
+static void
+fix_chain_of_logicals(void) {
+	int j, oj, ojj, sj, sjj;
+	struct partition *pj,*pjj,tmp;
+
+	/* Stage 1: sort sectors but leave sector of part 4 */
+	/* (Its sector is the global extended_offset.) */
+ stage1:
+	for (j = 5; j < partitions-1; j++) {
+		oj = ptes[j].offset;
+		ojj = ptes[j+1].offset;
+		if (oj > ojj) {
+			ptes[j].offset = ojj;
+			ptes[j+1].offset = oj;
+			pj = ptes[j].part_table;
+			set_start_sect(pj, get_start_sect(pj)+oj-ojj);
+			pjj = ptes[j+1].part_table;
+			set_start_sect(pjj, get_start_sect(pjj)+ojj-oj);
+			set_start_sect(ptes[j-1].ext_pointer,
+				       ojj-extended_offset);
+			set_start_sect(ptes[j].ext_pointer,
+				       oj-extended_offset);
+			goto stage1;
+		}
+	}
+
+	/* Stage 2: sort starting sectors */
+ stage2:
+	for (j = 4; j < partitions-1; j++) {
+		pj = ptes[j].part_table;
+		pjj = ptes[j+1].part_table;
+		sj = get_start_sect(pj);
+		sjj = get_start_sect(pjj);
+		oj = ptes[j].offset;
+		ojj = ptes[j+1].offset;
+		if (oj+sj > ojj+sjj) {
+			tmp = *pj;
+			*pj = *pjj;
+			*pjj = tmp;
+			set_start_sect(pj, ojj+sjj-oj);
+			set_start_sect(pjj, oj+sj-ojj);
+			goto stage2;
+		}
+	}
+
+	/* Probably something was changed */
+	for (j = 4; j < partitions; j++)
+		ptes[j].changed = 1;
+}
+
+static void
+fix_partition_table_order(void) {
+	struct pte *pei, *pek;
+	int i,k;
+
+	if (!wrong_p_order(NULL)) {
+		printf(_("Nothing to do. Ordering is correct already.\n\n"));
+		return;
+	}
+
+	while ((i = wrong_p_order(&k)) != 0 && i < 4) {
+		/* partition i should have come earlier, move it */
+		/* We have to move data in the MBR */
+		struct partition *pi, *pk, *pe, pbuf;
+		pei = &ptes[i];
+		pek = &ptes[k];
+
+		pe = pei->ext_pointer;
+		pei->ext_pointer = pek->ext_pointer;
+		pek->ext_pointer = pe;
+
+		pi = pei->part_table;
+		pk = pek->part_table;
+
+		memmove(&pbuf, pi, sizeof(struct partition));
+		memmove(pi, pk, sizeof(struct partition));
+		memmove(pk, &pbuf, sizeof(struct partition));
+
+		pei->changed = pek->changed = 1;
+	}
+
+	if (i)
+		fix_chain_of_logicals();
+
+	printf(_("Done.\n"));
+
+}
+
+static void
+list_table(int xtra) {
+	struct partition *p;
+	char *type;
+	int i, w;
+
+	if (sun_label) {
+		sun_list_table(xtra);
+		return;
+	}
+
+	if (sgi_label) {
+		sgi_list_table(xtra);
+		return;
+	}
+
+	list_disk_geometry();
+
+	if (osf_label) {
+		xbsd_print_disklabel(xtra);
+		return;
+	}
+
+	if (is_garbage_table()) {
+		printf(_("This doesn't look like a partition table\n"
+			 "Probably you selected the wrong device.\n\n"));
+	}
+
+	/* Heuristic: we list partition 3 of /dev/foo as /dev/foo3,
+	   but if the device name ends in a digit, say /dev/foo1,
+	   then the partition is called /dev/foo1p3. */
+	w = strlen(disk_device);
+	if (w && isdigit(disk_device[w-1]))
+		w++;
+	if (w < 5)
+		w = 5;
+
+	printf(_("%*s Boot      Start         End      Blocks   Id  System\n"),
+	       w+1, _("Device"));
+
+	for (i = 0; i < partitions; i++) {
+		struct pte *pe = &ptes[i];
+
+		p = pe->part_table;
+		if (p && !is_cleared_partition(p)) {
+			unsigned int psects = get_nr_sects(p);
+			unsigned int pblocks = psects;
+			unsigned int podd = 0;
+
+			if (sector_size < 1024) {
+				pblocks /= (1024 / sector_size);
+				podd = psects % (1024 / sector_size);
+			}
+			if (sector_size > 1024)
+				pblocks *= (sector_size / 1024);
+                        printf(
+			    "%s  %c %11lu %11lu %11lu%c  %2x  %s\n",
+			partname(disk_device, i+1, w+2),
+/* boot flag */		!p->boot_ind ? ' ' : p->boot_ind == ACTIVE_FLAG
+			? '*' : '?',
+/* start */		(unsigned long) cround(get_partition_start(pe)),
+/* end */		(unsigned long) cround(get_partition_start(pe) + psects
+				- (psects ? 1 : 0)),
+/* odd flag on end */	(unsigned long) pblocks, podd ? '+' : ' ',
+/* type id */		p->sys_ind,
+/* type name */		(type = partition_type(p->sys_ind)) ?
+			type : _("Unknown"));
+			check_consistency(p, i);
+			check_alignment(get_partition_start(pe), i);
+		}
+	}
+
+	/* Is partition table in disk order? It need not be, but... */
+	/* partition table entries are not checked for correct order if this
+	   is a sgi, sun or aix labeled disk... */
+	if (dos_label && wrong_p_order(NULL)) {
+		printf(_("\nPartition table entries are not in disk order\n"));
+	}
+}
+
+static void
+x_list_table(int extend) {
+	struct pte *pe;
+	struct partition *p;
+	int i;
+
+	printf(_("\nDisk %s: %d heads, %llu sectors, %d cylinders\n\n"),
+		disk_device, heads, sectors, cylinders);
+        printf(_("Nr AF  Hd Sec  Cyl  Hd Sec  Cyl     Start      Size ID\n"));
+	for (i = 0 ; i < partitions; i++) {
+		pe = &ptes[i];
+		p = (extend ? pe->ext_pointer : pe->part_table);
+		if (p != NULL) {
+                        printf("%2d %02x%4d%4d%5d%4d%4d%5d%11lu%11lu %02x\n",
+				i + 1, p->boot_ind, p->head,
+				sector(p->sector),
+				cylinder(p->sector, p->cyl), p->end_head,
+				sector(p->end_sector),
+				cylinder(p->end_sector, p->end_cyl),
+				(unsigned long) get_start_sect(p),
+				(unsigned long) get_nr_sects(p), p->sys_ind);
+			if (p->sys_ind) {
+				check_consistency(p, i);
+				check_alignment(get_partition_start(pe), i);
+			}
+		}
+	}
+}
+
+static void
+fill_bounds(unsigned long long *first, unsigned long long *last) {
+	int i;
+	struct pte *pe = &ptes[0];
+	struct partition *p;
+
+	for (i = 0; i < partitions; pe++,i++) {
+		p = pe->part_table;
+		if (!p->sys_ind || IS_EXTENDED (p->sys_ind)) {
+			first[i] = 0xffffffff;
+			last[i] = 0;
+		} else {
+			first[i] = get_partition_start(pe);
+			last[i] = first[i] + get_nr_sects(p) - 1;
+		}
+	}
+}
+
+static void
+check(int n, unsigned int h, unsigned int s, unsigned int c,
+      unsigned int start) {
+	unsigned int total, real_s, real_c;
+
+	real_s = sector(s) - 1;
+	real_c = cylinder(s, c);
+	total = (real_c * sectors + real_s) * heads + h;
+	if (!total)
+		fprintf(stderr, _("Warning: partition %d contains sector 0\n"), n);
+	if (h >= heads)
+		fprintf(stderr,
+			_("Partition %d: head %d greater than maximum %d\n"),
+			n, h + 1, heads);
+	if (real_s >= sectors)
+		fprintf(stderr, _("Partition %d: sector %d greater than "
+			"maximum %llu\n"), n, s, sectors);
+	if (real_c >= cylinders)
+		fprintf(stderr, _("Partitions %d: cylinder %d greater than "
+			"maximum %d\n"), n, real_c + 1, cylinders);
+	if (cylinders <= 1024 && start != total)
+		fprintf(stderr,
+			_("Partition %d: previous sectors %d disagrees with "
+			"total %d\n"), n, start, total);
+}
+
+static void
+verify(void) {
+	int i, j;
+	unsigned long long total = 1;
+	unsigned long long n_sectors = (total_number_of_sectors / sector_factor);
+	unsigned long long first[partitions], last[partitions];
+	struct partition *p;
+
+	if (warn_geometry())
+		return;
+
+	if (sun_label) {
+		verify_sun();
+		return;
+	}
+
+	if (sgi_label) {
+		verify_sgi(1);
+		return;
+	}
+
+	fill_bounds(first, last);
+	for (i = 0; i < partitions; i++) {
+		struct pte *pe = &ptes[i];
+
+		p = pe->part_table;
+		if (p->sys_ind && !IS_EXTENDED (p->sys_ind)) {
+			check_consistency(p, i);
+			check_alignment(get_partition_start(pe), i);
+			if (get_partition_start(pe) < first[i])
+				printf(_("Warning: bad start-of-data in "
+					"partition %d\n"), i + 1);
+			check(i + 1, p->end_head, p->end_sector, p->end_cyl,
+				last[i]);
+			total += last[i] + 1 - first[i];
+			for (j = 0; j < i; j++)
+			if ((first[i] >= first[j] && first[i] <= last[j])
+			 || ((last[i] <= last[j] && last[i] >= first[j]))) {
+				printf(_("Warning: partition %d overlaps "
+					"partition %d.\n"), j + 1, i + 1);
+				total += first[i] >= first[j] ?
+					first[i] : first[j];
+				total -= last[i] <= last[j] ?
+					last[i] : last[j];
+			}
+		}
+	}
+
+	if (extended_offset) {
+		struct pte *pex = &ptes[ext_index];
+		unsigned long long e_last = get_start_sect(pex->part_table) +
+			get_nr_sects(pex->part_table) - 1;
+
+		for (i = 4; i < partitions; i++) {
+			total++;
+			p = ptes[i].part_table;
+			if (!p->sys_ind) {
+				if (i != 4 || i + 1 < partitions)
+					printf(_("Warning: partition %d "
+						"is empty\n"), i + 1);
+			}
+			else if (first[i] < extended_offset ||
+					last[i] > e_last)
+				printf(_("Logical partition %d not entirely in "
+					"partition %d\n"), i + 1, ext_index + 1);
+		}
+	}
+
+	if (total > n_sectors)
+		printf(_("Total allocated sectors %llu greater than the maximum"
+			" %llu\n"), total, n_sectors);
+	else if (total < n_sectors)
+		printf(_("Remaining %lld unallocated %d-byte sectors\n"),
+		       n_sectors - total, sector_size);
+}
+
+static unsigned long long
+get_unused_start(int part_n,
+		unsigned long long start,
+		unsigned long long first[],
+		unsigned long long last[])
+{
+	int i;
+
+	for (i = 0; i < partitions; i++) {
+		unsigned long long lastplusoff;
+
+		if (start == ptes[i].offset)
+			start += sector_offset;
+		lastplusoff = last[i] + ((part_n < 4) ? 0 : sector_offset);
+		if (start >= first[i] && start <= lastplusoff)
+			start = lastplusoff + 1;
+	}
+
+	return start;
+}
+
+static void
+add_partition(int n, int sys) {
+	char mesg[256];		/* 48 does not suffice in Japanese */
+	int i, read = 0;
+	struct partition *p = ptes[n].part_table;
+	struct partition *q = ptes[ext_index].part_table;
+	long long llimit;
+	unsigned long long start, stop = 0, limit, temp,
+		first[partitions], last[partitions];
+
+	if (p && p->sys_ind) {
+		printf(_("Partition %d is already defined.  Delete "
+			 "it before re-adding it.\n"), n + 1);
+		return;
+	}
+	fill_bounds(first, last);
+	if (n < 4) {
+		start = sector_offset;
+		if (display_in_cyl_units || !total_number_of_sectors)
+			llimit = heads * sectors * cylinders - 1;
+		else
+			llimit = (total_number_of_sectors / sector_factor) - 1;
+		limit = llimit;
+		if (limit != llimit)
+			limit = 0x7fffffff;
+		if (extended_offset) {
+			first[ext_index] = extended_offset;
+			last[ext_index] = get_start_sect(q) +
+				get_nr_sects(q) - 1;
+		}
+	} else {
+		start = extended_offset + sector_offset;
+		limit = get_start_sect(q) + get_nr_sects(q) - 1;
+	}
+	if (display_in_cyl_units)
+		for (i = 0; i < partitions; i++)
+			first[i] = (cround(first[i]) - 1) * units_per_sector;
+
+	snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
+	do {
+		unsigned long long dflt, aligned;
+
+		temp = start;
+		dflt = start = get_unused_start(n, start, first, last);
+
+		/* the default sector should be aligned and unused */
+		do {
+			aligned = align_lba_in_range(dflt, dflt, limit);
+			dflt = get_unused_start(n, aligned, first, last);
+		} while (dflt != aligned && dflt > aligned && dflt < limit);
+
+		if (dflt >= limit)
+			dflt = start;
+		if (start > limit)
+			break;
+		if (start >= temp+units_per_sector && read) {
+			printf(_("Sector %llu is already allocated\n"), temp);
+			temp = start;
+			read = 0;
+		}
+		if (!read && start == temp) {
+			unsigned long long i = start;
+
+			start = read_int(cround(i), cround(dflt), cround(limit),
+					 0, mesg);
+			if (display_in_cyl_units) {
+				start = (start - 1) * units_per_sector;
+				if (start < i) start = i;
+			}
+			read = 1;
+		}
+	} while (start != temp || !read);
+	if (n > 4) {			/* NOT for fifth partition */
+		struct pte *pe = &ptes[n];
+
+		pe->offset = start - sector_offset;
+		if (pe->offset == extended_offset) { /* must be corrected */
+			pe->offset++;
+			if (sector_offset == 1)
+				start++;
+		}
+	}
+
+	for (i = 0; i < partitions; i++) {
+		struct pte *pe = &ptes[i];
+
+		if (start < pe->offset && limit >= pe->offset)
+			limit = pe->offset - 1;
+		if (start < first[i] && limit >= first[i])
+			limit = first[i] - 1;
+	}
+	if (start > limit) {
+		printf(_("No free sectors available\n"));
+		if (n > 4)
+			partitions--;
+		return;
+	}
+	if (cround(start) == cround(limit)) {
+		stop = limit;
+	} else {
+		int sx = 0;
+
+		snprintf(mesg, sizeof(mesg),
+			_("Last %1$s, +%2$s or +size{K,M,G}"),
+			 str_units(SINGULAR), str_units(PLURAL));
+
+		stop = read_int_sx(cround(start), cround(limit), cround(limit),
+				cround(start), mesg, &sx);
+		if (display_in_cyl_units) {
+			stop = stop * units_per_sector - 1;
+			if (stop >limit)
+				stop = limit;
+		}
+
+		if (sx && alignment_required) {
+			/* the last sector has not been exactly requested (but
+			 * defined by +size{K,M,G} convention), so be smart
+			 * and align the end of the partition. The next
+			 * partition will start at phy.block boundary.
+			 */
+			stop = align_lba_in_range(stop, start, limit) - 1;
+			if (stop > limit)
+				stop = limit;
+		}
+	}
+
+	set_partition(n, 0, start, stop, sys);
+	if (n > 4)
+		set_partition(n - 1, 1, ptes[n].offset, stop, EXTENDED);
+
+	if (IS_EXTENDED (sys)) {
+		struct pte *pe4 = &ptes[4];
+		struct pte *pen = &ptes[n];
+
+		ext_index = n;
+		pen->ext_pointer = p;
+		pe4->offset = extended_offset = start;
+		if (!(pe4->sectorbuffer = calloc(1, sector_size)))
+			fatal(out_of_memory);
+		pe4->part_table = pt_offset(pe4->sectorbuffer, 0);
+		pe4->ext_pointer = pe4->part_table + 1;
+		pe4->changed = 1;
+		partitions = 5;
+	}
+}
+
+static void
+add_logical(void) {
+	if (partitions > 5 || ptes[4].part_table->sys_ind) {
+		struct pte *pe = &ptes[partitions];
+
+		if (!(pe->sectorbuffer = calloc(1, sector_size)))
+			fatal(out_of_memory);
+		pe->part_table = pt_offset(pe->sectorbuffer, 0);
+		pe->ext_pointer = pe->part_table + 1;
+		pe->offset = 0;
+		pe->changed = 1;
+		partitions++;
+	}
+	add_partition(partitions - 1, LINUX_NATIVE);
+}
+
+static void
+new_partition(void) {
+	int i, free_primary = 0;
+
+	if (warn_geometry())
+		return;
+
+	if (sun_label) {
+		add_sun_partition(get_partition(0, partitions), LINUX_NATIVE);
+		return;
+	}
+
+	if (sgi_label) {
+		sgi_add_partition(get_partition(0, partitions), LINUX_NATIVE);
+		return;
+	}
+
+	if (aix_label) {
+		printf(_("\tSorry - this fdisk cannot handle AIX disk labels."
+			 "\n\tIf you want to add DOS-type partitions, create"
+			 "\n\ta new empty DOS partition table first. (Use o.)"
+			 "\n\tWARNING: "
+			 "This will destroy the present disk contents.\n"));
+		return;
+	}
+
+	if (mac_label) {
+		printf(_("\tSorry - this fdisk cannot handle Mac disk labels."
+		         "\n\tIf you want to add DOS-type partitions, create"
+		         "\n\ta new empty DOS partition table first. (Use o.)"
+		         "\n\tWARNING: "
+		         "This will destroy the present disk contents.\n"));
+		 return;
+	}
+
+	for (i = 0; i < 4; i++)
+		free_primary += !ptes[i].part_table->sys_ind;
+
+	if (!free_primary && partitions >= MAXIMUM_PARTS) {
+		printf(_("The maximum number of partitions has been created\n"));
+		return;
+	}
+
+	if (!free_primary) {
+		if (extended_offset)
+			add_logical();
+		else
+			printf(_("You must delete some partition and add "
+				 "an extended partition first\n"));
+	} else if (partitions >= MAXIMUM_PARTS) {
+		printf(_("All logical partitions are in use\n"));
+		printf(_("Adding a primary partition\n"));
+		add_partition(get_partition(0, 4), LINUX_NATIVE);
+	} else {
+		char c, line[LINE_LENGTH];
+		snprintf(line, sizeof(line),
+			 _("Command action\n   %s\n   p   primary "
+			   "partition (1-4)\n"), extended_offset ?
+			 _("l   logical (5 or over)") : _("e   extended"));
+		while (1) {
+			if ((c = tolower(read_char(line))) == 'p') {
+				int i = get_nonexisting_partition(0, 4);
+				if (i >= 0)
+					add_partition(i, LINUX_NATIVE);
+				return;
+			}
+			else if (c == 'l' && extended_offset) {
+				add_logical();
+				return;
+			}
+			else if (c == 'e' && !extended_offset) {
+				int i = get_nonexisting_partition(0, 4);
+				if (i >= 0)
+					add_partition(i, EXTENDED);
+				return;
+			}
+			else
+				printf(_("Invalid partition number "
+					 "for type `%c'\n"), c);
+		}
+	}
+}
+
+static void
+write_table(void) {
+	int i;
+
+	if (dos_label) {
+		for (i=0; i<3; i++)
+			if (ptes[i].changed)
+				ptes[3].changed = 1;
+		for (i = 3; i < partitions; i++) {
+			struct pte *pe = &ptes[i];
+
+			if (pe->changed) {
+				write_part_table_flag(pe->sectorbuffer);
+				write_sector(fd, pe->offset, pe->sectorbuffer);
+			}
+		}
+	}
+	else if (sgi_label) {
+		/* no test on change? the printf below might be mistaken */
+		sgi_write_table();
+	} else if (sun_label) {
+		int needw = 0;
+
+		for (i=0; i<8; i++)
+			if (ptes[i].changed)
+				needw = 1;
+		if (needw)
+			sun_write_table();
+	}
+
+	printf(_("The partition table has been altered!\n\n"));
+	reread_partition_table(1);
+}
+
+void
+reread_partition_table(int leave) {
+	int i;
+	struct stat statbuf;
+
+	i = fstat(fd, &statbuf);
+	if (i == 0 && S_ISBLK(statbuf.st_mode)) {
+		sync();
+#ifdef BLKRRPART
+		printf(_("Calling ioctl() to re-read partition table.\n"));
+		i = ioctl(fd, BLKRRPART);
+#else
+		errno = ENOSYS;
+		i = 1;
+#endif
+        }
+
+	if (i) {
+		printf(_("\nWARNING: Re-reading the partition table failed with error %d: %s.\n"
+			 "The kernel still uses the old table. The new table will be used at\n"
+			 "the next reboot or after you run partprobe(8) or kpartx(8)\n"),
+			errno, strerror(errno));
+	}
+
+	if (dos_changed)
+	    printf(
+		_("\nWARNING: If you have created or modified any DOS 6.x\n"
+		"partitions, please see the fdisk manual page for additional\n"
+		"information.\n"));
+
+	if (leave) {
+		if (fsync(fd) || close(fd)) {
+			fprintf(stderr, _("\nError closing file\n"));
+			exit(1);
+		}
+
+		printf(_("Syncing disks.\n"));
+		sync();
+		exit(!!i);
+	}
+}
+
+#define MAX_PER_LINE	16
+static void
+print_buffer(unsigned char pbuffer[]) {
+	int	i,
+		l;
+
+	for (i = 0, l = 0; i < sector_size; i++, l++) {
+		if (l == 0)
+			printf("0x%03X:", i);
+		printf(" %02X", pbuffer[i]);
+		if (l == MAX_PER_LINE - 1) {
+			printf("\n");
+			l = -1;
+		}
+	}
+	if (l > 0)
+		printf("\n");
+	printf("\n");
+}
+
+static void
+print_raw(void) {
+	int i;
+
+	printf(_("Device: %s\n"), disk_device);
+	if (sun_label || sgi_label)
+		print_buffer(MBRbuffer);
+	else for (i = 3; i < partitions; i++)
+		print_buffer(ptes[i].sectorbuffer);
+}
+
+static void
+move_begin(int i) {
+	struct pte *pe = &ptes[i];
+	struct partition *p = pe->part_table;
+	unsigned int new, first;
+
+	if (warn_geometry())
+		return;
+	if (!p->sys_ind || !get_nr_sects(p) || IS_EXTENDED (p->sys_ind)) {
+		printf(_("Partition %d has no data area\n"), i + 1);
+		return;
+	}
+	first = get_partition_start(pe);
+	new = read_int(first, first, first + get_nr_sects(p) - 1, first,
+		       _("New beginning of data")) - pe->offset;
+
+	if (new != get_nr_sects(p)) {
+		first = get_nr_sects(p) + get_start_sect(p) - new;
+		set_nr_sects(p, first);
+		set_start_sect(p, new);
+		pe->changed = 1;
+	}
+}
+
+static void
+xselect(void) {
+	char c;
+
+	while(1) {
+		putchar('\n');
+		c = tolower(read_char(_("Expert command (m for help): ")));
+		switch (c) {
+		case 'a':
+			if (sun_label)
+				sun_set_alt_cyl();
+			break;
+		case 'b':
+			if (dos_label)
+				move_begin(get_partition(0, partitions));
+			break;
+		case 'c':
+			user_cylinders = cylinders =
+				read_int(1, cylinders, 1048576, 0,
+					 _("Number of cylinders"));
+			if (sun_label)
+				sun_set_ncyl(cylinders);
+			break;
+		case 'd':
+			print_raw();
+			break;
+		case 'e':
+			if (sgi_label)
+				sgi_set_xcyl();
+			else if (sun_label)
+				sun_set_xcyl();
+			else
+			if (dos_label)
+				x_list_table(1);
+			break;
+		case 'f':
+			if (dos_label)
+				fix_partition_table_order();
+			break;
+		case 'g':
+			create_sgilabel();
+			break;
+		case 'h':
+			user_heads = heads = read_int(1, heads, 256, 0,
+					 _("Number of heads"));
+			update_units();
+			break;
+		case 'i':
+			if (sun_label)
+				sun_set_ilfact();
+			if (dos_label)
+				dos_set_mbr_id();
+			break;
+		case 'o':
+			if (sun_label)
+				sun_set_rspeed();
+			break;
+		case 'p':
+			if (sun_label)
+				list_table(1);
+			else
+				x_list_table(0);
+			break;
+		case 'q':
+			close(fd);
+			printf("\n");
+			exit(0);
+		case 'r':
+			return;
+		case 's':
+			user_sectors = sectors = read_int(1, sectors, 63, 0,
+					   _("Number of sectors"));
+			if (dos_compatible_flag)
+				fprintf(stderr, _("Warning: setting "
+					"sector offset for DOS "
+					"compatiblity\n"));
+			update_sector_offset();
+			update_units();
+			break;
+		case 'v':
+			verify();
+			break;
+		case 'w':
+			write_table(); 	/* does not return */
+			break;
+		case 'y':
+			if (sun_label)
+				sun_set_pcylcount();
+			break;
+		default:
+			xmenu();
+		}
+	}
+}
+
+static int
+is_ide_cdrom_or_tape(char *device) {
+	FILE *procf;
+	char buf[100];
+	struct stat statbuf;
+	int is_ide = 0;
+
+	/* No device was given explicitly, and we are trying some
+	   likely things.  But opening /dev/hdc may produce errors like
+           "hdc: tray open or drive not ready"
+	   if it happens to be a CD-ROM drive. It even happens that
+	   the process hangs on the attempt to read a music CD.
+	   So try to be careful. This only works since 2.1.73. */
+
+	if (strncmp("/dev/hd", device, 7))
+		return 0;
+
+	snprintf(buf, sizeof(buf), "/proc/ide/%s/media", device+5);
+	procf = fopen(buf, "r");
+	if (procf != NULL && fgets(buf, sizeof(buf), procf))
+		is_ide = (!strncmp(buf, "cdrom", 5) ||
+			  !strncmp(buf, "tape", 4));
+	else
+		/* Now when this proc file does not exist, skip the
+		   device when it is read-only. */
+		if (stat(device, &statbuf) == 0)
+			is_ide = ((statbuf.st_mode & 0222) == 0);
+
+	if (procf)
+		fclose(procf);
+	return is_ide;
+}
+
+static void
+gpt_warning(char *dev)
+{
+	if (dev && gpt_probe_signature_devname(dev))
+		fprintf(stderr, _("\nWARNING: GPT (GUID Partition Table) detected on '%s'! "
+			"The util fdisk doesn't support GPT. Use GNU Parted.\n\n"), dev);
+}
+
+static void
+try(char *device, int user_specified) {
+	int gb;
+
+	disk_device = device;
+	if (setjmp(listingbuf))
+		return;
+	if (!user_specified)
+		if (is_ide_cdrom_or_tape(device))
+			return;
+	gpt_warning(device);
+	if ((fd = open(disk_device, type_open)) >= 0) {
+		gb = get_boot(try_only);
+		if (gb > 0) { /* I/O error */
+		} else if (gb < 0) { /* no DOS signature */
+			list_disk_geometry();
+			if (!aix_label && !mac_label && btrydev(device) < 0)
+				fprintf(stderr,
+					_("Disk %s doesn't contain a valid "
+					  "partition table\n"), device);
+		} else {
+			list_table(0);
+		}
+		close(fd);
+	} else {
+		/* Ignore other errors, since we try IDE
+		   and SCSI hard disks which may not be
+		   installed on the system. */
+		if (errno == EACCES) {
+			fprintf(stderr, _("Cannot open %s\n"), device);
+			return;
+		}
+	}
+}
+
+/*
+ * for fdisk -l:
+ * try all things in /proc/partitions that look like a full disk
+ */
+static void
+tryprocpt(void) {
+	FILE *procpt;
+	char line[128], ptname[128], devname[256];
+	int ma, mi;
+	unsigned long long sz;
+
+	procpt = fopen(PROC_PARTITIONS, "r");
+	if (procpt == NULL) {
+		fprintf(stderr, _("cannot open %s\n"), PROC_PARTITIONS);
+		return;
+	}
+
+	while (fgets(line, sizeof(line), procpt)) {
+		if (sscanf (line, " %d %d %llu %128[^\n ]",
+			    &ma, &mi, &sz, ptname) != 4)
+			continue;
+		snprintf(devname, sizeof(devname), "/dev/%s", ptname);
+		if (is_whole_disk(devname))
+			try(devname, 0);
+	}
+	fclose(procpt);
+}
+
+static void
+dummy(int *kk) {}
+
+static void
+unknown_command(int c) {
+	printf(_("%c: unknown command\n"), c);
+}
+
+
+
+int
+main(int argc, char **argv) {
+	int j, c;
+	int optl = 0, opts = 0;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	while ((c = getopt(argc, argv, "b:cC:hH:lsS:uvV")) != -1) {
+		switch (c) {
+		case 'b':
+			/* Ugly: this sector size is really per device,
+			   so cannot be combined with multiple disks,
+			   and te same goes for the C/H/S options.
+			*/
+			sector_size = atoi(optarg);
+			if (sector_size != 512 && sector_size != 1024 &&
+			    sector_size != 2048 && sector_size != 4096)
+				fatal(usage);
+			sector_offset = 2;
+			user_set_sector_size = 1;
+			break;
+		case 'C':
+			user_cylinders = atoi(optarg);
+			break;
+		case 'c':
+			dos_compatible_flag = 0;
+			break;
+		case 'h':
+			fatal(help);
+			break;
+		case 'H':
+			user_heads = atoi(optarg);
+			if (user_heads <= 0 || user_heads > 256)
+				user_heads = 0;
+			break;
+		case 'S':
+			user_sectors = atoi(optarg);
+			if (user_sectors <= 0 || user_sectors >= 64)
+				user_sectors = 0;
+			break;
+		case 'l':
+			optl = 1;
+			break;
+		case 's':
+			opts = 1;
+			break;
+		case 'u':
+			display_in_cyl_units = 0;
+			break;
+		case 'V':
+		case 'v':
+			printf("fdisk (%s)\n", PACKAGE_STRING);
+			exit(0);
+		default:
+			fatal(usage);
+		}
+	}
+
+#if 0
+	printf(_("This kernel finds the sector size itself - "
+		 "-b option ignored\n"));
+#else
+	if (user_set_sector_size && argc-optind != 1)
+		printf(_("Warning: the -b (set sector size) option should"
+			 " be used with one specified device\n"));
+#endif
+
+	init_mbr_buffer();
+
+	if (optl) {
+		nowarn = 1;
+		type_open = O_RDONLY;
+		if (argc > optind) {
+			int k;
+			/* avoid gcc warning:
+			   variable `k' might be clobbered by `longjmp' */
+			dummy(&k);
+			listing = 1;
+			for (k = optind; k < argc; k++)
+				try(argv[k], 1);
+		} else {
+			/* we no longer have default device names */
+			/* but we can use /proc/partitions instead */
+			tryprocpt();
+		}
+		exit(0);
+	}
+
+	if (opts) {
+		unsigned long long size;
+
+		nowarn = 1;
+		type_open = O_RDONLY;
+
+		opts = argc - optind;
+		if (opts <= 0)
+			fatal(usage);
+
+		for (j = optind; j < argc; j++) {
+			disk_device = argv[j];
+			if ((fd = open(disk_device, type_open)) < 0)
+				fatal(unable_to_open);
+			if (blkdev_get_sectors(fd, &size) == -1)
+				fatal(ioctl_error);
+			close(fd);
+			if (opts == 1)
+				printf("%llu\n", size/2);
+			else
+				printf("%s: %llu\n", argv[j], size/2);
+		}
+		exit(0);
+	}
+
+	if (argc-optind == 1)
+		disk_device = argv[optind];
+	else
+		fatal(usage);
+
+	gpt_warning(disk_device);
+	get_boot(fdisk);
+
+	if (osf_label) {
+		/* OSF label, and no DOS label */
+		printf(_("Detected an OSF/1 disklabel on %s, entering "
+			 "disklabel mode.\n"),
+		       disk_device);
+		bselect();
+		osf_label = 0;
+		/* If we return we may want to make an empty DOS label? */
+	}
+
+	while (1) {
+		putchar('\n');
+		c = tolower(read_char(_("Command (m for help): ")));
+		switch (c) {
+		case 'a':
+			if (dos_label)
+				toggle_active(get_partition(1, partitions));
+			else if (sun_label)
+				toggle_sunflags(get_partition(1, partitions),
+						SUN_FLAG_UNMNT);
+			else if (sgi_label)
+				sgi_set_bootpartition(
+					get_partition(1, partitions));
+			else
+				unknown_command(c);
+			break;
+		case 'b':
+			if (sgi_label) {
+				printf(_("\nThe current boot file is: %s\n"),
+				       sgi_get_bootfile());
+				if (read_chars(_("Please enter the name of the "
+					       "new boot file: ")) == '\n')
+					printf(_("Boot file unchanged\n"));
+				else
+					sgi_set_bootfile(line_ptr);
+			} else
+				bselect();
+			break;
+		case 'c':
+			if (dos_label)
+				toggle_dos_compatibility_flag();
+			else if (sun_label)
+				toggle_sunflags(get_partition(1, partitions),
+						SUN_FLAG_RONLY);
+			else if (sgi_label)
+				sgi_set_swappartition(
+						get_partition(1, partitions));
+			else
+				unknown_command(c);
+			break;
+		case 'd':
+        		/* If sgi_label then don't use get_existing_partition,
+			   let the user select a partition, since
+			   get_existing_partition() only works for Linux-like
+			   partition tables */
+        		if (!sgi_label) {
+                		j = get_existing_partition(1, partitions);
+        		} else {
+                		j = get_partition(1, partitions);
+        		}
+			if (j >= 0)
+				delete_partition(j);
+			break;
+		case 'i':
+			if (sgi_label)
+				create_sgiinfo();
+			else
+				unknown_command(c);
+		case 'l':
+			list_types(get_sys_types());
+			break;
+		case 'm':
+			menu();
+			break;
+		case 'n':
+			new_partition();
+			break;
+		case 'o':
+			create_doslabel();
+			break;
+		case 'p':
+			list_table(0);
+			break;
+		case 'q':
+			close(fd);
+			printf("\n");
+			exit(0);
+		case 's':
+			create_sunlabel();
+			break;
+		case 't':
+			change_sysid();
+			break;
+		case 'u':
+			change_units();
+			break;
+		case 'v':
+			verify();
+			break;
+		case 'w':
+			write_table(); 		/* does not return */
+			break;
+		case 'x':
+			if (sgi_label) {
+				fprintf(stderr,
+					_("\n\tSorry, no experts menu for SGI "
+					"partition tables available.\n\n"));
+			} else
+				xselect();
+			break;
+		default:
+			unknown_command(c);
+			menu();
+		}
+	}
+	return 0;
+}
diff --git a/util-linux-ng-2.17.2/fdisk/fdisk.h b/util-linux-ng-2.17.2/fdisk/fdisk.h
new file mode 100644
index 0000000..1a89beb
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisk.h
@@ -0,0 +1,112 @@
+/*
+   fdisk.h
+*/
+
+#include "c.h"
+
+#define DEFAULT_SECTOR_SIZE	512
+#define MAX_SECTOR_SIZE	2048
+#define SECTOR_SIZE	512	/* still used in BSD code */
+#define MAXIMUM_PARTS	60
+
+#define ACTIVE_FLAG     0x80
+
+#define EXTENDED        0x05
+#define WIN98_EXTENDED  0x0f
+#define LINUX_PARTITION 0x81
+#define LINUX_SWAP      0x82
+#define LINUX_NATIVE    0x83
+#define LINUX_EXTENDED  0x85
+#define LINUX_LVM       0x8e
+#define LINUX_RAID      0xfd
+
+#define IS_EXTENDED(i) \
+	((i) == EXTENDED || (i) == WIN98_EXTENDED || (i) == LINUX_EXTENDED)
+
+#define cround(n)	(display_in_cyl_units ? ((n)/units_per_sector)+1 : (n))
+#define scround(x)	(((x)+units_per_sector-1)/units_per_sector)
+
+#if defined(__GNUC__) && (defined(__arm__) || defined(__alpha__))
+# define PACKED __attribute__ ((packed))
+#else
+# define PACKED
+#endif
+
+struct partition {
+	unsigned char boot_ind;         /* 0x80 - active */
+	unsigned char head;             /* starting head */
+	unsigned char sector;           /* starting sector */
+	unsigned char cyl;              /* starting cylinder */
+	unsigned char sys_ind;          /* What partition type */
+	unsigned char end_head;         /* end head */
+	unsigned char end_sector;       /* end sector */
+	unsigned char end_cyl;          /* end cylinder */
+	unsigned char start4[4];        /* starting sector counting from 0 */
+	unsigned char size4[4];         /* nr of sectors in partition */
+} PACKED;
+
+enum failure {help, usage, ioctl_error,
+	unable_to_open, unable_to_read, unable_to_seek,
+	unable_to_write, out_of_memory};
+
+enum action {fdisk, require, try_only, create_empty_dos, create_empty_sun};
+
+struct geom {
+	unsigned int heads;
+	unsigned int sectors;
+	unsigned int cylinders;
+};
+
+/* prototypes for fdisk.c */
+extern char *disk_device, *line_ptr;
+extern int fd, partitions;
+extern unsigned int display_in_cyl_units, units_per_sector;
+extern void change_units(void);
+extern void fatal(enum failure why);
+extern void get_geometry(int fd, struct geom *);
+extern int get_boot(enum action what);
+extern int  get_partition(int warn, int max);
+extern void list_types(struct systypes *sys);
+extern int read_line (void);
+extern char read_char(char *mesg);
+extern int read_hex(struct systypes *sys);
+extern void reread_partition_table(int leave);
+extern struct partition *get_part_table(int);
+extern int valid_part_table_flag(unsigned char *b);
+extern unsigned int read_int(unsigned int low, unsigned int dflt,
+			     unsigned int high, unsigned int base, char *mesg);
+
+extern unsigned char *MBRbuffer;
+extern void zeroize_mbr_buffer(void);
+
+extern unsigned int heads, cylinders, sector_size;
+extern unsigned long long sectors;
+extern char *partition_type(unsigned char type);
+extern void update_units(void);
+extern char read_chars(char *mesg);
+extern void set_changed(int);
+extern void set_all_unchanged(void);
+
+#define PLURAL	0
+#define SINGULAR 1
+extern const char * str_units(int);
+
+extern unsigned long long get_start_sect(struct partition *p);
+extern unsigned long long get_nr_sects(struct partition *p);
+
+extern int osf_label;
+extern int sun_label;
+extern int sgi_label;
+extern int aix_label;
+extern int mac_label;
+
+/* prototypes for fdiskbsdlabel.c */
+extern void bselect(void);
+extern int check_osf_label(void);
+extern int btrydev(char * dev);
+extern void xbsd_print_disklabel(int);
+
+/* prototypes for fdisksgilabel.c */
+extern int valid_part_table_flag(unsigned char *b);
+
+#define PROC_PARTITIONS "/proc/partitions"
diff --git a/util-linux-ng-2.17.2/fdisk/fdiskaixlabel.c b/util-linux-ng-2.17.2/fdisk/fdiskaixlabel.c
new file mode 100644
index 0000000..e7ee95d
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdiskaixlabel.c
@@ -0,0 +1,69 @@
+/*
+  Changes:
+  Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+  	Internationalization
+*/
+#include <stdio.h>              /* stderr */
+#include <string.h>             /* strstr */
+#include <unistd.h>             /* write */
+
+#include <endian.h>
+
+#include "common.h"
+#include "fdisk.h"
+#include "fdiskaixlabel.h"
+#include "nls.h"
+
+static	int     other_endian = 0;
+static  short	volumes=1;
+
+/*
+ * only dealing with free blocks here
+ */
+
+static void
+aix_info( void ) {
+    puts(
+	_("\n\tThere is a valid AIX label on this disk.\n"
+	"\tUnfortunately Linux cannot handle these\n"
+	"\tdisks at the moment.  Nevertheless some\n"
+	"\tadvice:\n"
+	"\t1. fdisk will destroy its contents on write.\n"
+	"\t2. Be sure that this disk is NOT a still vital\n"
+	"\t   part of a volume group. (Otherwise you may\n"
+	"\t   erase the other disks as well, if unmirrored.)\n"
+	"\t3. Before deleting this physical volume be sure\n"
+	"\t   to remove the disk logically from your AIX\n"
+	"\t   machine.  (Otherwise you become an AIXpert).")
+    );
+}
+
+void
+aix_nolabel( void )
+{
+    aixlabel->magic = 0;
+    aix_label = 0;
+    partitions = 4;
+    zeroize_mbr_buffer();
+    return;
+}
+
+int
+check_aix_label( void )
+{
+    if (aixlabel->magic != AIX_LABEL_MAGIC &&
+	aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) {
+	aix_label = 0;
+	other_endian = 0;
+	return 0;
+    }
+    other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
+    update_units();
+    aix_label = 1;
+    partitions= 1016;
+    volumes = 15;
+    aix_info();
+    aix_nolabel();		/* %% */
+    aix_label = 1;		/* %% */
+    return 1;
+}
diff --git a/util-linux-ng-2.17.2/fdisk/fdiskaixlabel.h b/util-linux-ng-2.17.2/fdisk/fdiskaixlabel.h
new file mode 100644
index 0000000..324b9ae
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdiskaixlabel.h
@@ -0,0 +1,31 @@
+#ifndef FDISK_AIX_LABEL_H
+#define FDISK_AIX_LABEL_H
+
+#include <stdint.h>
+/*
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ *	This file may be redistributed under
+ *	the terms of the GNU Public License.
+ */
+
+typedef struct {
+	unsigned int   magic;        /* expect AIX_LABEL_MAGIC */
+	unsigned int   fillbytes1[124];
+	unsigned int   physical_volume_id;
+	unsigned int   fillbytes2[124];
+} aix_partition;
+
+#define	AIX_LABEL_MAGIC		0xc9c2d4c1
+#define	AIX_LABEL_MAGIC_SWAPPED	0xc1d4c2c9
+#define	AIX_INFO_MAGIC		0x00072959
+#define	AIX_INFO_MAGIC_SWAPPED	0x59290700
+
+/* fdisk.c */
+#define aixlabel ((aix_partition *)MBRbuffer)
+
+/* fdiskaixlabel.c */
+extern struct	systypes aix_sys_types[];
+extern void	aix_nolabel( void );
+extern int	check_aix_label( void );
+
+#endif /* FDISK_AIX_LABEL_H */
diff --git a/util-linux-ng-2.17.2/fdisk/fdiskbsdlabel.c b/util-linux-ng-2.17.2/fdisk/fdiskbsdlabel.c
new file mode 100644
index 0000000..2f41561
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdiskbsdlabel.c
@@ -0,0 +1,866 @@
+/*
+   NetBSD disklabel editor for Linux fdisk
+   Written by Bernhard Fastenrath (fasten@informatik.uni-bonn.de)
+   with code from the NetBSD disklabel command:
+  
+   Copyright (c) 1987, 1988 Regents of the University of California.
+   All rights reserved.
+  
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+   3. All advertising materials mentioning features or use of this software
+      must display the following acknowledgement:
+  	This product includes software developed by the University of
+  	California, Berkeley and its contributors.
+   4. Neither the name of the University nor the names of its contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+  
+   THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+   SUCH DAMAGE.
+
+   Changes:
+   19990319 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> - i18n/nls
+
+   20000101 - David Huggins-Daines <dhuggins@linuxcare.com> - Better
+   support for OSF/1 disklabels on Alpha.
+   Also fixed unaligned accesses in alpha_bootblock_checksum()
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <setjmp.h>
+#include <errno.h>
+#include "nls.h"
+
+#include <sys/param.h>
+
+#include "common.h"
+#include "fdisk.h"
+#define FREEBSD_PARTITION	0xa5
+#define NETBSD_PARTITION	0xa9
+#define DKTYPENAMES
+#include "fdiskbsdlabel.h"
+
+static void xbsd_delete_part (void);
+static void xbsd_new_part (void);
+static void xbsd_write_disklabel (void);
+static int xbsd_create_disklabel (void);
+static void xbsd_edit_disklabel (void);
+static void xbsd_write_bootstrap (void);
+static void xbsd_change_fstype (void);
+static int xbsd_get_part_index (int max);
+static int xbsd_check_new_partition (int *i);
+static void xbsd_list_types (void);
+static u_short xbsd_dkcksum (struct xbsd_disklabel *lp);
+static int xbsd_initlabel  (struct partition *p, struct xbsd_disklabel *d,
+			    int pindex);
+static int xbsd_readlabel  (struct partition *p, struct xbsd_disklabel *d);
+static int xbsd_writelabel (struct partition *p, struct xbsd_disklabel *d);
+static void sync_disks (void);
+
+#if defined (__alpha__)
+void alpha_bootblock_checksum (char *boot);
+#endif
+
+#if !defined (__alpha__)
+static int xbsd_translate_fstype (int linux_type);
+static void xbsd_link_part (void);
+static struct partition *xbsd_part;
+static int xbsd_part_index;
+#endif
+
+#if defined (__alpha__)
+/* We access this through a u_int64_t * when checksumming */
+static char disklabelbuffer[BSD_BBSIZE] __attribute__((aligned(8)));
+#else
+static char disklabelbuffer[BSD_BBSIZE];
+#endif
+
+static struct xbsd_disklabel xbsd_dlabel;
+
+#define bsd_cround(n) \
+	(display_in_cyl_units ? ((n)/xbsd_dlabel.d_secpercyl) + 1 : (n))
+
+/*
+ * Test whether the whole disk has BSD disk label magic.
+ *
+ * Note: often reformatting with DOS-type label leaves the BSD magic,
+ * so this does not mean that there is a BSD disk label.
+ */
+int
+check_osf_label(void) {
+	if (xbsd_readlabel (NULL, &xbsd_dlabel) == 0)
+		return 0;
+	return 1;
+}
+
+int
+btrydev (char * dev) {
+	if (xbsd_readlabel (NULL, &xbsd_dlabel) == 0)
+		return -1;
+	printf(_("\nBSD label for device: %s\n"), dev);
+	xbsd_print_disklabel (0);
+	return 0;
+}
+
+static void
+bmenu (void) {
+  puts (_("Command action"));
+  puts (_("   d   delete a BSD partition"));
+  puts (_("   e   edit drive data"));
+  puts (_("   i   install bootstrap"));
+  puts (_("   l   list known filesystem types"));
+  puts (_("   m   print this menu"));
+  puts (_("   n   add a new BSD partition"));
+  puts (_("   p   print BSD partition table"));
+  puts (_("   q   quit without saving changes"));
+  puts (_("   r   return to main menu"));
+  puts (_("   s   show complete disklabel"));
+  puts (_("   t   change a partition's filesystem id"));
+  puts (_("   u   change units (cylinders/sectors)"));
+  puts (_("   w   write disklabel to disk"));
+#if !defined (__alpha__)
+  puts (_("   x   link BSD partition to non-BSD partition"));
+#endif
+}
+
+#if !defined (__alpha__)
+static int
+hidden(int type) {
+	return type ^ 0x10;
+}
+
+static int
+is_bsd_partition_type(int type) {
+	return (type == FREEBSD_PARTITION ||
+		type == hidden(FREEBSD_PARTITION) ||
+		type == NETBSD_PARTITION ||
+		type == hidden(NETBSD_PARTITION));
+}
+#endif
+
+void
+bselect (void) {
+#if !defined (__alpha__)
+  int t, ss;
+  struct partition *p;
+
+  for (t=0; t<4; t++) {
+    p = get_part_table(t);
+    if (p && is_bsd_partition_type(p->sys_ind)) {
+      xbsd_part = p;
+      xbsd_part_index = t;
+      ss = get_start_sect(xbsd_part);
+      if (ss == 0) {
+	fprintf (stderr, _("Partition %s has invalid starting sector 0.\n"),
+		 partname(disk_device, t+1, 0));
+	return;
+      }
+      printf (_("Reading disklabel of %s at sector %d.\n"),
+	      partname(disk_device, t+1, 0), ss + BSD_LABELSECTOR);
+      if (xbsd_readlabel (xbsd_part, &xbsd_dlabel) == 0)
+	if (xbsd_create_disklabel () == 0)
+	  return;
+      break;
+    }
+  }
+
+  if (t == 4) {
+    printf (_("There is no *BSD partition on %s.\n"), disk_device);
+    return;
+  }
+
+#elif defined (__alpha__)
+
+  if (xbsd_readlabel (NULL, &xbsd_dlabel) == 0)
+    if (xbsd_create_disklabel () == 0)
+      exit ( EXIT_SUCCESS );
+
+#endif
+
+  while (1) {
+    putchar ('\n');
+    switch (tolower (read_char (_("BSD disklabel command (m for help): ")))) {
+      case 'd':
+	xbsd_delete_part ();
+	break;
+      case 'e':
+	xbsd_edit_disklabel ();
+	break;
+      case 'i':
+	xbsd_write_bootstrap ();
+	break;
+      case 'l':
+	xbsd_list_types ();
+	break;
+      case 'n':
+	xbsd_new_part ();
+	break;
+      case 'p':
+	xbsd_print_disklabel (0);
+	break;
+      case 'q':
+	close (fd);
+	exit ( EXIT_SUCCESS );
+      case 'r':
+	return;
+      case 's':
+	xbsd_print_disklabel (1);
+	break;
+      case 't':
+	xbsd_change_fstype ();
+	break;
+      case 'u':
+	change_units();
+	break;
+      case 'w':
+	xbsd_write_disklabel ();
+	break;
+#if !defined (__alpha__)
+      case 'x':
+	xbsd_link_part ();
+	break;
+#endif
+      default:
+	bmenu ();
+	break;
+    }
+  }
+}
+
+static void
+xbsd_delete_part (void)
+{
+  int i;
+
+  i = xbsd_get_part_index (xbsd_dlabel.d_npartitions);
+  xbsd_dlabel.d_partitions[i].p_size   = 0;
+  xbsd_dlabel.d_partitions[i].p_offset = 0;
+  xbsd_dlabel.d_partitions[i].p_fstype = BSD_FS_UNUSED;
+  if (xbsd_dlabel.d_npartitions == i + 1)
+    while (xbsd_dlabel.d_partitions[xbsd_dlabel.d_npartitions-1].p_size == 0)
+      xbsd_dlabel.d_npartitions--;
+}
+
+static void
+xbsd_new_part (void)
+{
+  unsigned int begin, end;
+  char mesg[256];
+  int i;
+
+  if (!xbsd_check_new_partition (&i))
+    return;
+
+#if !defined (__alpha__) && !defined (__powerpc__) && !defined (__hppa__)
+  begin = get_start_sect(xbsd_part);
+  end = begin + get_nr_sects(xbsd_part) - 1;
+#else
+  begin = 0;
+  end = xbsd_dlabel.d_secperunit - 1;
+#endif
+
+  snprintf (mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
+  begin = read_int (bsd_cround (begin), bsd_cround (begin), bsd_cround (end),
+		    0, mesg);
+
+  if (display_in_cyl_units)
+    begin = (begin - 1) * xbsd_dlabel.d_secpercyl;
+
+  snprintf (mesg, sizeof(mesg), _("Last %s or +size or +sizeM or +sizeK"),
+	   str_units(SINGULAR));
+  end = read_int (bsd_cround (begin), bsd_cround (end), bsd_cround (end),
+		  bsd_cround (begin), mesg);
+
+  if (display_in_cyl_units)
+    end = end * xbsd_dlabel.d_secpercyl - 1;
+
+  xbsd_dlabel.d_partitions[i].p_size   = end - begin + 1;
+  xbsd_dlabel.d_partitions[i].p_offset = begin;
+  xbsd_dlabel.d_partitions[i].p_fstype = BSD_FS_UNUSED;
+}
+
+void
+xbsd_print_disklabel (int show_all) {
+  struct xbsd_disklabel *lp = &xbsd_dlabel;
+  struct xbsd_partition *pp;
+  FILE *f = stdout;
+  int i, j;
+
+  if (show_all) {
+#if defined (__alpha__)
+    fprintf(f, "# %s:\n", disk_device);
+#else
+    fprintf(f, "# %s:\n", partname(disk_device, xbsd_part_index+1, 0));
+#endif
+    if ((unsigned) lp->d_type < BSD_DKMAXTYPES)
+      fprintf(f, _("type: %s\n"), xbsd_dktypenames[lp->d_type]);
+    else
+      fprintf(f, _("type: %d\n"), lp->d_type);
+    fprintf(f, _("disk: %.*s\n"), (int) sizeof(lp->d_typename), lp->d_typename);
+    fprintf(f, _("label: %.*s\n"), (int) sizeof(lp->d_packname), lp->d_packname);
+    fprintf(f, _("flags:"));
+    if (lp->d_flags & BSD_D_REMOVABLE)
+      fprintf(f, _(" removable"));
+    if (lp->d_flags & BSD_D_ECC)
+      fprintf(f, _(" ecc"));
+    if (lp->d_flags & BSD_D_BADSECT)
+      fprintf(f, _(" badsect"));
+    fprintf(f, "\n");
+    /* On various machines the fields of *lp are short/int/long */
+    /* In order to avoid problems, we cast them all to long. */
+    fprintf(f, _("bytes/sector: %ld\n"), (long) lp->d_secsize);
+    fprintf(f, _("sectors/track: %ld\n"), (long) lp->d_nsectors);
+    fprintf(f, _("tracks/cylinder: %ld\n"), (long) lp->d_ntracks);
+    fprintf(f, _("sectors/cylinder: %ld\n"), (long) lp->d_secpercyl);
+    fprintf(f, _("cylinders: %ld\n"), (long) lp->d_ncylinders);
+    fprintf(f, _("rpm: %d\n"), lp->d_rpm);
+    fprintf(f, _("interleave: %d\n"), lp->d_interleave);
+    fprintf(f, _("trackskew: %d\n"), lp->d_trackskew);
+    fprintf(f, _("cylinderskew: %d\n"), lp->d_cylskew);
+    fprintf(f, _("headswitch: %ld\t\t# milliseconds\n"),
+	    (long) lp->d_headswitch);
+    fprintf(f, _("track-to-track seek: %ld\t# milliseconds\n"),
+	    (long) lp->d_trkseek);
+    fprintf(f, _("drivedata: "));
+    for (i = NDDATA - 1; i >= 0; i--)
+      if (lp->d_drivedata[i])
+	break;
+    if (i < 0)
+      i = 0;
+    for (j = 0; j <= i; j++)
+      fprintf(f, "%ld ", (long) lp->d_drivedata[j]);
+  }
+  fprintf (f, _("\n%d partitions:\n"), lp->d_npartitions);
+  fprintf (f, _("#       start       end      size     fstype   [fsize bsize   cpg]\n"));
+  pp = lp->d_partitions;
+  for (i = 0; i < lp->d_npartitions; i++, pp++) {
+    if (pp->p_size) {
+      if (display_in_cyl_units && lp->d_secpercyl) {
+	fprintf(f, "  %c: %8ld%c %8ld%c %8ld%c  ",
+		'a' + i,
+		(long) pp->p_offset / lp->d_secpercyl + 1,
+		(pp->p_offset % lp->d_secpercyl) ? '*' : ' ',
+		(long) (pp->p_offset + pp->p_size + lp->d_secpercyl - 1)
+			/ lp->d_secpercyl,
+		((pp->p_offset + pp->p_size) % lp->d_secpercyl) ? '*' : ' ',
+		(long) pp->p_size / lp->d_secpercyl,
+		(pp->p_size % lp->d_secpercyl) ? '*' : ' ');
+      } else {
+	fprintf(f, "  %c: %8ld  %8ld  %8ld   ",
+		'a' + i,
+		(long) pp->p_offset,
+		(long) pp->p_offset + pp->p_size - 1,
+		(long) pp->p_size);
+      }
+      if ((unsigned) pp->p_fstype < BSD_FSMAXTYPES)
+	fprintf(f, "%8.8s", xbsd_fstypes[pp->p_fstype].name);
+      else
+	fprintf(f, "%8x", pp->p_fstype);
+      switch (pp->p_fstype) {
+	case BSD_FS_UNUSED:
+	  fprintf(f, "    %5ld %5ld %5.5s ",
+		  (long) pp->p_fsize, (long) pp->p_fsize * pp->p_frag, "");
+	  break;
+	  
+	case BSD_FS_BSDFFS:
+	  fprintf(f, "    %5ld %5ld %5d ",
+		  (long) pp->p_fsize, (long) pp->p_fsize * pp->p_frag,
+		  pp->p_cpg);
+	  break;
+	  
+	default:
+	  fprintf(f, "%22.22s", "");
+	  break;
+      }
+      fprintf(f, "\n");
+    }
+  }
+}
+
+static void
+xbsd_write_disklabel (void) {
+#if defined (__alpha__)
+	printf (_("Writing disklabel to %s.\n"), disk_device);
+	xbsd_writelabel (NULL, &xbsd_dlabel);
+#else
+	printf (_("Writing disklabel to %s.\n"),
+		partname(disk_device, xbsd_part_index+1, 0));
+	xbsd_writelabel (xbsd_part, &xbsd_dlabel);
+#endif
+	reread_partition_table(0);	/* no exit yet */
+}
+
+static int
+xbsd_create_disklabel (void) {
+	char c;
+
+#if defined (__alpha__)
+	fprintf (stderr, _("%s contains no disklabel.\n"), disk_device);
+#else
+	fprintf (stderr, _("%s contains no disklabel.\n"),
+		 partname(disk_device, xbsd_part_index+1, 0));
+#endif
+
+	while (1) {
+		c = read_char (_("Do you want to create a disklabel? (y/n) "));
+		if (tolower(c) == 'y') {
+			if (xbsd_initlabel (
+#if defined (__alpha__) || defined (__powerpc__) || defined (__hppa__) || \
+    defined (__s390__) || defined (__s390x__)
+				NULL, &xbsd_dlabel, 0
+#else
+				xbsd_part, &xbsd_dlabel, xbsd_part_index
+#endif
+				) == 1) {
+				xbsd_print_disklabel (1);
+				return 1;
+			} else
+				return 0;
+		} else if (c == 'n')
+			return 0;
+	}
+}
+
+static int
+edit_int (int def, char *mesg)
+{
+  do {
+    fputs (mesg, stdout);
+    printf (" (%d): ", def);
+    if (!read_line ())
+      return def;
+  }
+  while (!isdigit (*line_ptr));
+  return atoi (line_ptr);
+} 
+
+static void
+xbsd_edit_disklabel (void)
+{
+  struct xbsd_disklabel *d;
+
+  d = &xbsd_dlabel;
+
+#if defined (__alpha__) || defined (__ia64__)
+  d -> d_secsize    = (u_long) edit_int ((u_long) d -> d_secsize     ,_("bytes/sector"));
+  d -> d_nsectors   = (u_long) edit_int ((u_long) d -> d_nsectors    ,_("sectors/track"));
+  d -> d_ntracks    = (u_long) edit_int ((u_long) d -> d_ntracks     ,_("tracks/cylinder"));
+  d -> d_ncylinders = (u_long) edit_int ((u_long) d -> d_ncylinders  ,_("cylinders"));
+#endif
+
+  /* d -> d_secpercyl can be != d -> d_nsectors * d -> d_ntracks */
+  while (1)
+  {
+    d -> d_secpercyl = (u_long) edit_int ((u_long) d -> d_nsectors * d -> d_ntracks,
+					  _("sectors/cylinder"));
+    if (d -> d_secpercyl <= d -> d_nsectors * d -> d_ntracks)
+      break;
+
+    printf (_("Must be <= sectors/track * tracks/cylinder (default).\n"));
+  }
+  d -> d_rpm        = (u_short) edit_int ((u_short) d -> d_rpm       ,_("rpm"));
+  d -> d_interleave = (u_short) edit_int ((u_short) d -> d_interleave,_("interleave"));
+  d -> d_trackskew  = (u_short) edit_int ((u_short) d -> d_trackskew ,_("trackskew"));
+  d -> d_cylskew    = (u_short) edit_int ((u_short) d -> d_cylskew   ,_("cylinderskew"));
+  d -> d_headswitch = (u_long) edit_int ((u_long) d -> d_headswitch  ,_("headswitch"));
+  d -> d_trkseek    = (u_long) edit_int ((u_long) d -> d_trkseek     ,_("track-to-track seek"));
+
+  d -> d_secperunit = d -> d_secpercyl * d -> d_ncylinders;
+}
+
+static int
+xbsd_get_bootstrap (char *path, void *ptr, int size)
+{
+  int fd;
+
+  if ((fd = open (path, O_RDONLY)) < 0)
+  {
+    perror (path);
+    return 0;
+  }
+  if (read (fd, ptr, size) < 0)
+  {
+    perror (path);
+    close (fd);
+    return 0;
+  }
+  printf (" ... %s\n", path);
+  close (fd);
+  return 1;
+}
+
+static void
+xbsd_write_bootstrap (void)
+{
+  char *bootdir = BSD_LINUX_BOOTDIR;
+  char path[sizeof(BSD_LINUX_BOOTDIR) + 1 + 2 + 4];  /* BSD_LINUX_BOOTDIR + / + {sd,wd} + boot */
+  char *dkbasename;
+  struct xbsd_disklabel dl;
+  char *d, *p, *e;
+  int sector;
+
+  if (xbsd_dlabel.d_type == BSD_DTYPE_SCSI)
+    dkbasename = "sd";
+  else
+    dkbasename = "wd";
+
+  printf (_("Bootstrap: %sboot -> boot%s (%s): "),
+	  dkbasename, dkbasename, dkbasename);
+  if (read_line ()) {
+    line_ptr[strlen (line_ptr)-1] = '\0';
+    dkbasename = line_ptr;
+  }
+  snprintf (path, sizeof(path), "%s/%sboot", bootdir, dkbasename);
+  if (!xbsd_get_bootstrap (path, disklabelbuffer, (int) xbsd_dlabel.d_secsize))
+    return;
+
+  /* We need a backup of the disklabel (xbsd_dlabel might have changed). */
+  d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE];
+  memmove (&dl, d, sizeof (struct xbsd_disklabel));
+
+  /* The disklabel will be overwritten by 0's from bootxx anyway */
+  bzero (d, sizeof (struct xbsd_disklabel));
+
+  snprintf (path, sizeof(path), "%s/boot%s", bootdir, dkbasename);
+  if (!xbsd_get_bootstrap (path, &disklabelbuffer[xbsd_dlabel.d_secsize],
+			  (int) xbsd_dlabel.d_bbsize - xbsd_dlabel.d_secsize))
+    return;
+
+  e = d + sizeof (struct xbsd_disklabel);
+  for (p=d; p < e; p++)
+    if (*p) {
+      fprintf (stderr, _("Bootstrap overlaps with disk label!\n"));
+      exit ( EXIT_FAILURE );
+    }
+
+  memmove (d, &dl, sizeof (struct xbsd_disklabel));
+
+#if defined (__powerpc__) || defined (__hppa__)
+  sector = 0;
+#elif defined (__alpha__)
+  sector = 0;
+  alpha_bootblock_checksum (disklabelbuffer);
+#else
+  sector = get_start_sect(xbsd_part);
+#endif
+
+  if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
+    fatal (unable_to_seek);
+  if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
+    fatal (unable_to_write);
+
+#if defined (__alpha__)
+  printf (_("Bootstrap installed on %s.\n"), disk_device);
+#else
+  printf (_("Bootstrap installed on %s.\n"),
+    partname (disk_device, xbsd_part_index+1, 0));
+#endif
+
+  sync_disks ();
+}
+
+static void
+xbsd_change_fstype (void)
+{
+  int i;
+
+  i = xbsd_get_part_index (xbsd_dlabel.d_npartitions);
+  xbsd_dlabel.d_partitions[i].p_fstype = read_hex (xbsd_fstypes);
+}
+
+static int
+xbsd_get_part_index (int max)
+{
+  char prompt[256];
+  char l;
+
+  snprintf (prompt, sizeof(prompt), _("Partition (a-%c): "), 'a' + max - 1);
+  do
+     l = tolower (read_char (prompt));
+  while (l < 'a' || l > 'a' + max - 1);
+  return l - 'a';
+}
+
+static int
+xbsd_check_new_partition (int *i) {
+
+	/* room for more? various BSD flavours have different maxima */
+	if (xbsd_dlabel.d_npartitions == BSD_MAXPARTITIONS) {
+		int t;
+
+		for (t = 0; t < BSD_MAXPARTITIONS; t++)
+			if (xbsd_dlabel.d_partitions[t].p_size == 0)
+				break;
+
+		if (t == BSD_MAXPARTITIONS) {
+			fprintf (stderr, _("The maximum number of partitions "
+					   "has been created\n"));
+			return 0;
+		}
+	}
+
+	*i = xbsd_get_part_index (BSD_MAXPARTITIONS);
+
+	if (*i >= xbsd_dlabel.d_npartitions)
+		xbsd_dlabel.d_npartitions = (*i) + 1;
+
+	if (xbsd_dlabel.d_partitions[*i].p_size != 0) {
+		fprintf (stderr, _("This partition already exists.\n"));
+		return 0;
+	}
+
+	return 1;
+}
+
+static void
+xbsd_list_types (void) {
+	list_types (xbsd_fstypes);
+}
+
+static u_short
+xbsd_dkcksum (struct xbsd_disklabel *lp) {
+	u_short *start, *end;
+	u_short sum = 0;
+  
+	start = (u_short *) lp;
+	end = (u_short *) &lp->d_partitions[lp->d_npartitions];
+	while (start < end)
+		sum ^= *start++;
+	return sum;
+}
+
+static int
+xbsd_initlabel (struct partition *p, struct xbsd_disklabel *d, int pindex) {
+	struct xbsd_partition *pp;
+	struct geom g;
+
+	get_geometry (fd, &g);
+	bzero (d, sizeof (struct xbsd_disklabel));
+
+	d -> d_magic = BSD_DISKMAGIC;
+
+	if (strncmp (disk_device, "/dev/sd", 7) == 0)
+		d -> d_type = BSD_DTYPE_SCSI;
+	else
+		d -> d_type = BSD_DTYPE_ST506;
+
+#if 0 /* not used (at least not written to disk) by NetBSD/i386 1.0 */
+	d -> d_subtype = BSD_DSTYPE_INDOSPART & pindex;
+#endif
+
+#if !defined (__alpha__)
+	d -> d_flags = BSD_D_DOSPART;
+#else
+	d -> d_flags = 0;
+#endif
+	d -> d_secsize = SECTOR_SIZE;		/* bytes/sector  */
+	d -> d_nsectors = g.sectors;		/* sectors/track */
+	d -> d_ntracks = g.heads;		/* tracks/cylinder (heads) */
+	d -> d_ncylinders = g.cylinders;
+	d -> d_secpercyl  = g.sectors * g.heads;/* sectors/cylinder */
+	if (d -> d_secpercyl == 0)
+		d -> d_secpercyl = 1;		/* avoid segfaults */
+	d -> d_secperunit = d -> d_secpercyl * d -> d_ncylinders;
+
+	d -> d_rpm = 3600;
+	d -> d_interleave = 1;
+	d -> d_trackskew = 0;
+	d -> d_cylskew = 0;
+	d -> d_headswitch = 0;
+	d -> d_trkseek = 0;
+
+	d -> d_magic2 = BSD_DISKMAGIC;
+	d -> d_bbsize = BSD_BBSIZE;
+	d -> d_sbsize = BSD_SBSIZE;
+
+#if !defined (__alpha__)
+	d -> d_npartitions = 4;
+	pp = &d -> d_partitions[2];		/* Partition C should be
+						   the NetBSD partition */
+	pp -> p_offset = get_start_sect(p);
+	pp -> p_size   = get_nr_sects(p);
+	pp -> p_fstype = BSD_FS_UNUSED;
+	pp = &d -> d_partitions[3];		/* Partition D should be
+						   the whole disk */
+	pp -> p_offset = 0;
+	pp -> p_size   = d -> d_secperunit;
+	pp -> p_fstype = BSD_FS_UNUSED;
+#elif defined (__alpha__)
+	d -> d_npartitions = 3;
+	pp = &d -> d_partitions[2];		/* Partition C should be
+						   the whole disk */
+	pp -> p_offset = 0;
+	pp -> p_size   = d -> d_secperunit;
+	pp -> p_fstype = BSD_FS_UNUSED;  
+#endif
+
+	return 1;
+}
+
+/*
+ * Read a xbsd_disklabel from sector 0 or from the starting sector of p.
+ * If it has the right magic, return 1.
+ */
+static int
+xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d)
+{
+	int t, sector;
+
+	/* p is used only to get the starting sector */
+#if !defined (__alpha__)
+	sector = (p ? get_start_sect(p) : 0);
+#elif defined (__alpha__)
+	sector = 0;
+#endif
+
+	if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
+		fatal (unable_to_seek);
+	if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
+		fatal (unable_to_read);
+
+	memmove (d,
+	         &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
+	         sizeof (struct xbsd_disklabel));
+
+	if (d -> d_magic != BSD_DISKMAGIC || d -> d_magic2 != BSD_DISKMAGIC)
+		return 0;
+
+	for (t = d -> d_npartitions; t < BSD_MAXPARTITIONS; t++) {
+		d -> d_partitions[t].p_size   = 0;
+		d -> d_partitions[t].p_offset = 0;
+		d -> d_partitions[t].p_fstype = BSD_FS_UNUSED;  
+	}
+
+	if (d -> d_npartitions > BSD_MAXPARTITIONS)
+		fprintf (stderr, _("Warning: too many partitions "
+				   "(%d, maximum is %d).\n"),
+			 d -> d_npartitions, BSD_MAXPARTITIONS);
+	return 1;
+}
+
+static int
+xbsd_writelabel (struct partition *p, struct xbsd_disklabel *d)
+{
+  unsigned int sector;
+
+#if !defined (__alpha__) && !defined (__powerpc__) && !defined (__hppa__)
+  sector = get_start_sect(p) + BSD_LABELSECTOR;
+#else
+  sector = BSD_LABELSECTOR;
+#endif
+
+  d -> d_checksum = 0;
+  d -> d_checksum = xbsd_dkcksum (d);
+
+  /* This is necessary if we want to write the bootstrap later,
+     otherwise we'd write the old disklabel with the bootstrap.
+  */
+  memmove (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], d,
+           sizeof (struct xbsd_disklabel));
+
+#if defined (__alpha__) && BSD_LABELSECTOR == 0
+  alpha_bootblock_checksum (disklabelbuffer);
+  if (lseek (fd, (off_t) 0, SEEK_SET) == -1)
+    fatal (unable_to_seek);
+  if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
+    fatal (unable_to_write);
+#else
+  if (lseek (fd, (off_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
+		   SEEK_SET) == -1)
+    fatal (unable_to_seek);
+  if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
+    fatal (unable_to_write);
+#endif
+
+  sync_disks ();
+
+  return 1;
+}
+
+static void
+sync_disks (void)
+{
+  printf (_("\nSyncing disks.\n"));
+  sync ();
+  sleep (4);
+}
+
+#if !defined (__alpha__)
+static int
+xbsd_translate_fstype (int linux_type)
+{
+  switch (linux_type)
+  {
+    case 0x01: /* DOS 12-bit FAT   */
+    case 0x04: /* DOS 16-bit <32M  */
+    case 0x06: /* DOS 16-bit >=32M */
+    case 0xe1: /* DOS access       */
+    case 0xe3: /* DOS R/O          */
+    case 0xf2: /* DOS secondary    */
+      return BSD_FS_MSDOS;
+    case 0x07: /* OS/2 HPFS        */
+      return BSD_FS_HPFS;
+    default:
+      return BSD_FS_OTHER;
+  }
+}
+
+static void
+xbsd_link_part (void)
+{
+  int k, i;
+  struct partition *p;
+
+  k = get_partition (1, partitions);
+
+  if (!xbsd_check_new_partition (&i))
+    return;
+
+  p = get_part_table(k);
+
+  xbsd_dlabel.d_partitions[i].p_size   = get_nr_sects(p);
+  xbsd_dlabel.d_partitions[i].p_offset = get_start_sect(p);
+  xbsd_dlabel.d_partitions[i].p_fstype = xbsd_translate_fstype(p->sys_ind);
+}
+#endif
+
+#if defined (__alpha__)
+
+#if !defined(__GLIBC__)
+typedef unsigned long long u_int64_t;
+#endif
+
+void
+alpha_bootblock_checksum (char *boot)
+{
+  u_int64_t *dp, sum;
+  int i;
+  
+  dp = (u_int64_t *)boot;
+  sum = 0;
+  for (i = 0; i < 63; i++)
+    sum += dp[i];
+  dp[63] = sum;
+}
+#endif /* __alpha__ */
diff --git a/util-linux-ng-2.17.2/fdisk/fdiskbsdlabel.h b/util-linux-ng-2.17.2/fdisk/fdiskbsdlabel.h
new file mode 100644
index 0000000..9f9e091
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdiskbsdlabel.h
@@ -0,0 +1,241 @@
+#ifndef FDISK_BSD_LABEL_H
+#define FDISK_BSD_LABEL_H
+
+/*
+ * Copyright (c) 1987, 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#ifndef BSD_DISKMAGIC
+#define BSD_DISKMAGIC     ((uint32_t) 0x82564557)
+#endif
+
+#ifndef BSD_MAXPARTITIONS
+#define	BSD_MAXPARTITIONS 16
+#endif
+
+#define BSD_LINUX_BOOTDIR "/usr/ucb/mdec"
+
+#if defined (i386) || defined (__sparc__) || defined (__arm__) || \
+    defined (__mips__) || defined (__s390__) || defined (__sh__) || \
+    defined(__x86_64__) || defined (__avr32__) || defined(__cris__)
+#define BSD_LABELSECTOR   1
+#define BSD_LABELOFFSET   0
+#elif defined (__alpha__) || defined (__powerpc__) || defined (__ia64__) || defined (__hppa__)
+#define BSD_LABELSECTOR   0
+#define BSD_LABELOFFSET   64
+#elif defined (__s390__) || defined (__s390x__)
+#define BSD_LABELSECTOR   1
+#define BSD_LABELOFFSET   0
+#else
+#error unknown architecture
+#endif
+
+#define	BSD_BBSIZE        8192		/* size of boot area, with label */
+#define	BSD_SBSIZE        8192		/* max size of fs superblock */
+
+struct xbsd_disklabel {
+	uint32_t	d_magic;		/* the magic number */
+	int16_t	d_type;			/* drive type */
+	int16_t	d_subtype;		/* controller/d_type specific */
+	char	d_typename[16];		/* type name, e.g. "eagle" */
+	char	d_packname[16];			/* pack identifier */ 
+			/* disk geometry: */
+	uint32_t	d_secsize;		/* # of bytes per sector */
+	uint32_t	d_nsectors;		/* # of data sectors per track */
+	uint32_t	d_ntracks;		/* # of tracks per cylinder */
+	uint32_t	d_ncylinders;		/* # of data cylinders per unit */
+	uint32_t	d_secpercyl;		/* # of data sectors per cylinder */
+	uint32_t	d_secperunit;		/* # of data sectors per unit */
+	/*
+	 * Spares (bad sector replacements) below
+	 * are not counted in d_nsectors or d_secpercyl.
+	 * Spare sectors are assumed to be physical sectors
+	 * which occupy space at the end of each track and/or cylinder.
+	 */
+	uint16_t	d_sparespertrack;	/* # of spare sectors per track */
+	uint16_t	d_sparespercyl;		/* # of spare sectors per cylinder */
+	/*
+	 * Alternate cylinders include maintenance, replacement,
+	 * configuration description areas, etc.
+	 */
+	uint32_t	d_acylinders;		/* # of alt. cylinders per unit */
+
+			/* hardware characteristics: */
+	/*
+	 * d_interleave, d_trackskew and d_cylskew describe perturbations
+	 * in the media format used to compensate for a slow controller.
+	 * Interleave is physical sector interleave, set up by the formatter
+	 * or controller when formatting.  When interleaving is in use,
+	 * logically adjacent sectors are not physically contiguous,
+	 * but instead are separated by some number of sectors.
+	 * It is specified as the ratio of physical sectors traversed
+	 * per logical sector.  Thus an interleave of 1:1 implies contiguous
+	 * layout, while 2:1 implies that logical sector 0 is separated
+	 * by one sector from logical sector 1.
+	 * d_trackskew is the offset of sector 0 on track N
+	 * relative to sector 0 on track N-1 on the same cylinder.
+	 * Finally, d_cylskew is the offset of sector 0 on cylinder N
+	 * relative to sector 0 on cylinder N-1.
+	 */
+	uint16_t	d_rpm;			/* rotational speed */
+	uint16_t	d_interleave;		/* hardware sector interleave */
+	uint16_t	d_trackskew;		/* sector 0 skew, per track */
+	uint16_t	d_cylskew;		/* sector 0 skew, per cylinder */
+	uint32_t	d_headswitch;		/* head switch time, usec */
+	uint32_t	d_trkseek;		/* track-to-track seek, usec */
+	uint32_t	d_flags;		/* generic flags */
+#define NDDATA 5
+	uint32_t	d_drivedata[NDDATA];	/* drive-type specific information */
+#define NSPARE 5
+	uint32_t	d_spare[NSPARE];	/* reserved for future use */
+	uint32_t	d_magic2;		/* the magic number (again) */
+	uint16_t	d_checksum;		/* xor of data incl. partitions */
+			/* filesystem and partition information: */
+	uint16_t	d_npartitions;	        /* number of partitions in following */
+	uint32_t	d_bbsize;	        /* size of boot area at sn0, bytes */
+	uint32_t	d_sbsize;	        /* max size of fs superblock, bytes */
+	struct xbsd_partition	 {	/* the partition table */
+		uint32_t	p_size;	        /* number of sectors in partition */
+		uint32_t	p_offset;       /* starting sector */
+		uint32_t	p_fsize;        /* filesystem basic fragment size */
+		uint8_t	p_fstype;       /* filesystem type, see below */
+		uint8_t	p_frag;	        /* filesystem fragments per block */
+		uint16_t	p_cpg;	        /* filesystem cylinders per group */
+	} d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */
+};
+
+/* d_type values: */
+#define	BSD_DTYPE_SMD		1		/* SMD, XSMD; VAX hp/up */
+#define	BSD_DTYPE_MSCP		2		/* MSCP */
+#define	BSD_DTYPE_DEC		3		/* other DEC (rk, rl) */
+#define	BSD_DTYPE_SCSI		4		/* SCSI */
+#define	BSD_DTYPE_ESDI		5		/* ESDI interface */
+#define	BSD_DTYPE_ST506		6		/* ST506 etc. */
+#define	BSD_DTYPE_HPIB		7		/* CS/80 on HP-IB */
+#define BSD_DTYPE_HPFL		8		/* HP Fiber-link */
+#define	BSD_DTYPE_FLOPPY	10		/* floppy */
+
+/* d_subtype values: */
+#define BSD_DSTYPE_INDOSPART	0x8		/* is inside dos partition */
+#define BSD_DSTYPE_DOSPART(s)	((s) & 3)	/* dos partition number */
+#define BSD_DSTYPE_GEOMETRY	0x10		/* drive params in label */
+
+#ifdef DKTYPENAMES
+static char *xbsd_dktypenames[] = {
+	"unknown",
+	"SMD",
+	"MSCP",
+	"old DEC",
+	"SCSI",
+	"ESDI",
+	"ST506",
+	"HP-IB",
+	"HP-FL",
+	"type 9",
+	"floppy",
+	0
+};
+#define BSD_DKMAXTYPES	(sizeof(xbsd_dktypenames) / sizeof(xbsd_dktypenames[0]) - 1)
+#endif
+
+/*
+ * Filesystem type and version.
+ * Used to interpret other filesystem-specific
+ * per-partition information.
+ */
+#define	BSD_FS_UNUSED	0		/* unused */
+#define	BSD_FS_SWAP    	1		/* swap */
+#define	BSD_FS_V6      	2		/* Sixth Edition */
+#define	BSD_FS_V7      	3		/* Seventh Edition */
+#define	BSD_FS_SYSV    	4		/* System V */
+#define	BSD_FS_V71K    	5		/* V7 with 1K blocks (4.1, 2.9) */
+#define	BSD_FS_V8      	6		/* Eighth Edition, 4K blocks */
+#define	BSD_FS_BSDFFS	7		/* 4.2BSD fast file system */
+#define	BSD_FS_BSDLFS	9		/* 4.4BSD log-structured file system */
+#define	BSD_FS_OTHER	10		/* in use, but unknown/unsupported */
+#define	BSD_FS_HPFS	11		/* OS/2 high-performance file system */
+#define	BSD_FS_ISO9660	12		/* ISO-9660 filesystem (cdrom) */
+#define BSD_FS_ISOFS	BSD_FS_ISO9660
+#define	BSD_FS_BOOT	13		/* partition contains bootstrap */
+#define BSD_FS_ADOS	14		/* AmigaDOS fast file system */
+#define BSD_FS_HFS	15		/* Macintosh HFS */
+#define BSD_FS_ADVFS	16		/* Digital Unix AdvFS */
+
+/* this is annoying, but it's also the way it is :-( */
+#ifdef __alpha__
+#define	BSD_FS_EXT2	8		/* ext2 file system */
+#else
+#define	BSD_FS_MSDOS	8		/* MS-DOS file system */
+#endif
+
+#ifdef	DKTYPENAMES
+static struct systypes xbsd_fstypes[] = {
+        {BSD_FS_UNUSED, "unused"},
+	{BSD_FS_SWAP,   "swap"},
+	{BSD_FS_V6,     "Version 6"},
+	{BSD_FS_V7,     "Version 7"},
+	{BSD_FS_SYSV,   "System V"},
+	{BSD_FS_V71K,   "4.1BSD"},
+	{BSD_FS_V8,     "Eighth Edition"},
+	{BSD_FS_BSDFFS, "4.2BSD"},
+#ifdef __alpha__
+	{BSD_FS_EXT2,   "ext2"},
+#else
+	{BSD_FS_MSDOS,  "MS-DOS"},
+#endif
+	{BSD_FS_BSDLFS, "4.4LFS"},
+	{BSD_FS_OTHER,  "unknown"},
+	{BSD_FS_HPFS,   "HPFS"},
+	{BSD_FS_ISO9660,"ISO-9660"},
+	{BSD_FS_BOOT,   "boot"},
+	{BSD_FS_ADOS,   "ADOS"},
+	{BSD_FS_HFS,    "HFS"},
+	{BSD_FS_ADVFS,	"AdvFS"},
+	{ 0, NULL }
+};
+#define BSD_FSMAXTYPES (ARRAY_SIZE(xbsd_fstypes)-1)
+
+#endif
+
+/*
+ * flags shared by various drives:
+ */
+#define	BSD_D_REMOVABLE	0x01		/* removable media */
+#define	BSD_D_ECC      	0x02		/* supports ECC */
+#define	BSD_D_BADSECT	0x04		/* supports bad sector forw. */
+#define	BSD_D_RAMDISK	0x08		/* disk emulator */
+#define	BSD_D_CHAIN    	0x10		/* can do back-back transfers */
+#define	BSD_D_DOSPART	0x20		/* within MSDOS partition */
+
+#endif /* FDISK_BSD_LABEL_H */
diff --git a/util-linux-ng-2.17.2/fdisk/fdiskmaclabel.c b/util-linux-ng-2.17.2/fdisk/fdiskmaclabel.c
new file mode 100644
index 0000000..4e3db20
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdiskmaclabel.c
@@ -0,0 +1,86 @@
+/*
+  Changes:
+  Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+	Internationalization
+*/
+#include <stdio.h>              /* stderr */
+#include <string.h>             /* strstr */
+#include <unistd.h>             /* write */
+
+#include <endian.h>
+
+#include "common.h"
+#include "fdisk.h"
+#include "fdiskmaclabel.h"
+#include "nls.h"
+
+#define MAC_BITMASK 0xffff0000
+
+
+static	int     other_endian = 0;
+static  short	volumes=1;
+
+/*
+ * only dealing with free blocks here
+ */
+
+static void
+mac_info( void ) {
+    puts(
+	_("\n\tThere is a valid Mac label on this disk.\n"
+	"\tUnfortunately fdisk(1) cannot handle these disks.\n"
+	"\tUse either pdisk or parted to modify the partition table.\n"
+	"\tNevertheless some advice:\n"
+	"\t1. fdisk will destroy its contents on write.\n"
+	"\t2. Be sure that this disk is NOT a still vital\n"
+	"\t   part of a volume group. (Otherwise you may\n"
+	"\t   erase the other disks as well, if unmirrored.)\n")
+    );
+}
+
+void
+mac_nolabel( void )
+{
+    maclabel->magic = 0;
+    mac_label = 0;
+    partitions = 4;
+    zeroize_mbr_buffer();
+    return;
+}
+
+int
+check_mac_label( void )
+{
+	/*
+	Conversion: only 16 bit should compared
+	e.g.: HFS Label is only 16bit long
+	*/
+	int magic_masked = 0 ;
+	magic_masked =  maclabel->magic & MAC_BITMASK ;
+
+	switch (magic_masked) {
+		case MAC_LABEL_MAGIC :
+		case MAC_LABEL_MAGIC_2:
+		case MAC_LABEL_MAGIC_3:
+			goto IS_MAC;
+			break;
+		default:
+			mac_label = 0;
+			other_endian = 0;
+			return 0;
+
+
+	}
+
+IS_MAC:
+    other_endian = (maclabel->magic == MAC_LABEL_MAGIC_SWAPPED); // =?
+    update_units();
+    mac_label = 1;
+    partitions= 1016; // =?
+    volumes = 15;	// =?
+    mac_info();
+    mac_nolabel();		/* %% */
+    mac_label = 1;		/* %% */
+    return 1;
+}
+
diff --git a/util-linux-ng-2.17.2/fdisk/fdiskmaclabel.h b/util-linux-ng-2.17.2/fdisk/fdiskmaclabel.h
new file mode 100644
index 0000000..e664a15
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdiskmaclabel.h
@@ -0,0 +1,39 @@
+#ifndef FDISK_MAC_LABEL_H
+#define FDISK_MAC_LABEL_H
+
+#include <sys/types.h>
+/*
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ *	This file may be redistributed under
+ *	the terms of the GNU Public License.
+ */
+
+typedef struct {
+	unsigned int  magic;        /* expect MAC_LABEL_MAGIC */
+	unsigned int  fillbytes1[124];
+	unsigned int  physical_volume_id;
+	unsigned int  fillbytes2[124];
+} mac_partition;
+
+/* MAC magic number only 16bits, do I always know that there are 0200
+ * following? Problem, after magic the uint16_t res1; follows, I donnno know
+ * about the 200k */
+#define	MAC_LABEL_MAGIC		0x45520000
+#define	MAC_LABEL_MAGIC_2	0x50530000
+#define	MAC_LABEL_MAGIC_3	0x504d0000
+
+#define	MAC_LABEL_MAGIC_SWAPPED		0x00002554
+
+#define	MAC_LABEL_MAGIC_2_SWAPPED	0x00003505
+#define	MAC_LABEL_MAGIC_3_SWAPPED	0x0000d405
+
+/* fdisk.c */
+#define maclabel ((mac_partition *)MBRbuffer)
+
+/* fdiskmaclabel.c */
+extern struct	systypes mac_sys_types[];
+extern void	mac_nolabel( void );
+extern int	check_mac_label( void );
+
+#endif /* FDISK_MAC_LABEL_H */
+
diff --git a/util-linux-ng-2.17.2/fdisk/fdisksgilabel.c b/util-linux-ng-2.17.2/fdisk/fdisksgilabel.c
new file mode 100644
index 0000000..3707a4c
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisksgilabel.c
@@ -0,0 +1,836 @@
+/*
+ *
+ * fdisksgilabel.c
+ *
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ *	This file may be modified and redistributed under
+ *	the terms of the GNU Public License.
+ *
+ * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *	Internationalization
+ *
+ * 2003-03-20 Phillip Kesling <pkesling@sgi.com>
+ *      Some fixes
+ */
+#include <stdio.h>              /* stderr */
+#include <stdlib.h>		/* exit */
+#include <string.h>             /* strstr */
+#include <unistd.h>             /* write */
+#include <sys/ioctl.h>          /* ioctl */
+#include <sys/stat.h>           /* stat */
+#include <assert.h>             /* assert */
+
+#include <endian.h>
+#include "nls.h"
+
+#include "blkdev.h"
+
+#include "common.h"
+#include "fdisk.h"
+#include "fdisksgilabel.h"
+
+static	int     other_endian = 0;
+static	int     debug = 0;
+static  short volumes=1;
+
+/*
+ * only dealing with free blocks here
+ */
+
+typedef struct { unsigned int first; unsigned int last; } freeblocks;
+static freeblocks freelist[17]; /* 16 partitions can produce 17 vacant slots */
+
+static void
+setfreelist(int i, unsigned int f, unsigned int l) {
+	freelist[i].first = f;
+	freelist[i].last = l;
+}
+
+static void
+add2freelist(unsigned int f, unsigned int l) {
+	int i = 0;
+	for ( ; i < 17 ; i++)
+		if (freelist[i].last == 0)
+			break;
+	setfreelist(i, f, l);
+}
+
+static void
+clearfreelist(void) {
+	int i;
+
+	for (i = 0; i < 17 ; i++)
+		setfreelist(i, 0, 0);
+}
+
+static unsigned int
+isinfreelist(unsigned int b) {
+	int i;
+
+	for (i = 0; i < 17 ; i++)
+		if (freelist[i].first <= b && freelist[i].last >= b)
+			return freelist[i].last;
+	return 0;
+}
+	/* return last vacant block of this stride (never 0). */
+	/* the '>=' is not quite correct, but simplifies the code */
+/*
+ * end of free blocks section
+ */
+struct systypes sgi_sys_types[] = {
+	{SGI_VOLHDR,	N_("SGI volhdr")},
+	{0x01,		N_("SGI trkrepl")},
+	{0x02,		N_("SGI secrepl")},
+	{SGI_SWAP,	N_("SGI raw")},
+	{0x04,		N_("SGI bsd")},
+	{0x05,		N_("SGI sysv")},
+	{ENTIRE_DISK,	N_("SGI volume")},
+	{SGI_EFS,	N_("SGI efs")},
+	{0x08,		N_("SGI lvol")},
+	{0x09,		N_("SGI rlvol")},
+	{SGI_XFS,	N_("SGI xfs")},
+	{SGI_XFSLOG,	N_("SGI xfslog")},
+	{SGI_XLV,	N_("SGI xlv")},
+	{SGI_XVM,	N_("SGI xvm")},
+	{LINUX_SWAP,	N_("Linux swap")},
+	{LINUX_NATIVE,	N_("Linux native")},
+	{LINUX_LVM,	N_("Linux LVM")},
+	{LINUX_RAID,	N_("Linux RAID")},
+	{0, NULL }
+};
+
+static int
+sgi_get_nsect(void) {
+	return SSWAP16(sgilabel->devparam.nsect);
+}
+
+static int
+sgi_get_ntrks(void) {
+	return SSWAP16(sgilabel->devparam.ntrks);
+}
+
+#if 0
+static int
+sgi_get_head_vol0(void) {
+	return SSWAP16(sgilabel->devparam.head_vol0);
+}
+
+static int
+sgi_get_bytes(void) {
+	return SSWAP16(sgilabel->devparam.bytes);
+}
+
+static int
+sgi_get_pcylcount(void) {
+	return SSWAP16(sgilabel->devparam.pcylcount);
+}
+#endif
+
+void
+sgi_nolabel() {
+	sgilabel->magic = 0;
+	sgi_label = 0;
+	partitions = 4;
+}
+
+static unsigned int
+two_s_complement_32bit_sum(unsigned int *base, int size /* in bytes */) {
+	int i = 0;
+	unsigned int sum = 0;
+
+	size /= sizeof(unsigned int);
+	for (i = 0; i < size; i++)
+		sum -= SSWAP32(base[i]);
+	return sum;
+}
+
+int
+check_sgi_label() {
+	if (sizeof(sgilabel) > 512) {
+		fprintf(stderr,
+			_("According to MIPS Computer Systems, Inc the "
+			  "Label must not contain more than 512 bytes\n"));
+		exit(1);
+	}
+
+	if (sgilabel->magic != SGI_LABEL_MAGIC &&
+	    sgilabel->magic != SGI_LABEL_MAGIC_SWAPPED) {
+		sgi_label = 0;
+		other_endian = 0;
+		return 0;
+	}
+
+	other_endian = (sgilabel->magic == SGI_LABEL_MAGIC_SWAPPED);
+	/*
+	 * test for correct checksum
+	 */
+	if (two_s_complement_32bit_sum((unsigned int*)sgilabel,
+				       sizeof(*sgilabel))) {
+		fprintf(stderr,
+			_("Detected sgi disklabel with wrong checksum.\n"));
+	}
+	update_units();
+	sgi_label = 1;
+	partitions= 16;
+	volumes = 15;
+	return 1;
+}
+
+void
+sgi_list_table(int xtra) {
+	int i, w;
+	int kpi = 0;		/* kernel partition ID */
+	char *type;
+
+	w = strlen(disk_device);
+
+	if (xtra) {
+		printf(_("\nDisk %s (SGI disk label): %d heads, %llu sectors\n"
+			 "%d cylinders, %d physical cylinders\n"
+			 "%d extra sects/cyl, interleave %d:1\n"
+			 "%s\n"
+			 "Units = %s of %d * %d bytes\n\n"),
+		       disk_device, heads, sectors, cylinders,
+		       SSWAP16(sgiparam.pcylcount),
+		       SSWAP16(sgiparam.sparecyl),
+		       SSWAP16(sgiparam.ilfact),
+		       (char *)sgilabel,
+		       str_units(PLURAL), units_per_sector,
+                       sector_size);
+	} else {
+		printf(_("\nDisk %s (SGI disk label): "
+			 "%d heads, %llu sectors, %d cylinders\n"
+			 "Units = %s of %d * %d bytes\n\n"),
+		       disk_device, heads, sectors, cylinders,
+		       str_units(PLURAL), units_per_sector,
+                       sector_size);
+	}
+	printf(_("----- partitions -----\n"
+		 "Pt# %*s  Info     Start       End   Sectors  Id  System\n"),
+	       w + 1, _("Device"));
+	for (i = 0 ; i < partitions; i++) {
+		if (sgi_get_num_sectors(i) || debug) {
+			uint32_t start = sgi_get_start_sector(i);
+			uint32_t len = sgi_get_num_sectors(i);
+			kpi++;		/* only count nonempty partitions */
+			printf(
+				"%2d: %s %4s %9ld %9ld %9ld  %2x  %s\n",
+/* fdisk part number */   i+1,
+/* device */              partname(disk_device, kpi, w+2),
+/* flags */               (sgi_get_swappartition() == i) ? "swap" :
+/* flags */               (sgi_get_bootpartition() == i) ? "boot" : "    ", 
+/* start */               (long) scround(start),
+/* end */                 (long) scround(start+len)-1,
+/* no odd flag on end */  (long) len, 
+/* type id */             sgi_get_sysid(i),
+/* type name */           (type = partition_type(sgi_get_sysid(i)))
+				? type : _("Unknown"));
+		}
+	}
+	printf(_("----- Bootinfo -----\nBootfile: %s\n"
+		 "----- Directory Entries -----\n"),
+	       sgilabel->boot_file);
+	for (i = 0 ; i < volumes; i++) {
+		if (sgilabel->directory[i].vol_file_size) {
+			uint32_t start = SSWAP32(sgilabel->directory[i].vol_file_start);
+			uint32_t len = SSWAP32(sgilabel->directory[i].vol_file_size);
+			unsigned char *name = sgilabel->directory[i].vol_file_name;
+			printf(_("%2d: %-10s sector%5u size%8u\n"),
+			       i, name, (unsigned int) start,
+			       (unsigned int) len);
+		}
+	}
+}
+
+unsigned int
+sgi_get_start_sector(int i) {
+	return SSWAP32(sgilabel->partitions[i].start_sector);
+}
+
+unsigned int
+sgi_get_num_sectors(int i) {
+	return SSWAP32(sgilabel->partitions[i].num_sectors);
+}
+
+int
+sgi_get_sysid(int i)
+{
+	return SSWAP32(sgilabel->partitions[i].id);
+}
+
+int
+sgi_get_bootpartition(void)
+{
+	return SSWAP16(sgilabel->boot_part);
+}
+
+int
+sgi_get_swappartition(void)
+{
+	return SSWAP16(sgilabel->swap_part);
+}
+
+void
+sgi_set_bootpartition(int i)
+{
+	sgilabel->boot_part = SSWAP16(((short)i));
+}
+
+static unsigned int
+sgi_get_lastblock(void) {
+	return heads * sectors * cylinders;
+}
+
+void
+sgi_set_swappartition(int i) {
+	sgilabel->swap_part = SSWAP16(((short)i));
+}
+
+static int
+sgi_check_bootfile(const char* aFile) {
+	if (strlen(aFile) < 3) /* "/a\n" is minimum */ {
+		printf(_("\nInvalid Bootfile!\n"
+			 "\tThe bootfile must be an absolute non-zero pathname,\n"
+			 "\te.g. \"/unix\" or \"/unix.save\".\n"));
+		return 0;
+	} else {
+		if (strlen(aFile) > 16) {
+			printf(_("\n\tName of Bootfile too long:  "
+				 "16 bytes maximum.\n"));
+			return 0;
+		} else {
+			if (aFile[0] != '/') {
+				printf(_("\n\tBootfile must have a "
+					 "fully qualified pathname.\n"));
+				return 0;
+			}
+		}
+	}
+	if (strncmp(aFile, (char *) sgilabel->boot_file, 16)) {
+		printf(_("\n\tBe aware, that the bootfile is not checked for existence.\n\t"
+			 "SGI's default is \"/unix\" and for backup \"/unix.save\".\n"));
+		/* filename is correct and did change */
+		return 1;
+	}
+	return 0;	/* filename did not change */
+}
+
+const char *
+sgi_get_bootfile(void) {
+	return (char *) sgilabel->boot_file;
+}
+
+void
+sgi_set_bootfile(const char* aFile) {
+	int i = 0;
+
+	if (sgi_check_bootfile(aFile)) {
+		while (i < 16) {
+			if ((aFile[i] != '\n')	/* in principle caught again by next line */
+			    &&  (strlen(aFile) > i))
+				sgilabel->boot_file[i] = aFile[i];
+			else
+				sgilabel->boot_file[i] = 0;
+			i++;
+		}
+		printf(_("\n\tBootfile is changed to \"%s\".\n"),
+		       sgilabel->boot_file);
+	}
+}
+
+void
+create_sgiinfo(void) {
+	/* I keep SGI's habit to write the sgilabel to the second block */
+	sgilabel->directory[0].vol_file_start = SSWAP32(2);
+	sgilabel->directory[0].vol_file_size = SSWAP32(sizeof(sgiinfo));
+	strncpy((char *) sgilabel->directory[0].vol_file_name, "sgilabel", 8);
+}
+
+sgiinfo *fill_sgiinfo(void);
+
+void
+sgi_write_table(void) {
+	sgilabel->csum = 0;
+	sgilabel->csum = SSWAP32(two_s_complement_32bit_sum(
+		(unsigned int*)sgilabel, 
+		sizeof(*sgilabel)));
+	assert(two_s_complement_32bit_sum(
+		(unsigned int*)sgilabel, sizeof(*sgilabel)) == 0);
+	if (lseek(fd, 0, SEEK_SET) < 0)
+		fatal(unable_to_seek);
+	if (write(fd, sgilabel, SECTOR_SIZE) != SECTOR_SIZE)
+		fatal(unable_to_write);
+	if (! strncmp((char *) sgilabel->directory[0].vol_file_name, "sgilabel", 8)) {
+		/*
+		 * keep this habit of first writing the "sgilabel".
+		 * I never tested whether it works without (AN 981002).
+		 */
+		sgiinfo *info = fill_sgiinfo();
+		int infostartblock = SSWAP32(sgilabel->directory[0].vol_file_start);
+		if (lseek(fd, (off_t) infostartblock*
+				SECTOR_SIZE, SEEK_SET) < 0)
+			fatal(unable_to_seek);
+		if (write(fd, info, SECTOR_SIZE) != SECTOR_SIZE)
+			fatal(unable_to_write);
+		free(info);
+	}
+}
+
+static int
+compare_start(int *x, int *y) {
+	/*
+	 * sort according to start sectors
+	 * and prefers largest partition:
+	 * entry zero is entire disk entry
+	 */
+	unsigned int i = *x;
+	unsigned int j = *y;
+	unsigned int a = sgi_get_start_sector(i);
+	unsigned int b = sgi_get_start_sector(j);
+	unsigned int c = sgi_get_num_sectors(i);
+	unsigned int d = sgi_get_num_sectors(j);
+
+	if (a == b)
+		return (d > c) ? 1 : (d == c) ? 0 : -1;
+	return (a > b) ? 1 : -1;
+}
+
+static int
+sgi_gaps(void) {
+	/*
+	 * returned value is:
+	 *  = 0 : disk is properly filled to the rim
+	 *  < 0 : there is an overlap
+	 *  > 0 : there is still some vacant space
+	 */
+	return verify_sgi(0);
+}
+
+int
+verify_sgi(int verbose)
+{
+	int Index[16];		/* list of valid partitions */
+	int sortcount = 0;	/* number of used partitions, i.e. non-zero lengths */
+	int entire = 0, i = 0;
+	unsigned int start = 0;
+	long long gap = 0;	/* count unused blocks */
+	unsigned int lastblock = sgi_get_lastblock();
+
+	clearfreelist();
+	for (i=0; i<16; i++) {
+		if (sgi_get_num_sectors(i) != 0) {
+			Index[sortcount++]=i;
+			if (sgi_get_sysid(i) == ENTIRE_DISK) {
+				if (entire++ == 1) {
+					if (verbose)
+						printf(_("More than one entire disk entry present.\n"));
+				}
+			}
+		}
+	}
+	if (sortcount == 0) {
+		if (verbose)
+			printf(_("No partitions defined\n"));
+		return (lastblock > 0) ? 1 : (lastblock == 0) ? 0 : -1;
+	}
+	qsort(Index, sortcount, sizeof(Index[0]), (void*)compare_start);
+	if (sgi_get_sysid(Index[0]) == ENTIRE_DISK) {
+		if ((Index[0] != 10) && verbose)
+			printf(_("IRIX likes when Partition 11 covers the entire disk.\n"));
+		if ((sgi_get_start_sector(Index[0]) != 0) && verbose)
+			printf(_("The entire disk partition should start "
+				 "at block 0,\n"
+				 "not at diskblock %d.\n"),
+			       sgi_get_start_sector(Index[0]));
+		if (debug)	/* I do not understand how some disks fulfil it */
+			if ((sgi_get_num_sectors(Index[0]) != lastblock) && verbose)
+				printf(_("The entire disk partition is only %d diskblock large,\n"
+					 "but the disk is %d diskblocks long.\n"),
+				       sgi_get_num_sectors(Index[0]), lastblock);
+		lastblock = sgi_get_num_sectors(Index[0]);
+	} else {
+		if (verbose)
+			printf(_("One Partition (#11) should cover the entire disk.\n"));
+		if (debug>2)
+			printf("sysid=%d\tpartition=%d\n",
+			       sgi_get_sysid(Index[0]), Index[0]+1);
+	}
+	for (i=1, start=0; i<sortcount; i++) {
+		int cylsize = sgi_get_nsect() * sgi_get_ntrks();
+		if ((sgi_get_start_sector(Index[i]) % cylsize) != 0) {
+			if (debug)	/* I do not understand how some disks fulfil it */
+				if (verbose)
+					printf(_("Partition %d does not start on cylinder boundary.\n"),
+					       Index[i]+1);
+		}
+		if (sgi_get_num_sectors(Index[i]) % cylsize != 0) {
+			if (debug)	/* I do not understand how some disks fulfil it */
+				if (verbose)
+					printf(_("Partition %d does not end on cylinder boundary.\n"),
+					       Index[i]+1);
+		}
+		/* We cannot handle several "entire disk" entries. */
+		if (sgi_get_sysid(Index[i]) == ENTIRE_DISK) continue;
+		if (start > sgi_get_start_sector(Index[i])) {
+			if (verbose)
+				printf(_("The Partition %d and %d overlap by %d sectors.\n"),
+				       Index[i-1]+1, Index[i]+1,
+				       start - sgi_get_start_sector(Index[i]));
+			if (gap >  0) gap = -gap;
+			if (gap == 0) gap = -1;
+		}
+		if (start < sgi_get_start_sector(Index[i])) {
+			if (verbose)
+				printf(_("Unused gap of %8u sectors - sectors %8u-%u\n"),
+				       sgi_get_start_sector(Index[i]) - start,
+				       start, sgi_get_start_sector(Index[i])-1);
+			gap += sgi_get_start_sector(Index[i]) - start;
+			add2freelist(start, sgi_get_start_sector(Index[i]));
+		}
+		start = sgi_get_start_sector(Index[i])
+			+ sgi_get_num_sectors(Index[i]);
+		if (debug > 1) {
+			if (verbose)
+				printf("%2d:%12d\t%12d\t%12d\n", Index[i],
+				       sgi_get_start_sector(Index[i]),
+				       sgi_get_num_sectors(Index[i]),
+				       sgi_get_sysid(Index[i]));
+		}
+	}
+	if (start < lastblock) {
+		if (verbose)
+			printf(_("Unused gap of %8u sectors - sectors %8u-%u\n"),
+			       lastblock - start, start, lastblock-1);
+		gap += lastblock - start;
+		add2freelist(start, lastblock);
+	}
+	/*
+	 * Done with arithmetics
+	 * Go for details now
+	 */
+	if (verbose) {
+		if (!sgi_get_num_sectors(sgi_get_bootpartition())) {
+			printf(_("\nThe boot partition does not exist.\n"));
+		}
+		if (!sgi_get_num_sectors(sgi_get_swappartition())) {
+			printf(_("\nThe swap partition does not exist.\n"));
+		} else {
+			if ((sgi_get_sysid(sgi_get_swappartition()) != SGI_SWAP)
+			    &&  (sgi_get_sysid(sgi_get_swappartition()) != LINUX_SWAP))
+				printf(_("\nThe swap partition has no swap type.\n"));
+		}
+		if (sgi_check_bootfile("/unix"))
+			printf(_("\tYou have chosen an unusual boot file name.\n"));
+	}
+	return (gap > 0) ? 1 : (gap == 0) ? 0 : -1;
+}
+
+int
+sgi_change_sysid(int i, int sys)
+{
+	if (sgi_get_num_sectors(i) == 0) /* caught already before, ... */ {
+		printf(_("Sorry You may change the Tag of non-empty partitions.\n"));
+		return 0;
+	}
+	if (((sys != ENTIRE_DISK) && (sys != SGI_VOLHDR))
+	    && (sgi_get_start_sector(i)<1)) {
+		read_chars(
+			_("It is highly recommended that the partition at offset 0\n"
+			  "is of type \"SGI volhdr\", the IRIX system will rely on it to\n"
+			  "retrieve from its directory standalone tools like sash and fx.\n"
+			  "Only the \"SGI volume\" entire disk section may violate this.\n"
+			  "Type YES if you are sure about tagging this partition differently.\n"));
+		if (strcmp (line_ptr, _("YES\n")))
+			return 0;
+	}
+	sgilabel->partitions[i].id = SSWAP32(sys);
+	return 1;
+}
+
+/* returns partition index of first entry marked as entire disk */
+static int
+sgi_entire(void) {
+	int i;
+
+	for (i=0; i<16; i++)
+		if (sgi_get_sysid(i) == SGI_VOLUME)
+			return i;
+	return -1;
+}
+
+static void
+sgi_set_partition(int i, unsigned int start, unsigned int length, int sys) {
+	sgilabel->partitions[i].id = SSWAP32(sys);
+	sgilabel->partitions[i].num_sectors = SSWAP32(length);
+	sgilabel->partitions[i].start_sector = SSWAP32(start);
+	set_changed(i);
+	if (sgi_gaps() < 0)	/* rebuild freelist */
+		printf(_("Do You know, You got a partition overlap on the disk?\n"));
+}
+
+static void
+sgi_set_entire(void) {
+	int n;
+
+	for (n=10; n<partitions; n++) {
+		if (!sgi_get_num_sectors(n)) {
+			sgi_set_partition(n, 0, sgi_get_lastblock(), SGI_VOLUME);
+			break;
+		}
+	}
+}
+
+static
+void
+sgi_set_volhdr(void)
+{
+	int n;
+
+	for (n=8; n<partitions; n++) {
+		if (!sgi_get_num_sectors(n)) {
+			/*
+			 * Choose same default volume header size
+			 * as IRIX fx uses.
+			 */
+			if (4096 < sgi_get_lastblock())
+				sgi_set_partition(n, 0, 4096, SGI_VOLHDR);
+			break;
+		}
+	}
+}
+
+void
+sgi_delete_partition(int i)
+{
+	sgi_set_partition(i, 0, 0, 0);
+}
+
+void
+sgi_add_partition(int n, int sys)
+{
+	char mesg[256];
+	unsigned int first=0, last=0;
+
+	if (n == 10) {
+		sys = SGI_VOLUME;
+	} else if (n == 8) {
+		sys = 0;
+	}
+	if (sgi_get_num_sectors(n)) {
+		printf(_("Partition %d is already defined.  Delete "
+			 "it before re-adding it.\n"), n + 1);
+		return;
+	}
+	if ((sgi_entire() == -1)
+	    &&  (sys != SGI_VOLUME)) {
+		printf(_("Attempting to generate entire disk entry automatically.\n"));
+		sgi_set_entire();
+		sgi_set_volhdr();
+	}
+	if ((sgi_gaps() == 0) &&  (sys != SGI_VOLUME)) {
+		printf(_("The entire disk is already covered with partitions.\n"));
+		return;
+	}
+	if (sgi_gaps() < 0) {
+		printf(_("You got a partition overlap on the disk. Fix it first!\n"));
+		return;
+	}
+	snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
+	for (;;) {
+		if (sys == SGI_VOLUME) {
+			last = sgi_get_lastblock();
+			first = read_int(0, 0, last-1, 0, mesg);
+			if (first != 0) {
+				printf(_("It is highly recommended that eleventh partition\n"
+					 "covers the entire disk and is of type `SGI volume'\n"));
+			}
+		} else {
+			first = freelist[0].first;
+			last  = freelist[0].last;
+			first = read_int(scround(first), scround(first), scround(last)-1,
+					 0, mesg);
+		}
+		if (display_in_cyl_units)
+			first *= units_per_sector;
+		else
+			first = first; /* align to cylinder if you know how ... */
+		if (!last)
+			last = isinfreelist(first);
+		if (last == 0) {
+			printf(_("You will get a partition overlap on the disk. "
+				 "Fix it first!\n"));
+		} else
+			break;
+	}
+	snprintf(mesg, sizeof(mesg), _(" Last %s"), str_units(SINGULAR));
+	last = read_int(scround(first), scround(last)-1, scround(last)-1,
+			scround(first), mesg)+1;
+	if (display_in_cyl_units)
+		last *= units_per_sector;                                     
+	else                                                             
+		last = last; /* align to cylinder if You know how ... */
+	if ((sys == SGI_VOLUME) && (first != 0 || last != sgi_get_lastblock()))
+		printf(_("It is highly recommended that eleventh partition\n"
+			 "covers the entire disk and is of type `SGI volume'\n"));
+	sgi_set_partition(n, first, last-first, sys);
+}
+
+void
+create_sgilabel(void)
+{
+	struct hd_geometry geometry;
+	struct {
+		unsigned int start;
+		unsigned int nsect;
+		int sysid;
+	} old[4];
+	int i=0;
+	unsigned long long llsectors;
+	int res; 		/* the result from the ioctl */
+	int sec_fac; 		/* the sector factor */
+
+	sec_fac = sector_size / 512;	/* determine the sector factor */
+
+	fprintf(stderr,
+		_("Building a new SGI disklabel. Changes will remain in memory only,\n"
+		  "until you decide to write them. After that, of course, the previous\n"
+		  "content will be unrecoverably lost.\n\n"));
+
+	other_endian = (BYTE_ORDER == LITTLE_ENDIAN);
+
+	res = blkdev_get_sectors(fd, &llsectors);
+
+#ifdef HDIO_GETGEO
+	if (!ioctl(fd, HDIO_GETGEO, &geometry)) {
+		heads = geometry.heads;
+		sectors = geometry.sectors;
+		if (res == 0) {
+			/* the get device size ioctl was successful */
+			unsigned long long llcyls;
+			llcyls = llsectors / (heads * sectors * sec_fac);
+			cylinders = llcyls;
+			if (cylinders != llcyls)	/* truncated? */
+				cylinders = ~0;
+		} else {
+			/* otherwise print error and use truncated version */
+			cylinders = geometry.cylinders;
+			fprintf(stderr,
+				_("Warning:  BLKGETSIZE ioctl failed on %s.  "
+				  "Using geometry cylinder value of %d.\n"
+				  "This value may be truncated for devices"
+				  " > 33.8 GB.\n"), disk_device, cylinders);
+		}
+	}
+#endif
+	for (i = 0; i < 4; i++) {
+		old[i].sysid = 0;
+		if (valid_part_table_flag(MBRbuffer)) {
+			if (get_part_table(i)->sys_ind) {
+				old[i].sysid = get_part_table(i)->sys_ind;
+				old[i].start = get_start_sect(get_part_table(i));
+				old[i].nsect = get_nr_sects(get_part_table(i));
+				printf(_("Trying to keep parameters of partition %d.\n"), i);
+				if (debug)
+					printf(_("ID=%02x\tSTART=%d\tLENGTH=%d\n"),
+					       old[i].sysid, old[i].start, old[i].nsect);
+			}
+		}
+	}
+
+	zeroize_mbr_buffer();
+	sgilabel->magic = SSWAP32(SGI_LABEL_MAGIC);
+	sgilabel->boot_part = SSWAP16(0);
+	sgilabel->swap_part = SSWAP16(1);
+
+	/* sizeof(sgilabel->boot_file) = 16 > 6 */
+	memset(sgilabel->boot_file, 0, 16);
+	strcpy((char *) sgilabel->boot_file, "/unix");
+
+	sgilabel->devparam.skew			= (0);
+	sgilabel->devparam.gap1			= (0);
+	sgilabel->devparam.gap2			= (0);
+	sgilabel->devparam.sparecyl			= (0);
+	sgilabel->devparam.pcylcount		= SSWAP16(geometry.cylinders);
+	sgilabel->devparam.head_vol0		= SSWAP16(0);
+	sgilabel->devparam.ntrks			= SSWAP16(geometry.heads);
+	/* tracks/cylinder (heads) */
+	sgilabel->devparam.cmd_tag_queue_depth	= (0);
+	sgilabel->devparam.unused0			= (0);
+	sgilabel->devparam.unused1			= SSWAP16(0);
+	sgilabel->devparam.nsect			= SSWAP16(geometry.sectors);
+	/* sectors/track */
+	sgilabel->devparam.bytes			= SSWAP16(sector_size);
+	sgilabel->devparam.ilfact			= SSWAP16(1);
+	sgilabel->devparam.flags			= SSWAP32(TRACK_FWD|\
+								  IGNORE_ERRORS|RESEEK);
+	sgilabel->devparam.datarate			= SSWAP32(0);
+	sgilabel->devparam.retries_on_error		= SSWAP32(1);
+	sgilabel->devparam.ms_per_word		= SSWAP32(0);
+	sgilabel->devparam.xylogics_gap1		= SSWAP16(0);
+	sgilabel->devparam.xylogics_syncdelay	= SSWAP16(0);
+	sgilabel->devparam.xylogics_readdelay	= SSWAP16(0);
+	sgilabel->devparam.xylogics_gap2		= SSWAP16(0);
+	sgilabel->devparam.xylogics_readgate	= SSWAP16(0);
+	sgilabel->devparam.xylogics_writecont	= SSWAP16(0);
+	memset(&(sgilabel->directory), 0, sizeof(struct volume_directory)*15);
+	memset(&(sgilabel->partitions), 0, sizeof(struct sgi_partition)*16);
+	sgi_label  =  1;
+	partitions = 16;
+	volumes    = 15;
+	sgi_set_entire();
+	sgi_set_volhdr();
+	for (i = 0; i < 4; i++) {
+		if (old[i].sysid) {
+			sgi_set_partition(i, old[i].start, old[i].nsect, old[i].sysid);
+		}
+	}
+}
+
+void
+sgi_set_ilfact(void)
+{
+	/* do nothing in the beginning */
+}
+
+void
+sgi_set_rspeed(void)
+{
+	/* do nothing in the beginning */
+}
+
+void
+sgi_set_pcylcount(void)
+{
+	/* do nothing in the beginning */
+}
+
+void
+sgi_set_xcyl(void)
+{
+	/* do nothing in the beginning */
+}
+
+void
+sgi_set_ncyl(void)
+{
+	/* do nothing in the beginning */
+}
+
+/* _____________________________________________________________
+ */
+
+sgiinfo *
+fill_sgiinfo(void)
+{
+	sgiinfo*info=calloc(1, sizeof(sgiinfo));
+	info->magic=SSWAP32(SGI_INFO_MAGIC);
+	info->b1=SSWAP32(-1);
+	info->b2=SSWAP16(-1);
+	info->b3=SSWAP16(1);
+	/* You may want to replace this string !!!!!!! */
+	strcpy((char *) info->scsi_string, "IBM OEM 0662S12         3 30");
+	strcpy((char *) info->serial, "0000");
+	info->check1816 = SSWAP16(18*256 +16);
+	strcpy((char *) info->installer, "Sfx version 5.3, Oct 18, 1994");
+	return info;
+}
diff --git a/util-linux-ng-2.17.2/fdisk/fdisksgilabel.h b/util-linux-ng-2.17.2/fdisk/fdisksgilabel.h
new file mode 100644
index 0000000..1445fa9
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisksgilabel.h
@@ -0,0 +1,139 @@
+#ifndef FDISK_SGI_LABEL_H
+#define FDISK_SGI_LABEL_H
+
+#include <stdint.h>
+
+#include "bitops.h"
+
+/*
+ * Copyright (C) Andreas Neuper, Sep 1998.
+ *	This file may be modified and redistributed under
+ *	the terms of the GNU Public License.
+ */
+
+struct device_parameter { /* 48 bytes */
+	unsigned char  skew;
+	unsigned char  gap1;
+	unsigned char  gap2;
+	unsigned char  sparecyl;
+	unsigned short pcylcount;
+	unsigned short head_vol0;
+	unsigned short ntrks;	/* tracks in cyl 0 or vol 0 */
+	unsigned char  cmd_tag_queue_depth;
+	unsigned char  unused0;
+	unsigned short unused1;
+	unsigned short nsect;	/* sectors/tracks in cyl 0 or vol 0 */
+	unsigned short bytes;
+	unsigned short ilfact;
+	unsigned int   flags;		/* controller flags */
+	unsigned int   datarate;
+	unsigned int   retries_on_error;
+	unsigned int   ms_per_word;
+	unsigned short xylogics_gap1;
+	unsigned short xylogics_syncdelay;
+	unsigned short xylogics_readdelay;
+	unsigned short xylogics_gap2;
+	unsigned short xylogics_readgate;
+	unsigned short xylogics_writecont;
+};
+
+#define	SGI_VOLHDR	0x00
+/* 1 and 2 were used for drive types no longer supported by SGI */
+#define	SGI_SWAP	0x03
+/* 4 and 5 were for filesystem types SGI haven't ever supported on MIPS CPUs */
+#define	SGI_VOLUME	0x06
+#define	SGI_EFS		0x07
+#define	SGI_LVOL	0x08
+#define	SGI_RLVOL	0x09
+#define	SGI_XFS		0x0a
+#define	SGI_XFSLOG	0x0b
+#define	SGI_XLV		0x0c
+#define	SGI_XVM		0x0d
+#define	ENTIRE_DISK	SGI_VOLUME
+/*
+ * controller flags
+ */
+#define	SECTOR_SLIP	0x01
+#define	SECTOR_FWD	0x02
+#define	TRACK_FWD	0x04
+#define	TRACK_MULTIVOL	0x08
+#define	IGNORE_ERRORS	0x10
+#define	RESEEK		0x20
+#define	CMDTAGQ_ENABLE	0x40
+
+typedef struct {
+	unsigned int   magic;		 /* expect SGI_LABEL_MAGIC */
+	unsigned short boot_part;        /* active boot partition */
+	unsigned short swap_part;        /* active swap partition */
+	unsigned char  boot_file[16];    /* name of the bootfile */
+	struct device_parameter devparam;	/*  1 * 48 bytes */
+	struct volume_directory {		/* 15 * 16 bytes */
+		unsigned char vol_file_name[8];	/* a character array */
+		unsigned int  vol_file_start;	/* number of logical block */
+		unsigned int  vol_file_size;	/* number of bytes */
+	} directory[15];
+	struct sgi_partition {			/* 16 * 12 bytes */
+		unsigned int num_sectors;	/* number of blocks */
+		unsigned int start_sector;	/* must be cylinder aligned */
+		unsigned int id;
+	} partitions[16];
+	unsigned int   csum;
+	unsigned int   fillbytes;
+} sgi_partition;
+
+typedef struct {
+	unsigned int   magic;		/* looks like a magic number */
+	unsigned int   a2;
+	unsigned int   a3;
+	unsigned int   a4;
+	unsigned int   b1;
+	unsigned short b2;
+	unsigned short b3;
+	unsigned int   c[16];
+	unsigned short d[3];
+	unsigned char  scsi_string[50];
+	unsigned char  serial[137];
+	unsigned short check1816;
+	unsigned char  installer[225];
+} sgiinfo;
+
+#define	SGI_LABEL_MAGIC		0x0be5a941
+#define	SGI_LABEL_MAGIC_SWAPPED	0x41a9e50b
+#define	SGI_INFO_MAGIC		0x00072959
+#define	SGI_INFO_MAGIC_SWAPPED	0x59290700
+
+#define SSWAP16(x) (other_endian ? swab16(x) : (uint16_t)(x))
+#define SSWAP32(x) (other_endian ? swab32(x) : (uint32_t)(x))
+
+/* fdisk.c */
+#define sgilabel ((sgi_partition *)MBRbuffer)
+#define sgiparam (sgilabel->devparam)
+
+/* fdisksgilabel.c */
+extern struct	systypes sgi_sys_types[];
+extern void	sgi_nolabel( void );
+extern int	check_sgi_label( void );
+extern void	sgi_list_table( int xtra );
+extern int  sgi_change_sysid( int i, int sys );
+extern unsigned int	sgi_get_start_sector( int i );
+extern unsigned int	sgi_get_num_sectors( int i );
+extern int	sgi_get_sysid( int i );
+extern void	sgi_delete_partition( int i );
+extern void	sgi_add_partition( int n, int sys );
+extern void	create_sgilabel( void );
+extern void	create_sgiinfo( void );
+extern int	verify_sgi( int verbose );
+extern void	sgi_write_table( void );
+extern void	sgi_set_ilfact( void );
+extern void	sgi_set_rspeed( void );
+extern void	sgi_set_pcylcount( void );
+extern void	sgi_set_xcyl( void );
+extern void	sgi_set_ncyl( void );
+extern void	sgi_set_bootpartition( int i );
+extern void	sgi_set_swappartition( int i );
+extern int	sgi_get_bootpartition( void );
+extern int	sgi_get_swappartition( void );
+extern void	sgi_set_bootfile( const char* aFile );
+extern const char *sgi_get_bootfile( void );
+
+#endif /* FDISK_SGI_LABEL_H */
diff --git a/util-linux-ng-2.17.2/fdisk/fdisksunlabel.c b/util-linux-ng-2.17.2/fdisk/fdisksunlabel.c
new file mode 100644
index 0000000..fad9d4f
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisksunlabel.c
@@ -0,0 +1,678 @@
+/*
+ * fdisksunlabel.c
+ *
+ * I think this is mostly, or entirely, due to
+ * 	Jakub Jelinek (jj@sunsite.mff.cuni.cz), July 1996
+ *
+ * Merged with fdisk for other architectures, aeb, June 1998.
+ *
+ * Sat Mar 20 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *      Internationalization
+ */
+
+#include <stdio.h>		/* stderr */
+#include <stdlib.h>		/* qsort */
+#include <string.h>		/* strstr */
+#include <unistd.h>		/* write */
+#include <sys/ioctl.h>		/* ioctl */
+#include <sys/stat.h>		/* stat */
+#include <sys/sysmacros.h>	/* major */
+
+#include "nls.h"
+#include "blkdev.h"
+
+#include <endian.h>
+#ifdef HAVE_LINUX_MAJOR_H
+#include <linux/major.h>	/* FLOPPY_MAJOR */
+#endif
+
+#include "common.h"
+#include "fdisk.h"
+#include "fdisksunlabel.h"
+
+static int     other_endian = 0;
+static int     scsi_disk = 0;
+static int     floppy = 0;
+
+struct systypes sun_sys_types[] = {
+	{SUN_TAG_UNASSIGNED, N_("Unassigned")},
+	{SUN_TAG_BOOT, N_("Boot")},
+	{SUN_TAG_ROOT, N_("SunOS root")},
+	{SUN_TAG_SWAP, N_("SunOS swap")},
+	{SUN_TAG_USR, N_("SunOS usr")},
+	{SUN_TAG_BACKUP, N_("Whole disk")},
+	{SUN_TAG_STAND, N_("SunOS stand")},
+	{SUN_TAG_VAR, N_("SunOS var")},
+	{SUN_TAG_HOME, N_("SunOS home")},
+	{SUN_TAG_ALTSCTR, N_("SunOS alt sectors")},
+	{SUN_TAG_CACHE, N_("SunOS cachefs")},
+	{SUN_TAG_RESERVED, N_("SunOS reserved")},
+	{SUN_TAG_LINUX_SWAP, N_("Linux swap")},
+	{SUN_TAG_LINUX_NATIVE, N_("Linux native")},
+	{SUN_TAG_LINUX_LVM, N_("Linux LVM")},
+	{SUN_TAG_LINUX_RAID, N_("Linux raid autodetect")},
+	{ 0, NULL }
+};
+
+static inline unsigned short __swap16(unsigned short x) {
+        return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8);
+}
+static inline uint32_t __swap32(uint32_t x) {
+        return (((uint32_t)(x) & 0xFF) << 24) | (((uint32_t)(x) & 0xFF00) << 8) | (((uint32_t)(x) & 0xFF0000) >> 8) | (((uint32_t)(x) & 0xFF000000) >> 24);
+}
+
+#define SSWAP16(x) (other_endian ? __swap16(x) \
+				 : (uint16_t)(x))
+#define SSWAP32(x) (other_endian ? __swap32(x) \
+				 : (uint32_t)(x))
+
+#ifndef FLOPPY_MAJOR
+#define FLOPPY_MAJOR 2
+#endif
+#ifndef IDE0_MAJOR
+#define IDE0_MAJOR 3
+#endif
+#ifndef IDE1_MAJOR
+#define IDE1_MAJOR 22
+#endif
+void guess_device_type(int fd)
+{
+	struct stat bootstat;
+
+	if (fstat (fd, &bootstat) < 0) {
+                scsi_disk = 0;
+                floppy = 0;
+	} else if (S_ISBLK(bootstat.st_mode)
+		   && (major(bootstat.st_rdev) == IDE0_MAJOR ||
+		       major(bootstat.st_rdev) == IDE1_MAJOR)) {
+                scsi_disk = 0;
+                floppy = 0;
+	} else if (S_ISBLK(bootstat.st_mode)
+		   && major(bootstat.st_rdev) == FLOPPY_MAJOR) {
+                scsi_disk = 0;
+                floppy = 1;
+	} else {
+                scsi_disk = 1;
+                floppy = 0;
+	}
+}
+
+static void set_sun_partition(int i, uint32_t start, uint32_t stop, uint16_t sysid)
+{
+	sunlabel->part_tags[i].tag = SSWAP16(sysid);
+	sunlabel->part_tags[i].flag = SSWAP16(0);
+	sunlabel->partitions[i].start_cylinder =
+		SSWAP32(start / (heads * sectors));
+	sunlabel->partitions[i].num_sectors =
+		SSWAP32(stop - start);
+	set_changed(i);
+}
+
+void sun_nolabel(void)
+{
+	sun_label = 0;
+	sunlabel->magic = 0;
+	partitions = 4;
+}
+
+int check_sun_label(void)
+{
+	unsigned short *ush;
+	int csum;
+
+	if (sunlabel->magic != SUN_LABEL_MAGIC &&
+	    sunlabel->magic != SUN_LABEL_MAGIC_SWAPPED) {
+		sun_label = 0;
+		other_endian = 0;
+		return 0;
+	}
+	other_endian = (sunlabel->magic == SUN_LABEL_MAGIC_SWAPPED);
+
+	ush = ((unsigned short *) (sunlabel + 1)) - 1;
+	for (csum = 0; ush >= (unsigned short *)sunlabel;)
+		csum ^= *ush--;
+
+	if (csum) {
+		fprintf(stderr,_("Detected sun disklabel with wrong checksum.\n"
+				"Probably you'll have to set all the values,\n"
+				"e.g. heads, sectors, cylinders and partitions\n"
+				"or force a fresh label (s command in main menu)\n"));
+	} else {
+		int need_fixing = 0;
+
+		heads = SSWAP16(sunlabel->nhead);
+		cylinders = SSWAP16(sunlabel->ncyl);
+		sectors = SSWAP16(sunlabel->nsect);
+
+		if (sunlabel->version != SSWAP32(SUN_LABEL_VERSION)) {
+			fprintf(stderr,_("Detected sun disklabel with wrong version [0x%08x].\n"),
+				SSWAP32(sunlabel->version));
+			need_fixing = 1;
+		}
+		if (sunlabel->sanity != SSWAP32(SUN_LABEL_SANE)) {
+			fprintf(stderr,_("Detected sun disklabel with wrong sanity [0x%08x].\n"),
+				SSWAP32(sunlabel->sanity));
+			need_fixing = 1;
+		}
+		if (sunlabel->num_partitions != SSWAP16(SUN_NUM_PARTITIONS)) {
+			fprintf(stderr,_("Detected sun disklabel with wrong num_partitions [%u].\n"),
+				SSWAP16(sunlabel->num_partitions));
+			need_fixing = 1;
+		}
+		if (need_fixing) {
+			fprintf(stderr, _("Warning: Wrong values need to be "
+					  "fixed up and will be corrected "
+					  "by w(rite)\n"));
+			sunlabel->version = SSWAP32(SUN_LABEL_VERSION);
+			sunlabel->sanity = SSWAP32(SUN_LABEL_SANE);
+			sunlabel->num_partitions = SSWAP16(SUN_NUM_PARTITIONS);
+
+			ush = (unsigned short *)sunlabel;
+			csum = 0;
+			while(ush < (unsigned short *)(&sunlabel->cksum))
+				csum ^= *ush++;
+			sunlabel->cksum = csum;
+
+			set_changed(0);
+		}
+	}
+	update_units();
+	sun_label = 1;
+	partitions = SUN_NUM_PARTITIONS;
+	return 1;
+}
+
+void create_sunlabel(void)
+{
+	struct hd_geometry geometry;
+	unsigned long long llsectors, llcyls;
+	unsigned int ndiv;
+	int res, sec_fac;
+
+	fprintf(stderr,
+	_("Building a new sun disklabel. Changes will remain in memory only,\n"
+       	"until you decide to write them. After that, of course, the previous\n"
+	"content won't be recoverable.\n\n"));
+#if BYTE_ORDER == LITTLE_ENDIAN
+	other_endian = 1;
+#else
+	other_endian = 0;
+#endif
+	zeroize_mbr_buffer();
+	sunlabel->magic = SSWAP16(SUN_LABEL_MAGIC);
+	sunlabel->sanity = SSWAP32(SUN_LABEL_SANE);
+	sunlabel->version = SSWAP32(SUN_LABEL_VERSION);
+	sunlabel->num_partitions = SSWAP16(SUN_NUM_PARTITIONS);
+
+	res = blkdev_get_sectors(fd, &llsectors);
+	sec_fac = sector_size / 512;
+
+#ifdef HDIO_GETGEO
+	if (!ioctl(fd, HDIO_GETGEO, &geometry)) {
+	        heads = geometry.heads;
+	        sectors = geometry.sectors;
+		if (res == 0) {
+			llcyls = llsectors / (heads * sectors * sec_fac);
+			cylinders = llcyls;
+			if (cylinders != llcyls)
+				cylinders = ~0;
+		} else {
+			cylinders = geometry.cylinders;
+			fprintf(stderr,
+				_("Warning:  BLKGETSIZE ioctl failed on %s.  "
+				  "Using geometry cylinder value of %d.\n"
+				  "This value may be truncated for devices"
+				  " > 33.8 GB.\n"), disk_device, cylinders);
+		}
+	} else
+#endif
+	{
+	        heads = read_int(1,1,1024,0,_("Heads"));
+		sectors = read_int(1,1,1024,0,_("Sectors/track"));
+		cylinders = read_int(1,1,65535,0,_("Cylinders"));
+	}
+
+	sunlabel->acyl   = SSWAP16(2);
+	sunlabel->pcyl   = SSWAP16(cylinders);
+	sunlabel->ncyl   = SSWAP16(cylinders - 2);
+	sunlabel->rpm    = SSWAP16(5400);
+	sunlabel->intrlv = SSWAP16(1);
+	sunlabel->apc    = SSWAP16(0);
+
+	sunlabel->nhead = SSWAP16(heads);
+	sunlabel->nsect = SSWAP16(sectors);
+	sunlabel->ncyl = SSWAP16(cylinders);
+
+	snprintf(sunlabel->label_id, sizeof(sunlabel->label_id),
+		 "Linux cyl %d alt %d hd %d sec %llu",
+		 cylinders, SSWAP16(sunlabel->acyl), heads, sectors);
+
+	if (cylinders * heads * sectors >= 150 * 2048) {
+	        ndiv = cylinders - (50 * 2048 / (heads * sectors)); /* 50M swap */
+	} else
+	        ndiv = cylinders * 2 / 3;
+
+	set_sun_partition(0, 0, ndiv * heads * sectors,
+			  SUN_TAG_LINUX_NATIVE);
+	set_sun_partition(1, ndiv * heads * sectors,
+			  cylinders * heads * sectors,
+			  SUN_TAG_LINUX_SWAP);
+	sunlabel->part_tags[1].flag |= SSWAP16(SUN_FLAG_UNMNT);
+
+	set_sun_partition(2, 0, cylinders * heads * sectors, SUN_TAG_BACKUP);
+
+	{
+		unsigned short *ush = (unsigned short *)sunlabel;
+		unsigned short csum = 0;
+		while(ush < (unsigned short *)(&sunlabel->cksum))
+			csum ^= *ush++;
+		sunlabel->cksum = csum;
+	}
+
+	set_all_unchanged();
+	get_boot(create_empty_sun);
+	set_changed(0);
+}
+
+void toggle_sunflags(int i, uint16_t mask)
+{
+	struct sun_tag_flag *p = &sunlabel->part_tags[i];
+
+	p->flag ^= SSWAP16(mask);
+
+	set_changed(i);
+}
+
+static void fetch_sun(uint32_t *starts, uint32_t *lens, uint32_t *start, uint32_t *stop)
+{
+	int i, continuous = 1;
+
+	*start = 0;
+	*stop = cylinders * heads * sectors;
+
+	for (i = 0; i < partitions; i++) {
+		struct sun_partition *part = &sunlabel->partitions[i];
+		struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+
+		if (part->num_sectors &&
+		    tag->tag != SSWAP16(SUN_TAG_UNASSIGNED) &&
+		    tag->tag != SSWAP16(SUN_TAG_BACKUP)) {
+			starts[i] = (SSWAP32(part->start_cylinder) *
+				     heads * sectors);
+			lens[i] = SSWAP32(part->num_sectors);
+			if (continuous) {
+				if (starts[i] == *start)
+					*start += lens[i];
+				else if (starts[i] + lens[i] >= *stop)
+					*stop = starts[i];
+				else
+					continuous = 0;
+				        /* There will be probably more gaps
+					  than one, so lets check afterwards */
+			}
+		} else {
+			starts[i] = 0;
+			lens[i] = 0;
+		}
+	}
+}
+
+static unsigned int *verify_sun_starts;
+
+static int verify_sun_cmp(int *a, int *b)
+{
+    if (*a == -1)
+	    return 1;
+    if (*b == -1)
+	    return -1;
+    if (verify_sun_starts[*a] > verify_sun_starts[*b])
+	    return 1;
+    return -1;
+}
+
+void verify_sun(void)
+{
+    uint32_t starts[SUN_NUM_PARTITIONS], lens[SUN_NUM_PARTITIONS], start, stop;
+    int i,j,k,starto,endo;
+    int array[SUN_NUM_PARTITIONS];
+
+    verify_sun_starts = starts;
+
+    fetch_sun(starts, lens, &start, &stop);
+
+    for (k = 0; k < 7; k++) {
+	for (i = 0; i < SUN_NUM_PARTITIONS; i++) {
+	    if (k && (lens[i] % (heads * sectors))) {
+	        printf(_("Partition %d doesn't end on cylinder boundary\n"), i+1);
+	    }
+	    if (lens[i]) {
+	        for (j = 0; j < i; j++)
+	            if (lens[j]) {
+	                if (starts[j] == starts[i]+lens[i]) {
+	                    starts[j] = starts[i]; lens[j] += lens[i];
+	                    lens[i] = 0;
+	                } else if (starts[i] == starts[j]+lens[j]){
+	                    lens[j] += lens[i];
+	                    lens[i] = 0;
+	                } else if (!k) {
+	                    if (starts[i] < starts[j]+lens[j] &&
+				starts[j] < starts[i]+lens[i]) {
+	                        starto = starts[i];
+	                        if (starts[j] > starto)
+					starto = starts[j];
+	                        endo = starts[i]+lens[i];
+	                        if (starts[j]+lens[j] < endo)
+					endo = starts[j]+lens[j];
+	                        printf(_("Partition %d overlaps with others in "
+				       "sectors %d-%d\n"), i+1, starto, endo);
+	                    }
+	                }
+	            }
+	    }
+	}
+    }
+    for (i = 0; i < SUN_NUM_PARTITIONS; i++) {
+        if (lens[i])
+            array[i] = i;
+        else
+            array[i] = -1;
+    }
+    qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
+	  (int (*)(const void *,const void *)) verify_sun_cmp);
+    if (array[0] == -1) {
+    	printf(_("No partitions defined\n"));
+    	return;
+    }
+    stop = cylinders * heads * sectors;
+    if (starts[array[0]])
+        printf(_("Unused gap - sectors 0-%d\n"), starts[array[0]]);
+    for (i = 0; i < 7 && array[i+1] != -1; i++) {
+        printf(_("Unused gap - sectors %d-%d\n"),
+	       (starts[array[i]] + lens[array[i]]),
+	       starts[array[i+1]]);
+    }
+    start = (starts[array[i]] + lens[array[i]]);
+    if (start < stop)
+        printf(_("Unused gap - sectors %d-%d\n"), start, stop);
+}
+
+void add_sun_partition(int n, int sys)
+{
+	uint32_t starts[SUN_NUM_PARTITIONS], lens[SUN_NUM_PARTITIONS];
+	struct sun_partition *part = &sunlabel->partitions[n];
+	struct sun_tag_flag *tag = &sunlabel->part_tags[n];
+	uint32_t start, stop, stop2;
+	int whole_disk = 0;
+		
+	char mesg[256];
+	int i, first, last;
+
+	if (part->num_sectors && tag->tag != SSWAP16(SUN_TAG_UNASSIGNED)) {
+		printf(_("Partition %d is already defined.  Delete "
+			"it before re-adding it.\n"), n + 1);
+		return;
+	}
+	
+	fetch_sun(starts, lens, &start, &stop);
+	if (stop <= start) {
+		if (n == 2)
+			whole_disk = 1;
+		else {
+			printf(_("Other partitions already cover the whole disk.\nDelete "
+			       "some/shrink them before retry.\n"));
+			return;
+		}
+	}
+	snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
+	for (;;) {
+		if (whole_disk)
+			first = read_int(0, 0, 0, 0, mesg);
+		else
+			first = read_int(scround(start), scround(stop)+1,
+					 scround(stop), 0, mesg);
+		if (display_in_cyl_units)
+			first *= units_per_sector;
+		else {
+			/* Starting sector has to be properly aligned */
+			int cs = heads * sectors;
+			int x = first % cs;
+
+			if (x)
+				first += cs - x;
+		}
+		if (n == 2 && first != 0)
+			printf (_("\
+It is highly recommended that the third partition covers the whole disk\n\
+and is of type `Whole disk'\n"));
+		/* ewt asks to add: "don't start a partition at cyl 0"
+		   However, edmundo@rano.demon.co.uk writes:
+		   "In addition to having a Sun partition table, to be able to
+		   boot from the disc, the first partition, /dev/sdX1, must
+		   start at cylinder 0. This means that /dev/sdX1 contains
+		   the partition table and the boot block, as these are the
+		   first two sectors of the disc. Therefore you must be
+		   careful what you use /dev/sdX1 for. In particular, you must
+		   not use a partition starting at cylinder 0 for Linux swap,
+		   as that would overwrite the partition table and the boot
+		   block. You may, however, use such a partition for a UFS
+		   or EXT2 file system, as these file systems leave the first
+		   1024 bytes undisturbed. */
+		/* On the other hand, one should not use partitions
+		   starting at block 0 in an md, or the label will
+		   be trashed. */
+		for (i = 0; i < partitions; i++)
+			if (lens[i] && starts[i] <= first
+			            && starts[i] + lens[i] > first)
+				break;
+		if (i < partitions && !whole_disk) {
+			if (n == 2 && !first) {
+			    whole_disk = 1;
+			    break;
+			}
+			printf(_("Sector %d is already allocated\n"), first);
+		} else
+			break;
+	}
+	stop = cylinders * heads * sectors;	/* ancient */
+	stop2 = stop;
+	for (i = 0; i < partitions; i++) {
+		if (starts[i] > first && starts[i] < stop)
+			stop = starts[i];
+	}
+	snprintf(mesg, sizeof(mesg),
+		 _("Last %s or +size or +sizeM or +sizeK"),
+		 str_units(SINGULAR));
+	if (whole_disk)
+		last = read_int(scround(stop2), scround(stop2), scround(stop2),
+				0, mesg);
+	else if (n == 2 && !first)
+		last = read_int(scround(first), scround(stop2), scround(stop2),
+				scround(first), mesg);
+	else
+		last = read_int(scround(first), scround(stop), scround(stop),
+				scround(first), mesg);
+	if (display_in_cyl_units)
+		last *= units_per_sector;
+	if (n == 2 && !first) {
+		if (last >= stop2) {
+		    whole_disk = 1;
+		    last = stop2;
+		} else if (last > stop) {
+		    printf (
+   _("You haven't covered the whole disk with the 3rd partition, but your value\n"
+     "%d %s covers some other partition. Your entry has been changed\n"
+     "to %d %s\n"),
+			scround(last), str_units(SINGULAR),
+			scround(stop), str_units(SINGULAR));
+		    last = stop;
+		}
+	} else if (!whole_disk && last > stop)
+		last = stop;
+
+	if (whole_disk)
+		sys = SUN_TAG_BACKUP;
+
+	set_sun_partition(n, first, last, sys);
+}
+
+void sun_delete_partition(int i)
+{
+	struct sun_partition *part = &sunlabel->partitions[i];
+	struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+	unsigned int nsec;
+
+	if (i == 2 &&
+	    tag->tag == SSWAP16(SUN_TAG_BACKUP) &&
+	    !part->start_cylinder &&
+	    (nsec = SSWAP32(part->num_sectors))
+	      == heads * sectors * cylinders)
+		printf(_("If you want to maintain SunOS/Solaris compatibility, "
+		       "consider leaving this\n"
+		       "partition as Whole disk (5), starting at 0, with %u "
+		       "sectors\n"), nsec);
+	tag->tag = SSWAP16(SUN_TAG_UNASSIGNED);
+	part->num_sectors = 0;
+}
+
+int sun_change_sysid(int i, uint16_t sys)
+{
+	struct sun_partition *part = &sunlabel->partitions[i];
+	struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+
+	if (sys == SUN_TAG_LINUX_SWAP && !part->start_cylinder) {
+	    read_chars(
+	      _("It is highly recommended that the partition at offset 0\n"
+	      "is UFS, EXT2FS filesystem or SunOS swap. Putting Linux swap\n"
+	      "there may destroy your partition table and bootblock.\n"
+	      "Type YES if you're very sure you would like that partition\n"
+	      "tagged with 82 (Linux swap): "));
+	    if (strcmp (line_ptr, _("YES\n")))
+		    return 0;
+	}
+	switch (sys) {
+	case SUN_TAG_SWAP:
+	case SUN_TAG_LINUX_SWAP:
+		/* swaps are not mountable by default */
+		tag->flag |= SSWAP16(SUN_FLAG_UNMNT);
+		break;
+	default:
+		/* assume other types are mountable;
+		   user can change it anyway */
+		tag->flag &= ~SSWAP16(SUN_FLAG_UNMNT);
+		break;
+	}
+	tag->tag = SSWAP16(sys);
+	return 1;
+}
+
+void sun_list_table(int xtra)
+{
+	int i, w;
+	char *type;
+
+	w = strlen(disk_device);
+	if (xtra)
+		printf(
+		_("\nDisk %s (Sun disk label): %d heads, %llu sectors, %d rpm\n"
+		"%d cylinders, %d alternate cylinders, %d physical cylinders\n"
+		"%d extra sects/cyl, interleave %d:1\n"
+		"Label ID: %s\n"
+		"Volume ID: %s\n"
+		"Units = %s of %d * 512 bytes\n\n"),
+		       disk_device, heads, sectors, SSWAP16(sunlabel->rpm),
+		       cylinders, SSWAP16(sunlabel->acyl),
+		       SSWAP16(sunlabel->pcyl),
+		       SSWAP16(sunlabel->apc),
+		       SSWAP16(sunlabel->intrlv),
+		       sunlabel->label_id,
+		       sunlabel->volume_id,
+		       str_units(PLURAL), units_per_sector);
+	else
+		printf(
+	_("\nDisk %s (Sun disk label): %d heads, %llu sectors, %d cylinders\n"
+	"Units = %s of %d * 512 bytes\n\n"),
+		       disk_device, heads, sectors, cylinders,
+		       str_units(PLURAL), units_per_sector);
+
+	printf(_("%*s Flag    Start       End    Blocks   Id  System\n"),
+	       w + 1, _("Device"));
+	for (i = 0 ; i < partitions; i++) {
+		struct sun_partition *part = &sunlabel->partitions[i];
+		struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+
+		if (part->num_sectors) {
+			uint32_t start = SSWAP32(part->start_cylinder) * heads * sectors;
+			uint32_t len = SSWAP32(part->num_sectors);
+			printf(
+			    "%s %c%c %9ld %9ld %9ld%c  %2x  %s\n",
+/* device */		  partname(disk_device, i+1, w),
+/* flags */		  (tag->flag & SSWAP16(SUN_FLAG_UNMNT)) ? 'u' : ' ',
+			  (tag->flag & SSWAP16(SUN_FLAG_RONLY)) ? 'r' : ' ',
+/* start */		  (long) scround(start),
+/* end */		  (long) scround(start+len),
+/* odd flag on end */	  (long) len / 2, len & 1 ? '+' : ' ',
+/* type id */		  SSWAP16(tag->tag),
+/* type name */		  (type = partition_type(SSWAP16(tag->tag)))
+			        ? type : _("Unknown"));
+		}
+	}
+}
+
+void sun_set_alt_cyl(void)
+{
+	sunlabel->acyl =
+		SSWAP16(read_int(0,SSWAP16(sunlabel->acyl), 65535, 0,
+				 _("Number of alternate cylinders")));
+}
+
+void sun_set_ncyl(int cyl)
+{
+	sunlabel->ncyl = SSWAP16(cyl);
+}
+
+void sun_set_xcyl(void)
+{
+	sunlabel->apc =
+		SSWAP16(read_int(0, SSWAP16(sunlabel->apc), sectors, 0,
+				 _("Extra sectors per cylinder")));
+}
+
+void sun_set_ilfact(void)
+{
+	sunlabel->intrlv =
+		SSWAP16(read_int(1, SSWAP16(sunlabel->intrlv), 32, 0,
+				 _("Interleave factor")));
+}
+
+void sun_set_rspeed(void)
+{
+	sunlabel->rpm =
+		SSWAP16(read_int(1, SSWAP16(sunlabel->rpm), 100000, 0,
+				 _("Rotation speed (rpm)")));
+}
+
+void sun_set_pcylcount(void)
+{
+	sunlabel->pcyl =
+		SSWAP16(read_int(0, SSWAP16(sunlabel->pcyl), 65535, 0,
+				 _("Number of physical cylinders")));
+}
+
+void sun_write_table(void)
+{
+	unsigned short *ush = (unsigned short *)sunlabel;
+	unsigned short csum = 0;
+
+	while(ush < (unsigned short *)(&sunlabel->cksum))
+		csum ^= *ush++;
+	sunlabel->cksum = csum;
+	if (lseek(fd, 0, SEEK_SET) < 0)
+		fatal(unable_to_seek);
+	if (write(fd, sunlabel, SECTOR_SIZE) != SECTOR_SIZE)
+		fatal(unable_to_write);
+}
+
+int sun_get_sysid(int i)
+{
+	return SSWAP16(sunlabel->part_tags[i].tag);
+}
diff --git a/util-linux-ng-2.17.2/fdisk/fdisksunlabel.h b/util-linux-ng-2.17.2/fdisk/fdisksunlabel.h
new file mode 100644
index 0000000..b7419cb
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/fdisksunlabel.h
@@ -0,0 +1,99 @@
+#ifndef FDISK_SUN_LABEL_H
+#define FDISK_SUN_LABEL_H
+
+#include <stdint.h>
+
+struct sun_partition {
+	uint32_t	start_cylinder;
+	uint32_t	num_sectors;
+};
+
+struct sun_tag_flag {
+	uint16_t	tag;
+#define SUN_TAG_UNASSIGNED	0x00	/* Unassigned partition */
+#define SUN_TAG_BOOT		0x01	/* Boot partition	*/
+#define SUN_TAG_ROOT		0x02	/* Root filesystem	*/
+#define SUN_TAG_SWAP		0x03	/* Swap partition	*/
+#define SUN_TAG_USR		0x04	/* /usr filesystem	*/
+#define SUN_TAG_BACKUP		0x05	/* Full-disk slice	*/
+#define SUN_TAG_STAND		0x06	/* Stand partition	*/
+#define SUN_TAG_VAR		0x07	/* /var filesystem	*/
+#define SUN_TAG_HOME		0x08	/* /home filesystem	*/
+#define SUN_TAG_ALTSCTR		0x09	/* Alt sector partition	*/
+#define SUN_TAG_CACHE		0x0a	/* Cachefs partition	*/
+#define SUN_TAG_RESERVED	0x0b	/* SMI reserved data	*/
+#define SUN_TAG_LINUX_SWAP	0x82	/* Linux SWAP		*/
+#define SUN_TAG_LINUX_NATIVE	0x83	/* Linux filesystem	*/
+#define SUN_TAG_LINUX_LVM	0x8e	/* Linux LVM		*/
+#define SUN_TAG_LINUX_RAID	0xfd	/* LInux RAID		*/
+
+	uint16_t	flag;
+#define SUN_FLAG_UNMNT		0x01	/* Unmountable partition*/
+#define SUN_FLAG_RONLY		0x10	/* Read only		*/
+};
+
+#define SUN_LABEL_SIZE		512
+
+#define SUN_LABEL_ID_SIZE	128
+#define SUN_VOLUME_ID_SIZE	8
+
+#define SUN_LABEL_VERSION	0x00000001
+#define SUN_LABEL_SANE		0x600ddeee
+#define SUN_NUM_PARTITIONS	8
+
+struct sun_disk_label {
+	char			label_id[SUN_LABEL_ID_SIZE];
+	uint32_t			version;
+	char			volume_id[SUN_VOLUME_ID_SIZE];
+	uint16_t			num_partitions;
+	struct sun_tag_flag	part_tags[SUN_NUM_PARTITIONS];
+	uint32_t			bootinfo[3];
+	uint32_t			sanity;
+	uint32_t			resv[10];
+	uint32_t			part_timestamps[SUN_NUM_PARTITIONS];
+	uint32_t			write_reinstruct;
+	uint32_t			read_reinstruct;
+	uint8_t			pad[148];
+	uint16_t			rpm;
+	uint16_t			pcyl;
+	uint16_t			apc;
+	uint16_t			resv1;
+	uint16_t			resv2;
+	uint16_t			intrlv;
+	uint16_t			ncyl;
+	uint16_t			acyl;
+	uint16_t			nhead;
+	uint16_t			nsect;
+	uint16_t			resv3;
+	uint16_t			resv4;
+	struct sun_partition	partitions[SUN_NUM_PARTITIONS];
+	uint16_t			magic;
+	uint16_t			cksum;
+};
+
+#define SUN_LABEL_MAGIC		0xDABE
+#define SUN_LABEL_MAGIC_SWAPPED	0xBEDA
+#define sunlabel ((struct sun_disk_label *)MBRbuffer)
+
+/* fdisksunlabel.c */
+extern struct systypes sun_sys_types[];
+extern void guess_device_type(int fd);
+extern int check_sun_label(void);
+extern void sun_nolabel(void);
+extern void create_sunlabel(void);
+extern void sun_delete_partition(int i);
+extern int sun_change_sysid(int i, uint16_t sys);
+extern void sun_list_table(int xtra);
+extern void verify_sun(void);
+extern void add_sun_partition(int n, int sys);
+extern void sun_write_table(void);
+extern void sun_set_alt_cyl(void);
+extern void sun_set_ncyl(int cyl);
+extern void sun_set_xcyl(void);
+extern void sun_set_ilfact(void);
+extern void sun_set_rspeed(void);
+extern void sun_set_pcylcount(void);
+extern void toggle_sunflags(int i, uint16_t mask);
+extern int sun_get_sysid(int i);
+
+#endif /* FDISK_SUN_LABEL_H */
diff --git a/util-linux-ng-2.17.2/fdisk/gpt.c b/util-linux-ng-2.17.2/fdisk/gpt.c
new file mode 100644
index 0000000..ff659fd
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/gpt.c
@@ -0,0 +1,215 @@
+/*
+ *
+ * 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
+ *
+ *
+ * GPT (GUID Partition Table) signature detection. Based on libparted and
+ * util-linux/partx.
+ *
+ * Warning: this code doesn't do all GPT checks (CRC32, Protective MBR, ..).
+ *          It's really GPT signature detection only.
+ *
+ * Copyright (C) 2007 Karel Zak <kzak@redhat.com>
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/utsname.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "gpt.h"
+#include "blkdev.h"
+#include "bitops.h"
+
+#define GPT_HEADER_SIGNATURE 0x5452415020494645LL
+#define GPT_PRIMARY_PARTITION_TABLE_LBA 1
+
+typedef struct {
+        uint32_t time_low;
+        uint16_t time_mid;
+        uint16_t time_hi_and_version;
+        uint8_t  clock_seq_hi_and_reserved;
+        uint8_t  clock_seq_low;
+        uint8_t  node[6];
+} /* __attribute__ ((packed)) */ efi_guid_t;
+/* commented out "__attribute__ ((packed))" to work around gcc bug (fixed
+ * in gcc3.1): __attribute__ ((packed)) breaks addressing on initialized
+ * data.  It turns out we don't need it in this case, so it doesn't break
+ * anything :)
+ */
+
+typedef struct _GuidPartitionTableHeader_t {
+	uint64_t Signature;
+	uint32_t Revision;
+	uint32_t HeaderSize;
+	uint32_t HeaderCRC32;
+	uint32_t Reserved1;
+	uint64_t MyLBA;
+	uint64_t AlternateLBA;
+	uint64_t FirstUsableLBA;
+	uint64_t LastUsableLBA;
+	efi_guid_t DiskGUID;
+	uint64_t PartitionEntryLBA;
+	uint32_t NumberOfPartitionEntries;
+	uint32_t SizeOfPartitionEntry;
+	uint32_t PartitionEntryArrayCRC32;
+	uint8_t Reserved2[512 - 92];
+} __attribute__ ((packed)) GuidPartitionTableHeader_t;
+
+static int
+_get_sector_size (int fd)
+{
+	int sector_size;
+
+	if (blkdev_get_sector_size(fd, &sector_size) == -1)
+		return DEFAULT_SECTOR_SIZE;
+	return sector_size;
+}
+
+static uint64_t
+_get_num_sectors(int fd)
+{
+	unsigned long long bytes=0;
+
+	if (blkdev_get_size(fd, &bytes) == -1)
+		return 0;
+	return bytes / _get_sector_size(fd);
+}
+
+static uint64_t
+last_lba(int fd)
+{
+	int rc;
+	uint64_t sectors = 0;
+	struct stat s;
+
+	memset(&s, 0, sizeof (s));
+	rc = fstat(fd, &s);
+	if (rc == -1)
+	{
+		fprintf(stderr, "last_lba() could not stat: %s\n",
+			strerror(errno));
+		return 0;
+	}
+	if (S_ISBLK(s.st_mode))
+		sectors = _get_num_sectors(fd);
+	else if (S_ISREG(s.st_mode))
+		sectors = s.st_size >> _get_sector_size(fd);
+	else
+	{
+		fprintf(stderr,
+			"last_lba(): I don't know how to handle files with mode %o\n",
+			s.st_mode);
+		sectors = 1;
+	}
+	return sectors - 1;
+}
+
+static ssize_t
+read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
+{
+	int sector_size = _get_sector_size(fd);
+	off_t offset = lba * sector_size;
+
+	lseek(fd, offset, SEEK_SET);
+	return read(fd, buffer, bytes);
+}
+
+static GuidPartitionTableHeader_t *
+alloc_read_gpt_header(int fd, uint64_t lba)
+{
+	GuidPartitionTableHeader_t *gpt =
+		(GuidPartitionTableHeader_t *) malloc(sizeof (GuidPartitionTableHeader_t));
+	if (!gpt)
+		return NULL;
+	memset(gpt, 0, sizeof (*gpt));
+	if (!read_lba(fd, lba, gpt, sizeof (GuidPartitionTableHeader_t)))
+	{
+		free(gpt);
+		return NULL;
+	}
+	return gpt;
+}
+
+static int
+gpt_check_signature(int fd, uint64_t lba)
+{
+	GuidPartitionTableHeader_t *gpt;
+	int res=0;
+
+	if ((gpt = alloc_read_gpt_header(fd, lba)))
+	{
+		if (gpt->Signature == cpu_to_le64(GPT_HEADER_SIGNATURE))
+			res = 1;
+		free(gpt);
+	}
+	return res;
+}
+
+/* returns:
+ *	0 not found GPT
+ *	1 for valid primary GPT header
+ *	2 for valid alternative GPT header
+ */
+int
+gpt_probe_signature_fd(int fd)
+{
+	int res = 0;
+
+	/* check primary GPT header */
+	if (gpt_check_signature(fd, GPT_PRIMARY_PARTITION_TABLE_LBA))
+		res = 1;
+	else
+	{
+		/* check alternative GPT header */
+		uint64_t lastlba = last_lba(fd);
+		if (gpt_check_signature(fd, lastlba))
+			res = 2;
+	}
+	return res;
+}
+
+int
+gpt_probe_signature_devname(char *devname)
+{
+	int res, fd;
+	if ((fd = open(devname, O_RDONLY)) < 0)
+		return 0;
+	res = gpt_probe_signature_fd(fd);
+	close(fd);
+	return res;
+}
+
+#ifdef GPT_TEST_MAIN
+int
+main(int argc, char **argv)
+{
+	if (argc!=2)
+	{
+		fprintf(stderr, "usage: %s <dev>\n", argv[0]);
+		exit(EXIT_FAILURE);
+	}
+	if (gpt_probe_signature_devname(argv[1]))
+		printf("GPT (GUID Partition Table) detected on %s\n", argv[1]);
+	exit(EXIT_SUCCESS);
+}
+#endif
diff --git a/util-linux-ng-2.17.2/fdisk/gpt.h b/util-linux-ng-2.17.2/fdisk/gpt.h
new file mode 100644
index 0000000..e57c24a
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/gpt.h
@@ -0,0 +1,8 @@
+#ifndef FDISK_GPT_H
+#define FDISK_GPT_H
+
+extern int gpt_probe_signature_fd(int fd);
+extern int gpt_probe_signature_devname(char *devname);
+
+#endif /* FDISK_GPT_H */
+
diff --git a/util-linux-ng-2.17.2/fdisk/i386_sys_types.c b/util-linux-ng-2.17.2/fdisk/i386_sys_types.c
new file mode 100644
index 0000000..e37ec51
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/i386_sys_types.c
@@ -0,0 +1,109 @@
+/* DOS partition types */
+#include "common.h"
+#include "nls.h"
+
+struct systypes i386_sys_types[] = {
+	{0x00, N_("Empty")},
+	{0x01, N_("FAT12")},
+	{0x02, N_("XENIX root")},
+	{0x03, N_("XENIX usr")},
+	{0x04, N_("FAT16 <32M")},
+	{0x05, N_("Extended")},		/* DOS 3.3+ extended partition */
+	{0x06, N_("FAT16")},		/* DOS 16-bit >=32M */
+	{0x07, N_("HPFS/NTFS")},	/* OS/2 IFS, eg, HPFS or NTFS or QNX */
+	{0x08, N_("AIX")},		/* AIX boot (AIX -- PS/2 port) or SplitDrive */
+	{0x09, N_("AIX bootable")},	/* AIX data or Coherent */
+	{0x0a, N_("OS/2 Boot Manager")},/* OS/2 Boot Manager */
+	{0x0b, N_("W95 FAT32")},
+	{0x0c, N_("W95 FAT32 (LBA)")},/* LBA really is `Extended Int 13h' */
+	{0x0e, N_("W95 FAT16 (LBA)")},
+	{0x0f, N_("W95 Ext'd (LBA)")},
+	{0x10, N_("OPUS")},
+	{0x11, N_("Hidden FAT12")},
+	{0x12, N_("Compaq diagnostics")},
+	{0x14, N_("Hidden FAT16 <32M")},
+	{0x16, N_("Hidden FAT16")},
+	{0x17, N_("Hidden HPFS/NTFS")},
+	{0x18, N_("AST SmartSleep")},
+	{0x1b, N_("Hidden W95 FAT32")},
+	{0x1c, N_("Hidden W95 FAT32 (LBA)")},
+	{0x1e, N_("Hidden W95 FAT16 (LBA)")},
+	{0x24, N_("NEC DOS")},
+	{0x39, N_("Plan 9")},
+	{0x3c, N_("PartitionMagic recovery")},
+	{0x40, N_("Venix 80286")},
+	{0x41, N_("PPC PReP Boot")},
+	{0x42, N_("SFS")},
+	{0x4d, N_("QNX4.x")},
+	{0x4e, N_("QNX4.x 2nd part")},
+	{0x4f, N_("QNX4.x 3rd part")},
+	{0x50, N_("OnTrack DM")},
+	{0x51, N_("OnTrack DM6 Aux1")},	/* (or Novell) */
+	{0x52, N_("CP/M")},		/* CP/M or Microport SysV/AT */
+	{0x53, N_("OnTrack DM6 Aux3")},
+	{0x54, N_("OnTrackDM6")},
+	{0x55, N_("EZ-Drive")},
+	{0x56, N_("Golden Bow")},
+	{0x5c, N_("Priam Edisk")},
+	{0x61, N_("SpeedStor")},
+	{0x63, N_("GNU HURD or SysV")},	/* GNU HURD or Mach or Sys V/386 (such as ISC UNIX) */
+	{0x64, N_("Novell Netware 286")},
+	{0x65, N_("Novell Netware 386")},
+	{0x70, N_("DiskSecure Multi-Boot")},
+	{0x75, N_("PC/IX")},
+	{0x80, N_("Old Minix")},	/* Minix 1.4a and earlier */
+	{0x81, N_("Minix / old Linux")},/* Minix 1.4b and later */
+	{0x82, N_("Linux swap / Solaris")},
+	{0x83, N_("Linux")},
+	{0x84, N_("OS/2 hidden C: drive")},
+	{0x85, N_("Linux extended")},
+	{0x86, N_("NTFS volume set")},
+	{0x87, N_("NTFS volume set")},
+	{0x88, N_("Linux plaintext")},
+	{0x8e, N_("Linux LVM")},
+	{0x93, N_("Amoeba")},
+	{0x94, N_("Amoeba BBT")},	/* (bad block table) */
+	{0x9f, N_("BSD/OS")},		/* BSDI */
+	{0xa0, N_("IBM Thinkpad hibernation")},
+	{0xa5, N_("FreeBSD")},		/* various BSD flavours */
+	{0xa6, N_("OpenBSD")},
+	{0xa7, N_("NeXTSTEP")},
+	{0xa8, N_("Darwin UFS")},
+	{0xa9, N_("NetBSD")},
+	{0xab, N_("Darwin boot")},
+	{0xaf, N_("HFS / HFS+")},
+	{0xb7, N_("BSDI fs")},
+	{0xb8, N_("BSDI swap")},
+	{0xbb, N_("Boot Wizard hidden")},
+	{0xbe, N_("Solaris boot")},
+	{0xbf, N_("Solaris")},
+	{0xc1, N_("DRDOS/sec (FAT-12)")},
+	{0xc4, N_("DRDOS/sec (FAT-16 < 32M)")},
+	{0xc6, N_("DRDOS/sec (FAT-16)")},
+	{0xc7, N_("Syrinx")},
+	{0xda, N_("Non-FS data")},
+	{0xdb, N_("CP/M / CTOS / ...")},/* CP/M or Concurrent CP/M or
+					   Concurrent DOS or CTOS */
+	{0xde, N_("Dell Utility")},	/* Dell PowerEdge Server utilities */
+	{0xdf, N_("BootIt")},		/* BootIt EMBRM */
+	{0xe1, N_("DOS access")},	/* DOS access or SpeedStor 12-bit FAT
+					   extended partition */
+	{0xe3, N_("DOS R/O")},		/* DOS R/O or SpeedStor */
+	{0xe4, N_("SpeedStor")},	/* SpeedStor 16-bit FAT extended
+					   partition < 1024 cyl. */
+	{0xeb, N_("BeOS fs")},
+	{0xee, N_("GPT")},		/* Intel EFI GUID Partition Table */
+	{0xef, N_("EFI (FAT-12/16/32)")},/* Intel EFI System Partition */
+	{0xf0, N_("Linux/PA-RISC boot")},/* Linux/PA-RISC boot loader */
+	{0xf1, N_("SpeedStor")},
+	{0xf4, N_("SpeedStor")},	/* SpeedStor large partition */
+	{0xf2, N_("DOS secondary")},	/* DOS 3.3+ secondary */
+	{0xfb, N_("VMware VMFS")},
+	{0xfc, N_("VMware VMKCORE")},	/* VMware kernel dump partition */
+	{0xfd, N_("Linux raid autodetect")},/* New (2.2.x) raid partition with
+					       autodetect using persistent
+					       superblock */
+	{0xfe, N_("LANstep")},		/* SpeedStor >1024 cyl. or LANstep */
+	{0xff, N_("BBT")},		/* Xenix Bad Block Table */
+	{ 0, 0 }
+};
diff --git a/util-linux-ng-2.17.2/fdisk/partitiontype.c b/util-linux-ng-2.17.2/fdisk/partitiontype.c
new file mode 100644
index 0000000..0ee44a0
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/partitiontype.c
@@ -0,0 +1,130 @@
+/*
+ * partitiontype.c, aeb, 2001-09-10
+ *
+ * call: partitiontype device
+ *
+ * either exit(1), or exit(0) with a single line of output
+ * DOS: sector 0 has a DOS signature.
+ */
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+
+struct aix_label {
+	unsigned int   magic;
+	/* more ... */
+};
+
+#define	AIX_LABEL_MAGIC		0xc9c2d4c1
+#define	AIX_LABEL_MAGIC_SWAPPED	0xc1d4c2c9
+
+struct bsd_label {
+	unsigned int   magic;
+	unsigned char  stuff[128];
+	unsigned int   magic2;
+	/* more ... */
+};
+
+#define BSD_LABEL_MAGIC         0x82564557
+
+struct sgi_label {
+	unsigned int   magic;
+	/* more ... */
+};
+
+#define	SGI_LABEL_MAGIC		0x0be5a941
+#define	SGI_LABEL_MAGIC_SWAPPED	0x41a9e50b
+
+struct sun_label {
+	unsigned char stuff[508];
+	unsigned short magic;      /* Magic number */
+	unsigned short csum;       /* Label xor'd checksum */
+};
+
+#define SUN_LABEL_MAGIC          0xDABE
+#define SUN_LABEL_MAGIC_SWAPPED  0xBEDA
+
+int
+main(int argc, char **argv) {
+	int fd, n;
+	unsigned char buf[1024];
+	struct aix_label *paix;
+	struct bsd_label *pbsd;
+	struct sgi_label *psgi;
+	struct sun_label *psun;
+
+	if (argc != 2) {
+		fprintf(stderr, "call: %s device\n", argv[0]);
+		exit(1);
+	}
+	fd = open(argv[1], O_RDONLY);
+	if (fd == -1) {
+		perror(argv[1]);
+		fprintf(stderr, "%s: cannot open device %s\n",
+			argv[0], argv[1]);
+		exit(1);
+	}
+	n = read(fd, buf, sizeof(buf));
+	if (n != sizeof(buf)) {
+		if (n == -1)
+			perror(argv[1]);
+		fprintf(stderr, "%s: cannot read device %s\n",
+			argv[0], argv[1]);
+		exit(1);
+	}
+
+	psun = (struct sun_label *)(&buf);
+	if (psun->magic == SUN_LABEL_MAGIC ||
+	    psun->magic == SUN_LABEL_MAGIC_SWAPPED) {
+		unsigned short csum = 0, *p;
+		int i;
+
+		for (p = (unsigned short *)(&buf);
+		     p < (unsigned short *)(&buf[512]); p++)
+			csum ^= *p;
+
+		if (csum == 0) {
+			printf("SUN\n");
+			exit(0);
+		}
+	}
+
+	pbsd = (struct bsd_label *)(&buf[512]);
+	if (pbsd->magic == BSD_LABEL_MAGIC &&
+	    pbsd->magic2 == BSD_LABEL_MAGIC) {
+		printf("BSD\n");
+		exit(0);
+	}
+
+	pbsd = (struct bsd_label *)(&buf[64]);
+	if (pbsd->magic == BSD_LABEL_MAGIC &&
+	    pbsd->magic2 == BSD_LABEL_MAGIC) {
+		printf("BSD\n");
+		exit(0);
+	}
+
+	paix = (struct aix_label *)(&buf);
+	if (paix->magic == AIX_LABEL_MAGIC ||
+	    paix->magic == AIX_LABEL_MAGIC_SWAPPED) {
+		printf("AIX\n");
+		exit(0);
+	}
+
+	psgi = (struct sgi_label *)(&buf);
+	if (psgi->magic == SGI_LABEL_MAGIC ||
+	    psgi->magic == SGI_LABEL_MAGIC_SWAPPED) {
+		printf("SGI\n");
+		exit(0);
+	}
+
+	if (buf[510] == 0x55 && buf[511] == 0xaa) {
+		printf("DOS\n");
+		exit(0);
+	}
+#if 0
+	fprintf(stderr, "%s: do not recognize any label on %s\n",
+		argv[0], argv[1]);
+#endif
+	exit(1);		/* unknown */
+}
+
diff --git a/util-linux-ng-2.17.2/fdisk/partname.c b/util-linux-ng-2.17.2/fdisk/partname.c
new file mode 100644
index 0000000..1fe3087
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/partname.c
@@ -0,0 +1,48 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "blkdev.h"
+#include "pathnames.h"
+#include "common.h"
+
+/*
+ * return partition name - uses static storage unless buf is supplied
+ */
+char *
+partname(char *dev, int pno, int lth) {
+	static char bufp[80];
+	char *p;
+	int w, wp;
+
+	w = strlen(dev);
+	p = "";
+
+	if (isdigit(dev[w-1]))
+		p = "p";
+
+	/* devfs kludge - note: fdisk partition names are not supposed
+	   to equal kernel names, so there is no reason to do this */
+	if (strcmp (dev + w - 4, "disc") == 0) {
+		w -= 4;
+		p = "part";
+	}
+
+	/* udev names partitions by appending -partN
+	   e.g. ata-SAMSUNG_SV8004H_0357J1FT712448-part1 */
+	if ((strncmp(dev, _PATH_DEV_BYID, strlen(_PATH_DEV_BYID)) == 0) ||
+	     strncmp(dev, _PATH_DEV_BYPATH, strlen(_PATH_DEV_BYPATH)) == 0) {
+	       p = "-part";
+	}
+
+	wp = strlen(p);
+
+	if (lth) {
+		snprintf(bufp, sizeof(bufp), "%*.*s%s%-2u",
+			 lth-wp-2, w, dev, p, pno);
+	} else {
+		snprintf(bufp, sizeof(bufp), "%.*s%s%-2u", w, dev, p, pno);
+	}
+	return bufp;
+}
+
diff --git a/util-linux-ng-2.17.2/fdisk/sfdisk.8 b/util-linux-ng-2.17.2/fdisk/sfdisk.8
new file mode 100644
index 0000000..a198247
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/sfdisk.8
@@ -0,0 +1,563 @@
+.\" Copyright 1995 Andries E. Brouwer (aeb@cwi.nl)
+.\" May be distributed under the GNU General Public License
+.\" The `DOS 6.x Warning' was taken from the old fdisk.8, which says
+.\" -- Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
+.\" -- May be distributed under the GNU General Public License
+.\" The `DRDOS Warning' was taken from a net post by Stephen Tweedie.
+.\"
+.TH SFDISK 8 "1 September 1995" "Linux" "Linux Programmer's Manual"
+.SH NAME
+sfdisk \- Partition table manipulator for Linux
+.SH SYNOPSIS
+.B sfdisk
+.RI [ options ]
+.I device
+.br
+.B sfdisk \-s
+.RI [ partition ]
+.SH DESCRIPTION
+.B sfdisk
+has four (main) uses: list the size of a partition, list the partitions
+on a device, check the partitions on a device, and - very dangerous -
+repartition a device.
+
+.B sfdisk
+doesn't understand GUID Partition Table (GPT) and
+it is not designed for large partitions. In particular case use more advanced GNU
+.BR parted (8).
+
+.SS "List Sizes"
+.BI "sfdisk \-s " partition
+gives the size of
+.I partition
+in blocks. This may be useful in connection with programs like
+.BR mkswap (8)
+or so. Here
+.I partition
+is usually something like
+.I /dev/hda1
+or
+.IR /dev/sdb12 ,
+but may also be an entire disk, like
+.IR /dev/xda .
+.br
+.RS
+.nf
+.if t .ft CW
+% sfdisk \-s /dev/hda9
+81599
+%
+.if t .ft R
+.fi
+.RE
+If the partition argument is omitted,
+.B sfdisk
+will list the sizes of all disks, and the total:
+.br
+.RS
+.nf
+.if t .ft CW
+% sfdisk \-s
+/dev/hda: 208896
+/dev/hdb: 1025136
+/dev/hdc: 1031063
+/dev/sda: 8877895
+/dev/sdb: 1758927
+total: 12901917 blocks
+%
+.if t .ft R
+.fi
+.RE
+
+.SS "List Partitions"
+The second type of invocation:
+.B sfdisk \-l
+.RB [ options ]
+.I device
+will list the partitions on this device.
+If the device argument is omitted, the partitions on all hard disks
+are listed.
+.br
+.nf
+.if t .ft CW
+% sfdisk \-l /dev/hdc
+
+Disk /dev/hdc: 16 heads, 63 sectors, 2045 cylinders
+Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0
+
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hdc1          0+    406     407\-   205096+  83  Linux native
+/dev/hdc2        407     813     407    205128   83  Linux native
+/dev/hdc3        814    2044    1231    620424   83  Linux native
+/dev/hdc4          0       \-       0         0    0  Empty
+%
+.if t .ft R
+.fi
+The trailing \- and + signs indicate that rounding has taken place,
+and that the actual value is slightly less (more).
+To see the exact values, ask for a listing with sectors as unit.
+
+.SS "Check partitions"
+The third type of invocation:
+.BI "sfdisk \-V " device
+will apply various consistency checks to the partition tables on
+.IR device .
+It prints `OK' or complains. The \-V option can be used together
+with \-l. In a shell script one might use
+.BI "sfdisk \-V \-q " device
+which only returns a status.
+
+.SS "Create partitions"
+The fourth type of invocation:
+.BI "sfdisk " device
+will cause
+.B sfdisk
+to read the specification for the desired partitioning of
+.I device
+from its standard input, and then to change the partition tables
+on that disk. Thus, it is possible to use
+.B sfdisk
+from a shell script. When
+.B sfdisk
+determines that its standard input is a terminal, it will be
+conversational; otherwise it will abort on any error.
+.LP
+BE EXTREMELY CAREFUL - ONE TYPING MISTAKE AND ALL YOUR DATA IS LOST
+.LP
+As a precaution, one can save the sectors changed by
+.BR sfdisk :
+.RS
+.nf
+.if t .ft CW
+% sfdisk /dev/hdd \-O hdd-partition-sectors.save
+\&...
+%
+.if t .ft R
+.fi
+.RE
+.LP
+Then, if you discover that you did something stupid before anything
+else has been written to disk, it may be possible to recover
+the old situation with
+.RS
+.nf
+.if t .ft CW
+% sfdisk /dev/hdd \-I hdd-partition-sectors.save
+%
+.if t .ft R
+.fi
+.RE
+.LP
+(This is not the same as saving the old partition table:
+a readable version of the old partition table can be saved
+using the \-d option. However, if you create logical partitions,
+the sectors describing them are located somewhere on disk,
+possibly on sectors that were not part of the partition table
+before. Thus, the information the \-O option saves is not a binary
+version of the output of \-d.)
+
+There are many options.
+
+.SH OPTIONS
+.TP
+.BR \-v " or " \-\-version
+Print version number of
+.B sfdisk
+and exit immediately.
+.TP
+.BR \-? " or " \-\-help
+Print a usage message and exit immediately.
+.TP
+.BR \-T " or " \-\-list\-types
+Print the recognized types (system Id's).
+.TP
+.BR \-s " or " \-\-show\-size
+List the size of a partition.
+.TP
+.BR \-g " or " \-\-show\-geometry
+List the kernel's idea of the geometry of the indicated disk(s).
+.TP
+.BR \-G " or " \-\-show\-pt\-geometry
+List the geometry of the indicated disks guessed by looking at
+the partition table.
+.TP
+.BR \-l " or " \-\-list
+List the partitions of a device.
+.TP
+.BR \-d
+Dump the partitions of a device in a format useful as input
+to sfdisk. For example,
+.br
+.nf
+.if t .ft CW
+    % sfdisk -d /dev/hda > hda.out
+    % sfdisk /dev/hda < hda.out
+.if t .ft R
+.fi
+will correct the bad last extended partition that the OS/2
+fdisk creates.
+.TP
+.BR \-V " or " \-\-verify
+Test whether partitions seem correct. (See above.)
+.TP
+.BR \-i " or " \-\-increment
+Number cylinders etc. starting from 1 instead of 0.
+.TP
+.BI \-N " number"
+Change only the single partition indicated. For example:
+.br
+.nf
+.if t .ft CW
+    % sfdisk /dev/hdb \-N5
+    ,,,*
+    %
+.if t .ft R
+.fi
+will make the fifth partition on /dev/hdb bootable (`active')
+and change nothing else. (Probably this fifth partition
+is called /dev/hdb5, but you are free to call it something else,
+like `/my_equipment/disks/2/5' or so).
+.TP
+.BI \-A " number"
+Make the indicated partition(s) active, and all others inactive.
+.TP
+.BI \-c "\fR or " \-\-id " number [Id]"
+If no Id argument given: print the partition Id of the indicated
+partition. If an Id argument is present: change the type (Id) of
+the indicated partition to the given value.
+This option has the two very long forms \-\-print\-id and \-\-change\-id.
+For example:
+.br
+.nf
+.if t .ft CW
+    % sfdisk --print-id /dev/hdb 5
+    6
+    % sfdisk --change-id /dev/hdb 5 83
+    OK
+.if t .ft R
+.fi
+first reports that /dev/hdb5 has Id 6, and then changes that into 83.
+.TP
+.BR \-uS " or " \-uB " or " \-uC " or " \-uM
+Accept or report in units of sectors (blocks, cylinders, megabytes,
+respectively). The default is cylinders, at least when the geometry
+is known.
+.TP
+.BR \-x " or " \-\-show\-extended
+Also list non-primary extended partitions on output,
+and expect descriptors for them on input.
+.TP
+.BI \-C " cylinders"
+Specify the number of cylinders, possibly overriding what the kernel thinks.
+.TP
+.BI \-H " heads"
+Specify the number of heads, possibly overriding what the kernel thinks.
+.TP
+.BI \-S " sectors"
+Specify the number of sectors, possibly overriding what the kernel thinks.
+.TP
+.BR \-f " or " \-\-force
+Do what I say, even if it is stupid.
+.TP
+.BR \-q " or " \-\-quiet
+Suppress warning messages.
+.TP
+.BR \-L " or " \-\-Linux
+Do not complain about things irrelevant for Linux.
+.TP
+.BR \-D " or " \-\-DOS
+For DOS-compatibility: waste a little space.
+(More precisely: if a partition cannot contain sector 0,
+e.g. because that is the MBR of the device, or contains
+the partition table of an extended partition, then
+.B sfdisk
+would make it start the next sector. However, when this
+option is given it skips to the start of the next track,
+wasting for example 33 sectors (in case of 34 sectors/track),
+just like certain versions of DOS do.)
+Certain Disk Managers and boot loaders (such as OSBS, but not
+LILO or the OS/2 Boot Manager) also live in this empty space,
+so maybe you want this option if you use one.
+.TP
+.BR \-E " or " \-\-DOS\-extended
+Take the starting sector numbers of "inner" extended partitions
+to be relative to the starting cylinder boundary of the outer one,
+(like some versions of DOS do) rather than to the starting sector
+(like Linux does).
+(The fact that there is a difference here means that one should
+always let extended partitions start at cylinder boundaries if
+DOS and Linux should interpret the partition table in the same way.
+Of course one can only know where cylinder boundaries are when
+one knows what geometry DOS will use for this disk.)
+.TP
+.BR \-\-IBM " or " \-\-leave\-last
+Certain IBM diagnostic programs assume that they can use the
+last cylinder on a disk for disk-testing purposes. If you think
+you might ever run such programs, use this option to tell
+.B sfdisk
+that it should not allocate the last cylinder.
+Sometimes the last cylinder contains a bad sector table.
+.TP
+.B \-n
+Go through all the motions, but do not actually write to disk.
+.TP
+.B \-R
+Only execute the BLKRRPART ioctl (to make the kernel re-read
+the partition table). This can be useful for checking in advance
+that the final BLKRRPART will be successful, and also when you
+changed the partition table `by hand' (e.g., using dd from a backup).
+If the kernel complains (`device busy for revalidation (usage = 2)')
+then something still uses the device, and you still have to unmount
+some file system, or say swapoff to some swap partition.
+.TP
+.B \-\-no\-reread
+When starting a repartitioning of a disk, sfdisk checks that this disk
+is not mounted, or in use as a swap device, and refuses to continue
+if it is. This option suppresses the test. (On the other hand, the \-f
+option would force sfdisk to continue even when this test fails.)
+.TP
+.BI \-O " file"
+Just before writing the new partition, output the sectors
+that are going to be overwritten to
+.I file
+(where hopefully
+.I file
+resides on another disk, or on a floppy).
+.TP
+.BI \-I " file"
+After destroying your filesystems with an unfortunate
+.B sfdisk
+command, you would have been able to restore the old situation
+if only you had preserved it using the \-O flag.
+
+.SH THEORY
+Block 0 of a disk (the Master Boot Record) contains among
+other things four partition descriptors. The partitions
+described here are called
+.I primary
+partitions.
+.LP
+A partition descriptor has 6 fields:
+.br
+.nf
+.RS
+struct partition {
+    unsigned char bootable;		/* 0 or 0x80 */
+    hsc begin_hsc;
+    unsigned char id;
+    hsc end_hsc;
+    unsigned int starting_sector;
+    unsigned int nr_of_sectors;
+}
+.RE
+.fi
+.LP
+The two hsc fields indicate head, sector and cylinder of the
+begin and the end of the partition. Since each hsc field only
+takes 3 bytes, only 24 bits are available, which does not
+suffice for big disks (say > 8GB). In fact, due to the wasteful
+representation (that uses a byte for the number of heads, which
+is typically 16), problems already start with 0.5GB.
+However Linux does not use these fields, and problems can arise
+only at boot time, before Linux has been started. For more
+details, see the
+.B lilo
+documentation.
+.LP
+Each partition has a type, its `Id', and if this type is 5 or f
+.IR "" "(`" "extended partition" "')"
+the starting sector of the partition
+again contains 4 partition descriptors. MSDOS only uses the
+first two of these: the first one an actual data partition,
+and the second one again an extended partition (or empty).
+In this way one gets a chain of extended partitions.
+Other operating systems have slightly different conventions.
+Linux also accepts type 85 as equivalent to 5 and f - this can be
+useful if one wants to have extended partitions under Linux past
+the 1024 cylinder boundary, without DOS FDISK hanging.
+(If there is no good reason, you should just use 5, which is
+understood by other systems.)
+.LP
+Partitions that are not primary or extended are called
+.IR logical .
+Often, one cannot boot from logical partitions (because the
+process of finding them is more involved than just looking
+at the MBR).
+Note that of an extended partition only the Id and the start
+are used. There are various conventions about what to write
+in the other fields. One should not try to use extended partitions
+for data storage or swap.
+
+.SH "INPUT FORMAT"
+.B sfdisk
+reads lines of the form
+.br
+.RS
+<start> <size> <id> <bootable> <c,h,s> <c,h,s>
+.RE
+where each line fills one partition descriptor.
+.LP
+Fields are separated by whitespace, or comma or semicolon possibly
+followed by whitespace; initial and trailing whitespace is ignored.
+Numbers can be octal, decimal or hexadecimal, decimal is default.
+When a field is absent or empty, a default value is used.
+.LP
+The <c,h,s> parts can (and probably should) be omitted -
+.B sfdisk
+computes them from <start> and <size> and the disk geometry
+as given by the kernel or specified using the \-H, \-S, \-C flags.
+.LP
+Bootable is specified as [*|\-], with as default not-bootable.
+(The value of this field is irrelevant for Linux - when Linux
+runs it has been booted already - but might play a role for
+certain boot loaders and for other operating systems.
+For example, when there are several primary DOS partitions,
+DOS assigns C: to the first among these that is bootable.)
+.LP
+Id is given in hex, without the 0x prefix, or is [E|S|L|X], where
+L (LINUX_NATIVE (83)) is the default, S is LINUX_SWAP (82), E
+is EXTENDED_PARTITION (5), and X is LINUX_EXTENDED (85).
+.LP
+The default value of start is the first nonassigned sector/cylinder/...
+.LP
+The default value of size is as much as possible (until next
+partition or end-of-disk).
+.LP
+However, for the four partitions inside an extended partition,
+the defaults are: Linux partition, Extended partition, Empty, Empty.
+.LP
+But when the \-N option (change a single partition only) is given,
+the default for each field is its previous value.
+
+.SH EXAMPLE
+The command
+.RS
+.nf
+.if t .ft CW
+sfdisk /dev/hdc << EOF
+0,407
+,407
+;
+;
+EOF
+.if t .ft R
+.fi
+.RE
+will partition /dev/hdc just as indicated above.
+
+The command
+.RS
+.nf
+.if t .ft CW
+sfdisk /dev/hdb << EOF
+,3,L
+,60,L
+,19,S
+,,E
+,130,L
+,130,L
+,130,L
+,,L
+EOF
+.if t .ft R
+.fi
+.RE
+will partition /dev/hdb into two Linux partitions of 3 and 60
+cylinders, a swap space of 19 cylinders, and an extended partition
+covering the rest. Inside the extended partition there are four
+Linux logical partitions, three of 130 cylinders and one
+covering the rest.
+
+With the \-x option, the number of input lines must be a multiple of 4:
+you have to list the two empty partitions that you never want
+using two blank lines. Without the \-x option, you give one line
+for the partitions inside a extended partition, instead of four,
+and terminate with end-of-file (^D).
+(And
+.B sfdisk
+will assume that your input line represents the first of four,
+that the second one is extended, and the 3rd and 4th are empty.)
+
+.SH "DOS 6.x WARNING"
+
+The DOS 6.x FORMAT command looks for some information in the first
+sector of the data area of the partition, and treats this information
+as more reliable than the information in the partition table.  DOS
+FORMAT expects DOS FDISK to clear the first 512 bytes of the data area
+of a partition whenever a size change occurs.  DOS FORMAT will look at
+this extra information even if the /U flag is given -- we consider
+this a bug in DOS FORMAT and DOS FDISK.
+.LP
+The bottom line is that if you use sfdisk to change the size of a
+DOS partition table entry, then you must also use
+.B dd
+to zero the first 512 bytes of that partition before using DOS FORMAT to
+format the partition.  For example, if you were using sfdisk to make a DOS
+partition table entry for /dev/hda1, then (after exiting sfdisk and
+rebooting Linux so that the partition table information is valid) you
+would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero
+the first 512 bytes of the partition.
+.B BE EXTREMELY CAREFUL
+if you use the
+.B dd
+command, since a small typo can make all of the data on your disk useless.
+
+For best results, you should always use an OS-specific partition table
+program.  For example, you should make DOS partitions with the DOS FDISK
+program and Linux partitions with the Linux sfdisk program.
+
+.SH "DRDOS WARNINGS"
+
+Stephen Tweedie reported (930515): `Most reports of superblock
+corruption turn out to be due to bad partitioning, with one filesystem
+overrunning the start of the next and corrupting its superblock.
+I have even had this problem with the supposedly-reliable DRDOS.  This
+was quite possibly due to DRDOS-6.0's FDISK command.  Unless I created
+a blank track or cylinder between the DRDOS partition and the
+immediately following one, DRDOS would happily stamp all over the
+start of the next partition.  Mind you, as long as I keep a little
+free disk space after any DRDOS partition, I don't have any other
+problems with the two coexisting on the one drive.'
+
+A. V. Le Blanc writes in README.efdisk: `Dr. DOS 5.0 and 6.0 has been
+reported to have problems cooperating with Linux, and with this version
+of efdisk in particular.  This efdisk sets the system type
+to hexadecimal 81.  Dr. DOS seems to confuse
+this with hexadecimal 1, a DOS code.  If you use Dr. DOS, use the
+efdisk command 't' to change the system code of any Linux partitions
+to some number less than hexadecimal 80; I suggest 41 and 42 for
+the moment.'
+
+A. V. Le Blanc writes in his README.fdisk: `DR-DOS 5.0 and 6.0
+are reported to have difficulties with partition ID codes of 80 or more.
+The Linux `fdisk' used to set the system type
+of new partitions to hexadecimal 81.  DR-DOS seems to confuse this with
+hexadecimal 1, a DOS code.  The values 82 for swap and 83 for file
+systems should not cause problems with DR-DOS.  If they do, you may use
+the `fdisk' command `t' to change the system code of any Linux
+partitions to some number less than hexadecimal 80; I suggest 42 and 43
+for the moment.'
+
+In fact, it seems that only 4 bits are significant for the DRDOS FDISK,
+so that for example 11 and 21 are listed as DOS 2.0. However, DRDOS
+itself seems to use the full byte. I have not been able to reproduce
+any corruption with DRDOS or its fdisk.
+
+.SH BUGS
+There are too many options.
+.LP
+There is no support for non-DOS partition types.
+
+.\" .SH AUTHOR
+.\" A. E. Brouwer (aeb@cwi.nl)
+.\"
+.SH "SEE ALSO"
+.BR cfdisk (8),
+.BR fdisk (8),
+.BR mkfs (8),
+.BR parted (8),
+.BR partprobe (8),
+.BR kpartx (8)
+.SH AVAILABILITY
+The sfdisk command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/fdisk/sfdisk.c b/util-linux-ng-2.17.2/fdisk/sfdisk.c
new file mode 100644
index 0000000..6432b25
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/sfdisk.c
@@ -0,0 +1,3111 @@
+/*
+ * sfdisk version 3.0 - aeb - 950813
+ *
+ * Copyright (C) 1995  Andries E. Brouwer (aeb@cwi.nl)
+ *
+ * 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 1
+ * or (at your option) any later version.
+ *
+ * A.V. Le Blanc (LeBlanc@mcc.ac.uk) wrote Linux fdisk 1992-1994,
+ * patched by various people (faith@cs.unc.edu, martin@cs.unc.edu,
+ * leisner@sdsp.mc.xerox.com, esr@snark.thyrsus.com, aeb@cwi.nl)
+ * 1993-1995, with version numbers (as far as I have seen) 0.93 - 2.0e.
+ * This program had (head,sector,cylinder) as basic unit, and was
+ * (therefore) broken in several ways for the use on larger disks -
+ * for example, my last patch (from 2.0d to 2.0e) was required
+ * to allow a partition to cross cylinder 8064, and to write an
+ * extended partition past the 4GB mark.
+ *
+ * The current program is a rewrite from scratch, and I started a
+ * version numbering at 3.0.
+ * 	Andries Brouwer, aeb@cwi.nl, 950813
+ *
+ * Well, a good user interface is still lacking. On the other hand,
+ * many configurations cannot be handled by any other fdisk.
+ * I changed the name to sfdisk to prevent confusion. - aeb, 970501
+ *
+ * Changes:
+ * 19990319 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> - i18n
+ * 20040428 - Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com> - added PACKED
+ * 20040824 - David A. Wheeler <dwheeler@dwheeler.com> - warnings to stderr
+ */
+
+#define PROGNAME "sfdisk"
+
+#include <stdio.h>
+#include <stdlib.h>		/* atoi, free */
+#include <stdarg.h>		/* varargs */
+#include <unistd.h>		/* read, write */
+#include <fcntl.h>		/* O_RDWR */
+#include <errno.h>		/* ERANGE */
+#include <string.h>		/* strchr(), strrchr() */
+#include <ctype.h>
+#include <getopt.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/utsname.h>
+
+#include "c.h"
+#include "nls.h"
+#include "blkdev.h"
+#include "linux_version.h"
+#include "common.h"
+#include "wholedisk.h"
+#include "gpt.h"
+
+/*
+ * Table of contents:
+ *  A. About seeking
+ *  B. About sectors
+ *  C. About heads, sectors and cylinders
+ *  D. About system Ids
+ *  E. About partitions
+ *  F. The standard input
+ *  G. The command line
+ *  H. Listing the current situation
+ *  I. Writing the new situation
+ */
+int exit_status = 0;
+
+int force = 0;		/* 1: do what I say, even if it is stupid ... */
+int quiet = 0;		/* 1: suppress all warnings */
+/* IA-64 gcc spec file currently does -DLinux... */
+#undef Linux
+int Linux = 0;		/* 1: suppress warnings irrelevant for Linux */
+int DOS = 0;		/* 1: shift extended partitions by #sectors, not 1 */
+int DOS_extended = 0;	/* 1: use starting cylinder boundary of extd partn */
+int dump = 0;           /* 1: list in a format suitable for later input */
+int verify = 0;         /* 1: check that listed partition is reasonable */
+int no_write = 0;	/* 1: do not actually write to disk */
+int no_reread = 0;	/* 1: skip the BLKRRPART ioctl test at startup */
+int leave_last = 0;	/* 1: don't allocate the last cylinder */
+int opt_list = 0;
+char *save_sector_file = NULL;
+char *restore_sector_file = NULL;
+
+static void
+do_warn(char *s, ...) {
+    va_list p;
+
+    va_start(p, s);
+    fflush(stdout);
+    vfprintf(stderr, s, p);
+    fflush(stderr);
+    va_end(p);
+}
+
+static void
+warn(char *s, ...) {
+    va_list p;
+
+    va_start(p, s);
+    if (!quiet) {
+	fflush(stdout);
+	vfprintf(stderr, s, p);
+	fflush(stderr);
+    }
+    va_end(p);
+}
+
+static void
+error(char *s, ...) {
+    va_list p;
+
+    va_start(p, s);
+    fflush(stdout);
+    fprintf(stderr, "\n" PROGNAME ": ");
+    vfprintf(stderr, s, p);
+    fflush(stderr);
+    va_end(p);
+}
+
+static void
+fatal(char *s, ...) {
+    va_list p;
+
+    va_start(p, s);
+    fflush(stdout);
+    fprintf(stderr, "\n" PROGNAME ": ");
+    vfprintf(stderr, s, p);
+    fflush(stderr);
+    va_end(p);
+    exit(1);
+}
+
+/*
+ * arm needs PACKED - use it everywhere?
+ */
+#if defined(__GNUC__) && (defined(__arm__) || defined(__alpha__))
+# define PACKED __attribute__ ((packed))
+#else
+# define PACKED
+#endif
+
+/*
+ *  A. About seeking
+ */
+
+/*
+ * sseek: seek to specified sector - return 0 on failure
+ *
+ * Note: we use 512-byte sectors here, irrespective of the hardware ss.
+ */
+
+static int
+sseek(char *dev, unsigned int fd, unsigned long s) {
+    off_t in, out;
+    in = ((off_t) s << 9);
+    out = 1;
+
+    if ((out = lseek(fd, in, SEEK_SET)) != in) {
+	perror("lseek");
+	error(_("seek error on %s - cannot seek to %lu\n"), dev, s);
+	return 0;
+    }
+
+    if (in != out) {
+	error(_("seek error: wanted 0x%08x%08x, got 0x%08x%08x\n"),
+	       (unsigned int)(in>>32), (unsigned int)(in & 0xffffffff),
+	       (unsigned int)(out>>32), (unsigned int)(out & 0xffffffff));
+	return 0;
+    }
+    return 1;
+}
+
+/*
+ *  B. About sectors
+ */
+
+/*
+ * We preserve all sectors read in a chain - some of these will
+ * have to be modified and written back.
+ */
+struct sector {
+    struct sector *next;
+    unsigned long sectornumber;
+    int to_be_written;
+    char data[512];
+} *sectorhead;
+
+static void
+free_sectors(void) {
+    struct sector *s;
+
+    while (sectorhead) {
+	s = sectorhead;
+	sectorhead = s->next;
+	free(s);
+    }
+}
+
+static struct sector *
+get_sector(char *dev, int fd, unsigned long sno) {
+    struct sector *s;
+
+    for(s = sectorhead; s; s = s->next)
+	if (s->sectornumber == sno)
+	    return s;
+
+    if (!sseek(dev, fd, sno))
+	return 0;
+
+    if (!(s = (struct sector *) malloc(sizeof(struct sector))))
+	fatal(_("out of memory - giving up\n"));
+
+    if (read(fd, s->data, sizeof(s->data)) != sizeof(s->data)) {
+	if (errno)		/* 0 in case we read past end-of-disk */
+	    perror("read");
+	error(_("read error on %s - cannot read sector %lu\n"), dev, sno);
+	free(s);
+	return 0;
+    }
+
+    s->next = sectorhead;
+    sectorhead = s;
+    s->sectornumber = sno;
+    s->to_be_written = 0;
+
+    return s;
+}
+
+static int
+msdos_signature (struct sector *s) {
+    unsigned char *data = (unsigned char *)s->data;
+    if (data[510] == 0x55 && data[511] == 0xaa)
+	    return 1;
+    error(_("ERROR: sector %lu does not have an msdos signature\n"),
+	  s->sectornumber);
+    return 0;
+}
+
+static int
+write_sectors(char *dev, int fd) {
+    struct sector *s;
+
+    for (s = sectorhead; s; s = s->next)
+	if (s->to_be_written) {
+	    if (!sseek(dev, fd, s->sectornumber))
+		return 0;
+	    if (write(fd, s->data, sizeof(s->data)) != sizeof(s->data)) {
+		perror("write");
+		error(_("write error on %s - cannot write sector %lu\n"),
+		       dev, s->sectornumber);
+		return 0;
+	    }
+	    s->to_be_written = 0;
+	}
+    return 1;
+}
+
+static void
+ulong_to_chars(unsigned long u, char *uu) {
+    int i;
+
+    for(i=0; i<4; i++) {
+	uu[i] = (u & 0xff);
+	u >>= 8;
+    }
+}
+
+static unsigned long
+chars_to_ulong(unsigned char *uu) {
+    int i;
+    unsigned long u = 0;
+
+    for(i=3; i>=0; i--)
+	u = (u << 8) | uu[i];
+    return u;
+}
+
+static int
+save_sectors(char *dev, int fdin) {
+    struct sector *s;
+    char ss[516];
+    int fdout = -1;
+
+    fdout = open(save_sector_file, O_WRONLY | O_CREAT, 0444);
+    if (fdout < 0) {
+	perror(save_sector_file);
+	error(_("cannot open partition sector save file (%s)\n"),
+	       save_sector_file);
+	goto err;
+    }
+
+    for (s = sectorhead; s; s = s->next)
+	if (s->to_be_written) {
+	    ulong_to_chars(s->sectornumber, ss);
+	    if (!sseek(dev, fdin, s->sectornumber))
+		goto err;
+	    if (read(fdin, ss+4, 512) != 512) {
+		perror("read");
+		error(_("read error on %s - cannot read sector %lu\n"),
+		       dev, s->sectornumber);
+		goto err;
+	    }
+	    if (write(fdout, ss, sizeof(ss)) != sizeof(ss)) {
+		perror("write");
+		error(_("write error on %s\n"), save_sector_file);
+		goto err;
+	    }
+	}
+
+    close(fdout);
+    return 1;
+
+err:
+    if (fdout >= 0)
+	close(fdout);
+    return 0;
+}
+
+static void reread_disk_partition(char *dev, int fd);
+
+static int
+restore_sectors(char *dev) {
+    int fdin = -1, fdout = -1;
+    int ct;
+    struct stat statbuf;
+    char *ss0, *ss;
+    unsigned long sno;
+
+    if (stat(restore_sector_file, &statbuf) < 0) {
+	perror(restore_sector_file);
+	error(_("cannot stat partition restore file (%s)\n"),
+	       restore_sector_file);
+	goto err;
+    }
+    if (statbuf.st_size % 516) {
+	error(_("partition restore file has wrong size - not restoring\n"));
+	goto err;
+    }
+    if (!(ss = (char *) malloc(statbuf.st_size))) {
+	error(_("out of memory?\n"));
+	goto err;
+    }
+    fdin = open(restore_sector_file, O_RDONLY);
+    if (fdin < 0) {
+	perror(restore_sector_file);
+	error(_("cannot open partition restore file (%s)\n"),
+	       restore_sector_file);
+	goto err;
+    }
+    if (read(fdin, ss, statbuf.st_size) != statbuf.st_size) {
+	perror("read");
+	error(_("error reading %s\n"), restore_sector_file);
+	goto err;
+    }
+
+    fdout = open(dev, O_WRONLY);
+    if (fdout < 0) {
+	perror(dev);
+	error(_("cannot open device %s for writing\n"), dev);
+	goto err;
+    }
+
+    ss0 = ss;
+    ct = statbuf.st_size/516;
+    while(ct--) {
+	sno = chars_to_ulong((unsigned char *) ss);
+	if (!sseek(dev, fdout, sno))
+	  goto err;
+	if (write(fdout, ss+4, 512) != 512) {
+	    perror(dev);
+	    error(_("error writing sector %lu on %s\n"), sno, dev);
+	    goto err;
+	}
+	ss += 516;
+    }
+    free(ss0);
+
+    reread_disk_partition(dev, fdout);
+    close(fdin);
+
+    return 1;
+
+err:
+    if (fdin >= 0)
+	close(fdin);
+    if (fdout >= 0)
+	close(fdout);
+
+    return 0;
+}
+
+/*
+ *  C. About heads, sectors and cylinders
+ */
+
+/*
+ * <linux/hdreg.h> defines HDIO_GETGEO and
+ * struct hd_geometry {
+ *      unsigned char heads;
+ *      unsigned char sectors;
+ *      unsigned short cylinders;
+ *      unsigned long start;
+ * };
+ *
+ * For large disks g.cylinders is truncated, so we use BLKGETSIZE.
+ */
+
+/*
+ * We consider several geometries for a disk:
+ * B - the BIOS geometry, gotten from the kernel via HDIO_GETGEO
+ * F - the fdisk geometry
+ * U - the user-specified geometry
+ *
+ * 0 means unspecified / unknown
+ */
+struct geometry {
+	unsigned long long total_size;		/* in sectors */
+	unsigned long cylindersize;		/* in sectors */
+	unsigned long heads, sectors, cylinders;
+	unsigned long start;
+} B, F, U;
+
+static struct geometry
+get_geometry(char *dev, int fd, int silent) {
+    struct hd_geometry g;
+    unsigned long cyls;
+    unsigned long long sectors;
+    struct geometry R;
+
+#ifdef HDIO_GETGEO
+    if (ioctl(fd, HDIO_GETGEO, &g))
+#endif
+    {
+	g.heads = g.sectors = g.cylinders = g.start = 0;
+	if (!silent)
+	    do_warn(_("Disk %s: cannot get geometry\n"), dev);
+    }
+
+    R.start = g.start;
+    R.heads = g.heads;
+    R.sectors = g.sectors;
+    R.cylindersize = R.heads * R.sectors;
+    R.cylinders = 0;
+    R.total_size = 0;
+
+    if (blkdev_get_sectors(fd, &sectors) == -1) {
+	/* maybe an ordinary file */
+	struct stat s;
+
+	if (fstat(fd, &s) == 0 && S_ISREG(s.st_mode))
+	    R.total_size = (s.st_size >> 9);
+	else if (!silent)
+	    do_warn(_("Disk %s: cannot get size\n"), dev);
+    } else
+	    R.total_size = sectors;
+
+    if (R.cylindersize && R.total_size) {
+	    sectors /= R.cylindersize;
+	    cyls = sectors;
+	    if (cyls != sectors)
+		    cyls = ~0;
+	    R.cylinders = cyls;
+    }
+
+    return R;
+}
+
+static void
+get_cylindersize(char *dev, int fd, int silent) {
+    struct geometry R;
+
+    R = get_geometry(dev, fd, silent);
+
+    B.heads = (U.heads ? U.heads : R.heads ? R.heads : 255);
+    B.sectors = (U.sectors ? U.sectors : R.sectors ? R.sectors : 63);
+    B.cylinders = (U.cylinders ? U.cylinders : R.cylinders);
+
+    B.cylindersize = B.heads * B.sectors;
+    B.total_size = R.total_size;
+
+    if (B.cylinders == 0 && B.cylindersize != 0)
+	    B.cylinders = B.total_size / B.cylindersize;
+
+    if (R.start && !force) {
+	warn(
+	    _("Warning: start=%lu - this looks like a partition rather than\n"
+	      "the entire disk. Using fdisk on it is probably meaningless.\n"
+	      "[Use the --force option if you really want this]\n"), R.start);
+	exit(1);
+    }
+#if 0
+    if (R.heads && B.heads != R.heads)
+	warn(_("Warning: HDIO_GETGEO says that there are %lu heads\n"),
+	     R.heads);
+    if (R.sectors && B.sectors != R.sectors)
+	warn(_("Warning: HDIO_GETGEO says that there are %lu sectors\n"),
+	     R.sectors);
+    if (R.cylinders && B.cylinders != R.cylinders
+	    && B.cylinders < 65536 && R.cylinders < 65536)
+	warn(_("Warning: BLKGETSIZE/HDIO_GETGEO says that there are %lu cylinders\n"),
+	     R.cylinders);
+#endif
+
+    if (B.sectors > 63)
+      warn(_("Warning: unlikely number of sectors (%lu) - usually at most 63\n"
+	   "This will give problems with all software that uses C/H/S addressing.\n"),
+	   B.sectors);
+    if (!silent)
+      printf(_("\nDisk %s: %lu cylinders, %lu heads, %lu sectors/track\n"),
+	     dev, B.cylinders, B.heads, B.sectors);
+}
+
+typedef struct { unsigned char h,s,c; } PACKED chs; /* has some c bits in s */
+chs zero_chs = { 0,0,0 };
+
+typedef struct { unsigned long h,s,c; } longchs;
+longchs zero_longchs;
+
+static chs
+longchs_to_chs (longchs aa, struct geometry G) {
+    chs a;
+
+    if (aa.h < 256 && aa.s < 64 && aa.c < 1024) {
+	a.h = aa.h;
+	a.s = aa.s | ((aa.c >> 2) & 0xc0);
+	a.c = (aa.c & 0xff);
+    } else if (G.heads && G.sectors) {
+	a.h = G.heads - 1;
+	a.s = G.sectors | 0xc0;
+	a.c = 0xff;
+    } else
+        a = zero_chs;
+    return a;
+}
+
+static longchs
+chs_to_longchs (chs a) {
+    longchs aa;
+
+    aa.h = a.h;
+    aa.s = (a.s & 0x3f);
+    aa.c = (a.s & 0xc0);
+    aa.c = (aa.c << 2) + a.c;
+    return aa;
+}
+
+static longchs
+ulong_to_longchs (unsigned long sno, struct geometry G) {
+    longchs aa;
+
+    if (G.heads && G.sectors && G.cylindersize) {
+	aa.s = 1 + sno % G.sectors;
+	aa.h = (sno / G.sectors) % G.heads;
+	aa.c = sno / G.cylindersize;
+	return aa;
+    } else {
+	return zero_longchs;
+    }
+}
+
+static chs
+ulong_to_chs (unsigned long sno, struct geometry G) {
+    return longchs_to_chs(ulong_to_longchs(sno, G), G);
+}
+
+#if 0
+static unsigned long
+longchs_to_ulong (longchs aa, struct geometry G) {
+    return (aa.c*G.cylindersize + aa.h*G.sectors + aa.s - 1);
+}
+
+static unsigned long
+chs_to_ulong (chs a, struct geometry G) {
+    return longchs_to_ulong(chs_to_longchs(a), G);
+}
+#endif
+
+static int
+is_equal_chs (chs a, chs b) {
+    return (a.h == b.h && a.s == b.s && a.c == b.c);
+}
+
+static int
+chs_ok (chs a, char *v, char *w) {
+    longchs aa = chs_to_longchs(a);
+    int ret = 1;
+
+    if (is_equal_chs(a, zero_chs))
+      return 1;
+    if (B.heads && aa.h >= B.heads) {
+	warn(_("%s of partition %s has impossible value for head: "
+	     "%lu (should be in 0-%lu)\n"), w, v, aa.h, B.heads-1);
+	ret = 0;
+    }
+    if (B.sectors && (aa.s == 0 || aa.s > B.sectors)) {
+	warn(_("%s of partition %s has impossible value for sector: "
+	     "%lu (should be in 1-%lu)\n"), w, v, aa.s, B.sectors);
+	ret = 0;
+    }
+    if (B.cylinders && aa.c >= B.cylinders) {
+	warn(_("%s of partition %s has impossible value for cylinders: "
+	     "%lu (should be in 0-%lu)\n"), w, v, aa.c, B.cylinders-1);
+	ret = 0;
+    }
+    return ret;
+}
+
+/*
+ *  D. About system Ids
+ */
+
+#define EMPTY_PARTITION		0
+#define EXTENDED_PARTITION	5
+#define WIN98_EXTENDED		0x0f
+#define DM6_AUX1PARTITION	0x51
+#define DM6_AUX3PARTITION	0x53
+#define DM6_PARTITION		0x54
+#define EZD_PARTITION		0x55
+#define LINUX_SWAP              0x82
+#define LINUX_NATIVE	        0x83
+#define LINUX_EXTENDED		0x85
+#define BSD_PARTITION		0xa5
+#define NETBSD_PARTITION	0xa9
+
+/* List of partition types now in i386_sys_types.c */
+
+static const char *
+sysname(unsigned char type) {
+    struct systypes *s;
+
+    for (s = i386_sys_types; s->name; s++)
+      if (s->type == type)
+	return _(s->name);
+    return _("Unknown");
+}
+
+static void
+list_types(void) {
+    struct systypes *s;
+
+    printf(_("Id  Name\n\n"));
+    for (s = i386_sys_types; s->name; s++)
+      printf("%2x  %s\n", s->type, _(s->name));
+}
+
+static int
+is_extended(unsigned char type) {
+	return (type == EXTENDED_PARTITION
+		|| type == LINUX_EXTENDED
+		|| type == WIN98_EXTENDED);
+}
+
+static int
+is_bsd(unsigned char type) {
+	return (type == BSD_PARTITION || type == NETBSD_PARTITION);
+}
+
+/*
+ *  E. About partitions
+ */
+
+/* MS/DOS partition */
+
+struct partition {
+    unsigned char bootable;		/* 0 or 0x80 */
+    chs begin_chs;
+    unsigned char sys_type;
+    chs end_chs;
+    unsigned int start_sect;	/* starting sector counting from 0 */
+    unsigned int nr_sects;	/* nr of sectors in partition */
+} PACKED;
+
+/* Unfortunately, partitions are not aligned, and non-Intel machines
+   are unhappy with non-aligned integers. So, we need a copy by hand. */
+static int
+copy_to_int(unsigned char *cp) {
+    unsigned int m;
+
+    m = *cp++;
+    m += (*cp++ << 8);
+    m += (*cp++ << 16);
+    m += (*cp++ << 24);
+    return m;
+}
+
+static void
+copy_from_int(int m, char *cp) {
+    *cp++ = (m & 0xff); m >>= 8;
+    *cp++ = (m & 0xff); m >>= 8;
+    *cp++ = (m & 0xff); m >>= 8;
+    *cp++ = (m & 0xff);
+}
+
+static void
+copy_to_part(char *cp, struct partition *p) {
+    p->bootable = *cp++;
+    p->begin_chs.h = *cp++;
+    p->begin_chs.s = *cp++;
+    p->begin_chs.c = *cp++;
+    p->sys_type = *cp++;
+    p->end_chs.h = *cp++;
+    p->end_chs.s = *cp++;
+    p->end_chs.c = *cp++;
+    p->start_sect = copy_to_int((unsigned char *) cp);
+    p->nr_sects = copy_to_int((unsigned char *) cp+4);
+}
+
+static void
+copy_from_part(struct partition *p, char *cp) {
+    *cp++ = p->bootable;
+    *cp++ = p->begin_chs.h;
+    *cp++ = p->begin_chs.s;
+    *cp++ = p->begin_chs.c;
+    *cp++ = p->sys_type;
+    *cp++ = p->end_chs.h;
+    *cp++ = p->end_chs.s;
+    *cp++ = p->end_chs.c;
+    copy_from_int(p->start_sect, cp);
+    copy_from_int(p->nr_sects, cp+4);
+}
+
+/* Roughly speaking, Linux doesn't use any of the above fields except
+   for partition type, start sector and number of sectors. (However,
+   see also linux/drivers/scsi/fdomain.c.)
+   The only way partition type is used (in the kernel) is the comparison
+   for equality with EXTENDED_PARTITION (and these Disk Manager types). */
+
+struct part_desc {
+    unsigned long start;
+    unsigned long size;
+    unsigned long sector, offset; /* disk location of this info */
+    struct partition p;
+    struct part_desc *ep;	  /* extended partition containing this one */
+    int ptype;
+#define DOS_TYPE	0
+#define BSD_TYPE	1
+} zero_part_desc;
+
+static struct part_desc *
+outer_extended_partition(struct part_desc *p) {
+    while (p->ep)
+      p = p->ep;
+    return p;
+}
+
+static int
+is_parent(struct part_desc *pp, struct part_desc *p) {
+    while (p) {
+	if (pp == p)
+	  return 1;
+	p = p->ep;
+    }
+    return 0;
+}
+
+struct disk_desc {
+    struct part_desc partitions[512];
+    int partno;
+} oldp, newp;
+
+/* determine where on the disk this information goes */
+static void
+add_sector_and_offset(struct disk_desc *z) {
+    int pno;
+    struct part_desc *p;
+
+    for (pno = 0; pno < z->partno; pno++) {
+	p = &(z->partitions[pno]);
+	p->offset = 0x1be + (pno%4)*sizeof(struct partition);
+	p->sector = (p->ep ? p->ep->start : 0);
+    }
+}
+
+/* tell the kernel to reread the partition tables */
+static int
+reread_ioctl(int fd) {
+#ifdef BLKRRPART
+    if (ioctl(fd, BLKRRPART))
+#else
+    errno = ENOSYS;
+#endif
+    {
+	perror("BLKRRPART");
+
+	/* 2.6.8 returns EIO for a zero table */
+	if (errno == EBUSY)
+		return -1;
+    }
+    return 0;
+}
+
+static int
+is_blockdev(int fd) {
+    struct stat statbuf;
+
+    return(fstat(fd, &statbuf) == 0 && S_ISBLK(statbuf.st_mode));
+}
+
+/* reread after writing */
+static void
+reread_disk_partition(char *dev, int fd) {
+    printf(_("Re-reading the partition table ...\n"));
+    fflush(stdout);
+    sync();
+
+    if (reread_ioctl(fd) && is_blockdev(fd))
+      do_warn(_("The command to re-read the partition table failed.\n"
+	        "Run partprobe(8), kpartx(8) or reboot your system now,\n"
+	        "before using mkfs\n"));
+
+    if (fsync(fd) || close(fd)) {
+	perror(dev);
+	do_warn(_("Error closing %s\n"), dev);
+    }
+    printf("\n");
+}
+
+/* find Linux name of this partition, assuming that it will have a name */
+static int
+index_to_linux(int pno, struct disk_desc *z) {
+    int i, ct = 1;
+    struct part_desc *p = &(z->partitions[0]);
+    for (i=0; i<pno; i++,p++)
+	if (i < 4 || (p->size > 0 && !is_extended(p->p.sys_type)))
+	  ct++;
+    return ct;
+}
+
+static int
+linux_to_index(int lpno, struct disk_desc *z) {
+    int i, ct = 0;
+    struct part_desc *p = &(z->partitions[0]);
+    for (i=0; i<z->partno && ct < lpno; i++,p++)
+      if ((i < 4 || (p->size > 0 && !is_extended(p->p.sys_type)))
+	 && ++ct == lpno)
+	return i;
+    return -1;
+}
+
+static int
+asc_to_index(char *pnam, struct disk_desc *z) {
+    int pnum, pno;
+
+    if (*pnam == '#') {
+	pno = atoi(pnam+1);
+    } else {
+	pnum = atoi(pnam);
+	pno = linux_to_index(pnum, z);
+    }
+    if (!(pno >= 0 && pno < z->partno))
+      fatal(_("%s: no such partition\n"), pnam);
+    return pno;
+}
+
+/*
+ * List partitions - in terms of sectors, blocks or cylinders
+ */
+#define F_SECTOR   1
+#define F_BLOCK    2
+#define F_CYLINDER 3
+#define F_MEGABYTE 4
+
+int default_format = F_MEGABYTE;
+int specified_format = 0;
+int show_extended = 0;
+int one_only = 0;
+int one_only_pno;
+int increment = 0;
+
+static void
+set_format(char c) {
+    switch(c) {
+      default:
+	do_warn(_("unrecognized format - using sectors\n"));
+      case 'S': specified_format = F_SECTOR; break;
+      case 'B': specified_format = F_BLOCK; break;
+      case 'C': specified_format = F_CYLINDER; break;
+      case 'M': specified_format = F_MEGABYTE; break;
+    }
+}
+
+static unsigned long
+unitsize(int format) {
+    default_format = (B.cylindersize ? F_CYLINDER : F_MEGABYTE);
+    if (!format && !(format = specified_format))
+      format = default_format;
+
+    switch(format) {
+      default:
+      case F_CYLINDER:
+	if (B.cylindersize)
+	  return B.cylindersize;
+      case F_SECTOR:
+	return 1;
+      case F_BLOCK:
+	return 2;
+      case F_MEGABYTE:
+	return 2048;
+    }
+}
+
+static unsigned long
+get_disksize(int format) {
+    if (B.total_size && leave_last)
+	    /* don't use last cylinder (--leave-last option) */
+	    return (B.total_size - B.cylindersize) / unitsize(format);
+
+    return B.total_size / unitsize(format);
+}
+
+static void
+out_partition_header(char *dev, int format, struct geometry G) {
+    if (dump) {
+	printf("# partition table of %s\n", dev);
+	printf("unit: sectors\n\n");
+	return;
+    }
+
+    default_format = (G.cylindersize ? F_CYLINDER : F_MEGABYTE);
+    if (!format && !(format = specified_format))
+      format = default_format;
+
+    switch(format) {
+      default:
+	do_warn(_("unimplemented format - using %s\n"),
+	       G.cylindersize ? _("cylinders") : _("sectors"));
+      case F_CYLINDER:
+	if (G.cylindersize) {
+	  printf(_("Units = cylinders of %lu bytes, blocks of 1024 bytes"
+		 ", counting from %d\n\n"),
+		 G.cylindersize<<9, increment);
+	    printf(_("   Device Boot Start     End   #cyls    #blocks   Id  System\n"));
+	    break;
+	}
+	/* fall through */
+      case F_SECTOR:
+	printf(_("Units = sectors of 512 bytes, counting from %d\n\n"),
+	       increment);
+	printf(_("   Device Boot    Start       End   #sectors  Id  System\n"));
+	break;
+      case F_BLOCK:
+	printf(_("Units = blocks of 1024 bytes, counting from %d\n\n"),
+	       increment);
+	printf(_("   Device Boot   Start       End    #blocks   Id  System\n"));
+	break;
+      case F_MEGABYTE:
+	printf(_("Units = mebibytes of 1048576 bytes, blocks of 1024 bytes"
+	       ", counting from %d\n\n"), increment);
+	printf(_("   Device Boot Start   End    MiB    #blocks   Id  System\n"));
+	break;
+    }
+}
+
+static void
+out_rounddown(int width, unsigned long n, unsigned long unit, int inc) {
+    printf("%*lu", width, inc + n/unit);
+    if (unit != 1)
+      putchar((n % unit) ? '+' : ' ');
+    putchar(' ');
+}
+
+static void
+out_roundup(int width, unsigned long n, unsigned long unit, int inc) {
+    if (n == (unsigned long)(-1))
+      printf("%*s", width, "-");
+    else
+      printf("%*lu", width, inc + n/unit);
+    if (unit != 1)
+      putchar(((n+1) % unit) ? '-' : ' ');
+    putchar(' ');
+}
+
+static void
+out_roundup_size(int width, unsigned long n, unsigned long unit) {
+    printf("%*lu", width, (n+unit-1)/unit);
+    if (unit != 1)
+      putchar((n % unit) ? '-' : ' ');
+    putchar(' ');
+}
+
+static struct geometry
+get_fdisk_geometry_one(struct part_desc *p) {
+    struct geometry G;
+
+    memset(&G, 0, sizeof(struct geometry));
+    chs b = p->p.end_chs;
+    longchs bb = chs_to_longchs(b);
+    G.heads = bb.h+1;
+    G.sectors = bb.s;
+    G.cylindersize = G.heads*G.sectors;
+    return G;
+}
+
+static int
+get_fdisk_geometry(struct disk_desc *z) {
+    struct part_desc *p;
+    int pno, agree;
+    struct geometry G0, G;
+
+    memset(&G0, 0, sizeof(struct geometry));
+    agree = 0;
+    for (pno=0; pno < z->partno; pno++) {
+	p = &(z->partitions[pno]);
+	if (p->size != 0 && p->p.sys_type != 0) {
+	    G = get_fdisk_geometry_one(p);
+	    if (!G0.heads) {
+		G0 = G;
+		agree = 1;
+	    } else if (G.heads != G0.heads || G.sectors != G0.sectors) {
+		agree = 0;
+		break;
+	    }
+	}
+    }
+    F = (agree ? G0 : B);
+    return (F.sectors != B.sectors || F.heads != B.heads);
+}
+
+static void
+out_partition(char *dev, int format, struct part_desc *p,
+	      struct disk_desc *z, struct geometry G) {
+    unsigned long start, end, size;
+    int pno, lpno;
+
+    if (!format && !(format = specified_format))
+      format = default_format;
+
+    pno = p - &(z->partitions[0]); 	/* our index */
+    lpno = index_to_linux(pno, z); 	/* name of next one that has a name */
+    if (pno == linux_to_index(lpno, z))  /* was that us? */
+      printf("%s", partname(dev, lpno, 10));  /* yes */
+    else if (show_extended)
+      printf("    -     ");
+    else
+      return;
+    putchar(dump ? ':' : ' ');
+
+    start = p->start;
+    end = p->start + p->size - 1;
+    size = p->size;
+
+    if (dump) {
+	printf(" start=%9lu", start);
+	printf(", size=%9lu", size);
+	if (p->ptype == DOS_TYPE) {
+	    printf(", Id=%2x", p->p.sys_type);
+	    if (p->p.bootable == 0x80)
+		printf(", bootable");
+	}
+	printf("\n");
+	return;
+    }
+
+    if (p->ptype != DOS_TYPE || p->p.bootable == 0)
+      printf("   ");
+    else if (p->p.bootable == 0x80)
+      printf(" * ");
+    else
+      printf(" ? ");		/* garbage */
+
+    switch(format) {
+      case F_CYLINDER:
+	if (G.cylindersize) {
+	    out_rounddown(6, start, G.cylindersize, increment);
+	    out_roundup(6, end, G.cylindersize, increment);
+	    out_roundup_size(6, size, G.cylindersize);
+	    out_rounddown(9, size, 2, 0);
+	    break;
+	}
+	/* fall through */
+      default:
+      case F_SECTOR:
+	out_rounddown(9, start, 1, increment);
+	out_roundup(9, end, 1, increment);
+	out_rounddown(10, size, 1, 0);
+	break;
+      case F_BLOCK:
+#if 0
+	printf("%8lu,%3lu ",
+	       p->sector/2, ((p->sector & 1) ? 512 : 0) + p->offset);
+#endif
+	out_rounddown(8, start, 2, increment);
+	out_roundup(8, end, 2, increment);
+	out_rounddown(9, size, 2, 0);
+	break;
+      case F_MEGABYTE:
+	out_rounddown(5, start, 2048, increment);
+	out_roundup(5, end, 2048, increment);
+	out_roundup_size(5, size, 2048);
+	out_rounddown(9, size, 2, 0);
+	break;
+    }
+    if (p->ptype == DOS_TYPE) {
+	printf(" %2x  %s\n",
+	   p->p.sys_type, sysname(p->p.sys_type));
+    } else {
+	printf("\n");
+    }
+
+    /* Is chs as we expect? */
+    if (!quiet && p->ptype == DOS_TYPE) {
+	chs a, b;
+	longchs aa, bb;
+	a = (size ? ulong_to_chs(start,G) : zero_chs);
+	b = p->p.begin_chs;
+	aa = chs_to_longchs(a);
+	bb = chs_to_longchs(b);
+	if (a.s && !is_equal_chs(a, b))
+	  do_warn(_("\t\tstart: (c,h,s) expected (%ld,%ld,%ld) found (%ld,%ld,%ld)\n"),
+		 aa.c, aa.h, aa.s, bb.c, bb.h, bb.s);
+	a = (size ? ulong_to_chs(end,G) : zero_chs);
+	b = p->p.end_chs;
+	aa = chs_to_longchs(a);
+	bb = chs_to_longchs(b);
+	if (a.s && !is_equal_chs(a, b))
+	  do_warn(_("\t\tend: (c,h,s) expected (%ld,%ld,%ld) found (%ld,%ld,%ld)\n"),
+		 aa.c, aa.h, aa.s, bb.c, bb.h, bb.s);
+	if (G.cylinders && G.cylinders < 1024 && bb.c > G.cylinders)
+	  do_warn(_("partition ends on cylinder %ld, beyond the end of the disk\n"),
+	       bb.c);
+    }
+}
+
+static void
+out_partitions(char *dev, struct disk_desc *z) {
+    int pno, format = 0;
+
+    if (z->partno == 0)
+	do_warn(_("No partitions found\n"));
+    else {
+	if (get_fdisk_geometry(z) && !dump) {
+	    do_warn(
+	   _("Warning: The partition table looks like it was made\n"
+	     "  for C/H/S=*/%ld/%ld (instead of %ld/%ld/%ld).\n"
+	     "For this listing I'll assume that geometry.\n"),
+	   F.heads, F.sectors, B.cylinders, B.heads, B.sectors);
+	}
+
+	out_partition_header(dev, format, F);
+	for(pno=0; pno < z->partno; pno++) {
+	    out_partition(dev, format, &(z->partitions[pno]), z, F);
+	    if (show_extended && pno%4==3)
+	      printf("\n");
+	}
+    }
+}
+
+static int
+disj(struct part_desc *p, struct part_desc *q) {
+    return
+      ((p->start + p->size <= q->start)
+	|| (is_extended(p->p.sys_type)
+	    && q->start + q->size <= p->start + p->size));
+}
+
+static char *
+pnumber(struct part_desc *p, struct disk_desc *z) {
+    static char buf[20];
+    int this, next;
+    struct part_desc *p0 = &(z->partitions[0]);
+
+    this = index_to_linux(p-p0, z);
+    next = index_to_linux(p-p0+1, z);
+
+    if (next > this)
+      sprintf(buf, "%d", this);
+    else
+      sprintf(buf, "[%d]", this);
+    return buf;
+}
+
+static int
+partitions_ok(struct disk_desc *z) {
+    struct part_desc *partitions = &(z->partitions[0]), *p, *q;
+    int partno = z->partno;
+
+#define PNO(p) pnumber(p, z)
+
+    /* Have at least 4 partitions been defined? */
+    if (partno < 4) {
+	 if (!partno)
+	      fatal(_("no partition table present.\n"));
+	 else
+	      fatal(_("strange, only %d partitions defined.\n"), partno);
+	 return 0;
+    }
+
+    /* Are the partitions of size 0 marked empty?
+       And do they have start = 0? And bootable = 0? */
+    for (p = partitions; p - partitions < partno; p++)
+      if (p->size == 0) {
+	  if (p->p.sys_type != EMPTY_PARTITION)
+	    warn(_("Warning: partition %s has size 0 but is not marked Empty\n"),
+		 PNO(p));
+	  else if (p->p.bootable != 0)
+	    warn(_("Warning: partition %s has size 0 and is bootable\n"),
+		 PNO(p));
+	  else if (p->p.start_sect != 0)
+	    warn(_("Warning: partition %s has size 0 and nonzero start\n"),
+		 PNO(p));
+	  /* all this is probably harmless, no error return */
+      }
+
+    /* Are the logical partitions contained in their extended partitions? */
+    for (p = partitions+4; p < partitions+partno; p++)
+      if (p->ptype == DOS_TYPE)
+      if (p->size && !is_extended(p->p.sys_type)) {
+	  q = p->ep;
+	  if (p->start < q->start || p->start + p->size > q->start + q->size) {
+	      warn(_("Warning: partition %s "), PNO(p));
+	      warn(_("is not contained in partition %s\n"), PNO(q));
+	      return 0;
+	  }
+      }
+
+    /* Are the data partitions mutually disjoint? */
+    for (p = partitions; p < partitions+partno; p++)
+      if (p->size && !is_extended(p->p.sys_type))
+	for (q = p+1; q < partitions+partno; q++)
+	  if (q->size && !is_extended(q->p.sys_type))
+	    if (!((p->start > q-> start) ? disj(q,p) : disj(p,q))) {
+		warn(_("Warning: partitions %s "), PNO(p));
+		warn(_("and %s overlap\n"), PNO(q));
+		return 0;
+	    }
+
+    /* Are the data partitions and the extended partition
+       table sectors disjoint? */
+    for (p = partitions; p < partitions+partno; p++)
+      if (p->size && !is_extended(p->p.sys_type))
+	for (q = partitions; q < partitions+partno; q++)
+	  if (is_extended(q->p.sys_type))
+	    if (p->start <= q->start && p->start + p->size > q->start) {
+		warn(_("Warning: partition %s contains part of "
+		       "the partition table (sector %lu),\n"
+		       "and will destroy it when filled\n"),
+		     PNO(p), q->start);
+		return 0;
+	    }
+
+    /* Do they start past zero and end before end-of-disk? */
+    { unsigned long ds = get_disksize(F_SECTOR);
+    for (p = partitions; p < partitions+partno; p++)
+      if (p->size) {
+	  if (p->start == 0) {
+	      warn(_("Warning: partition %s starts at sector 0\n"), PNO(p));
+	      return 0;
+	  }
+	  if (p->size && p->start + p->size > ds) {
+	      warn(_("Warning: partition %s extends past end of disk\n"),
+		   PNO(p));
+	      return 0;
+	  }
+      }
+    }
+
+    /* At most one chain of DOS extended partitions ? */
+    /* It seems that the OS/2 fdisk has the additional requirement
+       that the extended partition must be the fourth one */
+    { int ect = 0;
+      for (p = partitions; p < partitions+4; p++)
+	if (p->p.sys_type == EXTENDED_PARTITION)
+	  ect++;
+      if (ect > 1 && !Linux) {
+	  warn(_("Among the primary partitions, at most one can be extended\n"
+		 " (although this is not a problem under Linux)\n"));
+	  return 0;
+      }
+    }
+
+    /*
+     * Do all partitions start at a cylinder boundary ?
+     * (this is not required for Linux)
+     * The first partition starts after MBR.
+     * Logical partitions start slightly after the containing extended partn.
+     */
+    if (B.cylindersize) {
+	for(p = partitions; p < partitions+partno; p++)
+	  if (p->size) {
+	      if (p->start % B.cylindersize != 0
+		 && (!p->ep || p->start / B.cylindersize != p->ep->start / B.cylindersize)
+		 && (p->p.start_sect >= B.cylindersize)) {
+		  warn(_("Warning: partition %s does not start "
+		       "at a cylinder boundary\n"), PNO(p));
+		  if (!Linux)
+		    return 0;
+	      }
+	      if ((p->start + p->size) % B.cylindersize) {
+		  warn(_("Warning: partition %s does not end "
+		       "at a cylinder boundary\n"), PNO(p));
+		  if (!Linux)
+		    return 0;
+	      }
+	  }
+    }
+
+    /* Usually, one can boot only from primary partitions. */
+    /* In fact, from a unique one only. */
+    /* do not warn about bootable extended partitions -
+       often LILO is there */
+    { int pno = -1;
+    for(p = partitions; p < partitions+partno; p++)
+      if (p->p.bootable) {
+	  if (pno == -1)
+	    pno = p - partitions;
+	  else if (p - partitions < 4) {
+	      warn(_("Warning: more than one primary partition is marked "
+		   "bootable (active)\n"
+		   "This does not matter for LILO, but the DOS MBR will "
+		   "not boot this disk.\n"));
+	      break;
+	  }
+	  if (p - partitions >= 4) {
+	      warn(_("Warning: usually one can boot from primary partitions "
+		   "only\nLILO disregards the `bootable' flag.\n"));
+	      break;
+	  }
+      }
+      if (pno == -1 || pno >= 4)
+	warn(_("Warning: no primary partition is marked bootable (active)\n"
+	     "This does not matter for LILO, but the DOS MBR will "
+	     "not boot this disk.\n"));
+    }
+
+    /* Is chs as we expect? */
+    for(p = partitions; p < partitions+partno; p++)
+      if (p->ptype == DOS_TYPE) {
+	chs a, b;
+	longchs aa, bb;
+	a = p->size ? ulong_to_chs(p->start,B) : zero_chs;
+	b = p->p.begin_chs;
+	aa = chs_to_longchs(a);
+	bb = chs_to_longchs(b);
+	if (!chs_ok(b, PNO(p), _("start")))
+	  return 0;
+	if (a.s && !is_equal_chs(a, b))
+	  warn(_("partition %s: start: (c,h,s) expected (%ld,%ld,%ld) found (%ld,%ld,%ld)\n"),
+	       PNO(p), aa.c, aa.h, aa.s, bb.c, bb.h, bb.s);
+	a = p->size ? ulong_to_chs(p->start + p->size - 1, B) : zero_chs;
+	b = p->p.end_chs;
+	aa = chs_to_longchs(a);
+	bb = chs_to_longchs(b);
+	if (!chs_ok(b, PNO(p), _("end")))
+	  return 0;
+	if (a.s && !is_equal_chs(a, b))
+	  warn(_("partition %s: end: (c,h,s) expected (%ld,%ld,%ld) found (%ld,%ld,%ld)\n"),
+	       PNO(p), aa.c, aa.h, aa.s, bb.c, bb.h, bb.s);
+	if (B.cylinders && B.cylinders < 1024 && bb.c > B.cylinders)
+	  warn(_("partition %s ends on cylinder %ld, beyond the end of the disk\n"),
+	       PNO(p), bb.c);
+    }
+
+    return 1;
+
+#undef PNO
+}
+
+static void
+extended_partition(char *dev, int fd, struct part_desc *ep, struct disk_desc *z) {
+    char *cp;
+    struct sector *s;
+    unsigned long start, here, next;
+    int i, moretodo = 1;
+    struct partition p;
+    struct part_desc *partitions = &(z->partitions[0]);
+    int pno = z->partno;
+
+    here = start = ep->start;
+
+    if (B.cylindersize && start % B.cylindersize) {
+	/* This is BAD */
+	if (DOS_extended) {
+	    here = start -= (start % B.cylindersize);
+	    do_warn(_("Warning: shifted start of the extd partition "
+		     "from %ld to %ld\n"
+		     "(For listing purposes only. "
+		     "Do not change its contents.)\n"),
+		   ep->start, start);
+	} else {
+	    do_warn(_("Warning: extended partition does not start at a "
+		     "cylinder boundary.\n"
+		     "DOS and Linux will interpret the contents differently.\n"));
+	}
+    }
+
+    while (moretodo) {
+	moretodo = 0;
+
+	if (!(s = get_sector(dev, fd, here)))
+	    break;
+
+	if (!msdos_signature(s))
+	    break;
+
+	cp = s->data + 0x1be;
+
+	if (pno+4 >= ARRAY_SIZE(z->partitions)) {
+	    do_warn(_("too many partitions - ignoring those past nr (%d)\n"),
+		   pno-1);
+	    break;
+	}
+
+	next = 0;
+
+	for (i=0; i<4; i++,cp += sizeof(struct partition)) {
+	    partitions[pno].sector = here;
+	    partitions[pno].offset = cp - s->data;
+	    partitions[pno].ep = ep;
+	    copy_to_part(cp,&p);
+	    if (is_extended(p.sys_type)) {
+		partitions[pno].start = start + p.start_sect;
+		if (next)
+		  do_warn(_("tree of partitions?\n"));
+		else
+		  next = partitions[pno].start;		/* follow `upper' branch */
+		moretodo = 1;
+	    } else {
+		partitions[pno].start = here + p.start_sect;
+	    }
+	    partitions[pno].size = p.nr_sects;
+	    partitions[pno].ptype = DOS_TYPE;
+	    partitions[pno].p = p;
+	    pno++;
+	}
+	here = next;
+    }
+
+    z->partno = pno;
+}
+
+#define BSD_DISKMAGIC   (0x82564557UL)
+#define BSD_MAXPARTITIONS       16
+#define BSD_FS_UNUSED	   0
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+struct bsd_disklabel {
+	u32	d_magic;
+	char	d_junk1[4];
+	char    d_typename[16];
+	char    d_packname[16];
+	char	d_junk2[92];
+	u32	d_magic2;
+	char	d_junk3[2];
+	u16	d_npartitions;          /* number of partitions in following */
+	char	d_junk4[8];
+     struct  bsd_partition {         /* the partition table */
+                u32   p_size;         /* number of sectors in partition */
+                u32   p_offset;       /* starting sector */
+                u32   p_fsize;        /* filesystem basic fragment size */
+                u8    p_fstype;       /* filesystem type, see below */
+                u8    p_frag;         /* filesystem fragments per block */
+                u16   p_cpg;          /* filesystem cylinders per group */
+     } d_partitions[BSD_MAXPARTITIONS];      /* actually may be more */
+};
+
+static void
+bsd_partition(char *dev, int fd, struct part_desc *ep, struct disk_desc *z) {
+	struct bsd_disklabel *l;
+	struct bsd_partition *bp, *bp0;
+	unsigned long start = ep->start;
+	struct sector *s;
+	struct part_desc *partitions = &(z->partitions[0]);
+	int pno = z->partno;
+
+	if (!(s = get_sector(dev,fd,start+1)))
+		return;
+	l = (struct bsd_disklabel *) (s->data);
+	if (l->d_magic != BSD_DISKMAGIC || l->d_magic2 != BSD_DISKMAGIC)
+		return;
+
+	bp = bp0 = &l->d_partitions[0];
+	while (bp - bp0 < BSD_MAXPARTITIONS && bp - bp0 < l->d_npartitions) {
+		if (pno+1 >= ARRAY_SIZE(z->partitions)) {
+			do_warn(_("too many partitions - ignoring those "
+			       "past nr (%d)\n"), pno-1);
+			break;
+		}
+		if (bp->p_fstype != BSD_FS_UNUSED) {
+			partitions[pno].start = bp->p_offset;
+			partitions[pno].size = bp->p_size;
+			partitions[pno].sector = start+1;
+			partitions[pno].offset = (char *)bp - (char *)bp0;
+			partitions[pno].ep = 0;
+			partitions[pno].ptype = BSD_TYPE;
+			pno++;
+		}
+		bp++;
+	}
+	z->partno = pno;
+}
+
+static int
+msdos_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) {
+    int i;
+    char *cp;
+    struct partition pt;
+    struct sector *s;
+    struct part_desc *partitions = &(z->partitions[0]);
+    int pno = z->partno;
+    int bsd_later = 1;
+#ifdef __linux__
+    bsd_later = (get_linux_version() >= KERNEL_VERSION(2,3,40));
+#endif
+
+    if (!(s = get_sector(dev, fd, start)))
+	return 0;
+
+    if (!msdos_signature(s))
+	return 0;
+
+    cp = s->data + 0x1be;
+    copy_to_part(cp,&pt);
+
+    /* If I am not mistaken, recent kernels will hide this from us,
+	   so we will never actually see traces of a Disk Manager */
+    if (pt.sys_type == DM6_PARTITION
+	|| pt.sys_type == EZD_PARTITION
+	|| pt.sys_type == DM6_AUX1PARTITION
+	|| pt.sys_type == DM6_AUX3PARTITION) {
+	do_warn(_("detected Disk Manager - unable to handle that\n"));
+	return 0;
+    }
+    { unsigned int sig = *(unsigned short *)(s->data + 2);
+      if (sig <= 0x1ae
+	  && *(unsigned short *)(s->data + sig) == 0x55aa
+	  && (1 & *(unsigned char *)(s->data + sig + 2))) {
+	  do_warn(_("DM6 signature found - giving up\n"));
+	  return 0;
+      }
+    }
+
+    for (pno=0; pno<4; pno++,cp += sizeof(struct partition)) {
+	partitions[pno].sector = start;
+	partitions[pno].offset = cp - s->data;
+	copy_to_part(cp,&pt);
+	partitions[pno].start = start + pt.start_sect;
+	partitions[pno].size = pt.nr_sects;
+	partitions[pno].ep = 0;
+	partitions[pno].p = pt;
+    }
+
+    z->partno = pno;
+
+    for (i=0; i<4; i++) {
+	if (is_extended(partitions[i].p.sys_type)) {
+	    if (!partitions[i].size) {
+		do_warn(_("strange..., an extended partition of size 0?\n"));
+		continue;
+	    }
+	    extended_partition(dev, fd, &partitions[i], z);
+	}
+	if (!bsd_later && is_bsd(partitions[i].p.sys_type)) {
+	    if (!partitions[i].size) {
+		do_warn(_("strange..., a BSD partition of size 0?\n"));
+		continue;
+	    }
+	    bsd_partition(dev, fd, &partitions[i], z);
+	}
+    }
+
+    if (bsd_later) {
+	for (i=0; i<4; i++) {
+	    if (is_bsd(partitions[i].p.sys_type)) {
+		if (!partitions[i].size) {
+		    do_warn(_("strange..., a BSD partition of size 0?\n"));
+		    continue;
+		}
+		bsd_partition(dev, fd, &partitions[i], z);
+	    }
+	}
+    }
+
+    return 1;
+}
+
+static int
+osf_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) {
+	return 0;
+}
+
+static int
+sun_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) {
+	return 0;
+}
+
+static int
+amiga_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) {
+	return 0;
+}
+
+static void
+get_partitions(char *dev, int fd, struct disk_desc *z) {
+    z->partno = 0;
+
+    if (!msdos_partition(dev, fd, 0, z)
+	&& !osf_partition(dev, fd, 0, z)
+	&& !sun_partition(dev, fd, 0, z)
+	&& !amiga_partition(dev, fd, 0, z)) {
+	do_warn(_(" %s: unrecognized partition table type\n"), dev);
+	return;
+    }
+}
+
+static int
+write_partitions(char *dev, int fd, struct disk_desc *z) {
+    struct sector *s;
+    struct part_desc *partitions = &(z->partitions[0]), *p;
+    int pno = z->partno;
+
+    if (no_write) {
+	do_warn(_("-n flag was given: Nothing changed\n"));
+	exit(0);
+    }
+
+    for (p = partitions; p < partitions+pno; p++) {
+	s = get_sector(dev, fd, p->sector);
+	if (!s) return 0;
+	s->to_be_written = 1;
+	if (p->ptype == DOS_TYPE) {
+	    copy_from_part(&(p->p), s->data + p->offset);
+	    s->data[510] = 0x55;
+	    s->data[511] = 0xaa;
+	}
+    }
+    if (save_sector_file) {
+	if (!save_sectors(dev, fd)) {
+	    fatal(_("Failed saving the old sectors - aborting\n"));
+	    return 0;
+	}
+    }
+    if (!write_sectors(dev, fd)) {
+	error(_("Failed writing the partition on %s\n"), dev);
+	return 0;
+    }
+    if (fsync(fd)) {
+	perror(dev);
+	error(_("Failed writing the partition on %s\n"), dev);
+	return 0;
+    }
+    return 1;
+}
+
+/*
+ *  F. The standard input
+ */
+
+/*
+ * Input format:
+ * <start> <size> <type> <bootable> <c,h,s> <c,h,s>
+ * Fields are separated by whitespace or comma or semicolon possibly
+ * followed by whitespace; initial and trailing whitespace is ignored.
+ * Numbers can be octal, decimal or hexadecimal, decimal is default
+ * The <c,h,s> parts can (and probably should) be omitted.
+ * Bootable is specified as [*|-], with as default not-bootable.
+ * Type is given in hex, without the 0x prefix, or is [E|S|L|X], where
+ * L (LINUX_NATIVE (83)) is the default, S is LINUX_SWAP (82), and E
+ * is EXTENDED_PARTITION (5), X is LINUX_EXTENDED (85).
+ * The default value of start is the first nonassigned sector/cylinder/...
+ * The default value of size is as much as possible (until next
+ * partition or end-of-disk).
+ * .: end of chain of extended partitions.
+ *
+ * On interactive input an empty line means: all defaults.
+ * Otherwise empty lines are ignored.
+ */
+
+int eof, eob;
+
+struct dumpfld {
+    int fldno;
+    char *fldname;
+    int is_bool;
+} dumpflds[] = {
+    { 0, "start", 0 },
+    { 1, "size", 0 },
+    { 2, "Id", 0 },
+    { 3, "bootable", 1 },
+    { 4, "bh", 0 },
+    { 5, "bs", 0 },
+    { 6, "bc", 0 },
+    { 7, "eh", 0 },
+    { 8, "es", 0 },
+    { 9, "ec", 0 }
+};
+
+/*
+ * Read a line, split it into fields
+ *
+ * (some primitive handwork, but a more elaborate parser seems
+ *  unnecessary)
+ */
+#define RD_EOF (-1)
+#define RD_CMD (-2)
+
+static int
+read_stdin(char **fields, char *line, int fieldssize, int linesize) {
+    char *lp, *ip;
+    int c, fno;
+
+    /* boolean true and empty string at start */
+    line[0] = '*';
+    line[1] = 0;
+    for (fno=0; fno < fieldssize; fno++)
+      fields[fno] = line + 1;
+    fno = 0;
+
+    /* read a line from stdin */
+    lp = fgets(line+2, linesize-2, stdin);
+    if (lp == NULL) {
+	eof = 1;
+	return RD_EOF;
+    }
+    if (!(lp = strchr(lp, '\n')))
+      fatal(_("long or incomplete input line - quitting\n"));
+    *lp = 0;
+
+    /* remove comments, if any */
+    if ((lp = strchr(line+2, '#')) != 0)
+      *lp = 0;
+
+    /* recognize a few commands - to be expanded */
+    if (!strcmp(line+2, "unit: sectors")) {
+	specified_format = F_SECTOR;
+	return RD_CMD;
+    }
+
+    /* dump style? - then bad input is fatal */
+    if ((ip = strchr(line+2, ':')) != 0) {
+	struct dumpfld *d;
+
+      nxtfld:
+	    ip++;
+	    while(isspace(*ip))
+	      ip++;
+	    if (*ip == 0)
+	      return fno;
+	    for(d = dumpflds; d-dumpflds < ARRAY_SIZE(dumpflds); d++) {
+		if (!strncmp(ip, d->fldname, strlen(d->fldname))) {
+		    ip += strlen(d->fldname);
+		    while(isspace(*ip))
+		      ip++;
+		    if (d->is_bool)
+			fields[d->fldno] = line;
+		    else if (*ip == '=') {
+			while(isspace(*++ip)) ;
+			fields[d->fldno] = ip;
+			while(isalnum(*ip)) 	/* 0x07FF */
+			  ip++;
+		    } else
+		      fatal(_("input error: `=' expected after %s field\n"),
+			    d->fldname);
+		    if (fno <= d->fldno)
+		      fno = d->fldno + 1;
+		    if (*ip == 0)
+		      return fno;
+		    if (*ip != ',' && *ip != ';')
+		      fatal(_("input error: unexpected character %c after %s field\n"),
+			    *ip, d->fldname);
+		    *ip = 0;
+		    goto nxtfld;
+		}
+	    }
+	    fatal(_("unrecognized input: %s\n"), ip);
+    }
+
+    /* split line into fields */
+    lp = ip = line+2;
+    fields[fno++] = lp;
+    while((c = *ip++) != 0) {
+	if (!lp[-1] && (c == '\t' || c == ' '))
+	  ;
+	else if (c == '\t' || c == ' ' || c == ',' || c == ';') {
+	    *lp++ = 0;
+	    if (fno < fieldssize)
+		fields[fno++] = lp;
+	    continue;
+	} else
+	  *lp++ = c;
+    }
+
+    if (lp == fields[fno-1])
+      fno--;
+    return fno;
+}
+
+/* read a number, use default if absent */
+/* a sign gives an offset from the default */
+static int
+get_ul(char *u, unsigned long *up, unsigned long def, int base) {
+    char *nu;
+    int sign = 0;
+    unsigned long val;
+
+    if (*u == '+') {
+	sign = 1;
+	u++;
+    } else if (*u == '-') {
+	sign = -1;
+	u++;
+    }
+    if (*u) {
+	errno = 0;
+	val = strtoul(u, &nu, base);
+	if (errno == ERANGE) {
+	    do_warn(_("number too big\n"));
+	    return -1;
+	}
+	if (*nu) {
+	    do_warn(_("trailing junk after number\n"));
+	    return -1;
+	}
+	if (sign == 1)
+		val = def + val;
+	else if (sign == -1)
+		val = def - val;
+	*up = val;
+    } else
+      *up = def;
+    return 0;
+}
+
+/* There are two common ways to structure extended partitions:
+   as nested boxes, and as a chain. Sometimes the partitions
+   must be given in order. Sometimes all logical partitions
+   must lie inside the outermost extended partition.
+NESTED: every partition is contained in the surrounding partitions
+   and is disjoint from all others.
+CHAINED: every data partition is contained in the surrounding partitions
+   and disjoint from all others, but extended partitions may lie outside
+   (insofar as allowed by all_logicals_inside_outermost_extended).
+ONESECTOR: all data partitions are mutually disjoint; extended partitions
+   each use one sector only (except perhaps for the outermost one).
+*/
+int partitions_in_order = 0;
+int all_logicals_inside_outermost_extended = 1;
+enum { NESTED, CHAINED, ONESECTOR } boxes = NESTED;
+
+/* find the default value for <start> - assuming entire units */
+static unsigned long
+first_free(int pno, int is_extended, struct part_desc *ep, int format,
+	   unsigned long mid, struct disk_desc *z) {
+    unsigned long ff, fff;
+    unsigned long unit = unitsize(format);
+    struct part_desc *partitions = &(z->partitions[0]), *pp = 0;
+
+    /* if containing ep undefined, look at its container */
+    if (ep && ep->p.sys_type == EMPTY_PARTITION)
+      ep = ep->ep;
+
+    if (ep) {
+	if (boxes == NESTED || (boxes == CHAINED && !is_extended))
+	  pp = ep;
+	else if (all_logicals_inside_outermost_extended)
+	  pp = outer_extended_partition(ep);
+    }
+#if 0
+    ff = pp ? (pp->start + unit - 1) / unit : 0;
+#else
+    /* rounding up wastes almost an entire cylinder - round down
+       and leave it to compute_start_sect() to fix the difference */
+    ff = pp ? pp->start / unit : 0;
+#endif
+    /* MBR and 1st sector of an extended partition are never free */
+    if (unit == 1)
+      ff++;
+
+  again:
+    for(pp = partitions; pp < partitions+pno; pp++) {
+	if (!is_parent(pp, ep) && pp->size > 0) {
+	    if ((partitions_in_order || pp->start / unit <= ff
+		                     || (mid && pp->start / unit <= mid))
+		&& (fff = (pp->start + pp->size + unit - 1) / unit) > ff) {
+		ff = fff;
+		goto again;
+	    }
+	}
+    }
+
+    return ff;
+}
+
+/* find the default value for <size> - assuming entire units */
+static unsigned long
+max_length(int pno, int is_extended, struct part_desc *ep, int format,
+	   unsigned long start, struct disk_desc *z) {
+    unsigned long fu;
+    unsigned long unit = unitsize(format);
+    struct part_desc *partitions = &(z->partitions[0]), *pp = 0;
+
+    /* if containing ep undefined, look at its container */
+    if (ep && ep->p.sys_type == EMPTY_PARTITION)
+      ep = ep->ep;
+
+    if (ep) {
+	if (boxes == NESTED || (boxes == CHAINED && !is_extended))
+	  pp = ep;
+	else if (all_logicals_inside_outermost_extended)
+	  pp = outer_extended_partition(ep);
+    }
+    fu = pp ? (pp->start + pp->size) / unit : get_disksize(format);
+
+    for(pp = partitions; pp < partitions+pno; pp++)
+      if (!is_parent(pp, ep) && pp->size > 0
+	  && pp->start / unit >= start && pp->start / unit < fu)
+	fu = pp->start / unit;
+
+    return (fu > start) ? fu - start : 0;
+}
+
+/* compute starting sector of a partition inside an extended one */
+/* return 0 on failure */
+/* ep is 0 or points to surrounding extended partition */
+static int
+compute_start_sect(struct part_desc *p, struct part_desc *ep) {
+    unsigned long base;
+    int inc = (DOS && B.sectors) ? B.sectors : 1;
+    int delta;
+
+    if (ep && p->start + p->size >= ep->start + 1)
+      delta = p->start - ep->start - inc;
+    else if (p->start == 0 && p->size > 0)
+      delta = -inc;
+    else
+      delta = 0;
+
+    if (delta < 0) {
+	unsigned long old_size = p->size;
+	p->start -= delta;
+	p->size += delta;
+	if (is_extended(p->p.sys_type) && boxes == ONESECTOR)
+	  p->size = inc;
+	else if (old_size <= -delta) {
+	    warn(_("no room for partition descriptor\n"));
+	    return 0;
+	}
+    }
+    base = (!ep ? 0
+	        : (is_extended(p->p.sys_type) ?
+		   outer_extended_partition(ep) : ep)->start);
+    p->ep = ep;
+    if (p->p.sys_type == EMPTY_PARTITION && p->size == 0) {
+        p->p.start_sect = 0;
+	p->p.begin_chs = zero_chs;
+	p->p.end_chs = zero_chs;
+    } else {
+        p->p.start_sect = p->start - base;
+	p->p.begin_chs = ulong_to_chs(p->start,B);
+	p->p.end_chs = ulong_to_chs(p->start + p->size - 1,B);
+    }
+    p->p.nr_sects = p->size;
+    return 1;
+}
+
+/* build the extended partition surrounding a given logical partition */
+static int
+build_surrounding_extended(struct part_desc *p, struct part_desc *ep,
+			   struct disk_desc *z) {
+    int inc = (DOS && B.sectors) ? B.sectors : 1;
+    int format = F_SECTOR;
+    struct part_desc *p0 = &(z->partitions[0]), *eep = ep->ep;
+
+    if (boxes == NESTED) {
+	ep->start = first_free(ep-p0, 1, eep, format, p->start, z);
+	ep->size = max_length(ep-p0, 1, eep, format, ep->start, z);
+	if (ep->start > p->start || ep->start + ep->size < p->start + p->size) {
+	    warn(_("cannot build surrounding extended partition\n"));
+	    return 0;
+	}
+    } else {
+	ep->start = p->start;
+	if (boxes == CHAINED)
+	  ep->size = p->size;
+	else
+	  ep->size = inc;
+    }
+
+    ep->p.nr_sects = ep->size;
+    ep->p.bootable = 0;
+    ep->p.sys_type = EXTENDED_PARTITION;
+    if (!compute_start_sect(ep, eep) || !compute_start_sect(p, ep)) {
+	ep->p.sys_type = EMPTY_PARTITION;
+	ep->size = 0;
+	return 0;
+    }
+
+    return 1;
+}
+
+static int
+read_line(int pno, struct part_desc *ep, char *dev, int interactive,
+	  struct disk_desc *z) {
+    char line[1000];
+    char *fields[11];
+    int fno, pct = pno%4;
+    struct part_desc p, *orig;
+    unsigned long ff, ff1, ul, ml, ml1, def;
+    int format, lpno, is_extd;
+
+    if (eof || eob)
+      return -1;
+
+    lpno = index_to_linux(pno, z);
+
+    if (interactive) {
+	if (pct == 0 && (show_extended || pno == 0))
+	  warn("\n");
+	warn("%s:", partname(dev, lpno, 10));
+    }
+
+    /* read input line - skip blank lines when reading from a file */
+    do {
+	fno = read_stdin(fields, line, ARRAY_SIZE(fields), ARRAY_SIZE(line));
+    } while(fno == RD_CMD || (fno == 0 && !interactive));
+    if (fno == RD_EOF) {
+	return -1;
+    } else if (fno > 10 && *(fields[10]) != 0) {
+	do_warn(_("too many input fields\n"));
+	return 0;
+    }
+
+    if (fno == 1 && !strcmp(fields[0], ".")) {
+	eob = 1;
+	return -1;
+    }
+
+    /* use specified format, but round to cylinders if F_MEGABYTE specified */
+    format = 0;
+    if (B.cylindersize && specified_format == F_MEGABYTE)
+      format = F_CYLINDER;
+
+    orig = (one_only ? &(oldp.partitions[pno]) : 0);
+
+    p = zero_part_desc;
+    p.ep = ep;
+
+    /* first read the type - we need to know whether it is extended */
+    /* stop reading when input blank (defaults) and all is full */
+    is_extd = 0;
+    if (fno == 0) {		/* empty line */
+	if (orig && is_extended(orig->p.sys_type))
+	  is_extd = 1;
+	ff = first_free(pno, is_extd, ep, format, 0, z);
+	ml = max_length(pno, is_extd, ep, format, ff, z);
+	if (ml == 0 && is_extd == 0) {
+	    is_extd = 1;
+	    ff = first_free(pno, is_extd, ep, format, 0, z);
+	    ml = max_length(pno, is_extd, ep, format, ff, z);
+	}
+	if (ml == 0 && pno >= 4) {
+	    /* no free blocks left - don't read any further */
+	    warn(_("No room for more\n"));
+	    return -1;
+	}
+    }
+    if (fno < 3 || !*(fields[2]))
+      ul = orig ? orig->p.sys_type :
+	   (is_extd || (pno > 3 && pct == 1 && show_extended))
+	     ? EXTENDED_PARTITION : LINUX_NATIVE;
+    else if (!strcmp(fields[2], "L"))
+      ul = LINUX_NATIVE;
+    else if (!strcmp(fields[2], "S"))
+      ul = LINUX_SWAP;
+    else if (!strcmp(fields[2], "E"))
+      ul = EXTENDED_PARTITION;
+    else if (!strcmp(fields[2], "X"))
+      ul = LINUX_EXTENDED;
+    else if (get_ul(fields[2], &ul, LINUX_NATIVE, 16))
+      return 0;
+    if (ul > 255) {
+	warn(_("Illegal type\n"));
+	return 0;
+    }
+    p.p.sys_type = ul;
+    is_extd = is_extended(ul);
+
+    /* find start */
+    ff = first_free(pno, is_extd, ep, format, 0, z);
+    ff1 = ff * unitsize(format);
+    def = orig ? orig->start : (pno > 4 && pct > 1) ? 0 : ff1;
+    if (fno < 1 || !*(fields[0]))
+      p.start = def;
+    else {
+	if (get_ul(fields[0], &ul, def / unitsize(0), 0))
+	  return 0;
+	p.start = ul * unitsize(0);
+	p.start -= (p.start % unitsize(format));
+    }
+
+    /* find length */
+    ml = max_length(pno, is_extd, ep, format, p.start / unitsize(format), z);
+    ml1 = ml * unitsize(format);
+    def = orig ? orig->size : (pno > 4 && pct > 1) ? 0 : ml1;
+    if (fno < 2 || !*(fields[1]))
+      p.size = def;
+    else {
+	if (get_ul(fields[1], &ul, def / unitsize(0), 0))
+	  return 0;
+	p.size = ul * unitsize(0) + unitsize(format) - 1;
+	p.size -= (p.size % unitsize(format));
+    }
+    if (p.size > ml1) {
+	warn(_("Warning: given size (%lu) exceeds max allowable size (%lu)\n"),
+	     (p.size + unitsize(0) - 1) / unitsize(0), ml1 / unitsize(0));
+	if (!force)
+	  return 0;
+    }
+    if (p.size == 0 && pno >= 4 && (fno < 2 || !*(fields[1]))) {
+	warn(_("Warning: empty partition\n"));
+	if (!force)
+	  return 0;
+    }
+    p.p.nr_sects = p.size;
+
+    if (p.size == 0 && !orig) {
+	if (fno < 1 || !*(fields[0]))
+	  p.start = 0;
+	if (fno < 3 || !*(fields[2]))
+	  p.p.sys_type = EMPTY_PARTITION;
+    }
+
+    if (p.start < ff1 && p.size > 0) {
+	warn(_("Warning: bad partition start (earliest %lu)\n"),
+	     (ff1 + unitsize(0) - 1) / unitsize(0));
+	if (!force)
+	  return 0;
+    }
+
+    if (fno < 4 || !*(fields[3]))
+      ul = (orig ? orig->p.bootable : 0);
+    else if (!strcmp(fields[3], "-"))
+      ul = 0;
+    else if (!strcmp(fields[3], "*") || !strcmp(fields[3], "+"))
+      ul = 0x80;
+    else {
+    	warn(_("unrecognized bootable flag - choose - or *\n"));
+    	return 0;
+    }
+    p.p.bootable = ul;
+
+    if (ep && ep->p.sys_type == EMPTY_PARTITION) {
+      if (!build_surrounding_extended(&p, ep, z))
+	return 0;
+    } else
+      if (!compute_start_sect(&p, ep))
+	return 0;
+
+    { longchs aa = chs_to_longchs(p.p.begin_chs), bb;
+
+      if (fno < 5) {
+	  bb = aa;
+      } else if (fno < 7) {
+	  warn(_("partial c,h,s specification?\n"));
+	  return 0;
+      } else if (get_ul(fields[4], &bb.c, aa.c, 0) ||
+		get_ul(fields[5], &bb.h, aa.h, 0) ||
+		get_ul(fields[6], &bb.s, aa.s, 0))
+	return 0;
+      p.p.begin_chs = longchs_to_chs(bb,B);
+    }
+    { longchs aa = chs_to_longchs(p.p.end_chs), bb;
+
+      if (fno < 8) {
+	  bb = aa;
+      } else if (fno < 10) {
+	  warn(_("partial c,h,s specification?\n"));
+	  return 0;
+      } else if (get_ul(fields[7], &bb.c, aa.c, 0) ||
+		get_ul(fields[8], &bb.h, aa.h, 0) ||
+		get_ul(fields[9], &bb.s, aa.s, 0))
+	return 0;
+      p.p.end_chs = longchs_to_chs(bb, B);
+    }
+
+    if (pno > 3 && p.size && show_extended && p.p.sys_type != EMPTY_PARTITION
+	        && (is_extended(p.p.sys_type) != (pct == 1))) {
+	warn(_("Extended partition not where expected\n"));
+	if (!force)
+	  return 0;
+    }
+
+    z->partitions[pno] = p;
+    if (pno >= z->partno)
+      z->partno += 4;		/* reqd for out_partition() */
+
+    if (interactive)
+      out_partition(dev, 0, &(z->partitions[pno]), z, B);
+
+    return 1;
+}
+
+/* ep either points to the extended partition to contain this one,
+   or to the empty partition that may become extended or is 0 */
+static int
+read_partition(char *dev, int interactive, int pno, struct part_desc *ep,
+	       struct disk_desc *z) {
+    struct part_desc *p = &(z->partitions[pno]);
+    int i;
+
+    if (one_only) {
+	*p = oldp.partitions[pno];
+	if (one_only_pno != pno)
+	  goto ret;
+    } else if (!show_extended && pno > 4 && pno%4)
+	  goto ret;
+
+    while (!(i = read_line(pno, ep, dev, interactive, z)))
+      if (!interactive)
+	fatal(_("bad input\n"));
+    if (i < 0) {
+	p->ep = ep;
+	return 0;
+    }
+
+  ret:
+    p->ep = ep;
+    if (pno >= z->partno)
+      z->partno += 4;
+    return 1;
+}
+
+static void
+read_partition_chain(char *dev, int interactive, struct part_desc *ep,
+		     struct disk_desc *z) {
+    int i, base;
+
+    eob = 0;
+    while (1) {
+	base = z->partno;
+	if (base+4 > ARRAY_SIZE(z->partitions)) {
+	    do_warn(_("too many partitions\n"));
+	    break;
+	}
+	for (i=0; i<4; i++)
+	  if (!read_partition(dev, interactive, base+i, ep, z))
+	    return;
+	for (i=0; i<4; i++) {
+	    ep = &(z->partitions[base+i]);
+	    if (is_extended(ep->p.sys_type) && ep->size)
+	      break;
+	}
+	if (i == 4) {
+	    /* nothing found - maybe an empty partition is going
+	       to be extended */
+	    if (one_only || show_extended)
+	      break;
+	    ep = &(z->partitions[base+1]);
+	    if (ep->size || ep->p.sys_type != EMPTY_PARTITION)
+	      break;
+	}
+    }
+}
+
+static void
+read_input(char *dev, int interactive, struct disk_desc *z) {
+    int i;
+    struct part_desc *partitions = &(z->partitions[0]), *ep;
+
+    for (i=0; i < ARRAY_SIZE(z->partitions); i++)
+      partitions[i] = zero_part_desc;
+    z->partno = 0;
+
+    if (interactive)
+      warn(_("Input in the following format; absent fields get a default value.\n"
+             "<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>\n"
+             "Usually you only need to specify <start> and <size> (and perhaps <type>).\n"));
+    eof = 0;
+
+    for (i=0; i<4; i++)
+      read_partition(dev, interactive, i, 0, z);
+    for (i=0; i<4; i++) {
+	ep = partitions+i;
+	if (is_extended(ep->p.sys_type) && ep->size)
+	  read_partition_chain(dev, interactive, ep, z);
+    }
+    add_sector_and_offset(z);
+}
+
+/*
+ *  G. The command line
+ */
+
+static void version(void) {
+    printf("sfdisk (%s)\n", PACKAGE_STRING);
+}
+
+static void
+usage(void) {
+    version();
+    printf(_("Usage: %s [options] device ...\n"), PROGNAME);
+    puts (_("device: something like /dev/hda or /dev/sda"));
+    puts (_("useful options:"));
+    puts (_("    -s [or --show-size]: list size of a partition"));
+    puts (_("    -c [or --id]:        print or change partition Id"));
+    puts (_("    -l [or --list]:      list partitions of each device"));
+    puts (_("    -d [or --dump]:      idem, but in a format suitable for later input"));
+    puts (_("    -i [or --increment]: number cylinders etc. from 1 instead of from 0"));
+    puts (_("    -uS, -uB, -uC, -uM:  accept/report in units of sectors/blocks/cylinders/MB"));
+    puts (_("    -T [or --list-types]:list the known partition types"));
+    puts (_("    -D [or --DOS]:       for DOS-compatibility: waste a little space"));
+    puts (_("    -R [or --re-read]:   make kernel reread partition table"));
+    puts (_("    -N# :                change only the partition with number #"));
+    puts (_("    -n :                 do not actually write to disk"));
+    puts (_("    -O file :            save the sectors that will be overwritten to file"));
+    puts (_("    -I file :            restore these sectors again"));
+    puts (_("    -v [or --version]:   print version"));
+    puts (_("    -? [or --help]:      print this message"));
+    puts (_("dangerous options:"));
+    puts (_("    -g [or --show-geometry]: print the kernel's idea of the geometry"));
+    puts (_("    -G [or --show-pt-geometry]: print geometry guessed from the partition table"));
+    puts (_("    -x [or --show-extended]: also list extended partitions on output\n"
+          "                             or expect descriptors for them on input"));
+    puts (_("    -L  [or --Linux]:      do not complain about things irrelevant for Linux"));
+    puts (_("    -q  [or --quiet]:      suppress warning messages"));
+    puts (_("    You can override the detected geometry using:"));
+    puts (_("    -C# [or --cylinders #]:set the number of cylinders to use"));
+    puts (_("    -H# [or --heads #]:    set the number of heads to use"));
+    puts (_("    -S# [or --sectors #]:  set the number of sectors to use"));
+    puts (_("You can disable all consistency checking with:"));
+    puts (_("    -f  [or --force]:      do what I say, even if it is stupid"));
+    exit(1);
+}
+
+static void
+activate_usage(char *progn) {
+    puts (_("Usage:"));
+    printf(_("%s device		 list active partitions on device\n"), progn);
+    printf(_("%s device n1 n2 ... activate partitions n1 ..., inactivate the rest\n"), progn);
+    printf(_("%s -An device	 activate partition n, inactivate the other ones\n"), PROGNAME);
+    exit(1);
+}
+
+static void
+unhide_usage(char *progn) {
+    exit(1);
+}
+
+static char short_opts[] = "cdfgilnqsu:vx?1A::C:DGH:I:LN:O:RS:TU::V";
+
+#define PRINT_ID 0400
+#define CHANGE_ID 01000
+
+static const struct option long_opts[] = {
+    { "change-id",	  no_argument, NULL, 'c' + CHANGE_ID },
+    { "print-id",	  no_argument, NULL, 'c' + PRINT_ID },
+    { "id",		  no_argument, NULL, 'c' },
+    { "dump",             no_argument, NULL, 'd' },
+    { "force",            no_argument, NULL, 'f' },
+    { "show-geometry",	  no_argument, NULL, 'g' },
+    { "increment",        no_argument, NULL, 'i' },
+    { "list",             no_argument, NULL, 'l' },
+    { "quiet",            no_argument, NULL, 'q' },
+    { "show-size",        no_argument, NULL, 's' },
+    { "unit",       required_argument, NULL, 'u' },
+    { "version",          no_argument, NULL, 'v' },
+    { "show-extended",    no_argument, NULL, 'x' },
+    { "help",	          no_argument, NULL, '?' },
+    { "one-only",         no_argument, NULL, '1' },
+    { "cylinders",  required_argument, NULL, 'C' },
+    { "heads",      required_argument, NULL, 'H' },
+    { "sectors",    required_argument, NULL, 'S' },
+    { "show-pt-geometry", no_argument, NULL, 'G' },
+    { "activate",   optional_argument, NULL, 'A' },
+    { "DOS",              no_argument, NULL, 'D' },
+    { "DOS-extended",	  no_argument, NULL, 'E' },
+    { "Linux",            no_argument, NULL, 'L' },
+    { "re-read",          no_argument, NULL, 'R' },
+    { "list-types",       no_argument, NULL, 'T' },
+    { "unhide",     optional_argument, NULL, 'U' },
+    { "no-reread",        no_argument, NULL, 160 },
+    { "IBM",              no_argument, NULL, 161 },
+    { "leave-last",       no_argument, NULL, 161 },
+/* undocumented flags - not all completely implemented */
+    { "in-order",         no_argument, NULL, 128 },
+    { "not-in-order",     no_argument, NULL, 129 },
+    { "inside-outer",     no_argument, NULL, 130 },
+    { "not-inside-outer", no_argument, NULL, 131 },
+    { "nested",           no_argument, NULL, 132 },
+    { "chained",          no_argument, NULL, 133 },
+    { "onesector",        no_argument, NULL, 134 },
+    { NULL, 0, NULL, 0 }
+};
+
+static int
+is_ide_cdrom_or_tape(char *device) {
+	FILE *procf;
+	char buf[100];
+	struct stat statbuf;
+	int is_ide = 0;
+
+	/* No device was given explicitly, and we are trying some
+	   likely things.  But opening /dev/hdc may produce errors like
+           "hdc: tray open or drive not ready"
+	   if it happens to be a CD-ROM drive. It even happens that
+	   the process hangs on the attempt to read a music CD.
+	   So try to be careful. This only works since 2.1.73. */
+
+	if (strncmp("/dev/hd", device, 7))
+		return 0;
+
+	snprintf(buf, sizeof(buf), "/proc/ide/%s/media", device+5);
+	procf = fopen(buf, "r");
+	if (procf != NULL && fgets(buf, sizeof(buf), procf))
+		is_ide = (!strncmp(buf, "cdrom", 5) ||
+			  !strncmp(buf, "tape", 4));
+	else
+		/* Now when this proc file does not exist, skip the
+		   device when it is read-only. */
+		if (stat(device, &statbuf) == 0)
+			is_ide = ((statbuf.st_mode & 0222) == 0);
+
+	if (procf)
+		fclose(procf);
+	return is_ide;
+}
+
+#define PROC_PARTITIONS	"/proc/partitions"
+
+static char *
+nextproc(FILE *procf) {
+	static char devname[256];
+	char line[1024], ptname[128];
+	int ma, mi;
+	unsigned long long sz;
+
+	if (procf == NULL)
+		return NULL;
+	while (fgets(line, sizeof(line), procf) != NULL) {
+		if (sscanf (line, " %d %d %llu %128[^\n ]",
+			    &ma, &mi, &sz, ptname) != 4)
+			continue;
+		snprintf(devname, sizeof(devname), "/dev/%s", ptname);
+		if (!is_whole_disk(devname))
+			continue;
+		return devname;
+	}
+
+	return NULL;
+}
+
+static void
+gpt_warning(char *dev, int warn_only)
+{
+	if (force)
+		warn_only = 1;
+
+	if (dev && gpt_probe_signature_devname(dev)) {
+		fflush(stdout);
+		fprintf(stderr, _("\nWARNING: GPT (GUID Partition Table) detected on '%s'! "
+			"The util sfdisk doesn't support GPT. Use GNU Parted.\n\n"), dev);
+		if (!warn_only) {
+			fprintf(stderr, _("Use the --force flag to overrule this check.\n"));
+			exit(1);
+		}
+	}
+}
+
+static void do_list(char *dev, int silent);
+static void do_size(char *dev, int silent);
+static void do_geom(char *dev, int silent);
+static void do_pt_geom(char *dev, int silent);
+static void do_fdisk(char *dev);
+static void do_reread(char *dev);
+static void do_change_id(char *dev, char *part, char *id);
+static void do_unhide(char **av, int ac, char *arg);
+static void do_activate(char **av, int ac, char *arg);
+
+unsigned long long total_size;
+
+int
+main(int argc, char **argv) {
+    char *progn;
+    int c;
+    char *dev;
+    int opt_size = 0;
+    int opt_out_geom = 0;
+    int opt_out_pt_geom = 0;
+    int opt_reread = 0;
+    int activate = 0;
+    int do_id = 0;
+    int unhide = 0;
+    int fdisk = 0;
+    char *activatearg = 0;
+    char *unhidearg = 0;
+
+    setlocale(LC_ALL, "");
+    bindtextdomain(PACKAGE, LOCALEDIR);
+    textdomain(PACKAGE);
+
+    if (argc < 1)
+      fatal(_("no command?\n"));
+    if ((progn = strrchr(argv[0], '/')) == NULL)
+      progn = argv[0];
+    else
+      progn++;
+    if (!strcmp(progn, "activate"))
+      activate = 1;		/* equivalent to `sfdisk -A' */
+#if 0				/* not important enough to deserve a name */
+    else if (!strcmp(progn, "unhide"))
+      unhide = 1;		/* equivalent to `sfdisk -U' */
+#endif
+    else
+      fdisk = 1;
+
+    while ((c = getopt_long (argc, argv, short_opts, long_opts, NULL)) != -1) {
+	switch (c) {
+	  case 'f':
+	    force = 1; break;	/* does not imply quiet */
+	  case 'g':
+	    opt_out_geom = 1; break;
+	  case 'G':
+	    opt_out_pt_geom = 1; break;
+	  case 'i':
+	    increment = 1; break;
+	  case 'c':
+	  case 'c' + PRINT_ID:
+	  case 'c' + CHANGE_ID:
+	    do_id = c; break;
+	  case 'd':
+	    dump = 1; /* fall through */
+	  case 'l':
+	    opt_list = 1; break;
+	  case 'n':
+	    no_write = 1; break;
+	  case 'q':
+	    quiet = 1; break;
+	  case 's':
+	    opt_size = 1; break;
+	  case 'u':
+	    set_format(*optarg); break;
+	  case 'v':
+	    version();
+	    exit(0);
+	  case 'x':
+	    show_extended = 1; break;
+	  case 'A':
+	    activatearg = optarg;
+	    activate = 1; break;
+	  case 'C':
+	    U.cylinders = atoi(optarg); break;
+	  case 'D':
+	    DOS = 1; break;
+	  case 'E':
+	    DOS_extended = 1; break;
+	  case 'H':
+	    U.heads = atoi(optarg); break;
+	  case 'L':
+	    Linux = 1; break;
+	  case 'N':
+	    one_only = atoi(optarg); break;
+	  case 'I':
+	    restore_sector_file = optarg; break;
+	  case 'O':
+	    save_sector_file = optarg; break;
+	  case 'R':
+	    opt_reread = 1; break;
+	  case 'S':
+	    U.sectors = atoi(optarg); break;
+	  case 'T':
+	    list_types();
+	    exit(0);
+	  case 'U':
+	    unhidearg = optarg;
+	    unhide = 1; break;
+	  case 'V':
+	    verify = 1; break;
+	  case '?':
+	  default:
+	    usage(); break;
+
+	  /* undocumented flags */
+	  case 128:
+	    partitions_in_order = 1; break;
+	  case 129:
+	    partitions_in_order = 0; break;
+	  case 130:
+	    all_logicals_inside_outermost_extended = 1; break;
+	  case 131:
+	    all_logicals_inside_outermost_extended = 0; break;
+	  case 132:
+	    boxes = NESTED; break;
+	  case 133:
+	    boxes = CHAINED; break;
+	  case 134:
+	    boxes = ONESECTOR; break;
+
+	  /* more flags */
+	  case 160:
+	    no_reread = 1; break;
+	  case 161:
+	    leave_last = 1; break;
+	}
+    }
+
+    if (optind == argc &&
+	(opt_list || opt_out_geom || opt_out_pt_geom || opt_size || verify)) {
+	FILE *procf;
+
+	/* try all known devices */
+	total_size = 0;
+
+	procf = fopen(PROC_PARTITIONS, "r");
+	if (!procf)
+	    fprintf(stderr, _("cannot open %s\n"), PROC_PARTITIONS);
+	else {
+	    while ((dev = nextproc(procf)) != NULL) {
+	        if (is_ide_cdrom_or_tape(dev))
+		   continue;
+	        gpt_warning(dev, 1);
+	        if (opt_out_geom)
+		   do_geom(dev, 1);
+	        if (opt_out_pt_geom)
+		   do_pt_geom(dev, 1);
+	        if (opt_size)
+		   do_size(dev, 1);
+	        if (opt_list || verify)
+		   do_list(dev, 1);
+	    }
+	    fclose(procf);
+	}
+
+	if (opt_size)
+	  printf(_("total: %llu blocks\n"), total_size);
+
+	exit(exit_status);
+    }
+
+    if (optind == argc) {
+	if (activate)
+	  activate_usage(fdisk ? "sfdisk -A" : progn);
+	else if (unhide)
+	  unhide_usage(fdisk ? "sfdisk -U" : progn);
+	else
+	  usage();
+    }
+
+    if (opt_list || opt_out_geom || opt_out_pt_geom || opt_size || verify) {
+	while (optind < argc) {
+	    gpt_warning(argv[optind], 1);
+	    if (opt_out_geom)
+	      do_geom(argv[optind], 0);
+	    if (opt_out_pt_geom)
+	      do_pt_geom(argv[optind], 0);
+	    if (opt_size)
+	      do_size(argv[optind], 0);
+	    if (opt_list || verify)
+	      do_list(argv[optind], 0);
+	    optind++;
+	}
+	exit(exit_status);
+    }
+
+    if (optind != argc-1)
+	gpt_warning(argv[optind], 0);
+
+    if (activate) {
+	do_activate(argv+optind, argc-optind, activatearg);
+	exit(exit_status);
+    }
+    if (unhide) {
+	do_unhide(argv+optind, argc-optind, unhidearg);
+	exit(exit_status);
+    }
+    if (do_id) {
+        if ((do_id & PRINT_ID) != 0 && optind != argc-2)
+	  fatal(_("usage: sfdisk --print-id device partition-number\n"));
+	else if ((do_id & CHANGE_ID) != 0 && optind != argc-3)
+	  fatal(_("usage: sfdisk --change-id device partition-number Id\n"));
+	else if (optind != argc-3 && optind != argc-2)
+	  fatal(_("usage: sfdisk --id device partition-number [Id]\n"));
+	do_change_id(argv[optind], argv[optind+1],
+		     (optind == argc-2) ? 0 : argv[optind+2]);
+	exit(exit_status);
+    }
+
+    if (optind != argc-1)
+      fatal(_("can specify only one device (except with -l or -s)\n"));
+    dev = argv[optind];
+
+    if (opt_reread)
+      do_reread(dev);
+    else if (restore_sector_file)
+      restore_sectors(dev);
+    else
+      do_fdisk(dev);
+
+    return 0;
+}
+
+/*
+ *  H. Listing the current situation
+ */
+
+static int
+my_open (char *dev, int rw, int silent) {
+    int fd, mode;
+
+    mode = (rw ? O_RDWR : O_RDONLY);
+    fd = open(dev, mode);
+    if (fd < 0 && !silent) {
+	perror(dev);
+	if (rw)
+		fatal(_("cannot open %s read-write\n"), dev);
+	else
+		fatal(_("cannot open %s for reading\n"), dev);
+    }
+    return fd;
+}
+
+static void
+do_list (char *dev, int silent) {
+    int fd;
+    struct disk_desc *z;
+
+    fd = my_open(dev, 0, silent);
+    if (fd < 0)
+	return;
+
+    z = &oldp;
+
+    free_sectors();
+    get_cylindersize(dev, fd, dump ? 1 : opt_list ? 0 : 1);
+    get_partitions(dev, fd, z);
+
+    if (opt_list)
+      out_partitions(dev, z);
+
+    if (verify) {
+	if (partitions_ok(z))
+	  warn(_("%s: OK\n"), dev);
+	else
+	  exit_status = 1;
+    }
+
+    close(fd);
+}
+
+static void
+do_geom (char *dev, int silent) {
+    int fd;
+    struct geometry R;
+
+    fd = my_open(dev, 0, silent);
+    if (fd < 0)
+	return;
+
+    R = get_geometry(dev, fd, silent);
+    if (R.cylinders)
+	printf(_("%s: %ld cylinders, %ld heads, %ld sectors/track\n"),
+	       dev, R.cylinders, R.heads, R.sectors);
+
+    close(fd);
+}
+
+static void
+do_pt_geom (char *dev, int silent) {
+    int fd;
+    struct disk_desc *z;
+    struct geometry R;
+
+    fd = my_open(dev, 0, silent);
+    if (fd < 0)
+	return;
+
+    z = &oldp;
+
+    free_sectors();
+    get_cylindersize(dev, fd, 1);
+    get_partitions(dev, fd, z);
+
+    R = B;
+
+    if (z->partno != 0 && get_fdisk_geometry(z)) {
+	    R.heads = F.heads;
+	    R.sectors = F.sectors;
+	    R.cylindersize = R.heads * R.sectors;
+	    R.cylinders = (R.cylindersize == 0) ? 0 :
+		    R.total_size / R.cylindersize;
+    }
+
+    if (R.cylinders)
+	printf(_("%s: %ld cylinders, %ld heads, %ld sectors/track\n"),
+	       dev, R.cylinders, R.heads, R.sectors);
+
+    close(fd);
+}
+
+/* for compatibility with earlier fdisk: provide option -s */
+static void
+do_size (char *dev, int silent) {
+    int fd;
+    unsigned long long size;
+
+    fd = my_open(dev, 0, silent);
+    if (fd < 0)
+	return;
+
+    if (blkdev_get_sectors(fd, &size) == -1) {
+	if (!silent) {
+	    perror(dev);
+	    fatal(_("Cannot get size of %s\n"), dev);
+	}
+	return;
+    }
+
+    size /= 2;			/* convert sectors to blocks */
+
+    /* a CDROM drive without mounted CD yields MAXINT */
+    if (silent && size == ((1<<30)-1))
+      return;
+
+    if (silent)
+      printf("%s: %9llu\n", dev, size);
+    else
+      printf("%llu\n", size);
+
+    total_size += size;
+
+    close(fd);
+}
+
+/*
+ * Activate: usually one wants to have a single primary partition
+ * to be active. OS/2 fdisk makes non-bootable logical partitions
+ * active - I don't know what that means to OS/2 Boot Manager.
+ *
+ * Call: activate /dev/hda 2 5 7	make these partitions active
+ *					and the remaining ones inactive
+ * Or:   sfdisk -A /dev/hda 2 5 7
+ *
+ * If only a single partition must be active, one may also use the form
+ *       sfdisk -A2 /dev/hda
+ *
+ * With "activate /dev/hda" or "sfdisk -A /dev/hda" the active partitions
+ * are listed but not changed. To get zero active partitions, use
+ * "activate /dev/hda none" or "sfdisk -A /dev/hda none".
+ * Use something like `echo ",,,*" | sfdisk -N2 /dev/hda' to only make
+ * /dev/hda2 active, without changing other partitions.
+ *
+ * A warning will be given if after the change not precisely one primary
+ * partition is active.
+ *
+ * The present syntax was chosen to be (somewhat) compatible with the
+ * activate from the LILO package.
+ */
+static void
+set_active (struct disk_desc *z, char *pnam) {
+    int pno;
+
+    pno = asc_to_index(pnam, z);
+    if (z->partitions[pno].ptype == DOS_TYPE)
+	    z->partitions[pno].p.bootable = 0x80;
+}
+
+static void
+do_activate (char **av, int ac, char *arg) {
+    char *dev = av[0];
+    int fd;
+    int rw, i, pno, lpno;
+    struct disk_desc *z;
+
+    z = &oldp;
+
+    rw = (!no_write && (arg || ac > 1));
+    fd = my_open(dev, rw, 0);
+
+    free_sectors();
+    get_cylindersize(dev, fd, 1);
+    get_partitions(dev, fd, z);
+
+    if (!arg && ac == 1) {
+	/* list active partitions */
+	for (pno=0; pno < z->partno; pno++) {
+	    if (z->partitions[pno].p.bootable) {
+		lpno = index_to_linux(pno, z);
+		if (pno == linux_to_index(lpno, z))
+		  printf("%s\n", partname(dev, lpno, 0));
+		else
+		  printf("%s#%d\n", dev, pno);
+		if (z->partitions[pno].p.bootable != 0x80)
+		  warn(_("bad active byte: 0x%x instead of 0x80\n"),
+		       z->partitions[pno].p.bootable);
+	    }
+	}
+    } else {
+	/* clear `active byte' everywhere */
+	for (pno=0; pno < z->partno; pno++)
+	    if (z->partitions[pno].ptype == DOS_TYPE)
+		z->partitions[pno].p.bootable = 0;
+
+	/* then set where desired */
+	if (ac == 1)
+	  set_active(z, arg);
+	else for(i=1; i<ac; i++)
+	  set_active(z, av[i]);
+
+	/* then write to disk */
+	if (write_partitions(dev, fd, z))
+	  warn(_("Done\n\n"));
+	else
+	  exit_status = 1;
+    }
+    i = 0;
+    for (pno=0; pno < z->partno && pno < 4; pno++)
+      if (z->partitions[pno].p.bootable)
+	i++;
+    if (i != 1)
+      warn(_("You have %d active primary partitions. This does not matter for LILO,\n"
+	   "but the DOS MBR will only boot a disk with 1 active partition.\n"), i);
+
+    close(fd);
+}
+
+static void
+set_unhidden (struct disk_desc *z, char *pnam) {
+    int pno;
+    unsigned char id;
+
+    pno = asc_to_index(pnam, z);
+    id = z->partitions[pno].p.sys_type;
+    if (id == 0x11 || id == 0x14 || id == 0x16 || id == 0x17)
+      id -= 0x10;
+    else
+      fatal(_("partition %s has id %x and is not hidden\n"), pnam, id);
+    z->partitions[pno].p.sys_type = id;
+}
+
+/*
+ * maybe remove and make part of --change-id
+ */
+static void
+do_unhide (char **av, int ac, char *arg) {
+    char *dev = av[0];
+    int fd, rw, i;
+    struct disk_desc *z;
+
+    z = &oldp;
+
+    rw = !no_write;
+    fd = my_open(dev, rw, 0);
+
+    free_sectors();
+    get_cylindersize(dev, fd, 1);
+    get_partitions(dev, fd, z);
+
+    /* unhide where desired */
+    if (ac == 1)
+      set_unhidden(z, arg);
+    else for(i=1; i<ac; i++)
+      set_unhidden(z, av[i]);
+
+    /* then write to disk */
+    if (write_partitions(dev, fd, z))
+      warn(_("Done\n\n"));
+    else
+      exit_status = 1;
+
+    close(fd);
+}
+
+static void
+do_change_id(char *dev, char *pnam, char *id) {
+    int fd, rw, pno;
+    struct disk_desc *z;
+    unsigned long i;
+
+    z = &oldp;
+
+    rw = !no_write;
+    fd = my_open(dev, rw, 0);
+
+    free_sectors();
+    get_cylindersize(dev, fd, 1);
+    get_partitions(dev, fd, z);
+
+    pno = asc_to_index(pnam, z);
+    if (id == 0) {
+      printf("%x\n", z->partitions[pno].p.sys_type);
+      return;
+    }
+    i = strtoul(id, NULL, 16);
+    if (i > 255)
+      fatal(_("Bad Id %lx\n"), i);
+    z->partitions[pno].p.sys_type = i;
+
+    if (write_partitions(dev, fd, z))
+      warn(_("Done\n\n"));
+    else
+      exit_status = 1;
+
+    close(fd);
+}
+
+static void
+do_reread(char *dev) {
+    int fd;
+
+    fd = my_open(dev, 0, 0);
+    if (reread_ioctl(fd))
+      do_warn(_("This disk is currently in use.\n"));
+
+    close(fd);
+}
+
+/*
+ *  I. Writing the new situation
+ */
+
+static void
+do_fdisk(char *dev){
+    int fd;
+    int c, answer;
+    struct stat statbuf;
+    int interactive = isatty(0);
+    struct disk_desc *z;
+
+    if (stat(dev, &statbuf) < 0) {
+	perror(dev);
+	fatal(_("Fatal error: cannot find %s\n"), dev);
+    }
+    if (!S_ISBLK(statbuf.st_mode)) {
+	do_warn(_("Warning: %s is not a block device\n"), dev);
+	no_reread = 1;
+    }
+    fd = my_open(dev, !no_write, 0);
+
+    if (!no_write && !no_reread) {
+	warn(_("Checking that no-one is using this disk right now ...\n"));
+	if (reread_ioctl(fd)) {
+	    do_warn(_("\nThis disk is currently in use - repartitioning is probably a bad idea.\n"
+		   "Umount all file systems, and swapoff all swap partitions on this disk.\n"
+		   "Use the --no-reread flag to suppress this check.\n"));
+	    if (!force) {
+		do_warn(_("Use the --force flag to overrule all checks.\n"));
+		exit(1);
+	    }
+	} else
+	  warn(_("OK\n"));
+    }
+
+    z = &oldp;
+
+    free_sectors();
+    get_cylindersize(dev, fd, 0);
+    get_partitions(dev, fd, z);
+
+    printf(_("Old situation:\n"));
+    out_partitions(dev, z);
+
+    if (one_only && (one_only_pno = linux_to_index(one_only, z)) < 0)
+      fatal(_("Partition %d does not exist, cannot change it\n"), one_only);
+
+    z = &newp;
+
+    while(1) {
+
+	read_input(dev, interactive, z);
+
+	printf(_("New situation:\n"));
+	out_partitions(dev, z);
+
+	if (!partitions_ok(z) && !force) {
+	    if (!interactive)
+	      fatal(_("I don't like these partitions - nothing changed.\n"
+		      "(If you really want this, use the --force option.)\n"));
+	    else
+	      do_warn(_("I don't like this - probably you should answer No\n"));
+	}
+      ask:
+	if (interactive) {
+	    if (no_write)
+	      printf(_("Are you satisfied with this? [ynq] "));
+	    else
+	      printf(_("Do you want to write this to disk? [ynq] "));
+	    answer = c = getchar();
+	    while (c != '\n' && c != EOF)
+	      c = getchar();
+	    if (c == EOF)
+		printf(_("\nsfdisk: premature end of input\n"));
+	    if (c == EOF || answer == 'q' || answer == 'Q') {
+		fatal(_("Quitting - nothing changed\n"));
+	    } else if (answer == 'n' || answer == 'N') {
+		continue;
+	    } else if (answer == 'y' || answer == 'Y') {
+		break;
+	    } else {
+		printf(_("Please answer one of y,n,q\n"));
+		goto ask;
+	    }
+	} else
+	  break;
+    }
+
+    if (write_partitions(dev, fd, z))
+      printf(_("Successfully wrote the new partition table\n\n"));
+    else
+      exit_status = 1;
+
+    reread_disk_partition(dev, fd);
+
+    warn(_("If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)\n"
+	 "to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1\n"
+	 "(See fdisk(8).)\n"));
+
+    sync();			/* superstition */
+    exit(exit_status);
+}
diff --git a/util-linux-ng-2.17.2/fdisk/sfdisk.examples b/util-linux-ng-2.17.2/fdisk/sfdisk.examples
new file mode 100644
index 0000000..13e671d
--- /dev/null
+++ b/util-linux-ng-2.17.2/fdisk/sfdisk.examples
@@ -0,0 +1,264 @@
+Examples of the use of sfdisk 3.0 (to partition a disk)
+Input lines have fields <start>,<size>,<type>... - see sfdisk.8.
+Usually no <start> is given, and input lines start with a comma.
+
+Before doing anything with a disk, make sure it is not in use;
+unmount all its file systems, and say swapoff to its swap partitions.
+(The final BLKRRPART ioctl will fail if anything else still uses
+the disk, and you will have to reboot. It is easier to first make
+sure that nothing uses the disk, e.g., by testing:
+	% umount /dev/sdb1
+	% sfdisk -R /dev/sdb
+	BLKRRPART: Device or resource busy
+      * Device busy for revalidation (usage=2)
+	% swapoff /dev/sdb3
+	% sfdisk -R /dev/sdb
+      * sdb: sdb1 < sdb5 sdb6 > sdb3
+	%
+Note that the starred messages are kernel messages, that may be
+logged somewhere, or written to some other console.
+In sfdisk 3.01 sfdisk automatically does this check, unless told not to.)
+
+1. One big partition:
+	sfdisk /dev/hda << EOF
+	;
+	EOF
+
+(If there was garbage on the disk before, you may get error messages
+like: `ERROR: sector 0 does not have an msdos signature'
+and `/dev/hda: unrecognized partition'. This does not matter
+if you write an entirely fresh partition table anyway.)
+
+The output will be:
+-----------------------------------------------------------------------
+Old situation:
+...
+New situation:
+Units = cylinders of 208896 bytes, blocks of 1024 bytes, counting from 0
+
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+   1023    1024-   208895+  83  Linux native
+Successfully wrote the new partition table
+  hda: hda1
+-----------------------------------------------------------------------
+Writing and rereading the partition table takes a few seconds -
+don't be alarmed if nothing happens for six seconds or so.
+
+
+2. Three primary partitions: two of size 50MB and the rest:
+	sfdisk /dev/hda -uM << EOF
+	,50
+	,50
+	;
+	EOF
+-----------------------------------------------------------------------
+New situation:
+Units = megabytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
+
+   Device Boot Start   End     MB   #blocks   Id  System
+/dev/hda1         0+    50-    51-    51203+  83  Linux native
+/dev/hda2        50+   100-    51-    51204   83  Linux native
+/dev/hda3       100+   203    104-   106488   83  Linux native
+Successfully wrote the new partition table
+  hda: hda1 hda2 hda3
+-----------------------------------------------------------------------
+/dev/hda1 is one block (in fact only half a block) shorter than
+/dev/hda2 because its start had to be shifted away from zero in
+order to leave room for the Master Boot Record (MBR).
+
+
+3. A 1MB OS2 Boot Manager partition, a 50MB DOS partition,
+   and three extended partitions (DOS D:, Linux swap, Linux):
+	sfdisk /dev/hda -uM << EOF
+	,1,a
+	,50,6
+	,,E
+	;
+	,20,4
+	,16,S
+	;
+	EOF
+-----------------------------------------------------------------------
+   Device Boot Start   End     MB   #blocks   Id  System
+/dev/hda1         0+     1-     2-     1223+   a  OS/2 Boot Manager
+/dev/hda2         1+    51-    51-    51204    6  DOS 16-bit FAT >=32M
+/dev/hda3        51+   203    153-   156468    5  Extended
+/dev/hda4         0      -      0         0    0  Empty
+/dev/hda5        51+    71-    21-    20603+   4  DOS 16-bit FAT <32M
+/dev/hda6        71+    87-    17-    16523+  82  Linux swap
+/dev/hda7        87+   203    117-   119339+  83  Linux native
+Successfully wrote the new partition table
+  hda: hda1 hda2 hda3 < hda5 hda6 hda7 >
+-----------------------------------------------------------------------
+All these rounded numbers look better in cylinder units:
+	% sfdisk -l /dev/hda
+-----------------------------------------------------------------------
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+      5       6-     1223+   a  OS/2 Boot Manager
+/dev/hda2          6     256     251     51204    6  DOS 16-bit FAT >=32M
+/dev/hda3        257    1023     767    156468    5  Extended
+/dev/hda4          0       -       0         0    0  Empty
+/dev/hda5        257+    357     101-    20603+   4  DOS 16-bit FAT <32M
+/dev/hda6        358+    438      81-    16523+  82  Linux swap
+/dev/hda7        439+   1023     585-   119339+  83  Linux native
+-----------------------------------------------------------------------
+But still - why does /dev/hda5 not start on a cylinder boundary?
+Because it is contained in an extended partition that does.
+Of the chain of extended partitions, usually only the first is
+shown. (The others have no name under Linux anyway.) But
+these additional extended partitions can be made visible:
+	% sfdisk -l -x /dev/hda
+-----------------------------------------------------------------------
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+      5       6-     1223+   a  OS/2 Boot Manager
+/dev/hda2          6     256     251     51204    6  DOS 16-bit FAT >=32M
+/dev/hda3        257    1023     767    156468    5  Extended
+/dev/hda4          0       -       0         0    0  Empty
+
+/dev/hda5        257+    357     101-    20603+   4  DOS 16-bit FAT <32M
+    -            358    1023     666    135864    5  Extended
+    -            257     256       0         0    0  Empty
+    -            257     256       0         0    0  Empty
+
+/dev/hda6        358+    438      81-    16523+  82  Linux swap
+    -            439    1023     585    119340    5  Extended
+    -            358     357       0         0    0  Empty
+    -            358     357       0         0    0  Empty
+
+/dev/hda7        439+   1023     585-   119339+  83  Linux native
+    -            439     438       0         0    0  Empty
+    -            439     438       0         0    0  Empty
+    -            439     438       0         0    0  Empty
+-----------------------------------------------------------------------
+
+Why the empty 4th input line? The description of the extended partitions
+starts after that of the four primary partitions.
+You force an empty partition with a ",0" input line, but here all
+space was divided already, so the fourth partition became empty
+automatically.
+
+How did I know about 4,6,a,E,S? Well, E,S,L stand for Extended,
+Swap and Linux. The other values are hexadecimal and come from
+the table:
+	% sfdisk -T
+	Id  Name
+	
+	 0  Empty
+	 1  DOS 12-bit FAT
+	 2  XENIX root
+	 3  XENIX usr
+	 4  DOS 16-bit FAT <32M
+	 5  Extended
+	 6  DOS 16-bit FAT >=32M
+	 7  OS/2 HPFS or QNX or Advanced UNIX
+	 8  AIX data
+	 9  AIX boot or Coherent
+	 a  OS/2 Boot Manager
+	...
+
+
+4. Preserving the sectors changed by sfdisk.
+	% sfdisk -O save-hdd-partition-sectors /dev/hda
+        ...
+   will write the sectors overwritten by sfdisk to file.
+   If you notice that you trashed some partition, you may
+   be able to restore things by
+	% sfdisk -I save-hdd-partition-sectors /dev/hda
+	%
+
+5. Preserving some old partitions.
+	% sfdisk -N2 /dev/hda
+	...
+   will only change the partition /dev/hda2, and leave the rest
+   unchanged. The most obvious application is to change an Id:
+	% sfdisk -N7 /dev/hda
+	,,63
+	%
+-----------------------------------------------------------------------
+Old situation:
+
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+      5       6-     1223+   a  OS/2 Boot Manager
+...
+/dev/hda6        358+    438      81-    16523+  82  Linux swap
+/dev/hda7        439+   1023     585-   119339+  83  Linux native
+
+New situation:
+
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+      5       6-     1223+   a  OS/2 Boot Manager
+...
+/dev/hda6        358+    438      81-    16523+  82  Linux swap
+/dev/hda7        439+   1023     585-   119339+  63  GNU HURD
+-----------------------------------------------------------------------
+   Note that changing a logical partition into an empty partition
+   will decrease the number of all subsequent logical partitions.   
+
+6. Deleting a partition.
+At first I thought of having an option -X# for deleting partitions,
+but there are several ways in which a partition can be deleted, and
+it is probably better to handle this just as a general change.
+	% sfdisk -d /dev/hda > ohda
+will write the current tables on the file `ohda'.
+-----------------------------------------------------------------------
+% cat ohda
+# partition table of /dev/hda
+unit: sectors
+
+/dev/hda1 : start=        1, size=   40799, Id= 5
+/dev/hda2 : start=    40800, size=   40800, Id=83
+/dev/hda3 : start=    81600, size=  336192, Id=83
+/dev/hda4 : start=        0, size=       0, Id= 0
+/dev/hda5 : start=        2, size=   40798, Id=83
+-----------------------------------------------------------------------
+In order to delete the partition on /dev/hda3, edit this file
+and feed the result to sfdisk again.
+-----------------------------------------------------------------------
+% emacs ohda
+% cat ohda
+# partition table of /dev/hda
+unit: sectors
+
+/dev/hda1 : start=        1, size=   40799, Id= 5
+/dev/hda2 : start=    40800, size=   40800, Id=83
+/dev/hda3 : start=        0, size=       0, Id= 0
+/dev/hda4 : start=        0, size=       0, Id= 0
+/dev/hda5 : start=        2, size=   40798, Id=83
+% sfdisk /dev/hda < ohda
+Old situation:
+Units = cylinders of 208896 bytes, blocks of 1024 bytes, counting from 0
+
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+     99     100-    20399+   5  Extended
+/dev/hda2        100     199     100     20400   83  Linux native
+/dev/hda3        200    1023     824    168096   83  Linux native
+/dev/hda4          0       -       0         0    0  Empty
+/dev/hda5          0+     99     100-    20399   83  Linux native
+New situation:
+Units = sectors of 512 bytes, counting from 0
+
+   Device Boot    Start       End  #sectors  Id  System
+/dev/hda1             1     40799     40799   5  Extended
+/dev/hda2         40800     81599     40800  83  Linux native
+/dev/hda3             0         -         0   0  Empty
+/dev/hda4             0         -         0   0  Empty
+/dev/hda5             2     40799     40798  83  Linux native
+Successfully wrote the new partition table
+% sfdisk -l -V /dev/hda
+
+Disk /dev/hda: 12 heads, 34 sectors, 1024 cylinders
+Units = cylinders of 208896 bytes, blocks of 1024 bytes, counting from 0
+
+   Device Boot Start     End   #cyls   #blocks   Id  System
+/dev/hda1          0+     99     100-    20399+   5  Extended
+/dev/hda2        100     199     100     20400   83  Linux native
+/dev/hda3          0       -       0         0    0  Empty
+/dev/hda4          0       -       0         0    0  Empty
+/dev/hda5          0+     99     100-    20399   83  Linux native
+/dev/hda: OK
+-----------------------------------------------------------------------
+This is a good way of making changes: dump the current status
+to file, edit the file, and feed it to sfdisk.
+Preserving the file on some other disk could be useful:
+if ever the MBR gets thrashed it can be used to restore
+the old situation.
diff --git a/util-linux-ng-2.17.2/fsck/Makefile.am b/util-linux-ng-2.17.2/fsck/Makefile.am
new file mode 100644
index 0000000..203d36b
--- /dev/null
+++ b/util-linux-ng-2.17.2/fsck/Makefile.am
@@ -0,0 +1,17 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+sbin_PROGRAMS = fsck
+dist_man_MANS = fsck.8
+
+fsck_SOURCES = base_device.c fsck.c fsck.h ../lib/ismounted.c \
+	       ../lib/fsprobe.c ../lib/canonicalize.c
+fsck_LDADD =
+fsck_CFLAGS = $(AM_CFLAGS)
+
+if BUILD_LIBBLKID
+fsck_LDADD += $(ul_libblkid_la)
+fsck_CFLAGS += -I$(ul_libblkid_incdir)
+else
+fsck_LDADD += $(BLKID_LIBS)
+fsck_CFLAGS += $(BLKID_CFLAGS)
+endif
diff --git a/util-linux-ng-2.17.2/fsck/Makefile.in b/util-linux-ng-2.17.2/fsck/Makefile.in
new file mode 100644
index 0000000..d59b568
--- /dev/null
+++ b/util-linux-ng-2.17.2/fsck/Makefile.in
@@ -0,0 +1,780 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(dist_man_MANS) $(dist_noinst_DATA) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config/include-Makefile.am
+sbin_PROGRAMS = fsck$(EXEEXT)
+@BUILD_LIBBLKID_TRUE@am__append_1 = $(ul_libblkid_la)
+@BUILD_LIBBLKID_TRUE@am__append_2 = -I$(ul_libblkid_incdir)
+@BUILD_LIBBLKID_FALSE@am__append_3 = $(BLKID_LIBS)
+@BUILD_LIBBLKID_FALSE@am__append_4 = $(BLKID_CFLAGS)
+subdir = fsck
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
+PROGRAMS = $(sbin_PROGRAMS)
+am_fsck_OBJECTS = fsck-base_device.$(OBJEXT) fsck-fsck.$(OBJEXT) \
+	fsck-ismounted.$(OBJEXT) fsck-fsprobe.$(OBJEXT) \
+	fsck-canonicalize.$(OBJEXT)
+fsck_OBJECTS = $(am_fsck_OBJECTS)
+am__DEPENDENCIES_1 =
+@BUILD_LIBBLKID_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+fsck_DEPENDENCIES = $(am__append_1) $(am__DEPENDENCIES_2)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+fsck_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(fsck_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(fsck_SOURCES)
+DIST_SOURCES = $(fsck_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(dist_man_MANS)
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+dist_man_MANS = fsck.8
+fsck_SOURCES = base_device.c fsck.c fsck.h ../lib/ismounted.c \
+	       ../lib/fsprobe.c ../lib/canonicalize.c
+
+fsck_LDADD = $(am__append_1) $(am__append_3)
+fsck_CFLAGS = $(AM_CFLAGS) $(am__append_2) $(am__append_4)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fsck/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign fsck/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
+$(am__aclocal_m4_deps):
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+fsck$(EXEEXT): $(fsck_OBJECTS) $(fsck_DEPENDENCIES) 
+	@rm -f fsck$(EXEEXT)
+	$(AM_V_CCLD)$(fsck_LINK) $(fsck_OBJECTS) $(fsck_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-base_device.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-canonicalize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-fsck.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-fsprobe.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-ismounted.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+fsck-base_device.o: base_device.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-base_device.o -MD -MP -MF $(DEPDIR)/fsck-base_device.Tpo -c -o fsck-base_device.o `test -f 'base_device.c' || echo '$(srcdir)/'`base_device.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-base_device.Tpo $(DEPDIR)/fsck-base_device.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='base_device.c' object='fsck-base_device.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-base_device.o `test -f 'base_device.c' || echo '$(srcdir)/'`base_device.c
+
+fsck-base_device.obj: base_device.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-base_device.obj -MD -MP -MF $(DEPDIR)/fsck-base_device.Tpo -c -o fsck-base_device.obj `if test -f 'base_device.c'; then $(CYGPATH_W) 'base_device.c'; else $(CYGPATH_W) '$(srcdir)/base_device.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-base_device.Tpo $(DEPDIR)/fsck-base_device.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='base_device.c' object='fsck-base_device.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-base_device.obj `if test -f 'base_device.c'; then $(CYGPATH_W) 'base_device.c'; else $(CYGPATH_W) '$(srcdir)/base_device.c'; fi`
+
+fsck-fsck.o: fsck.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-fsck.o -MD -MP -MF $(DEPDIR)/fsck-fsck.Tpo -c -o fsck-fsck.o `test -f 'fsck.c' || echo '$(srcdir)/'`fsck.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-fsck.Tpo $(DEPDIR)/fsck-fsck.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fsck.c' object='fsck-fsck.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-fsck.o `test -f 'fsck.c' || echo '$(srcdir)/'`fsck.c
+
+fsck-fsck.obj: fsck.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-fsck.obj -MD -MP -MF $(DEPDIR)/fsck-fsck.Tpo -c -o fsck-fsck.obj `if test -f 'fsck.c'; then $(CYGPATH_W) 'fsck.c'; else $(CYGPATH_W) '$(srcdir)/fsck.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-fsck.Tpo $(DEPDIR)/fsck-fsck.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fsck.c' object='fsck-fsck.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-fsck.obj `if test -f 'fsck.c'; then $(CYGPATH_W) 'fsck.c'; else $(CYGPATH_W) '$(srcdir)/fsck.c'; fi`
+
+fsck-ismounted.o: ../lib/ismounted.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-ismounted.o -MD -MP -MF $(DEPDIR)/fsck-ismounted.Tpo -c -o fsck-ismounted.o `test -f '../lib/ismounted.c' || echo '$(srcdir)/'`../lib/ismounted.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-ismounted.Tpo $(DEPDIR)/fsck-ismounted.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/ismounted.c' object='fsck-ismounted.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-ismounted.o `test -f '../lib/ismounted.c' || echo '$(srcdir)/'`../lib/ismounted.c
+
+fsck-ismounted.obj: ../lib/ismounted.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-ismounted.obj -MD -MP -MF $(DEPDIR)/fsck-ismounted.Tpo -c -o fsck-ismounted.obj `if test -f '../lib/ismounted.c'; then $(CYGPATH_W) '../lib/ismounted.c'; else $(CYGPATH_W) '$(srcdir)/../lib/ismounted.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-ismounted.Tpo $(DEPDIR)/fsck-ismounted.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/ismounted.c' object='fsck-ismounted.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-ismounted.obj `if test -f '../lib/ismounted.c'; then $(CYGPATH_W) '../lib/ismounted.c'; else $(CYGPATH_W) '$(srcdir)/../lib/ismounted.c'; fi`
+
+fsck-fsprobe.o: ../lib/fsprobe.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-fsprobe.o -MD -MP -MF $(DEPDIR)/fsck-fsprobe.Tpo -c -o fsck-fsprobe.o `test -f '../lib/fsprobe.c' || echo '$(srcdir)/'`../lib/fsprobe.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-fsprobe.Tpo $(DEPDIR)/fsck-fsprobe.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/fsprobe.c' object='fsck-fsprobe.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-fsprobe.o `test -f '../lib/fsprobe.c' || echo '$(srcdir)/'`../lib/fsprobe.c
+
+fsck-fsprobe.obj: ../lib/fsprobe.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-fsprobe.obj -MD -MP -MF $(DEPDIR)/fsck-fsprobe.Tpo -c -o fsck-fsprobe.obj `if test -f '../lib/fsprobe.c'; then $(CYGPATH_W) '../lib/fsprobe.c'; else $(CYGPATH_W) '$(srcdir)/../lib/fsprobe.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-fsprobe.Tpo $(DEPDIR)/fsck-fsprobe.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/fsprobe.c' object='fsck-fsprobe.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-fsprobe.obj `if test -f '../lib/fsprobe.c'; then $(CYGPATH_W) '../lib/fsprobe.c'; else $(CYGPATH_W) '$(srcdir)/../lib/fsprobe.c'; fi`
+
+fsck-canonicalize.o: ../lib/canonicalize.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-canonicalize.o -MD -MP -MF $(DEPDIR)/fsck-canonicalize.Tpo -c -o fsck-canonicalize.o `test -f '../lib/canonicalize.c' || echo '$(srcdir)/'`../lib/canonicalize.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-canonicalize.Tpo $(DEPDIR)/fsck-canonicalize.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/canonicalize.c' object='fsck-canonicalize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-canonicalize.o `test -f '../lib/canonicalize.c' || echo '$(srcdir)/'`../lib/canonicalize.c
+
+fsck-canonicalize.obj: ../lib/canonicalize.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-canonicalize.obj -MD -MP -MF $(DEPDIR)/fsck-canonicalize.Tpo -c -o fsck-canonicalize.obj `if test -f '../lib/canonicalize.c'; then $(CYGPATH_W) '../lib/canonicalize.c'; else $(CYGPATH_W) '$(srcdir)/../lib/canonicalize.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/fsck-canonicalize.Tpo $(DEPDIR)/fsck-canonicalize.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/canonicalize.c' object='fsck-canonicalize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-canonicalize.obj `if test -f '../lib/canonicalize.c'; then $(CYGPATH_W) '../lib/canonicalize.c'; else $(CYGPATH_W) '$(srcdir)/../lib/canonicalize.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man8: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(sbindir)" "$(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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool clean-sbinPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-sbinPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-man8 install-pdf install-pdf-am install-ps \
+	install-ps-am install-sbinPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-man uninstall-man8 \
+	uninstall-sbinPROGRAMS
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/fsck/base_device.c b/util-linux-ng-2.17.2/fsck/base_device.c
new file mode 100644
index 0000000..aad2ba0
--- /dev/null
+++ b/util-linux-ng-2.17.2/fsck/base_device.c
@@ -0,0 +1,169 @@
+/*
+ * base_device.c
+ *
+ * Return the "base device" given a particular device; this is used to
+ * assure that we only fsck one partition on a particular drive at any
+ * one time.  Otherwise, the disk heads will be seeking all over the
+ * place.  If the base device can not be determined, return NULL.
+ *
+ * The base_device() function returns an allocated string which must
+ * be freed.
+ *
+ * Written by Theodore Ts'o, <tytso@mit.edu>
+ *
+ * Copyright (C) 2000 Theodore Ts'o.
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
+ */
+#include <stdio.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <ctype.h>
+#include <string.h>
+
+#include "fsck.h"
+
+/*
+ * Required for the uber-silly devfs /dev/ide/host1/bus2/target3/lun3
+ * pathames.
+ */
+static const char *devfs_hier[] = {
+	"host", "bus", "target", "lun", 0
+};
+
+char *base_device(const char *device)
+{
+	char *str, *cp;
+	const char **hier, *disk;
+	int len;
+
+	str = malloc(strlen(device)+1);
+	if (!str)
+		return NULL;
+	strcpy(str, device);
+	cp = str;
+
+	/* Skip over /dev/; if it's not present, give up. */
+	if (strncmp(cp, "/dev/", 5) != 0)
+		goto errout;
+	cp += 5;
+
+	/* Skip over /dev/dsk/... */
+	if (strncmp(cp, "dsk/", 4) == 0)
+		cp += 4;
+
+	/*
+	 * For md devices, we treat them all as if they were all
+	 * on one disk, since we don't know how to parallelize them.
+	 */
+	if (cp[0] == 'm' && cp[1] == 'd') {
+		*(cp+2) = 0;
+		return str;
+	}
+
+	/* Handle DAC 960 devices */
+	if (strncmp(cp, "rd/", 3) == 0) {
+		cp += 3;
+		if (cp[0] != 'c' || cp[2] != 'd' ||
+		    !isdigit(cp[1]) || !isdigit(cp[3]))
+			goto errout;
+		*(cp+4) = 0;
+		return str;
+	}
+
+	/* Now let's handle /dev/hd* and /dev/sd* devices.... */
+	if ((cp[0] == 'h' || cp[0] == 's') && (cp[1] == 'd')) {
+		cp += 2;
+		/* If there's a single number after /dev/hd, skip it */
+		if (isdigit(*cp))
+			cp++;
+		/* What follows must be an alpha char, or give up */
+		if (!isalpha(*cp))
+			goto errout;
+		*(cp + 1) = 0;
+		return str;
+	}
+
+	/* Now let's handle devfs (ugh) names */
+	len = 0;
+	if (strncmp(cp, "ide/", 4) == 0)
+		len = 4;
+	if (strncmp(cp, "scsi/", 5) == 0)
+		len = 5;
+	if (len) {
+		cp += len;
+		/*
+		 * Now we proceed down the expected devfs hierarchy.
+		 * i.e., .../host1/bus2/target3/lun4/...
+		 * If we don't find the expected token, followed by
+		 * some number of digits at each level, abort.
+		 */
+		for (hier = devfs_hier; *hier; hier++) {
+			len = strlen(*hier);
+			if (strncmp(cp, *hier, len) != 0)
+				goto errout;
+			cp += len;
+			while (*cp != '/' && *cp != 0) {
+				if (!isdigit(*cp))
+					goto errout;
+				cp++;
+			}
+			cp++;
+		}
+		*(cp - 1) = 0;
+		return str;
+	}
+
+	/* Now handle devfs /dev/disc or /dev/disk names */
+	disk = 0;
+	if (strncmp(cp, "discs/", 6) == 0)
+		disk = "disc";
+	else if (strncmp(cp, "disks/", 6) == 0)
+		disk = "disk";
+	if (disk) {
+		cp += 6;
+		if (strncmp(cp, disk, 4) != 0)
+			goto errout;
+		cp += 4;
+		while (*cp != '/' && *cp != 0) {
+			if (!isdigit(*cp))
+				goto errout;
+			cp++;
+		}
+		*cp = 0;
+		return str;
+	}
+
+errout:
+	free(str);
+	return NULL;
+}
+
+#ifdef DEBUG
+int main(int argc, char** argv)
+{
+	const char *base;
+	char  buf[256], *cp;
+
+	while (1) {
+		if (fgets(buf, sizeof(buf), stdin) == NULL)
+			break;
+		cp = strchr(buf, '\n');
+		if (cp)
+			*cp = 0;
+		cp = strchr(buf, '\t');
+		if (cp)
+			*cp = 0;
+		base = base_device(buf);
+		printf("%s\t%s\n", buf, base ? base : "NONE");
+	}
+	exit(0);
+}
+#endif
diff --git a/util-linux-ng-2.17.2/fsck/fsck.8 b/util-linux-ng-2.17.2/fsck/fsck.8
new file mode 100644
index 0000000..fd1e7e2
--- /dev/null
+++ b/util-linux-ng-2.17.2/fsck/fsck.8
@@ -0,0 +1,424 @@
+.\" -*- nroff -*-
+.\" Copyright 1993, 1994, 1995 by Theodore Ts'o.  All Rights Reserved.
+.\" This file may be copied under the terms of the GNU Public License.
+.\"
+.TH FSCK 8 "February 2009" "Linux" "MAINTENANCE COMMANDS"
+.SH NAME
+fsck \- check and repair a Linux file system
+.SH SYNOPSIS
+.B fsck
+.RB [ \-sAVRTMNP ]
+.RB [ \-C
+.RI [ fd ]]
+.RB [ \-t
+.IR fstype ]
+.RI [ filesys ...]
+.RB [ \-\- ]
+.RI [ fs-specific-options ]
+.SH DESCRIPTION
+.B fsck
+is used to check and optionally repair one or more Linux file systems.
+.I filesys
+can be a device name (e.g.
+.IR /dev/hdc1 ", " /dev/sdb2 ),
+a mount point (e.g.
+.IR / ", " /usr ", " /home ),
+or an ext2 label or UUID specifier (e.g.
+UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
+Normally, the
+.B fsck
+program will try to handle filesystems on different physical disk drives
+in parallel to reduce the total amount of time needed to check all of the
+filesystems.
+.PP
+If no filesystems are specified on the command line, and the
+.B \-A
+option is not specified,
+.B fsck
+will default to checking filesystems in
+.B /etc/fstab
+serially.  This is equivalent to the
+.B \-As
+options.
+.PP
+The exit code returned by
+.B fsck
+is the sum of the following conditions:
+.br
+\	0\	\-\ No errors
+.br
+\	1\	\-\ File system errors corrected
+.br
+\	2\	\-\ System should be rebooted
+.br
+\	4\	\-\ File system errors left uncorrected
+.br
+\	8\	\-\ Operational error
+.br
+\	16\	\-\ Usage or syntax error
+.br
+\	32\	\-\ Fsck canceled by user request
+.br
+\	128\	\-\ Shared library error
+.br
+The exit code returned when multiple file systems are checked
+is the bit-wise OR of the exit codes for each
+file system that is checked.
+.PP
+In actuality,
+.B fsck
+is simply a front-end for the various file system checkers
+(\fBfsck\fR.\fIfstype\fR) available under Linux.  The file
+system-specific checker is searched for in
+.I /sbin
+first, then in
+.I /etc/fs
+and
+.IR /etc ,
+and finally in the directories listed in the PATH environment
+variable.  Please see the file system-specific checker manual pages for
+further details.
+.SH OPTIONS
+.TP
+.B \-s
+Serialize
+.B fsck
+operations.  This is a good idea if you are checking multiple
+filesystems and the checkers are in an interactive mode.  (Note:
+.BR e2fsck (8)
+runs in an interactive mode by default.  To make
+.BR e2fsck (8)
+run in a non-interactive mode, you must either specify the
+.B \-p
+or
+.B \-a
+option, if you wish for errors to be corrected automatically, or the
+.B \-n
+option if you do not.)
+.TP
+.BI \-t " fslist"
+Specifies the type(s) of file system to be checked.  When the
+.B \-A
+flag is specified, only filesystems that match
+.I fslist
+are checked.  The
+.I fslist
+parameter is a comma-separated list of filesystems and options
+specifiers.  All of the filesystems in this comma-separated list may be
+prefixed by a negation operator
+.RB ' no '
+or
+.RB ' ! ',
+which requests that only those filesystems not listed in
+.I fslist
+will be checked.  If all of the filesystems in
+.I fslist
+are not prefixed by a negation operator, then only those filesystems
+listed
+in
+.I fslist
+will be checked.
+.sp
+Options specifiers may be included in the comma-separated
+.IR fslist .
+They must have the format
+.BI opts= fs-option\fR.
+If an options specifier is present, then only filesystems which contain
+.I fs-option
+in their mount options field of
+.B /etc/fstab
+will be checked.  If the options specifier is prefixed by a negation
+operator, then only
+those filesystems that do not have
+.I fs-option
+in their mount options field of
+.B /etc/fstab
+will be checked.
+.sp
+For example, if
+.B opts=ro
+appears in
+.IR fslist ,
+then only filesystems listed in
+.B /etc/fstab
+with the
+.B ro
+option will be checked.
+.sp
+For compatibility with Mandrake distributions whose boot scripts
+depend upon an unauthorized UI change to the
+.B fsck
+program, if a filesystem type of
+.B loop
+is found in
+.IR fslist ,
+it is treated as if
+.B opts=loop
+were specified as an argument to the
+.B \-t
+option.
+.sp
+Normally, the filesystem type is deduced by searching for
+.I filesys
+in the
+.I /etc/fstab
+file and using the corresponding entry.
+If the type can not be deduced, and there is only a single filesystem
+given as an argument to the
+.B \-t
+option,
+.B fsck
+will use the specified filesystem type.  If this type is not
+available, then the default file system type (currently ext2) is used.
+.TP
+.B \-A
+Walk through the
+.I /etc/fstab
+file and try to check all file systems in one run.  This option is
+typically used from the
+.I /etc/rc
+system initialization file, instead of multiple commands for checking
+a single file system.
+.sp
+The root filesystem will be checked first unless the
+.B \-P
+option is specified (see below).  After that,
+filesystems will be checked in the order specified by the
+.I fs_passno
+(the sixth) field in the
+.I /etc/fstab
+file.
+Filesystems with a
+.I fs_passno
+value of 0 are skipped and are not checked at all.  Filesystems with a
+.I fs_passno
+value of greater than zero will be checked in order,
+with filesystems with the lowest
+.I fs_passno
+number being checked first.
+If there are multiple filesystems with the same pass number,
+fsck will attempt to check them in parallel, although it will avoid running
+multiple filesystem checks on the same physical disk.
+.sp
+Hence, a very common configuration in
+.I /etc/fstab
+files is to set the root filesystem to have a
+.I fs_passno
+value of 1
+and to set all other filesystems to have a
+.I fs_passno
+value of 2.  This will allow
+.B fsck
+to automatically run filesystem checkers in parallel if it is advantageous
+to do so.  System administrators might choose
+not to use this configuration if they need to avoid multiple filesystem
+checks running in parallel for some reason --- for example, if the
+machine in question is short on memory so that
+excessive paging is a concern.
+.sp
+.B fsck
+normally does not check whether the device actually exists before
+calling a file system specific checker. Therefore non-existing
+devices may cause the system to enter file system repair mode during
+boot if the filesystem specific checker returns a fatal error. The
+.B /etc/fstab
+mount option
+.B nofail
+may be used to have
+.B fsck
+skip non-existing devices.
+.B fsck
+also skips non-existing devices that have the special file system type
+.B auto
+.
+.TP
+.B \-C\fR [ \fI "fd" \fR ]
+Display completion/progress bars for those filesystem checkers (currently
+only for ext2 and ext3) which support them.   Fsck will manage the
+filesystem checkers so that only one of them will display
+a progress bar at a time.  GUI front-ends may specify a file descriptor
+.IR fd ,
+in which case the progress bar information will be sent to that file descriptor.
+.TP
+.B \-M
+Do not check mounted filesystems and return an exit code of 0
+for mounted filesystems.
+.TP
+.B \-N
+Don't execute, just show what would be done.
+.TP
+.B \-P
+When the
+.B \-A
+flag is set, check the root filesystem in parallel with the other filesystems.
+This is not the safest thing in the world to do,
+since if the root filesystem is in doubt things like the
+.BR e2fsck (8)
+executable might be corrupted!  This option is mainly provided
+for those sysadmins who don't want to repartition the root
+filesystem to be small and compact (which is really the right solution).
+.TP
+.B \-R
+When checking all file systems with the
+.B \-A
+flag, skip the root file system (in case it's already mounted read-write).
+.TP
+.B \-T
+Don't show the title on startup.
+.TP
+.B \-V
+Produce verbose output, including all file system-specific commands
+that are executed.
+.TP
+.B fs-specific-options
+Options which are not understood by
+.B fsck
+are passed to the filesystem-specific checker.  These arguments
+.B must
+not take arguments, as there is no
+way for
+.B fsck
+to be able to properly guess which arguments take options and which
+don't.
+.IP
+Options and arguments which follow the
+.B \-\-
+are treated as file system-specific options to be passed to the
+file system-specific checker.
+.IP
+Please note that fsck is not
+designed to pass arbitrarily complicated options to filesystem-specific
+checkers.  If you're doing something complicated, please just
+execute the filesystem-specific checker directly.  If you pass
+.B fsck
+some horribly complicated option and arguments, and it doesn't do
+what you expect,
+.B don't bother reporting it as a bug.
+You're almost certainly doing something that you shouldn't be doing
+with
+.BR fsck.
+.PP
+Options to different filesystem-specific fsck's are not standardized.
+If in doubt, please consult the man pages of the filesystem-specific
+checker.  Although not guaranteed, the following options are supported
+by most file system checkers:
+.TP
+.B \-a
+Automatically repair the file system without any questions (use
+this option with caution).  Note that
+.BR e2fsck (8)
+supports
+.B \-a
+for backwards compatibility only.  This option is mapped to
+.BR e2fsck 's
+.B \-p
+option which is safe to use, unlike the
+.B \-a
+option that some file system checkers support.
+.TP
+.B \-n
+For some filesystem-specific checkers, the
+.B \-n
+option will cause the fs-specific fsck to avoid attempting to repair any
+problems, but simply report such problems to stdout.  This is however
+not true for all filesystem-specific checkers.  In particular,
+.BR fsck.reiserfs (8)
+will not report any corruption if given this option.
+.BR fsck.minix (8)
+does not support the
+.B \-n
+option at all.
+.TP
+.B \-r
+Interactively repair the filesystem (ask for confirmations).  Note: It
+is generally a bad idea to use this option if multiple fsck's are being
+run in parallel.  Also note that this is
+.BR e2fsck 's
+default behavior; it supports this option for backwards compatibility
+reasons only.
+.TP
+.B \-y
+For some filesystem-specific checkers, the
+.B \-y
+option will cause the fs-specific fsck to always attempt to fix any
+detected filesystem corruption automatically.  Sometimes an expert may
+be able to do better driving the fsck manually.  Note that
+.B not
+all filesystem-specific checkers implement this option.  In particular
+.BR fsck.minix (8)
+and
+.BR fsck.cramfs (8)
+does not support the
+.B -y
+option as of this writing.
+.SH AUTHOR
+Theodore Ts'o (tytso@mit.edu)
+.SH AVAILABILITY
+The blkid command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
+.SH FILES
+.IR /etc/fstab .
+.SH ENVIRONMENT VARIABLES
+The
+.B fsck
+program's behavior is affected by the following environment variables:
+.TP
+.B FSCK_FORCE_ALL_PARALLEL
+If this environment variable is set,
+.B fsck
+will attempt to run all of the specified filesystems in parallel,
+regardless of whether the filesystems appear to be on the same
+device.  (This is useful for RAID systems or high-end storage systems
+such as those sold by companies such as IBM or EMC.)
+.TP
+.B FSCK_MAX_INST
+This environment variable will limit the maximum number of file system
+checkers that can be running at one time.  This allows configurations
+which have a large number of disks to avoid
+.B fsck
+starting too many file system checkers at once, which might overload
+CPU and memory resources available on the system.  If this value is
+zero, then an unlimited number of processes can be spawned.  This is
+currently the default, but future versions of
+.B fsck
+may attempt to automatically determine how many file system checks can
+be run based on gathering accounting data from the operating system.
+.TP
+.B PATH
+The
+.B PATH
+environment variable is used to find file system checkers.  A set of
+system directories are searched first:
+.BR /sbin ,
+.BR /sbin/fs.d ,
+.BR  /sbin/fs ,
+.BR /etc/fs ,
+and
+.BR /etc .
+Then the set of directories found in the
+.B PATH
+environment are searched.
+.TP
+.B FSTAB_FILE
+This environment variable allows the system administrator
+to override the standard location of the
+.B /etc/fstab
+file.  It is also useful for developers who are testing
+.BR fsck .
+.SH SEE ALSO
+.BR fstab (5),
+.BR mkfs (8),
+.BR fsck.ext2 (8)
+or
+.BR fsck.ext3 (8)
+or
+.BR e2fsck (8),
+.BR cramfsck (8),
+.BR fsck.minix (8),
+.BR fsck.msdos (8),
+.BR fsck.jfs (8),
+.BR fsck.nfs (8),
+.BR fsck.vfat (8),
+.BR fsck.xfs (8),
+.BR fsck.xiafs (8),
+.BR reiserfsck (8).
diff --git a/util-linux-ng-2.17.2/fsck/fsck.c b/util-linux-ng-2.17.2/fsck/fsck.c
new file mode 100644
index 0000000..e9e645f
--- /dev/null
+++ b/util-linux-ng-2.17.2/fsck/fsck.c
@@ -0,0 +1,1346 @@
+/*
+ * pfsck --- A generic, parallelizing front-end for the fsck program.
+ * It will automatically try to run fsck programs in parallel if the
+ * devices are on separate spindles.  It is based on the same ideas as
+ * the generic front end for fsck by David Engel and Fred van Kempen,
+ * but it has been completely rewritten from scratch to support
+ * parallel execution.
+ *
+ * Written by Theodore Ts'o, <tytso@mit.edu>
+ *
+ * Miquel van Smoorenburg (miquels@drinkel.ow.org) 20-Oct-1994:
+ *   o Changed -t fstype to behave like with mount when -A (all file
+ *     systems) or -M (like mount) is specified.
+ *   o fsck looks if it can find the fsck.type program to decide
+ *     if it should ignore the fs type. This way more fsck programs
+ *     can be added without changing this front-end.
+ *   o -R flag skip root file system.
+ *
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ *	         2001, 2002, 2003, 2004, 2005 by  Theodore Ts'o.
+ *
+ * Copyright (C) 2009 Karel Zak <kzak@redhat.com>
+ *
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ */
+
+#define _XOPEN_SOURCE 600 /* for inclusion of sa_handler in Solaris */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/signal.h>
+#include <sys/stat.h>
+#include <limits.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+#include <stdlib.h>
+#include <paths.h>
+#include <unistd.h>
+#include <errno.h>
+#include <malloc.h>
+#include <signal.h>
+
+#include "fsprobe.h"
+
+#include "nls.h"
+#include "pathnames.h"
+#include "ismounted.h"
+
+#include "fsck.h"
+
+static const char *ignored_types[] = {
+	"ignore",
+	"iso9660",
+	"nfs",
+	"proc",
+	"sw",
+	"swap",
+	"tmpfs",
+	"devpts",
+	NULL
+};
+
+static const char *really_wanted[] = {
+	"minix",
+	"ext2",
+	"ext3",
+	"ext4",
+	"ext4dev",
+	"jfs",
+	"reiserfs",
+	"xiafs",
+	"xfs",
+	NULL
+};
+
+#define BASE_MD "/dev/md"
+
+/*
+ * Global variables for options
+ */
+char *devices[MAX_DEVICES];
+char *args[MAX_ARGS];
+int num_devices, num_args;
+
+int verbose = 0;
+int doall = 0;
+int noexecute = 0;
+int serialize = 0;
+int skip_root = 0;
+int ignore_mounted = 0;
+int notitle = 0;
+int parallel_root = 0;
+int progress = 0;
+int progress_fd = 0;
+int force_all_parallel = 0;
+int num_running = 0;
+int max_running = 0;
+volatile int cancel_requested = 0;
+int kill_sent = 0;
+char *progname;
+char *fstype = NULL;
+struct fs_info *filesys_info = NULL, *filesys_last = NULL;
+struct fsck_instance *instance_list;
+const char *fsck_prefix_path = "/sbin:/sbin/fs.d:/sbin/fs:/etc/fs:/etc";
+char *fsck_path = 0;
+
+static char *string_copy(const char *s)
+{
+	char	*ret;
+
+	if (!s)
+		return 0;
+	ret = malloc(strlen(s)+1);
+	if (ret)
+		strcpy(ret, s);
+	return ret;
+}
+
+static int string_to_int(const char *s)
+{
+	long l;
+	char *p;
+
+	l = strtol(s, &p, 0);
+	if (*p || l == LONG_MIN || l == LONG_MAX || l < 0 || l > INT_MAX)
+		return -1;
+	else
+		return (int) l;
+}
+
+static int ignore(struct fs_info *);
+
+static char *skip_over_blank(char *cp)
+{
+	while (*cp && isspace(*cp))
+		cp++;
+	return cp;
+}
+
+static char *skip_over_word(char *cp)
+{
+	while (*cp && !isspace(*cp))
+		cp++;
+	return cp;
+}
+
+static void strip_line(char *line)
+{
+	char	*p;
+
+	while (*line) {
+		p = line + strlen(line) - 1;
+		if ((*p == '\n') || (*p == '\r'))
+			*p = 0;
+		else
+			break;
+	}
+}
+
+static char *parse_word(char **buf)
+{
+	char *word, *next;
+
+	word = *buf;
+	if (*word == 0)
+		return 0;
+
+	word = skip_over_blank(word);
+	next = skip_over_word(word);
+	if (*next)
+		*next++ = 0;
+	*buf = next;
+	return word;
+}
+
+static void parse_escape(char *word)
+{
+	char	*p, *q;
+	int	ac, i;
+
+	if (!word)
+		return;
+
+	for (p = word, q = word; *p; p++, q++) {
+		*q = *p;
+		if (*p != '\\')
+			continue;
+		if (*++p == 0)
+			break;
+		if (*p == 't') {
+			*q = '\t';
+			continue;
+		}
+		if (*p == 'n') {
+			*q = '\n';
+			continue;
+		}
+		if (!isdigit(*p)) {
+			*q = *p;
+			continue;
+		}
+		ac = 0;
+		for (i = 0; i < 3; i++, p++) {
+			if (!isdigit(*p))
+				break;
+			ac = (ac * 8) + (*p - '0');
+		}
+		*q = ac;
+		p--;
+	}
+	*q = 0;
+}
+
+static void free_instance(struct fsck_instance *i)
+{
+	free(i->prog);
+	free(i->device);
+	free(i->base_device);
+	free(i);
+	return;
+}
+
+static struct fs_info *create_fs_device(const char *device, const char *mntpnt,
+					const char *type, const char *opts,
+					int freq, int passno)
+{
+	struct fs_info *fs;
+
+	if (!(fs = malloc(sizeof(struct fs_info))))
+		return NULL;
+
+	fs->device = string_copy(device);
+	fs->mountpt = string_copy(mntpnt);
+	fs->type = string_copy(type);
+	fs->opts = string_copy(opts ? opts : "");
+	fs->freq = freq;
+	fs->passno = passno;
+	fs->flags = 0;
+	fs->next = NULL;
+
+	if (!filesys_info)
+		filesys_info = fs;
+	else
+		filesys_last->next = fs;
+	filesys_last = fs;
+
+	return fs;
+}
+
+
+
+static int parse_fstab_line(char *line, struct fs_info **ret_fs)
+{
+	char	*dev, *device, *mntpnt, *type, *opts, *freq, *passno, *cp;
+	struct fs_info *fs;
+
+	*ret_fs = 0;
+	strip_line(line);
+	cp = line;
+
+	device = parse_word(&cp);
+	if (!device || *device == '#')
+		return 0;	/* Ignore blank lines and comments */
+	mntpnt = parse_word(&cp);
+	type = parse_word(&cp);
+	opts = parse_word(&cp);
+	freq = parse_word(&cp);
+	passno = parse_word(&cp);
+
+	if (!mntpnt || !type)
+		return -1;
+
+	parse_escape(device);
+	parse_escape(mntpnt);
+	parse_escape(type);
+	parse_escape(opts);
+	parse_escape(freq);
+	parse_escape(passno);
+
+	dev = fsprobe_get_devname_by_spec(device);
+	if (dev)
+		device = dev;
+
+	if (strchr(type, ','))
+		type = 0;
+
+	fs = create_fs_device(device, mntpnt, type ? type : "auto", opts,
+			      freq ? atoi(freq) : -1,
+			      passno ? atoi(passno) : -1);
+	free(dev);
+
+	if (!fs)
+		return -1;
+	*ret_fs = fs;
+	return 0;
+}
+
+static void interpret_type(struct fs_info *fs)
+{
+	char	*t;
+
+	if (strcmp(fs->type, "auto") != 0)
+		return;
+	t = fsprobe_get_fstype_by_devname(fs->device);
+	if (t) {
+		free(fs->type);
+		fs->type = t;
+	}
+}
+
+/*
+ * Load the filesystem database from /etc/fstab
+ */
+static void load_fs_info(const char *filename)
+{
+	FILE	*f;
+	char	buf[1024];
+	int	lineno = 0;
+	int	old_fstab = 1;
+	struct fs_info *fs;
+
+	if ((f = fopen(filename, "r")) == NULL) {
+		fprintf(stderr, _("WARNING: couldn't open %s: %s\n"),
+			filename, strerror(errno));
+		return;
+	}
+	while (!feof(f)) {
+		lineno++;
+		if (!fgets(buf, sizeof(buf), f))
+			break;
+		buf[sizeof(buf)-1] = 0;
+		if (parse_fstab_line(buf, &fs) < 0) {
+			fprintf(stderr, _("WARNING: bad format "
+				"on line %d of %s\n"), lineno, filename);
+			continue;
+		}
+		if (!fs)
+			continue;
+		if (fs->passno < 0)
+			fs->passno = 0;
+		else
+			old_fstab = 0;
+	}
+
+	fclose(f);
+
+	if (old_fstab && filesys_info) {
+		fputs(_(
+		"WARNING: Your /etc/fstab does not contain the fsck passno\n"
+		"	field.  I will kludge around things for you, but you\n"
+		"	should fix your /etc/fstab file as soon as you can.\n\n"), stderr);
+
+		for (fs = filesys_info; fs; fs = fs->next) {
+			fs->passno = 1;
+		}
+	}
+}
+
+/* Lookup filesys in /etc/fstab and return the corresponding entry. */
+static struct fs_info *lookup(char *filesys)
+{
+	struct fs_info *fs;
+
+	/* No filesys name given. */
+	if (filesys == NULL)
+		return NULL;
+
+	for (fs = filesys_info; fs; fs = fs->next) {
+		if (!strcmp(filesys, fs->device) ||
+		    (fs->mountpt && !strcmp(filesys, fs->mountpt)))
+			break;
+	}
+
+	return fs;
+}
+
+/* Find fsck program for a given fs type. */
+static char *find_fsck(char *type)
+{
+  char *s;
+  const char *tpl;
+  static char prog[256];
+  char *p = string_copy(fsck_path);
+  struct stat st;
+
+  /* Are we looking for a program or just a type? */
+  tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
+
+  for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
+	sprintf(prog, tpl, s, type);
+	if (stat(prog, &st) == 0) break;
+  }
+  free(p);
+  return(s ? prog : NULL);
+}
+
+static int progress_active(NOARGS)
+{
+	struct fsck_instance *inst;
+
+	for (inst = instance_list; inst; inst = inst->next) {
+		if (inst->flags & FLAG_DONE)
+			continue;
+		if (inst->flags & FLAG_PROGRESS)
+			return 1;
+	}
+	return 0;
+}
+
+/*
+ * Execute a particular fsck program, and link it into the list of
+ * child processes we are waiting for.
+ */
+static int execute(const char *type, const char *device, const char *mntpt,
+		   int interactive)
+{
+	char *s, *argv[80], prog[80];
+	int  argc, i;
+	struct fsck_instance *inst, *p;
+	pid_t	pid;
+
+	inst = malloc(sizeof(struct fsck_instance));
+	if (!inst)
+		return ENOMEM;
+	memset(inst, 0, sizeof(struct fsck_instance));
+
+	sprintf(prog, "fsck.%s", type);
+	argv[0] = string_copy(prog);
+	argc = 1;
+
+	for (i=0; i <num_args; i++)
+		argv[argc++] = string_copy(args[i]);
+
+	if (progress) {
+		if ((strcmp(type, "ext2") == 0) ||
+		    (strcmp(type, "ext3") == 0) ||
+		    (strcmp(type, "ext4") == 0) ||
+		    (strcmp(type, "ext4dev") == 0)) {
+			char tmp[80];
+
+			tmp[0] = 0;
+			if (!progress_active()) {
+				snprintf(tmp, 80, "-C%d", progress_fd);
+				inst->flags |= FLAG_PROGRESS;
+			} else if (progress_fd)
+				snprintf(tmp, 80, "-C%d", progress_fd * -1);
+			if (tmp[0])
+				argv[argc++] = string_copy(tmp);
+		}
+	}
+
+	argv[argc++] = string_copy(device);
+	argv[argc] = 0;
+
+	s = find_fsck(prog);
+	if (s == NULL) {
+		fprintf(stderr, _("fsck: %s: not found\n"), prog);
+		free(inst);
+		return ENOENT;
+	}
+
+	if (verbose || noexecute) {
+		printf("[%s (%d) -- %s] ", s, num_running,
+		       mntpt ? mntpt : device);
+		for (i=0; i < argc; i++)
+			printf("%s ", argv[i]);
+		printf("\n");
+	}
+
+	/* Fork and execute the correct program. */
+	if (noexecute)
+		pid = -1;
+	else if ((pid = fork()) < 0) {
+		perror("fork");
+		free(inst);
+		return errno;
+	} else if (pid == 0) {
+		if (!interactive)
+			close(0);
+		(void) execv(s, argv);
+		perror(argv[0]);
+		free(inst);
+		exit(EXIT_ERROR);
+	}
+
+	for (i=0; i < argc; i++)
+		free(argv[i]);
+
+	inst->pid = pid;
+	inst->prog = string_copy(prog);
+	inst->type = string_copy(type);
+	inst->device = string_copy(device);
+	inst->base_device = base_device(device);
+	inst->start_time = time(0);
+	inst->next = NULL;
+
+	/*
+	 * Find the end of the list, so we add the instance on at the end.
+	 */
+	for (p = instance_list; p && p->next; p = p->next);
+
+	if (p)
+		p->next = inst;
+	else
+		instance_list = inst;
+
+	return 0;
+}
+
+/*
+ * Send a signal to all outstanding fsck child processes
+ */
+static int kill_all(int signum)
+{
+	struct fsck_instance *inst;
+	int	n = 0;
+
+	for (inst = instance_list; inst; inst = inst->next) {
+		if (inst->flags & FLAG_DONE)
+			continue;
+		kill(inst->pid, signum);
+		n++;
+	}
+	return n;
+}
+
+/*
+ * Wait for one child process to exit; when it does, unlink it from
+ * the list of executing child processes, and return it.
+ */
+static struct fsck_instance *wait_one(int flags)
+{
+	int	status;
+	int	sig;
+	struct fsck_instance *inst, *inst2, *prev;
+	pid_t	pid;
+
+	if (!instance_list)
+		return NULL;
+
+	if (noexecute) {
+		inst = instance_list;
+		prev = 0;
+#ifdef RANDOM_DEBUG
+		while (inst->next && (random() & 1)) {
+			prev = inst;
+			inst = inst->next;
+		}
+#endif
+		inst->exit_status = 0;
+		goto ret_inst;
+	}
+
+	/*
+	 * gcc -Wall fails saving throw against stupidity
+	 * (inst and prev are thought to be uninitialized variables)
+	 */
+	inst = prev = NULL;
+
+	do {
+		pid = waitpid(-1, &status, flags);
+		if (cancel_requested && !kill_sent) {
+			kill_all(SIGTERM);
+			kill_sent++;
+		}
+		if ((pid == 0) && (flags & WNOHANG))
+			return NULL;
+		if (pid < 0) {
+			if ((errno == EINTR) || (errno == EAGAIN))
+				continue;
+			if (errno == ECHILD) {
+				fprintf(stderr,
+					_("%s: wait: No more child process?!?\n"),
+					progname);
+				return NULL;
+			}
+			perror("wait");
+			continue;
+		}
+		for (prev = 0, inst = instance_list;
+		     inst;
+		     prev = inst, inst = inst->next) {
+			if (inst->pid == pid)
+				break;
+		}
+	} while (!inst);
+
+	if (WIFEXITED(status))
+		status = WEXITSTATUS(status);
+	else if (WIFSIGNALED(status)) {
+		sig = WTERMSIG(status);
+		if (sig == SIGINT) {
+			status = EXIT_UNCORRECTED;
+		} else {
+			printf(_("Warning... %s for device %s exited "
+			       "with signal %d.\n"),
+			       inst->prog, inst->device, sig);
+			status = EXIT_ERROR;
+		}
+	} else {
+		printf(_("%s %s: status is %x, should never happen.\n"),
+		       inst->prog, inst->device, status);
+		status = EXIT_ERROR;
+	}
+	inst->exit_status = status;
+	inst->flags |= FLAG_DONE;
+	if (progress && (inst->flags & FLAG_PROGRESS) &&
+	    !progress_active()) {
+		for (inst2 = instance_list; inst2; inst2 = inst2->next) {
+			if (inst2->flags & FLAG_DONE)
+				continue;
+			if (strcmp(inst2->type, "ext2") &&
+			    strcmp(inst2->type, "ext3") &&
+			    strcmp(inst2->type, "ext4") &&
+			    strcmp(inst2->type, "ext4dev"))
+				continue;
+			/*
+			 * If we've just started the fsck, wait a tiny
+			 * bit before sending the kill, to give it
+			 * time to set up the signal handler
+			 */
+			if (inst2->start_time < time(0)+2) {
+				if (fork() == 0) {
+					sleep(1);
+					kill(inst2->pid, SIGUSR1);
+					exit(0);
+				}
+			} else
+				kill(inst2->pid, SIGUSR1);
+			inst2->flags |= FLAG_PROGRESS;
+			break;
+		}
+	}
+ret_inst:
+	if (prev)
+		prev->next = inst->next;
+	else
+		instance_list = inst->next;
+	if (verbose > 1)
+		printf(_("Finished with %s (exit status %d)\n"),
+		       inst->device, inst->exit_status);
+	num_running--;
+	return inst;
+}
+
+#define FLAG_WAIT_ALL		0
+#define FLAG_WAIT_ATLEAST_ONE	1
+/*
+ * Wait until all executing child processes have exited; return the
+ * logical OR of all of their exit code values.
+ */
+static int wait_many(int flags)
+{
+	struct fsck_instance *inst;
+	int	global_status = 0;
+	int	wait_flags = 0;
+
+	while ((inst = wait_one(wait_flags))) {
+		global_status |= inst->exit_status;
+		free_instance(inst);
+#ifdef RANDOM_DEBUG
+		if (noexecute && (flags & WNOHANG) && !(random() % 3))
+			break;
+#endif
+		if (flags & FLAG_WAIT_ATLEAST_ONE)
+			wait_flags = WNOHANG;
+	}
+	return global_status;
+}
+
+/*
+ * Run the fsck program on a particular device
+ *
+ * If the type is specified using -t, and it isn't prefixed with "no"
+ * (as in "noext2") and only one filesystem type is specified, then
+ * use that type regardless of what is specified in /etc/fstab.
+ *
+ * If the type isn't specified by the user, then use either the type
+ * specified in /etc/fstab, or DEFAULT_FSTYPE.
+ */
+static void fsck_device(struct fs_info *fs, int interactive)
+{
+	const char *type;
+	int retval;
+
+	interpret_type(fs);
+
+	if (strcmp(fs->type, "auto") != 0)
+		type = fs->type;
+	else if (fstype && strncmp(fstype, "no", 2) &&
+	    strncmp(fstype, "opts=", 5) && strncmp(fstype, "loop", 4) &&
+	    !strchr(fstype, ','))
+		type = fstype;
+	else
+		type = DEFAULT_FSTYPE;
+
+	num_running++;
+	retval = execute(type, fs->device, fs->mountpt, interactive);
+	if (retval) {
+		fprintf(stderr, _("%s: Error %d while executing fsck.%s "
+			"for %s\n"), progname, retval, type, fs->device);
+		num_running--;
+	}
+}
+
+
+/*
+ * Deal with the fsck -t argument.
+ */
+struct fs_type_compile {
+	char **list;
+	int *type;
+	int  negate;
+} fs_type_compiled;
+
+#define FS_TYPE_NORMAL	0
+#define FS_TYPE_OPT	1
+#define FS_TYPE_NEGOPT	2
+
+static const char *fs_type_syntax_error =
+N_("Either all or none of the filesystem types passed to -t must be prefixed\n"
+   "with 'no' or '!'.\n");
+
+static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp)
+{
+	char 	*cp, *list, *s;
+	int	num = 2;
+	int	negate, first_negate = 1;
+
+	if (fs_type) {
+		for (cp=fs_type; *cp; cp++) {
+			if (*cp == ',')
+				num++;
+		}
+	}
+
+	cmp->list = malloc(num * sizeof(char *));
+	cmp->type = malloc(num * sizeof(int));
+	if (!cmp->list || !cmp->type) {
+		fputs(_("Couldn't allocate memory for filesystem types\n"),
+		      stderr);
+		exit(EXIT_ERROR);
+	}
+	memset(cmp->list, 0, num * sizeof(char *));
+	memset(cmp->type, 0, num * sizeof(int));
+	cmp->negate = 0;
+
+	if (!fs_type)
+		return;
+
+	list = string_copy(fs_type);
+	num = 0;
+	s = strtok(list, ",");
+	while(s) {
+		negate = 0;
+		if (strncmp(s, "no", 2) == 0) {
+			s += 2;
+			negate = 1;
+		} else if (*s == '!') {
+			s++;
+			negate = 1;
+		}
+		if (strcmp(s, "loop") == 0)
+			/* loop is really short-hand for opts=loop */
+			goto loop_special_case;
+		else if (strncmp(s, "opts=", 5) == 0) {
+			s += 5;
+		loop_special_case:
+			cmp->type[num] = negate ? FS_TYPE_NEGOPT : FS_TYPE_OPT;
+		} else {
+			if (first_negate) {
+				cmp->negate = negate;
+				first_negate = 0;
+			}
+			if ((negate && !cmp->negate) ||
+			    (!negate && cmp->negate)) {
+				fputs(_(fs_type_syntax_error), stderr);
+				exit(EXIT_USAGE);
+			}
+		}
+#if 0
+		printf("Adding %s to list (type %d).\n", s, cmp->type[num]);
+#endif
+	        cmp->list[num++] = string_copy(s);
+		s = strtok(NULL, ",");
+	}
+	free(list);
+}
+
+/*
+ * This function returns true if a particular option appears in a
+ * comma-delimited options list
+ */
+static int opt_in_list(const char *opt, char *optlist)
+{
+	char	*list, *s;
+
+	if (!optlist)
+		return 0;
+	list = string_copy(optlist);
+
+	s = strtok(list, ",");
+	while(s) {
+		if (strcmp(s, opt) == 0) {
+			free(list);
+			return 1;
+		}
+		s = strtok(NULL, ",");
+	}
+        free(list);
+	return 0;
+}
+
+/* See if the filesystem matches the criteria given by the -t option */
+static int fs_match(struct fs_info *fs, struct fs_type_compile *cmp)
+{
+	int n, ret = 0, checked_type = 0;
+	char *cp;
+
+	if (cmp->list == 0 || cmp->list[0] == 0)
+		return 1;
+
+	for (n=0; (cp = cmp->list[n]); n++) {
+		switch (cmp->type[n]) {
+		case FS_TYPE_NORMAL:
+			checked_type++;
+			if (strcmp(cp, fs->type) == 0) {
+				ret = 1;
+			}
+			break;
+		case FS_TYPE_NEGOPT:
+			if (opt_in_list(cp, fs->opts))
+				return 0;
+			break;
+		case FS_TYPE_OPT:
+			if (!opt_in_list(cp, fs->opts))
+				return 0;
+			break;
+		}
+	}
+	if (checked_type == 0)
+		return 1;
+	return (cmp->negate ? !ret : ret);
+}
+
+/*
+ * Check if a device exists
+ */
+static int device_exists(const char *device)
+{
+	struct stat st;
+
+	if (stat(device, &st) == -1)
+		return 0;
+
+	if (!S_ISBLK(st.st_mode))
+		return 0;
+
+	return 1;
+}
+
+/* Check if we should ignore this filesystem. */
+static int ignore(struct fs_info *fs)
+{
+	const char **ip;
+	int wanted = 0;
+
+	/*
+	 * If the pass number is 0, ignore it.
+	 */
+	if (fs->passno == 0)
+		return 1;
+
+	/*
+	 * If this is a bind mount, ignore it.
+	 */
+	if (opt_in_list("bind", fs->opts)) {
+		fprintf(stderr,
+			_("%s: skipping bad line in /etc/fstab: bind mount with nonzero fsck pass number\n"),
+			fs->mountpt);
+		return 1;
+	}
+
+	/*
+	 * ignore devices that don't exist and have the "nofail" mount option
+	 */
+	if (!device_exists(fs->device) && opt_in_list("nofail", fs->opts)) {
+		if (verbose)
+			printf(_("%s: skipping nonexistent device\n"), fs->device);
+		return 1;
+	}
+
+	interpret_type(fs);
+
+	/*
+	 * If a specific fstype is specified, and it doesn't match,
+	 * ignore it.
+	 */
+	if (!fs_match(fs, &fs_type_compiled)) return 1;
+
+	/* Are we ignoring this type? */
+	for(ip = ignored_types; *ip; ip++)
+		if (strcmp(fs->type, *ip) == 0) return 1;
+
+	/* Do we really really want to check this fs? */
+	for(ip = really_wanted; *ip; ip++)
+		if (strcmp(fs->type, *ip) == 0) {
+			wanted = 1;
+			break;
+		}
+
+	/* See if the <fsck.fs> program is available. */
+	if (find_fsck(fs->type) == NULL) {
+		if (wanted)
+			fprintf(stderr, _("fsck: cannot check %s: fsck.%s not found\n"),
+				fs->device, fs->type);
+		return 1;
+	}
+
+	/* We can and want to check this file system type. */
+	return 0;
+}
+
+/*
+ * Returns TRUE if a partition on the same disk is already being
+ * checked.
+ */
+static int device_already_active(char *device)
+{
+	struct fsck_instance *inst;
+	char *base;
+
+	if (force_all_parallel)
+		return 0;
+
+#ifdef BASE_MD
+	/* Don't check a soft raid disk with any other disk */
+	if (instance_list &&
+	    (!strncmp(instance_list->device, BASE_MD, sizeof(BASE_MD)-1) ||
+	     !strncmp(device, BASE_MD, sizeof(BASE_MD)-1)))
+		return 1;
+#endif
+
+	base = base_device(device);
+	/*
+	 * If we don't know the base device, assume that the device is
+	 * already active if there are any fsck instances running.
+	 */
+	if (!base)
+		return (instance_list != 0);
+	for (inst = instance_list; inst; inst = inst->next) {
+		if (!inst->base_device || !strcmp(base, inst->base_device)) {
+			free(base);
+			return 1;
+		}
+	}
+	free(base);
+	return 0;
+}
+
+/* Check all file systems, using the /etc/fstab table. */
+static int check_all(NOARGS)
+{
+	struct fs_info *fs = NULL;
+	int status = EXIT_OK;
+	int not_done_yet = 1;
+	int passno = 1;
+	int pass_done;
+
+	if (verbose)
+		fputs(_("Checking all file systems.\n"), stdout);
+
+	/*
+	 * Do an initial scan over the filesystem; mark filesystems
+	 * which should be ignored as done, and resolve any "auto"
+	 * filesystem types (done as a side-effect of calling ignore()).
+	 */
+	for (fs = filesys_info; fs; fs = fs->next) {
+		if (ignore(fs))
+			fs->flags |= FLAG_DONE;
+	}
+
+	/*
+	 * Find and check the root filesystem.
+	 */
+	if (!parallel_root) {
+		for (fs = filesys_info; fs; fs = fs->next) {
+			if (!strcmp(fs->mountpt, "/"))
+				break;
+		}
+		if (fs) {
+			if (!skip_root && !ignore(fs) &&
+			    !(ignore_mounted && is_mounted(fs->device))) {
+				fsck_device(fs, 1);
+				status |= wait_many(FLAG_WAIT_ALL);
+				if (status > EXIT_NONDESTRUCT)
+					return status;
+			}
+			fs->flags |= FLAG_DONE;
+		}
+	}
+	/*
+	 * This is for the bone-headed user who enters the root
+	 * filesystem twice.  Skip root will skep all root entries.
+	 */
+	if (skip_root)
+		for (fs = filesys_info; fs; fs = fs->next)
+			if (!strcmp(fs->mountpt, "/"))
+				fs->flags |= FLAG_DONE;
+
+	while (not_done_yet) {
+		not_done_yet = 0;
+		pass_done = 1;
+
+		for (fs = filesys_info; fs; fs = fs->next) {
+			if (cancel_requested)
+				break;
+			if (fs->flags & FLAG_DONE)
+				continue;
+			/*
+			 * If the filesystem's pass number is higher
+			 * than the current pass number, then we don't
+			 * do it yet.
+			 */
+			if (fs->passno > passno) {
+				not_done_yet++;
+				continue;
+			}
+			if (ignore_mounted && is_mounted(fs->device)) {
+				fs->flags |= FLAG_DONE;
+				continue;
+			}
+			/*
+			 * If a filesystem on a particular device has
+			 * already been spawned, then we need to defer
+			 * this to another pass.
+			 */
+			if (device_already_active(fs->device)) {
+				pass_done = 0;
+				continue;
+			}
+			/*
+			 * Spawn off the fsck process
+			 */
+			fsck_device(fs, serialize);
+			fs->flags |= FLAG_DONE;
+
+			/*
+			 * Only do one filesystem at a time, or if we
+			 * have a limit on the number of fsck's extant
+			 * at one time, apply that limit.
+			 */
+			if (serialize ||
+			    (max_running && (num_running >= max_running))) {
+				pass_done = 0;
+				break;
+			}
+		}
+		if (cancel_requested)
+			break;
+		if (verbose > 1)
+			printf(_("--waiting-- (pass %d)\n"), passno);
+		status |= wait_many(pass_done ? FLAG_WAIT_ALL :
+				    FLAG_WAIT_ATLEAST_ONE);
+		if (pass_done) {
+			if (verbose > 1)
+				printf("----------------------------------\n");
+			passno++;
+		} else
+			not_done_yet++;
+	}
+	if (cancel_requested && !kill_sent) {
+		kill_all(SIGTERM);
+		kill_sent++;
+	}
+	status |= wait_many(FLAG_WAIT_ATLEAST_ONE);
+	return status;
+}
+
+static void usage(NOARGS)
+{
+	fputs(_("Usage: fsck [-AMNPRTV] [ -C [ fd ] ] [-t fstype] [fs-options] [filesys ...]\n"), stderr);
+	exit(EXIT_USAGE);
+}
+
+static void signal_cancel(int sig FSCK_ATTR((unused)))
+{
+	cancel_requested++;
+}
+
+static void PRS(int argc, char *argv[])
+{
+	int	i, j;
+	char	*arg, *dev, *tmp = 0;
+	char	options[128];
+	int	opt = 0;
+	int     opts_for_fsck = 0;
+	struct sigaction	sa;
+
+	/*
+	 * Set up signal action
+	 */
+	memset(&sa, 0, sizeof(struct sigaction));
+	sa.sa_handler = signal_cancel;
+	sigaction(SIGINT, &sa, 0);
+	sigaction(SIGTERM, &sa, 0);
+
+	num_devices = 0;
+	num_args = 0;
+	instance_list = 0;
+
+	progname = argv[0];
+
+	for (i=1; i < argc; i++) {
+		arg = argv[i];
+		if (!arg)
+			continue;
+		if ((arg[0] == '/' && !opts_for_fsck) || strchr(arg, '=')) {
+			if (num_devices >= MAX_DEVICES) {
+				fprintf(stderr, _("%s: too many devices\n"),
+					progname);
+				exit(EXIT_ERROR);
+			}
+			dev = fsprobe_get_devname_by_spec(arg);
+			if (!dev && strchr(arg, '=')) {
+				/*
+				 * Check to see if we failed because
+				 * /proc/partitions isn't found.
+				 */
+				if (access(_PATH_PROC_PARTITIONS, R_OK) < 0) {
+					fprintf(stderr, _("Couldn't open %s: %s\n"),
+						_PATH_PROC_PARTITIONS, strerror(errno));
+					fprintf(stderr, _("Is /proc mounted?\n"));
+					exit(EXIT_ERROR);
+				}
+				/*
+				 * Check to see if this is because
+				 * we're not running as root
+				 */
+				if (geteuid())
+					fprintf(stderr,
+		_("Must be root to scan for matching filesystems: %s\n"), arg);
+				else
+					fprintf(stderr,
+		_("Couldn't find matching filesystem: %s\n"), arg);
+				exit(EXIT_ERROR);
+			}
+			devices[num_devices++] = dev ? dev : string_copy(arg);
+			continue;
+		}
+		if (arg[0] != '-' || opts_for_fsck) {
+			if (num_args >= MAX_ARGS) {
+				fprintf(stderr, _("%s: too many arguments\n"),
+					progname);
+				exit(EXIT_ERROR);
+			}
+			args[num_args++] = string_copy(arg);
+			continue;
+		}
+		for (j=1; arg[j]; j++) {
+			if (opts_for_fsck) {
+				options[++opt] = arg[j];
+				continue;
+			}
+			switch (arg[j]) {
+			case 'A':
+				doall++;
+				break;
+			case 'C':
+				progress++;
+				if (arg[j+1]) {
+					progress_fd = string_to_int(arg+j+1);
+					if (progress_fd < 0)
+						progress_fd = 0;
+					else
+						goto next_arg;
+				} else if ((i+1) < argc &&
+					   !strncmp(argv[i+1], "-", 1) == 0) {
+					progress_fd = string_to_int(argv[i]);
+					if (progress_fd < 0)
+						progress_fd = 0;
+					else {
+						goto next_arg;
+						i++;
+					}
+				}
+				break;
+			case 'V':
+				verbose++;
+				break;
+			case 'N':
+				noexecute++;
+				break;
+			case 'R':
+				skip_root++;
+				break;
+			case 'T':
+				notitle++;
+				break;
+			case 'M':
+				ignore_mounted++;
+				break;
+			case 'P':
+				parallel_root++;
+				break;
+			case 's':
+				serialize++;
+				break;
+			case 't':
+				tmp = 0;
+				if (fstype)
+					usage();
+				if (arg[j+1])
+					tmp = arg+j+1;
+				else if ((i+1) < argc)
+					tmp = argv[++i];
+				else
+					usage();
+				fstype = string_copy(tmp);
+				compile_fs_type(fstype, &fs_type_compiled);
+				goto next_arg;
+			case '-':
+				opts_for_fsck++;
+				break;
+			case '?':
+				usage();
+				break;
+			default:
+				options[++opt] = arg[j];
+				break;
+			}
+		}
+	next_arg:
+		if (opt) {
+			options[0] = '-';
+			options[++opt] = '\0';
+			if (num_args >= MAX_ARGS) {
+				fprintf(stderr,
+					_("%s: too many arguments\n"),
+					progname);
+				exit(EXIT_ERROR);
+			}
+			args[num_args++] = string_copy(options);
+			opt = 0;
+		}
+	}
+	if (getenv("FSCK_FORCE_ALL_PARALLEL"))
+		force_all_parallel++;
+	if ((tmp = getenv("FSCK_MAX_INST")))
+	    max_running = atoi(tmp);
+}
+
+int main(int argc, char *argv[])
+{
+	int i, status = 0;
+	int interactive = 0;
+	char *oldpath = getenv("PATH");
+	const char *fstab;
+	struct fs_info *fs;
+
+	setvbuf(stdout, NULL, _IONBF, BUFSIZ);
+	setvbuf(stderr, NULL, _IONBF, BUFSIZ);
+
+	setlocale(LC_MESSAGES, "");
+	setlocale(LC_CTYPE, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	fsprobe_init();
+	PRS(argc, argv);
+
+	if (!notitle)
+		printf(_("fsck from %s\n"), PACKAGE_STRING);
+
+	fstab = getenv("FSTAB_FILE");
+	if (!fstab)
+		fstab = _PATH_MNTTAB;
+	load_fs_info(fstab);
+
+	/* Update our search path to include uncommon directories. */
+	if (oldpath) {
+		fsck_path = malloc (strlen (fsck_prefix_path) + 1 +
+				    strlen (oldpath) + 1);
+		if (!fsck_path) {
+			fprintf(stderr, _("%s: Unable to allocate memory for fsck_path\n"), progname);
+			exit(EXIT_ERROR);
+		}
+		strcpy (fsck_path, fsck_prefix_path);
+		strcat (fsck_path, ":");
+		strcat (fsck_path, oldpath);
+	} else {
+		fsck_path = string_copy(fsck_prefix_path);
+	}
+
+	if ((num_devices == 1) || (serialize))
+		interactive = 1;
+
+	/* If -A was specified ("check all"), do that! */
+	if (doall)
+		return check_all();
+
+	if (num_devices == 0) {
+		serialize++;
+		interactive++;
+		return check_all();
+	}
+	for (i = 0 ; i < num_devices; i++) {
+		if (cancel_requested) {
+			if (!kill_sent) {
+				kill_all(SIGTERM);
+				kill_sent++;
+			}
+			break;
+		}
+		fs = lookup(devices[i]);
+		if (!fs) {
+			fs = create_fs_device(devices[i], 0, "auto",
+					      0, -1, -1);
+			if (!fs)
+				continue;
+		}
+		if (ignore_mounted && is_mounted(fs->device))
+			continue;
+		fsck_device(fs, interactive);
+		if (serialize ||
+		    (max_running && (num_running >= max_running))) {
+			struct fsck_instance *inst;
+
+			inst = wait_one(0);
+			if (inst) {
+				status |= inst->exit_status;
+				free_instance(inst);
+			}
+			if (verbose > 1)
+				printf("----------------------------------\n");
+		}
+	}
+	status |= wait_many(FLAG_WAIT_ALL);
+	free(fsck_path);
+	fsprobe_exit();
+	return status;
+}
+
diff --git a/util-linux-ng-2.17.2/fsck/fsck.h b/util-linux-ng-2.17.2/fsck/fsck.h
new file mode 100644
index 0000000..45b7844
--- /dev/null
+++ b/util-linux-ng-2.17.2/fsck/fsck.h
@@ -0,0 +1,72 @@
+/*
+ * fsck.h
+ */
+
+#include <time.h>
+
+#ifdef __STDC__
+#define NOARGS void
+#else
+#define NOARGS
+#endif
+
+#ifdef __GNUC__
+#define FSCK_ATTR(x) __attribute__(x)
+#else
+#define FSCK_ATTR(x)
+#endif
+
+
+#ifndef DEFAULT_FSTYPE
+#define DEFAULT_FSTYPE	"ext2"
+#endif
+
+#define MAX_DEVICES 32
+#define MAX_ARGS 32
+
+#define EXIT_OK          0
+#define EXIT_NONDESTRUCT 1
+#define EXIT_DESTRUCT    2
+#define EXIT_UNCORRECTED 4
+#define EXIT_ERROR       8
+#define EXIT_USAGE       16
+#define EXIT_LIBRARY     128
+
+/*
+ * Internal structure for mount tabel entries.
+ */
+
+struct fs_info {
+	char  *device;
+	char  *mountpt;
+	char  *type;
+	char  *opts;
+	int   freq;
+	int   passno;
+	int   flags;
+	struct fs_info *next;
+};
+
+#define FLAG_DONE 1
+#define FLAG_PROGRESS 2
+
+/*
+ * Structure to allow exit codes to be stored
+ */
+struct fsck_instance {
+	int	pid;
+	int	flags;
+	int	exit_status;
+	time_t	start_time;
+	char *	prog;
+	char *	type;
+	char *	device;
+	char *	base_device;
+	struct fsck_instance *next;
+};
+
+extern char *base_device(const char *device);
+extern const char *identify_fs(const char *fs_name, const char *fs_types);
+
+/* ismounted.h */
+extern int is_mounted(const char *file);
diff --git a/util-linux-ng-2.17.2/getopt/COPYING b/util-linux-ng-2.17.2/getopt/COPYING
new file mode 100644
index 0000000..a43ea21
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/COPYING
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, 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
+
+	Appendix: 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) 19yy  <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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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.
diff --git a/util-linux-ng-2.17.2/getopt/Changelog b/util-linux-ng-2.17.2/getopt/Changelog
new file mode 100644
index 0000000..ee27965
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/Changelog
@@ -0,0 +1,38 @@
+20051107: Bumped up version number to 1.1.4
+20051107: Makefile: package target
+20051107: Changed email and website to current ones
+20051107: Fixed a few typos in the manpage (sync with util-linux (2.12r)
+20030123: Bumped up version number to 1.1.3
+20030123: Changed WITH_GETTEXT option to WITHOUT_GETTEXT
+20030123: Renamed example programs to have the string getopt- prepended
+20030123: Manpage: all minus signs are now escaped
+20030123: Sync with util-linux (2.11y)
+20010329: Bumped up version number to 1.1.2
+20010329: Sync with util-linux
+20010311: Bumped up version number to 1.1.1
+20010311: Fixed stupid compilation error if NLS not selected
+20000630: Bumped up version number to 1.1.0
+20000630: Ported the Native Language Support patches from util-linux
+          They are written by Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
+20000627: Bumped up version number to 1.0.6
+20000627: A few manpage tweaks
+20000616: Introduced DESTDIR and directory creation in the Makefile.
+19990716: Bumped up version number to 1.0.5
+19990622: Made -u work
+19990101: Bumped up version number to 1.0.4 (aka. 1.0.3a in util-linux)
+19990101: Very small fix in main()
+19990101: Updated util-linux Makefile
+19980628: Bumped up version number to 1.0.3
+19980628: Removed remaining incompatibility with tcsh-6.02 from parse.tcsh
+980626: Added separate Makefile for util-linux
+19980625: Removed several bugs from parse.tcsh, partly thanks to Volker Kuhlmann
+          (v.kuhlmann@elec.canterbury.ac.nz).
+19980612: Removed reference to getopt in util-linux
+19980611: Bumped up version number to 1.0.2
+19980611: Fixed --version bug (was not available, though documented!)
+19980611: Removed compiler warnings.
+19980603: Bumped up version number to 1.0.1
+19980603: Fixed sizeof() bug (should be strlen) in getopt.c, thanks to 
+          Bob Proulx (rwp@hprwp.fc.hp.com).
+19980505: Changed date field in LSM to proper syntax
+19980505: Released version 1.0
diff --git a/util-linux-ng-2.17.2/getopt/Makefile.am b/util-linux-ng-2.17.2/getopt/Makefile.am
new file mode 100644
index 0000000..bd3e794
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/Makefile.am
@@ -0,0 +1,11 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+usrbin_exec_PROGRAMS = getopt
+dist_man_MANS = getopt.1
+
+exampledir = $(datadir)/getopt/
+dist_example_SCRIPTS = getopt-parse.bash getopt-parse.tcsh \
+	getopt-test.bash getopt-test.tcsh
+
+EXTRA_DIST = README Changelog COPYING
+
diff --git a/util-linux-ng-2.17.2/getopt/Makefile.in b/util-linux-ng-2.17.2/getopt/Makefile.in
new file mode 100644
index 0000000..eb0d00a
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/Makefile.in
@@ -0,0 +1,725 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = README $(dist_example_SCRIPTS) $(dist_man_MANS) \
+	$(dist_noinst_DATA) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/config/include-Makefile.am \
+	COPYING
+usrbin_exec_PROGRAMS = getopt$(EXEEXT)
+subdir = getopt
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(usrbin_execdir)" \
+	"$(DESTDIR)$(exampledir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(usrbin_exec_PROGRAMS)
+getopt_SOURCES = getopt.c
+getopt_OBJECTS = getopt.$(OBJEXT)
+getopt_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+SCRIPTS = $(dist_example_SCRIPTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = getopt.c
+DIST_SOURCES = getopt.c
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(dist_man_MANS)
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+dist_man_MANS = getopt.1
+exampledir = $(datadir)/getopt/
+dist_example_SCRIPTS = getopt-parse.bash getopt-parse.tcsh \
+	getopt-test.bash getopt-test.tcsh
+
+EXTRA_DIST = README Changelog COPYING
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign getopt/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign getopt/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
+$(am__aclocal_m4_deps):
+install-usrbin_execPROGRAMS: $(usrbin_exec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(usrbin_execdir)" || $(MKDIR_P) "$(DESTDIR)$(usrbin_execdir)"
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(usrbin_execdir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usrbin_execdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-usrbin_execPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(usrbin_execdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(usrbin_execdir)" && rm -f $$files
+
+clean-usrbin_execPROGRAMS:
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+getopt$(EXEEXT): $(getopt_OBJECTS) $(getopt_DEPENDENCIES) 
+	@rm -f getopt$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(getopt_OBJECTS) $(getopt_LDADD) $(LIBS)
+install-dist_exampleSCRIPTS: $(dist_example_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)"
+	@list='$(dist_example_SCRIPTS)'; test -n "$(exampledir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(exampledir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(exampledir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-dist_exampleSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_example_SCRIPTS)'; test -n "$(exampledir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(exampledir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(exampledir)" && rm -f $$files
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man1: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man1:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(usrbin_execdir)" "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(man1dir)"; 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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool clean-usrbin_execPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_exampleSCRIPTS install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-usrbin_execPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_exampleSCRIPTS uninstall-man \
+	uninstall-usrbin_execPROGRAMS
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-usrbin_execPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-dist_exampleSCRIPTS install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-man1 \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip install-usrbin_execPROGRAMS installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-dist_exampleSCRIPTS \
+	uninstall-man uninstall-man1 uninstall-usrbin_execPROGRAMS
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/getopt/README b/util-linux-ng-2.17.2/getopt/README
new file mode 100644
index 0000000..dbf7bb0
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/README
@@ -0,0 +1,81 @@
+This package contains a reimplementation of getopt(1).
+
+PREFACE
+
+Getopt(1) is a program to help shell scripts parse command-line parameters.
+It is for example included in the util-linux distribution (upto version
+2.7.1). But, there are some problems with that getopt(1) implementation, 
+as listed in the 'BUGS' section of its man-page:
+
+>BUGS
+>     Whatever getopt(3) has.
+>
+>     Arguments containing white space or imbedded shell metacharacters gener-
+>     ally will not survive intact;  this looks easy to fix but isn't.
+>
+>     The error message for an invalid option is identified as coming from
+>     getopt rather than from the shell procedure containing the invocation of
+>     getopt; this again is hard to fix.
+>
+>     The precise best way to use the set command to set the arguments without
+>     disrupting the value(s) of shell options varies from one shell version to
+>     another.
+
+This implementation of getopt(1) is written to solve some of these problems,
+while still staying (for all practical purposes) completely compatible with
+other getopt(1) implementations.
+
+
+INSTALLATION
+
+Installation should be very easy. Just type 'make' to compile the sources.
+It should compile cleanly, without any warnings, but even if it does not
+you probably don't have to worry. You must use GNU Make and gcc, or you
+will have to edit the Makefile. 
+
+Type 'make install' to install the binary and the manual page. It installs 
+by default in /usr/local/bin and /usr/local/man/man1, to install in /usr/bin 
+and /usr/man/man1 try 'make install prefix=/usr'.
+
+The example files can be installed in /usr/local/lib/getopt by calling
+'make install_doc'.
+
+If you do not trust the getopt(3) in your libc, or if you do not use a libc
+with the GNU getopt(3) routines, you can use the gnu sources as provided 
+in the gnu directory. Try 'make LIBCGETOPT=0'. Ignore any compile warnings.
+
+You can check whether the new implementation of getopt is found first
+in your path by calling 'bash test.bash'.
+
+
+HIGHLIGHTS
+
+It can do anything that the GNU getopt(3) routines can do.
+
+It can cope with spaces and shell metacharacters within arguments.
+
+It can parse long parameters.
+
+It can shuffle parameters, so you can mix options and other parameters on
+the command-line.
+
+It can be easily identified as an enhanced getopt(1) from within shell scripts.
+
+It can report parse errors as coming from the shell script.
+
+It is fully compatible with other getopt(1) implementations.
+
+COPYING
+
+This program comes under the GNU general public licence version 2. See the 
+file COPYING included in this package. Note that though you may freely
+copy it, it is copyright (c) 1997-2005 by Frodo Looijaard 
+<frodo@frodo.looijaard.name>.
+Files in the gnu directory are from glibc-2.0.4: copyright (C) 1987, 88, 
+89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+
+
+DOWNLOADING
+
+You can find the latest version of this program at:
+  http://software.frodo.looijaard.name/getopt/
diff --git a/util-linux-ng-2.17.2/getopt/getopt-parse.bash b/util-linux-ng-2.17.2/getopt/getopt-parse.bash
new file mode 100755
index 0000000..864fc0a
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/getopt-parse.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# A small example program for using the new getopt(1) program.
+# This program will only work with bash(1)
+# An similar program using the tcsh(1) script language can be found
+# as parse.tcsh
+
+# Example input and output (from the bash prompt):
+# ./parse.bash -a par1 'another arg' --c-long 'wow!*\?' -cmore -b " very long "
+# Option a
+# Option c, no argument
+# Option c, argument `more'
+# Option b, argument ` very long '
+# Remaining arguments:
+# --> `par1'
+# --> `another arg'
+# --> `wow!*\?'
+
+# Note that we use `"$@"' to let each command-line parameter expand to a 
+# separate word. The quotes around `$@' are essential!
+# We need TEMP as the `eval set --' would nuke the return value of getopt.
+TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
+     -n 'example.bash' -- "$@"`
+
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+
+# Note the quotes around `$TEMP': they are essential!
+eval set -- "$TEMP"
+
+while true ; do
+	case "$1" in
+		-a|--a-long) echo "Option a" ; shift ;;
+		-b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
+		-c|--c-long) 
+			# c has an optional argument. As we are in quoted mode,
+			# an empty parameter will be generated if its optional
+			# argument is not found.
+			case "$2" in
+				"") echo "Option c, no argument"; shift 2 ;;
+				*)  echo "Option c, argument \`$2'" ; shift 2 ;;
+			esac ;;
+		--) shift ; break ;;
+		*) echo "Internal error!" ; exit 1 ;;
+	esac
+done
+echo "Remaining arguments:"
+for arg do echo '--> '"\`$arg'" ; done
diff --git a/util-linux-ng-2.17.2/getopt/getopt-parse.tcsh b/util-linux-ng-2.17.2/getopt/getopt-parse.tcsh
new file mode 100755
index 0000000..2266d0e
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/getopt-parse.tcsh
@@ -0,0 +1,77 @@
+#!/bin/tcsh
+
+# A small example program for using the new getopt(1) program.
+# This program will only work with tcsh(1)
+# An similar program using the bash(1) script language can be found
+# as parse.bash
+
+# Example input and output (from the tcsh prompt):
+# ./parse.tcsh -a par1 'another arg' --c-long 'wow\!*\?' -cmore -b " very long "
+# Option a
+# Option c, no argument
+# Option c, argument `more'
+# Option b, argument ` very long '
+# Remaining arguments:
+# --> `par1'
+# --> `another arg'
+# --> `wow!*\?'
+
+# Note that we had to escape the exclamation mark in the wow-argument. This
+# is _not_ a problem with getopt, but with the tcsh command parsing. If you
+# would give the same line from the bash prompt (ie. call ./parse.tcsh),
+# you could remove the exclamation mark.
+
+# This is a bit tricky. We use a temp variable, to be able to check the
+# return value of getopt (eval nukes it). argv contains the command arguments
+# as a list. The ':q`  copies that list without doing any substitutions:
+# each element of argv becomes a separate argument for getopt. The braces
+# are needed because the result is also a list.
+set temp=(`getopt -s tcsh -o ab:c:: --long a-long,b-long:,c-long:: -- $argv:q`)
+if ($? != 0) then 
+  echo "Terminating..." >/dev/stderr
+  exit 1
+endif
+
+# Now we do the eval part. As the result is a list, we need braces. But they
+# must be quoted, because they must be evaluated when the eval is called.
+# The 'q` stops doing any silly substitutions.
+eval set argv=\($temp:q\)
+
+while (1)
+	switch($1:q)
+	case -a:
+	case --a-long:
+		echo "Option a" ; shift 
+		breaksw;
+	case -b:
+	case --b-long:
+		echo "Option b, argument "\`$2:q\' ; shift ; shift
+		breaksw
+	case -c:
+	case --c-long:
+		# c has an optional argument. As we are in quoted mode,
+		# an empty parameter will be generated if its optional
+		# argument is not found.
+
+		if ($2:q == "") then
+			echo "Option c, no argument"
+		else
+			echo "Option c, argument "\`$2:q\'
+		endif
+		shift; shift
+		breaksw
+	case --:
+		shift
+		break
+	default:
+		echo "Internal error!" ; exit 1
+	endsw
+end
+
+echo "Remaining arguments:"
+# foreach el ($argv:q) created problems for some tcsh-versions (at least
+# 6.02). So we use another shift-loop here:
+while ($#argv > 0)
+	echo '--> '\`$1:q\'
+	shift
+end
diff --git a/util-linux-ng-2.17.2/getopt/getopt-test.bash b/util-linux-ng-2.17.2/getopt/getopt-test.bash
new file mode 100755
index 0000000..149e1f9
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/getopt-test.bash
@@ -0,0 +1,6 @@
+#!/bin/bash
+if `getopt -T >/dev/null 2>&1` ; [ $? = 4 ] ; then
+  echo "Enhanced getopt(1)"
+else
+  echo "Old getopt(1)"
+fi
diff --git a/util-linux-ng-2.17.2/getopt/getopt-test.tcsh b/util-linux-ng-2.17.2/getopt/getopt-test.tcsh
new file mode 100755
index 0000000..d661e76
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/getopt-test.tcsh
@@ -0,0 +1,7 @@
+#!/bin/tcsh
+getopt -T >&/dev/null
+if ( $status == 4) then
+  echo "Enhanced getopt(1)"
+else
+  echo "Old getopt(1)"
+endif
diff --git a/util-linux-ng-2.17.2/getopt/getopt.1 b/util-linux-ng-2.17.2/getopt/getopt.1
new file mode 100644
index 0000000..755dc97
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/getopt.1
@@ -0,0 +1,464 @@
+.TH GETOPT 1 "May 31, 1997" Linux ""
+.SH NAME
+getopt \- parse command options (enhanced)
+.SH SYNOPSIS
+.B getopt
+.I optstring parameters
+.br
+.B getopt
+.RI [ options ]
+.RB [ \-\- ]
+.I optstring parameters
+.br
+.B getopt
+.RI [ options ]
+.BR \-o | \-\-options
+.I optstring
+.RI [ options ]
+.RB [ \-\- ]
+.I parameters
+.SH DESCRIPTION
+.B getopt
+is used to break up
+.RI ( parse )
+options in command lines for easy parsing by
+shell procedures, and to check for legal options.
+It uses the
+.SM GNU
+.BR getopt (3)
+routines to do this.
+
+The parameters
+.B getopt
+is called with can be divided into two parts: options
+which modify the way getopt will parse
+.RI ( options
+and
+.BR \-o | \-\-options
+.I optstring
+in the
+.BR SYNOPSIS ),
+and the parameters which are to be
+parsed
+.RI ( parameters
+in the
+.BR SYNOPSIS ).
+The second part will start at the first non\-option parameter
+that is not an option argument, or after the first occurrence of
+.RB ` \-\- '.
+If no
+.RB ` \-o '
+or
+.RB ` \-\-options '
+option is found in the first part, the first
+parameter of the second part is used as the short options string.
+
+If the environment variable
+.B GETOPT_COMPATIBLE
+is set, or if its first parameter
+is not an option (does not start with a
+.RB ` \- ',
+this is the first format in the
+.BR SYNOPSIS),
+.B getopt
+will generate output that is compatible with that of other versions of
+.BR getopt (1).
+It will still do parameter shuffling and recognize optional
+arguments (see section
+.B COMPATIBILITY
+for more information).
+
+Traditional implementations of
+.BR getopt (1)
+are unable to cope with whitespace and other (shell\-specific) special characters
+in arguments and non\-option parameters. To solve this problem, this
+implementation can generate
+quoted output which must once again be interpreted by the shell (usually
+by using the
+.B eval
+command). This has the effect of preserving those characters, but
+you must call
+.B getopt
+in a way that is no longer compatible with other versions (the second
+or third format in the
+.BR SYNOPSIS ).
+To determine whether this enhanced version of
+.BR getopt (1)
+is installed, a special test option
+.RB ( \-T )
+can be used.
+.SH OPTIONS
+.TP
+.BR \-a , " \-\-alternative"
+Allow long options to start with a single
+.RB ` \- '.
+.TP
+.BR \-h , " \-\-help"
+Output a small usage guide and exit successfully. No other output is generated.
+.TP
+.BR \-l , " \-\-longoptions \fIlongopts\fP"
+The long (multi\-character) options to be recognized.
+More than one option name
+may be specified at once, by separating the names with commas. This option
+may be given more than once, the
+.I longopts
+are cumulative.
+Each long option name
+in
+.I longopts
+may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument.
+.TP
+.BR \-n , " \-\-name \fIprogname\fP"
+The name that will be used by the
+.BR getopt (3)
+routines when it reports errors. Note that errors of
+.BR getopt (1)
+are still reported as coming from getopt.
+.TP
+.BR \-o , " \-\-options \fIshortopts\fP"
+The short (one\-character) options to be recognized. If this option is not
+found, the first parameter of
+.B getopt
+that does not start with
+a
+.RB ` \- '
+(and is not an option argument) is used as the short options string.
+Each short option character
+in
+.I shortopts
+may be followed by one colon to indicate it has a required argument,
+and by two colons to indicate it has an optional argument.
+The first character of shortopts may be
+.RB ` + '
+or
+.RB ` \- '
+to influence the way
+options are parsed and output is generated (see section
+.B SCANNING MODES
+for details).
+.TP
+.BR \-q , " \-\-quiet"
+Disable error reporting by getopt(3).
+.TP
+.BR  \-Q , " \-\-quiet\-output"
+Do not generate normal output. Errors are still reported by
+.BR getopt (3),
+unless you also use
+.IR \-q .
+.TP
+.BR \-s , " \-\-shell \fIshell\fP"
+Set quoting conventions to those of shell. If no \-s argument is found,
+the
+.SM BASH
+conventions are used. Valid arguments are currently
+.RB ` sh '
+.RB ` bash ',
+.RB ` csh ',
+and
+.RB ` tcsh '.
+.TP
+.BR \-u , " \-\-unquoted"
+Do not quote the output. Note that whitespace and special (shell\-dependent)
+characters can cause havoc in this mode (like they do with other
+.BR getopt (1)
+implementations).
+.TP
+.BR \-T , " \-\-test"
+Test if your
+.BR getopt (1)
+is this enhanced version or an old version. This generates no output,
+and sets the error status to 4. Other implementations of
+.BR getopt (1),
+and this version if the environment variable
+.B GETOPT_COMPATIBLE
+is set,
+will return
+.RB ` \-\- '
+and error status 0.
+.TP
+.BR \-V , " \-\-version"
+Output version information and exit successfully. No other output is generated.
+.SH PARSING
+This section specifies the format of the second part of the parameters of
+.B getopt
+(the
+.I parameters
+in the
+.BR SYNOPSIS ).
+The next section
+.RB ( OUTPUT )
+describes the output that is
+generated. These parameters were typically the parameters a shell function
+was called with.
+Care must be taken that each parameter the shell function was
+called with corresponds to exactly one parameter in the parameter list of
+.B getopt
+(see the
+.BR EXAMPLES ).
+All parsing is done by the GNU
+.BR getopt (3)
+routines.
+
+The parameters are parsed from left to right. Each parameter is classified as a
+short option, a long option, an argument to an option,
+or a non\-option parameter.
+
+A simple short option is a
+.RB ` \- '
+followed by a short option character. If
+the option has a required argument, it may be written directly after the option
+character or as the next parameter (ie. separated by whitespace on the
+command line). If the
+option has an optional argument, it must be written directly after the
+option character if present.
+
+It is possible to specify several short options after one
+.RB ` \- ',
+as long as all (except possibly the last) do not have required or optional
+arguments.
+
+A long option normally begins with
+.RB ` \-\- '
+followed by the long option name.
+If the option has a required argument, it may be written directly after
+the long option name, separated by
+.RB ` = ',
+or as the next argument (ie. separated by whitespace on the command line).
+If the option has an optional argument, it must
+be written directly after the long option name, separated by
+.RB ` = ',
+if present (if you add the
+.RB ` = '
+but nothing behind it, it is interpreted
+as if no argument was present; this is a slight bug, see the
+.BR BUGS ).
+Long options may be abbreviated, as long as the abbreviation is not
+ambiguous.
+
+Each parameter not starting with a
+.RB ` \- ',
+and not a required argument of
+a previous option, is a non\-option parameter. Each parameter after
+a
+.RB ` \-\- '
+parameter is always interpreted as a non\-option parameter.
+If the environment variable
+.B POSIXLY_CORRECT
+is set, or if the short
+option string started with a
+.RB ` + ',
+all remaining parameters are interpreted
+as non\-option parameters as soon as the first non\-option parameter is
+found.
+.SH OUTPUT
+Output is generated for each element described in the previous section.
+Output is done
+in the same order as the elements are specified in the input, except
+for non\-option parameters. Output can be done in
+.I compatible
+.RI ( unquoted )
+mode, or in such way that whitespace and other special characters within
+arguments and non\-option parameters are preserved (see
+.BR QUOTING ).
+When the output is processed in the shell script, it will seem to be
+composed of distinct elements that can be processed one by one (by using the
+shift command in most shell languages). This is imperfect in unquoted mode,
+as elements can be split at unexpected places if they contain whitespace
+or special characters.
+
+If there are problems parsing the parameters, for example because a
+required argument is not found or an option is not recognized, an error
+will be reported on stderr, there will be no output for the offending
+element, and a non\-zero error status is returned.
+
+For a short option, a single
+.RB ` \- '
+and the option character are generated
+as one parameter. If the option has an argument, the next
+parameter will be the argument. If the option takes an optional argument,
+but none was found, the next parameter will be generated but be empty in
+quoting mode,
+but no second parameter will be generated in unquoted (compatible) mode.
+Note that many other
+.BR getopt (1)
+implementations do not support optional arguments.
+
+If several short options were specified after a single
+.RB ` \- ',
+each will be present in the output as a separate parameter.
+
+For a long option,
+.RB ` \-\- '
+and the full option name are generated as one
+parameter. This is done regardless whether the option was abbreviated or
+specified with a single
+.RB ` \- '
+in the input. Arguments are handled as with short options.
+
+Normally, no non\-option parameters output is generated until all options
+and their arguments have been generated. Then
+.RB ` \-\- '
+is generated as a
+single parameter, and after it the non\-option parameters in the order
+they were found, each as a separate parameter.
+Only if the first character of the short options string was a
+.RB ` \- ',
+non\-option parameter output is generated at the place they are found in the
+input (this is not supported if the first format of the
+.B SYNOPSIS
+is used; in that case all preceding occurrences of
+.RB ` \- '
+and
+.RB ` + '
+are ignored).
+.SH QUOTING
+In compatible mode, whitespace or 'special' characters in arguments or
+non\-option parameters are not handled correctly. As the output is
+fed to the shell script, the script does not know how it is supposed to break
+the output into separate parameters.  To circumvent this
+problem, this implementation offers quoting. The idea is that output
+is generated with quotes around each parameter. When this output is once
+again fed to the shell (usually by a shell
+.B eval
+command), it is split correctly into separate parameters.
+
+Quoting is not enabled if the environment variable
+.B GETOPT_COMPATIBLE
+is set, if the first form of the
+.B SYNOPSIS
+is used, or if the option
+.RB ` \-u '
+is found.
+
+Different shells use different quoting conventions. You can use the
+.RB ` \-s '
+option to select the shell you are using. The following shells are
+currently supported:
+.RB ` sh ',
+.RB ` bash ',
+.RB ` csh '
+and
+.RB ` tcsh '.
+Actually, only two `flavors' are distinguished: sh\-like quoting conventions
+and csh\-like quoting conventions. Chances are that if you use another shell
+script language, one of these flavors can still be used.
+
+.SH "SCANNING MODES"
+The first character of the short options string may be a
+.RB ` \- '
+or a
+.RB ` + '
+to indicate a special scanning mode. If the first calling form
+in the
+.B SYNOPSIS
+is used they are ignored; the environment variable
+.B POSIXLY_CORRECT
+is still examined, though.
+
+If the first character is
+.RB ` + ',
+or if the environment variable
+.B POSIXLY_CORRECT
+is set, parsing stops as soon as the first non\-option parameter
+(ie. a parameter that does not start with a
+.RB ` \- ')
+is found that
+is not an option argument. The remaining parameters are all interpreted as
+non\-option parameters.
+
+If the first character is a
+.RB ` \- ',
+non\-option parameters are outputted at the place where they are found; in normal
+operation, they are all collected at the end of output after a
+.RB ` \-\- '
+parameter has been generated. Note that this
+.RB ` \-\- '
+parameter is still generated, but it will always be the last parameter in
+this mode.
+.SH COMPATIBILITY
+This version of
+.BR getopt (1)
+is written to be as compatible as possible to
+other versions. Usually you can just replace them with this version
+without any modifications, and with some advantages.
+
+If the first character of the first parameter of getopt is not a
+.RB ` \- ',
+getopt goes into compatibility mode. It will interpret its first parameter as
+the string of short options, and all other arguments will be parsed. It
+will still do parameter shuffling (ie. all non\-option parameters are outputted
+at the end), unless the environment variable
+.B POSIXLY_CORRECT
+is set.
+
+The environment variable
+.B GETOPT_COMPATIBLE
+forces
+.B getopt
+into compatibility mode. Setting both this environment variable and
+.B POSIXLY_CORRECT
+offers 100% compatibility for `difficult' programs. Usually, though,
+neither is needed.
+
+In compatibility mode, leading
+.RB ` \- '
+and
+.RB ` + '
+characters in the short options string are ignored.
+.SH RETURN CODES
+.B getopt
+returns error code
+.B 0
+for successful parsing,
+.B 1
+if
+.BR getopt (3)
+returns errors,
+.B 2
+if it does not understand its own parameters,
+.B 3
+if an internal error occurs like out\-of\-memory, and
+.B 4
+if it is called with
+.BR \-T .
+.SH EXAMPLES
+Example scripts for (ba)sh and (t)csh are provided with the
+.BR getopt (1)
+distribution, and are optionally installed in
+.BR /usr/share/getopt .
+
+.SH ENVIRONMENT
+.IP POSIXLY_CORRECT
+This environment variable is examined by the
+.BR getopt (3)
+routines.
+If it is set, parsing stops as soon as a parameter
+is found that is not an option or an option argument. All remaining
+parameters are also interpreted as non\-option parameters, regardless
+whether they start with a
+.RB ` \- '.
+.IP GETOPT_COMPATIBLE
+Forces
+.B getopt
+to use the first calling format as specified in the
+.BR SYNOPSIS .
+.SH BUGS
+.BR getopt (3)
+can parse long options with optional arguments that are given an empty optional
+argument (but can not do this for short options). This
+.BR getopt (1)
+treats optional arguments that are empty as if they were not present.
+
+The syntax if you do not want any short option variables at all is
+not very intuitive (you have to set them explicitly to the empty
+string).
+
+.SH AUTHOR
+Frodo Looijaard <frodo@frodo.looijaard.name>
+.SH "SEE ALSO"
+.BR getopt (3),
+.BR bash (1),
+.BR tcsh (1).
+.SH AVAILABILITY
+The getopt command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/getopt/getopt.c b/util-linux-ng-2.17.2/getopt/getopt.c
new file mode 100644
index 0000000..fbcfb05
--- /dev/null
+++ b/util-linux-ng-2.17.2/getopt/getopt.c
@@ -0,0 +1,459 @@
+/*
+    getopt.c - Enhanced implementation of BSD getopt(1)
+    Copyright (c) 1997-2005 Frodo Looijaard <frodo@frodo.looijaard.name>
+
+    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., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/* 
+ * Version 1.0-b4: Tue Sep 23 1997. First public release.
+ * Version 1.0: Wed Nov 19 1997. 
+ *   Bumped up the version number to 1.0
+ *   Fixed minor typo (CSH instead of TCSH)
+ * Version 1.0.1: Tue Jun 3 1998
+ *   Fixed sizeof instead of strlen bug
+ *   Bumped up the version number to 1.0.1
+ * Version 1.0.2: Thu Jun 11 1998 (not present)
+ *   Fixed gcc-2.8.1 warnings
+ *   Fixed --version/-V option (not present)
+ * Version 1.0.5: Tue Jun 22 1999
+ *   Make -u option work (not present)
+ * Version 1.0.6: Tue Jun 27 2000
+ *   No important changes
+ * Version 1.1.0: Tue Jun 30 2000
+ *   Added NLS support (partly written by Arkadiusz Mi<B6>kiewicz 
+ *     <misiek@pld.org.pl>)
+ * Version 1.1.4: Mon Nov 7 2005
+ *   Fixed a few type's in the manpage
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <getopt.h>
+
+#include "nls.h"
+
+/* NON_OPT is the code that is returned when a non-option is found in '+' 
+   mode */
+#define NON_OPT 1
+/* LONG_OPT is the code that is returned when a long option is found. */
+#define LONG_OPT 2
+
+/* The shells recognized. */
+typedef enum {BASH,TCSH} shell_t;
+
+
+/* Some global variables that tells us how to parse. */
+shell_t shell=BASH; /* The shell we generate output for. */
+int quiet_errors=0; /* 0 is not quiet. */
+int quiet_output=0; /* 0 is not quiet. */
+int quote=1; /* 1 is do quote. */
+int alternative=0; /* 0 is getopt_long, 1 is getopt_long_only */
+
+/* Function prototypes */
+void *our_malloc(size_t size);
+void *our_realloc(void *ptr, size_t size);
+const char *normalize(const char *arg);
+int generate_output(char * argv[],int argc,const char *optstr,
+                    const struct option *longopts);
+int main(int argc, char *argv[]);
+void parse_error(const char *message);
+void add_long_options(char *options);
+void add_longopt(const char *name,int has_arg);
+void print_help(void);
+void set_shell(const char *new_shell);
+void set_initial_shell(void);
+
+void *our_malloc(size_t size)
+{
+	void *ret=malloc(size);
+	if (! ret) {
+		fprintf(stderr,_("%s: Out of memory!\n"),"getopt");
+		exit(3);
+	}
+	return(ret);
+}
+
+void *our_realloc(void *ptr, size_t size)
+{
+	void *ret=realloc(ptr,size);
+	if (! ret && size) {
+		fprintf(stderr,_("%s: Out of memory!\n"),"getopt");
+		exit(3);
+	}
+	return(ret);
+}
+
+/*
+ * This function 'normalizes' a single argument: it puts single quotes around
+ * it and escapes other special characters. If quote is false, it just
+ * returns its argument.
+ * Bash only needs special treatment for single quotes; tcsh also recognizes
+ * exclamation marks within single quotes, and nukes whitespace.
+ * This function returns a pointer to a buffer that is overwritten by 
+ * each call.
+ */
+const char *normalize(const char *arg)
+{
+	static char *BUFFER=NULL;
+	const char *argptr=arg;
+	char *bufptr;
+
+	free(BUFFER);
+
+	if (!quote) { /* Just copy arg */
+		BUFFER=our_malloc(strlen(arg)+1);
+			
+		strcpy(BUFFER,arg);
+		return BUFFER;
+	}
+
+	/* Each character in arg may take upto four characters in the result:
+	   For a quote we need a closing quote, a backslash, a quote and an
+	   opening quote! We need also the global opening and closing quote,
+	   and one extra character for '\0'. */
+	BUFFER=our_malloc(strlen(arg)*4+3);
+
+	bufptr=BUFFER;
+	*bufptr++='\'';
+
+	while (*argptr) {
+		if (*argptr == '\'') {
+			/* Quote: replace it with: '\'' */
+			*bufptr++='\'';
+			*bufptr++='\\';
+			*bufptr++='\'';
+			*bufptr++='\'';
+		} else if (shell==TCSH && *argptr=='!') {
+			/* Exclamation mark: replace it with: \! */
+			*bufptr++='\'';
+			*bufptr++='\\';
+			*bufptr++='!';
+			*bufptr++='\'';
+		} else if (shell==TCSH && *argptr=='\n') {
+			/* Newline: replace it with: \n */
+			*bufptr++='\\';
+			*bufptr++='n';
+		} else if (shell==TCSH && isspace(*argptr)) {
+			/* Non-newline whitespace: replace it with \<ws> */
+			*bufptr++='\'';
+			*bufptr++='\\';
+			*bufptr++=*argptr;
+			*bufptr++='\'';
+		} else
+			/* Just copy */
+			*bufptr++=*argptr;
+		argptr++;
+	}
+	*bufptr++='\'';
+	*bufptr++='\0';
+	return BUFFER;
+}
+
+/* 
+ * Generate the output. argv[0] is the program name (used for reporting errors).
+ * argv[1..] contains the options to be parsed. argc must be the number of
+ * elements in argv (ie. 1 if there are no options, only the program name),
+ * optstr must contain the short options, and longopts the long options.
+ * Other settings are found in global variables.
+ */
+int generate_output(char * argv[],int argc,const char *optstr,
+                    const struct option *longopts)
+{
+	int exit_code = 0; /* We assume everything will be OK */
+	int opt;
+	int longindex;
+	const char *charptr;
+
+	if (quiet_errors) /* No error reporting from getopt(3) */
+		opterr=0;
+	optind=0; /* Reset getopt(3) */
+
+	while ((opt = (alternative?
+	              getopt_long_only(argc,argv,optstr,longopts,&longindex):
+	              getopt_long(argc,argv,optstr,longopts,&longindex))) 
+               != EOF) 
+		if (opt == '?' || opt == ':' )
+			exit_code = 1;
+		else if (!quiet_output) 
+		{
+			if (opt == LONG_OPT) {
+				printf(" --%s",longopts[longindex].name);
+				if (longopts[longindex].has_arg) 
+					printf(" %s",
+					       normalize(optarg?optarg:""));
+			} else if (opt == NON_OPT) 
+				printf(" %s",normalize(optarg)); 
+			else {
+				printf(" -%c",opt);
+				charptr = strchr(optstr,opt);
+				if (charptr != NULL && *++charptr == ':')
+					printf(" %s",
+					       normalize(optarg?optarg:""));
+			}
+		}
+	
+	if (! quiet_output) {
+		printf(" --");
+		while (optind < argc) 
+			printf(" %s",normalize(argv[optind++]));
+		printf("\n");
+	}
+	return exit_code;
+}
+
+/*
+ * Report an error when parsing getopt's own arguments.
+ * If message is NULL, we already sent a message, we just exit with a helpful
+ * hint.
+ */
+void parse_error(const char *message)
+{
+	if (message)
+		fprintf(stderr,"getopt: %s\n",message);
+	fputs(_("Try `getopt --help' for more information.\n"),stderr);
+	exit(2);
+}
+
+static struct option *long_options=NULL;
+static int long_options_length=0; /* Length of array */
+static int long_options_nr=0; /* Nr of used elements in array */
+#define LONG_OPTIONS_INCR 10
+#define init_longopt() add_longopt(NULL,0)
+
+/* Register a long option. The contents of name is copied. */
+void add_longopt(const char *name,int has_arg)
+{
+	char *tmp;
+	if (!name) { /* init */
+		free(long_options);
+		long_options=NULL;
+		long_options_length=0;
+		long_options_nr=0;
+	}
+
+	if (long_options_nr == long_options_length) {
+		long_options_length += LONG_OPTIONS_INCR;
+		long_options=our_realloc(long_options,
+		                         sizeof(struct option) * 
+		                           long_options_length);
+	}
+
+	long_options[long_options_nr].name=NULL;
+	long_options[long_options_nr].has_arg=0;
+	long_options[long_options_nr].flag=NULL;
+	long_options[long_options_nr].val=0;
+
+	if (long_options_nr) { /* Not for init! */
+		long_options[long_options_nr-1].has_arg=has_arg;
+		long_options[long_options_nr-1].flag=NULL;
+		long_options[long_options_nr-1].val=LONG_OPT;
+		tmp = our_malloc(strlen(name)+1);
+		strcpy(tmp,name);
+		long_options[long_options_nr-1].name=tmp;
+	}
+	long_options_nr++;
+}
+	
+
+/* 
+ * Register several long options. options is a string of long options, 
+ * separated by commas or whitespace. 
+ * This nukes options! 
+ */
+void add_long_options(char *options)
+{
+	int arg_opt;
+	char *tokptr=strtok(options,", \t\n");
+	while (tokptr) {
+		arg_opt=no_argument;
+		if (strlen(tokptr) > 0) {
+			if (tokptr[strlen(tokptr)-1] == ':') {
+				if (tokptr[strlen(tokptr)-2] == ':') {
+					tokptr[strlen(tokptr)-2]='\0';
+					arg_opt=optional_argument;
+				} else {
+					tokptr[strlen(tokptr)-1]='\0';
+					arg_opt=required_argument;
+				}
+				if (strlen(tokptr) == 0)
+					parse_error(_("empty long option after "
+					              "-l or --long argument"));
+			}
+			add_longopt(tokptr,arg_opt);
+		}
+		tokptr=strtok(NULL,", \t\n");
+	}
+}
+
+void set_shell(const char *new_shell)
+{
+	if (!strcmp(new_shell,"bash"))
+		shell=BASH;
+	else if (!strcmp(new_shell,"tcsh"))
+		shell=TCSH;
+	else if (!strcmp(new_shell,"sh"))
+		shell=BASH;
+	else if (!strcmp(new_shell,"csh"))
+		shell=TCSH;
+	else
+		parse_error(_("unknown shell after -s or --shell argument"));
+}
+
+void print_help(void)
+{
+	fputs(_("Usage: getopt optstring parameters\n"),stderr);
+	fputs(_("       getopt [options] [--] optstring parameters\n"),stderr);
+	fputs(_("       getopt [options] -o|--options optstring [options] [--]\n"),stderr);
+	fputs(_("              parameters\n"),stderr);
+	fputs(_("  -a, --alternative            Allow long options starting with single -\n"),stderr);
+	fputs(_("  -h, --help                   This small usage guide\n"),stderr);
+	fputs(_("  -l, --longoptions=longopts   Long options to be recognized\n"),stderr);
+	fputs(_("  -n, --name=progname          The name under which errors are reported\n"),stderr);
+	fputs(_("  -o, --options=optstring      Short options to be recognized\n"),stderr);
+	fputs(_("  -q, --quiet                  Disable error reporting by getopt(3)\n"),stderr);
+	fputs(_("  -Q, --quiet-output           No normal output\n"),stderr);
+	fputs(_("  -s, --shell=shell            Set shell quoting conventions\n"),stderr);	
+	fputs(_("  -T, --test                   Test for getopt(1) version\n"),stderr);
+	fputs(_("  -u, --unqote                 Do not quote the output\n"),stderr);
+	fputs(_("  -V, --version                Output version information\n"),stderr);
+	exit(2);
+}
+	
+/* Exit codes:
+ *   0) No errors, succesful operation.
+ *   1) getopt(3) returned an error.
+ *   2) A problem with parameter parsing for getopt(1).
+ *   3) Internal error, out of memory
+ *   4) Returned for -T
+ */
+
+static struct option longopts[]={ {"options",required_argument,NULL,'o'},
+                                  {"longoptions",required_argument,NULL,'l'},
+                                  {"quiet",no_argument,NULL,'q'},
+                                  {"quiet-output",no_argument,NULL,'Q'},
+                                  {"shell",required_argument,NULL,'s'},
+                                  {"test",no_argument,NULL,'T'},
+                                  {"unquoted",no_argument,NULL,'u'},
+                                  {"help",no_argument,NULL,'h'},
+                                  {"alternative",no_argument,NULL,'a'},
+                                  {"name",required_argument,NULL,'n'},
+                                  {"version",no_argument,NULL,'V'},
+                                  {NULL,0,NULL,0}
+                                };
+
+/* Stop scanning as soon as a non-option argument is found! */
+static const char *shortopts="+ao:l:n:qQs:TuhV";
+
+int main(int argc, char *argv[])
+{
+	char *optstr=NULL;
+	char *name=NULL;
+	int opt;
+	int compatible=0;
+
+	setlocale(LC_ALL,"");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	init_longopt();
+
+	if (getenv("GETOPT_COMPATIBLE")) 
+		compatible=1;
+
+	if (argc == 1) 
+	{
+		if (compatible) {
+			/* For some reason, the original getopt gave no error
+                           when there were no arguments. */
+			printf(" --\n");
+			exit(0);
+		}
+		else
+			parse_error(_("missing optstring argument"));
+	}
+	
+	if (argv[1][0] != '-' || compatible) {
+		quote=0;
+		optstr=our_malloc(strlen(argv[1])+1);
+		strcpy(optstr,argv[1]+strspn(argv[1],"-+"));
+		argv[1]=argv[0];
+		exit(generate_output(argv+1,argc-1,optstr,long_options));
+	}
+	
+	while ((opt=getopt_long(argc,argv,shortopts,longopts,NULL)) != EOF) 
+		switch (opt) {
+		case 'a':
+			alternative=1;
+			break;
+		case 'h':
+			print_help();
+			exit(0);
+		case 'o':
+			free(optstr);
+			optstr=our_malloc(strlen(optarg)+1);
+			strcpy(optstr,optarg);
+			break;
+		case 'l':
+			add_long_options(optarg);
+			break;
+		case 'n':
+			free(name);
+			name=our_malloc(strlen(optarg)+1);
+			strcpy(name,optarg);
+			break;
+		case 'q':
+			quiet_errors=1;
+			break;
+		case 'Q':
+			quiet_output=1;
+			break;
+		case 's':
+			set_shell(optarg);
+			break;
+		case 'T':
+			exit(4);
+		case 'u':
+			quote=0;
+			break;
+		case 'V':
+			printf(_("getopt (enhanced) 1.1.4\n"));
+			exit(0);
+		case '?':
+		case ':':
+			parse_error(NULL);
+		default:
+			parse_error(_("internal error, contact the author."));
+		}
+	
+	if (!optstr) 
+	{
+		if (optind >= argc)
+			parse_error(_("missing optstring argument"));
+		else {
+			optstr=our_malloc(strlen(argv[optind])+1);
+			strcpy(optstr,argv[optind]);
+			optind++;
+		}
+	}
+	if (name)
+		argv[optind-1]=name;
+	else
+		argv[optind-1]=argv[0];
+	exit(generate_output(argv+optind-1,argc-optind+1,optstr,long_options));
+}
diff --git a/util-linux-ng-2.17.2/hwclock/Makefile.am b/util-linux-ng-2.17.2/hwclock/Makefile.am
new file mode 100644
index 0000000..542521c
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/Makefile.am
@@ -0,0 +1,14 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+dist_man_MANS = hwclock.8
+
+sbin_PROGRAMS = hwclock
+
+hwclock_SOURCES = hwclock.c cmos.c rtc.c kd.c clock.h
+hwclock_LDADD =
+
+if HAVE_AUDIT
+hwclock_LDADD += -laudit
+endif
+
+EXTRA_DIST = README.hwclock clock-ppc.c
diff --git a/util-linux-ng-2.17.2/hwclock/Makefile.in b/util-linux-ng-2.17.2/hwclock/Makefile.in
new file mode 100644
index 0000000..627cf30
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/Makefile.in
@@ -0,0 +1,689 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(dist_man_MANS) $(dist_noinst_DATA) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config/include-Makefile.am
+sbin_PROGRAMS = hwclock$(EXEEXT)
+@HAVE_AUDIT_TRUE@am__append_1 = -laudit
+subdir = hwclock
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
+PROGRAMS = $(sbin_PROGRAMS)
+am_hwclock_OBJECTS = hwclock.$(OBJEXT) cmos.$(OBJEXT) rtc.$(OBJEXT) \
+	kd.$(OBJEXT)
+hwclock_OBJECTS = $(am_hwclock_OBJECTS)
+am__DEPENDENCIES_1 =
+hwclock_DEPENDENCIES = $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(hwclock_SOURCES)
+DIST_SOURCES = $(hwclock_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(dist_man_MANS)
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+dist_man_MANS = hwclock.8
+hwclock_SOURCES = hwclock.c cmos.c rtc.c kd.c clock.h
+hwclock_LDADD = $(am__append_1)
+EXTRA_DIST = README.hwclock clock-ppc.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hwclock/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign hwclock/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
+$(am__aclocal_m4_deps):
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+hwclock$(EXEEXT): $(hwclock_OBJECTS) $(hwclock_DEPENDENCIES) 
+	@rm -f hwclock$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hwclock_OBJECTS) $(hwclock_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmos.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwclock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtc.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man8: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(sbindir)" "$(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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool clean-sbinPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-sbinPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-man8 install-pdf install-pdf-am install-ps \
+	install-ps-am install-sbinPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-man uninstall-man8 \
+	uninstall-sbinPROGRAMS
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/hwclock/README.hwclock b/util-linux-ng-2.17.2/hwclock/README.hwclock
new file mode 100644
index 0000000..ba8bc44
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/README.hwclock
@@ -0,0 +1,27 @@
+Hwclock is a program that runs under Linux and sets and queries the 
+Hardware Clock, which is often called the Real Time Clock, RTC, or
+CMOS clock.
+
+Sometimes, you need to install hwclock setuid root.  If you want users
+other than the superuser to be able to display the clock value using the
+direct ISA I/O method, install it setuid root.  If you have the /dev/rtc
+interface on your system or are on a non-ISA system, there's probably
+no need for users to use the direct ISA I/O method, so don't bother.
+
+To install setuid root, do something like this:
+
+  chmod a=rx,u=s /sbin/hwclock
+
+In any case, hwclock will not allow you to set anything unless you have
+the superuser _real_ uid.  (This is restriction is not necessary if you
+haven't installed setuid root, but it's there for now).
+
+You may want to preformat and/or compress the man page before installing.
+
+If you want to build hwclock, just cd to the source directory and invoke
+make with no parameters.
+
+hwclock calls option processing routines in the libsshopt library,
+which is part of Sverre H. Huseby's "shhopt" package. You
+can find a more authoritative copy of this package on metalab
+(ftp://metalab.unc.edu/pub/Linux/libs/shhopt-X.Y).
diff --git a/util-linux-ng-2.17.2/hwclock/clock-ppc.c b/util-linux-ng-2.17.2/hwclock/clock-ppc.c
new file mode 100644
index 0000000..b73d0ad
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/clock-ppc.c
@@ -0,0 +1,459 @@
+/*
+From t-matsuu@protein.osaka-u.ac.jp Sat Jan 22 13:43:20 2000
+Date: Sat, 22 Jan 2000 21:42:54 +0900 (JST)
+To: Andries.Brouwer@cwi.nl
+Subject: Please merge the source for PPC
+From: MATSUURA Takanori <t-matsuu@protein.osaka-u.ac.jp>
+
+Even now, it is used clock-1.1 based source on Linux for PowerPC
+architecture, attached on this mail.
+
+Please merge this source in main util-linux source.
+
+But I'm not an author of this source, but Paul Mackerras.
+http://linuxcare.com.au/paulus/
+shows details of him.
+
+MATSUURA Takanori @ Division of Protein Chemistry, 
+                     Institute for Protein Research, Osaka University, Japan
+E-Mail: t-matsuu@protein.osaka-u.ac.jp
+Web Page: http://www.protein.osaka-u.ac.jp/chemistry/matsuura/
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <time.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <sys/time.h>
+
+#include <asm/cuda.h>
+
+/*
+ * Adapted for Power Macintosh by Paul Mackerras.
+ */
+
+/* V1.0
+ * CMOS clock manipulation - Charles Hedrick, hedrick@cs.rutgers.edu, Apr 1992
+ * 
+ * clock [-u] -r  - read cmos clock
+ * clock [-u] -w  - write cmos clock from system time
+ * clock [-u] -s  - set system time from cmos clock
+ * clock [-u] -a  - set system time from cmos clock, adjust the time to
+ *                  correct for systematic error, and put it back to the cmos.
+ *  -u indicates cmos clock is kept in universal time
+ *
+ * The program is designed to run setuid, since we need to be able to
+ * write to the CUDA.
+ *
+ *********************
+ * V1.1
+ * Modified for clock adjustments - Rob Hooft, hooft@chem.ruu.nl, Nov 1992
+ * Also moved error messages to stderr. The program now uses getopt.
+ * Changed some exit codes. Made 'gcc 2.3 -Wall' happy.
+ *
+ * I think a small explanation of the adjustment routine should be given
+ * here. The problem with my machine is that its CMOS clock is 10 seconds 
+ * per day slow. With this version of clock.c, and my '/etc/rc.local' 
+ * reading '/etc/clock -au' instead of '/etc/clock -u -s', this error 
+ * is automatically corrected at every boot. 
+ *
+ * To do this job, the program reads and writes the file '/etc/adjtime' 
+ * to determine the correction, and to save its data. In this file are 
+ * three numbers: 
+ *
+ * 1) the correction in seconds per day (So if your clock runs 5 
+ *    seconds per day fast, the first number should read -5.0)
+ * 2) the number of seconds since 1/1/1970 the last time the program was
+ *    used.
+ * 3) the remaining part of a second which was leftover after the last 
+ *    adjustment
+ *
+ * Installation and use of this program:
+ *
+ * a) create a file '/etc/adjtime' containing as the first and only line:
+ *    '0.0 0 0.0'
+ * b) run 'clock -au' or 'clock -a', depending on whether your cmos is in
+ *    universal or local time. This updates the second number.
+ * c) set your system time using the 'date' command.
+ * d) update your cmos time using 'clock -wu' or 'clock -w'
+ * e) replace the first number in /etc/adjtime by your correction.
+ * f) put the command 'clock -au' or 'clock -a' in your '/etc/rc.local'
+ *
+ * If the adjustment doesn't work for you, try contacting me by E-mail.
+ *
+ ******
+ * V1.2
+ *
+ * Applied patches by Harald Koenig (koenig@nova.tat.physik.uni-tuebingen.de)
+ * Patched and indented by Rob Hooft (hooft@EMBL-Heidelberg.DE)
+ * 
+ * A free quote from a MAIL-message (with spelling corrections):
+ *
+ * "I found the explanation and solution for the CMOS reading 0xff problem
+ *  in the 0.99pl13c (ALPHA) kernel: the RTC goes offline for a small amount
+ *  of time for updating. Solution is included in the kernel source 
+ *  (linux/kernel/time.c)."
+ *
+ * "I modified clock.c to fix this problem and added an option (now default,
+ *  look for USE_INLINE_ASM_IO) that I/O instructions are used as inline
+ *  code and not via /dev/port (still possible via #undef ...)."
+ *
+ * With the new code, which is partially taken from the kernel sources, 
+ * the CMOS clock handling looks much more "official".
+ * Thanks Harald (and Torsten for the kernel code)!
+ *
+ ******
+ * V1.3
+ * Canges from alan@spri.levels.unisa.edu.au (Alan Modra):
+ * a) Fix a few typos in comments and remove reference to making
+ *    clock -u a cron job.  The kernel adjusts cmos time every 11
+ *    minutes - see kernel/sched.c and kernel/time.c set_rtc_mmss().
+ *    This means we should really have a cron job updating
+ *    /etc/adjtime every 11 mins (set last_time to the current time
+ *    and not_adjusted to ???).
+ * b) Swapped arguments of outb() to agree with asm/io.h macro of the
+ *    same name.  Use outb() from asm/io.h as it's slightly better.
+ * c) Changed CMOS_READ and CMOS_WRITE to inline functions.  Inserted
+ *    cli()..sti() pairs in appropriate places to prevent possible
+ *    errors, and changed ioperm() call to iopl() to allow cli.
+ * d) Moved some variables around to localise them a bit.
+ * e) Fixed bug with clock -ua or clock -us that cleared environment
+ *    variable TZ.  This fix also cured the annoying display of bogus
+ *    day of week on a number of machines. (Use mktime(), ctime()
+ *    rather than asctime() )
+ * f) Use settimeofday() rather than stime().  This one is important
+ *    as it sets the kernel's timezone offset, which is returned by
+ *    gettimeofday(), and used for display of MSDOS and OS2 file
+ *    times.
+ * g) faith@cs.unc.edu added -D flag for debugging
+ *
+ * V1.4: alan@SPRI.Levels.UniSA.Edu.Au (Alan Modra)
+ *       Wed Feb  8 12:29:08 1995, fix for years > 2000.
+ *       faith@cs.unc.edu added -v option to print version.
+ *
+ * August 1996 Tom Dyas (tdyas@eden.rutgers.edu)
+ *       Converted to be compatible with the SPARC /dev/rtc driver.
+ *
+ */
+
+#define VERSION "1.4"
+
+/* Here the information for time adjustments is kept. */
+#define ADJPATH "/etc/adjtime"
+
+/* Apparently the RTC on PowerMacs stores seconds since 1 Jan 1904 */
+#define RTC_OFFSET	2082844800
+
+/* used for debugging the code. */
+/*#define KEEP_OFF */
+
+/* Globals */
+int readit = 0;
+int adjustit = 0;
+int writeit = 0;
+int setit = 0;
+int universal = 0;
+int debug = 0;
+
+time_t mkgmtime(struct tm *);
+
+volatile void 
+usage ( void )
+{
+  (void) fprintf (stderr, 
+    "clock [-u] -r|w|s|a|v\n"
+    "  r: read and print CMOS clock\n"
+    "  w: write CMOS clock from system time\n"
+    "  s: set system time from CMOS clock\n"
+    "  a: get system time and adjust CMOS clock\n"
+    "  u: CMOS clock is in universal time\n"
+    "  v: print version (" VERSION ") and exit\n"
+  );
+  exit(EXIT_FAILURE);
+}
+
+int adb_fd;
+
+void
+adb_init ( void )
+{
+  adb_fd = open ("/dev/adb", 2);
+  if (adb_fd < 0)
+    {
+      perror ("unable to open /dev/adb read/write : ");
+      exit(EXIT_FAILURE);
+    }
+}
+
+unsigned char get_packet[2] = { (unsigned char) CUDA_PACKET, 
+				(unsigned char) CUDA_GET_TIME };
+unsigned char set_packet[6] = { (unsigned char) CUDA_PACKET, 
+				(unsigned char) CUDA_SET_TIME };
+
+int 
+main (int argc, char **argv )
+{
+  struct tm tm, *tmp;
+  time_t systime;
+  time_t last_time;
+  time_t clock_time;
+  int i, arg;
+  double factor;
+  double not_adjusted;
+  int adjustment = 0;
+  /*   unsigned char save_control, save_freq_select; */
+  unsigned char reply[16];
+
+  while ((arg = getopt (argc, argv, "rwsuaDv")) != -1)
+    {
+      switch (arg)
+	{
+	case 'r':
+	  readit = 1;
+	  break;
+	case 'w':
+	  writeit = 1;
+	  break;
+	case 's':
+	  setit = 1;
+	  break;
+	case 'u':
+	  universal = 1;
+	  break;
+	case 'a':
+	  adjustit = 1;
+	  break;
+        case 'D':
+	  debug = 1;
+	  break;
+	case 'v':
+	  (void) fprintf( stderr, "clock " VERSION "\n" );
+	  exit(EXIT_SUCCESS);
+	default:
+	  usage ();
+	}
+    }
+
+    /* If we are in MkLinux do not even bother trying to set the clock */
+    if(!access("/proc/osfmach3/version", R_OK))
+    {           /* We're running MkLinux */
+     if ( readit | writeit | setit | adjustit )
+	printf("You must change the clock setting in MacOS.\n");
+     exit(0);
+    }
+
+  if (readit + writeit + setit + adjustit > 1)
+    usage ();			/* only allow one of these */
+
+  if (!(readit | writeit | setit | adjustit))	/* default to read */
+    readit = 1;
+
+  adb_init ();
+
+  if (adjustit)
+    {				/* Read adjustment parameters first */
+      FILE *adj;
+      if ((adj = fopen (ADJPATH, "r")) == NULL)
+	{
+	  perror (ADJPATH);
+	  exit(EXIT_FAILURE);
+	}
+      if (fscanf (adj, "%lf %d %lf", &factor, (int *) (&last_time), 
+		  &not_adjusted) < 0)
+	{
+	  perror (ADJPATH);
+	  exit(EXIT_FAILURE);
+	}
+      (void) fclose (adj);
+      if (debug) (void) printf(
+			"Last adjustment done at %d seconds after 1/1/1970\n",
+			(int) last_time);
+    }
+
+  if (readit || setit || adjustit)
+    {
+      int ii;
+
+      if (write(adb_fd, get_packet, sizeof(get_packet)) < 0) {
+	perror("write adb");
+	exit(EXIT_FAILURE);
+      }
+      ii = (int) read(adb_fd, reply, sizeof(reply));
+      if (ii < 0) {
+	perror("read adb");
+	exit(EXIT_FAILURE);
+      }
+      if (ii != 7)
+	(void) fprintf(stderr, 
+		       "Warning: bad reply length from CUDA (%d)\n", ii);
+      clock_time = (time_t) ((reply[3] << 24) + (reply[4] << 16)
+	                     + (reply[5] << 8)) + (time_t) reply[6];
+      clock_time -= RTC_OFFSET;
+
+      if (universal) {
+	systime = clock_time;
+      } else {
+	tm = *gmtime(&clock_time);
+	(void) printf("time in rtc is %s", asctime(&tm));
+	tm.tm_isdst = -1;		/* don't know whether it's DST */
+	systime = mktime(&tm);
+      }
+    }
+
+  if (readit)
+    {
+      (void) printf ("%s", ctime (&systime ));
+    }
+
+  if (setit || adjustit)
+    {
+      struct timeval tv;
+      struct timezone tz;
+
+/* program is designed to run setuid, be secure! */
+
+      if (getuid () != 0)
+	{			
+	  (void) fprintf (stderr, 
+			  "Sorry, must be root to set or adjust time\n");
+	  exit(EXIT_FAILURE);
+	}
+
+      if (adjustit)
+	{			/* the actual adjustment */
+	  double exact_adjustment;
+
+	  exact_adjustment = ((double) (systime - last_time))
+	    * factor / (24 * 60 * 60)
+	    + not_adjusted;
+	  if (exact_adjustment > 0.)
+	    adjustment = (int) (exact_adjustment + 0.5);
+	  else
+	    adjustment = (int) (exact_adjustment - 0.5);
+	  not_adjusted = exact_adjustment - (double) adjustment;
+	  systime += adjustment;
+	  if (debug) {
+	     (void) printf ("Time since last adjustment is %d seconds\n",
+		     (int) (systime - last_time));
+	     (void) printf ("Adjusting time by %d seconds\n",
+		     adjustment);
+	     (void) printf ("remaining adjustment is %.3f seconds\n",
+		     not_adjusted);
+	  }
+	}
+#ifndef KEEP_OFF
+      tv.tv_sec = systime;
+      tv.tv_usec = 0;
+      tz.tz_minuteswest = timezone / 60;
+      tz.tz_dsttime = daylight;
+
+      if (settimeofday (&tv, &tz) != 0)
+        {
+	  (void) fprintf (stderr,
+		   "Unable to set time -- probably you are not root\n");
+	  exit(EXIT_FAILURE);
+	}
+      
+      if (debug) {
+	 (void) printf( "Called settimeofday:\n" );
+	 (void) printf( "\ttv.tv_sec = %ld, tv.tv_usec = %ld\n",
+		 tv.tv_sec, tv.tv_usec );
+	 (void) printf( "\ttz.tz_minuteswest = %d, tz.tz_dsttime = %d\n",
+		 tz.tz_minuteswest, tz.tz_dsttime );
+      }
+#endif
+    }
+  
+  if (writeit || (adjustit && adjustment != 0))
+    {
+      systime = time (NULL);
+
+      if (universal) {
+	clock_time = systime;
+
+      } else {
+	tmp = localtime(&systime);
+	clock_time = mkgmtime(tmp);
+      }
+
+      clock_time += RTC_OFFSET;
+      set_packet[2] = clock_time >> 24;
+      set_packet[3] = clock_time >> 16;
+      set_packet[4] = clock_time >> 8;
+      set_packet[5] = (unsigned char) clock_time;
+
+      if (write(adb_fd, set_packet, sizeof(set_packet)) < 0) {
+	perror("write adb (set)");
+	exit(EXIT_FAILURE);
+      }
+      i = (int) read(adb_fd, reply, sizeof(reply));
+      if (debug) {
+	int j;
+	(void) printf("set reply %d bytes:", i);
+	for (j = 0; j < i; ++j) 
+	    (void) printf(" %.2x", (unsigned int) reply[j]);
+	(void) printf("\n");
+      }
+      if (i != 3 || reply[1] != (unsigned char) 0)
+	(void) fprintf(stderr, "Warning: error %d setting RTC\n", 
+		       (int) reply[1]);
+
+      if (debug) {
+	clock_time -= RTC_OFFSET;
+	(void) printf("set RTC to %s", asctime(gmtime(&clock_time)));
+      }
+    }
+  else
+    if (debug) (void) printf ("CMOS clock unchanged.\n");
+  /* Save data for next 'adjustit' call */
+  if (adjustit)
+    {
+      FILE *adj;
+      if ((adj = fopen (ADJPATH, "w")) == NULL)
+	{
+	  perror (ADJPATH);
+	  exit(EXIT_FAILURE);
+	}
+      (void) fprintf (adj, "%f %d %f\n", factor, (int) systime, not_adjusted);
+      (void) fclose (adj);
+    }
+  exit(EXIT_SUCCESS);
+}
+
+/* Stolen from linux/arch/i386/kernel/time.c. */
+/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
+ * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
+ * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
+ *
+ * [For the Julian calendar (which was used in Russia before 1917,
+ * Britain & colonies before 1752, anywhere else before 1582,
+ * and is still in use by some communities) leave out the
+ * -year/100+year/400 terms, and add 10.]
+ *
+ * This algorithm was first published by Gauss (I think).
+ *
+ * WARNING: this function will overflow on 2106-02-07 06:28:16 on
+ * machines were long is 32-bit! (However, as time_t is signed, we
+ * will already get problems at other places on 2038-01-19 03:14:08)
+ */
+time_t mkgmtime(struct tm *tm)
+{
+  int mon = tm->tm_mon + 1;
+  int year = tm->tm_year + 1900;
+
+  if (0 >= (int) (mon -= 2)) {	/* 1..12 -> 11,12,1..10 */
+    mon += 12;	/* Puts Feb last since it has leap day */
+    year -= 1;
+  }
+  return (((
+	    (unsigned long)(year/4 - year/100 + year/400 + 367*mon/12) +
+	      tm->tm_mday + year*365 - 719499
+	    )*24 + tm->tm_hour /* now have hours */
+	   )*60 + tm->tm_min /* now have minutes */
+	  )*60 + tm->tm_sec; /* finally seconds */
+}
diff --git a/util-linux-ng-2.17.2/hwclock/clock.h b/util-linux-ng-2.17.2/hwclock/clock.h
new file mode 100644
index 0000000..e4eb7eb
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/clock.h
@@ -0,0 +1,53 @@
+#ifndef HWCLOCK_CLOCK_H
+#define HWCLOCK_CLOCK_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>		/* for errno, EPERM, EINVAL, ENOENT */
+#include <time.h>
+
+#include "c.h"
+
+struct clock_ops {
+	char *interface_name;
+        int (*get_permissions)(void);
+        int (*read_hardware_clock)(struct tm *tm);
+        int (*set_hardware_clock)(const struct tm *tm);
+	int (*synchronize_to_clock_tick)(void);
+};
+
+extern struct clock_ops *probe_for_cmos_clock(void);
+extern struct clock_ops *probe_for_rtc_clock(void);
+extern struct clock_ops *probe_for_kd_clock(void);
+
+typedef int bool;
+
+/* hwclock.c */
+extern char *progname;
+extern int debug;
+extern int epoch_option;
+extern void outsyserr(char *msg, ...)
+#ifdef __GNUC__
+        __attribute__ ((format (printf, 1, 2)));
+#else
+        ;
+#endif
+extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
+/* cmos.c */
+extern void set_cmos_epoch(int ARCconsole, int SRM);
+extern void set_cmos_access(int Jensen, int funky_toy);
+
+/* rtc.c */
+extern int get_epoch_rtc(unsigned long *epoch, int silent);
+extern int set_epoch_rtc(unsigned long epoch);
+extern char *rtc_dev_name;
+
+#ifdef HAVE_LIBAUDIT
+extern void hwaudit_exit(int status);
+# define hwclock_exit(_status)	hwaudit_exit(_status)
+#else
+# define hwclock_exit(_status)	exit(_status)
+#endif
+
+#endif /* HWCLOCK_CLOCK_H */
diff --git a/util-linux-ng-2.17.2/hwclock/cmos.c b/util-linux-ng-2.17.2/hwclock/cmos.c
new file mode 100644
index 0000000..8b3495b
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/cmos.c
@@ -0,0 +1,614 @@
+/*
+ * i386 CMOS starts out with 14 bytes clock data
+ * alpha has something similar, but with details
+ * depending on the machine type.
+ *
+ * byte 0: seconds (0-59)
+ * byte 2: minutes (0-59)
+ * byte 4: hours (0-23 in 24hr mode,
+ *                1-12 in 12hr mode, with high bit unset/set if am/pm)
+ * byte 6: weekday (1-7, Sunday=1)
+ * byte 7: day of the month (1-31)
+ * byte 8: month (1-12)
+ * byte 9: year (0-99)
+ * Numbers are stored in BCD/binary if bit 2 of byte 11 is unset/set
+ * The clock is in 12hr/24hr mode if bit 1 of byte 11 is unset/set
+ * The clock is undefined (being updated) if bit 7 of byte 10 is set.
+ * The clock is frozen (to be updated) by setting bit 7 of byte 11
+ * Bit 7 of byte 14 indicates whether the CMOS clock is reliable:
+ * it is 1 if RTC power has been good since this bit was last read;
+ * it is 0 when the battery is dead and system power has been off.
+ *
+ * Avoid setting the RTC clock within 2 seconds of the day rollover
+ * that starts a new month or enters daylight saving time.
+ *
+ * The century situation is messy:
+ * Usually byte 50 (0x32) gives the century (in BCD, so 19 or 20 hex),
+ * but IBM PS/2 has (part of) a checksum there and uses byte 55 (0x37).
+ * Sometimes byte 127 (0x7f) or Bank 1, byte 0x48 gives the century.
+ * The original RTC will not access any century byte; some modern
+ * versions will. If a modern RTC or BIOS increments the century byte
+ * it may go from 0x19 to 0x20, but in some buggy cases 0x1a is produced.
+ */
+
+/*
+ * A struct tm has int fields
+ *   tm_sec (0-59, 60 or 61 only for leap seconds)
+ *   tm_min (0-59)
+ *   tm_hour (0-23)
+ *   tm_mday (1-31)
+ *   tm_mon (0-11)
+ *   tm_year (number of years since 1900)
+ *   tm_wday (0-6, 0=Sunday)
+ *   tm_yday (0-365)
+ *   tm_isdst (>0: yes, 0: no, <0: unknown)
+ */
+
+#include <unistd.h>		/* for geteuid() */
+#include <fcntl.h>		/* for O_RDWR */
+#include <errno.h>
+#include "nls.h"
+
+#if defined(__i386__)
+#ifdef HAVE_SYS_IO_H
+#include <sys/io.h>
+#else
+#include <asm/io.h>		/* for inb, outb */
+#endif
+#elif defined(__alpha__)
+/* <asm/io.h> fails to compile, probably because of u8 etc */
+extern unsigned int     inb(unsigned long port);
+extern void             outb(unsigned char b,unsigned long port);
+#else
+void outb(int a, int b){}
+int inb(int c){ return 0; }
+#endif
+
+#include "clock.h"
+
+#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
+#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
+
+/*
+ * The epoch.
+ *
+ * Unix uses 1900 as epoch for a struct tm, and 1970 for a time_t.
+ * But what was written to CMOS?
+ * Digital DECstations use 1928 - this is on a mips or alpha
+ * Digital Unix uses 1952, e.g. on AXPpxi33
+ * Windows NT uses 1980.
+ * The ARC console expects to boot Windows NT and uses 1980.
+ * (But a Ruffian uses 1900, just like SRM.)
+ * It is reported that ALPHA_PRE_V1_2_SRM_CONSOLE uses 1958.
+ */
+#define TM_EPOCH 1900
+int cmos_epoch = 1900;
+
+/* Martin Ostermann writes:
+The problem with the Jensen is twofold: First, it has the clock at a
+different address. Secondly, it has a distinction beween "local" and
+normal bus addresses. The local ones pertain to the hardware integrated
+into the chipset, like serial/parallel ports and of course, the RTC.
+Those need to be addressed differently. This is handled fine in the kernel,
+and it's not a problem, since this usually gets totally optimized by the
+compile. But the i/o routines of (g)libc lack this support so far.
+The result of this is, that the old clock program worked only on the
+Jensen when USE_DEV_PORT was defined, but not with the normal inb/outb
+functions.
+ */
+int use_dev_port = 0;		/* 1 for Jensen */
+int dev_port_fd;
+unsigned short clock_ctl_addr = 0x70;	/* 0x170 for Jensen */
+unsigned short clock_data_addr = 0x71; 	/* 0x171 for Jensen */
+
+
+int century_byte = 0;		/* 0: don't access a century byte
+				  50 (0x32): usual PC value
+				  55 (0x37): PS/2 */
+
+#ifdef __alpha__
+int funkyTOY = 0;		/* 1 for PC164/LX164/SX164 type alpha */
+#endif
+
+#ifdef __alpha
+
+static int
+is_in_cpuinfo(char *fmt, char *str)
+{
+    FILE *cpuinfo;
+    char field[256];
+    char format[256];
+    int found = 0;
+
+    sprintf(format, "%s : %s", fmt, "%255s");
+
+    if ((cpuinfo = fopen ("/proc/cpuinfo", "r")) != NULL) {
+	while (!feof(cpuinfo)) {
+	    if (fscanf (cpuinfo, format, field) == 1) {
+		if (strncmp(field, str, strlen(str)) == 0)
+		    found = 1;
+		break;
+	    }
+	    fgets (field, 256, cpuinfo);
+	}
+	fclose(cpuinfo);
+    }
+    return found;
+}
+
+/* Set cmos_epoch, either from user options, or by asking the kernel,
+   or by looking at /proc/cpu_info */
+void
+set_cmos_epoch(int ARCconsole, int SRM) {
+  unsigned long epoch;
+
+  /* Believe the user */
+  if (epoch_option != -1) {
+    cmos_epoch = epoch_option;
+    return;
+  }
+
+  if (ARCconsole)
+    cmos_epoch = 1980;
+
+  if (ARCconsole || SRM)
+    return;
+
+
+  /* If we can ask the kernel, we don't need guessing from /proc/cpuinfo */
+  if (get_epoch_rtc(&epoch, 1) == 0) {
+     cmos_epoch = epoch;
+     return;
+  }
+
+  /* The kernel source today says: read the year.
+     If it is in 0-19 then the epoch is 2000.
+     If it is in 20-47 then the epoch is 1980.
+     If it is in 48-69 then the epoch is 1952.
+     If it is in 70-99 then the epoch is 1928.
+     Otherwise the epoch is 1900.
+     Clearly, this must be changed before 2019. */
+
+  /* See whether we are dealing with SRM or MILO, as they have
+     different "epoch" ideas. */
+  if (is_in_cpuinfo("system serial number", "MILO")) {
+      ARCconsole = 1;
+      if (debug) printf (_("booted from MILO\n"));
+  }
+
+  /* See whether we are dealing with a RUFFIAN aka Alpha PC-164 UX (or BX),
+     as they have REALLY different TOY (TimeOfYear) format: BCD, and not
+     an ARC-style epoch.
+     BCD is detected dynamically, but we must NOT adjust like ARC. */
+  if (ARCconsole && is_in_cpuinfo("system type", "Ruffian")) {
+    ARCconsole = 0;
+    if (debug) printf (_("Ruffian BCD clock\n"));
+  }
+
+  if (ARCconsole)
+    cmos_epoch = 1980;
+}
+
+void
+set_cmos_access(int Jensen, int funky_toy) {
+
+  /* See whether we're dealing with a Jensen---it has a weird I/O
+     system.  DEC was just learning how to build Alpha PCs.  */
+  if (Jensen || is_in_cpuinfo("system type", "Jensen")) {
+    use_dev_port = 1;
+    clock_ctl_addr = 0x170;
+    clock_data_addr = 0x171;
+    if (debug) printf (_("clockport adjusted to 0x%x\n"), clock_ctl_addr);
+  }
+
+  /* see whether we are dealing with PC164/LX164/SX164, as they have a TOY
+     that must be accessed differently to work correctly. */
+  /* Nautilus stuff reported by Neoklis Kyriazis */
+  if (funky_toy ||
+      is_in_cpuinfo("system variation", "PC164") ||
+      is_in_cpuinfo("system variation", "LX164") ||
+      is_in_cpuinfo("system variation", "SX164") ||
+      is_in_cpuinfo("system type", "Nautilus")) {
+      funkyTOY = 1;
+      if (debug) printf (_("funky TOY!\n"));
+  }
+}
+#endif
+
+
+#if __alpha__
+/*
+ * The Alpha doesn't allow user-level code to disable interrupts (for
+ * good reasons).  Instead, we ensure atomic operation by performing
+ * the operation and checking whether the high 32 bits of the cycle
+ * counter changed.  If they did, a context switch must have occurred
+ * and we redo the operation.  As long as the operation is reasonably
+ * short, it will complete atomically, eventually.
+ */
+
+static unsigned long
+atomic(const char *name, unsigned long (*op)(unsigned long),
+       unsigned long arg)
+{
+  unsigned long ts1, ts2, n, v;
+
+  for (n = 0; n < 1000; ++n) {
+    asm volatile ("rpcc %0" : "r="(ts1));
+    v = (*op)(arg);
+    asm volatile ("rpcc %0" : "r="(ts2));
+
+    if ((ts1 ^ ts2) >> 32 == 0) {
+      return v;
+    }
+  }
+  fprintf(stderr, _("%s: atomic %s failed for 1000 iterations!"), progname, name);
+  exit(1);
+}
+#else
+
+/*
+ * Hmmh, this isn't very atomic.  Maybe we should force an error
+ * instead?
+ *
+ * TODO: optimize the access to CMOS by mlockall(MCL_CURRENT)
+ *       and SCHED_FIFO
+ */
+static unsigned long
+atomic(const char *name, unsigned long (*op)(unsigned long),
+       unsigned long arg)
+{
+    return (*op)(arg);
+}
+
+#endif
+
+
+static inline
+unsigned long cmos_read(unsigned long reg)
+{
+  if (use_dev_port) {
+    unsigned char v = reg | 0x80;
+    lseek(dev_port_fd, clock_ctl_addr, 0);
+    if (write(dev_port_fd, &v, 1) == -1 && debug)
+      printf(_("cmos_read(): write to control address %X failed: %s\n"), clock_ctl_addr, strerror(errno));
+    lseek(dev_port_fd, clock_data_addr, 0);
+    if (read(dev_port_fd, &v, 1) == -1 && debug)
+      printf(_("cmos_read(): read data address %X failed: %s\n"), clock_data_addr, strerror(errno));
+    return v;
+  } else {
+    /* We only want to read CMOS data, but unfortunately
+       writing to bit 7 disables (1) or enables (0) NMI;
+       since this bit is read-only we have to guess the old status.
+       Various docs suggest that one should disable NMI while
+       reading/writing CMOS data, and enable it again afterwards.
+       This would yield the sequence
+	  outb (reg | 0x80, 0x70);
+	  val = inb(0x71);
+	  outb (0x0d, 0x70);	// 0x0d: random read-only location
+       Other docs state that "any write to 0x70 should be followed
+       by an action to 0x71 or the RTC wil be left in an unknown state".
+       Most docs say that it doesnt matter at all what one does.
+     */
+    /* bit 0x80: disable NMI while reading - should we?
+       Let us follow the kernel and not disable.
+       Called only with 0 <= reg < 128 */
+    outb (reg, clock_ctl_addr);
+    return inb (clock_data_addr);
+  }
+}
+
+static inline
+unsigned long cmos_write(unsigned long reg, unsigned long val)
+{
+  if (use_dev_port) {
+    unsigned char v = reg | 0x80;
+    lseek(dev_port_fd, clock_ctl_addr, 0);
+    if (write(dev_port_fd, &v, 1) == -1 && debug)
+      printf(_("cmos_write(): write to control address %X failed: %s\n"), clock_ctl_addr, strerror(errno));
+    v = (val & 0xff);
+    lseek(dev_port_fd, clock_data_addr, 0);
+    if (write(dev_port_fd, &v, 1) == -1 && debug)
+      printf(_("cmos_write(): write to data address %X failed: %s\n"), clock_data_addr, strerror(errno));
+  } else {
+    outb (reg, clock_ctl_addr);
+    outb (val, clock_data_addr);
+  }
+  return 0;
+}
+
+static unsigned long cmos_set_time(unsigned long arg)
+{
+  unsigned char save_control, save_freq_select, pmbit = 0;
+  struct tm tm = *(struct tm *) arg;
+  unsigned int century;
+
+/*
+ * CMOS byte 10 (clock status register A) has 3 bitfields:
+ * bit 7: 1 if data invalid, update in progress (read-only bit)
+ *         (this is raised 224 us before the actual update starts)
+ *  6-4    select base frequency
+ *         010: 32768 Hz time base (default)
+ *         111: reset
+ *         all other combinations are manufacturer-dependent
+ *         (e.g.: DS1287: 010 = start oscillator, anything else = stop)
+ *  3-0    rate selection bits for interrupt
+ *         0000 none (may stop RTC)
+ *         0001, 0010 give same frequency as 1000, 1001
+ *         0011 122 microseconds (minimum, 8192 Hz)
+ *         .... each increase by 1 halves the frequency, doubles the period
+ *         1111 500 milliseconds (maximum, 2 Hz)
+ *         0110 976.562 microseconds (default 1024 Hz)
+ */
+
+  save_control = cmos_read (11);   /* tell the clock it's being set */
+  cmos_write (11, (save_control | 0x80));
+  save_freq_select = cmos_read (10);       /* stop and reset prescaler */
+  cmos_write (10, (save_freq_select | 0x70));
+
+  tm.tm_year += TM_EPOCH;
+  century = tm.tm_year/100;
+  tm.tm_year -= cmos_epoch;
+  tm.tm_year %= 100;
+  tm.tm_mon += 1;
+  tm.tm_wday += 1;
+
+  if (!(save_control & 0x02)) {	/* 12hr mode; the default is 24hr mode */
+      if (tm.tm_hour == 0)
+          tm.tm_hour = 24;
+      if (tm.tm_hour > 12) {
+	  tm.tm_hour -= 12;
+	  pmbit = 0x80;
+      }
+  }
+
+  if (!(save_control & 0x04)) { /* BCD mode - the default */
+      BIN_TO_BCD(tm.tm_sec);
+      BIN_TO_BCD(tm.tm_min);
+      BIN_TO_BCD(tm.tm_hour);
+      BIN_TO_BCD(tm.tm_wday);
+      BIN_TO_BCD(tm.tm_mday);
+      BIN_TO_BCD(tm.tm_mon);
+      BIN_TO_BCD(tm.tm_year);
+      BIN_TO_BCD(century);
+  }
+
+  cmos_write (0, tm.tm_sec);
+  cmos_write (2, tm.tm_min);
+  cmos_write (4, tm.tm_hour | pmbit);
+  cmos_write (6, tm.tm_wday);
+  cmos_write (7, tm.tm_mday);
+  cmos_write (8, tm.tm_mon);
+  cmos_write (9, tm.tm_year);
+  if (century_byte)
+	  cmos_write (century_byte, century);
+
+
+    /* The kernel sources, linux/arch/i386/kernel/time.c, have the
+       following comment:
+
+       The following flags have to be released exactly in this order,
+       otherwise the DS12887 (popular MC146818A clone with integrated
+       battery and quartz) will not reset the oscillator and will not
+       update precisely 500 ms later.  You won't find this mentioned
+       in the Dallas Semiconductor data sheets, but who believes data
+       sheets anyway ...  -- Markus Kuhn
+    */
+
+  cmos_write (11, save_control);
+  cmos_write (10, save_freq_select);
+  return 0;
+}
+
+static int
+hclock_read(unsigned long reg) {
+	return atomic("clock read", cmos_read, (reg));
+}
+
+static void
+hclock_set_time(const struct tm *tm) {
+	atomic("set time", cmos_set_time, (unsigned long)(tm));
+}
+
+static inline int
+cmos_clock_busy(void) {
+	return
+#ifdef __alpha__
+	                /* poll bit 4 (UF) of Control Register C */
+	    funkyTOY ? (hclock_read(12) & 0x10) :
+#endif
+		        /* poll bit 7 (UIP) of Control Register A */
+	    (hclock_read(10) & 0x80);
+}
+
+
+static int
+synchronize_to_clock_tick_cmos(void) {
+  int i;
+
+  /* Wait for rise.  Should be within a second, but in case something
+     weird happens, we have a limit on this loop to reduce the impact
+     of this failure.
+     */
+  for (i = 0; !cmos_clock_busy(); i++)
+	  if (i >= 10000000)
+		  return 1;
+
+  /* Wait for fall.  Should be within 2.228 ms. */
+  for (i = 0; cmos_clock_busy(); i++)
+	  if (i >= 1000000)
+		  return 1;
+  return 0;
+}
+
+
+
+static int
+read_hardware_clock_cmos(struct tm *tm) {
+/*----------------------------------------------------------------------------
+  Read the hardware clock and return the current time via <tm> argument.
+  Assume we have an ISA machine and read the clock directly with CPU I/O
+  instructions.
+
+  This function is not totally reliable.  It takes a finite and
+  unpredictable amount of time to execute the code below.  During that
+  time, the clock may change and we may even read an invalid value in
+  the middle of an update.  We do a few checks to minimize this
+  possibility, but only the kernel can actually read the clock
+  properly, since it can execute code in a short and predictable
+  amount of time (by turning of interrupts).
+
+  In practice, the chance of this function returning the wrong time is
+  extremely remote.
+
+-----------------------------------------------------------------------------*/
+  bool got_time = FALSE;
+  unsigned char status, pmbit;
+
+  status = pmbit = 0;		/* just for gcc */
+
+  while (!got_time) {
+    /* Bit 7 of Byte 10 of the Hardware Clock value is the Update In Progress
+       (UIP) bit, which is on while and 244 uS before the Hardware Clock
+       updates itself.  It updates the counters individually, so reading
+       them during an update would produce garbage.  The update takes 2mS,
+       so we could be spinning here that long waiting for this bit to turn
+       off.
+
+       Furthermore, it is pathologically possible for us to be in this
+       code so long that even if the UIP bit is not on at first, the
+       clock has changed while we were running.  We check for that too,
+       and if it happens, we start over.
+       */
+
+    if (!cmos_clock_busy()) {
+      /* No clock update in progress, go ahead and read */
+      tm->tm_sec = hclock_read(0);
+      tm->tm_min = hclock_read(2);
+      tm->tm_hour = hclock_read(4);
+      tm->tm_wday = hclock_read(6);
+      tm->tm_mday = hclock_read(7);
+      tm->tm_mon = hclock_read(8);
+      tm->tm_year = hclock_read(9);
+      status = hclock_read(11);
+#if 0
+      if (century_byte)
+	  century = hclock_read(century_byte);
+#endif
+
+      /* Unless the clock changed while we were reading, consider this
+         a good clock read .
+       */
+      if (tm->tm_sec == hclock_read (0))
+	got_time = TRUE;
+    }
+    /* Yes, in theory we could have been running for 60 seconds and
+       the above test wouldn't work!
+       */
+  }
+
+  if (!(status & 0x04)) { /* BCD mode - the default */
+      BCD_TO_BIN(tm->tm_sec);
+      BCD_TO_BIN(tm->tm_min);
+      pmbit = (tm->tm_hour & 0x80);
+      tm->tm_hour &= 0x7f;
+      BCD_TO_BIN(tm->tm_hour);
+      BCD_TO_BIN(tm->tm_wday);
+      BCD_TO_BIN(tm->tm_mday);
+      BCD_TO_BIN(tm->tm_mon);
+      BCD_TO_BIN(tm->tm_year);
+#if 0
+      BCD_TO_BIN(century);
+#endif
+  }
+
+  /* We don't use the century byte of the Hardware Clock
+     since we don't know its address (usually 50 or 55).
+     Here, we follow the advice of the X/Open Base Working Group:
+     "if century is not specified, then values in the range [69-99]
+      refer to years in the twentieth century (1969 to 1999 inclusive),
+      and values in the range [00-68] refer to years in the twenty-first
+      century (2000 to 2068 inclusive)."
+   */
+
+  tm->tm_wday -= 1;
+  tm->tm_mon -= 1;
+  tm->tm_year += (cmos_epoch - TM_EPOCH);
+  if (tm->tm_year < 69)
+	  tm->tm_year += 100;
+  if (pmbit) {
+	  tm->tm_hour += 12;
+	  if (tm->tm_hour == 24)
+		  tm->tm_hour = 0;
+  }
+
+  tm->tm_isdst = -1;        /* don't know whether it's daylight */
+  return 0;
+}
+
+
+
+static int
+set_hardware_clock_cmos(const struct tm *new_broken_time) {
+
+    hclock_set_time(new_broken_time);
+    return 0;
+}
+
+static int
+i386_iopl(const int level) {
+#if defined(__i386__) || defined(__alpha__)
+  extern int iopl(const int lvl);
+  return iopl(level);
+#else
+  return -2;
+#endif
+}
+
+static int
+get_permissions_cmos(void) {
+  int rc;
+
+  if (use_dev_port) {
+    if ((dev_port_fd = open("/dev/port", O_RDWR)) < 0) {
+      int errsv = errno;
+      fprintf(stderr, _("Cannot open /dev/port: %s"), strerror(errsv));
+      rc = 1;
+    } else
+      rc = 0;
+  } else {
+    rc = i386_iopl(3);
+    if (rc == -2) {
+      fprintf(stderr, _("I failed to get permission because I didn't try.\n"));
+    } else if (rc != 0) {
+      rc = errno;
+      fprintf(stderr, _("%s is unable to get I/O port access:  "
+              "the iopl(3) call failed.\n"), progname);
+      if(rc == EPERM && geteuid())
+        fprintf(stderr, _("Probably you need root privileges.\n"));
+    }
+  }
+  return rc ? 1 : 0;
+}
+
+static struct clock_ops cmos = {
+	"direct I/O instructions to ISA clock",
+	get_permissions_cmos,
+	read_hardware_clock_cmos,
+	set_hardware_clock_cmos,
+	synchronize_to_clock_tick_cmos,
+};
+
+
+/* return &cmos if cmos clock present, NULL otherwise */
+/* choose this construction to avoid gcc messages about unused variables */
+
+struct clock_ops *
+probe_for_cmos_clock(void){
+    int have_cmos =
+#if defined(__i386__) || defined(__alpha__)
+	    TRUE;
+#else
+	    FALSE;
+#endif
+    return have_cmos ? &cmos : NULL;
+}
diff --git a/util-linux-ng-2.17.2/hwclock/hwclock.8 b/util-linux-ng-2.17.2/hwclock/hwclock.8
new file mode 100644
index 0000000..55663fe
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/hwclock.8
@@ -0,0 +1,628 @@
+.TH HWCLOCK 8 "06 August 2008"
+.SH NAME
+hwclock \- query and set the hardware clock (RTC)
+.SH SYNOPSIS
+.B hwclock
+.RI [ functions ]
+.RI [ options ]
+
+.SH DESCRIPTION
+.B hwclock
+is a tool for accessing the Hardware Clock.  You can display the
+current time, set the Hardware Clock to a specified time, set the
+Hardware Clock to the System Time, and set the System Time from the
+Hardware Clock.
+.PP
+You can also run
+.B hwclock
+periodically to insert or remove time from the Hardware Clock to
+compensate for systematic drift (where the clock consistently gains or
+loses time at a certain rate if left to run).
+
+.SH FUNCTIONS
+You need exactly one of the following options to tell
+.B hwclock
+what function to perform:
+.PP
+.TP
+.BR \-r , \ \-\-show
+Read the Hardware Clock and print the time on Standard Output.
+The time shown is always in local time, even if you keep your Hardware Clock
+in Coordinated Universal Time.  See the
+.B \-\-utc
+option.
+
+.TP
+.B \-\-set
+Set the Hardware Clock to the time given by the
+.B \-\-date
+option.
+.TP
+.BR \-s , \ \-\-hctosys
+Set the System Time from the Hardware Clock.
+
+Also set the kernel's timezone value to the local timezone
+as indicated by the TZ environment variable and/or
+.IR /usr/share/zoneinfo ,
+as
+.BR tzset (3)
+would interpret them.
+The obsolete tz_dsttime field of the kernel's timezone value is set
+to DST_NONE. (For details on what this field used to mean, see
+.BR settimeofday (2).)
+
+This is a good option to use in one of the system startup scripts.
+.TP
+.BR \-w , \ \-\-systohc
+Set the Hardware Clock to the current System Time.
+.TP
+.B \-\-systz
+Reset the System Time based on the current timezone.
+
+Also set the kernel's timezone value to the local timezone
+as indicated by the TZ environment variable and/or
+.IR /usr/share/zoneinfo ,
+as
+.BR tzset (3)
+would interpret them.
+The obsolete tz_dsttime field of the kernel's timezone value is set
+to DST_NONE. (For details on what this field used to mean, see
+.BR settimeofday (2).)
+
+This is an alternate option to
+.B \-\-hctosys
+that does not read the hardware clock, and may be used in system startup
+scripts for recent 2.6 kernels where you know the System Time contains
+the Hardware Clock time.
+.TP
+.B \-\-adjust
+Add or subtract time from the Hardware Clock to account for systematic
+drift since the last time the clock was set or adjusted.  See discussion
+below.
+.TP
+.B \-\-getepoch
+Print the kernel's Hardware Clock epoch value to standard output.
+This is the number of years into AD to which a zero year value in the
+Hardware Clock refers.  For example, if you are using the convention
+that the year counter in your Hardware Clock contains the number of
+full years since 1952, then the kernel's Hardware Counter epoch value
+must be 1952.
+
+This epoch value is used whenever hwclock reads or sets the Hardware Clock.
+.TP
+.B \-\-setepoch
+Set the kernel's Hardware Clock epoch value to the value specified by the
+.B \-\-epoch
+option.  See the
+.B \-\-getepoch
+option for details.
+.TP
+.BR \-v , \ \-\-version
+Print the version of
+.B hwclock
+on Standard Output.
+.TP
+.BI \-\-date= date_string
+You need this option if you specify the
+.B \-\-set
+option.  Otherwise, it is ignored.
+This specifies the time to which to set the Hardware Clock.
+The value of this option is an argument to the
+.BR date (1)
+program.
+For example,
+.sp
+.I hwclock --set --date="9/22/96 16:45:05"
+.sp
+The argument is in local time, even if you keep your Hardware Clock in
+Coordinated Universal time.  See the
+.B \-\-utc
+option.
+
+.TP
+.BI \-\-epoch= year
+Specifies the year which is the beginning of the Hardware Clock's
+epoch.  I.e. the number of years into AD to which a zero value in the
+Hardware Clock's year counter refers. It is used together with
+the \-\-setepoch option to set the kernel's idea of the epoch of the
+Hardware Clock, or otherwise to specify the epoch for use with
+direct ISA access.
+
+For example, on a Digital Unix machine:
+.sp
+.I hwclock --setepoch --epoch=1952
+
+
+.SH OPTIONS
+.PP
+The following options apply to most functions.
+.TP
+.BR \-u , \ \-\-utc
+.TP
+.B \-\-localtime
+Indicates that the Hardware Clock is kept in Coordinated Universal
+Time or local time, respectively.  It is your choice whether to keep
+your clock in UTC or local time, but nothing in the clock tells which
+you've chosen.  So this option is how you give that information to
+.BR hwclock .
+
+If you specify the wrong one of these options (or specify neither and
+take a wrong default), both setting and querying of the Hardware Clock
+will be messed up.
+
+If you specify neither
+.B \-\-utc
+nor
+.B \-\-localtime
+, the default is whichever was specified the last time
+.B hwclock
+was used to set the clock (i.e. hwclock was successfully run with the
+.BR \-\-set ,
+.BR \-\-systohc ,
+or
+.B \-\-adjust
+options), as recorded in the adjtime file.  If the adjtime file doesn't
+exist, the default is local time.
+
+.TP
+.B \-\-noadjfile
+disables the facilities provided by
+.IR /etc/adjtime .
+.B hwclock
+will not read nor write to that file with this option. Either
+.B \-\-utc
+or
+.B \-\-localtime
+must be specified when using this option.
+
+.TP
+.BI \-\-adjfile= filename
+overrides the default /etc/adjtime.
+
+.TP
+.BR \-f , \ \-\-rtc=\fIfilename\fB
+overrides the default /dev file name, which is
+.IR /dev/rtc
+on many platforms but may be
+.IR /dev/rtc0 ,
+.IR /dev/rtc1 ,
+and so on.
+
+.TP
+.B \-\-directisa
+is meaningful only on an ISA machine or an Alpha (which implements enough
+of ISA to be, roughly speaking, an ISA machine for
+.BR hwclock 's
+purposes).  For other machines, it has no effect.  This option tells
+.B hwclock
+to use explicit I/O instructions to access the Hardware Clock.
+Without this option,
+.B hwclock
+will try to use the /dev/rtc device (which it assumes to be driven by the
+rtc device driver).  If it is unable to open the device (for read), it will
+use the explicit I/O instructions anyway.
+
+The rtc device driver was new in Linux Release 2.
+.TP
+.B \-\-badyear
+Indicates that the Hardware Clock is incapable of storing years outside
+the range 1994-1999.  There is a problem in some BIOSes (almost all
+Award BIOSes made between 4/26/94 and 5/31/95) wherein they are unable
+to deal with years after 1999.  If one attempts to set the year-of-century
+value to something less than 94 (or 95 in some cases), the value that
+actually gets set is 94 (or 95).  Thus, if you have one of these machines,
+.B hwclock
+cannot set the year after 1999 and cannot use the value of the clock as
+the true time in the normal way.
+
+To compensate for this (without your getting a BIOS update, which would
+definitely be preferable), always use
+.B \-\-badyear
+if you have one of these machines.  When
+.B hwclock
+knows it's working with a brain-damaged clock, it ignores the year part of
+the Hardware Clock value and instead tries to guess the year based on the
+last calibrated date in the adjtime file, by assuming that that date is
+within the past year.  For this to work, you had better do a
+.I hwclock \-\-set
+or
+.I hwclock \-\-systohc
+at least once a year!
+
+Though
+.B hwclock
+ignores the year value when it reads the Hardware Clock, it sets the
+year value when it sets the clock.  It sets it to 1995, 1996, 1997, or
+1998, whichever one has the same position in the leap year cycle as
+the true year.  That way, the Hardware Clock inserts leap days where
+they belong.  Again, if you let the Hardware Clock run for more than a
+year without setting it, this scheme could be defeated and you could
+end up losing a day.
+
+.B hwclock
+warns you that you probably need
+.B \-\-badyear
+whenever it finds your Hardware Clock set to 1994 or 1995.
+
+.TP
+.B \-\-srm
+This option is equivalent to
+.B \-\-epoch=1900
+and is used to specify the most common epoch on Alphas
+with SRM console.
+.TP
+.B \-\-arc
+This option is equivalent to
+.B \-\-epoch=1980
+and is used to specify the most common epoch on Alphas
+with ARC console (but Ruffians have epoch 1900).
+.TP
+.B \-\-jensen
+.TP
+.B \-\-funky\-toy
+These two options specify what kind of Alpha machine you have.  They
+are invalid if you don't have an Alpha and are usually unnecessary
+if you do, because
+.B hwclock
+should be able to determine by itself what it's
+running on, at least when
+.I /proc
+is mounted.
+(If you find you need one of these options to make
+.B hwclock
+work, contact the maintainer to see if the program can be improved
+to detect your system automatically. Output of `hwclock --debug'
+and `cat /proc/cpuinfo' may be of interest.)
+
+.B \-\-jensen
+means you are running on a Jensen model.
+
+.B \-\-funky\-toy
+means that on your machine, one has to use the UF bit instead
+of the UIP bit in the Hardware Clock to detect a time transition.  "Toy"
+in the option name refers to the Time Of Year facility of the machine.
+
+
+.TP
+.B \-\-test
+Do everything except actually updating the Hardware Clock or anything
+else.  This is useful, especially in conjunction with
+.BR \-\-debug ,
+in learning about
+.BR hwclock .
+.TP
+.B \-\-debug
+Display a lot of information about what
+.B hwclock
+is doing internally.  Some of its function is complex and this output
+can help you understand how the program works.
+
+
+.SH NOTES
+
+
+.SH Clocks in a Linux System
+.PP
+There are two main clocks in a Linux system:
+.PP
+.B The Hardware Clock:
+This is a clock that runs independently of any control program running
+in the CPU and even when the machine is powered off.
+
+On an ISA system, this clock is specified as part of the ISA standard.
+The control program can read or set this clock to a whole second, but
+the control program can also detect the edges of the 1 second clock
+ticks, so the clock actually has virtually infinite precision.
+.PP
+This clock is commonly called the hardware clock, the real time clock,
+the RTC, the BIOS clock, and the CMOS clock.  Hardware Clock, in its
+capitalized form, was coined for use by
+.B hwclock
+because all of the other names are inappropriate to the point of being
+misleading.
+.PP
+So for example, some non-ISA systems have a few real time clocks with
+only one of them having its own power domain.
+A very low power external I2C or SPI clock chip might be used with a
+backup battery as the hardware clock to initialize a more functional
+integrated real-time clock which is used for most other purposes.
+.PP
+.B The System Time:
+This is the time kept by a clock inside the Linux kernel and driven by
+a timer interrupt.  (On an ISA machine, the timer interrupt is part of
+the ISA standard).  It has meaning only while Linux is running on the
+machine.  The System Time is the number of seconds since 00:00:00
+January 1, 1970 UTC (or more succinctly, the number of seconds since
+1969).  The System Time is not an integer, though.  It has virtually
+infinite precision.
+.PP
+The System Time is the time that matters.  The Hardware Clock's basic
+purpose in a Linux system is to keep time when Linux is not running.  You
+initialize the System Time to the time from the Hardware Clock when Linux
+starts up, and then never use the Hardware Clock again.  Note that in DOS,
+for which ISA was designed, the Hardware Clock is the only real time clock.
+.PP
+It is important that the System Time not have any discontinuities such as
+would happen if you used the
+.BR date (1L)
+program to set it while the system is running.  You can, however, do whatever
+you want to the Hardware Clock while the system is running, and the next
+time Linux starts up, it will do so with the adjusted time from the Hardware
+Clock.  You can also use the program
+.BR adjtimex (8)
+to smoothly adjust the System Time while the system runs.
+.PP
+A Linux kernel maintains a concept of a local timezone for the system.
+But don't be misled -- almost nobody cares what timezone the kernel
+thinks it is in.  Instead, programs that care about the timezone
+(perhaps because they want to display a local time for you) almost
+always use a more traditional method of determining the timezone: They
+use the TZ environment variable and/or the
+.I /usr/share/zoneinfo
+directory, as explained in the man page for
+.BR tzset (3).
+However, some
+programs and fringe parts of the Linux kernel such as filesystems use
+the kernel timezone value.  An example is the vfat filesystem.  If the
+kernel timezone value is wrong, the vfat filesystem will report and
+set the wrong timestamps on files.
+.PP
+.B hwclock
+sets the kernel timezone to the value indicated by TZ and/or
+.I /usr/share/zoneinfo
+when you set the System Time using the
+.B \-\-hctosys
+option.
+.PP
+The timezone value actually consists of two parts: 1) a field
+tz_minuteswest indicating how many minutes local time (not adjusted
+for DST) lags behind UTC, and 2) a field tz_dsttime indicating
+the type of Daylight Savings Time (DST) convention that is in effect
+in the locality at the present time.
+This second field is not used under Linux and is always zero.
+(See also
+.BR settimeofday (2).)
+
+.SH How hwclock Accesses the Hardware Clock
+.PP
+.B hwclock
+uses many different ways to get and set Hardware Clock values.
+The most normal way is to do I/O to the device special file /dev/rtc,
+which is presumed to be driven by the rtc device driver.  However,
+this method is not always available.  For one thing, the rtc driver is
+a relatively recent addition to Linux.  Older systems don't have it.
+Also, though there are versions of the rtc driver that work on DEC
+Alphas, there appear to be plenty of Alphas on which the rtc driver
+does not work (a common symptom is hwclock hanging).
+Moreover, recent Linux systems have more generic support for RTCs,
+even systems that have more than one, so you might need to override
+the default by specifying
+.I /dev/rtc0
+or
+.I /dev/rtc1
+instead.
+.PP
+On older systems, the method of accessing the Hardware Clock depends on
+the system hardware.
+.PP
+On an ISA system,
+.B hwclock
+can directly access the "CMOS memory" registers that
+constitute the clock, by doing I/O to Ports 0x70 and 0x71.  It does
+this with actual I/O instructions and consequently can only do it if
+running with superuser effective userid.  (In the case of a Jensen
+Alpha, there is no way for
+.B hwclock
+to execute those I/O instructions, and so it uses instead the
+/dev/port device special file, which provides almost as low-level an
+interface to the I/O subsystem).
+
+This is a really poor method of accessing the clock, for all the
+reasons that user space programs are generally not supposed to do
+direct I/O and disable interrupts.  Hwclock provides it because it is
+the only method available on ISA and Alpha systems which don't have
+working rtc device drivers available.
+
+.PP
+On an m68k system,
+.B hwclock
+can access the clock via the console driver, via the device special
+file /dev/tty1.
+.PP
+.B hwclock
+tries to use /dev/rtc.  If it is compiled for a kernel that doesn't have
+that function or it is unable to open /dev/rtc
+(or the alternative special file you've defined on the command line)
+.B hwclock
+will fall back to another method, if available.  On an ISA or Alpha
+machine, you can force
+.B hwclock
+to use the direct manipulation of the CMOS registers without even trying
+.I /dev/rtc
+by specifying the
+.B \-\-directisa
+option.
+
+
+.SH The Adjust Function
+.PP
+The Hardware Clock is usually not very accurate.  However, much of its
+inaccuracy is completely predictable - it gains or loses the same amount
+of time every day.  This is called systematic drift.
+.BR hwclock 's
+"adjust" function lets you make systematic corrections to correct the
+systematic drift.
+.PP
+It works like this:
+.B hwclock
+keeps a file,
+.IR /etc/adjtime ,
+that keeps some historical information.  This is called the adjtime file.
+.PP
+Suppose you start with no adjtime file.  You issue a
+.I hwclock \-\-set
+command to set the Hardware Clock to the true current time.
+.B Hwclock
+creates the adjtime file and records in it the current time as the
+last time the clock was calibrated.
+5 days later, the clock has gained 10 seconds, so you issue another
+.I hwclock \-\-set
+command to set it back 10 seconds.
+.B Hwclock
+updates the adjtime file to show the current time as the last time the
+clock was calibrated, and records 2 seconds per day as the systematic
+drift rate.  24 hours go by, and then you issue a
+.I hwclock \-\-adjust
+command.
+.B Hwclock
+consults the adjtime file and sees that the clock gains 2 seconds per
+day when left alone and that it has been left alone for exactly one
+day.  So it subtracts 2 seconds from the Hardware Clock.  It then
+records the current time as the last time the clock was adjusted.
+Another 24 hours goes by and you issue another
+.IR "hwclock \-\-adjust" .
+.B Hwclock
+does the same thing: subtracts 2 seconds and updates the adjtime file
+with the current time as the last time the clock was adjusted.
+.PP
+Every time you calibrate (set) the clock (using
+.I \-\-set
+or
+.IR \-\-systohc ),
+.B hwclock
+recalculates the systematic drift rate based on how long it has been
+since the last calibration, how long it has been since the last
+adjustment, what drift rate was assumed in any intervening
+adjustments, and the amount by which the clock is presently off.
+.PP
+A small amount of error creeps in any time
+.B hwclock
+sets the clock, so it refrains from making an adjustment that would be
+less than 1 second.  Later on, when you request an adjustment again,
+the accumulated drift will be more than a second and
+.B hwclock
+will do the adjustment then.
+.PP
+It is good to do a
+.I hwclock \-\-adjust
+just before the
+.I hwclock \-\-hctosys
+at system startup time, and maybe periodically while the system is
+running via cron.
+.PP
+The adjtime file, while named for its historical purpose of controlling
+adjustments only, actually contains other information for use by hwclock
+in remembering information from one invocation to the next.
+.PP
+The format of the adjtime file is, in ASCII:
+.PP
+Line 1: 3 numbers, separated by blanks: 1) systematic drift rate in
+seconds per day, floating point decimal; 2) Resulting number of
+seconds since 1969 UTC of most recent adjustment or calibration,
+decimal integer; 3) zero (for compatibility with
+.BR clock (8))
+as a decimal integer.
+.PP
+Line 2: 1 number: Resulting number of seconds since 1969 UTC of most
+recent calibration.  Zero if there has been no calibration yet or it
+is known that any previous calibration is moot (for example, because
+the Hardware Clock has been found, since that calibration, not to
+contain a valid time).  This is a decimal integer.
+.PP
+Line 3: "UTC" or "LOCAL".  Tells whether the Hardware Clock is set to
+Coordinated Universal Time or local time.  You can always override this
+value with options on the
+.B hwclock
+command line.
+.PP
+You can use an adjtime file that was previously used with the
+.BR clock (8)
+program with
+.BR hwclock .
+
+
+.SH "Automatic Hardware Clock Synchronization By the Kernel"
+
+You should be aware of another way that the Hardware Clock is kept
+synchronized in some systems.  The Linux kernel has a mode wherein it
+copies the System Time to the Hardware Clock every 11 minutes.
+This is a good mode to use when you are using something sophisticated
+like ntp to keep your System Time synchronized. (ntp is a way to keep
+your System Time synchronized either to a time server somewhere on the
+network or to a radio clock hooked up to your system.  See RFC 1305).
+
+This mode (we'll call it "11 minute mode") is off until something
+turns it on.  The ntp daemon xntpd is one thing that turns it on.  You
+can turn it off by running anything, including
+.IR "hwclock \-\-hctosys" ,
+that sets the System Time the old fashioned way.
+
+To see if it is on or
+off, use the command
+.I adjtimex \-\-print
+and look at the value of "status".  If the "64" bit of this number
+(expressed in binary) equal to 0, 11 minute mode is on.  Otherwise, it
+is off.
+
+If your system runs with 11 minute mode on, don't use
+.I hwclock \-\-adjust
+or
+.IR "hwclock \-\-hctosys" .
+You'll just make a mess.  It is acceptable to use a
+.I hwclock \-\-hctosys
+at startup time to get a reasonable System Time until your system is
+able to set the System Time from the external source and start 11
+minute mode.
+
+
+.SH ISA Hardware Clock Century value
+
+There is some sort of standard that defines CMOS memory Byte 50 on an ISA
+machine as an indicator of what century it is.
+.B hwclock
+does not use or set that byte because there are some machines that
+don't define the byte that way, and it really isn't necessary anyway,
+since the year-of-century does a good job of implying which century it
+is.
+
+If you have a bona fide use for a CMOS century byte, contact the
+.B hwclock
+maintainer; an option may be appropriate.
+
+Note that this section is only relevant when you are using the "direct
+ISA" method of accessing the Hardware Clock.
+ACPI provides a standard way to access century values, when they
+are supported by the hardware.
+
+.SH "ENVIRONMENT VARIABLES"
+.I TZ
+
+.SH FILES
+.I /etc/adjtime
+.I /usr/share/zoneinfo/
+.RI ( /usr/lib/zoneinfo
+on old systems)
+.I /dev/rtc
+.I /dev/rtc0
+.I /dev/port
+.I /dev/tty1
+.I /proc/cpuinfo
+
+.SH "SEE ALSO"
+.BR adjtimex (8),
+.BR date (1),
+.BR gettimeofday (2),
+.BR settimeofday (2),
+.BR crontab (1),
+.BR tzset (3)
+
+.SH AUTHORS
+Written by Bryan Henderson, September 1996 (bryanh@giraffe-data.com),
+based on work done on the
+.I clock
+program by Charles Hedrick, Rob Hooft, and Harald Koenig.
+See the source code for complete history and credits.
+
+.SH AVAILABILITY
+The hwclock command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/hwclock/hwclock.c b/util-linux-ng-2.17.2/hwclock/hwclock.c
new file mode 100644
index 0000000..c07f757
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/hwclock.c
@@ -0,0 +1,1818 @@
+/*
+ * hwclock.c
+ *
+ * clock.c was written by Charles Hedrick, hedrick@cs.rutgers.edu, Apr 1992
+ * Modified for clock adjustments - Rob Hooft <hooft@chem.ruu.nl>, Nov 1992
+ * Improvements by Harald Koenig <koenig@nova.tat.physik.uni-tuebingen.de>
+ * and Alan Modra <alan@spri.levels.unisa.edu.au>.
+ *
+ * Major rewrite by Bryan Henderson <bryanh@giraffe-data.com>, 96.09.19.
+ * The new program is called hwclock. New features:
+ * - You can set the hardware clock without also modifying the system clock.
+ * - You can read and set the clock with finer than 1 second precision.
+ * - When you set the clock, hwclock automatically refigures the drift
+ *   rate, based on how far off the clock was before you set it.
+ *
+ * Reshuffled things, added sparc code, and re-added alpha stuff
+ * by David Mosberger <davidm@azstarnet.com>
+ * and Jay Estabrook <jestabro@amt.tay1.dec.com>
+ * and Martin Ostermann <ost@coments.rwth-aachen.de>, aeb@cwi.nl, 990212.
+ *
+ * Fix for Award 2094 bug, Dave Coffin  (dcoffin@shore.net)  11/12/98
+ * Change of local time handling, Stefan Ring <e9725446@stud3.tuwien.ac.at>
+ * Change of adjtime handling, James P. Rutledge <ao112@rgfn.epcc.edu>.
+ *
+ * Distributed under GPL
+ */
+
+/*
+ * clock [-u] -r  - read hardware clock
+ * clock [-u] -w  - write hardware clock from system time
+ * clock [-u] -s  - set system time from hardware clock
+ * clock [-u] -a  - set system time from hardware clock, adjust the time
+ *                  to correct for systematic error, and write it back to
+ *                  the hardware clock
+ * -u indicates cmos clock is kept in universal time
+ * -A indicates cmos clock is kept in Alpha ARC console time (0 == 1980)
+ * -J indicates we're dealing with a Jensen (early DEC Alpha PC)
+ */
+
+/*
+ * Explanation of `adjusting' (Rob Hooft):
+ *
+ * The problem with my machine is that its CMOS clock is 10 seconds
+ * per day slow. With this version of clock.c, and my '/etc/rc.local'
+ * reading '/etc/clock -au' instead of '/etc/clock -u -s', this error
+ * is automatically corrected at every boot.
+ *
+ * To do this job, the program reads and writes the file '/etc/adjtime'
+ * to determine the correction, and to save its data. In this file are
+ * three numbers:
+ *
+ * 1) the correction in seconds per day. (So if your clock runs 5
+ *    seconds per day fast, the first number should read -5.0)
+ * 2) the number of seconds since 1/1/1970 the last time the program
+ *    was used
+ * 3) the remaining part of a second which was leftover after the last
+ *    adjustment
+ *
+ * Installation and use of this program:
+ *
+ * a) create a file '/etc/adjtime' containing as the first and only line:
+ *    '0.0 0 0.0'
+ * b) run 'clock -au' or 'clock -a', depending on whether your cmos is in
+ *    universal or local time. This updates the second number.
+ * c) set your system time using the 'date' command.
+ * d) update your cmos time using 'clock -wu' or 'clock -w'
+ * e) replace the first number in /etc/adjtime by your correction.
+ * f) put the command 'clock -au' or 'clock -a' in your '/etc/rc.local'
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+#include <getopt.h>
+#include <sysexits.h>
+
+#include "clock.h"
+#include "nls.h"
+
+#ifdef HAVE_LIBAUDIT
+#include <libaudit.h>
+static int hwaudit_fd = -1;
+static int hwaudit_on;
+#endif
+
+#define MYNAME "hwclock"
+
+char *progname = MYNAME;
+
+/* The struct that holds our hardware access routines */
+struct clock_ops *ur;
+
+#define FLOOR(arg) ((arg >= 0 ? (int) arg : ((int) arg) - 1));
+
+/* Here the information for time adjustments is kept. */
+#define ADJPATH "/etc/adjtime"
+
+const char *adj_file_name = NULL;
+
+/* Store the date here when "badyear" flag is set. */
+#define LASTDATE "/var/lib/lastdate"
+
+struct adjtime {
+  /* This is information we keep in the adjtime file that tells us how
+     to do drift corrections.  Elements are all straight from the
+     adjtime file, so see documentation of that file for details.
+     Exception is <dirty>, which is an indication that what's in this
+     structure is not what's in the disk file (because it has been
+     updated since read from the disk file).
+     */
+  bool dirty;
+
+  /* line 1 */
+  double drift_factor;
+  time_t last_adj_time;
+  double not_adjusted;
+
+  /* line 2 */
+  time_t last_calib_time;
+      /* The most recent time that we set the clock from an external
+	 authority (as opposed to just doing a drift adjustment) */
+
+  /* line 3 */
+  enum a_local_utc {LOCAL, UTC, UNKNOWN} local_utc;
+      /* To which time zone, local or UTC, we most recently set the
+	 hardware clock. */
+};
+
+bool debug;
+  /* We are running in debug mode, wherein we put a lot of information about
+     what we're doing to standard output. */
+
+bool badyear;
+  /* Workaround for Award 4.50g BIOS bug: keep the year in a file. */
+
+int epoch_option = -1;
+  /* User-specified epoch, used when rtc fails to return epoch. */
+
+/*
+ * Almost all Award BIOS's made between 04/26/94 and 05/31/95
+ * have a nasty bug limiting the RTC year byte to the range 94-99.
+ * Any year between 2000 and 2093 gets changed to 2094, every time
+ * you start the system.
+ * With the --badyear option, we write the date to file and hope
+ * that the file is updated at least once a year.
+ * I recommend putting this command "hwclock --badyear" in the monthly
+ * crontab, just to be safe. --  Dave Coffin  11/12/98
+ */
+static void
+write_date_to_file (struct tm *tm) {
+  FILE *fp;
+
+  if ((fp = fopen(LASTDATE,"w"))) {
+    fprintf(fp,"%02d.%02d.%04d\n", tm->tm_mday, tm->tm_mon+1,
+	    tm->tm_year+1900);
+    fclose(fp);
+  } else
+    perror(LASTDATE);
+}
+
+static void
+read_date_from_file (struct tm *tm) {
+  int last_mday, last_mon, last_year;
+  FILE *fp;
+
+  if ((fp = fopen(LASTDATE,"r"))) {
+    if (fscanf (fp,"%d.%d.%d\n", &last_mday, &last_mon, &last_year) == 3) {
+      tm->tm_year = last_year-1900;
+      if ((tm->tm_mon << 5) + tm->tm_mday < ((last_mon-1) << 5) + last_mday)
+	tm->tm_year ++;
+    }
+    fclose(fp);
+  }
+  write_date_to_file (tm);
+}
+
+double
+time_diff(struct timeval subtrahend, struct timeval subtractor) {
+/*---------------------------------------------------------------------------
+  The difference in seconds between two times in "timeval" format.
+----------------------------------------------------------------------------*/
+  return (subtrahend.tv_sec - subtractor.tv_sec)
+           + (subtrahend.tv_usec - subtractor.tv_usec) / 1E6;
+}
+
+
+static struct timeval
+time_inc(struct timeval addend, double increment) {
+/*----------------------------------------------------------------------------
+  The time, in "timeval" format, which is <increment> seconds after
+  the time <addend>.  Of course, <increment> may be negative.
+-----------------------------------------------------------------------------*/
+  struct timeval newtime;
+
+  newtime.tv_sec = addend.tv_sec + (int) increment;
+  newtime.tv_usec = addend.tv_usec + (increment - (int) increment) * 1E6;
+
+  /* Now adjust it so that the microsecond value is between 0 and 1 million */
+  if (newtime.tv_usec < 0) {
+    newtime.tv_usec += 1E6;
+    newtime.tv_sec -= 1;
+  } else if (newtime.tv_usec >= 1E6) {
+    newtime.tv_usec -= 1E6;
+    newtime.tv_sec += 1;
+  }
+  return newtime;
+}
+
+
+static bool
+hw_clock_is_utc(const bool utc, const bool local_opt,
+		const struct adjtime adjtime) {
+	bool ret;
+
+	if (utc)
+		ret = TRUE;	/* --utc explicitly given on command line */
+	else if (local_opt)
+		ret = FALSE;	/* --localtime explicitly given */
+	else
+				/* get info from adjtime file - default is local */
+		ret = (adjtime.local_utc == UTC);
+	if (debug)
+		printf(_("Assuming hardware clock is kept in %s time.\n"),
+		       ret ? _("UTC") : _("local"));
+	return ret;
+}
+
+
+
+static int
+read_adjtime(struct adjtime *adjtime_p) {
+/*----------------------------------------------------------------------------
+  Read the adjustment parameters out of the /etc/adjtime file.
+
+  Return them as the adjtime structure <*adjtime_p>.
+  If there is no /etc/adjtime file, return defaults.
+  If values are missing from the file, return defaults for them.
+
+  return value 0 if all OK, !=0 otherwise.
+
+-----------------------------------------------------------------------------*/
+  FILE *adjfile;
+  int rc;  /* local return code */
+  struct stat statbuf;  /* We don't even use the contents of this. */
+
+    rc = stat(adj_file_name, &statbuf);
+    if (rc < 0 && errno == ENOENT) {
+      /* He doesn't have a adjtime file, so we'll use defaults. */
+      adjtime_p->drift_factor = 0;
+      adjtime_p->last_adj_time = 0;
+      adjtime_p->not_adjusted = 0;
+      adjtime_p->last_calib_time = 0;
+      adjtime_p->local_utc = UNKNOWN;
+      adjtime_p->dirty = FALSE;        /* don't create a zero adjfile */
+
+      return 0;
+    }
+
+    adjfile = fopen(adj_file_name, "r");   /* open file for reading */
+    if (adjfile == NULL) {
+      outsyserr("cannot open file %s", adj_file_name);
+      return EX_OSFILE;
+    }
+
+    {
+      char line1[81];           /* String: first line of adjtime file */
+      char line2[81];           /* String: second line of adjtime file */
+      char line3[81];           /* String: third line of adjtime file */
+      long timeval;
+
+      if (!fgets(line1, sizeof(line1), adjfile))
+        line1[0] = '\0';          /* In case fgets fails */
+      if (!fgets(line2, sizeof(line2), adjfile))
+        line2[0] = '\0';          /* In case fgets fails */
+      if (!fgets(line3, sizeof(line3), adjfile))
+        line3[0] = '\0';          /* In case fgets fails */
+
+      fclose(adjfile);
+
+      /* Set defaults in case values are missing from file */
+      adjtime_p->drift_factor = 0;
+      adjtime_p->last_adj_time = 0;
+      adjtime_p->not_adjusted = 0;
+      adjtime_p->last_calib_time = 0;
+      timeval = 0;
+
+      sscanf(line1, "%lf %ld %lf",
+             &adjtime_p->drift_factor,
+             &timeval,
+             &adjtime_p->not_adjusted);
+      adjtime_p->last_adj_time = timeval;
+
+      sscanf(line2, "%ld", &timeval);
+      adjtime_p->last_calib_time = timeval;
+
+      if (!strcmp(line3, "UTC\n"))
+	adjtime_p->local_utc = UTC;
+      else if (!strcmp(line3, "LOCAL\n"))
+	adjtime_p->local_utc = LOCAL;
+      else {
+	adjtime_p->local_utc = UNKNOWN;
+	if (line3[0]) {
+	  fprintf(stderr,
+		  _("%s: Warning: unrecognized third line in adjtime file\n"),
+		  MYNAME);
+	  fprintf(stderr, _("(Expected: `UTC' or `LOCAL' or nothing.)\n"));
+	}
+      }
+    }
+    adjtime_p->dirty = FALSE;
+
+    if (debug) {
+      printf(_("Last drift adjustment done at %ld seconds after 1969\n"),
+             (long) adjtime_p->last_adj_time);
+      printf(_("Last calibration done at %ld seconds after 1969\n"),
+             (long) adjtime_p->last_calib_time);
+      printf(_("Hardware clock is on %s time\n"),
+	     (adjtime_p->local_utc == LOCAL) ? _("local") :
+	     (adjtime_p->local_utc == UTC) ? _("UTC") : _("unknown"));
+    }
+
+    return 0;
+}
+
+
+static int
+synchronize_to_clock_tick(void) {
+/*-----------------------------------------------------------------------------
+  Wait until the falling edge of the Hardware Clock's update flag so
+  that any time that is read from the clock immediately after we
+  return will be exact.
+
+  The clock only has 1 second precision, so it gives the exact time only
+  once per second, right on the falling edge of the update flag.
+
+  We wait (up to one second) either blocked waiting for an rtc device
+  or in a CPU spin loop.  The former is probably not very accurate.
+
+  Return 0 if it worked, nonzero if it didn't.
+-----------------------------------------------------------------------------*/
+	int rc;
+
+	if (debug) printf(_("Waiting for clock tick...\n"));
+
+	rc = ur->synchronize_to_clock_tick();
+
+	if (debug) {
+		if (rc)
+			printf(_("...synchronization failed\n"));
+		else
+			printf(_("...got clock tick\n"));
+	}
+
+	return rc;
+}
+
+
+
+static void
+mktime_tz(struct tm tm, const bool universal,
+          bool *valid_p, time_t *systime_p) {
+/*-----------------------------------------------------------------------------
+  Convert a time in broken down format (hours, minutes, etc.) into standard
+  unix time (seconds into epoch).  Return it as *systime_p.
+
+  The broken down time is argument <tm>.  This broken down time is either in
+  local time zone or UTC, depending on value of logical argument "universal".
+  True means it is in UTC.
+
+  If the argument contains values that do not constitute a valid time,
+  and mktime() recognizes this, return *valid_p == false and
+  *systime_p undefined.  However, mktime() sometimes goes ahead and
+  computes a fictional time "as if" the input values were valid,
+  e.g. if they indicate the 31st day of April, mktime() may compute
+  the time of May 1.  In such a case, we return the same fictional
+  value mktime() does as *systime_p and return *valid_p == true.
+
+-----------------------------------------------------------------------------*/
+  time_t mktime_result;  /* The value returned by our mktime() call */
+  char *zone;       /* Local time zone name */
+
+  /* We use the C library function mktime(), but since it only works on
+     local time zone input, we may have to fake it out by temporarily
+     changing the local time zone to UTC.
+     */
+  zone = getenv("TZ");	/* remember original time zone */
+  if (universal) {
+    /* Set timezone to UTC */
+    setenv("TZ", "", TRUE);
+    /* Note: tzset() gets called implicitly by the time code, but only the
+       first time.  When changing the environment variable, better call
+       tzset() explicitly.
+       */
+    tzset();
+  }
+  mktime_result = mktime(&tm);
+  if (mktime_result == -1) {
+    /* This apparently (not specified in mktime() documentation) means
+       the 'tm' structure does not contain valid values (however, not
+       containing valid values does _not_ imply mktime() returns -1).
+       */
+    *valid_p = FALSE;
+    *systime_p = 0;
+    if (debug)
+      printf(_("Invalid values in hardware clock: "
+             "%4d/%.2d/%.2d %.2d:%.2d:%.2d\n"),
+             tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+             tm.tm_hour, tm.tm_min, tm.tm_sec);
+  } else {
+    *valid_p = TRUE;
+    *systime_p = mktime_result;
+    if (debug)
+      printf(_("Hw clock time : %4d/%.2d/%.2d %.2d:%.2d:%.2d = "
+	       "%ld seconds since 1969\n"),
+	     tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+             tm.tm_hour, tm.tm_min, tm.tm_sec, (long) *systime_p);
+  }
+  /* now put back the original zone.  */
+  if (zone) setenv("TZ", zone, TRUE);
+  else unsetenv("TZ");
+  tzset();
+}
+
+
+static int
+read_hardware_clock(const bool universal, bool *valid_p, time_t *systime_p){
+/*----------------------------------------------------------------------------
+  Read the hardware clock and return the current time via <tm> argument.
+
+  Use the method indicated by <method> argument to access the hardware clock.
+-----------------------------------------------------------------------------*/
+  struct tm tm;
+  int err;
+
+  err = ur->read_hardware_clock(&tm);
+  if (err)
+	  return err;
+
+  if (badyear)
+    read_date_from_file(&tm);
+
+  if (debug)
+    printf (_("Time read from Hardware Clock: %4d/%.2d/%.2d %02d:%02d:%02d\n"),
+	    tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+            tm.tm_hour, tm.tm_min, tm.tm_sec);
+  mktime_tz(tm, universal, valid_p, systime_p);
+
+  return 0;
+}
+
+
+static void
+set_hardware_clock(const time_t newtime,
+                   const bool universal,
+                   const bool testing) {
+/*----------------------------------------------------------------------------
+  Set the Hardware Clock to the time <newtime>, in local time zone or UTC,
+  according to <universal>.
+----------------------------------------------------------------------------*/
+  int err;
+  struct tm new_broken_time;
+    /* Time to which we will set Hardware Clock, in broken down format, in
+       the time zone of caller's choice
+       */
+
+  if (universal)
+	  new_broken_time = *gmtime(&newtime);
+  else
+	  new_broken_time = *localtime(&newtime);
+
+  if (debug)
+    printf(_("Setting Hardware Clock to %.2d:%.2d:%.2d "
+           "= %ld seconds since 1969\n"),
+           new_broken_time.tm_hour, new_broken_time.tm_min,
+           new_broken_time.tm_sec, (long) newtime);
+
+  if (testing)
+    printf(_("Clock not changed - testing only.\n"));
+  else {
+    if (badyear) {
+      /*
+       * Write the real year to a file, then write a fake year
+       * between 1995 and 1998 to the RTC.  This way, Award BIOS boots
+       * on 29 Feb 2000 thinking that it's 29 Feb 1996.
+       */
+      write_date_to_file (&new_broken_time);
+      new_broken_time.tm_year = 95 + ((new_broken_time.tm_year+1) & 3);
+    }
+    err = ur->set_hardware_clock(&new_broken_time);
+  }
+}
+
+
+
+static void
+set_hardware_clock_exact(const time_t sethwtime,
+                         const struct timeval refsystime,
+                         const bool universal,
+                         const bool testing) {
+/*----------------------------------------------------------------------------
+  Set the Hardware Clock to the time "sethwtime", in local time zone or UTC,
+  according to "universal".
+
+  Wait for a fraction of a second so that "sethwtime" is the value of
+  the Hardware Clock as of system time "refsystime", which is in the past.
+  For example, if "sethwtime" is 14:03:05 and "refsystime" is 12:10:04.5
+  and the current system time is 12:10:06.0: Wait .5 seconds (to make
+  exactly 2 seconds since "refsystime") and then set the Hardware Clock
+  to 14:03:07, thus getting a precise and retroactive setting of the clock.
+
+  (Don't be confused by the fact that the system clock and the Hardware
+  Clock differ by two hours in the above example.  That's just to remind
+  you that there are two independent time scales here).
+
+  This function ought to be able to accept set times as fractional times.
+  Idea for future enhancement.
+-----------------------------------------------------------------------------*/
+
+  time_t newhwtime;
+  struct timeval beginsystime, nowsystime;
+  double tdiff;
+
+ time_resync:
+  gettimeofday(&beginsystime, NULL);
+  tdiff = time_diff(beginsystime, refsystime);
+  newhwtime = sethwtime + (int) (tdiff + 0.5);
+  if (debug)
+    printf(_("Time elapsed since reference time has been %.6f seconds.\n"
+           "Delaying further to reach the new time.\n"), tdiff);
+
+  /*
+   * Now delay some more until Hardware Clock time newhwtime arrives.  The 0.5 s
+   * is because the Hardware Clock always sets to your set time plus 500 ms
+   * (because it is designed to update to the next second precisely 500 ms
+   * after you finish the setting).
+   */
+  do {
+	  gettimeofday(&nowsystime, NULL);
+	  tdiff = time_diff(nowsystime, beginsystime);
+	  if (tdiff < 0)
+		  goto time_resync;	/* probably backward time reset */
+	  if (tdiff > 0.1)
+		  goto time_resync;	/* probably forward time reset */
+	  beginsystime = nowsystime;
+	  tdiff = time_diff(nowsystime, refsystime);
+  } while (newhwtime == sethwtime + (int) (tdiff + 0.5));
+
+  set_hardware_clock(newhwtime, universal, testing);
+}
+
+
+
+static void
+display_time(const bool hclock_valid, const time_t systime,
+             const double sync_duration) {
+/*----------------------------------------------------------------------------
+  Put the time "systime" on standard output in display format.
+  Except if hclock_valid == false, just tell standard output that we don't
+  know what time it is.
+
+  Include in the output the adjustment "sync_duration".
+-----------------------------------------------------------------------------*/
+  if (!hclock_valid)
+    fprintf(stderr, _("The Hardware Clock registers contain values that are "
+            "either invalid (e.g. 50th day of month) or beyond the range "
+            "we can handle (e.g. Year 2095).\n"));
+  else {
+    struct tm *lt;
+    char *format = "%c";
+    char ctime_now[200];
+
+    lt = localtime(&systime);
+    strftime(ctime_now, sizeof(ctime_now), format, lt);
+    printf(_("%s  %.6f seconds\n"), ctime_now, -(sync_duration));
+  }
+}
+
+
+
+static int
+interpret_date_string(const char *date_opt, time_t * const time_p) {
+/*----------------------------------------------------------------------------
+  Interpret the value of the --date option, which is something like
+  "13:05:01".  In fact, it can be any of the myriad ASCII strings that specify
+  a time which the "date" program can understand.  The date option value in
+  question is our "dateopt" argument.
+
+  The specified time is in the local time zone.
+
+  Our output, "*time_p", is a seconds-into-epoch time.
+
+  We use the "date" program to interpret the date string.  "date" must be
+  runnable by issuing the command "date" to the /bin/sh shell.  That means
+  in must be in the current PATH.
+
+  If anything goes wrong (and many things can), we return return code
+  10 and arbitrary *time_p.  Otherwise, return code is 0 and *time_p
+  is valid.
+----------------------------------------------------------------------------*/
+	FILE *date_child_fp;
+	char date_resp[100];
+	const char magic[]="seconds-into-epoch=";
+	char date_command[100];
+	int retcode;  /* our eventual return code */
+	int rc;  /* local return code */
+
+	if (date_opt == NULL) {
+		fprintf(stderr, _("No --date option specified.\n"));
+		return 14;
+	}
+
+	/* prevent overflow - a security risk */
+	if (strlen(date_opt) > sizeof(date_command) - 50) {
+		fprintf(stderr, _("--date argument too long\n"));
+		return 13;
+	}
+
+	/* Quotes in date_opt would ruin the date command we construct. */
+	if (strchr(date_opt, '"') != NULL) {
+		fprintf(stderr,
+			_("The value of the --date option is not a valid date.\n"
+			  "In particular, it contains quotation marks.\n"));
+		return 12;
+	}
+
+	sprintf(date_command, "date --date=\"%s\" +seconds-into-epoch=%%s",
+		date_opt);
+	if (debug)
+		printf(_("Issuing date command: %s\n"), date_command);
+
+	date_child_fp = popen(date_command, "r");
+	if (date_child_fp == NULL) {
+		outsyserr(_("Unable to run 'date' program in /bin/sh shell. "
+			    "popen() failed"));
+		return 10;
+	}
+
+	if (!fgets(date_resp, sizeof(date_resp), date_child_fp))
+		date_resp[0] = '\0';  /* in case fgets fails */
+	if (debug)
+		printf(_("response from date command = %s\n"), date_resp);
+	if (strncmp(date_resp, magic, sizeof(magic)-1) != 0) {
+		fprintf(stderr, _("The date command issued by %s returned "
+				  "unexpected results.\n"
+				  "The command was:\n  %s\n"
+				  "The response was:\n  %s\n"),
+			MYNAME, date_command, date_resp);
+		retcode = 8;
+	} else {
+		long seconds_since_epoch;
+		rc = sscanf(date_resp + sizeof(magic)-1, "%ld",
+			    &seconds_since_epoch);
+		if (rc < 1) {
+			fprintf(stderr,
+				_("The date command issued by %s returned "
+				  "something other than an integer where the "
+				  "converted time value was expected.\n"
+				  "The command was:\n  %s\n"
+				  "The response was:\n %s\n"),
+				MYNAME, date_command, date_resp);
+			retcode = 6;
+		} else {
+			retcode = 0;
+			*time_p = seconds_since_epoch;
+			if (debug)
+				printf(_("date string %s equates to "
+					 "%ld seconds since 1969.\n"),
+				       date_opt, (long) *time_p);
+		}
+	}
+	pclose(date_child_fp);
+
+	return retcode;
+}
+
+
+
+static int
+set_system_clock(const bool hclock_valid, const time_t newtime,
+                 const bool testing) {
+/*----------------------------------------------------------------------------
+   Set the System Clock to time 'newtime'.
+
+   Also set the kernel time zone value to the value indicated by the
+   TZ environment variable and/or /usr/lib/zoneinfo/, interpreted as
+   tzset() would interpret them.
+
+   EXCEPT: if hclock_valid is false, just issue an error message
+   saying there is no valid time in the Hardware Clock to which to set
+   the system time.
+
+   If 'testing' is true, don't actually update anything -- just say we
+   would have.
+-----------------------------------------------------------------------------*/
+  int retcode;
+
+  if (!hclock_valid) {
+    fprintf(stderr, _("The Hardware Clock does not contain a valid time, so "
+            "we cannot set the System Time from it.\n"));
+    retcode = 1;
+  } else {
+    struct timeval tv;
+    struct tm *broken;
+    int minuteswest;
+    int rc;
+
+    tv.tv_sec = newtime;
+    tv.tv_usec = 0;
+
+    broken = localtime(&newtime);
+#ifdef HAVE_TM_GMTOFF
+    minuteswest = -broken->tm_gmtoff/60;		/* GNU extension */
+#else
+    minuteswest = timezone/60;
+    if (broken->tm_isdst)
+	    minuteswest -= 60;
+#endif
+
+    if (debug) {
+      printf(_("Calling settimeofday:\n"));
+      printf(_("\ttv.tv_sec = %ld, tv.tv_usec = %ld\n"),
+             (long) tv.tv_sec, (long) tv.tv_usec);
+      printf(_("\ttz.tz_minuteswest = %d\n"), minuteswest);
+    }
+    if (testing) {
+      printf(_("Not setting system clock because running in test mode.\n"));
+      retcode = 0;
+    } else {
+      const struct timezone tz = { minuteswest, 0 };
+
+      rc = settimeofday(&tv, &tz);
+      if (rc) {
+	      if (errno == EPERM) {
+		      fprintf(stderr,
+			      _("Must be superuser to set system clock.\n"));
+		      retcode = EX_NOPERM;
+	      } else {
+		      outsyserr(_("settimeofday() failed"));
+		      retcode = 1;
+	      }
+      } else retcode = 0;
+    }
+  }
+  return retcode;
+}
+
+
+static int
+set_system_clock_timezone(const bool universal, const bool testing) {
+/*----------------------------------------------------------------------------
+   Reset the System Clock from local time to UTC, based on its current
+   value and the timezone unless universal is TRUE.
+
+   Also set the kernel time zone value to the value indicated by the
+   TZ environment variable and/or /usr/lib/zoneinfo/, interpreted as
+   tzset() would interpret them.
+
+   If 'testing' is true, don't actually update anything -- just say we
+   would have.
+-----------------------------------------------------------------------------*/
+  int retcode;
+  struct timeval tv;
+  struct tm *broken;
+  int minuteswest;
+  int rc;
+
+  gettimeofday(&tv, NULL);
+  if (debug) {
+    struct tm broken_time;
+    char ctime_now[200];
+
+    broken_time = *gmtime(&tv.tv_sec);
+    strftime(ctime_now, sizeof(ctime_now), "%Y/%m/%d %H:%M:%S", &broken_time);
+    printf(_("Current system time: %ld = %s\n"), (long) tv.tv_sec, ctime_now);
+  }
+
+  broken = localtime(&tv.tv_sec);
+#ifdef HAVE_TM_GMTOFF
+  minuteswest = -broken->tm_gmtoff/60;		/* GNU extension */
+#else
+  minuteswest = timezone/60;
+  if (broken->tm_isdst)
+	  minuteswest -= 60;
+#endif
+
+  gettimeofday(&tv, NULL);
+  if (!universal)
+    tv.tv_sec += minuteswest * 60;
+
+  if (debug) {
+    struct tm broken_time;
+    char ctime_now[200];
+
+    broken_time = *gmtime(&tv.tv_sec);
+    strftime(ctime_now, sizeof(ctime_now), "%Y/%m/%d %H:%M:%S", &broken_time);
+
+    printf(_("Calling settimeofday:\n"));
+    printf(_("\tUTC: %s\n"), ctime_now);
+    printf(_("\ttv.tv_sec = %ld, tv.tv_usec = %ld\n"),
+           (long) tv.tv_sec, (long) tv.tv_usec);
+    printf(_("\ttz.tz_minuteswest = %d\n"), minuteswest);
+  }
+  if (testing) {
+    printf(_("Not setting system clock because running in test mode.\n"));
+    retcode = 0;
+  } else {
+    const struct timezone tz = { minuteswest, 0 };
+
+    rc = settimeofday(&tv, &tz);
+    if (rc) {
+	    if (errno == EPERM) {
+		    fprintf(stderr,
+			    _("Must be superuser to set system clock.\n"));
+		    retcode = EX_NOPERM;
+	    } else {
+		    outsyserr(_("settimeofday() failed"));
+		    retcode = 1;
+	    }
+    } else retcode = 0;
+  }
+  return retcode;
+}
+
+
+static void
+adjust_drift_factor(struct adjtime *adjtime_p,
+                    const time_t nowtime,
+                    const bool hclock_valid,
+		    const time_t hclocktime,
+		    const double sync_delay) {
+/*------------------------------------------------------------------------
+  Update the drift factor in <*adjtime_p> to reflect the fact that the
+  Hardware Clock was calibrated to <nowtime> and before that was set
+  to <hclocktime>.
+
+  We record in the adjtime file the time at which we last calibrated
+  the clock so we can compute the drift rate each time we calibrate.
+
+  EXCEPT: if <hclock_valid> is false, assume Hardware Clock was not set
+  before to anything meaningful and regular adjustments have not been
+  done, so don't adjust the drift factor.
+  ------------------------------------------------------------------------*/
+	if (!hclock_valid) {
+		if (debug)
+			printf(_("Not adjusting drift factor because the "
+				 "Hardware Clock previously contained "
+				 "garbage.\n"));
+	} else if (adjtime_p->last_calib_time == 0) {
+		if (debug)
+			printf(_("Not adjusting drift factor because last "
+				 "calibration time is zero,\n"
+				 "so history is bad and calibration startover "
+				 "is necessary.\n"));
+	} else if ((hclocktime - adjtime_p->last_calib_time) < 23 * 60 * 60) {
+		if (debug)
+			printf(_("Not adjusting drift factor because it has "
+				 "been less than a day since the last "
+				 "calibration.\n"));
+	} else if (adjtime_p->last_calib_time != 0) {
+		/*
+		 * At adjustment time we adjust the hardware clock according
+		 * to the contents of /etc/adjtime.
+		 *
+		 * At calibration time we set the hardware clock and
+		 * update /etc/adjtime, that is, for each calibration
+		 * (except the first) we also do an adjustment.
+		 *
+		 * We are now at calibration time.
+		 *
+		 * Let us do computation in doubles. (Floats almost suffice,
+		 * but 195 days + 1 second equals 195 days in floats.)
+		 */
+		const double sec_per_day = 24.0 * 60.0 * 60.0;
+		double atime_per_htime;
+		double adj_days, cal_days;
+		double exp_drift, unc_drift;
+		double factor_adjust;
+
+		/* Adjusted time units per hardware time unit */
+		atime_per_htime = 1.0 + adjtime_p->drift_factor / sec_per_day;
+
+		/* Days since last adjustment (in hardware clock time) */
+		adj_days = (double)(hclocktime - adjtime_p->last_adj_time)
+			/ sec_per_day;
+
+		/* Expected drift (sec) since last adjustment */
+		exp_drift = adj_days * adjtime_p->drift_factor
+			+ adjtime_p->not_adjusted;
+
+		/* Uncorrected drift (sec) since last calibration */
+		unc_drift = (double)(nowtime - hclocktime)
+			+ sync_delay - exp_drift;
+
+		/* Days since last calibration (in hardware clock time) */
+		cal_days = ((double)(adjtime_p->last_adj_time
+				    - adjtime_p->last_calib_time)
+			    + adjtime_p->not_adjusted)
+			/ (sec_per_day * atime_per_htime) + adj_days;
+
+		/* Amount to add to previous drift factor */
+		factor_adjust = unc_drift / cal_days;
+
+		if (debug)
+			printf(_("Clock drifted %.1f seconds in the past "
+				 "%d seconds in spite of a drift factor of "
+				 "%f seconds/day.\n"
+				 "Adjusting drift factor by %f seconds/day\n"),
+			       unc_drift,
+			       (int) (nowtime - adjtime_p->last_calib_time),
+			       adjtime_p->drift_factor,
+			       factor_adjust);
+
+		adjtime_p->drift_factor += factor_adjust;
+	}
+	adjtime_p->last_calib_time = nowtime;
+
+	adjtime_p->last_adj_time = nowtime;
+
+	adjtime_p->not_adjusted = 0;
+
+	adjtime_p->dirty = TRUE;
+}
+
+
+
+static void
+calculate_adjustment(const double factor,
+                     const time_t last_time,
+                     const double not_adjusted,
+                     const time_t systime,
+                     int *adjustment_p,
+                     double *retro_p) {
+/*----------------------------------------------------------------------------
+  Do the drift adjustment calculation.
+
+  The way we have to set the clock, we need the adjustment in two parts:
+
+    1) an integer number of seconds (return as *adjustment_p)
+
+    2) a positive fraction of a second (less than 1) (return as *retro_p)
+
+  The sum of these two values is the adjustment needed.  Positive means to
+  advance the clock or insert seconds.  Negative means to retard the clock
+  or remove seconds.
+----------------------------------------------------------------------------*/
+  double exact_adjustment;
+
+  exact_adjustment = ((double) (systime - last_time)) * factor / (24 * 60 * 60)
+                     + not_adjusted;
+  *adjustment_p = FLOOR(exact_adjustment);
+
+  *retro_p = exact_adjustment - (double) *adjustment_p;
+  if (debug) {
+    printf (_("Time since last adjustment is %d seconds\n"),
+            (int) (systime - last_time));
+    printf (_("Need to insert %d seconds and refer time back "
+            "%.6f seconds ago\n"),
+            *adjustment_p, *retro_p);
+  }
+}
+
+
+
+static void
+save_adjtime(const struct adjtime adjtime, const bool testing) {
+/*-----------------------------------------------------------------------------
+  Write the contents of the <adjtime> structure to its disk file.
+
+  But if the contents are clean (unchanged since read from disk), don't
+  bother.
+-----------------------------------------------------------------------------*/
+  char newfile[412];   /* Stuff to write to disk file */
+
+  if (adjtime.dirty) {
+    /* snprintf is not always available, but this is safe
+       as long as libc does not use more than 100 positions for %ld or %f */
+    sprintf(newfile, "%f %ld %f\n%ld\n%s\n",
+             adjtime.drift_factor,
+             (long) adjtime.last_adj_time,
+             adjtime.not_adjusted,
+             (long) adjtime.last_calib_time,
+	     (adjtime.local_utc == UTC) ? "UTC" : "LOCAL");
+
+    if (testing) {
+      printf(_("Not updating adjtime file because of testing mode.\n"));
+      printf(_("Would have written the following to %s:\n%s"),
+             adj_file_name, newfile);
+    } else {
+      FILE *adjfile;
+      int err = 0;
+
+      adjfile = fopen(adj_file_name, "w");
+      if (adjfile == NULL) {
+        outsyserr(_("Could not open file with the clock adjustment parameters "
+               "in it (%s) for writing"), adj_file_name);
+	err = 1;
+      } else {
+        if (fputs(newfile, adjfile) < 0) {
+	  outsyserr(_("Could not update file with the clock adjustment "
+		    "parameters (%s) in it"), adj_file_name);
+	  err = 1;
+        }
+        if (fclose(adjfile) < 0) {
+          outsyserr(_("Could not update file with the clock adjustment "
+		    "parameters (%s) in it"), adj_file_name);
+	  err = 1;
+        }
+      }
+      if (err)
+	fprintf(stderr, _("Drift adjustment parameters not updated.\n"));
+    }
+  }
+}
+
+
+
+static void
+do_adjustment(struct adjtime *adjtime_p,
+              const bool hclock_valid, const time_t hclocktime,
+              const struct timeval read_time,
+              const bool universal, const bool testing) {
+/*---------------------------------------------------------------------------
+  Do the adjustment requested, by 1) setting the Hardware Clock (if
+  necessary), and 2) updating the last-adjusted time in the adjtime
+  structure.
+
+  Do not update anything if the Hardware Clock does not currently present
+  a valid time.
+
+  arguments <factor> and <last_time> are current values from the adjtime
+  file.
+
+  <hclock_valid> means the Hardware Clock contains a valid time, and that
+  time is <hclocktime>.
+
+  <read_time> is the current system time (to be precise, it is the system
+  time at the time <hclocktime> was read, which due to computational delay
+  could be a short time ago).
+
+  <universal>: the Hardware Clock is kept in UTC.
+
+  <testing>:  We are running in test mode (no updating of clock).
+
+  We do not bother to update the clock if the adjustment would be less than
+  one second.  This is to avoid cumulative error and needless CPU hogging
+  (remember we use an infinite loop for some timing) if the user runs us
+  frequently.
+
+----------------------------------------------------------------------------*/
+  if (!hclock_valid) {
+    fprintf(stderr, _("The Hardware Clock does not contain a valid time, "
+            "so we cannot adjust it.\n"));
+    adjtime_p->last_calib_time = 0;  /* calibration startover is required */
+    adjtime_p->last_adj_time = 0;
+    adjtime_p->not_adjusted = 0;
+    adjtime_p->dirty = TRUE;
+  } else if (adjtime_p->last_adj_time == 0) {
+    if (debug)
+      printf(_("Not setting clock because last adjustment time is zero, "
+	     "so history is bad."));
+  } else {
+    int adjustment;
+    /* Number of seconds we must insert in the Hardware Clock */
+    double retro;
+    /* Fraction of second we have to remove from clock after inserting
+       <adjustment> whole seconds.
+       */
+    calculate_adjustment(adjtime_p->drift_factor,
+                         adjtime_p->last_adj_time,
+                         adjtime_p->not_adjusted,
+                         hclocktime,
+                         &adjustment, &retro);
+    if (adjustment > 0 || adjustment < -1) {
+      set_hardware_clock_exact(hclocktime + adjustment,
+                               time_inc(read_time, -retro),
+                               universal, testing);
+      adjtime_p->last_adj_time = hclocktime + adjustment;
+      adjtime_p->not_adjusted = 0;
+      adjtime_p->dirty = TRUE;
+    } else
+      if (debug)
+        printf(_("Needed adjustment is less than one second, "
+               "so not setting clock.\n"));
+  }
+}
+
+
+
+static void
+determine_clock_access_method(const bool user_requests_ISA) {
+
+  ur = NULL;
+
+  if (user_requests_ISA)
+	  ur = probe_for_cmos_clock();
+
+  if (!ur)
+	  ur = probe_for_rtc_clock();
+
+  if (!ur)
+	  ur = probe_for_kd_clock();
+
+  if (!ur && !user_requests_ISA)
+	  ur = probe_for_cmos_clock();
+
+  if (debug) {
+	  if (ur)
+		  printf(_("Using %s.\n"), ur->interface_name);
+	  else
+		  printf(_("No usable clock interface found.\n"));
+  }
+}
+
+static int
+manipulate_clock(const bool show, const bool adjust, const bool noadjfile,
+                 const bool set, const time_t set_time,
+                 const bool hctosys, const bool systohc, const bool systz,
+                 const struct timeval startup_time,
+                 const bool utc, const bool local_opt,
+		 const bool testing) {
+/*---------------------------------------------------------------------------
+  Do all the normal work of hwclock - read, set clock, etc.
+
+  Issue output to stdout and error message to stderr where appropriate.
+
+  Return rc == 0 if everything went OK, rc != 0 if not.
+----------------------------------------------------------------------------*/
+    struct adjtime adjtime;
+      /* Contents of the adjtime file, or what they should be. */
+    int rc;  /* local return code */
+    bool no_auth;  /* User lacks necessary authorization to access the clock */
+
+    if (!systz) {
+      no_auth = ur->get_permissions();
+      if (no_auth)
+              return EX_NOPERM;
+    }
+
+    if (!noadjfile && (adjust || set || systohc || (!utc && !local_opt))) {
+      rc = read_adjtime(&adjtime);
+      if (rc)
+	      return rc;
+    } else {
+      /* A little trick to avoid reading the file if we don't have to */
+      adjtime.dirty = FALSE;
+      rc = 0;
+    }
+
+    {
+      const bool universal = hw_clock_is_utc(utc, local_opt, adjtime);
+
+      if ((set || systohc || adjust) &&
+	  (adjtime.local_utc == UTC) != universal) {
+	adjtime.local_utc = universal ? UTC : LOCAL;
+	adjtime.dirty = TRUE;
+      }
+
+      {
+        struct timeval read_time;
+          /* The time at which we read the Hardware Clock */
+
+        bool hclock_valid = FALSE;
+          /* The Hardware Clock gives us a valid time, or at least something
+             close enough to fool mktime().
+             */
+
+        time_t hclocktime = 0;
+          /* The time the hardware clock had just after we
+             synchronized to its next clock tick when we started up.
+             Defined only if hclock_valid is true.
+             */
+
+	if (show || adjust || hctosys || (!noadjfile && !systz)) {
+          /* data from HW-clock are required */
+          rc = synchronize_to_clock_tick();
+          if (rc && rc != 2)		/* 2= synchronization timeout */
+            return EX_IOERR;
+          gettimeofday(&read_time, NULL);
+          rc = read_hardware_clock(universal, &hclock_valid, &hclocktime);
+          if (rc)
+             return EX_IOERR;
+	}
+
+        if (show) {
+          display_time(hclock_valid, hclocktime,
+                       time_diff(read_time, startup_time));
+        } else if (set) {
+          set_hardware_clock_exact(set_time, startup_time,
+				      universal, testing);
+	  if (!noadjfile)
+            adjust_drift_factor(&adjtime, set_time, hclock_valid, hclocktime,
+			        time_diff(read_time, startup_time));
+        } else if (adjust) {
+          do_adjustment(&adjtime, hclock_valid, hclocktime,
+                        read_time, universal, testing);
+        } else if (systohc) {
+          struct timeval nowtime, reftime;
+          /* We can only set_hardware_clock_exact to a whole seconds
+             time, so we set it with reference to the most recent
+             whole seconds time.
+             */
+          gettimeofday(&nowtime, NULL);
+          reftime.tv_sec = nowtime.tv_sec;
+          reftime.tv_usec = 0;
+
+          set_hardware_clock_exact((time_t) reftime.tv_sec, reftime,
+                                   universal, testing);
+	  if (!noadjfile)
+            adjust_drift_factor(&adjtime, (time_t) reftime.tv_sec, hclock_valid,
+                                hclocktime, (double) read_time.tv_usec / 1E6);
+        } else if (hctosys) {
+          rc = set_system_clock(hclock_valid, hclocktime, testing);
+          if (rc) {
+            printf(_("Unable to set system clock.\n"));
+	    return rc;
+          }
+	} else if (systz) {
+	  rc = set_system_clock_timezone(universal, testing);
+	  if (rc) {
+	    printf(_("Unable to set system clock.\n"));
+	    return rc;
+	  }
+        }
+        if (!noadjfile)
+         save_adjtime(adjtime, testing);
+      }
+    }
+    return 0;
+}
+
+
+static void
+manipulate_epoch(const bool getepoch, const bool setepoch,
+                 const int epoch_opt, const bool testing) {
+/*----------------------------------------------------------------------------
+   Get or set the Hardware Clock epoch value in the kernel, as appropriate.
+   <getepoch>, <setepoch>, and <epoch> are hwclock invocation options.
+
+   <epoch> == -1 if the user did not specify an "epoch" option.
+
+-----------------------------------------------------------------------------*/
+  /*
+   Maintenance note:  This should work on non-Alpha machines, but the
+   evidence today (98.03.04) indicates that the kernel only keeps the
+   epoch value on Alphas.  If that is ever fixed, this function should be
+   changed.
+   */
+
+#ifndef __alpha__
+    fprintf(stderr, _("The kernel keeps an epoch value for the Hardware Clock "
+            "only on an Alpha machine.\nThis copy of hwclock was built for "
+            "a machine other than Alpha\n(and thus is presumably not running "
+            "on an Alpha now).  No action taken.\n"));
+#else
+    if (getepoch) {
+      unsigned long epoch;
+
+      if (get_epoch_rtc(&epoch, 0))
+        fprintf(stderr, _("Unable to get the epoch value from the kernel.\n"));
+      else
+        printf(_("Kernel is assuming an epoch value of %lu\n"), epoch);
+    } else if (setepoch) {
+      if (epoch_opt == -1)
+        fprintf(stderr, _("To set the epoch value, you must use the 'epoch' "
+                "option to tell to what value to set it.\n"));
+      else if (testing)
+        printf(_("Not setting the epoch to %d - testing only.\n"),
+	       epoch_opt);
+      else if (set_epoch_rtc(epoch_opt))
+        printf(_("Unable to set the epoch value in the kernel.\n"));
+    }
+#endif
+}
+
+#ifdef __ia64__
+#define RTC_DEV "/dev/efirtc"
+#else
+#define RTC_DEV "/dev/rtc"
+#endif
+
+static void
+out_version(void) {
+	printf(_("%s from %s\n"), MYNAME, PACKAGE_STRING);
+}
+
+/*
+    usage - Output (error and) usage information
+
+    This function is called both directly from main to show usage
+    information and as fatal function from shhopt if some argument is
+    not understood. In case of normal usage info FMT should be NULL.
+    In that case the info is printed to stdout. If FMT is given
+    usage will act like fprintf( stderr, fmt, ... ), show a usage
+    information and terminate the program afterwards.
+*/
+static void
+usage( const char *fmt, ... ) {
+  FILE    *usageto;
+  va_list ap;
+
+  usageto = fmt ? stderr : stdout;
+
+  fprintf( usageto, _(
+    "hwclock - query and set the hardware clock (RTC)\n\n"
+    "Usage: hwclock [function] [options...]\n\n"
+    "Functions:\n"
+	"  -h | --help         show this help\n"
+	"  -r | --show         read hardware clock and print result\n"
+	"       --set          set the rtc to the time given with --date\n"
+	"  -s | --hctosys      set the system time from the hardware clock\n"
+	"  -w | --systohc      set the hardware clock to the current system time\n"
+	"       --systz        set the system time based on the current timezone\n"
+	"       --adjust       adjust the rtc to account for systematic drift since\n"
+	"                      the clock was last set or adjusted\n"
+	"       --getepoch     print out the kernel's hardware clock epoch value\n"
+	"       --setepoch     set the kernel's hardware clock epoch value to the \n"
+	"                      value given with --epoch\n"
+	"  -v | --version      print out the version of hwclock to stdout\n"
+	"\nOptions: \n"
+	"  -u | --utc          the hardware clock is kept in UTC\n"
+	"       --localtime    the hardware clock is kept in local time\n"
+	"  -f | --rtc=path     special /dev/... file to use instead of default\n"
+	"       --directisa    access the ISA bus directly instead of %s\n"
+	"       --badyear      ignore rtc's year because the bios is broken\n"
+	"       --date         specifies the time to which to set the hardware clock\n"
+	"       --epoch=year   specifies the year which is the beginning of the \n"
+	"                      hardware clock's epoch value\n"
+	"       --noadjfile    do not access /etc/adjtime. Requires the use of\n"
+	"                      either --utc or --localtime\n"
+	"       --adjfile=path specifies the path to the adjust file (default is\n"
+	"                      /etc/adjtime)\n"
+	"       --test         do everything except actually updating the hardware\n"
+	"                      clock or anything else\n"
+	"  -D | --debug        debug mode\n"
+	"\n"
+    ),RTC_DEV);
+#ifdef __alpha__
+  fprintf(usageto, _(
+	"  -J|--jensen, -A|--arc, -S|--srm, -F|--funky-toy\n"
+	"       tell hwclock the type of alpha you have (see hwclock(8))\n"
+	"\n"
+    ) );
+#endif
+
+  fflush(stdout);
+  if (fmt) {
+    usageto = stderr;
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    va_end(ap);
+  }
+
+  hwclock_exit(fmt ? EX_USAGE : 0);
+}
+
+static const struct option longopts[] = {
+	{ "adjust", 0, 0, 'a' },
+	{ "help", 0, 0, 'h' },
+	{ "show", 0, 0, 'r' },
+	{ "hctosys", 0, 0, 's' },
+	{ "utc", 0, 0, 'u' },
+	{ "version", 0, 0, 'v' },
+	{ "systohc", 0, 0, 'w' },
+	{ "debug", 0, 0, 'D' },
+#ifdef __alpha__
+	{ "ARC", 0, 0, 'A' },
+	{ "arc", 0, 0, 'A' },
+	{ "Jensen", 0, 0, 'J' },
+	{ "jensen", 0, 0, 'J' },
+	{ "SRM", 0, 0, 'S' },
+	{ "srm", 0, 0, 'S' },
+	{ "funky-toy", 0, 0, 'F'},
+#endif
+	{ "set", 0, 0, 128 },
+	{ "getepoch", 0, 0, 129 },
+	{ "setepoch", 0, 0, 130 },
+	{ "noadjfile", 0, 0, 131 },
+	{ "localtime", 0, 0, 132 },
+	{ "badyear", 0, 0, 133 },
+	{ "directisa", 0, 0, 134 },
+	{ "test", 0, 0, 135 },
+	{ "date", 1, 0, 136 },
+	{ "epoch", 1, 0, 137 },
+	{ "rtc", 1, 0, 'f' },
+	{ "adjfile", 1, 0, 138 },
+	{ "systz", 0, 0, 139 },
+	{ NULL, 0, 0, 0 }
+};
+
+/*
+ * Returns:
+ *  EX_USAGE: bad invocation
+ *  EX_NOPERM: no permission
+ *  EX_OSFILE: cannot open /dev/rtc or /etc/adjtime
+ *  EX_IOERR: ioctl error getting or setting the time
+ *  0: OK (or not)
+ *  1: failure
+ */
+int
+main(int argc, char **argv) {
+
+	struct timeval startup_time;
+	/* The time we started up, in seconds into the epoch, including
+	   fractions. */
+	time_t set_time = 0;  /* Time to which user said to set Hardware Clock */
+
+	bool permitted;  /* User is permitted to do the function */
+	int rc, c;
+
+	/* Variables set by various options; show may also be set later */
+	/* The options debug, badyear and epoch_option are global */
+	bool show, set, systohc, hctosys, systz, adjust, getepoch, setepoch;
+	bool utc, testing, local_opt, noadjfile, directisa;
+	bool ARCconsole, Jensen, SRM, funky_toy;
+	char *date_opt;
+
+	/* Remember what time we were invoked */
+	gettimeofday(&startup_time, NULL);
+
+#ifdef HAVE_LIBAUDIT
+	hwaudit_fd = audit_open();
+	if (hwaudit_fd < 0 && !(errno == EINVAL || errno == EPROTONOSUPPORT ||
+				errno == EAFNOSUPPORT)) {
+		/* You get these error codes only when the kernel doesn't have
+		 * audit compiled in. */
+		fprintf(stderr, _("%s: Unable to connect to audit system\n"),
+				MYNAME);
+		return EX_NOPERM;
+	}
+#endif
+	setlocale(LC_ALL, "");
+#ifdef LC_NUMERIC
+	/* We need LC_CTYPE and LC_TIME and LC_MESSAGES, but must avoid
+	   LC_NUMERIC since it gives problems when we write to /etc/adjtime.
+	   - gqueri@mail.dotcom.fr */
+	setlocale(LC_NUMERIC, "C");
+#endif
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	/* Set option defaults */
+	show = set = systohc = hctosys = systz = adjust = noadjfile = FALSE;
+	getepoch = setepoch = utc = local_opt = testing = debug = FALSE;
+	ARCconsole = Jensen = SRM = funky_toy = directisa = badyear = FALSE;
+	date_opt = NULL;
+
+	while ((c = getopt_long (argc, argv, "?hvVDarsuwAJSFf:", longopts, NULL))
+	       != -1) {
+		switch (c) {
+		case 'D':
+			debug = TRUE;
+			break;
+		case 'a':
+			adjust = TRUE;
+			break;
+		case 'r':
+			show = TRUE;
+			break;
+		case 's':
+			hctosys = TRUE;
+			break;
+		case 'u':
+			utc = TRUE;
+			break;
+		case 'w':
+			systohc = TRUE;
+			break;
+#ifdef __alpha__
+		case 'A':
+			ARCconsole = TRUE;
+			break;
+		case 'J':
+			Jensen = TRUE;
+			break;
+		case 'S':
+			SRM = TRUE;
+			break;
+		case 'F':
+			funky_toy = TRUE;
+			break;
+#endif
+		case 128:
+			set = TRUE;
+			break;
+		case 129:
+			getepoch = TRUE;
+			break;
+		case 130:
+			setepoch = TRUE;
+			break;
+		case 131:
+			noadjfile = TRUE;
+			break;
+		case 132:
+			local_opt = TRUE;		/* --localtime */
+			break;
+		case 133:
+			badyear = TRUE;
+			break;
+		case 134:
+			directisa = TRUE;
+			break;
+		case 135:
+			testing = TRUE;			/* --test */
+			break;
+		case 136:
+			date_opt = optarg;		/* --date */
+			break;
+		case 137:
+			epoch_option = atoi(optarg);	/* --epoch */
+			break;
+		case 138:
+			adj_file_name = optarg;		/* --adjfile */
+			break;
+		case 139:
+			systz = TRUE;			/* --systz */
+			break;
+		case 'f':
+			rtc_dev_name = optarg;		/* --rtc */
+			break;
+		case 'v':				/* --version */
+		case 'V':
+			out_version();
+			return 0;
+		case 'h':				/* --help */
+		case '?':
+		default:
+			usage(NULL);
+		}
+	}
+
+	argc -= optind;
+	argv += optind;
+
+#ifdef HAVE_LIBAUDIT
+	if (testing != TRUE) {
+		if (adjust == TRUE || hctosys == TRUE || systohc == TRUE ||
+					set == TRUE || setepoch == TRUE) {
+			hwaudit_on = TRUE;
+		}
+	}
+#endif
+	if (argc > 0) {
+		usage(_("%s takes no non-option arguments.  "
+			"You supplied %d.\n"),
+		      MYNAME, argc);
+	}
+
+	if (show + set + systohc + hctosys + systz + adjust + getepoch
+	    + setepoch > 1){
+		fprintf(stderr, _("You have specified multiple functions.\n"
+				  "You can only perform one function "
+				  "at a time.\n"));
+		hwclock_exit(EX_USAGE);
+	}
+
+	if (utc && local_opt) {
+		fprintf(stderr, _("%s: The --utc and --localtime options "
+				  "are mutually exclusive.  You specified "
+				  "both.\n"), MYNAME);
+		hwclock_exit(EX_USAGE);
+	}
+
+	if (adjust && noadjfile) {
+		fprintf(stderr, _("%s: The --adjust and --noadjfile options "
+				  "are mutually exclusive.  You specified "
+				  "both.\n"), MYNAME);
+		hwclock_exit(EX_USAGE);
+	}
+
+	if (adj_file_name && noadjfile) {
+		fprintf(stderr, _("%s: The --adjfile and --noadjfile options "
+				  "are mutually exclusive.  You specified "
+				  "both.\n"), MYNAME);
+		hwclock_exit(EX_USAGE);
+	}
+	if (!adj_file_name)
+		adj_file_name = ADJPATH;
+
+	if (noadjfile && !(utc || local_opt)) {
+		fprintf(stderr, _("%s: With --noadjfile, you must specify "
+				  "either --utc or --localtime\n"), MYNAME);
+		hwclock_exit(EX_USAGE);
+	}
+
+#ifdef __alpha__
+	set_cmos_epoch(ARCconsole, SRM);
+	set_cmos_access(Jensen, funky_toy);
+#endif
+
+	if (set) {
+		rc = interpret_date_string(date_opt, &set_time);
+		/* (time-consuming) */
+		if (rc != 0) {
+			fprintf(stderr, _("No usable set-to time.  "
+					  "Cannot set clock.\n"));
+			hwclock_exit(EX_USAGE);
+		}
+	}
+
+	if (!(show | set | systohc | hctosys | systz | adjust | getepoch
+	      | setepoch))
+		show = 1; /* default to show */
+
+
+	if (getuid() == 0)
+		permitted = TRUE;
+	else {
+		/* program is designed to run setuid (in some situations) */
+		if (set || systohc || adjust) {
+			fprintf(stderr,
+				_("Sorry, only the superuser can change "
+				  "the Hardware Clock.\n"));
+			permitted = FALSE;
+		} else if (systz || hctosys) {
+			fprintf(stderr,
+				_("Sorry, only the superuser can change "
+				  "the System Clock.\n"));
+			permitted = FALSE;
+		} else if (setepoch) {
+			fprintf(stderr,
+				_("Sorry, only the superuser can change the "
+				  "Hardware Clock epoch in the kernel.\n"));
+			permitted = FALSE;
+		} else
+			permitted = TRUE;
+	}
+
+	if (!permitted)
+		hwclock_exit(EX_NOPERM);
+
+	if (getepoch || setepoch) {
+		manipulate_epoch(getepoch, setepoch, epoch_option, testing);
+		hwclock_exit(0);
+	}
+
+	if (debug)
+		out_version();
+	if (!systz) {
+		determine_clock_access_method(directisa);
+		if (!ur) {
+			fprintf(stderr,
+				_("Cannot access the Hardware Clock via "
+				  "any known method.\n"));
+			if (!debug)
+				fprintf(stderr,
+					_("Use the --debug option to see the "
+					  "details of our search for an access "
+					  "method.\n"));
+			hwclock_exit(1);
+		}
+	}
+
+	rc = manipulate_clock(show, adjust, noadjfile, set, set_time,
+				hctosys, systohc, systz, startup_time, utc,
+				local_opt, testing);
+	hwclock_exit(rc);
+	return rc;	/* Not reached */
+}
+
+/* A single routine for greater uniformity */
+void
+outsyserr(char *msg, ...) {
+	va_list args;
+	int errsv = errno;
+
+	fprintf(stderr, "%s: ", progname);
+	va_start(args, msg);
+	vfprintf(stderr, msg, args);
+	va_end(args);
+	fprintf(stderr, ", errno=%d: %s.\n",
+		errsv, strerror(errsv));
+}
+
+
+#ifdef HAVE_LIBAUDIT
+void
+hwaudit_exit(int status)
+{
+	if (hwaudit_on) {
+		audit_log_user_message(hwaudit_fd, AUDIT_USYS_CONFIG,
+			"changing system time", NULL, NULL, NULL, status ? 0 : 1);
+		close(hwaudit_fd);
+	}
+	exit(status);
+}
+#endif
+
+/****************************************************************************
+
+  History of this program:
+
+  98.08.12 BJH   Version 2.4
+
+  Don't use century byte from Hardware Clock.  Add comments telling why.
+
+
+  98.06.20 BJH   Version 2.3.
+
+  Make --hctosys set the kernel timezone from TZ environment variable
+  and/or /usr/lib/zoneinfo.  From Klaus Ripke (klaus@ripke.com).
+
+  98.03.05 BJH.  Version 2.2.
+
+  Add --getepoch and --setepoch.
+
+  Fix some word length things so it works on Alpha.
+
+  Make it work when /dev/rtc doesn't have the interrupt functions.
+  In this case, busywait for the top of a second instead of blocking and
+  waiting for the update complete interrupt.
+
+  Fix a bunch of bugs too numerous to mention.
+
+  97.06.01: BJH.  Version 2.1.  Read and write the century byte (Byte
+  50) of the ISA Hardware Clock when using direct ISA I/O.  Problem
+  discovered by job (jei@iclnl.icl.nl).
+
+  Use the rtc clock access method in preference to the KDGHWCLK method.
+  Problem discovered by Andreas Schwab <schwab@LS5.informatik.uni-dortmund.de>.
+
+  November 1996: Version 2.0.1.  Modifications by Nicolai Langfeldt
+  (janl@math.uio.no) to make it compile on linux 1.2 machines as well
+  as more recent versions of the kernel. Introduced the NO_CLOCK
+  access method and wrote feature test code to detect absense of rtc
+  headers.
+
+
+**************************************************************************
+  Maintenance notes
+
+  To compile this, you must use GNU compiler optimization (-O option)
+  in order to make the "extern inline" functions from asm/io.h (inb(),
+  etc.)  compile.  If you don't optimize, which means the compiler
+  will generate no inline functions, the references to these functions
+  in this program will be compiled as external references.  Since you
+  probably won't be linking with any functions by these names, you will
+  have unresolved external references when you link.
+
+  The program is designed to run setuid superuser, since we need to be
+  able to do direct I/O.  (More to the point: we need permission to
+  execute the iopl() system call).  (However, if you use one of the
+  methods other than direct ISA I/O to access the clock, no setuid is
+  required).
+
+  Here's some info on how we must deal with the time that elapses while
+  this program runs: There are two major delays as we run:
+
+    1) Waiting up to 1 second for a transition of the Hardware Clock so
+       we are synchronized to the Hardware Clock.
+
+    2) Running the "date" program to interpret the value of our --date
+       option.
+
+  Reading the /etc/adjtime file is the next biggest source of delay and
+  uncertainty.
+
+  The user wants to know what time it was at the moment he invoked us,
+  not some arbitrary time later.  And in setting the clock, he is
+  giving us the time at the moment we are invoked, so if we set the
+  clock some time later, we have to add some time to that.
+
+  So we check the system time as soon as we start up, then run "date"
+  and do file I/O if necessary, then wait to synchronize with a
+  Hardware Clock edge, then check the system time again to see how
+  much time we spent.  We immediately read the clock then and (if
+  appropriate) report that time, and additionally, the delay we measured.
+
+  If we're setting the clock to a time given by the user, we wait some
+  more so that the total delay is an integral number of seconds, then
+  set the Hardware Clock to the time the user requested plus that
+  integral number of seconds.  N.B. The Hardware Clock can only be set
+  in integral seconds.
+
+  If we're setting the clock to the system clock value, we wait for
+  the system clock to reach the top of a second, and then set the
+  Hardware Clock to the system clock's value.
+
+  Here's an interesting point about setting the Hardware Clock:  On my
+  machine, when you set it, it sets to that precise time.  But one can
+  imagine another clock whose update oscillator marches on a steady one
+  second period, so updating the clock between any two oscillator ticks
+  is the same as updating it right at the earlier tick.  To avoid any
+  complications that might cause, we set the clock as soon as possible
+  after an oscillator tick.
+
+
+  About synchronizing to the Hardware Clock when reading the time: The
+  precision of the Hardware Clock counters themselves is one second.
+  You can't read the counters and find out that is 12:01:02.5.  But if
+  you consider the location in time of the counter's ticks as part of
+  its value, then its precision is as infinite as time is continuous!
+  What I'm saying is this: To find out the _exact_ time in the
+  hardware clock, we wait until the next clock tick (the next time the
+  second counter changes) and measure how long we had to wait.  We
+  then read the value of the clock counters and subtract the wait time
+  and we know precisely what time it was when we set out to query the
+  time.
+
+  hwclock uses this method, and considers the Hardware Clock to have
+  infinite precision.
+
+
+  Enhancements needed:
+
+   - When waiting for whole second boundary in set_hardware_clock_exact,
+     fail if we miss the goal by more than .1 second, as could happen if
+     we get pre-empted (by the kernel dispatcher).
+
+****************************************************************************/
+
diff --git a/util-linux-ng-2.17.2/hwclock/kd.c b/util-linux-ng-2.17.2/hwclock/kd.c
new file mode 100644
index 0000000..3da87ca
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/kd.c
@@ -0,0 +1,186 @@
+/* kd.c - KDGHWCLK stuff, possibly m68k only - deprecated */
+
+#include "clock.h"
+
+#ifndef __m68k__
+
+struct clock_ops *
+probe_for_kd_clock() {
+	return NULL;
+}
+
+#else /* __m68k__ */
+
+#include <unistd.h>		/* for close() */
+#include <fcntl.h>		/* for O_RDONLY */
+#include <sysexits.h>
+#include <sys/ioctl.h>
+
+#include "nls.h"
+#include "usleep.h"
+
+static int con_fd = -1;		/* opened by probe_for_kd_clock() */
+				/* never closed */
+static char *con_fd_filename;	/* usually "/dev/tty1" */
+
+/* Get defines for KDGHWCLK and KDSHWCLK (m68k) */
+#include <linux/kd.h>
+#ifndef KDGHWCLK
+#define KDGHWCLK        0x4B50     /* get hardware clock */
+#define KDSHWCLK        0x4B51     /* set hardware clock */
+struct hwclk_time {
+        unsigned        sec;    /* 0..59 */
+        unsigned        min;    /* 0..59 */
+        unsigned        hour;   /* 0..23 */
+        unsigned        day;    /* 1..31 */
+        unsigned        mon;    /* 0..11 */
+        unsigned        year;   /* 70... */
+        int             wday;   /* 0..6, 0 is Sunday, -1 means unknown/don't set */
+};
+#endif
+
+static int
+synchronize_to_clock_tick_kd(void) {
+/*----------------------------------------------------------------------------
+   Wait for the top of a clock tick by calling KDGHWCLK in a busy loop until
+   we see it.
+-----------------------------------------------------------------------------*/
+
+  /* The time when we were called (and started waiting) */
+  struct hwclk_time start_time, nowtime;
+  struct timeval begin, now;
+
+  if (debug)
+    printf(_("Waiting in loop for time from KDGHWCLK to change\n"));
+
+  if (ioctl(con_fd, KDGHWCLK, &start_time) == -1) {
+    outsyserr(_("KDGHWCLK ioctl to read time failed"));
+    return 3;
+  }
+
+  /* Wait for change.  Should be within a second, but in case something
+   * weird happens, we have a time limit (1.5s) on this loop to reduce the
+   * impact of this failure.
+   */
+  gettimeofday(&begin, NULL);
+  do {
+    /* Added by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
+     * "The culprit is the fast loop with KDGHWCLK ioctls. It seems
+     *  the kernel gets confused by those on Amigas with A2000 RTCs
+     *  and simply hangs after some time. Inserting a sleep helps."
+     */
+    usleep(1);
+
+    if (ioctl(con_fd, KDGHWCLK, &nowtime) == -1) {
+      outsyserr(_("KDGHWCLK ioctl to read time failed in loop"));
+      return 3;
+    }
+    if (start_time.tm_sec != nowtime.tm_sec)
+      break;
+    gettimeofday(&now, NULL);
+    if (time_diff(now, begin) > 1.5) {
+      fprintf(stderr, _("Timed out waiting for time change.\n"));
+      return 2;
+    }
+  } while(1);
+
+  return 0;
+}
+
+
+static int
+read_hardware_clock_kd(struct tm *tm) {
+/*----------------------------------------------------------------------------
+  Read the hardware clock and return the current time via <tm>
+  argument.  Use ioctls to /dev/tty1 on what we assume is an m68k
+  machine.
+
+  Note that we don't use /dev/console here.  That might be a serial
+  console.
+-----------------------------------------------------------------------------*/
+  struct hwclk_time t;
+
+  if (ioctl(con_fd, KDGHWCLK, &t) == -1) {
+    outsyserr(_("ioctl() failed to read time from %s"), con_fd_filename);
+    hwclock_exit(EX_IOERR);
+  }
+
+  tm->tm_sec  = t.sec;
+  tm->tm_min  = t.min;
+  tm->tm_hour = t.hour;
+  tm->tm_mday = t.day;
+  tm->tm_mon  = t.mon;
+  tm->tm_year = t.year;
+  tm->tm_wday = t.wday;
+  tm->tm_isdst = -1;     /* Don't know if it's Daylight Savings Time */
+
+  return 0;
+}
+
+
+static int
+set_hardware_clock_kd(const struct tm *new_broken_time) {
+/*----------------------------------------------------------------------------
+  Set the Hardware Clock to the time <new_broken_time>.  Use ioctls to
+  /dev/tty1 on what we assume is an m68k machine.
+
+  Note that we don't use /dev/console here.  That might be a serial console.
+----------------------------------------------------------------------------*/
+  struct hwclk_time t;
+
+  t.sec  = new_broken_time->tm_sec;
+  t.min  = new_broken_time->tm_min;
+  t.hour = new_broken_time->tm_hour;
+  t.day  = new_broken_time->tm_mday;
+  t.mon  = new_broken_time->tm_mon;
+  t.year = new_broken_time->tm_year;
+  t.wday = new_broken_time->tm_wday;
+
+  if (ioctl(con_fd, KDSHWCLK, &t ) == -1) {
+    outsyserr(_("ioctl KDSHWCLK failed"));
+    hwclock_exit(1);
+  }
+  return 0;
+}
+
+static int
+get_permissions_kd(void) {
+  return 0;
+}
+
+static struct clock_ops kd = {
+	"KDGHWCLK interface to m68k clock",
+	get_permissions_kd,
+	read_hardware_clock_kd,
+	set_hardware_clock_kd,
+	synchronize_to_clock_tick_kd,
+};
+
+/* return &kd if KDGHWCLK works, NULL otherwise */
+struct clock_ops *
+probe_for_kd_clock() {
+	struct clock_ops *ret = NULL;
+	struct hwclk_time t;
+
+	if (con_fd < 0) {	/* first time here */
+		con_fd_filename = "/dev/tty1";
+		con_fd = open(con_fd_filename, O_RDONLY);
+	}
+	if (con_fd < 0) {
+		/* perhaps they are using devfs? */
+		con_fd_filename = "/dev/vc/1";
+		con_fd = open(con_fd_filename, O_RDONLY);
+	}
+	if (con_fd < 0) {
+		/* probably KDGHWCLK exists on m68k only */
+		outsyserr(_("Can't open /dev/tty1 or /dev/vc/1"));
+	} else {
+		if (ioctl(con_fd, KDGHWCLK, &t) == -1) {
+			if (errno != EINVAL)
+				outsyserr(_("KDGHWCLK ioctl failed"));
+		} else
+			ret = &kd;
+	}
+	return ret;
+}
+#endif /* __m68k__ */
diff --git a/util-linux-ng-2.17.2/hwclock/rtc.c b/util-linux-ng-2.17.2/hwclock/rtc.c
new file mode 100644
index 0000000..2e05385
--- /dev/null
+++ b/util-linux-ng-2.17.2/hwclock/rtc.c
@@ -0,0 +1,477 @@
+/* rtc.c - Use /dev/rtc for clock access */
+#include <unistd.h>		/* for close() */
+#include <fcntl.h>		/* for O_RDONLY */
+#include <errno.h>
+#include <sysexits.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>		/* for struct timeval */
+
+#include "clock.h"
+#include "nls.h"
+
+/*
+ * Get defines for rtc stuff.
+ *
+ * Getting the rtc defines is nontrivial.
+ * The obvious way is by including <linux/mc146818rtc.h>
+ * but that again includes <asm/io.h> which again includes ...
+ * and on sparc and alpha this gives compilation errors for
+ * many kernel versions. So, we give the defines ourselves here.
+ * Moreover, some Sparc person decided to be incompatible, and
+ * used a struct rtc_time different from that used in mc146818rtc.h.
+ */
+
+/* On Sparcs, there is a <asm/rtc.h> that defines different ioctls
+   (that are required on my machine). However, this include file
+   does not exist on other architectures. */
+/* One might do:
+#ifdef __sparc__
+#include <asm/rtc.h>
+#endif
+ */
+/* The following is roughly equivalent */
+struct sparc_rtc_time
+{
+        int     sec;    /* Seconds (0-59) */
+        int     min;    /* Minutes (0-59) */
+        int     hour;   /* Hour (0-23) */
+        int     dow;    /* Day of the week (1-7) */
+        int     dom;    /* Day of the month (1-31) */
+        int     month;  /* Month of year (1-12) */
+        int     year;   /* Year (0-99) */
+};
+
+#define RTCGET _IOR('p', 20, struct sparc_rtc_time)
+#define RTCSET _IOW('p', 21, struct sparc_rtc_time)
+
+
+/* non-sparc stuff */
+#if 0
+#include <linux/version.h>
+/* Check if the /dev/rtc interface is available in this version of
+   the system headers.  131072 is linux 2.0.0. */
+#if LINUX_VERSION_CODE >= 131072
+#include <linux/mc146818rtc.h>
+#endif
+#endif
+
+/* struct rtc_time is present since 1.3.99 */
+/* Earlier (since 1.3.89), a struct tm was used. */
+struct linux_rtc_time {
+        int tm_sec;
+        int tm_min;
+        int tm_hour;
+        int tm_mday;
+        int tm_mon;
+        int tm_year;
+        int tm_wday;
+        int tm_yday;
+        int tm_isdst;
+};
+
+/* RTC_RD_TIME etc have this definition since 1.99.9 (pre2.0-9) */
+#ifndef RTC_RD_TIME
+#define RTC_RD_TIME       _IOR('p', 0x09, struct linux_rtc_time)
+#define RTC_SET_TIME      _IOW('p', 0x0a, struct linux_rtc_time)
+#define RTC_UIE_ON        _IO('p', 0x03)	/* Update int. enable on */
+#define RTC_UIE_OFF       _IO('p', 0x04)	/* Update int. enable off */
+#endif
+/* RTC_EPOCH_READ and RTC_EPOCH_SET are present since 2.0.34 and 2.1.89 */
+#ifndef RTC_EPOCH_READ
+#define RTC_EPOCH_READ	_IOR('p', 0x0d, unsigned long)	 /* Read epoch */
+#define RTC_EPOCH_SET	_IOW('p', 0x0e, unsigned long)	 /* Set epoch */
+#endif
+
+/* /dev/rtc is conventionally chardev 10/135
+ * ia64 uses /dev/efirtc, chardev 10/136
+ * devfs (obsolete) used /dev/misc/... for miscdev
+ * new RTC framework + udev uses dynamic major and /dev/rtc0.../dev/rtcN
+ * ... so we need an overridable default
+ */
+
+/* default or user defined dev (by hwclock --rtc=<path>) */
+char *rtc_dev_name;
+
+static int rtc_dev_fd = -1;
+
+static void
+close_rtc(void) {
+	if (rtc_dev_fd != -1)
+		close(rtc_dev_fd);
+	rtc_dev_fd = -1;
+}
+
+static int
+open_rtc(void) {
+	char *fls[] = {
+#ifdef __ia64__
+		"/dev/efirtc",
+		"/dev/misc/efirtc",
+#endif
+		"/dev/rtc",
+		"/dev/rtc0",
+		"/dev/misc/rtc",
+		NULL
+	};
+	char **p;
+
+	if (rtc_dev_fd != -1)
+		return rtc_dev_fd;
+
+	/* --rtc option has been given */
+	if (rtc_dev_name)
+		rtc_dev_fd = open(rtc_dev_name, O_RDONLY);
+	else {
+		for (p=fls; *p; ++p) {
+			rtc_dev_fd = open(*p, O_RDONLY);
+
+			if (rtc_dev_fd < 0 && (errno == ENOENT || errno == ENODEV))
+				continue;
+			rtc_dev_name = *p;
+			break;
+		}
+		if (rtc_dev_fd < 0)
+			rtc_dev_name = *fls;	/* default for error messages */
+	}
+
+	if (rtc_dev_fd != 1)
+		atexit(close_rtc);
+	return rtc_dev_fd;
+}
+
+static int
+open_rtc_or_exit(void) {
+	int rtc_fd = open_rtc();
+
+	if (rtc_fd < 0) {
+		outsyserr(_("open() of %s failed"), rtc_dev_name);
+		hwclock_exit(EX_OSFILE);
+	}
+	return rtc_fd;
+}
+
+static int
+do_rtc_read_ioctl(int rtc_fd, struct tm *tm) {
+	int rc = -1;
+	char *ioctlname;
+
+#ifdef __sparc__
+	/* some but not all sparcs use a different ioctl and struct */
+	struct sparc_rtc_time stm;
+
+	ioctlname = "RTCGET";
+	rc = ioctl(rtc_fd, RTCGET, &stm);
+	if (rc == 0) {
+		tm->tm_sec = stm.sec;
+		tm->tm_min = stm.min;
+		tm->tm_hour = stm.hour;
+		tm->tm_mday = stm.dom;
+		tm->tm_mon = stm.month - 1;
+		tm->tm_year = stm.year - 1900;
+		tm->tm_wday = stm.dow - 1;
+		tm->tm_yday = -1;		/* day in the year */
+	}
+#endif
+	if (rc == -1) {		/* no sparc, or RTCGET failed */
+		ioctlname = "RTC_RD_TIME";
+		rc = ioctl(rtc_fd, RTC_RD_TIME, tm);
+	}
+	if (rc == -1) {
+		perror(ioctlname);
+		fprintf(stderr, _("ioctl() to %s to read the time failed.\n"),
+			rtc_dev_name);
+		return -1;
+	}
+
+	tm->tm_isdst = -1;          /* don't know whether it's dst */
+	return 0;
+}
+
+static int
+busywait_for_rtc_clock_tick(const int rtc_fd) {
+/*----------------------------------------------------------------------------
+   Wait for the top of a clock tick by reading /dev/rtc in a busy loop until
+   we see it.
+-----------------------------------------------------------------------------*/
+  struct tm start_time;
+    /* The time when we were called (and started waiting) */
+  struct tm nowtime;
+  int rc;
+  struct timeval begin, now;
+
+  if (debug)
+    printf(_("Waiting in loop for time from %s to change\n"),
+	   rtc_dev_name);
+
+  rc = do_rtc_read_ioctl(rtc_fd, &start_time);
+  if (rc)
+    return 1;
+
+  /* Wait for change.  Should be within a second, but in case something
+   * weird happens, we have a time limit (1.5s) on this loop to reduce the
+   * impact of this failure.
+   */
+  gettimeofday(&begin, NULL);
+  do {
+    rc = do_rtc_read_ioctl(rtc_fd, &nowtime);
+    if (rc || start_time.tm_sec != nowtime.tm_sec)
+      break;
+    gettimeofday(&now, NULL);
+    if (time_diff(now, begin) > 1.5) {
+      fprintf(stderr, _("Timed out waiting for time change.\n"));
+      return 2;
+    }
+  } while(1);
+
+  if (rc)
+    return 3;
+  return 0;
+}
+
+static int
+synchronize_to_clock_tick_rtc(void) {
+/*----------------------------------------------------------------------------
+  Same as synchronize_to_clock_tick(), but just for /dev/rtc.
+-----------------------------------------------------------------------------*/
+int rtc_fd;  /* File descriptor of /dev/rtc */
+int ret;
+
+  rtc_fd = open_rtc();
+  if (rtc_fd == -1) {
+    outsyserr(_("open() of %s failed"), rtc_dev_name);
+    ret = 1;
+  } else {
+    int rc;  /* Return code from ioctl */
+    /* Turn on update interrupts (one per second) */
+#if defined(__alpha__) || defined(__sparc__)
+    /* Not all alpha kernels reject RTC_UIE_ON, but probably they should. */
+    rc = -1;
+    errno = EINVAL;
+#else
+    rc = ioctl(rtc_fd, RTC_UIE_ON, 0);
+#endif
+    if (rc == -1 && (errno == ENOTTY || errno == EINVAL)) {
+      /* This rtc device doesn't have interrupt functions.  This is typical
+         on an Alpha, where the Hardware Clock interrupts are used by the
+         kernel for the system clock, so aren't at the user's disposal.
+         */
+      if (debug)
+	      printf(_("%s does not have interrupt functions. "),
+		     rtc_dev_name);
+      ret = busywait_for_rtc_clock_tick(rtc_fd);
+    } else if (rc == 0) {
+#ifdef Wait_until_update_interrupt
+      unsigned long dummy;
+
+      /* this blocks until the next update interrupt */
+      rc = read(rtc_fd, &dummy, sizeof(dummy));
+      ret = 1;
+      if (rc == -1)
+        outsyserr(_("read() to %s to wait for clock tick failed"),
+		  rtc_dev_name);
+      else
+        ret = 0;
+#else
+      /* Just reading rtc_fd fails on broken hardware: no update
+	 interrupt comes and a bootscript with a hwclock call hangs */
+      fd_set rfds;
+      struct timeval tv;
+
+      /* Wait up to five seconds for the next update interrupt */
+      FD_ZERO(&rfds);
+      FD_SET(rtc_fd, &rfds);
+      tv.tv_sec = 5;
+      tv.tv_usec = 0;
+      rc = select(rtc_fd + 1, &rfds, NULL, NULL, &tv);
+      ret = 1;
+      if (rc == -1)
+        outsyserr(_("select() to %s to wait for clock tick failed"),
+		  rtc_dev_name);
+      else if (rc == 0)
+	fprintf(stderr, _("select() to %s to wait for clock tick timed out\n"),
+			  rtc_dev_name);
+      else
+        ret = 0;
+#endif
+
+      /* Turn off update interrupts */
+      rc = ioctl(rtc_fd, RTC_UIE_OFF, 0);
+      if (rc == -1)
+        outsyserr(_("ioctl() to %s to turn off update interrupts failed"),
+		  rtc_dev_name);
+    } else {
+      outsyserr(_("ioctl() to %s to turn on update interrupts "
+		"failed unexpectedly"), rtc_dev_name);
+      ret = 1;
+    }
+  }
+  return ret;
+}
+
+
+static int
+read_hardware_clock_rtc(struct tm *tm) {
+	int rtc_fd, rc;
+
+	rtc_fd = open_rtc_or_exit();
+
+	/* Read the RTC time/date, return answer via tm */
+	rc = do_rtc_read_ioctl(rtc_fd, tm);
+
+	return rc;
+}
+
+
+static int
+set_hardware_clock_rtc(const struct tm *new_broken_time) {
+/*-------------------------------------------------------------------------
+  Set the Hardware Clock to the broken down time <new_broken_time>.
+  Use ioctls to "rtc" device /dev/rtc.
+  -------------------------------------------------------------------------*/
+	int rc = -1;
+	int rtc_fd;
+	char *ioctlname;
+
+	rtc_fd = open_rtc_or_exit();
+
+#ifdef __sparc__
+	{
+		struct sparc_rtc_time stm;
+
+		stm.sec = new_broken_time->tm_sec;
+		stm.min = new_broken_time->tm_min;
+		stm.hour = new_broken_time->tm_hour;
+		stm.dom = new_broken_time->tm_mday;
+		stm.month = new_broken_time->tm_mon + 1;
+		stm.year = new_broken_time->tm_year + 1900;
+		stm.dow = new_broken_time->tm_wday + 1;
+
+		ioctlname = "RTCSET";
+		rc = ioctl(rtc_fd, RTCSET, &stm);
+	}
+#endif
+	if (rc == -1) {		/* no sparc, or RTCSET failed */
+		ioctlname = "RTC_SET_TIME";
+		rc = ioctl(rtc_fd, RTC_SET_TIME, new_broken_time);
+	}
+
+	if (rc == -1) {
+		perror(ioctlname);
+		fprintf(stderr, _("ioctl() to %s to set the time failed.\n"),
+			rtc_dev_name);
+		hwclock_exit(EX_IOERR);
+	}
+
+	if (debug)
+		printf(_("ioctl(%s) was successful.\n"), ioctlname);
+
+	return 0;
+}
+
+
+static int
+get_permissions_rtc(void) {
+	return 0;
+}
+
+static struct clock_ops rtc = {
+	"/dev interface to clock",
+	get_permissions_rtc,
+	read_hardware_clock_rtc,
+	set_hardware_clock_rtc,
+	synchronize_to_clock_tick_rtc,
+};
+
+/* return &rtc if /dev/rtc can be opened, NULL otherwise */
+struct clock_ops *
+probe_for_rtc_clock(){
+	int rtc_fd = open_rtc();
+	if (rtc_fd >= 0)
+		return &rtc;
+	if (debug)
+		outsyserr(_("Open of %s failed"), rtc_dev_name);
+	return NULL;
+}
+
+
+
+int
+get_epoch_rtc(unsigned long *epoch_p, int silent) {
+/*----------------------------------------------------------------------------
+  Get the Hardware Clock epoch setting from the kernel.
+----------------------------------------------------------------------------*/
+  int rtc_fd;
+
+  rtc_fd = open_rtc();
+  if (rtc_fd < 0) {
+    if (!silent) {
+      if (errno == ENOENT)
+        fprintf(stderr, _(
+		"To manipulate the epoch value in the kernel, we must "
+                "access the Linux 'rtc' device driver via the device special "
+                "file %s.  This file does not exist on this system.\n"),
+		rtc_dev_name);
+      else
+        outsyserr(_("Unable to open %s"), rtc_dev_name);
+    }
+    return 1;
+  }
+
+  if (ioctl(rtc_fd, RTC_EPOCH_READ, epoch_p) == -1) {
+    if (!silent)
+      outsyserr(_("ioctl(RTC_EPOCH_READ) to %s failed"), rtc_dev_name);
+    return 1;
+  }
+
+  if (debug)
+	  printf(_("we have read epoch %ld from %s "
+		 "with RTC_EPOCH_READ ioctl.\n"), *epoch_p, rtc_dev_name);
+
+  return 0;
+}
+
+
+
+int
+set_epoch_rtc(unsigned long epoch) {
+/*----------------------------------------------------------------------------
+  Set the Hardware Clock epoch in the kernel.
+----------------------------------------------------------------------------*/
+  int rtc_fd;
+
+  if (epoch < 1900) {
+    /* kernel would not accept this epoch value */
+    /* Hmm - bad habit, deciding not to do what the user asks
+       just because one believes that the kernel might not like it. */
+    fprintf(stderr, _("The epoch value may not be less than 1900.  "
+            "You requested %ld\n"), epoch);
+    return 1;
+  }
+
+  rtc_fd = open_rtc();
+  if (rtc_fd < 0) {
+    if (errno == ENOENT)
+      fprintf(stderr, _("To manipulate the epoch value in the kernel, we must "
+              "access the Linux 'rtc' device driver via the device special "
+              "file %s.  This file does not exist on this system.\n"),
+	      rtc_dev_name);
+    else
+      outsyserr(_("Unable to open %s"), rtc_dev_name);
+    return 1;
+  }
+
+  if (debug)
+    printf(_("setting epoch to %ld "
+	   "with RTC_EPOCH_SET ioctl to %s.\n"), epoch, rtc_dev_name);
+
+  if (ioctl(rtc_fd, RTC_EPOCH_SET, epoch) == -1) {
+    if (errno == EINVAL)
+      fprintf(stderr, _("The kernel device driver for %s "
+	      "does not have the RTC_EPOCH_SET ioctl.\n"), rtc_dev_name);
+    else
+      outsyserr(_("ioctl(RTC_EPOCH_SET) to %s failed"), rtc_dev_name);
+    return 1;
+  }
+
+  return 0;
+}
diff --git a/util-linux-ng-2.17.2/include/Makefile.am b/util-linux-ng-2.17.2/include/Makefile.am
new file mode 100644
index 0000000..525e3d2
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/Makefile.am
@@ -0,0 +1,23 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+dist_noinst_HEADERS = \
+	c.h \
+	bitops.h \
+	blkdev.h \
+	canonicalize.h \
+	carefulputc.h \
+	env.h \
+	fsprobe.h \
+	ismounted.h \
+	linux_reboot.h \
+	linux_version.h \
+	md5.h \
+	nls.h \
+	pathnames.h \
+	setproctitle.h \
+	swapheader.h \
+	usleep.h \
+	wholedisk.h \
+	widechar.h \
+	crc32.h \
+	xstrncpy.h
diff --git a/util-linux-ng-2.17.2/include/Makefile.in b/util-linux-ng-2.17.2/include/Makefile.in
new file mode 100644
index 0000000..a66c5f3
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/Makefile.in
@@ -0,0 +1,507 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(dist_noinst_DATA) $(dist_noinst_HEADERS) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config/include-Makefile.am
+subdir = include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+DATA = $(dist_noinst_DATA)
+HEADERS = $(dist_noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+dist_noinst_HEADERS = \
+	c.h \
+	bitops.h \
+	blkdev.h \
+	canonicalize.h \
+	carefulputc.h \
+	env.h \
+	fsprobe.h \
+	ismounted.h \
+	linux_reboot.h \
+	linux_version.h \
+	md5.h \
+	nls.h \
+	pathnames.h \
+	setproctitle.h \
+	swapheader.h \
+	usleep.h \
+	wholedisk.h \
+	widechar.h \
+	crc32.h \
+	xstrncpy.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign include/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
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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) $(HEADERS)
+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:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool ctags distclean distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/include/bitops.h b/util-linux-ng-2.17.2/include/bitops.h
new file mode 100644
index 0000000..e283b83
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/bitops.h
@@ -0,0 +1,89 @@
+#ifndef BITOPS_H
+#define BITOPS_H
+
+#include <stdint.h>
+#include <endian.h>
+
+/*
+ * Bit map related macros. Usually provided by libc.
+ */
+#include <sys/param.h>
+
+#ifndef NBBY
+# define NBBY            CHAR_BIT
+#endif
+
+#ifndef setbit
+# define setbit(a,i)	((a)[(i)/NBBY] |= 1<<((i)%NBBY))
+# define clrbit(a,i)	((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+# define isset(a,i)	((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+# define isclr(a,i)	(((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+#endif
+
+#if !defined __BYTE_ORDER || !(__BYTE_ORDER == __LITTLE_ENDIAN) && !(__BYTE_ORDER == __BIG_ENDIAN)
+#error missing __BYTE_ORDER
+#endif
+
+/*
+ * Byte swab macros (based on linux/byteorder/swab.h)
+ */
+#define swab16(x) \
+	((uint16_t)( \
+		(((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
+		(((uint16_t)(x) & (uint16_t)0xff00U) >> 8) ))
+
+#define swab32(x) \
+	((uint32_t)( \
+		(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
+		(((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) | \
+		(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) | \
+		(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) ))
+
+#define swab64(x) \
+	((uint64_t)( \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) <<  8) | \
+	        (uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >>  8) | \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+		(uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) ))
+
+
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+
+#define cpu_to_le16(x) swab16(x)
+#define cpu_to_le32(x) swab32(x)
+#define cpu_to_le64(x) swab64(x)
+#define cpu_to_be16(x) (x)
+#define cpu_to_be32(x) (x)
+#define cpu_to_be64(x) (x)
+
+#define le16_to_cpu(x) swab16(x)
+#define le32_to_cpu(x) swab32(x)
+#define le64_to_cpu(x) swab64(x)
+#define be16_to_cpu(x) (x)
+#define be32_to_cpu(x) (x)
+#define be64_to_cpu(x) (x)
+
+#else /* __BYTE_ORDER != __BIG_ENDIAN */
+
+#define cpu_to_le16(x) (x)
+#define cpu_to_le32(x) (x)
+#define cpu_to_le64(x) (x)
+#define cpu_to_be16(x) swab16(x)
+#define cpu_to_be32(x) swab32(x)
+#define cpu_to_be64(x) swab64(x)
+
+#define le16_to_cpu(x) (x)
+#define le32_to_cpu(x) (x)
+#define le64_to_cpu(x) (x)
+#define be16_to_cpu(x) swab16(x)
+#define be32_to_cpu(x) swab32(x)
+#define be64_to_cpu(x) swab64(x)
+
+#endif /* __BYTE_ORDER */
+
+#endif /* BITOPS_H */
+
diff --git a/util-linux-ng-2.17.2/include/blkdev.h b/util-linux-ng-2.17.2/include/blkdev.h
new file mode 100644
index 0000000..56a9c1f
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/blkdev.h
@@ -0,0 +1,71 @@
+#ifndef BLKDEV_H
+#define BLKDEV_H
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define DEFAULT_SECTOR_SIZE       512
+
+/* open() retries when errno is ENOMEDIUM */
+#define CRDOM_NOMEDIUM_RETRIES    5
+
+#if !defined(BLKROSET) && defined(__linux__)
+
+#define BLKROSET   _IO(0x12,93)	/* set device read-only (0 = read-write) */
+#define BLKROGET   _IO(0x12,94)	/* get read-only status (0 = read_write) */
+#define BLKRRPART  _IO(0x12,95)	/* re-read partition table */
+#define BLKGETSIZE _IO(0x12,96)	/* return device size /512 (long *arg) */
+#define BLKFLSBUF  _IO(0x12,97)	/* flush buffer cache */
+#define BLKRASET   _IO(0x12,98)	/* set read ahead for block device */
+#define BLKRAGET   _IO(0x12,99)	/* get current read ahead setting */
+#define BLKFRASET  _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
+#define BLKFRAGET  _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
+#define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
+#define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
+#define BLKSSZGET  _IO(0x12,104)/* get block device sector size */
+
+/* ioctls introduced in 2.2.16, removed in 2.5.58 */
+#define BLKELVGET  _IOR(0x12,106,size_t) /* elevator get */
+#define BLKELVSET  _IOW(0x12,107,size_t) /* elevator set */
+
+#define BLKBSZGET  _IOR(0x12,112,size_t)
+#define BLKBSZSET  _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
+
+#endif /* BLKROSET */
+
+/* block device topology ioctls, introduced in 2.6.32 */
+#ifndef BLKIOMIN
+#define BLKIOMIN   _IO(0x12,120)
+#define BLKIOOPT   _IO(0x12,121)
+#define BLKALIGNOFF _IO(0x12,122)
+#define BLKPBSZGET _IO(0x12,123)
+#endif
+
+#ifndef HDIO_GETGEO
+# ifdef __linux__
+#  define HDIO_GETGEO 0x0301
+# endif
+struct hd_geometry {
+	unsigned char heads;
+	unsigned char sectors;
+	unsigned short cylinders;	/* truncated */
+	unsigned long start;
+};
+#endif
+
+/* Determine size in bytes */
+off_t blkdev_find_size (int fd);
+
+/* get size in bytes */
+int blkdev_get_size(int fd, unsigned long long *bytes);
+
+/* get 512-byte sector count */
+int blkdev_get_sectors(int fd, unsigned long long *sectors);
+
+/* get hardware sector size */
+int blkdev_get_sector_size(int fd, int *sector_size);
+
+#endif /* BLKDEV_H */
diff --git a/util-linux-ng-2.17.2/include/c.h b/util-linux-ng-2.17.2/include/c.h
new file mode 100644
index 0000000..577b8a8
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/c.h
@@ -0,0 +1,65 @@
+/*
+ * Fundamental C definitions.
+ */
+
+#ifndef UTIL_LINUX_C_H
+#define UTIL_LINUX_C_H
+
+#include <limits.h>
+
+/*
+ * Compiler specific stuff
+ */
+#ifdef __GNUC__
+
+/* &a[0] degrades to a pointer: a different type from an array */
+# define __must_be_array(a) \
+	BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
+
+#else /* !__GNUC__ */
+# define __must_be_array(a)	0
+# define __attribute__(_arg_)
+#endif /* !__GNUC__ */
+
+
+/* Force a compilation error if condition is true, but also produce a
+ * result (of value 0 and type size_t), so the expression can be used
+ * e.g. in a structure initializer (or where-ever else comma expressions
+ * aren't permitted).
+ */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
+
+#ifndef ARRAY_SIZE
+# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX 4096
+#endif
+
+#ifndef TRUE
+# define TRUE 1
+#endif
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+#ifndef min
+# define min(x, y) ({				\
+	typeof(x) _min1 = (x);			\
+	typeof(y) _min2 = (y);			\
+	(void) (&_min1 == &_min2);		\
+	_min1 < _min2 ? _min1 : _min2; })
+#endif
+
+#ifndef max
+# define max(x, y) ({				\
+	typeof(x) _max1 = (x);			\
+	typeof(y) _max2 = (y);			\
+	(void) (&_max1 == &_max2);		\
+	_max1 > _max2 ? _max1 : _max2; })
+#endif
+
+#endif /* UTIL_LINUX_C_H */
diff --git a/util-linux-ng-2.17.2/include/canonicalize.h b/util-linux-ng-2.17.2/include/canonicalize.h
new file mode 100644
index 0000000..f26df18
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/canonicalize.h
@@ -0,0 +1,9 @@
+#ifndef CANONICALIZE_H
+#define CANONICALIZE_H
+
+#include "c.h"	/* for PATH_MAX */
+
+extern char *canonicalize_path(const char *path);
+extern char *canonicalize_dm_name(const char *ptname);
+
+#endif /* CANONICALIZE_H */
diff --git a/util-linux-ng-2.17.2/include/carefulputc.h b/util-linux-ng-2.17.2/include/carefulputc.h
new file mode 100644
index 0000000..2d857eb
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/carefulputc.h
@@ -0,0 +1,29 @@
+#ifndef _CAREFUULPUTC_H
+#define _CAREFUULPUTC_H
+
+/* putc() for use in write and wall (that sometimes are sgid tty) */
+/* Avoid control characters in our locale, and also ASCII control characters.
+   Note that the locale of the recipient is unknown. */
+#include <stdio.h>
+#include <ctype.h>
+
+#define iso8859x_iscntrl(c) \
+	(((c) & 0x7f) < 0x20 || (c) == 0x7f)
+
+static inline int carefulputc(int c, FILE *fp) {
+	int ret;
+
+	if (c == '\007' || c == '\t' || c == '\r' || c == '\n' ||
+	    (!iso8859x_iscntrl(c) && (isprint(c) || isspace(c))))
+		ret = putc(c, fp);
+	else if ((c & 0x80) || !isprint(c^0x40))
+		ret = fprintf(fp, "\\%3o", (unsigned char) c);
+	else {
+		ret = putc('^', fp);
+		if (ret != EOF)
+			ret = putc(c^0x40, fp);
+	}
+	return (ret < 0) ? EOF : 0;
+}
+
+#endif  /*  _CAREFUULPUTC_H  */
diff --git a/util-linux-ng-2.17.2/include/crc32.h b/util-linux-ng-2.17.2/include/crc32.h
new file mode 100644
index 0000000..b454be9
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/crc32.h
@@ -0,0 +1,9 @@
+#ifndef UL_NG_CRC32_H
+#define UL_NG_CRC32_H
+
+#include <stdint.h>
+
+extern uint32_t crc32(uint32_t seed, const unsigned char *buf, size_t len);
+
+#endif
+
diff --git a/util-linux-ng-2.17.2/include/env.h b/util-linux-ng-2.17.2/include/env.h
new file mode 100644
index 0000000..d69b4f2
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/env.h
@@ -0,0 +1,2 @@
+extern void sanitize_env (void);
+
diff --git a/util-linux-ng-2.17.2/include/fsprobe.h b/util-linux-ng-2.17.2/include/fsprobe.h
new file mode 100644
index 0000000..307eb64
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/fsprobe.h
@@ -0,0 +1,24 @@
+#ifndef FSPROBE_H
+#define FSPROBE_H
+/*
+ * This is the generic interface for filesystem guessing libraries.
+ * Implementations are provided by
+ */
+extern void fsprobe_init(void);
+extern void fsprobe_exit(void);
+
+extern int fsprobe_parse_spec(const char *spec, char **name, char **value);
+
+/* all routines return newly allocated string */
+extern char *fsprobe_get_devname_by_uuid(const char *uuid);
+extern char *fsprobe_get_devname_by_label(const char *label);
+extern char *fsprobe_get_devname_by_spec(const char *spec);
+
+extern char *fsprobe_get_label_by_devname(const char *devname);
+extern char *fsprobe_get_uuid_by_devname(const char *devname);
+extern char *fsprobe_get_fstype_by_devname(const char *devname);
+
+
+extern int fsprobe_known_fstype(const char *fstype);
+
+#endif /* FSPROBE_H */
diff --git a/util-linux-ng-2.17.2/include/ismounted.h b/util-linux-ng-2.17.2/include/ismounted.h
new file mode 100644
index 0000000..57918cb
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/ismounted.h
@@ -0,0 +1,14 @@
+#ifndef IS_MOUNTED_H
+#define IS_MOUNTED_H
+
+#define MF_MOUNTED	1
+#define MF_ISROOT	2
+#define MF_READONLY	4
+#define MF_SWAP		8
+#define MF_BUSY		16
+
+extern int is_mounted(const char *file);
+extern int check_mount_point(const char *device, int *mount_flags,
+				 char *mtpt, int mtlen);
+
+#endif /* IS_MOUNTED_H */
diff --git a/util-linux-ng-2.17.2/include/linux_reboot.h b/util-linux-ng-2.17.2/include/linux_reboot.h
new file mode 100644
index 0000000..9cebc67
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/linux_reboot.h
@@ -0,0 +1,72 @@
+#ifndef _LINUX_REBOOT_H
+#define _LINUX_REBOOT_H
+
+/*
+ * Magic values required to use _reboot() system call.
+ */
+
+#define	LINUX_REBOOT_MAGIC1	0xfee1dead
+#define	LINUX_REBOOT_MAGIC2	672274793
+#define	LINUX_REBOOT_MAGIC2A	85072278
+#define	LINUX_REBOOT_MAGIC2B	369367448
+
+
+/*
+ * Commands accepted by the _reboot() system call.
+ *
+ * RESTART     Restart system using default command and mode.
+ * HALT        Stop OS and give system control to ROM monitor, if any.
+ * CAD_ON      Ctrl-Alt-Del sequence causes RESTART command.
+ * CAD_OFF     Ctrl-Alt-Del sequence sends SIGINT to init task.
+ * POWER_OFF   Stop OS and remove all power from system, if possible.
+ * RESTART2    Restart system using given command string.
+ */
+
+#define	LINUX_REBOOT_CMD_RESTART	0x01234567
+#define	LINUX_REBOOT_CMD_HALT		0xCDEF0123
+#define	LINUX_REBOOT_CMD_CAD_ON		0x89ABCDEF
+#define	LINUX_REBOOT_CMD_CAD_OFF	0x00000000
+#define	LINUX_REBOOT_CMD_POWER_OFF	0x4321FEDC
+#define	LINUX_REBOOT_CMD_RESTART2	0xA1B2C3D4
+
+/* Including <unistd.h> makes sure that on a glibc system
+   <features.h> is included, which again defines __GLIBC__ */
+#include <unistd.h>
+#include "linux_reboot.h"
+
+#define USE_LIBC
+
+#ifdef USE_LIBC
+
+/* libc version */
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#  include <sys/reboot.h>
+#  define REBOOT(cmd) reboot(cmd)
+#else
+extern int reboot(int, int, int);
+#  define REBOOT(cmd) reboot(LINUX_REBOOT_MAGIC1,LINUX_REBOOT_MAGIC2,(cmd))
+#endif
+static inline int my_reboot(int cmd) {
+	return REBOOT(cmd);
+}
+
+#else /* no USE_LIBC */
+
+/* direct syscall version */
+#include <linux/unistd.h>
+
+#ifdef _syscall3
+_syscall3(int,  reboot,  int,  magic, int, magic_too, int, cmd);
+#else
+/* Let us hope we have a 3-argument reboot here */
+extern int reboot(int, int, int);
+#endif
+
+static inline int my_reboot(int cmd) {
+	return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd);
+}
+
+#endif
+
+
+#endif /*  _LINUX_REBOOT_H  */
diff --git a/util-linux-ng-2.17.2/include/linux_version.h b/util-linux-ng-2.17.2/include/linux_version.h
new file mode 100644
index 0000000..a6a1e99
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/linux_version.h
@@ -0,0 +1,14 @@
+#ifndef LINUX_VERSION_H
+#define LINUX_VERSION_H
+
+#ifdef HAVE_LINUX_VERSION_H
+# include <linux/version.h>
+#endif
+
+#ifndef KERNEL_VERSION
+# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#endif
+
+int get_linux_version(void);
+
+#endif /* LINUX_VERSION_H */
diff --git a/util-linux-ng-2.17.2/include/md5.h b/util-linux-ng-2.17.2/include/md5.h
new file mode 100644
index 0000000..d598e81
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/md5.h
@@ -0,0 +1,27 @@
+#ifndef MD5_H
+#define MD5_H
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#else
+typedef unsigned int uint32_t;
+#endif
+
+struct MD5Context {
+	uint32_t buf[4];
+	uint32_t bits[2];
+	unsigned char in[64];
+};
+
+void MD5Init(struct MD5Context *context);
+void MD5Update(struct MD5Context *context, unsigned char const *buf,
+	       unsigned len);
+void MD5Final(unsigned char digest[16], struct MD5Context *context);
+void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
+
+/*
+ * This is needed to make RSAREF happy on some MS-DOS compilers.
+ */
+typedef struct MD5Context MD5_CTX;
+
+#endif /* !MD5_H */
diff --git a/util-linux-ng-2.17.2/include/nls.h b/util-linux-ng-2.17.2/include/nls.h
new file mode 100644
index 0000000..dd0440c
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/nls.h
@@ -0,0 +1,34 @@
+#ifndef UTIL_LINUX_NLS_H
+#define UTIL_LINUX_NLS_H
+
+int main(int argc, char *argv[]);
+
+#ifndef LOCALEDIR
+#define LOCALEDIR "/usr/share/locale"
+#endif
+
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#else
+# undef setlocale
+# define setlocale(Category, Locale) /* empty */
+#endif
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# define _(Text) gettext (Text)
+# ifdef gettext_noop
+#  define N_(String) gettext_noop (String)
+# else
+#  define N_(String) (String)
+# endif
+#else
+# undef bindtextdomain
+# define bindtextdomain(Domain, Directory) /* empty */
+# undef textdomain
+# define textdomain(Domain) /* empty */
+# define _(Text) (Text)
+# define N_(Text) (Text)
+#endif
+
+#endif /* UTIL_LINUX_NLS_H */
diff --git a/util-linux-ng-2.17.2/include/pathnames.h b/util-linux-ng-2.17.2/include/pathnames.h
new file mode 100644
index 0000000..efe5c3b
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/pathnames.h
@@ -0,0 +1,112 @@
+/*
+ * Vaguely based on
+ *	@(#)pathnames.h	5.3 (Berkeley) 5/9/89
+ * This code is in the public domain.
+ */
+#ifndef PATHNAMES_H
+#define PATHNAMES_H
+
+#include <paths.h>
+
+#ifndef __STDC__
+# error "we need an ANSI compiler"
+#endif
+
+/* DEFPATHs from <paths.h> don't include /usr/local */
+#undef _PATH_DEFPATH
+#define	_PATH_DEFPATH	        "/usr/local/bin:/bin:/usr/bin"
+
+#undef _PATH_DEFPATH_ROOT
+#define	_PATH_DEFPATH_ROOT	"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+#define _PATH_SECURETTY		"/etc/securetty"
+#define _PATH_WTMPLOCK		"/etc/wtmplock"
+
+#define	_PATH_HUSHLOGIN		".hushlogin"
+
+#ifndef _PATH_MAILDIR
+#define	_PATH_MAILDIR		"/var/spool/mail"
+#endif
+#define	_PATH_MOTDFILE		"/etc/motd"
+#define	_PATH_NOLOGIN		"/etc/nologin"
+
+#define _PATH_LOGIN		"/bin/login"
+#define _PATH_INITTAB		"/etc/inittab"
+#define _PATH_RC		"/etc/rc"
+#define _PATH_REBOOT		"/sbin/reboot"
+#define _PATH_SHUTDOWN		"/sbin/shutdown"
+#define _PATH_SINGLE		"/etc/singleboot"
+#define _PATH_SHUTDOWN_CONF	"/etc/shutdown.conf"
+
+#define _PATH_SECURE		"/etc/securesingle"
+#define _PATH_USERTTY           "/etc/usertty"
+
+/* used in login-utils/shutdown.c */
+
+/* used in login-utils/setpwnam.h and login-utils/islocal.c */
+#define _PATH_PASSWD            "/etc/passwd"
+
+/* used in login-utils/newgrp */
+#define _PATH_GSHADOW		"/etc/gshadow"
+
+/* used in login-utils/setpwnam.h */
+#define _PATH_PTMP              "/etc/ptmp"
+#define _PATH_PTMPTMP           "/etc/ptmptmp"
+#define _PATH_GROUP             "/etc/group"
+#define _PATH_GTMP              "/etc/gtmp"
+#define _PATH_GTMPTMP           "/etc/gtmptmp"
+#define _PATH_SHADOW_PASSWD     "/etc/shadow"
+#define _PATH_SHADOW_PTMP       "/etc/sptmp"
+#define _PATH_SHADOW_PTMPTMP    "/etc/sptmptmp"
+#define _PATH_SHADOW_GROUP      "/etc/gshadow"
+#define _PATH_SHADOW_GTMP       "/etc/sgtmp"
+#define _PATH_SHADOW_GTMPTMP    "/etc/sgtmptmp"
+
+/* used in misc-utils/look.c */
+#define _PATH_WORDS             "/usr/share/dict/words"
+#define _PATH_WORDS_ALT         "/usr/share/dict/web2"
+
+/* mount paths */
+#define _PATH_UMOUNT		"/bin/umount"
+
+#define _PATH_FILESYSTEMS	"/etc/filesystems"
+#define _PATH_PROC_SWAPS	"/proc/swaps"
+#define _PATH_PROC_FILESYSTEMS	"/proc/filesystems"
+#define _PATH_PROC_MOUNTS	"/proc/mounts"
+#define _PATH_PROC_PARTITIONS	"/proc/partitions"
+#define _PATH_PROC_DEVICES	"/proc/devices"
+
+#ifndef _PATH_MOUNTED
+# ifdef MOUNTED					/* deprecated */
+#  define _PATH_MOUNTED		MOUNTED
+# else
+#  define _PATH_MOUNTED		"/etc/mtab"
+# endif
+#endif
+
+#ifndef _PATH_MNTTAB
+# ifdef MNTTAB					/* deprecated */
+#  define _PATH_MNTTAB		MNTTAB
+# else
+#  define _PATH_MNTTAB		"/etc/fstab"
+# endif
+#endif
+
+#define _PATH_MOUNTED_LOCK	_PATH_MOUNTED "~"
+#define _PATH_MOUNTED_TMP	_PATH_MOUNTED ".tmp"
+
+#ifndef _PATH_DEV
+# define _PATH_DEV		"/dev/"
+#endif
+
+#define _PATH_DEV_LOOP		"/dev/loop"
+#define _PATH_DEV_TTY		"/dev/tty"
+
+/* udev paths */
+#define _PATH_DEV_BYLABEL	"/dev/disk/by-label"
+#define _PATH_DEV_BYUUID	"/dev/disk/by-uuid"
+#define _PATH_DEV_BYID		"/dev/disk/by-id"
+#define _PATH_DEV_BYPATH	"/dev/disk/by-path"
+
+#endif /* PATHNAMES_H */
+
diff --git a/util-linux-ng-2.17.2/include/setproctitle.h b/util-linux-ng-2.17.2/include/setproctitle.h
new file mode 100644
index 0000000..d57abda
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/setproctitle.h
@@ -0,0 +1,7 @@
+
+void initproctitle (int argc, char **argv);
+#if 0
+void setproctitle (const char *fmt, ...);
+#else
+void setproctitle (const char *prog, const char *txt);
+#endif
diff --git a/util-linux-ng-2.17.2/include/swapheader.h b/util-linux-ng-2.17.2/include/swapheader.h
new file mode 100644
index 0000000..6ff5390
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/swapheader.h
@@ -0,0 +1,24 @@
+#ifndef _SWAPHEADER_H
+#define _SWAPHEADER_H
+
+struct swap_header_v1 {
+        char         bootbits[1024];    /* Space for disklabel etc. */
+	unsigned int version;
+	unsigned int last_page;
+	unsigned int nr_badpages;
+	unsigned int padding[125];
+	unsigned int badpages[1];
+};
+
+struct swap_header_v1_2 {
+	char	      bootbits[1024];    /* Space for disklabel etc. */
+	unsigned int  version;
+	unsigned int  last_page;
+	unsigned int  nr_badpages;
+	unsigned char uuid[16];
+	char	      volume_name[16];
+	unsigned int  padding[117];
+	unsigned int  badpages[1];
+};
+
+#endif /* _SWAPHEADER_H */
diff --git a/util-linux-ng-2.17.2/include/usleep.h b/util-linux-ng-2.17.2/include/usleep.h
new file mode 100644
index 0000000..f64477c
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/usleep.h
@@ -0,0 +1,18 @@
+#ifndef UTIL_LINUX_USLEEP_H
+#define UTIL_LINUX_USLEEP_H
+
+#ifndef HAVE_USLEEP
+/*
+ * This function is marked obsolete in POSIX.1-2001 and removed in
+ * POSIX.1-2008. It is replaced with nanosleep().
+ */
+# define usleep(x) \
+	do { \
+		struct timespec xsleep; \
+		xsleep.tv_sec = x / 1000 / 1000; \
+		xsleep.tv_nsec = (x - xsleep.tv_sec * 1000 * 1000) * 1000; \
+		nanosleep(&xsleep, NULL); \
+	} while (0)
+#endif
+
+#endif /* UTIL_LINUX_USLEEP_H */
diff --git a/util-linux-ng-2.17.2/include/wholedisk.h b/util-linux-ng-2.17.2/include/wholedisk.h
new file mode 100644
index 0000000..251479e
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/wholedisk.h
@@ -0,0 +1,8 @@
+#ifndef WHOLEDISK_H
+#define WHOLEDISK_H
+
+extern int is_whole_disk(const char *name);
+extern int is_whole_disk_fd(int fd, const char *name);
+
+#endif /* WHOLEDISK_H */
+
diff --git a/util-linux-ng-2.17.2/include/widechar.h b/util-linux-ng-2.17.2/include/widechar.h
new file mode 100644
index 0000000..b023b5f
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/widechar.h
@@ -0,0 +1,38 @@
+/* Declarations for wide characters */
+/* This file must be included last because the redefinition of wchar_t may
+   cause conflicts when system include files were included after it. */
+
+#ifdef HAVE_WIDECHAR
+
+# include <wchar.h>
+# include <wctype.h>
+
+#else /* !HAVE_WIDECHAR */
+
+# include <ctype.h>
+  /* Fallback for types */
+# define wchar_t char
+# define wint_t int
+# define WEOF EOF
+  /* Fallback for input operations */
+# define fgetwc fgetc
+# define getwc getc
+# define getwchar getchar
+# define fgetws fgets
+  /* Fallback for output operations */
+# define fputwc fputc
+# define putwc putc
+# define putwchar putchar
+# define fputws fputs
+  /* Fallback for character classification */
+# define iswgraph isgraph
+# define iswprint isprint
+# define iswspace isspace
+  /* Fallback for string functions */
+# define wcschr strchr
+# define wcsdup strdup
+# define wcslen strlen
+
+# define wcwidth(c) 1
+
+#endif /* HAVE_WIDECHAR */
diff --git a/util-linux-ng-2.17.2/include/xstrncpy.h b/util-linux-ng-2.17.2/include/xstrncpy.h
new file mode 100644
index 0000000..7ed4109
--- /dev/null
+++ b/util-linux-ng-2.17.2/include/xstrncpy.h
@@ -0,0 +1,8 @@
+/* NUL-terminated version of strncpy() */
+#include <string.h>
+
+/* caller guarantees n > 0 */
+static inline void xstrncpy(char *dest, const char *src, size_t n) {
+	strncpy(dest, src, n-1);
+	dest[n-1] = 0;
+}
diff --git a/util-linux-ng-2.17.2/lib/Makefile.am b/util-linux-ng-2.17.2/lib/Makefile.am
new file mode 100644
index 0000000..5600d18
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/Makefile.am
@@ -0,0 +1,14 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+AM_CPPFLAGS += -DTEST_PROGRAM
+
+noinst_PROGRAMS = test_blkdev test_ismounted test_wholedisk
+
+test_blkdev_SOURCES = blkdev.c
+test_ismounted_SOURCES = ismounted.c
+test_wholedisk_SOURCES = wholedisk.c
+
+if LINUX
+test_blkdev_SOURCES += linux_version.c
+endif
+
diff --git a/util-linux-ng-2.17.2/lib/Makefile.in b/util-linux-ng-2.17.2/lib/Makefile.in
new file mode 100644
index 0000000..ab974b7
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/Makefile.in
@@ -0,0 +1,585 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(dist_noinst_DATA) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/config/include-Makefile.am
+noinst_PROGRAMS = test_blkdev$(EXEEXT) test_ismounted$(EXEEXT) \
+	test_wholedisk$(EXEEXT)
+@LINUX_TRUE@am__append_1 = linux_version.c
+subdir = lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am__test_blkdev_SOURCES_DIST = blkdev.c linux_version.c
+@LINUX_TRUE@am__objects_1 = linux_version.$(OBJEXT)
+am_test_blkdev_OBJECTS = blkdev.$(OBJEXT) $(am__objects_1)
+test_blkdev_OBJECTS = $(am_test_blkdev_OBJECTS)
+test_blkdev_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am_test_ismounted_OBJECTS = ismounted.$(OBJEXT)
+test_ismounted_OBJECTS = $(am_test_ismounted_OBJECTS)
+test_ismounted_LDADD = $(LDADD)
+am_test_wholedisk_OBJECTS = wholedisk.$(OBJEXT)
+test_wholedisk_OBJECTS = $(am_test_wholedisk_OBJECTS)
+test_wholedisk_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(test_blkdev_SOURCES) $(test_ismounted_SOURCES) \
+	$(test_wholedisk_SOURCES)
+DIST_SOURCES = $(am__test_blkdev_SOURCES_DIST) \
+	$(test_ismounted_SOURCES) $(test_wholedisk_SOURCES)
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h \
+	-I$(top_srcdir)/include -DLOCALEDIR=\"$(localedir)\" \
+	-DTEST_PROGRAM
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+test_blkdev_SOURCES = blkdev.c $(am__append_1)
+test_ismounted_SOURCES = ismounted.c
+test_wholedisk_SOURCES = wholedisk.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign lib/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
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+test_blkdev$(EXEEXT): $(test_blkdev_OBJECTS) $(test_blkdev_DEPENDENCIES) 
+	@rm -f test_blkdev$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(test_blkdev_OBJECTS) $(test_blkdev_LDADD) $(LIBS)
+test_ismounted$(EXEEXT): $(test_ismounted_OBJECTS) $(test_ismounted_DEPENDENCIES) 
+	@rm -f test_ismounted$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(test_ismounted_OBJECTS) $(test_ismounted_LDADD) $(LIBS)
+test_wholedisk$(EXEEXT): $(test_wholedisk_OBJECTS) $(test_wholedisk_DEPENDENCIES) 
+	@rm -f test_wholedisk$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(test_wholedisk_OBJECTS) $(test_wholedisk_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blkdev.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ismounted.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wholedisk.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(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:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-libtool clean-noinstPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+# 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:
diff --git a/util-linux-ng-2.17.2/lib/blkdev.c b/util-linux-ng-2.17.2/lib/blkdev.c
new file mode 100644
index 0000000..1ca4548
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/blkdev.c
@@ -0,0 +1,148 @@
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+#include "blkdev.h"
+#include "linux_version.h"
+
+static long
+blkdev_valid_offset (int fd, off_t offset) {
+	char ch;
+
+	if (lseek (fd, offset, 0) < 0)
+		return 0;
+	if (read (fd, &ch, 1) < 1)
+		return 0;
+	return 1;
+}
+
+off_t
+blkdev_find_size (int fd) {
+	off_t high, low;
+
+	low = 0;
+	for (high = 1; high > 0 && blkdev_valid_offset (fd, high); high *= 2)
+		low = high;
+	while (low < high - 1)
+	{
+		const off_t mid = (low + high) / 2;
+
+		if (blkdev_valid_offset (fd, mid))
+			low = mid;
+		else
+			high = mid;
+	}
+	blkdev_valid_offset (fd, 0);
+	return (low + 1);
+}
+
+/* get size in bytes */
+int
+blkdev_get_size(int fd, unsigned long long *bytes)
+{
+	/* TODO: use stat as well */
+
+#ifdef BLKGETSIZE64
+#ifdef __linux__
+	int ver = get_linux_version();
+	/* kernels 2.4.15-2.4.17, had a broken BLKGETSIZE64 */
+	if (ver >= KERNEL_VERSION (2,6,0) ||
+	   (ver >= KERNEL_VERSION (2,4,18) && ver < KERNEL_VERSION (2,5,0)))
+#endif
+		if (ioctl(fd, BLKGETSIZE64, bytes) >= 0)
+			return 0;
+#endif /* BLKGETSIZE64 */
+
+#ifdef BLKGETSIZE
+	{
+		unsigned long size;
+
+		if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
+			*bytes = ((unsigned long long)size << 9);
+			return 0;
+		}
+	}
+
+	return -1;
+#endif /* BLKGETSIZE */
+
+	*bytes = blkdev_find_size(fd);
+	return 0;
+}
+
+/* get 512-byte sector count */
+int
+blkdev_get_sectors(int fd, unsigned long long *sectors)
+{
+	unsigned long long bytes;
+
+	if (blkdev_get_size(fd, &bytes) == 0) {
+		*sectors = (bytes >> 9);
+		return 0;
+	}
+
+	return -1;
+}
+
+/* get logical sector size (default is 512)
+ *
+ * This is the smallest unit the storage device can
+ * address. It is typically 512 bytes.
+ */
+int
+blkdev_get_sector_size(int fd, int *sector_size)
+{
+#ifdef BLKSSZGET
+#ifdef __linux__
+	if (get_linux_version() < KERNEL_VERSION(2,3,3)) {
+		*sector_size = DEFAULT_SECTOR_SIZE;
+		return 0;
+	}
+#endif
+	if (ioctl(fd, BLKSSZGET, sector_size) >= 0)
+		return 0;
+
+	return -1;
+#else
+	*sector_size = DEFAULT_SECTOR_SIZE;
+	return 0;
+#endif
+}
+
+
+#ifdef TEST_PROGRAM
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <err.h>
+int
+main(int argc, char **argv)
+{
+	unsigned long long bytes;
+	unsigned long long sectors;
+	int sector_size;
+	int fd;
+
+	if (argc != 2) {
+		fprintf(stderr, "usage: %s device\n", argv[0]);
+		exit(EXIT_FAILURE);
+	}
+
+	if ((fd = open(argv[1], O_RDONLY)) < 0)
+		err(EXIT_FAILURE, "open %s failed", argv[1]);
+
+	if (blkdev_get_size(fd, &bytes) < 0)
+		err(EXIT_FAILURE, "blkdev_get_size() failed");
+	if (blkdev_get_sectors(fd, &sectors) < 0)
+		err(EXIT_FAILURE, "blkdev_get_sectors() failed");
+	if (blkdev_get_sector_size(fd, &sector_size) < 0)
+		err(EXIT_FAILURE, "blkdev_get_sector_size() failed");
+
+	printf("bytes %llu\n", bytes);
+	printf("sectors %llu\n", sectors);
+	printf("sectorsize %d\n", sector_size);
+
+	return EXIT_SUCCESS;
+}
+#endif /* TEST_PROGRAM */
diff --git a/util-linux-ng-2.17.2/lib/canonicalize.c b/util-linux-ng-2.17.2/lib/canonicalize.c
new file mode 100644
index 0000000..29b3f25
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/canonicalize.c
@@ -0,0 +1,191 @@
+/*
+ * canonicalize.c -- canonicalize pathname by removing symlinks
+ * Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library 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 Library Public License for more details.
+ *
+ */
+
+/*
+ * This routine is part of libc.  We include it nevertheless,
+ * since the libc version has some security flaws.
+ *
+ * TODO: use canonicalize_file_name() when exist in glibc
+ */
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include "canonicalize.h"
+
+#ifndef MAXSYMLINKS
+# define MAXSYMLINKS 256
+#endif
+
+static char *
+myrealpath(const char *path, char *resolved_path, int maxreslth) {
+	int readlinks = 0;
+	char *npath;
+	char link_path[PATH_MAX+1];
+	int n;
+	char *buf = NULL;
+
+	npath = resolved_path;
+
+	/* If it's a relative pathname use getcwd for starters. */
+	if (*path != '/') {
+		if (!getcwd(npath, maxreslth-2))
+			return NULL;
+		npath += strlen(npath);
+		if (npath[-1] != '/')
+			*npath++ = '/';
+	} else {
+		*npath++ = '/';
+		path++;
+	}
+
+	/* Expand each slash-separated pathname component. */
+	while (*path != '\0') {
+		/* Ignore stray "/" */
+		if (*path == '/') {
+			path++;
+			continue;
+		}
+		if (*path == '.' && (path[1] == '\0' || path[1] == '/')) {
+			/* Ignore "." */
+			path++;
+			continue;
+		}
+		if (*path == '.' && path[1] == '.' &&
+		    (path[2] == '\0' || path[2] == '/')) {
+			/* Backup for ".." */
+			path += 2;
+			while (npath > resolved_path+1 &&
+			       (--npath)[-1] != '/')
+				;
+			continue;
+		}
+		/* Safely copy the next pathname component. */
+		while (*path != '\0' && *path != '/') {
+			if (npath-resolved_path > maxreslth-2) {
+				errno = ENAMETOOLONG;
+				goto err;
+			}
+			*npath++ = *path++;
+		}
+
+		/* Protect against infinite loops. */
+		if (readlinks++ > MAXSYMLINKS) {
+			errno = ELOOP;
+			goto err;
+		}
+
+		/* See if last pathname component is a symlink. */
+		*npath = '\0';
+		n = readlink(resolved_path, link_path, PATH_MAX);
+		if (n < 0) {
+			/* EINVAL means the file exists but isn't a symlink. */
+			if (errno != EINVAL)
+				goto err;
+		} else {
+			int m;
+			char *newbuf;
+
+			/* Note: readlink doesn't add the null byte. */
+			link_path[n] = '\0';
+			if (*link_path == '/')
+				/* Start over for an absolute symlink. */
+				npath = resolved_path;
+			else
+				/* Otherwise back up over this component. */
+				while (*(--npath) != '/')
+					;
+
+			/* Insert symlink contents into path. */
+			m = strlen(path);
+			newbuf = malloc(m + n + 1);
+			if (!newbuf)
+				goto err;
+			memcpy(newbuf, link_path, n);
+			memcpy(newbuf + n, path, m + 1);
+			free(buf);
+			path = buf = newbuf;
+		}
+		*npath++ = '/';
+	}
+	/* Delete trailing slash but don't whomp a lone slash. */
+	if (npath != resolved_path+1 && npath[-1] == '/')
+		npath--;
+	/* Make sure it's null terminated. */
+	*npath = '\0';
+
+	free(buf);
+	return resolved_path;
+
+ err:
+	free(buf);
+	return NULL;
+}
+
+/*
+ * Converts private "dm-N" names to "/dev/mapper/<name>"
+ *
+ * Since 2.6.29 (patch 784aae735d9b0bba3f8b9faef4c8b30df3bf0128) kernel sysfs
+ * provides the real DM device names in /sys/block/<ptname>/dm/name
+ */
+char *
+canonicalize_dm_name(const char *ptname)
+{
+	FILE	*f;
+	size_t	sz;
+	char	path[256], name[256], *res = NULL;
+
+	snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptname);
+	if (!(f = fopen(path, "r")))
+		return NULL;
+
+	/* read "<name>\n" from sysfs */
+	if (fgets(name, sizeof(name), f) && (sz = strlen(name)) > 1) {
+		name[sz - 1] = '\0';
+		snprintf(path, sizeof(path), "/dev/mapper/%s", name);
+		res = strdup(path);
+	}
+	fclose(f);
+	return res;
+}
+
+char *
+canonicalize_path(const char *path)
+{
+	char canonical[PATH_MAX+2];
+	char *p;
+
+	if (path == NULL)
+		return NULL;
+
+	if (!myrealpath(path, canonical, PATH_MAX+1))
+		return strdup(path);
+
+
+	p = strrchr(canonical, '/');
+	if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
+		p = canonicalize_dm_name(p+1);
+		if (p)
+			return p;
+	}
+
+	return strdup(canonical);
+}
+
+
diff --git a/util-linux-ng-2.17.2/lib/crc32.c b/util-linux-ng-2.17.2/lib/crc32.c
new file mode 100644
index 0000000..eaaa06a
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/crc32.c
@@ -0,0 +1,116 @@
+/*
+ *  COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or
+ *  code or tables extracted from it, as desired without restriction.
+ *
+ *  First, the polynomial itself and its table of feedback terms.  The
+ *  polynomial is
+ *  X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
+ *
+ *  Note that we take it "backwards" and put the highest-order term in
+ *  the lowest-order bit.  The X^32 term is "implied"; the LSB is the
+ *  X^31 term, etc.  The X^0 term (usually shown as "+1") results in
+ *  the MSB being 1.
+ *
+ *  Note that the usual hardware shift register implementation, which
+ *  is what we're using (we're merely optimizing it by doing eight-bit
+ *  chunks at a time) shifts bits into the lowest-order term.  In our
+ *  implementation, that means shifting towards the right.  Why do we
+ *  do it this way?  Because the calculated CRC must be transmitted in
+ *  order from highest-order term to lowest-order term.  UARTs transmit
+ *  characters in order from LSB to MSB.  By storing the CRC this way,
+ *  we hand it to the UART in the order low-byte to high-byte; the UART
+ *  sends each low-bit to hight-bit; and the result is transmission bit
+ *  by bit from highest- to lowest-order term without requiring any bit
+ *  shuffling on our part.  Reception works similarly.
+ *
+ *  The feedback terms table consists of 256, 32-bit entries.  Notes
+ *
+ *      The table can be generated at runtime if desired; code to do so
+ *      is shown later.  It might not be obvious, but the feedback
+ *      terms simply represent the results of eight shift/xor opera-
+ *      tions for all combinations of data and CRC register values.
+ *
+ *      The values must be right-shifted by eight bits by the "updcrc"
+ *      logic; the shift must be unsigned (bring in zeroes).  On some
+ *      hardware you could probably optimize the shift in assembler by
+ *      using byte-swap instructions.
+ *      polynomial $edb88320
+ *
+ */
+
+#include <stdio.h>
+
+#include "crc32.h"
+
+
+static const uint32_t crc32_tab[] = {
+	0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+	0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+	0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+	0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+	0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+	0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+	0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+	0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+	0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+	0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+	0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+	0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+	0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+	0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+	0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+	0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+	0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+	0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+	0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+	0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+	0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+	0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+	0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+	0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+	0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+	0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+	0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+	0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+	0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+	0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+	0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+	0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+	0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+	0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+	0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+	0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+	0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+	0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+	0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+	0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+	0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+	0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+	0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+	0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+	0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+	0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+	0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+	0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+	0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+	0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+	0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+	0x2d02ef8dL
+};
+
+/*
+ * This a generic crc32() function, it takes seed as an argument,
+ * and does __not__ xor at the end. Then individual users can do
+ * whatever they need.
+ */
+uint32_t crc32(uint32_t seed, const unsigned char *buf, size_t len)
+{
+	uint32_t crc = seed;
+	const unsigned char *p = buf;
+
+	while(len-- > 0)
+		crc = crc32_tab[(crc ^ *p++) & 0xff] ^ (crc >> 8);
+
+	return crc;
+}
+
diff --git a/util-linux-ng-2.17.2/lib/env.c b/util-linux-ng-2.17.2/lib/env.c
new file mode 100644
index 0000000..82fadf5
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/env.c
@@ -0,0 +1,73 @@
+/*
+ * Security checks of environment
+ * Added from shadow-utils package
+ * by Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ *
+ */ 
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "env.h"
+
+extern char **environ;
+
+static char * const forbid[] = {
+        "_RLD_=",
+        "BASH_ENV=",    /* GNU creeping featurism strikes again... */
+        "ENV=",
+        "HOME=",
+        "IFS=",
+        "KRB_CONF=",
+        "LD_",          /* anything with the LD_ prefix */
+        "LIBPATH=",
+        "MAIL=",
+        "NLSPATH=",
+        "PATH=",
+        "SHELL=",
+        "SHLIB_PATH=",
+        (char *) 0
+};
+
+/* these are allowed, but with no slashes inside
+   (to work around security problems in GNU gettext) */
+static char * const noslash[] = {
+        "LANG=",
+        "LANGUAGE=",
+        "LC_",          /* anything with the LC_ prefix */
+        (char *) 0
+};
+
+void
+sanitize_env(void)
+{
+        char **envp = environ;
+        char * const *bad;
+        char **cur;
+        char **move;
+
+        for (cur = envp; *cur; cur++) {
+                for (bad = forbid; *bad; bad++) {
+                        if (strncmp(*cur, *bad, strlen(*bad)) == 0) {
+                                for (move = cur; *move; move++)
+                                        *move = *(move + 1);
+                                cur--;
+                                break;
+                        }
+                }
+        }
+
+        for (cur = envp; *cur; cur++) {
+                for (bad = noslash; *bad; bad++) {
+                        if (strncmp(*cur, *bad, strlen(*bad)) != 0)
+                                continue;
+                        if (!strchr(*cur, '/'))
+                                continue;  /* OK */
+                        for (move = cur; *move; move++)
+                                *move = *(move + 1);
+                        cur--;
+                        break;
+                }
+        }
+}
+
diff --git a/util-linux-ng-2.17.2/lib/fsprobe.c b/util-linux-ng-2.17.2/lib/fsprobe.c
new file mode 100644
index 0000000..7721180
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/fsprobe.c
@@ -0,0 +1,252 @@
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#ifdef HAVE_BLKID_BLKID_H
+#include <blkid/blkid.h>
+#else
+#include <blkid.h>
+#endif
+
+#include "blkdev.h"
+#include "canonicalize.h"
+#include "pathnames.h"
+#include "fsprobe.h"
+
+static blkid_cache blcache;
+
+#ifdef HAVE_LIBBLKID_INTERNAL
+/* ask kernel developers why we need such ugly open() method... */
+static int
+open_device(const char *devname)
+{
+	int retries = 0;
+
+	do {
+		int fd = open(devname, O_RDONLY);
+		if (fd >= 0)
+			return fd;
+		if (errno != ENOMEDIUM)
+			break;
+		if (retries >= CRDOM_NOMEDIUM_RETRIES)
+			break;
+		++retries;
+		sleep(3);
+	} while(1);
+
+	return -1;
+}
+#endif
+
+/*
+ * Parses NAME=value, returns -1 on parse error, 0 success. The success is also
+ * when the 'spec' doesn't contain name=value pair (because the spec could be
+ * a devname too). In particular case the pointer 'name' is set to NULL.
+ */
+int
+fsprobe_parse_spec(const char *spec, char **name, char **value)
+{
+	*name = NULL;
+	*value = NULL;
+
+	if (strchr(spec, '='))
+		return blkid_parse_tag_string(spec, name, value);
+
+	return 0;
+}
+
+char *
+fsprobe_get_devname_by_spec(const char *spec)
+{
+	char *name, *value;
+
+	if (!spec)
+		return NULL;
+	if (fsprobe_parse_spec(spec, &name, &value) != 0)
+		return NULL;				/* parse error */
+	if (name) {
+		char *nspec = NULL;
+
+		if (!strcmp(name,"LABEL"))
+			nspec = fsprobe_get_devname_by_label(value);
+		else if (!strcmp(name,"UUID"))
+			nspec = fsprobe_get_devname_by_uuid(value);
+
+		free(name);
+		free(value);
+		return nspec;
+	}
+
+	return canonicalize_path(spec);
+}
+
+void
+fsprobe_init(void)
+{
+	blcache = NULL;
+}
+
+int
+fsprobe_known_fstype(const char *fstype)
+{
+	return blkid_known_fstype(fstype);
+}
+
+#ifdef HAVE_LIBBLKID_INTERNAL
+/*
+ * libblkid from util-linux-ng
+ * -- recommended
+ */
+static blkid_probe blprobe;
+
+void
+fsprobe_exit(void)
+{
+	if (blprobe)
+		blkid_free_probe(blprobe);
+	if (blcache)
+		blkid_put_cache(blcache);
+}
+
+/* returns device LABEL, UUID, FSTYPE, ... by low-level
+ * probing interface
+ */
+static char *
+fsprobe_get_value(const char *name, const char *devname)
+{
+	int fd;
+	const char *data = NULL;
+
+	if (!devname || !name)
+		return NULL;
+	fd = open_device(devname);
+	if (fd < 0)
+		return NULL;
+	if (!blprobe)
+		blprobe = blkid_new_probe();
+	if (!blprobe)
+		goto done;
+	if (blkid_probe_set_device(blprobe, fd, 0, 0))
+		goto done;
+
+	blkid_probe_enable_superblocks(blprobe, 1);
+
+	blkid_probe_set_superblocks_flags(blprobe,
+		BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
+
+	if (blkid_do_safeprobe(blprobe))
+		goto done;
+	if (blkid_probe_lookup_value(blprobe, name, &data, NULL))
+		goto done;
+done:
+	close(fd);
+	return data ? strdup((char *) data) : NULL;
+}
+
+char *
+fsprobe_get_label_by_devname(const char *devname)
+{
+	return fsprobe_get_value("LABEL", devname);
+}
+
+char *
+fsprobe_get_uuid_by_devname(const char *devname)
+{
+	return fsprobe_get_value("UUID", devname);
+}
+
+char *
+fsprobe_get_fstype_by_devname(const char *devname)
+{
+	return fsprobe_get_value("TYPE", devname);
+}
+
+char *
+fsprobe_get_devname_by_uuid(const char *uuid)
+{
+	return blkid_evaluate_tag("UUID", uuid, &blcache);
+}
+
+char *
+fsprobe_get_devname_by_label(const char *label)
+{
+	return blkid_evaluate_tag("LABEL", label, &blcache);
+}
+
+#else /* !HAVE_LIBBLKID_INTERNAL */
+
+/*
+ * Classic libblkid (from e2fsprogs) without blkid_evaluate_tag()
+ * -- deprecated
+ */
+#define BLKID_EMPTY_CACHE	"/dev/null"
+
+void
+fsprobe_exit(void)
+{
+	if (blcache)
+		blkid_put_cache(blcache);
+}
+
+char *
+fsprobe_get_devname_by_uuid(const char *uuid)
+{
+	if (!blcache)
+		blkid_get_cache(&blcache, NULL);
+
+	return blkid_get_devname(blcache, "UUID", uuid);
+}
+
+char *
+fsprobe_get_devname_by_label(const char *label)
+{
+	if (!blcache)
+		blkid_get_cache(&blcache, NULL);
+
+	return blkid_get_devname(blcache, "LABEL", label);
+}
+
+char *
+fsprobe_get_fstype_by_devname(const char *devname)
+{
+	blkid_cache c;
+	char *tp;
+
+	if (blcache)
+		return blkid_get_tag_value(blcache, "TYPE", devname);
+
+	/* The cache is not initialized yet. Use empty cache rather than waste
+	 * time with /etc/blkid.tab. It seems that probe FS is faster than
+	 * parse the cache file.  -- kzak (17-May-2007)
+	 */
+	blkid_get_cache(&c, BLKID_EMPTY_CACHE);
+	tp = blkid_get_tag_value(c, "TYPE", devname);
+	blkid_put_cache(c);
+
+	return tp;
+}
+
+char *
+fsprobe_get_label_by_devname(const char *devname)
+{
+	if (!blcache)
+		blkid_get_cache(&blcache, NULL);
+
+	return blkid_get_tag_value(blcache, "LABEL", devname);
+}
+
+char *
+fsprobe_get_uuid_by_devname(const char *devname)
+{
+	if (!blcache)
+		blkid_get_cache(&blcache, NULL);
+
+	return blkid_get_tag_value(blcache, "UUID", devname);
+}
+
+#endif /* !HAVE_LIBBLKID_INTERNAL */
diff --git a/util-linux-ng-2.17.2/lib/ismounted.c b/util-linux-ng-2.17.2/lib/ismounted.c
new file mode 100644
index 0000000..94fe425
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/ismounted.c
@@ -0,0 +1,361 @@
+/*
+ * ismounted.c --- Check to see if the filesystem was mounted
+ *
+ * Copyright (C) 1995,1996,1997,1998,1999,2000,2008 Theodore Ts'o.
+ *
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ */
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <mntent.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <ctype.h>
+#include <sys/param.h>
+
+#include "pathnames.h"
+#include "ismounted.h"
+
+#ifdef HAVE_MNTENT_H
+/*
+ * Helper function which checks a file in /etc/mtab format to see if a
+ * filesystem is mounted.  Returns an error if the file doesn't exist
+ * or can't be opened.
+ */
+static int check_mntent_file(const char *mtab_file, const char *file,
+				   int *mount_flags, char *mtpt, int mtlen)
+{
+	struct mntent	*mnt;
+	struct stat	st_buf;
+	int		retval = 0;
+	dev_t		file_dev=0, file_rdev=0;
+	ino_t		file_ino=0;
+	FILE		*f;
+	int		fd;
+
+	*mount_flags = 0;
+	if ((f = setmntent (mtab_file, "r")) == NULL)
+		return errno;
+	if (stat(file, &st_buf) == 0) {
+		if (S_ISBLK(st_buf.st_mode)) {
+#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
+			file_rdev = st_buf.st_rdev;
+#endif	/* __GNU__ */
+		} else {
+			file_dev = st_buf.st_dev;
+			file_ino = st_buf.st_ino;
+		}
+	}
+	while ((mnt = getmntent (f)) != NULL) {
+		if (mnt->mnt_fsname[0] != '/')
+			continue;
+		if (strcmp(file, mnt->mnt_fsname) == 0)
+			break;
+		if (stat(mnt->mnt_fsname, &st_buf) == 0) {
+			if (S_ISBLK(st_buf.st_mode)) {
+#ifndef __GNU__
+				if (file_rdev && (file_rdev == st_buf.st_rdev))
+					break;
+#endif	/* __GNU__ */
+			} else {
+				if (file_dev && ((file_dev == st_buf.st_dev) &&
+						 (file_ino == st_buf.st_ino)))
+					break;
+			}
+		}
+	}
+
+	if (mnt == 0) {
+#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
+		/*
+		 * Do an extra check to see if this is the root device.  We
+		 * can't trust /etc/mtab, and /proc/mounts will only list
+		 * /dev/root for the root filesystem.  Argh.  Instead we
+		 * check if the given device has the same major/minor number
+		 * as the device that the root directory is on.
+		 */
+		if (file_rdev && stat("/", &st_buf) == 0 &&
+		    st_buf.st_dev == file_rdev) {
+			*mount_flags = MF_MOUNTED;
+			if (mtpt)
+				strncpy(mtpt, "/", mtlen);
+			goto is_root;
+		}
+#endif	/* __GNU__ */
+		goto errout;
+	}
+#ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */
+	/* Validate the entry in case /etc/mtab is out of date */
+	/*
+	 * We need to be paranoid, because some broken distributions
+	 * (read: Slackware) don't initialize /etc/mtab before checking
+	 * all of the non-root filesystems on the disk.
+	 */
+	if (stat(mnt->mnt_dir, &st_buf) < 0) {
+		retval = errno;
+		if (retval == ENOENT) {
+#ifdef DEBUG
+			printf("Bogus entry in %s!  (%s does not exist)\n",
+			       mtab_file, mnt->mnt_dir);
+#endif /* DEBUG */
+			retval = 0;
+		}
+		goto errout;
+	}
+	if (file_rdev && (st_buf.st_dev != file_rdev)) {
+#ifdef DEBUG
+		printf("Bogus entry in %s!  (%s not mounted on %s)\n",
+		       mtab_file, file, mnt->mnt_dir);
+#endif /* DEBUG */
+		goto errout;
+	}
+#endif /* __GNU__ */
+	*mount_flags = MF_MOUNTED;
+
+#ifdef MNTOPT_RO
+	/* Check to see if the ro option is set */
+	if (hasmntopt(mnt, MNTOPT_RO))
+		*mount_flags |= MF_READONLY;
+#endif
+
+	if (mtpt)
+		strncpy(mtpt, mnt->mnt_dir, mtlen);
+	/*
+	 * Check to see if we're referring to the root filesystem.
+	 * If so, do a manual check to see if we can open /etc/mtab
+	 * read/write, since if the root is mounted read/only, the
+	 * contents of /etc/mtab may not be accurate.
+	 */
+	if (!strcmp(mnt->mnt_dir, "/")) {
+is_root:
+#define TEST_FILE "/.ismount-test-file"
+		*mount_flags |= MF_ISROOT;
+		fd = open(TEST_FILE, O_RDWR|O_CREAT, 0600);
+		if (fd < 0) {
+			if (errno == EROFS)
+				*mount_flags |= MF_READONLY;
+		} else
+			close(fd);
+		(void) unlink(TEST_FILE);
+	}
+	retval = 0;
+errout:
+	endmntent (f);
+	return retval;
+}
+
+static int check_mntent(const char *file, int *mount_flags,
+			      char *mtpt, int mtlen)
+{
+	int	retval;
+
+#ifdef DEBUG
+	retval = check_mntent_file("/tmp/mtab", file, mount_flags,
+				   mtpt, mtlen);
+	if (retval == 0)
+		return 0;
+#endif /* DEBUG */
+#ifdef __linux__
+	retval = check_mntent_file("/proc/mounts", file, mount_flags,
+				   mtpt, mtlen);
+	if (retval == 0 && (*mount_flags != 0))
+		return 0;
+#endif /* __linux__ */
+#if defined(MOUNTED) || defined(_PATH_MOUNTED)
+#ifndef MOUNTED
+#define MOUNTED _PATH_MOUNTED
+#endif /* MOUNTED */
+	retval = check_mntent_file(MOUNTED, file, mount_flags, mtpt, mtlen);
+	return retval;
+#else
+	*mount_flags = 0;
+	return 0;
+#endif /* defined(MOUNTED) || defined(_PATH_MOUNTED) */
+}
+
+#else
+#if defined(HAVE_GETMNTINFO)
+
+static int check_getmntinfo(const char *file, int *mount_flags,
+				  char *mtpt, int mtlen)
+{
+	struct statfs *mp;
+        int    len, n;
+        const  char   *s1;
+	char	*s2;
+
+        n = getmntinfo(&mp, MNT_NOWAIT);
+        if (n == 0)
+		return errno;
+
+        len = sizeof(_PATH_DEV) - 1;
+        s1 = file;
+        if (strncmp(_PATH_DEV, s1, len) == 0)
+                s1 += len;
+
+	*mount_flags = 0;
+        while (--n >= 0) {
+                s2 = mp->f_mntfromname;
+                if (strncmp(_PATH_DEV, s2, len) == 0) {
+                        s2 += len - 1;
+                        *s2 = 'r';
+                }
+                if (strcmp(s1, s2) == 0 || strcmp(s1, &s2[1]) == 0) {
+			*mount_flags = MF_MOUNTED;
+			break;
+		}
+                ++mp;
+	}
+	if (mtpt)
+		strncpy(mtpt, mp->f_mntonname, mtlen);
+	return 0;
+}
+#endif /* HAVE_GETMNTINFO */
+#endif /* HAVE_MNTENT_H */
+
+/*
+ * Check to see if we're dealing with the swap device.
+ */
+static int is_swap_device(const char *file)
+{
+	FILE		*f;
+	char		buf[1024], *cp;
+	dev_t		file_dev;
+	struct stat	st_buf;
+	int		ret = 0;
+
+	file_dev = 0;
+#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
+	if ((stat(file, &st_buf) == 0) &&
+	    S_ISBLK(st_buf.st_mode))
+		file_dev = st_buf.st_rdev;
+#endif	/* __GNU__ */
+
+	if (!(f = fopen("/proc/swaps", "r")))
+		return 0;
+	/* Skip the first line */
+	if (!fgets(buf, sizeof(buf), f))
+		goto leave;
+	if (*buf && strncmp(buf, "Filename\t", 9))
+		/* Linux <=2.6.19 contained a bug in the /proc/swaps
+		 * code where the header would not be displayed
+		 */
+		goto valid_first_line;
+
+	while (fgets(buf, sizeof(buf), f)) {
+valid_first_line:
+		if ((cp = strchr(buf, ' ')) != NULL)
+			*cp = 0;
+		if ((cp = strchr(buf, '\t')) != NULL)
+			*cp = 0;
+		if (strcmp(buf, file) == 0) {
+			ret++;
+			break;
+		}
+#ifndef __GNU__
+		if (file_dev && (stat(buf, &st_buf) == 0) &&
+		    S_ISBLK(st_buf.st_mode) &&
+		    file_dev == st_buf.st_rdev) {
+			ret++;
+			break;
+		}
+#endif	/* __GNU__ */
+	}
+
+leave:
+	fclose(f);
+	return ret;
+}
+
+
+/*
+ * check_mount_point() fills determines if the device is mounted or otherwise
+ * busy, and fills in mount_flags with one or more of the following flags:
+ * MF_MOUNTED, MF_ISROOT, MF_READONLY, MF_SWAP, and MF_BUSY.  If mtpt is
+ * non-NULL, the directory where the device is mounted is copied to where mtpt
+ * is pointing, up to mtlen characters.
+ */
+#ifdef __TURBOC__
+ #pragma argsused
+#endif
+int check_mount_point(const char *device, int *mount_flags,
+				  char *mtpt, int mtlen)
+{
+	struct stat	st_buf;
+	int	retval = 0;
+	int		fd;
+
+	if (is_swap_device(device)) {
+		*mount_flags = MF_MOUNTED | MF_SWAP;
+		strncpy(mtpt, "<swap>", mtlen);
+	} else {
+#ifdef HAVE_MNTENT_H
+		retval = check_mntent(device, mount_flags, mtpt, mtlen);
+#else
+#ifdef HAVE_GETMNTINFO
+		retval = check_getmntinfo(device, mount_flags, mtpt, mtlen);
+#else
+#ifdef __GNUC__
+ #warning "Can't use getmntent or getmntinfo to check for mounted filesystems!"
+#endif
+		*mount_flags = 0;
+#endif /* HAVE_GETMNTINFO */
+#endif /* HAVE_MNTENT_H */
+	}
+	if (retval)
+		return retval;
+
+#ifdef __linux__ /* This only works on Linux 2.6+ systems */
+	if ((stat(device, &st_buf) != 0) ||
+	    !S_ISBLK(st_buf.st_mode))
+		return 0;
+	fd = open(device, O_RDONLY | O_EXCL);
+	if (fd < 0) {
+		if (errno == EBUSY)
+			*mount_flags |= MF_BUSY;
+	} else
+		close(fd);
+#endif
+
+	return 0;
+}
+
+int is_mounted(const char *file)
+{
+	int	retval;
+	int	mount_flags = 0;
+
+	retval = check_mount_point(file, &mount_flags, NULL, 0);
+	if (retval)
+		return 0;
+	return mount_flags & MF_MOUNTED;
+}
+
+#ifdef TEST_PROGRAM
+int main(int argc, char **argv)
+{
+	int flags = 0;
+	char devname[PATH_MAX];
+
+	if (argc < 2) {
+		fprintf(stderr, "Usage: %s device\n", argv[0]);
+		return EXIT_FAILURE;
+	}
+
+	if (check_mount_point(argv[1], &flags, devname, sizeof(devname)) == 0 &&
+	    (flags & MF_MOUNTED)) {
+		if (flags & MF_SWAP)
+			printf("used swap device\n");
+		else
+			printf("mounted on %s\n", devname);
+		return EXIT_SUCCESS;
+	}
+
+	printf("not mounted\n");
+	return EXIT_FAILURE;
+}
+#endif /* DEBUG */
diff --git a/util-linux-ng-2.17.2/lib/linux_version.c b/util-linux-ng-2.17.2/lib/linux_version.c
new file mode 100644
index 0000000..f9fbd8d
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/linux_version.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <sys/utsname.h>
+
+#include "linux_version.h"
+
+int
+get_linux_version (void)
+{
+	static int kver = -1;
+	struct utsname uts;
+	int major;
+	int minor;
+	int teeny;
+
+	if (kver != -1)
+		return kver;
+	if (uname (&uts))
+		kver = 0;
+	else if (sscanf (uts.release, "%d.%d.%d", &major, &minor, &teeny) != 3)
+		kver = 0;
+	else
+		kver = KERNEL_VERSION (major, minor, teeny);
+
+	return kver;
+}
diff --git a/util-linux-ng-2.17.2/lib/md5.c b/util-linux-ng-2.17.2/lib/md5.c
new file mode 100644
index 0000000..6ad4b68
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/md5.c
@@ -0,0 +1,259 @@
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest.  This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+#include <endian.h>
+#include <string.h>		/* for memcpy() */
+
+#include "md5.h"
+
+#if !defined __BYTE_ORDER || !(__BYTE_ORDER == __LITTLE_ENDIAN) && !(__BYTE_ORDER == __BIG_ENDIAN)
+#error missing __BYTE_ORDER
+#endif
+
+#if (__BYTE_ORDER == __LITTLE_ENDIAN)
+#define byteReverse(buf, len)	/* Nothing */
+#else
+void byteReverse(unsigned char *buf, unsigned longs);
+
+#ifndef ASM_MD5
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+void byteReverse(unsigned char *buf, unsigned longs)
+{
+    uint32_t t;
+    do {
+	t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+	    ((unsigned) buf[1] << 8 | buf[0]);
+	*(uint32_t *) buf = t;
+	buf += 4;
+    } while (--longs);
+}
+#endif
+#endif
+
+/*
+ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+void MD5Init(struct MD5Context *ctx)
+{
+    ctx->buf[0] = 0x67452301;
+    ctx->buf[1] = 0xefcdab89;
+    ctx->buf[2] = 0x98badcfe;
+    ctx->buf[3] = 0x10325476;
+
+    ctx->bits[0] = 0;
+    ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+{
+    uint32_t t;
+
+    /* Update bitcount */
+
+    t = ctx->bits[0];
+    if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
+	ctx->bits[1]++;		/* Carry from low to high */
+    ctx->bits[1] += len >> 29;
+
+    t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */
+
+    /* Handle any leading odd-sized chunks */
+
+    if (t) {
+	unsigned char *p = (unsigned char *) ctx->in + t;
+
+	t = 64 - t;
+	if (len < t) {
+	    memcpy(p, buf, len);
+	    return;
+	}
+	memcpy(p, buf, t);
+	byteReverse(ctx->in, 16);
+	MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+	buf += t;
+	len -= t;
+    }
+    /* Process data in 64-byte chunks */
+
+    while (len >= 64) {
+	memcpy(ctx->in, buf, 64);
+	byteReverse(ctx->in, 16);
+	MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+	buf += 64;
+	len -= 64;
+    }
+
+    /* Handle any remaining bytes of data. */
+
+    memcpy(ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern 
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+{
+    unsigned count;
+    unsigned char *p;
+
+    /* Compute number of bytes mod 64 */
+    count = (ctx->bits[0] >> 3) & 0x3F;
+
+    /* Set the first char of padding to 0x80.  This is safe since there is
+       always at least one byte free */
+    p = ctx->in + count;
+    *p++ = 0x80;
+
+    /* Bytes of padding needed to make 64 bytes */
+    count = 64 - 1 - count;
+
+    /* Pad out to 56 mod 64 */
+    if (count < 8) {
+	/* Two lots of padding:  Pad the first block to 64 bytes */
+	memset(p, 0, count);
+	byteReverse(ctx->in, 16);
+	MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+
+	/* Now fill the next block with 56 bytes */
+	memset(ctx->in, 0, 56);
+    } else {
+	/* Pad block to 56 bytes */
+	memset(p, 0, count - 8);
+    }
+    byteReverse(ctx->in, 14);
+
+    /* Append length in bits and transform */
+    ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+    ((uint32_t *) ctx->in)[15] = ctx->bits[1];
+
+    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+    byteReverse((unsigned char *) ctx->buf, 4);
+    memcpy(digest, ctx->buf, 16);
+    memset(ctx, 0, sizeof(*ctx));	/* In case it's sensitive */
+}
+
+#ifndef ASM_MD5
+
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data.  MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+void MD5Transform(uint32_t buf[4], uint32_t const in[16])
+{
+    register uint32_t a, b, c, d;
+
+    a = buf[0];
+    b = buf[1];
+    c = buf[2];
+    d = buf[3];
+
+    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+    buf[0] += a;
+    buf[1] += b;
+    buf[2] += c;
+    buf[3] += d;
+}
+
+#endif
+
diff --git a/util-linux-ng-2.17.2/lib/setproctitle.c b/util-linux-ng-2.17.2/lib/setproctitle.c
new file mode 100644
index 0000000..319bc6a
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/setproctitle.c
@@ -0,0 +1,109 @@
+/* proctitle code - we know this to work only on linux... */
+
+/*
+**  SETPROCTITLE -- set process title for ps (from sendmail)
+**
+**      Parameters:
+**              fmt -- a printf style format string.
+**
+**      Returns:
+**              none.
+**
+**      Side Effects:
+**              Clobbers argv of our main procedure so ps(1) will
+**              display the title.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include "setproctitle.h"
+
+#ifndef SPT_BUFSIZE
+#define SPT_BUFSIZE     2048
+#endif
+
+extern char** environ;
+
+static char** argv0;
+static int argv_lth;
+
+void
+initproctitle (int argc, char **argv) {
+	int i;
+	char **envp = environ;
+
+	/*
+	 * Move the environment so we can reuse the memory.
+	 * (Code borrowed from sendmail.)
+	 * WARNING: ugly assumptions on memory layout here;
+	 *          if this ever causes problems, #undef DO_PS_FIDDLING
+	 */
+	for (i = 0; envp[i] != NULL; i++)
+		continue;
+	environ = (char **) malloc(sizeof(char *) * (i + 1));
+	if (environ == NULL)
+		return;
+	for (i = 0; envp[i] != NULL; i++)
+		if ((environ[i] = strdup(envp[i])) == NULL)
+			return;
+	environ[i] = NULL;
+
+	argv0 = argv;
+	if (i > 0)
+		argv_lth = envp[i-1] + strlen(envp[i-1]) - argv0[0];
+	else
+		argv_lth = argv0[argc-1] + strlen(argv0[argc-1]) - argv0[0];
+}	
+
+#if 0
+/* Nice code, but many places do not know about vsnprintf ... */
+void
+setproctitle (const char *fmt,...) {
+	int        i;
+	char       buf[SPT_BUFSIZE];
+	va_list    ap;
+
+	if (!argv0)
+		return;
+
+	va_start(ap, fmt);
+	(void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap);
+	va_end(ap);
+
+	i = strlen (buf);
+	if (i > argv_lth - 2) {
+		i = argv_lth - 2;
+		buf[i] = '\0';
+	}
+	memset(argv0[0], '\0', argv_lth);       /* clear the memory area */
+	(void) strcpy (argv0[0], buf);
+
+	argv0[1] = NULL;
+}
+#else
+void
+setproctitle (const char *prog, const char *txt) {
+        int        i;
+        char       buf[SPT_BUFSIZE];
+
+        if (!argv0)
+                return;
+
+	if (strlen(prog) + strlen(txt) + 5 > SPT_BUFSIZE)
+		return;
+
+        (void) sprintf(buf, "%s -- %s", prog, txt);
+
+        i = strlen (buf);
+        if (i > argv_lth - 2) {
+                i = argv_lth - 2;
+                buf[i] = '\0';
+        }
+	memset(argv0[0], '\0', argv_lth);       /* clear the memory area */
+        (void) strcpy (argv0[0], buf);
+
+        argv0[1] = NULL;
+}
+#endif
diff --git a/util-linux-ng-2.17.2/lib/wholedisk.c b/util-linux-ng-2.17.2/lib/wholedisk.c
new file mode 100644
index 0000000..35f143d
--- /dev/null
+++ b/util-linux-ng-2.17.2/lib/wholedisk.c
@@ -0,0 +1,58 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "blkdev.h"
+#include "wholedisk.h"
+
+int is_whole_disk_fd(int fd, const char *name)
+{
+#ifdef HDIO_GETGEO
+	struct hd_geometry geometry;
+	int i = 0;
+
+	if (fd != -1)
+		i = ioctl(fd, HDIO_GETGEO, &geometry);
+	if (i == 0)
+		return geometry.start == 0;
+#endif
+	/*
+	 * The "silly heuristic" is still sexy for us, because
+	 * for example Xen doesn't implement HDIO_GETGEO for virtual
+	 * block devices (/dev/xvda).
+	 *
+	 * -- kzak@redhat.com (23-Feb-2006)
+	 */
+	while (*name)
+		name++;
+	return !isdigit(name[-1]);
+}
+
+int is_whole_disk(const char *name)
+{
+	int fd = -1, res = 0;
+#ifdef HDIO_GETGEO
+	fd = open(name, O_RDONLY);
+	if (fd != -1)
+#endif
+		res = is_whole_disk_fd(fd, name);
+
+	if (fd != -1)
+		close(fd);
+	return res;
+}
+
+#ifdef TEST_PROGRAM
+int main(int argc, char **argv)
+{
+	if (argc < 2) {
+		fprintf(stderr, "usage: %s <device>\n", argv[0]);
+		exit(EXIT_FAILURE);
+	}
+
+	printf("%s: is%s whole disk\n", argv[1],
+			is_whole_disk(argv[1]) ? "" : " NOT");
+	exit(EXIT_SUCCESS);
+}
+#endif
diff --git a/util-linux-ng-2.17.2/licenses/COPYING.GPL b/util-linux-ng-2.17.2/licenses/COPYING.GPL
new file mode 100644
index 0000000..a43ea21
--- /dev/null
+++ b/util-linux-ng-2.17.2/licenses/COPYING.GPL
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, 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
+
+	Appendix: 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) 19yy  <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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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.
diff --git a/util-linux-ng-2.17.2/licenses/COPYING.UCB b/util-linux-ng-2.17.2/licenses/COPYING.UCB
new file mode 100644
index 0000000..9abbf24
--- /dev/null
+++ b/util-linux-ng-2.17.2/licenses/COPYING.UCB
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
diff --git a/util-linux-ng-2.17.2/login-utils/Makefile.am b/util-linux-ng-2.17.2/login-utils/Makefile.am
new file mode 100644
index 0000000..920a6e7
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/Makefile.am
@@ -0,0 +1,140 @@
+include $(top_srcdir)/config/include-Makefile.am
+
+bin_PROGRAMS =
+usrbin_exec_PROGRAMS =
+sbin_PROGRAMS =
+usrsbin_exec_PROGRAMS =
+dist_man_MANS =
+
+EXTRA_DIST = README.getty  README.modems-with-agetty  README.poeigl
+
+if BUILD_AGETTY
+sbin_PROGRAMS += agetty
+dist_man_MANS += agetty.8
+endif
+
+if BUILD_INIT
+
+sbin_PROGRAMS += simpleinit shutdown initctl
+dist_man_MANS += fastboot.8 fasthalt.8 halt.8 reboot.8 simpleinit.8 shutdown.8 \
+	initctl.8
+
+simpleinit_SOURCES = simpleinit.c my_crypt.h simpleinit.h
+initctl_SOURCES = initctl.c simpleinit.h
+
+if NEED_LIBCRYPT
+simpleinit_LDADD = -lcrypt
+endif
+
+endif # BUILD_INIT
+
+if BUILD_LAST
+usrbin_exec_PROGRAMS += last
+dist_man_MANS += last.1
+endif
+
+if BUILD_LOGIN_UTILS
+
+bin_PROGRAMS += login
+usrbin_exec_PROGRAMS += chfn chsh newgrp
+usrsbin_exec_PROGRAMS += vipw
+dist_man_MANS += chfn.1 chsh.1 login.1 newgrp.1 vipw.8 vigr.8
+
+# login, chfn and chsh libs
+login_ldadd_common =
+
+chfn_SOURCES = chfn.c $(chfn_chsh_common)
+chsh_SOURCES = chsh.c $(chfn_chsh_common)
+chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \
+	../lib/env.c
+login_SOURCES = login.c login.h my_crypt.h ../lib/setproctitle.c
+newgrp_SOURCES = newgrp.c my_crypt.h
+vipw_SOURCES = vipw.c setpwnam.h
+
+chfn_LDADD = $(login_ldadd_common)
+chsh_LDADD = $(login_ldadd_common)
+login_LDADD = $(login_ldadd_common)
+newgrp_LDADD =
+vipw_LDADD =
+
+chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+
+chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+
+if HAVE_PAM
+login_ldadd_common += -lpam -lpam_misc
+else
+if NEED_LIBCRYPT
+login_ldadd_common += -lcrypt
+endif
+login_SOURCES += checktty.c
+endif #! HAVE_PAM
+
+if NEED_LIBCRYPT
+newgrp_LDADD += -lcrypt
+endif
+
+if HAVE_AUDIT
+login_LDADD += -laudit
+endif
+
+if HAVE_SELINUX
+chfn_SOURCES += selinux_utils.c selinux_utils.h
+chsh_SOURCES += selinux_utils.c selinux_utils.h
+vipw_LDADD += -lselinux
+login_ldadd_common += -lselinux
+endif
+
+
+install-exec-hook::
+	cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
+
+endif
+
+if BUILD_MESG
+usrbin_exec_PROGRAMS += mesg
+dist_man_MANS += mesg.1
+endif
+
+if BUILD_WALL
+usrbin_exec_PROGRAMS += wall
+wall_SOURCES = wall.c ttymsg.c ttymsg.h
+dist_man_MANS += wall.1
+
+if USE_TTY_GROUP
+if MAKEINSTALL_DO_CHOWN
+install-exec-hook::
+	chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
+	chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
+endif
+endif
+endif
+
+if BUILD_INIT
+
+install-exec-hook::
+	cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot
+	cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot
+	cd $(DESTDIR)$(sbindir) && ln -sf shutdown halt
+	cd $(DESTDIR)$(sbindir) && ln -sf shutdown fasthalt
+	cd $(DESTDIR)$(sbindir) && ln -sf initctl need
+	cd $(DESTDIR)$(sbindir) && ln -sf initctl display-services
+	cd $(DESTDIR)$(sbindir) && ln -sf initctl provide
+
+install-data-hook:
+	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8
+	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8
+	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8
+
+endif
+
+noinst_PROGRAMS = checktty_test islocal_test
+checktty_test_SOURCES = checktty.c login.h
+checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS)
+islocal_test_SOURCES = islocal.c
+islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS)
+
diff --git a/util-linux-ng-2.17.2/login-utils/Makefile.in b/util-linux-ng-2.17.2/login-utils/Makefile.in
new file mode 100644
index 0000000..cf5b55b
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/Makefile.in
@@ -0,0 +1,1353 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(dist_man_MANS) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config/include-Makefile.am
+bin_PROGRAMS = $(am__EXEEXT_1)
+usrbin_exec_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
+	$(am__EXEEXT_7)
+sbin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3)
+usrsbin_exec_PROGRAMS = $(am__EXEEXT_8)
+@BUILD_AGETTY_TRUE@am__append_1 = agetty
+@BUILD_AGETTY_TRUE@am__append_2 = agetty.8
+@BUILD_INIT_TRUE@am__append_3 = simpleinit shutdown initctl
+@BUILD_INIT_TRUE@am__append_4 = fastboot.8 fasthalt.8 halt.8 reboot.8 simpleinit.8 shutdown.8 \
+@BUILD_INIT_TRUE@	initctl.8
+
+@BUILD_LAST_TRUE@am__append_5 = last
+@BUILD_LAST_TRUE@am__append_6 = last.1
+@BUILD_LOGIN_UTILS_TRUE@am__append_7 = login
+@BUILD_LOGIN_UTILS_TRUE@am__append_8 = chfn chsh newgrp
+@BUILD_LOGIN_UTILS_TRUE@am__append_9 = vipw
+@BUILD_LOGIN_UTILS_TRUE@am__append_10 = chfn.1 chsh.1 login.1 newgrp.1 vipw.8 vigr.8
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_PAM_TRUE@am__append_11 = -lpam -lpam_misc
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_PAM_FALSE@@NEED_LIBCRYPT_TRUE@am__append_12 = -lcrypt
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_PAM_FALSE@am__append_13 = checktty.c
+@BUILD_LOGIN_UTILS_TRUE@@NEED_LIBCRYPT_TRUE@am__append_14 = -lcrypt
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_AUDIT_TRUE@am__append_15 = -laudit
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_SELINUX_TRUE@am__append_16 = selinux_utils.c selinux_utils.h
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_SELINUX_TRUE@am__append_17 = selinux_utils.c selinux_utils.h
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_SELINUX_TRUE@am__append_18 = -lselinux
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_SELINUX_TRUE@am__append_19 = -lselinux
+@BUILD_MESG_TRUE@am__append_20 = mesg
+@BUILD_MESG_TRUE@am__append_21 = mesg.1
+@BUILD_WALL_TRUE@am__append_22 = wall
+@BUILD_WALL_TRUE@am__append_23 = wall.1
+noinst_PROGRAMS = checktty_test$(EXEEXT) islocal_test$(EXEEXT)
+subdir = login-utils
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+	$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
+	$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+	$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/tls.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@BUILD_LOGIN_UTILS_TRUE@am__EXEEXT_1 = login$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \
+	"$(DESTDIR)$(usrbin_execdir)" "$(DESTDIR)$(usrsbin_execdir)" \
+	"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"
+@BUILD_AGETTY_TRUE@am__EXEEXT_2 = agetty$(EXEEXT)
+@BUILD_INIT_TRUE@am__EXEEXT_3 = simpleinit$(EXEEXT) shutdown$(EXEEXT) \
+@BUILD_INIT_TRUE@	initctl$(EXEEXT)
+@BUILD_LAST_TRUE@am__EXEEXT_4 = last$(EXEEXT)
+@BUILD_LOGIN_UTILS_TRUE@am__EXEEXT_5 = chfn$(EXEEXT) chsh$(EXEEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	newgrp$(EXEEXT)
+@BUILD_MESG_TRUE@am__EXEEXT_6 = mesg$(EXEEXT)
+@BUILD_WALL_TRUE@am__EXEEXT_7 = wall$(EXEEXT)
+@BUILD_LOGIN_UTILS_TRUE@am__EXEEXT_8 = vipw$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) \
+	$(usrbin_exec_PROGRAMS) $(usrsbin_exec_PROGRAMS)
+agetty_SOURCES = agetty.c
+agetty_OBJECTS = agetty.$(OBJEXT)
+agetty_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am_checktty_test_OBJECTS = checktty_test-checktty.$(OBJEXT)
+checktty_test_OBJECTS = $(am_checktty_test_OBJECTS)
+checktty_test_LDADD = $(LDADD)
+am__chfn_SOURCES_DIST = chfn.c islocal.c setpwnam.c islocal.h \
+	my_crypt.h setpwnam.h ../lib/env.c selinux_utils.c \
+	selinux_utils.h
+@BUILD_LOGIN_UTILS_TRUE@am__objects_1 = chfn-islocal.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	chfn-setpwnam.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	chfn-env.$(OBJEXT)
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_SELINUX_TRUE@am__objects_2 = chfn-selinux_utils.$(OBJEXT)
+@BUILD_LOGIN_UTILS_TRUE@am_chfn_OBJECTS = chfn-chfn.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__objects_1) $(am__objects_2)
+chfn_OBJECTS = $(am_chfn_OBJECTS)
+am__DEPENDENCIES_1 =
+@BUILD_LOGIN_UTILS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__DEPENDENCIES_1) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__DEPENDENCIES_1)
+@BUILD_LOGIN_UTILS_TRUE@chfn_DEPENDENCIES = $(am__DEPENDENCIES_2)
+chfn_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(chfn_CFLAGS) $(CFLAGS) \
+	$(chfn_LDFLAGS) $(LDFLAGS) -o $@
+am__chsh_SOURCES_DIST = chsh.c islocal.c setpwnam.c islocal.h \
+	my_crypt.h setpwnam.h ../lib/env.c selinux_utils.c \
+	selinux_utils.h
+@BUILD_LOGIN_UTILS_TRUE@am__objects_3 = chsh-islocal.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	chsh-setpwnam.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	chsh-env.$(OBJEXT)
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_SELINUX_TRUE@am__objects_4 = chsh-selinux_utils.$(OBJEXT)
+@BUILD_LOGIN_UTILS_TRUE@am_chsh_OBJECTS = chsh-chsh.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__objects_3) $(am__objects_4)
+chsh_OBJECTS = $(am_chsh_OBJECTS)
+@BUILD_LOGIN_UTILS_TRUE@chsh_DEPENDENCIES = $(am__DEPENDENCIES_2)
+chsh_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(chsh_CFLAGS) $(CFLAGS) \
+	$(chsh_LDFLAGS) $(LDFLAGS) -o $@
+am__initctl_SOURCES_DIST = initctl.c simpleinit.h
+@BUILD_INIT_TRUE@am_initctl_OBJECTS = initctl.$(OBJEXT)
+initctl_OBJECTS = $(am_initctl_OBJECTS)
+initctl_LDADD = $(LDADD)
+am_islocal_test_OBJECTS = islocal_test-islocal.$(OBJEXT)
+islocal_test_OBJECTS = $(am_islocal_test_OBJECTS)
+islocal_test_LDADD = $(LDADD)
+last_SOURCES = last.c
+last_OBJECTS = last.$(OBJEXT)
+last_LDADD = $(LDADD)
+am__login_SOURCES_DIST = login.c login.h my_crypt.h \
+	../lib/setproctitle.c checktty.c
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_PAM_FALSE@am__objects_5 =  \
+@BUILD_LOGIN_UTILS_TRUE@@HAVE_PAM_FALSE@	checktty.$(OBJEXT)
+@BUILD_LOGIN_UTILS_TRUE@am_login_OBJECTS = login.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	setproctitle.$(OBJEXT) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__objects_5)
+login_OBJECTS = $(am_login_OBJECTS)
+@BUILD_LOGIN_UTILS_TRUE@login_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__DEPENDENCIES_1)
+mesg_SOURCES = mesg.c
+mesg_OBJECTS = mesg.$(OBJEXT)
+mesg_LDADD = $(LDADD)
+am__newgrp_SOURCES_DIST = newgrp.c my_crypt.h
+@BUILD_LOGIN_UTILS_TRUE@am_newgrp_OBJECTS = newgrp-newgrp.$(OBJEXT)
+newgrp_OBJECTS = $(am_newgrp_OBJECTS)
+@BUILD_LOGIN_UTILS_TRUE@newgrp_DEPENDENCIES = $(am__DEPENDENCIES_1)
+newgrp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(newgrp_CFLAGS) $(CFLAGS) \
+	$(newgrp_LDFLAGS) $(LDFLAGS) -o $@
+shutdown_SOURCES = shutdown.c
+shutdown_OBJECTS = shutdown.$(OBJEXT)
+shutdown_LDADD = $(LDADD)
+am__simpleinit_SOURCES_DIST = simpleinit.c my_crypt.h simpleinit.h
+@BUILD_INIT_TRUE@am_simpleinit_OBJECTS = simpleinit.$(OBJEXT)
+simpleinit_OBJECTS = $(am_simpleinit_OBJECTS)
+simpleinit_DEPENDENCIES =
+am__vipw_SOURCES_DIST = vipw.c setpwnam.h
+@BUILD_LOGIN_UTILS_TRUE@am_vipw_OBJECTS = vipw.$(OBJEXT)
+vipw_OBJECTS = $(am_vipw_OBJECTS)
+@BUILD_LOGIN_UTILS_TRUE@vipw_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am__wall_SOURCES_DIST = wall.c ttymsg.c ttymsg.h
+@BUILD_WALL_TRUE@am_wall_OBJECTS = wall.$(OBJEXT) ttymsg.$(OBJEXT)
+wall_OBJECTS = $(am_wall_OBJECTS)
+wall_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = agetty.c $(checktty_test_SOURCES) $(chfn_SOURCES) \
+	$(chsh_SOURCES) $(initctl_SOURCES) $(islocal_test_SOURCES) \
+	last.c $(login_SOURCES) mesg.c $(newgrp_SOURCES) shutdown.c \
+	$(simpleinit_SOURCES) $(vipw_SOURCES) $(wall_SOURCES)
+DIST_SOURCES = agetty.c $(checktty_test_SOURCES) \
+	$(am__chfn_SOURCES_DIST) $(am__chsh_SOURCES_DIST) \
+	$(am__initctl_SOURCES_DIST) $(islocal_test_SOURCES) last.c \
+	$(am__login_SOURCES_DIST) mesg.c $(am__newgrp_SOURCES_DIST) \
+	shutdown.c $(am__simpleinit_SOURCES_DIST) \
+	$(am__vipw_SOURCES_DIST) $(am__wall_SOURCES_DIST)
+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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(dist_man_MANS)
+am__dist_noinst_DATA_DIST = agetty.8 fastboot.8 fasthalt.8 halt.8 \
+	reboot.8 simpleinit.8 shutdown.8 initctl.8 last.1 chfn.1 \
+	chsh.1 login.1 newgrp.1 vipw.8 vigr.8 mesg.1 wall.1
+DATA = $(dist_noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BLKID_CFLAGS = @BLKID_CFLAGS@
+BLKID_LIBS = @BLKID_LIBS@
+BLKID_LIBS_STATIC = @BLKID_LIBS_STATIC@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID_DATE = @LIBBLKID_DATE@
+LIBBLKID_VERSION = @LIBBLKID_VERSION@
+LIBBLKID_VERSION_INFO = @LIBBLKID_VERSION_INFO@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID_VERSION = @LIBUUID_VERSION@
+LIBUUID_VERSION_INFO = @LIBUUID_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+NCURSES_LIBS = @NCURSES_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SELINUX_LIBS = @SELINUX_LIBS@
+SELINUX_LIBS_STATIC = @SELINUX_LIBS_STATIC@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUID_CFLAGS = @SUID_CFLAGS@
+SUID_LDFLAGS = @SUID_LDFLAGS@
+USE_NLS = @USE_NLS@
+UUID_CFLAGS = @UUID_CFLAGS@
+UUID_LIBS = @UUID_LIBS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XSLTPROC = @XSLTPROC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+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 = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libdirname = @libdirname@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+usrbin_execdir = @usrbin_execdir@
+usrlib_execdir = @usrlib_execdir@
+usrsbin_execdir = @usrsbin_execdir@
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include \
+	-DLOCALEDIR=\"$(localedir)\"
+
+AM_CFLAGS = -fsigned-char
+AM_LDFLAGS = 
+
+# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
+# Unlike with other dist primaries, the files are not distributed if the
+# conditional is false.
+# Work the bug around until it is fixed:
+dist_noinst_DATA = $(dist_man_MANS)
+
+# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
+#
+# blkid
+ul_libblkid_srcdir = $(top_srcdir)/shlibs/blkid/src
+ul_libblkid_builddir = $(top_builddir)/shlibs/blkid/src
+ul_libblkid_la = $(top_builddir)/shlibs/blkid/src/libblkid.la
+
+# blkid.h is generated by ./configure script and stored in build directory
+ul_libblkid_incdir = $(ul_libblkid_builddir)
+
+# uuid
+ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src
+ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src
+ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la
+dist_man_MANS = $(am__append_2) $(am__append_4) $(am__append_6) \
+	$(am__append_10) $(am__append_21) $(am__append_23)
+EXTRA_DIST = README.getty  README.modems-with-agetty  README.poeigl
+@BUILD_INIT_TRUE@simpleinit_SOURCES = simpleinit.c my_crypt.h simpleinit.h
+@BUILD_INIT_TRUE@initctl_SOURCES = initctl.c simpleinit.h
+@BUILD_INIT_TRUE@@NEED_LIBCRYPT_TRUE@simpleinit_LDADD = -lcrypt
+
+# login, chfn and chsh libs
+@BUILD_LOGIN_UTILS_TRUE@login_ldadd_common = $(am__append_11) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__append_12) $(am__append_19)
+@BUILD_LOGIN_UTILS_TRUE@chfn_SOURCES = chfn.c $(chfn_chsh_common) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__append_16)
+@BUILD_LOGIN_UTILS_TRUE@chsh_SOURCES = chsh.c $(chfn_chsh_common) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__append_17)
+@BUILD_LOGIN_UTILS_TRUE@chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \
+@BUILD_LOGIN_UTILS_TRUE@	../lib/env.c
+
+@BUILD_LOGIN_UTILS_TRUE@login_SOURCES = login.c login.h my_crypt.h \
+@BUILD_LOGIN_UTILS_TRUE@	../lib/setproctitle.c $(am__append_13)
+@BUILD_LOGIN_UTILS_TRUE@newgrp_SOURCES = newgrp.c my_crypt.h
+@BUILD_LOGIN_UTILS_TRUE@vipw_SOURCES = vipw.c setpwnam.h
+@BUILD_LOGIN_UTILS_TRUE@chfn_LDADD = $(login_ldadd_common)
+@BUILD_LOGIN_UTILS_TRUE@chsh_LDADD = $(login_ldadd_common)
+@BUILD_LOGIN_UTILS_TRUE@login_LDADD = $(login_ldadd_common) \
+@BUILD_LOGIN_UTILS_TRUE@	$(am__append_15)
+@BUILD_LOGIN_UTILS_TRUE@newgrp_LDADD = $(am__append_14)
+@BUILD_LOGIN_UTILS_TRUE@vipw_LDADD = $(am__append_18)
+@BUILD_LOGIN_UTILS_TRUE@chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+@BUILD_LOGIN_UTILS_TRUE@chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+@BUILD_LOGIN_UTILS_TRUE@newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+@BUILD_LOGIN_UTILS_TRUE@chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+@BUILD_LOGIN_UTILS_TRUE@chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+@BUILD_LOGIN_UTILS_TRUE@newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+@BUILD_WALL_TRUE@wall_SOURCES = wall.c ttymsg.c ttymsg.h
+checktty_test_SOURCES = checktty.c login.h
+checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS)
+islocal_test_SOURCES = islocal.c
+islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/include-Makefile.am $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign login-utils/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign login-utils/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
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+install-usrbin_execPROGRAMS: $(usrbin_exec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(usrbin_execdir)" || $(MKDIR_P) "$(DESTDIR)$(usrbin_execdir)"
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(usrbin_execdir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usrbin_execdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-usrbin_execPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$(usrbin_execdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(usrbin_execdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(usrbin_execdir)" && rm -f $$files
+
+clean-usrbin_execPROGRAMS:
+	@list='$(usrbin_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+install-usrsbin_execPROGRAMS: $(usrsbin_exec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(usrsbin_execdir)" || $(MKDIR_P) "$(DESTDIR)$(usrsbin_execdir)"
+	@list='$(usrsbin_exec_PROGRAMS)'; test -n "$(usrsbin_execdir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(usrsbin_execdir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(usrsbin_execdir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-usrsbin_execPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(usrsbin_exec_PROGRAMS)'; test -n "$(usrsbin_execdir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(usrsbin_execdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(usrsbin_execdir)" && rm -f $$files
+
+clean-usrsbin_execPROGRAMS:
+	@list='$(usrsbin_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+agetty$(EXEEXT): $(agetty_OBJECTS) $(agetty_DEPENDENCIES) 
+	@rm -f agetty$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(agetty_OBJECTS) $(agetty_LDADD) $(LIBS)
+checktty_test$(EXEEXT): $(checktty_test_OBJECTS) $(checktty_test_DEPENDENCIES) 
+	@rm -f checktty_test$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(checktty_test_OBJECTS) $(checktty_test_LDADD) $(LIBS)
+chfn$(EXEEXT): $(chfn_OBJECTS) $(chfn_DEPENDENCIES) 
+	@rm -f chfn$(EXEEXT)
+	$(AM_V_CCLD)$(chfn_LINK) $(chfn_OBJECTS) $(chfn_LDADD) $(LIBS)
+chsh$(EXEEXT): $(chsh_OBJECTS) $(chsh_DEPENDENCIES) 
+	@rm -f chsh$(EXEEXT)
+	$(AM_V_CCLD)$(chsh_LINK) $(chsh_OBJECTS) $(chsh_LDADD) $(LIBS)
+initctl$(EXEEXT): $(initctl_OBJECTS) $(initctl_DEPENDENCIES) 
+	@rm -f initctl$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(initctl_OBJECTS) $(initctl_LDADD) $(LIBS)
+islocal_test$(EXEEXT): $(islocal_test_OBJECTS) $(islocal_test_DEPENDENCIES) 
+	@rm -f islocal_test$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(islocal_test_OBJECTS) $(islocal_test_LDADD) $(LIBS)
+last$(EXEEXT): $(last_OBJECTS) $(last_DEPENDENCIES) 
+	@rm -f last$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(last_OBJECTS) $(last_LDADD) $(LIBS)
+login$(EXEEXT): $(login_OBJECTS) $(login_DEPENDENCIES) 
+	@rm -f login$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(login_OBJECTS) $(login_LDADD) $(LIBS)
+mesg$(EXEEXT): $(mesg_OBJECTS) $(mesg_DEPENDENCIES) 
+	@rm -f mesg$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(mesg_OBJECTS) $(mesg_LDADD) $(LIBS)
+newgrp$(EXEEXT): $(newgrp_OBJECTS) $(newgrp_DEPENDENCIES) 
+	@rm -f newgrp$(EXEEXT)
+	$(AM_V_CCLD)$(newgrp_LINK) $(newgrp_OBJECTS) $(newgrp_LDADD) $(LIBS)
+shutdown$(EXEEXT): $(shutdown_OBJECTS) $(shutdown_DEPENDENCIES) 
+	@rm -f shutdown$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(shutdown_OBJECTS) $(shutdown_LDADD) $(LIBS)
+simpleinit$(EXEEXT): $(simpleinit_OBJECTS) $(simpleinit_DEPENDENCIES) 
+	@rm -f simpleinit$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(simpleinit_OBJECTS) $(simpleinit_LDADD) $(LIBS)
+vipw$(EXEEXT): $(vipw_OBJECTS) $(vipw_DEPENDENCIES) 
+	@rm -f vipw$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(vipw_OBJECTS) $(vipw_LDADD) $(LIBS)
+wall$(EXEEXT): $(wall_OBJECTS) $(wall_DEPENDENCIES) 
+	@rm -f wall$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(wall_OBJECTS) $(wall_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agetty.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checktty.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checktty_test-checktty.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chfn-chfn.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chfn-env.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chfn-islocal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chfn-selinux_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chfn-setpwnam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chsh-chsh.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chsh-env.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chsh-islocal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chsh-selinux_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chsh-setpwnam.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initctl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/islocal_test-islocal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/last.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/login.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mesg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newgrp-newgrp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setproctitle.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleinit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttymsg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vipw.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wall.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+checktty_test-checktty.o: checktty.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(checktty_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT checktty_test-checktty.o -MD -MP -MF $(DEPDIR)/checktty_test-checktty.Tpo -c -o checktty_test-checktty.o `test -f 'checktty.c' || echo '$(srcdir)/'`checktty.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/checktty_test-checktty.Tpo $(DEPDIR)/checktty_test-checktty.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='checktty.c' object='checktty_test-checktty.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(checktty_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o checktty_test-checktty.o `test -f 'checktty.c' || echo '$(srcdir)/'`checktty.c
+
+checktty_test-checktty.obj: checktty.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(checktty_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT checktty_test-checktty.obj -MD -MP -MF $(DEPDIR)/checktty_test-checktty.Tpo -c -o checktty_test-checktty.obj `if test -f 'checktty.c'; then $(CYGPATH_W) 'checktty.c'; else $(CYGPATH_W) '$(srcdir)/checktty.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/checktty_test-checktty.Tpo $(DEPDIR)/checktty_test-checktty.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='checktty.c' object='checktty_test-checktty.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(checktty_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o checktty_test-checktty.obj `if test -f 'checktty.c'; then $(CYGPATH_W) 'checktty.c'; else $(CYGPATH_W) '$(srcdir)/checktty.c'; fi`
+
+chfn-chfn.o: chfn.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-chfn.o -MD -MP -MF $(DEPDIR)/chfn-chfn.Tpo -c -o chfn-chfn.o `test -f 'chfn.c' || echo '$(srcdir)/'`chfn.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-chfn.Tpo $(DEPDIR)/chfn-chfn.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='chfn.c' object='chfn-chfn.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-chfn.o `test -f 'chfn.c' || echo '$(srcdir)/'`chfn.c
+
+chfn-chfn.obj: chfn.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-chfn.obj -MD -MP -MF $(DEPDIR)/chfn-chfn.Tpo -c -o chfn-chfn.obj `if test -f 'chfn.c'; then $(CYGPATH_W) 'chfn.c'; else $(CYGPATH_W) '$(srcdir)/chfn.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-chfn.Tpo $(DEPDIR)/chfn-chfn.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='chfn.c' object='chfn-chfn.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-chfn.obj `if test -f 'chfn.c'; then $(CYGPATH_W) 'chfn.c'; else $(CYGPATH_W) '$(srcdir)/chfn.c'; fi`
+
+chfn-islocal.o: islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-islocal.o -MD -MP -MF $(DEPDIR)/chfn-islocal.Tpo -c -o chfn-islocal.o `test -f 'islocal.c' || echo '$(srcdir)/'`islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-islocal.Tpo $(DEPDIR)/chfn-islocal.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='islocal.c' object='chfn-islocal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-islocal.o `test -f 'islocal.c' || echo '$(srcdir)/'`islocal.c
+
+chfn-islocal.obj: islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-islocal.obj -MD -MP -MF $(DEPDIR)/chfn-islocal.Tpo -c -o chfn-islocal.obj `if test -f 'islocal.c'; then $(CYGPATH_W) 'islocal.c'; else $(CYGPATH_W) '$(srcdir)/islocal.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-islocal.Tpo $(DEPDIR)/chfn-islocal.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='islocal.c' object='chfn-islocal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-islocal.obj `if test -f 'islocal.c'; then $(CYGPATH_W) 'islocal.c'; else $(CYGPATH_W) '$(srcdir)/islocal.c'; fi`
+
+chfn-setpwnam.o: setpwnam.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-setpwnam.o -MD -MP -MF $(DEPDIR)/chfn-setpwnam.Tpo -c -o chfn-setpwnam.o `test -f 'setpwnam.c' || echo '$(srcdir)/'`setpwnam.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-setpwnam.Tpo $(DEPDIR)/chfn-setpwnam.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='setpwnam.c' object='chfn-setpwnam.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-setpwnam.o `test -f 'setpwnam.c' || echo '$(srcdir)/'`setpwnam.c
+
+chfn-setpwnam.obj: setpwnam.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-setpwnam.obj -MD -MP -MF $(DEPDIR)/chfn-setpwnam.Tpo -c -o chfn-setpwnam.obj `if test -f 'setpwnam.c'; then $(CYGPATH_W) 'setpwnam.c'; else $(CYGPATH_W) '$(srcdir)/setpwnam.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-setpwnam.Tpo $(DEPDIR)/chfn-setpwnam.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='setpwnam.c' object='chfn-setpwnam.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-setpwnam.obj `if test -f 'setpwnam.c'; then $(CYGPATH_W) 'setpwnam.c'; else $(CYGPATH_W) '$(srcdir)/setpwnam.c'; fi`
+
+chfn-env.o: ../lib/env.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-env.o -MD -MP -MF $(DEPDIR)/chfn-env.Tpo -c -o chfn-env.o `test -f '../lib/env.c' || echo '$(srcdir)/'`../lib/env.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-env.Tpo $(DEPDIR)/chfn-env.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/env.c' object='chfn-env.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-env.o `test -f '../lib/env.c' || echo '$(srcdir)/'`../lib/env.c
+
+chfn-env.obj: ../lib/env.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-env.obj -MD -MP -MF $(DEPDIR)/chfn-env.Tpo -c -o chfn-env.obj `if test -f '../lib/env.c'; then $(CYGPATH_W) '../lib/env.c'; else $(CYGPATH_W) '$(srcdir)/../lib/env.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-env.Tpo $(DEPDIR)/chfn-env.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/env.c' object='chfn-env.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-env.obj `if test -f '../lib/env.c'; then $(CYGPATH_W) '../lib/env.c'; else $(CYGPATH_W) '$(srcdir)/../lib/env.c'; fi`
+
+chfn-selinux_utils.o: selinux_utils.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-selinux_utils.o -MD -MP -MF $(DEPDIR)/chfn-selinux_utils.Tpo -c -o chfn-selinux_utils.o `test -f 'selinux_utils.c' || echo '$(srcdir)/'`selinux_utils.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-selinux_utils.Tpo $(DEPDIR)/chfn-selinux_utils.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='selinux_utils.c' object='chfn-selinux_utils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-selinux_utils.o `test -f 'selinux_utils.c' || echo '$(srcdir)/'`selinux_utils.c
+
+chfn-selinux_utils.obj: selinux_utils.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -MT chfn-selinux_utils.obj -MD -MP -MF $(DEPDIR)/chfn-selinux_utils.Tpo -c -o chfn-selinux_utils.obj `if test -f 'selinux_utils.c'; then $(CYGPATH_W) 'selinux_utils.c'; else $(CYGPATH_W) '$(srcdir)/selinux_utils.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chfn-selinux_utils.Tpo $(DEPDIR)/chfn-selinux_utils.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='selinux_utils.c' object='chfn-selinux_utils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chfn_CFLAGS) $(CFLAGS) -c -o chfn-selinux_utils.obj `if test -f 'selinux_utils.c'; then $(CYGPATH_W) 'selinux_utils.c'; else $(CYGPATH_W) '$(srcdir)/selinux_utils.c'; fi`
+
+chsh-chsh.o: chsh.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-chsh.o -MD -MP -MF $(DEPDIR)/chsh-chsh.Tpo -c -o chsh-chsh.o `test -f 'chsh.c' || echo '$(srcdir)/'`chsh.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-chsh.Tpo $(DEPDIR)/chsh-chsh.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='chsh.c' object='chsh-chsh.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-chsh.o `test -f 'chsh.c' || echo '$(srcdir)/'`chsh.c
+
+chsh-chsh.obj: chsh.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-chsh.obj -MD -MP -MF $(DEPDIR)/chsh-chsh.Tpo -c -o chsh-chsh.obj `if test -f 'chsh.c'; then $(CYGPATH_W) 'chsh.c'; else $(CYGPATH_W) '$(srcdir)/chsh.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-chsh.Tpo $(DEPDIR)/chsh-chsh.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='chsh.c' object='chsh-chsh.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-chsh.obj `if test -f 'chsh.c'; then $(CYGPATH_W) 'chsh.c'; else $(CYGPATH_W) '$(srcdir)/chsh.c'; fi`
+
+chsh-islocal.o: islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-islocal.o -MD -MP -MF $(DEPDIR)/chsh-islocal.Tpo -c -o chsh-islocal.o `test -f 'islocal.c' || echo '$(srcdir)/'`islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-islocal.Tpo $(DEPDIR)/chsh-islocal.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='islocal.c' object='chsh-islocal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-islocal.o `test -f 'islocal.c' || echo '$(srcdir)/'`islocal.c
+
+chsh-islocal.obj: islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-islocal.obj -MD -MP -MF $(DEPDIR)/chsh-islocal.Tpo -c -o chsh-islocal.obj `if test -f 'islocal.c'; then $(CYGPATH_W) 'islocal.c'; else $(CYGPATH_W) '$(srcdir)/islocal.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-islocal.Tpo $(DEPDIR)/chsh-islocal.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='islocal.c' object='chsh-islocal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-islocal.obj `if test -f 'islocal.c'; then $(CYGPATH_W) 'islocal.c'; else $(CYGPATH_W) '$(srcdir)/islocal.c'; fi`
+
+chsh-setpwnam.o: setpwnam.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-setpwnam.o -MD -MP -MF $(DEPDIR)/chsh-setpwnam.Tpo -c -o chsh-setpwnam.o `test -f 'setpwnam.c' || echo '$(srcdir)/'`setpwnam.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-setpwnam.Tpo $(DEPDIR)/chsh-setpwnam.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='setpwnam.c' object='chsh-setpwnam.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-setpwnam.o `test -f 'setpwnam.c' || echo '$(srcdir)/'`setpwnam.c
+
+chsh-setpwnam.obj: setpwnam.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-setpwnam.obj -MD -MP -MF $(DEPDIR)/chsh-setpwnam.Tpo -c -o chsh-setpwnam.obj `if test -f 'setpwnam.c'; then $(CYGPATH_W) 'setpwnam.c'; else $(CYGPATH_W) '$(srcdir)/setpwnam.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-setpwnam.Tpo $(DEPDIR)/chsh-setpwnam.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='setpwnam.c' object='chsh-setpwnam.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-setpwnam.obj `if test -f 'setpwnam.c'; then $(CYGPATH_W) 'setpwnam.c'; else $(CYGPATH_W) '$(srcdir)/setpwnam.c'; fi`
+
+chsh-env.o: ../lib/env.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-env.o -MD -MP -MF $(DEPDIR)/chsh-env.Tpo -c -o chsh-env.o `test -f '../lib/env.c' || echo '$(srcdir)/'`../lib/env.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-env.Tpo $(DEPDIR)/chsh-env.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/env.c' object='chsh-env.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-env.o `test -f '../lib/env.c' || echo '$(srcdir)/'`../lib/env.c
+
+chsh-env.obj: ../lib/env.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-env.obj -MD -MP -MF $(DEPDIR)/chsh-env.Tpo -c -o chsh-env.obj `if test -f '../lib/env.c'; then $(CYGPATH_W) '../lib/env.c'; else $(CYGPATH_W) '$(srcdir)/../lib/env.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-env.Tpo $(DEPDIR)/chsh-env.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/env.c' object='chsh-env.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-env.obj `if test -f '../lib/env.c'; then $(CYGPATH_W) '../lib/env.c'; else $(CYGPATH_W) '$(srcdir)/../lib/env.c'; fi`
+
+chsh-selinux_utils.o: selinux_utils.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-selinux_utils.o -MD -MP -MF $(DEPDIR)/chsh-selinux_utils.Tpo -c -o chsh-selinux_utils.o `test -f 'selinux_utils.c' || echo '$(srcdir)/'`selinux_utils.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-selinux_utils.Tpo $(DEPDIR)/chsh-selinux_utils.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='selinux_utils.c' object='chsh-selinux_utils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-selinux_utils.o `test -f 'selinux_utils.c' || echo '$(srcdir)/'`selinux_utils.c
+
+chsh-selinux_utils.obj: selinux_utils.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -MT chsh-selinux_utils.obj -MD -MP -MF $(DEPDIR)/chsh-selinux_utils.Tpo -c -o chsh-selinux_utils.obj `if test -f 'selinux_utils.c'; then $(CYGPATH_W) 'selinux_utils.c'; else $(CYGPATH_W) '$(srcdir)/selinux_utils.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/chsh-selinux_utils.Tpo $(DEPDIR)/chsh-selinux_utils.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='selinux_utils.c' object='chsh-selinux_utils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(chsh_CFLAGS) $(CFLAGS) -c -o chsh-selinux_utils.obj `if test -f 'selinux_utils.c'; then $(CYGPATH_W) 'selinux_utils.c'; else $(CYGPATH_W) '$(srcdir)/selinux_utils.c'; fi`
+
+islocal_test-islocal.o: islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(islocal_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT islocal_test-islocal.o -MD -MP -MF $(DEPDIR)/islocal_test-islocal.Tpo -c -o islocal_test-islocal.o `test -f 'islocal.c' || echo '$(srcdir)/'`islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/islocal_test-islocal.Tpo $(DEPDIR)/islocal_test-islocal.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='islocal.c' object='islocal_test-islocal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(islocal_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o islocal_test-islocal.o `test -f 'islocal.c' || echo '$(srcdir)/'`islocal.c
+
+islocal_test-islocal.obj: islocal.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(islocal_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT islocal_test-islocal.obj -MD -MP -MF $(DEPDIR)/islocal_test-islocal.Tpo -c -o islocal_test-islocal.obj `if test -f 'islocal.c'; then $(CYGPATH_W) 'islocal.c'; else $(CYGPATH_W) '$(srcdir)/islocal.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/islocal_test-islocal.Tpo $(DEPDIR)/islocal_test-islocal.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='islocal.c' object='islocal_test-islocal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(islocal_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o islocal_test-islocal.obj `if test -f 'islocal.c'; then $(CYGPATH_W) 'islocal.c'; else $(CYGPATH_W) '$(srcdir)/islocal.c'; fi`
+
+setproctitle.o: ../lib/setproctitle.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT setproctitle.o -MD -MP -MF $(DEPDIR)/setproctitle.Tpo -c -o setproctitle.o `test -f '../lib/setproctitle.c' || echo '$(srcdir)/'`../lib/setproctitle.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/setproctitle.Tpo $(DEPDIR)/setproctitle.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/setproctitle.c' object='setproctitle.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o setproctitle.o `test -f '../lib/setproctitle.c' || echo '$(srcdir)/'`../lib/setproctitle.c
+
+setproctitle.obj: ../lib/setproctitle.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT setproctitle.obj -MD -MP -MF $(DEPDIR)/setproctitle.Tpo -c -o setproctitle.obj `if test -f '../lib/setproctitle.c'; then $(CYGPATH_W) '../lib/setproctitle.c'; else $(CYGPATH_W) '$(srcdir)/../lib/setproctitle.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/setproctitle.Tpo $(DEPDIR)/setproctitle.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='../lib/setproctitle.c' object='setproctitle.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o setproctitle.obj `if test -f '../lib/setproctitle.c'; then $(CYGPATH_W) '../lib/setproctitle.c'; else $(CYGPATH_W) '$(srcdir)/../lib/setproctitle.c'; fi`
+
+newgrp-newgrp.o: newgrp.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(newgrp_CFLAGS) $(CFLAGS) -MT newgrp-newgrp.o -MD -MP -MF $(DEPDIR)/newgrp-newgrp.Tpo -c -o newgrp-newgrp.o `test -f 'newgrp.c' || echo '$(srcdir)/'`newgrp.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/newgrp-newgrp.Tpo $(DEPDIR)/newgrp-newgrp.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='newgrp.c' object='newgrp-newgrp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(newgrp_CFLAGS) $(CFLAGS) -c -o newgrp-newgrp.o `test -f 'newgrp.c' || echo '$(srcdir)/'`newgrp.c
+
+newgrp-newgrp.obj: newgrp.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(newgrp_CFLAGS) $(CFLAGS) -MT newgrp-newgrp.obj -MD -MP -MF $(DEPDIR)/newgrp-newgrp.Tpo -c -o newgrp-newgrp.obj `if test -f 'newgrp.c'; then $(CYGPATH_W) 'newgrp.c'; else $(CYGPATH_W) '$(srcdir)/newgrp.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/newgrp-newgrp.Tpo $(DEPDIR)/newgrp-newgrp.Po
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='newgrp.c' object='newgrp-newgrp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(newgrp_CFLAGS) $(CFLAGS) -c -o newgrp-newgrp.obj `if test -f 'newgrp.c'; then $(CYGPATH_W) 'newgrp.c'; else $(CYGPATH_W) '$(srcdir)/newgrp.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-man1: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man1:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(dist_man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(usrbin_execdir)" "$(DESTDIR)$(usrsbin_execdir)" "$(DESTDIR)$(man1dir)" "$(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)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+@BUILD_INIT_FALSE@@BUILD_LOGIN_UTILS_FALSE@@BUILD_WALL_FALSE@install-exec-hook:
+@BUILD_INIT_FALSE@@BUILD_LOGIN_UTILS_FALSE@@MAKEINSTALL_DO_CHOWN_FALSE@install-exec-hook:
+@BUILD_INIT_FALSE@@BUILD_LOGIN_UTILS_FALSE@@USE_TTY_GROUP_FALSE@install-exec-hook:
+@BUILD_INIT_FALSE@install-data-hook:
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+	clean-noinstPROGRAMS clean-sbinPROGRAMS \
+	clean-usrbin_execPROGRAMS clean-usrsbin_execPROGRAMS \
+	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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-sbinPROGRAMS \
+	install-usrbin_execPROGRAMS install-usrsbin_execPROGRAMS
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man \
+	uninstall-sbinPROGRAMS uninstall-usrbin_execPROGRAMS \
+	uninstall-usrsbin_execPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool clean-noinstPROGRAMS \
+	clean-sbinPROGRAMS clean-usrbin_execPROGRAMS \
+	clean-usrsbin_execPROGRAMS ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am \
+	install-data-hook install-dvi install-dvi-am install-exec \
+	install-exec-am install-exec-hook install-html install-html-am \
+	install-info install-info-am install-man install-man1 \
+	install-man8 install-pdf install-pdf-am install-ps \
+	install-ps-am install-sbinPROGRAMS install-strip \
+	install-usrbin_execPROGRAMS install-usrsbin_execPROGRAMS \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-man uninstall-man1 uninstall-man8 \
+	uninstall-sbinPROGRAMS uninstall-usrbin_execPROGRAMS \
+	uninstall-usrsbin_execPROGRAMS
+
+
+$(ul_libblkid_la):
+	$(MAKE) -C $(ul_libblkid_builddir)
+
+$(ul_libuuid_la):
+	$(MAKE) -C $(ul_libuuid_builddir)
+
+@BUILD_LOGIN_UTILS_TRUE@install-exec-hook::
+@BUILD_LOGIN_UTILS_TRUE@	cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
+
+@BUILD_WALL_TRUE@@MAKEINSTALL_DO_CHOWN_TRUE@@USE_TTY_GROUP_TRUE@install-exec-hook::
+@BUILD_WALL_TRUE@@MAKEINSTALL_DO_CHOWN_TRUE@@USE_TTY_GROUP_TRUE@	chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
+@BUILD_WALL_TRUE@@MAKEINSTALL_DO_CHOWN_TRUE@@USE_TTY_GROUP_TRUE@	chmod g+s $(DESTDIR)$(usrbin_execdir)/wall
+
+@BUILD_INIT_TRUE@install-exec-hook::
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf shutdown halt
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf shutdown fasthalt
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf initctl need
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf initctl display-services
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(sbindir) && ln -sf initctl provide
+
+@BUILD_INIT_TRUE@install-data-hook:
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8
+@BUILD_INIT_TRUE@	cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8
+
+# 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:
diff --git a/util-linux-ng-2.17.2/login-utils/README.getty b/util-linux-ng-2.17.2/login-utils/README.getty
new file mode 100644
index 0000000..4e32faa
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/README.getty
@@ -0,0 +1,26 @@
+@(#) README 1.8 9/1/91 23:32:37
+
+This is a SYSV/SunOS4 getty program with useful features for hardwired
+and dial-in tty lines.
+
+- The program adapts the tty modes to parity bits and to erase, kill
+end-of-line and upper-case characters when it reads a login name.
+
+- The baud rate can be established by BREAK character processing and by
+parsing the CONNECT status messages from Hayes-compatible modems.
+
+Other features: RTS/CTS flow control (SunOS4, suggested by John Harkin,
+<jh@moon.nbn.com>), alternate login program, does not use /etc/gettytab
+or /etc/gettydefs.
+
+The program works without modification under System V release 2 and
+SunOS 4.1/4.1.1. It probably also works with later System V releases.
+
+In the Makefile you will have to specify whether diagnostics should be
+reported through the syslog daemon; the alternative is that all error
+reports go directly to /dev/console.
+
+The command-line interface was cleaned up a bit; it is slightly
+incompatible with earlier agetty versions.
+
+		Wietse Venema (wietse@wzv.win.tue.nl)
diff --git a/util-linux-ng-2.17.2/login-utils/README.modems-with-agetty b/util-linux-ng-2.17.2/login-utils/README.modems-with-agetty
new file mode 100644
index 0000000..44a611e
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/README.modems-with-agetty
@@ -0,0 +1,76 @@
+25/10/95 Peter Orbaek <poe@daimi.aau.dk>
+
+Some notes for using agetty with modems
+
+Using a comms program to initialize the modem
+---------------------------------------------
+
+* Use kermit or minicom to initialize the modem to
+
+	- be entirely quiet.
+	- don't do local echo in command mode.
+	- turn on DCD (carrier detect) only when there is a connection going.
+	- enable auto-answer.
+	- keep a constant computer/modem bitrate at all times.
+	- optionally save this setup as the modem startup configuration.
+
+* Run agetty on the appropriate ttySn port with the arguments:
+	* -w to wait for a CR or LF before writing the /etc/issue message
+	* computer/modem bitrate
+	* the tty name.
+
+Example from my modem setup, an old 2400 bps SupraModem using Hayes standard
+AT commands.
+
+Initialize modem using kermit with the commands
+
+	AT E0 Q1 &D2 &C1 S0=1 &W0
+
+to
+	- turn off local echo from modem when in command mode (E0).
+	- disable all result codes from modem (Q1).
+	- make an on/off transition on the DTR line make the modem
+	  disconnect and go into command mode (&D2).
+	- make the computer/modem DCD line track the modem/modem
+	  carrier detect signal, i.e. no connection means no
+	  carrier detect signal to the computer (&C1).
+	- enable auto-answer after the first ring (S0=1).
+	- store the configuration as the start configuration (&W0).
+
+The commands on your modem to achieve the same setup may vary, especially
+the &D2 and &C1 commands may not be entirely standard.
+
+Exit kermit/minicom.
+
+Put the command 
+
+	/sbin/agetty -w 2400 ttyS1
+
+in the command field of the appropriate line in /etc/inittab to start
+agetty on /dev/ttyS1 with a 2400 bps speed between modem and computer.
+
+Initializing the modem with agetty
+----------------------------------
+
+Use the agetty -I command line option to specify a modem init string, like
+for the same setup as above, use the following agetty command in your
+/etc/inittab.
+
+	/sbin/agetty -w -I 'ATE0Q1&D2&C1S0=1\015' 2400 ttyS1
+
+The final \015 is an octal coding of the carriage return character
+ending the command string.
+
+If you're using simpleinit (part of this package) instead of the SYSV 
+compatible init (you're most likely using the SYSV one!) then you must
+remove the single quotes from the command line above.
+
+Note that the &W0 command was not used here since the modem will be 
+initialized each time agetty starts.
+
+With a V.34 (28.8 kbps) modem try starting with a command like:
+
+	/sbin/agetty -w -I 'ATE0Q1&D2&C1S0=1\015' 115200 ttyS1
+
+Note that agetty supports the higher (>9600 bps) serial speeds
+directly, there's no need to use setserial to use the higher speeds.
diff --git a/util-linux-ng-2.17.2/login-utils/README.poeigl b/util-linux-ng-2.17.2/login-utils/README.poeigl
new file mode 100644
index 0000000..5d30ec5
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/README.poeigl
@@ -0,0 +1,583 @@
+README for init/getty/login, by poe@daimi.aau.dk
+
+This package contains simpleinit, agetty, and login programs for Linux.
+Additional utilities included are: hostname, who, write, wall, users
+domainname, hostid, cage and mesg.
+
+Most of this software has been contributed by others, I basically just
+ported the things to Linux.
+
+About installation: See the bottom of this file. Check the Makefile!
+Be sure you know what you are doing! You may well be able to lock
+yourself out from your machine. Especially: The init provided here
+(simpleinit) is NOT a SYSV compatible init and the inittab format
+is different.
+
+If you are uncertain whether you got the latest version, check out
+
+	ftp://ftp.daimi.aau.dk/pub/linux/poe/
+
+Version 1.49 (20-Jun-97)
+	Small patches for new util-linux distribution and glibc compat.
+	PAM support in login.c by Erik Troan.
+
+Version 1.48 (6-Jun-97)
+	Now changes mode and owner of /dev/vcs devices for console logins.
+	After idea by Andries Brouwer.
+
+Version 1.47 (2-Apr-97)
+	Got new version of hostid.c and hostid.1 from 
+	Sander van Malssen <svm@kozmix.ow.nl>.
+	Removed premature endutent() call in login.c, simpleinit.c and 
+	agetty.c to be compatible with the changed semantics of gnu libc2. 
+	Fix by Jesse Thilo <Jesse.Thilo@pobox.com>.
+
+Version 1.46 (28-Jan-97)
+	Several security fixes for login by David Holland (buffer overruns)
+	<dholland@hcs.harvard.edu>
+	Fixed write.c, to handle a terminating period correctly.
+	Re-indented login.c, it was getting too messy.
+
+Version 1.45a (16-Dec-96)
+	Better support in login for shadow passwords. Compile with
+	-DSHADOW_PWD if you have <shadow.h>. This is on by default.
+	By Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>.
+	Changed the wtmp locking scheme in login.c,agetty.c,simpleinit.c
+	to flock() /etc/wtmplock instead of the wtmp file directly.
+	This avoids a denial of service attack.
+	Some support for the RB-1 Cryptocard token for challenge/response
+	authentication. This needs a DES library, either Eric Young's
+	libdes, or the Koontz implementation, see cryptocard.c.
+	Initial support patch by Randolph Bentson, 
+	<bentson@grieg.seaslug.org>
+	Changed getpass() to use fputs() instead of fprintf().
+
+Version 1.44 (13-Nov-96):
+	Made isapty() in checktty.c more resilient to 2.0 systems
+	that haven't re-MAKEDEV'ed their pty devices.
+
+Version 1.43 (8-Nov-96):
+	Fix to checktty.c: PTY's are numbered differently after 1.3,
+	blush! Fix by Gerhard Schneider <gs@ilfb.tuwien.ac.at>
+
+Version 1.42c (6-Nov-96):
+	Small fix by Gabriel M. Schuyler <schuyler@easiest.com>, to get
+	better syslog messages (1 LOGIN FAILURE instead of 2 LOGIN FAILURES).
+	Patch butchered by me.
+
+Version 1.42b (30-Sep-96):
+	Got patch for checktty.c from Christoph Lameter
+	<clameter@miriam.fuller.edu> so it doesn't traverse the groupfile
+	"manually" but uses the getgroups() call, this is more efficient
+	with large groupfiles and NIS/YP.
+
+Version 1.42a (24-Sep-96):
+	Added extra syslog() call to login.c to log all good logins.
+	Patch from Steve Philp.
+
+Version 1.41 (20-Jul-96):
+	Added security fix to checktty.c by JDS to clear certain lists.
+	Patches butchered and ANSI'fied by me.
+	Added -n option to agetty to avoid the login prompt.
+
+Version 1.40a (29-Dec-95):
+	Added -f <issue_file> option to agetty. Patches from Eric Rasmussen
+	<ear@usfirst.org>, but somewhat butchered by me.
+
+Version 1.39 (25-Oct-95):
+	Lots of testing and bugfixes in agetty. Now the modem init stuff 
+	should finally work (for me). Also wrote modem.agetty as an example
+	on how to use agetty with a modem.
+	Agetty now also supports baud rates of 38400, 57600, 115200 and
+	230400 bps.
+
+Version 1.37 (15-Sep-95):
+	Added -I <initstring> and -w options to agetty.c for those that
+	use agetty with modems.
+
+Version 1.36 (25-Aug-95): 
+	Enhanced /etc/usertty features with group support. Moved this part
+	of login.c to checktty.c. One can now define classes of hosts and
+	ttys and do access checking based on unix-group membership. See
+	login.1. Also time ranges for logins can be specified, for example
+	writing the line
+
+	joe	[mon:tue:wed:thu:fri:8-16]@barracuda [mon:tue:wed:thu:fri:0-7:17-23]@joes.pc.at.home [sat:sun:0-23]@joes.pc.at.home
+
+	says that during working hours, Joe may rlogin from the host
+	barracuda, whereas outside working hours and in weekends Joe may
+	rlogin from his networked PC at home.
+
+	login.c: failures was not properly initialized, it now is. Also
+	made sure ALL failures are really logged to syslog.
+
+Version 1.35 (7-Aug-95):
+	login.c: Much improved features for the usertty file, allows
+	access control based on both hostnames/addresses and line. See the 
+	about.usertty file and the man-page.
+
+	Fixed agetty so it doesn't fiddle with the ut_id field in the
+	utmp record, this should prevent growing utmps on systems with
+	more than 10 login lines. Fix suggested and checked by Alan Wendt 
+	<alan@ezlink.com> in his agetty.1.9.1a.
+
+	Agetty now installs as agetty again, not as getty.
+	Updated man-page for login(1) to document /etc/usertty changes.
+
+	This has been tested on Linux 1.2.5 with GCC 2.5.8 and libc 4.5.26.
+
+Version 1.33a (20-Jun-95):
+	rchatfie@cavern.nmsu.edu ("rc.") suggested that I should remove
+	the #ifndef linux around the special logging of dial-up 
+	logins. This is now done, so each login via a serial port 
+	generates a separate DIALUP syslog entry.
+
+Version 1.33 (5-Jun-95):
+	Patch by Ron Sommeling <sommel@sci.kun.nl> and
+	jlaiho@ichaos.nullnet.fi (Juha Laiho) for agetty.c, used
+	to return a pointer to an automatic variable in get_logname().
+	Many patches from or via Rickard Faith <faith@cs.unc.edu>, fixing
+	man-pages etc, now defaults to using /var/log/wtmp and /var/run/utmp
+	according to the new FSSTND.
+
+	Fix in login.c for CPU eating bug when a remote telnet client dies
+	while logging in.
+
+	This is for Linux 1.2, GCC 2.6.2 or later.
+
+Version 1.32b (12-Mar-95):
+	Login now sets the tty group to "tty" instead of "other". Depending
+	on compile-time define USE_TTY_GROUP the tty mode is set to 0620 or
+	0600 instead of 0622. All as per suggestion by Rik Faith and the
+	linux-security list.
+	Write/wall now strips control chars except BEL (\007). Again after
+	suggestion by Rik Faith.
+
+Version 1.32a
+	Urgent security patch from Alvaro M. Echevarria incorporated into
+	login.c. This is really needed on machines running YP until
+	the libraries are fixed.
+
+Version 1.32
+	Login now logs the ip-address of the connecting host to utmp as it
+	should.
+
+Version 1.31b (2-Feb-95):
+	Daniel Quinlan <quinlan@yggdrasil.com> and Ross Biro 
+	<biro@yggdrasil.com> suggested a patch to login.c that allows for 
+	shell scripts in the shell field of /etc/passwd, so one can now
+	have (as a line in /etc/passwd):
+		bye::1000:1000:Outlogger:/bin:echo Bye
+	Logging in as "bye" with no password simply echoes Bye on the screen.
+	This has applications for pppd/slip.
+
+Version 1.31a (28-Oct-94):
+	Scott Telford provided a patch for simpleinit, so executing reboot
+	from singleuser mode won't partially execute /etc/rc before
+	the reboot.
+
+Version 1.30 (17-Sep-94):
+	tobias@server.et-inf.fho-emden.de (Peter Tobias) has made a more 
+	advanced hostname command that understands some options such as
+	-f for FQDN etc. I'll not duplicate his work. Use his hostname
+	package if you wish.
+
+	svm@kozmix.xs4all.nl (Sander van Malssen) provided more features
+	for the /etc/issue file in agetty. \U and \u now expand to the 
+	number of current users.
+
+	It is now possible to state the value of TERM on the agetty command
+	line. This was also provided by Sander.
+
+	This has been built under Linux 1.1.42 with gcc 2.5.8 and libc 4.5.26.
+
+Version 1.29 (18-Aug-94):
+	Finally got around to making a real version after the numerous
+	alpha versions of 1.28. Scott Telford <st@epcc.ed.ac.uk> provided
+	a patch for write(1) to make it look more like BSD write.
+
+	Fixed login so that the .hushlogin feature works even with real
+	protective users mounted via NFS (ie. where root can't access
+	the user's .hushlogin file).
+
+	Cleaned up the code to make -Wall bearable.
+
+Version 1.28c (21-Jul-94):
+	Rik Faith reminded me that agetty should use the syslog
+	facility. It now does.
+
+Version 1.28b (30-May-94):
+	On suggestion from Jeremy Fitzhardinge <jeremy@suite.sw.oz.au>
+	I added -- as option delimiter on args passed from agetty to
+	login. Fixes -froot hole for other login programs. The login
+	program in this package never had that hole.
+
+Version 1.28a (16-May-94):
+	bill@goshawk.lanl.gov provided a couple of patches, one fixing
+	terminal setup in agetty, and reboot is now supposed to be
+	in /sbin according to FSSTND.
+
+Version 1.27 (10-May-94):
+	Changed login.c, so all bad login attempts are logged, and added
+	usertty security feature. See about.usertty for an explanation.
+	There's no longer a limit of 20 chars in the TERM environment 
+	variable. Suggested by Nicolai Langfeldt <janl@math.uio.no>
+
+	Added #ifdef HAVE_QUOTA around quota checks. Enable them if
+	you have quota stuff in your libraries and kernel.
+	Also re-enabled set/getpriority() calls as we now have them,
+	and have had for a long time...
+
+	Now wtmp is locked and unlocked around writes to avoid mangling.
+	Due to Jaakko Hyv{tti <HYVATTI@cc.helsinki.fi>.
+
+	Wrt. agetty: A \o in /etc/issue now inserts the domainname, as 
+	set by domainname(1). Sander van Malssen provided this.
+	This is being used under Linux 1.1.9
+
+	Beefed up the agetty.8 man-page to describe the /etc/issue
+	options. Added man-pages for wall, cage, who.
+
+Version 1.26 alpha (25-Apr-94):
+	Added patch from Bill Reynolds <bill@goshawk.lanl.gov> to 
+	simpleinit, so it will drop into single user if /etc/rc
+	fails, eg. from fsck.
+
+Version 1.25 (9-Feb-94):
+	Agetty should now work with the Linux 0.99pl15a kernel.
+	ECHOCTL and ECHOPRT are no longer set in the termios struct.
+	Also made agetty accept both "tty baudrate" and "baudrate tty"
+	arguments.
+
+Version 1.24 (23-Jan-94): changes since 1.22
+	Christian von Roques <roques@juliet.ka.sub.org> provided a patch
+	that cleans up the handling of the -L option on agetty. 
+	Rik Faith <faith@cs.unc.edu> enhanced several man-pages...
+
+Version 1.23 (11-Dec-93): changes since 1.21
+	Mitchum DSouza provided the hostid(1) code. It needs libc 4.4.4 or
+	later and a Linux 0.99.14 kernel or later. It can set and print
+	the world unique hostid of the machine. This may be used in 
+	connection with commercial software licenses. God forbid!
+	I added the -v option, and munged the code a bit, so don't blame
+	Mitch if you don't like it.
+
+	I made the "cage" program. Using this as a shell in the passwd
+	file, enables one to let users log into a chroot'ed environment.
+	For those that have modem logins and are concerned about security.
+	Read the source for further info.
+
+	"who am i" now works.
+
+	The login program works with Yellow Pages (aka NIS) simply by
+	linking with an appropriate library containing a proper version
+	of getpwnam() and friends.
+
+Version 1.21 (30-Oct-93): changes since 1.20
+	In simpleinit.c: The boottime wtmp record is now written *after*
+	/etc/rc is run, to put a correct timestamp on it.
+	Daniel Thumim <dthumim@mit.edu> suggested this fix.
+
+	The source and Makefile is prepared for optional installation of 
+	binaries in /sbin instead of /etc, and logfiles in /usr/adm instead
+	of /etc. See and change the Makefile to suit your preferences.
+	Rik Faith and Stephen Tweedie inspired this change.
+
+Version 1.20 (30-Jul-93): changes since 1.17:
+	Versions 1.18 and 1.19 were never made publically available.
+	Agetty now supports a -L switch that makes it force the CLOCAL flag.
+	This is useful if you have a local terminal attached with a partly
+	wired serial cable that does not pass on the Carrier Detect signal.
+
+	There's a domainname program like the hostname program; contributed
+	by Lars Wirzenius.
+
+	Simpleinit will now write a REBOOT record to wtmp on boot up. Time-
+	zone support is now optional in simpleinit. Both of these patches
+	were made by Scott Telford <st@epcc.ed.ac.uk>.
+
+	This is for Linux 0.99.11 or later.
+
+Version 1.17 (19-May-93): changes since 1.16:
+	Login, simpleinit and write should now work with shadow passwords
+	too. See the Makefile. Thanks to Anders Buch who let me have an
+	account on his SLS based Linux box on the Internet, so I could test
+	this. I should also thank jmorriso@rflab.ee.ubc.ca (John Paul Morrison)
+	who sent me the shadow patch to login.c
+
+Version 1.16 (24-Apr-93): changes since 1.15a:
+	Simpleinit now clears the utmp entry associated with the pid's that
+	it reaps if there is one. A few are still using simpleinit and this
+	was a popular demand. It also appends an entry to wtmp
+
+Version 1.15a (15-Mar-93): changes since 1.13a:
+	junio@shadow.twinsun.com (Jun Hamano) sent me a one-line fix
+	for occasional mangled issue-output from agetty.
+
+Version 1.13a (2-Mar-93): changes since 1.12a:
+	With the new LILO (0.9), there are more than one possible arg
+	to init, so Werner Almesberger <almesber@bernina.ethz.ch>
+	suggested that a loop over argv[] was made in boot_single() in
+	simpleinit.c
+
+Version 1.12a (24-Feb-93): changes since 1.11:
+	This is for Linux 0.99.6 or later. Built with gcc 2.3.3 and libc4.2
+	jrs@world.std.com (Rick Sladkey) told me that the setenv("TZ",..)
+	in login.c did more harm than good, so I commented it out.
+
+Version 1.11a (16-Feb-93): changes since 1.9a:
+	This is for Linux 0.99.5 or later.
+	Anthony Rumble <arumble@extro.ucc.su.OZ.AU> made me avare that
+	the patches for vhangup() from Steven S. Dick didn't quite work,
+	so I changed it.
+
+	Linus Torvalds provided another patch relating to vhangup, since
+	in newer Linuxen vhangup() doesn't really close all files, so we
+	can't just open the tty's again.
+
+Version 1.9a (18-Jan-93): changes since 1.8a:
+	Rick Faith sent me man-pages for most of the untilities in this
+	package. They are now included.
+
+	Steven S. Dick <ssd@nevets.oau.org> sent me a patch for login.c
+	so DTR won't drop during vhangup() on a modemline.
+
+	This is completely untested!! I haven't even had the time to
+	compile it yet.
+
+Version 1.8a (13-Dec-92): changes since 1.7:
+	This is for Linux 0.98.6 or later. Compiles with gcc2.2.2d7 and libc4.1
+
+	Bettered write/wall after fix from I forget who. Now wall can have
+	commandline args.
+
+	Fixed bug in who.c
+
+	Patched simpleinit.c with patch from Ed Carp, so it sets the timezone
+	from /etc/TZ. Should probably by be /etc/timezone.
+
+	Sander Van Malssen <sander@kozmix.hacktic.nl> provided a patch
+	for getty, so it can understand certain escapecodes in /etc/issue.
+
+	I hacked up a very simple substitute for a syslog() call, to try out
+	the logging. If you have a real syslog() and syslogd then use that!
+
+	The special vhangup.c file is out, it's in the official libc by now.
+	(and even in the libc that I have :-)
+
+	who, and write are now deprecated, get the better ones from one of
+	the GNU packages, shellutils I think.
+
+	Some people think that the simple init provided in this package is too
+	spartan, if you think the same, then get the SYSV compatible init
+	from Miquel van Smoorenburg <miquels@maestro.htsa.aha.nl>
+	Simpleinit will probably be deprecated in the future.
+
+Version 1.7: 26-Oct-92 changes since 1.6:
+	This is for Linux 0.97PL4 or later.
+
+	Thanks to Werner Almesberger, init now has support for a 
+	singleuser mode. 
+
+	Login now supports the -h <hostname> option, used in connection
+	with TCP/IP. (rlogin/telnet)
+
+	Getty writes an entry to /etc/wtmp when started, so last won't report
+	"still logged in" for tty's that have not been logged into since
+	the last user of that tty logged out. This patch was inspired by
+	Mitchum DSouza. To gain the full benefit of this, get the newest
+	last from the admutils-1.4.tar.Z package or later.
+
+Version 1.6 (29-Aug-92): changes since 1.5:
+	This is for Linux 0.97P1+ or later.
+	
+	Login now uses the newly implemented vhangup() sys-call, to prevent
+	snooping on the tty.
+	An alternative getpass() function is now provided with login, because
+	I was told that the old one in libc didn't work with telnet and
+	or rlogin. I don't have a network or a kernel with TCP/IP so I haven't
+	tested the new one with telnet, but it is derived from BSD sources
+	that are supposed to work with networking.
+
+Version 1.5 (12-Aug-92): changes since 1.4
+	This is for Linux 0.97 or later, and has been built with gcc2.2.2
+
+	This release just puts in a few bugfixes in login.c and simpleinit.c
+
+Version 1.4 (4-Jul-92): changes since 1.3:
+	This is for Linux 0.96b, and has been built and tested with gcc 2.2.2.
+
+	Init now handles the SIGINT signal. When init gets a SIGINT it will
+	call /usr/bin/reboot and thereby gently reboot the machine. This
+	makes sense because after Linux 0.96B-PL1 the key-combination
+	Ctrl-Alt-Del may send a SIGINT to init instead of booting the 
+	machine the hard way without syncing or anything.
+
+	You may want to get the admutils-1.1 package which includes a program
+	that will instruct the kernel to use the "gentle-reboot" procedure.
+
+Version 1.3 (14-Jun-92): changes since 1.2:
+	This is for Linux 0.96A.
+
+	The ioctl(TIOCSWINSZ) has been removed from login.c because it now
+	works :-).
+	
+	login.c now supports a lastlog database.
+
+	Several programs and pieces of source that were included in the 1.2
+	package has been *removed* as they are incorporated into the new
+	libc. Other omitted parts such as last(1) has been replaced by
+	better versions, and can be found in the admutils package.
+
+	Agetty is now called getty and will be placed in /etc.
+
+	A few changes has been made to make it possible to compile the
+	stuff with GCC 2.x.
+
+Version 1.2 (28-Feb-92): changes since 1.1:
+	This is for Linux 0.12.
+
+	A couple of problems with simpleinit.c has been solved, thanks to
+	Humberto Zuazaga. So now init groks comments in /etc/inittab, and
+	handles the HUP and TSTP signals properly.
+
+	I added two small scripts to the distribution: users and mesg.
+
+	TERM is now carried through from /etc/inittab all the way to the
+	shell. Console tty's are special-cased, so the termcap entry in
+	/etc/inittab is overridden by the setting given at boot-time.
+	This requires a different patch to the kernel than that distributed
+	with version 1.1
+
+	Login no more sends superfluous chars from a password to the 
+	shell. It also properly prints a NL after the password.
+
+	Agetty didn't set the erase character properly, it does now.
+
+	A few extra defines has been added to utmp.h
+
+	Several netters helped discover the bugs in 1.1. Thanks to them
+	all.
+
+Version 1.1 (released 19-Feb-92): Changes since 1.0:
+	A bug in simpleinit.c has been fixed, thanks to Pietro Castelli.
+	The definition of the ut_line field has been changed to track the
+	USG standard more closely, we now strip "/dev/" off the front.
+	Thanks to: Douglas E. Quale and Stephen Gallimore.
+
+	I have added a getlogin.c library routine, and a write(1) command.
+	I removed the qpl-init stuff. If people want to use it, they should
+	get it from the source. I don't want to hack on it anymore.
+
+	A couple of people reported problems with getty having problems 
+	with serial terminals. That was correct. I borrowed a null-modem
+	from Tommy Thorn, and now the problems should be fixed. It seems
+	that there is kept a lot of garbage in the serial buffers, flush
+	them and it works like a charm. Getty does an ioctl(0, TCFLSH, 2)
+	for this.
+
+	The write.c code now doubles as code for a wall(1) program.
+
+Description of the various files:
+
+login.c		The login program. This is a portation of BSD login, first
+		to HP-UX 8.0 by Michael Glad (glad@daimi.aau.dk), and
+		to Linux (initially to 0.12) by me.
+
+who.c		A simple who(1) util. to list utmp. Done by me.
+		You may prefer the GNU who util. with more options
+		and features.
+
+hostname.c	A hostname(1) command to get and set the hostname. I did
+		this too.
+
+domainname.c	Like hostname, only reads out or sets the domainname.
+
+agetty.c	The getty program. From comp.sources.misc, by W.Z. Venema.
+		Hacked a bit by me.
+
+simpleinit.c	A simple init program, written by me. Uses /etc/inittab
+
+		A "kill -HUP" to init makes it re-read /etc/inittab.
+		A "kill -TSTP" to init makes it stop spawning gettys on the
+		ttys. A second "kill -TSTP" starts it again.
+		A kill -INT to init makes it attempt a reboot of the machine.
+		this works in connection with kernel support for softboot
+		when Ctrl-Alt-Del is pressed.
+
+		Init will start up in singleuser mode if /etc/singleboot
+		exists at boottime, or if it is given an argument of "single"
+		via eg. LILO. If /etc/securesingle exists it will ask for the
+		root password before starting single user.
+
+write.c		A write(1) command, used to pass messages between users
+		at different terminals. This code doubles as code for 
+		a wall(1) command. Make a symlink: /usr/bin/wall ->
+		/usr/bin/write for this.
+
+mesg		A tiny shellscript, so you can avoid that other people write
+		to your shell.
+
+users		Another script that uses awk(1) and tr(1) to process the
+		output from who(1) into a one-liner.
+		If you don't have awk, but have Perl, this does the same:
+
+		who | perl -ane 'print "$F[0] "'; echo ""
+
+pathnames.h:
+		Header.
+
+param.h
+		Header, extended with getdtablesize() macro, should go
+		in /usr/include/sys
+
+Building.
+---------
+A "make all" should do. At least it does for me.
+
+Installation:
+-------------
+
+login		should go in /bin, if you don't like this change
+		pathnames.h and recompile at least agetty.
+
+getty, init	Put them in SBINDIR
+
+who, hostname, write, wall, mesg, users:
+		/usr/bin
+
+securetty	login needs this in /etc, defines which ttys that root
+		can login on. This should *never* include ttys{1,2}
+
+inittab		the simpleinit code needs this in /etc. Note that the syntax
+		of /etc/inittab has little to do with the syntax of a real
+		SysV inittab. Edit this one for your local setup.
+
+shells		The chsh program will use this if it's placed in /etc. It
+		defines the valid shell-programs. Have one abs. path on
+		each line.
+
+You can also do a "make install" as root, but don't just do it because I
+say so, check the Makefile first.
+
+"Make install" will install only the new binaries, and not motd, inittab,
+securetty and issue. To install these configuration files, do a 
+"make Install".
+
+Getty requires a /dev/console to write errors to. I just made it a symlink
+to /dev/tty1. Because of a bug in the tty driver this errorlogging may
+cause the shell on tty1 to logout.
+
+Getty will print the contents of /etc/issue if it's present before asking
+for username. Login will print the contents of /etc/motd after successful
+login. Login doesn't print /etc/motd, and doesn't check for mail if
+~/.hushlogin is present and world readable.
+
+If /etc/nologin is present then login will print its contents and disallow
+any logins except root.
+It might be a good idea to have a "rm -f /etc/nologin" line in one's 
+/etc/rc file.
+
+If /etc/securetty is present it defines which tty's that root can login on.
+
+   - Peter (poe@daimi.aau.dk)
diff --git a/util-linux-ng-2.17.2/login-utils/agetty.8 b/util-linux-ng-2.17.2/login-utils/agetty.8
new file mode 100644
index 0000000..8761374
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/agetty.8
@@ -0,0 +1,309 @@
+.TH AGETTY 8 
+.SH NAME
+agetty \- alternative Linux getty
+
+.SH SYNOPSIS
+.BR "agetty " [\-8ihLmnUw]
+.RI "[-f " issue_file ]
+.RI "[-l " login_program ]
+.RI "[-I " init ]
+.RI "[-t " timeout ]
+.RI "[-H " login_host ]
+.I port
+.I baud_rate,...
+.RI [ term ]
+.br
+.BR "agetty " [\-8ihLmnw]
+.RI "[-f " issue_file ]
+.RI "[-l " login_program ]
+.RI "[-I " init ]
+.RI "[-t " timeout ]
+.RI "[-H " login_host ]
+.I baud_rate,...
+.I port
+.RI [ term ]
+
+.SH DESCRIPTION
+.ad
+.fi
+\fBagetty\fP opens a tty port, prompts for a login name and invokes
+the /bin/login command. It is normally invoked by \fIinit(8)\fP.
+
+\fBagetty\fP has several \fInon-standard\fP features that are useful
+for hard-wired and for dial-in lines:
+.IP o
+Adapts the tty settings to parity bits and to erase, kill,
+end-of-line and uppercase characters when it reads a login name.
+The program can handle 7-bit characters with even, odd, none or space
+parity, and 8-bit characters with no parity. The following special
+characters are recognized: @ and Control-U (kill); #, DEL and
+back space (erase); carriage return and line feed (end of line).
+.IP o
+Optionally deduces the baud rate from the CONNECT messages produced by
+Hayes(tm)-compatible modems.
+.IP o
+Optionally does not hang up when it is given an already opened line
+(useful for call-back applications).
+.IP o
+Optionally does not display the contents of the \fI/etc/issue\fP file.
+.IP o
+Optionally displays an alternative issue file instead of \fI/etc/issue\fP.
+.IP o
+Optionally does not ask for a login name.
+.IP o
+Optionally invokes a non-standard login program instead of
+\fI/bin/login\fP.
+.IP o
+Optionally turns on hard-ware flow control
+.IP o
+Optionally forces the line to be local with no need for carrier detect.
+.PP
+This program does not use the \fI/etc/gettydefs\fP (System V) or
+\fI/etc/gettytab\fP (SunOS 4) files.
+.SH ARGUMENTS
+.na
+.nf
+.fi
+.ad
+.TP
+port
+A path name relative to the \fI/dev\fP directory. If a "-" is
+specified, \fBagetty\fP assumes that its standard input is
+already connected to a tty port and that a connection to a
+remote user has already been established.
+.sp
+Under System V, a "-" \fIport\fP argument should be preceded
+by a "--".
+.TP
+baud_rate,...
+A comma-separated list of one or more baud rates. Each time
+\fBagetty\fP receives a BREAK character it advances through
+the list, which is treated as if it were circular.
+.sp
+Baud rates should be specified in descending order, so that the
+null character (Ctrl-@) can also be used for baud rate switching.
+.TP
+term
+The value to be used for the TERM environment variable. This overrides
+whatever init(8) may have set, and is inherited by login and the shell.
+.SH OPTIONS
+.na
+.nf
+.fi
+.ad
+.TP
+\-8
+Assume that the tty is 8-bit clean, hence disable parity detection.
+.TP
+\-h
+Enable hardware (RTS/CTS) flow control. It is left up to the
+application to disable software (XON/XOFF) flow protocol where
+appropriate.
+.TP
+\-i
+Do not display the contents of \fI/etc/issue\fP (or other) before writing the
+login prompt. Terminals or communications hardware may become confused
+when receiving lots of text at the wrong baud rate; dial-up scripts
+may fail if the login prompt is preceded by too much text.
+.TP
+\-f \fIissue_file\fP
+Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
+This allows custom messages to be displayed on different terminals.
+The \-i option will override this option.
+.TP
+\-I \fIinitstring\fP
+Set an initial string to be sent to the tty or modem before sending
+anything else. This may be used to initialize a modem.  Non printable
+characters may be sent by writing their octal code preceded by a
+backslash (\\). For example to send a linefeed character (ASCII 10,
+octal 012) write \\012.
+.PP
+.TP
+\-l \fIlogin_program\fP
+Invoke the specified \fIlogin_program\fP instead of /bin/login.
+This allows the use of a non-standard login program (for example,
+one that asks for a dial-up password or that uses a different
+password file).
+.TP
+\-H \fIlogin_host\fP
+Write the specified \fIlogin_host\fP into the utmp file. (Normally,
+no login host is given, since \fBagetty\fP is used for local hardwired
+connections and consoles. However, this option can be useful for 
+identifying terminal concentrators and the like.
+.TP
+\-m
+Try to extract the baud rate the CONNECT status message
+produced by Hayes(tm)\-compatible modems. These status
+messages are of the form: "<junk><speed><junk>".
+\fBagetty\fP assumes that the modem emits its status message at
+the same speed as specified with (the first) \fIbaud_rate\fP value
+on the command line.
+.sp
+Since the \fI\-m\fP feature may fail on heavily-loaded systems,
+you still should enable BREAK processing by enumerating all
+expected baud rates on the command line.
+.TP 
+\-n 
+Do not prompt the user for a login name. This can be used in
+connection with \-l option to invoke a non-standard login process such
+as a BBS system. Note that with the \-n option, \fBagetty\fR gets no input from
+user who logs in and therefore won't be able to figure out parity,
+character size, and newline processing of the connection. It defaults to 
+space parity, 7 bit characters, and ASCII CR (13) end-of-line character.
+Beware that the program that \fBagetty\fR starts (usually /bin/login)
+is run as root.
+.TP
+\-t \fItimeout\fP
+Terminate if no user name could be read within \fItimeout\fP
+seconds. This option should probably not be used with hard-wired
+lines.
+.TP
+\-L
+Force the line to be a local line with no need for carrier detect. This can
+be useful when you have a locally attached terminal where the serial line
+does not set the carrier detect signal.
+.TP
+\-U
+Turn on support for detecting an uppercase only terminal.  This setting will
+detect a login name containing only capitals as indicating an uppercase
+only terminal and turn on some upper to lower case conversions.  Note that
+this has no support for any unicode characters.
+.TP
+\-w 
+Wait for the user or the modem to send a carriage-return or a
+linefeed character before sending the \fI/etc/issue\fP (or other) file
+and the login prompt. Very useful in connection with the \-I option.
+.PP
+.SH EXAMPLES
+This section shows examples for the process field of an entry in the
+\fI/etc/inittab\fP file.  You'll have to prepend appropriate values
+for the other fields.  See \fIinittab(5)\fP for more details.
+
+For a hard-wired line or a console tty:
+.ti +5
+/sbin/agetty 9600 ttyS1
+
+For a directly connected terminal without proper carriage detect wiring:
+(try this if your terminal just sleeps instead of giving you a password:
+prompt.)
+.ti +5
+/sbin/agetty \-L 9600 ttyS1 vt100
+
+For a old style dial-in line with a 9600/2400/1200 baud modem:
+.ti +5
+/sbin/agetty \-mt60 ttyS1 9600,2400,1200
+
+For a Hayes modem with a fixed 115200 bps interface to the machine:
+(the example init string turns off modem echo and result codes, makes
+modem/computer DCD track modem/modem DCD, makes a DTR drop cause a 
+dis-connection and turn on auto-answer after 1 ring.)
+.ti +5
+/sbin/agetty \-w \-I 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
+
+.SH ISSUE ESCAPES
+The issue-file (\fI/etc/issue\fP or the file set with the \-f option)
+may contain certain escape codes to display the system name, date and
+time etc. All escape codes consist of a backslash (\\) immediately
+followed by one of the letters explained below.
+
+.TP
+b
+Insert the baudrate of the current line.
+.TP
+d
+Insert the current date.
+.TP
+s
+Insert the system name, the name of the operating system.
+.TP
+l
+Insert the name of the current tty line.
+.TP
+m
+Insert the architecture identifier of the machine, eg. i486
+.TP
+n
+Insert the nodename of the machine, also known as the hostname.
+.TP
+o
+Insert the NIS domainname of the machine.
+.TP
+O
+Insert the DNS domainname of the machine.
+.TP
+r
+Insert the release number of the OS, eg. 1.1.9.
+.TP
+t
+Insert the current time.
+.TP
+u
+Insert the number of current users logged in.
+.TP
+U
+Insert the string "1 user" or "<n> users" where <n> is the number of current
+users logged in.
+.TP
+v
+Insert the version of the OS, eg. the build-date etc.
+.TP
+Example: On my system, the following \fI/etc/issue\fP file:
+
+.na
+.nf
+.ti +.5
+This is \\n.\\o (\\s \\m \\r) \\t
+.TP
+displays as
+
+.ti +.5
+This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
+
+.fi
+
+.SH FILES
+.na
+.nf
+/var/run/utmp, the system status file.
+/etc/issue, printed before the login prompt.
+/dev/console, problem reports (if syslog(3) is not used).
+/etc/inittab, \fIinit\fP(8) configuration file.
+.SH BUGS
+.ad
+.fi
+The baud-rate detection feature (the \fI-m\fP option) requires that
+\fBagetty\fP be scheduled soon enough after completion of a dial-in
+call (within 30 ms with modems that talk at 2400 baud). For robustness,
+always use the \fI\-m\fP option in combination with a multiple baud
+rate command-line argument, so that BREAK processing is enabled.
+
+The text in the \fI/etc/issue\fP file (or other) and the login prompt
+are always output with 7-bit characters and space parity.
+
+The baud-rate detection feature (the \fI-m\fP option) requires that
+the modem emits its status message \fIafter\fP raising the DCD line.
+.SH DIAGNOSTICS
+.ad
+.fi
+Depending on how the program was configured, all diagnostics are
+written to the console device or reported via the syslog(3) facility.
+Error messages are produced if the \fIport\fP argument does not
+specify a terminal device; if there is no utmp entry for the
+current process (System V only); and so on.
+.SH AUTHOR(S)
+.na
+.nf
+W.Z. Venema <wietse@wzv.win.tue.nl>
+Eindhoven University of Technology
+Department of Mathematics and Computer Science
+Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
+
+Peter Orbaek <poe@daimi.aau.dk>
+Linux port and more options. Still maintains the code.
+
+Eric Rasmussen <ear@usfirst.org>
+Added \-f option to display custom login messages on different terminals.
+
+.SH AVAILABILITY
+The agetty command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/login-utils/agetty.c b/util-linux-ng-2.17.2/login-utils/agetty.c
new file mode 100644
index 0000000..39a1fd3
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/agetty.c
@@ -0,0 +1,1282 @@
+/* agetty.c - another getty program for Linux. By W. Z. Venema 1989
+   Ported to Linux by Peter Orbaek <poe@daimi.aau.dk>
+   This program is freely distributable. The entire man-page used to
+   be here. Now read the real man-page agetty.8 instead.
+
+   -f option added by Eric Rasmussen <ear@usfirst.org> - 12/28/95
+   
+   1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+   - added Native Language Support
+
+   1999-05-05 Thorsten Kranzkowski <dl8bcu@gmx.net>
+   - enable hardware flow control before displaying /etc/issue
+   
+*/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <signal.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <utmp.h>
+#include <getopt.h>
+#include <time.h>
+#include <sys/file.h>
+#include <sys/socket.h>
+#include <netdb.h>
+
+#include "xstrncpy.h"
+#include "nls.h"
+#include "pathnames.h"
+
+#ifdef __linux__
+#include <sys/param.h>
+#define USE_SYSLOG
+#endif
+
+ /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */
+
+#ifdef	USE_SYSLOG
+#include <syslog.h>
+#endif
+
+ /*
+  * Some heuristics to find out what environment we are in: if it is not
+  * System V, assume it is SunOS 4.
+  */
+
+#ifdef LOGIN_PROCESS			/* defined in System V utmp.h */
+#define	SYSV_STYLE			/* select System V style getty */
+#endif
+
+ /*
+  * Things you may want to modify.
+  * 
+  * If ISSUE is not defined, agetty will never display the contents of the
+  * /etc/issue file. You will not want to spit out large "issue" files at the
+  * wrong baud rate. Relevant for System V only.
+  * 
+  * You may disagree with the default line-editing etc. characters defined
+  * below. Note, however, that DEL cannot be used for interrupt generation
+  * and for line editing at the same time.
+  */
+
+#ifdef	SYSV_STYLE
+#define	ISSUE "/etc/issue"		/* displayed before the login prompt */
+#include <sys/utsname.h>
+#endif
+
+#define LOGIN " login: "		/* login prompt */
+
+/* Some shorthands for control characters. */
+
+#define CTL(x)		(x ^ 0100)	/* Assumes ASCII dialect */
+#define	CR		CTL('M')	/* carriage return */
+#define	NL		CTL('J')	/* line feed */
+#define	BS		CTL('H')	/* back space */
+#define	DEL		CTL('?')	/* delete */
+
+/* Defaults for line-editing etc. characters; you may want to change this. */
+
+#define DEF_ERASE	DEL		/* default erase character */
+#define DEF_INTR	CTL('C')	/* default interrupt character */
+#define DEF_QUIT	CTL('\\')	/* default quit char */
+#define DEF_KILL	CTL('U')	/* default kill char */
+#define DEF_EOF		CTL('D')	/* default EOF char */
+#define DEF_EOL		0
+#define DEF_SWITCH	0		/* default switch char */
+
+#ifndef MAXHOSTNAMELEN
+# ifdef HOST_NAME_MAX
+#  define MAXHOSTNAMELEN HOST_NAME_MAX
+# else
+#  define MAXHOSTNAMELEN 64
+# endif
+#endif
+
+ /*
+  * When multiple baud rates are specified on the command line, the first one
+  * we will try is the first one specified.
+  */
+
+#define	FIRST_SPEED	0
+
+/* Storage for command-line options. */
+
+#define	MAX_SPEED	10		/* max. nr. of baud rates */
+
+struct options {
+    int     flags;			/* toggle switches, see below */
+    int     timeout;			/* time-out period */
+    char   *login;			/* login program */
+    char   *tty;			/* name of tty */
+    char   *initstring;			/* modem init string */
+    char   *issue;			/* alternative issue file */
+    int     numspeed;			/* number of baud rates to try */
+    int     speeds[MAX_SPEED];		/* baud rates to be tried */
+    int     eightbits;			/* assume 8bit-clean tty */
+};
+
+#define	F_PARSE		(1<<0)		/* process modem status messages */
+#define	F_ISSUE		(1<<1)		/* display /etc/issue */
+#define	F_RTSCTS	(1<<2)		/* enable RTS/CTS flow control */
+#define F_LOCAL		(1<<3)		/* force local */
+#define F_INITSTRING    (1<<4)		/* initstring is set */
+#define F_WAITCRLF	(1<<5)		/* wait for CR or LF */
+#define F_CUSTISSUE	(1<<6)		/* give alternative issue file */
+#define F_NOPROMPT	(1<<7)		/* don't ask for login name! */
+#define F_LCUC		(1<<8)		/* Support for *LCUC stty modes */
+
+/* Storage for things detected while the login name was read. */
+
+struct chardata {
+    int     erase;			/* erase character */
+    int     kill;			/* kill character */
+    int     eol;			/* end-of-line character */
+    int     parity;			/* what parity did we see */
+    int     capslock;			/* upper case without lower case */
+};
+
+/* Initial values for the above. */
+
+struct chardata init_chardata = {
+    DEF_ERASE,				/* default erase character */
+    DEF_KILL,				/* default kill character */
+    13,					/* default eol char */
+    0,					/* space parity */
+    0,					/* no capslock */
+};
+
+struct Speedtab {
+    long    speed;
+    int     code;
+};
+
+static struct Speedtab speedtab[] = {
+    { 50, B50 },
+    { 75, B75 },
+    { 110, B110 },
+    { 134, B134 },
+    { 150, B150 },
+    { 200, B200 },
+    { 300, B300 },
+    { 600, B600 },
+    { 1200, B1200 },
+    { 1800, B1800 },
+    { 2400, B2400 },
+    { 4800, B4800 },
+    { 9600, B9600 },
+#ifdef	B19200
+    { 19200, B19200 },
+#endif
+#ifdef	B38400
+    { 38400, B38400 },
+#endif
+#ifdef	EXTA
+    { 19200, EXTA },
+#endif
+#ifdef	EXTB
+    { 38400, EXTB },
+#endif
+#ifdef B57600
+    { 57600, B57600 },
+#endif
+#ifdef B115200
+    { 115200, B115200 },
+#endif
+#ifdef B230400
+    { 230400, B230400 },
+#endif
+    { 0, 0 },
+};
+
+#define P_(s) s
+int main P_((int argc, char **argv));
+void parse_args P_((int argc, char **argv, struct options *op));
+void parse_speeds P_((struct options *op, char *arg));
+void update_utmp P_((char *line));
+void open_tty P_((char *tty, struct termios *tp, int local));
+void termio_init P_((struct termios *tp, int speed, struct options *op));
+void auto_baud P_((struct termios *tp));
+void do_prompt P_((struct options *op, struct termios *tp));
+void next_speed P_((struct termios *tp, struct options *op));
+char *get_logname P_((struct options *op, struct chardata *cp, struct termios *tp));
+void termio_final P_((struct options *op, struct termios *tp, struct chardata *cp));
+int caps_lock P_((char *s));
+int bcode P_((char *s));
+void usage P_((void));
+void error P_((const char *, ...));
+#undef P_
+
+/* The following is used for understandable diagnostics. */
+
+char *progname;
+
+/* Fake hostname for ut_host specified on command line. */
+char *fakehost = NULL;
+
+/* ... */
+#ifdef DEBUGGING
+#define debug(s) fprintf(dbf,s); fflush(dbf)
+FILE *dbf;
+#else
+#define debug(s) /* nothing */
+#endif
+
+int
+main(argc, argv)
+     int     argc;
+     char  **argv;
+{
+    char   *logname = NULL;		/* login name, given to /bin/login */
+    struct chardata chardata;		/* set by get_logname() */
+    struct termios termios;		/* terminal mode bits */
+    static struct options options = {
+	F_ISSUE,			/* show /etc/issue (SYSV_STYLE) */
+	0,				/* no timeout */
+	_PATH_LOGIN,			/* default login program */
+	"tty1",				/* default tty line */
+	"",				/* modem init string */
+	ISSUE,				/* default issue file */
+	0,				/* no baud rates known yet */
+    };
+
+       setlocale(LC_ALL, "");
+       bindtextdomain(PACKAGE, LOCALEDIR);
+       textdomain(PACKAGE);
+    
+    /* The BSD-style init command passes us a useless process name. */
+
+#ifdef	SYSV_STYLE
+       {
+	       char *ptr;
+	       progname = argv[0];
+	       if ((ptr = strrchr(argv[0], '/')))
+		       progname = ++ptr;
+       }
+#else
+       progname = "agetty";
+#endif
+
+#ifdef DEBUGGING
+	dbf = fopen("/dev/ttyp0", "w");
+
+	{	int i;
+	
+		for(i = 1; i < argc; i++) {
+			debug(argv[i]);
+		}
+	}
+#endif
+
+    /* Parse command-line arguments. */
+
+    parse_args(argc, argv, &options);
+
+#ifdef __linux__
+	setsid();
+#endif
+	
+    /* Update the utmp file. */
+
+#ifdef	SYSV_STYLE
+    update_utmp(options.tty);
+#endif
+
+    debug("calling open_tty\n");
+    /* Open the tty as standard { input, output, error }. */
+    open_tty(options.tty, &termios, options.flags & F_LOCAL);
+
+    tcsetpgrp(0, getpid());
+    /* Initialize the termios settings (raw mode, eight-bit, blocking i/o). */
+    debug("calling termio_init\n");
+    termio_init(&termios, options.speeds[FIRST_SPEED], &options);
+
+    /* write the modem init string and DON'T flush the buffers */
+    if (options.flags & F_INITSTRING) {
+	debug("writing init string\n");
+	write(1, options.initstring, strlen(options.initstring));
+    }
+
+    if (!(options.flags & F_LOCAL)) {
+	/* go to blocking write mode unless -L is specified */
+	fcntl(1, F_SETFL, fcntl(1, F_GETFL, 0) & ~O_NONBLOCK);
+    }
+
+    /* Optionally detect the baud rate from the modem status message. */
+    debug("before autobaud\n");
+    if (options.flags & F_PARSE)
+	auto_baud(&termios);
+
+    /* Set the optional timer. */
+    if (options.timeout)
+	(void) alarm((unsigned) options.timeout);
+
+    /* optionally wait for CR or LF before writing /etc/issue */
+    if (options.flags & F_WAITCRLF) {
+	char ch;
+
+	debug("waiting for cr-lf\n");
+	while(read(0, &ch, 1) == 1) {
+	    ch &= 0x7f;   /* strip "parity bit" */
+#ifdef DEBUGGING
+	    fprintf(dbf, "read %c\n", ch);
+#endif
+	    if (ch == '\n' || ch == '\r') break;
+	}
+    }
+
+    chardata = init_chardata;
+    if (!(options.flags & F_NOPROMPT)) {
+	/* Read the login name. */
+	debug("reading login name\n");
+	while ((logname = get_logname(&options, &chardata, &termios)) == 0)
+	  next_speed(&termios, &options);
+    }
+
+    /* Disable timer. */
+
+    if (options.timeout)
+	(void) alarm(0);
+
+    /* Finalize the termios settings. */
+
+    termio_final(&options, &termios, &chardata);
+
+    /* Now the newline character should be properly written. */
+
+    (void) write(1, "\n", 1);
+
+    /* Let the login program take care of password validation. */
+
+    (void) execl(options.login, options.login, "--", logname, NULL);
+    error(_("%s: can't exec %s: %m"), options.tty, options.login);
+    exit(0);  /* quiet GCC */
+}
+
+/* parse-args - parse command-line arguments */
+
+void
+parse_args(argc, argv, op)
+     int     argc;
+     char  **argv;
+     struct options *op;
+{
+    extern char *optarg;		/* getopt */
+    extern int optind;			/* getopt */
+    int     c;
+
+    while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mt:wUn"))) {
+	switch (c) {
+	case '8':
+	    op->eightbits = 1;
+	    break;
+	case 'I':
+	    if (!(op->initstring = malloc(strlen(optarg)+1))) {
+		error(_("can't malloc initstring"));
+		break;
+	    }
+	    {
+		char ch, *p, *q;
+		int i;
+
+		/* copy optarg into op->initstring decoding \ddd
+		   octal codes into chars */
+		q = op->initstring;
+		p = optarg;
+		while (*p) {
+		    if (*p == '\\') {		/* know \\ means \ */
+			p++;
+			if (*p == '\\') {
+			    ch = '\\';
+			    p++;
+			} else {		/* handle \000 - \177 */
+			    ch = 0;
+			    for (i = 1; i <= 3; i++) {
+				if (*p >= '0' && *p <= '7') {
+				    ch <<= 3;
+				    ch += *p - '0';
+				    p++;
+				} else 
+				  break;
+			    }
+			}
+			*q++ = ch;
+		    } else {
+			*q++ = *p++;
+		    }
+		}
+		*q = '\0';
+	    }
+	    op->flags |= F_INITSTRING;
+	    break;
+
+	case 'L':				/* force local */
+ 	    op->flags |= F_LOCAL;
+ 	    break;
+	case 'H':                               /* fake login host */
+	    fakehost = optarg;
+	    break;
+	case 'f':				/* custom issue file */
+	    op->flags |= F_CUSTISSUE;
+	    op->issue = optarg;
+	    break;
+	case 'h':				/* enable h/w flow control */
+	    op->flags |= F_RTSCTS;
+	    break;
+	case 'i':				/* do not show /etc/issue */
+	    op->flags &= ~F_ISSUE;
+	    break;
+	case 'l':
+	    op->login = optarg;			/* non-default login program */
+	    break;
+	case 'm':				/* parse modem status message */
+	    op->flags |= F_PARSE;
+	    break;
+	case 'n':
+	    op->flags |= F_NOPROMPT;
+	    break;
+	case 't':				/* time out */
+	    if ((op->timeout = atoi(optarg)) <= 0)
+		error(_("bad timeout value: %s"), optarg);
+	    break;
+	case 'w':
+	    op->flags |= F_WAITCRLF;
+	    break;
+	case 'U':
+	    op->flags |= F_LCUC;
+	    break;
+	default:
+	    usage();
+	}
+    }
+	debug("after getopt loop\n");
+    if (argc < optind + 2)			/* check parameter count */
+	usage();
+
+    /* we loosen up a bit and accept both "baudrate tty" and "tty baudrate" */
+    if('0' <= argv[optind][0] && argv[optind][0] <= '9') {
+	/* a number first, assume it's a speed (BSD style) */
+	parse_speeds(op, argv[optind++]);	/* baud rate(s) */
+	op->tty = argv[optind];			/* tty name */
+    } else {
+	op->tty = argv[optind++];		/* tty name */
+	parse_speeds(op, argv[optind]);		/* baud rate(s) */
+    }
+
+    optind++;
+    if (argc > optind && argv[optind])
+	setenv ("TERM", argv[optind], 1);
+
+#ifdef DO_DEVFS_FIDDLING
+    /*
+     * some devfs junk, following Goswin Brederlow:
+     *   turn ttyS<n> into tts/<n>
+     *   turn tty<n> into vc/<n>
+     */
+    if (op->tty && strlen(op->tty) < 90) {
+	    char dev_name[100];
+	    struct stat st;
+
+	    if (strncmp(op->tty, "ttyS", 4) == 0) {
+		    strcpy(dev_name, "/dev/");
+		    strcat(dev_name, op->tty);
+		    if (stat(dev_name, &st) < 0) {
+			    strcpy(dev_name, "/dev/tts/");
+			    strcat(dev_name, op->tty + 4);
+			    if (stat(dev_name, &st) == 0)
+				    op->tty = strdup(dev_name + 5);
+		    }
+	    } else if (strncmp(op->tty, "tty", 3) == 0) {
+		    strcpy(dev_name, "/dev/");
+		    strncat(dev_name, op->tty, 90);
+		    if (stat(dev_name, &st) < 0) {
+			    strcpy(dev_name, "/dev/vc/");
+			    strcat(dev_name, op->tty + 3);
+			    if (stat(dev_name, &st) == 0)
+				    op->tty = strdup(dev_name + 5);
+		    }
+	    }
+    }
+#endif
+
+    debug("exiting parseargs\n");
+}
+
+/* parse_speeds - parse alternate baud rates */
+
+void
+parse_speeds(op, arg)
+     struct options *op;
+     char   *arg;
+{
+    char   *cp;
+
+	debug("entered parse_speeds\n");
+    for (cp = strtok(arg, ","); cp != 0; cp = strtok((char *) 0, ",")) {
+	if ((op->speeds[op->numspeed++] = bcode(cp)) <= 0)
+	    error(_("bad speed: %s"), cp);
+	if (op->numspeed >= MAX_SPEED)
+	    error(_("too many alternate speeds"));
+    }
+    debug("exiting parsespeeds\n");
+}
+
+#ifdef	SYSV_STYLE
+
+/* update_utmp - update our utmp entry */
+void
+update_utmp(line)
+     char   *line;
+{
+    struct  utmp ut;
+    time_t  t;
+    int     mypid = getpid();
+    struct  utmp *utp;
+
+    /*
+     * The utmp file holds miscellaneous information about things started by
+     * /sbin/init and other system-related events. Our purpose is to update
+     * the utmp entry for the current process, in particular the process type
+     * and the tty line we are listening to. Return successfully only if the
+     * utmp file can be opened for update, and if we are able to find our
+     * entry in the utmp file.
+     */
+
+    utmpname(_PATH_UTMP);
+    setutent();
+
+    /* Find mypid in utmp. Earlier code here tested only
+       utp->ut_type != INIT_PROCESS, so maybe the >= here should be >.
+       The present code is taken from login.c, so if this is changed,
+       maybe login has to be changed as well. */
+    while ((utp = getutent()))
+	    if (utp->ut_pid == mypid
+		&& utp->ut_type >= INIT_PROCESS
+		&& utp->ut_type <= DEAD_PROCESS)
+		    break;
+
+    if (utp) {
+	memcpy(&ut, utp, sizeof(ut));
+    } else {
+	/* some inits don't initialize utmp... */
+	memset(&ut, 0, sizeof(ut));
+	strncpy(ut.ut_id, line + 3, sizeof(ut.ut_id));
+    }
+	
+    strncpy(ut.ut_user, "LOGIN", sizeof(ut.ut_user));
+    strncpy(ut.ut_line, line, sizeof(ut.ut_line));
+    if (fakehost)
+	strncpy(ut.ut_host, fakehost, sizeof(ut.ut_host));
+    time(&t);
+    ut.ut_time = t;
+    ut.ut_type = LOGIN_PROCESS;
+    ut.ut_pid = mypid;
+
+    pututline(&ut);
+    endutent();
+
+    {
+#ifdef HAVE_UPDWTMP
+	updwtmp(_PATH_WTMP, &ut);
+#else
+	int ut_fd;
+	int lf;
+
+	if ((lf = open(_PATH_WTMPLOCK, O_CREAT|O_WRONLY, 0660)) >= 0) {
+	    flock(lf, LOCK_EX);
+	    if ((ut_fd = open(_PATH_WTMP, O_APPEND|O_WRONLY)) >= 0) {
+		write(ut_fd, &ut, sizeof(ut));
+		close(ut_fd);
+	    }
+	    flock(lf, LOCK_UN);
+	    close(lf);
+	}
+#endif
+    }
+}
+
+#endif
+
+/* open_tty - set up tty as standard { input, output, error } */
+void
+open_tty(tty, tp, local)
+     char   *tty;
+     struct termios *tp;
+     int    local;
+{
+    /* Get rid of the present standard { output, error} if any. */
+
+    (void) close(1);
+    (void) close(2);
+    errno = 0;					/* ignore above errors */
+
+    /* Set up new standard input, unless we are given an already opened port. */
+
+    if (strcmp(tty, "-")) {
+	struct stat st;
+
+	/* Sanity checks... */
+
+	if (chdir("/dev"))
+	    error(_("/dev: chdir() failed: %m"));
+	if (stat(tty, &st) < 0)
+	    error("/dev/%s: %m", tty);
+	if ((st.st_mode & S_IFMT) != S_IFCHR)
+	    error(_("/dev/%s: not a character device"), tty);
+
+	/* Open the tty as standard input. */
+
+	(void) close(0);
+	errno = 0;				/* ignore close(2) errors */
+
+	debug("open(2)\n");
+	if (open(tty, O_RDWR|O_NONBLOCK, 0) != 0)
+	    error(_("/dev/%s: cannot open as standard input: %m"), tty);
+
+    } else {
+
+	/*
+	 * Standard input should already be connected to an open port. Make
+	 * sure it is open for read/write.
+	 */
+
+	if ((fcntl(0, F_GETFL, 0) & O_RDWR) != O_RDWR)
+	    error(_("%s: not open for read/write"), tty);
+    }
+
+    /* Set up standard output and standard error file descriptors. */
+    debug("duping\n");
+    if (dup(0) != 1 || dup(0) != 2)		/* set up stdout and stderr */
+	error(_("%s: dup problem: %m"), tty);	/* we have a problem */
+
+    /*
+     * The following ioctl will fail if stdin is not a tty, but also when
+     * there is noise on the modem control lines. In the latter case, the
+     * common course of action is (1) fix your cables (2) give the modem more
+     * time to properly reset after hanging up. SunOS users can achieve (2)
+     * by patching the SunOS kernel variable "zsadtrlow" to a larger value;
+     * 5 seconds seems to be a good value.
+     */
+
+    if (tcgetattr(0, tp) < 0)
+	error("%s: tcgetattr: %m", tty);
+
+    /*
+     * It seems to be a terminal. Set proper protections and ownership. Mode
+     * 0622 is suitable for SYSV <4 because /bin/login does not change
+     * protections. SunOS 4 login will change the protections to 0620 (write
+     * access for group tty) after the login has succeeded.
+     */
+
+    /*
+     * Let us use 0600 for Linux for the period between getty and login
+     */
+
+    (void) chown(tty, 0, 0);			/* root, sys */
+    (void) chmod(tty, 0600);			/* 0622: crw--w--w- */
+    errno = 0;					/* ignore above errors */
+}
+
+/* termio_init - initialize termios settings */
+
+char gbuf[1024];
+char area[1024];
+
+void
+termio_init(tp, speed, op)
+     struct termios *tp;
+     int     speed;
+     struct options *op;
+{
+
+    /*
+     * Initial termios settings: 8-bit characters, raw-mode, blocking i/o.
+     * Special characters are set after we have read the login name; all
+     * reads will be done in raw mode anyway. Errors will be dealt with
+     * lateron.
+     */
+    /* flush input and output queues, important for modems! */
+    (void) tcflush(0, TCIOFLUSH);
+
+    tp->c_cflag = CS8 | HUPCL | CREAD;
+    cfsetispeed(tp, speed);
+    cfsetospeed(tp, speed);
+    if (op->flags & F_LOCAL) {
+	tp->c_cflag |= CLOCAL;
+    }
+
+    tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
+#ifdef HAVE_STRUCT_TERMIOS_C_LINE
+    tp->c_line = 0;
+#endif
+    tp->c_cc[VMIN] = 1;
+    tp->c_cc[VTIME] = 0;
+
+    /* Optionally enable hardware flow control */
+
+#ifdef	CRTSCTS
+    if (op->flags & F_RTSCTS)
+	tp->c_cflag |= CRTSCTS;
+#endif
+
+    (void) tcsetattr(0, TCSANOW, tp);
+
+    /* go to blocking input even in local mode */
+    fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~O_NONBLOCK);
+
+    debug("term_io 2\n");
+}
+
+/* auto_baud - extract baud rate from modem status message */
+void
+auto_baud(tp)
+     struct termios *tp;
+{
+    int     speed;
+    int     vmin;
+    unsigned iflag;
+    char    buf[BUFSIZ];
+    char   *bp;
+    int     nread;
+
+    /*
+     * This works only if the modem produces its status code AFTER raising
+     * the DCD line, and if the computer is fast enough to set the proper
+     * baud rate before the message has gone by. We expect a message of the
+     * following format:
+     * 
+     * <junk><number><junk>
+     * 
+     * The number is interpreted as the baud rate of the incoming call. If the
+     * modem does not tell us the baud rate within one second, we will keep
+     * using the current baud rate. It is advisable to enable BREAK
+     * processing (comma-separated list of baud rates) if the processing of
+     * modem status messages is enabled.
+     */
+
+    /*
+     * Use 7-bit characters, don't block if input queue is empty. Errors will
+     * be dealt with lateron.
+     */
+
+    iflag = tp->c_iflag;
+    tp->c_iflag |= ISTRIP;			/* enable 8th-bit stripping */
+    vmin = tp->c_cc[VMIN];
+    tp->c_cc[VMIN] = 0;				/* don't block if queue empty */
+    tcsetattr(0, TCSANOW, tp);
+
+    /*
+     * Wait for a while, then read everything the modem has said so far and
+     * try to extract the speed of the dial-in call.
+     */
+
+    (void) sleep(1);
+    if ((nread = read(0, buf, sizeof(buf) - 1)) > 0) {
+	buf[nread] = '\0';
+	for (bp = buf; bp < buf + nread; bp++) {
+	    if (isascii(*bp) && isdigit(*bp)) {
+		if ((speed = bcode(bp))) {
+		    cfsetispeed(tp, speed);
+		    cfsetospeed(tp, speed);
+		}
+		break;
+	    }
+	}
+    }
+    /* Restore terminal settings. Errors will be dealt with lateron. */
+
+    tp->c_iflag = iflag;
+    tp->c_cc[VMIN] = vmin;
+    (void) tcsetattr(0, TCSANOW, tp);
+}
+
+/* do_prompt - show login prompt, optionally preceded by /etc/issue contents */
+void
+do_prompt(op, tp)
+     struct options *op;
+     struct termios *tp;
+{
+#ifdef	ISSUE
+    FILE    *fd;
+    int     oflag;
+    int     c;
+    struct utsname uts;
+
+    (void) uname(&uts);
+#endif
+
+    (void) write(1, "\r\n", 2);			/* start a new line */
+#ifdef	ISSUE					/* optional: show /etc/issue */
+    if ((op->flags & F_ISSUE) && (fd = fopen(op->issue, "r"))) {
+	oflag = tp->c_oflag;			/* save current setting */
+	tp->c_oflag |= (ONLCR | OPOST);		/* map NL in output to CR-NL */
+	(void) tcsetattr(0, TCSADRAIN, tp);
+
+
+	while ((c = getc(fd)) != EOF)
+	{
+	    if (c == '\\')
+	      {
+		c = getc(fd);
+		
+		switch (c)
+		  {
+		  case 's':
+		    (void) printf ("%s", uts.sysname);
+		    break;
+		    
+		  case 'n':
+		    (void) printf ("%s", uts.nodename);
+		    break;
+		    
+		  case 'r':
+		    (void) printf ("%s", uts.release);
+		    break;
+		    
+		  case 'v':
+		    (void) printf ("%s", uts.version);
+		    break;
+		    
+		  case 'm':
+		    (void) printf ("%s", uts.machine);
+		    break;
+
+		  case 'o':
+		   {
+		     char domainname[MAXHOSTNAMELEN+1];
+#ifdef HAVE_GETDOMAINNAME
+		     if (getdomainname(domainname, sizeof(domainname)))
+#endif
+			 strcpy(domainname, "unknown_domain");
+		     domainname[sizeof(domainname)-1] = '\0';
+		     printf ("%s", domainname);
+		   }
+		  break;
+
+		  case 'O':
+		   {
+			char *dom = "unknown_domain";
+			char host[MAXHOSTNAMELEN+1];
+			struct addrinfo hints, *info = NULL;
+
+			memset(&hints, 0, sizeof(hints));
+			hints.ai_flags = AI_CANONNAME;
+
+			if (gethostname(host, sizeof(host)) ||
+			    getaddrinfo(host, NULL, &hints, &info) ||
+			    info == NULL)
+				fputs(dom, stdout);
+			else {
+				char *canon;
+
+				if (info->ai_canonname &&
+				    (canon = strchr(info->ai_canonname, '.')))
+					dom = canon + 1;
+				fputs(dom, stdout);
+				freeaddrinfo(info);
+			}
+		   }
+		  break;
+
+		  case 'd':
+		  case 't':
+		    {
+		      /* TODO: use nl_langinfo() */
+		      char *weekday[] = { "Sun", "Mon", "Tue", "Wed", "Thu",
+					  "Fri", "Sat" };
+		      char *month[] = { "Jan", "Feb", "Mar", "Apr", "May",
+					"Jun", "Jul", "Aug", "Sep", "Oct",
+					"Nov", "Dec" };
+		      time_t now;
+		      struct tm *tm;
+
+		      (void) time (&now);
+		      tm = localtime(&now);
+
+		      if (c == 'd')
+			(void) printf ("%s %s %d  %d",
+				weekday[tm->tm_wday], month[tm->tm_mon],
+				tm->tm_mday, 
+				tm->tm_year < 70 ? tm->tm_year + 2000 :
+				tm->tm_year + 1900);
+		      else
+			(void) printf ("%02d:%02d:%02d",
+				tm->tm_hour, tm->tm_min, tm->tm_sec);
+		      
+		      break;
+		    }
+
+		  case 'l':
+		      (void) printf ("%s", op->tty);
+		      break;
+
+		  case 'b':
+		    {
+			int i;
+
+			for (i = 0; speedtab[i].speed; i++) {
+			    if (speedtab[i].code == cfgetispeed(tp)) {
+				printf("%ld", speedtab[i].speed);
+				break;
+			    }
+			}
+			break;
+		    }
+		  case 'u':
+		  case 'U':
+		    {
+		      int users = 0;
+		      struct utmp *ut;
+		      setutent();
+		      while ((ut = getutent()))
+		        if (ut->ut_type == USER_PROCESS)
+			  users++;
+		      endutent();
+		      printf ("%d ", users);
+		      if (c == 'U')
+		        printf ((users == 1) ? _("user") : _("users"));
+		      break;
+		    }
+		  default:
+		    (void) putchar(c);
+		  }
+	      }
+	    else
+	      (void) putchar(c);
+	}
+	fflush(stdout);
+
+	tp->c_oflag = oflag;			/* restore settings */
+	(void) tcsetattr(0, TCSADRAIN, tp);	/* wait till output is gone */
+	(void) fclose(fd);
+    }
+#endif
+    {
+	char hn[MAXHOSTNAMELEN+1];
+	if (gethostname(hn, sizeof(hn)) == 0)
+	    write(1, hn, strlen(hn));
+    }
+    (void) write(1, LOGIN, sizeof(LOGIN) - 1);	/* always show login prompt */
+}
+
+/* next_speed - select next baud rate */
+void
+next_speed(tp, op)
+     struct termios *tp;
+     struct options *op;
+{
+    static int baud_index = FIRST_SPEED;/* current speed index */
+
+    baud_index = (baud_index + 1) % op->numspeed;
+    cfsetispeed(tp, op->speeds[baud_index]);
+    cfsetospeed(tp, op->speeds[baud_index]);
+    (void) tcsetattr(0, TCSANOW, tp);
+}
+
+/* get_logname - get user name, establish parity, speed, erase, kill, eol */
+
+char   *get_logname(op, cp, tp)
+     struct options *op;
+     struct chardata *cp;
+     struct termios *tp;
+{
+    static char logname[BUFSIZ];
+    char   *bp;
+    char    c;				/* input character, full eight bits */
+    char    ascval;			/* low 7 bits of input character */
+    int     bits;			/* # of "1" bits per character */
+    int     mask;			/* mask with 1 bit up */
+    static char *erase[] = {		/* backspace-space-backspace */
+	"\010\040\010",			/* space parity */
+	"\010\040\010",			/* odd parity */
+	"\210\240\210",			/* even parity */
+	"\210\240\210",			/* no parity */
+    };
+
+    /* Initialize kill, erase, parity etc. (also after switching speeds). */
+
+    *cp = init_chardata;
+
+    /* Flush pending input (esp. after parsing or switching the baud rate). */
+
+    (void) sleep(1);
+    (void) tcflush(0, TCIFLUSH);
+
+    /* Prompt for and read a login name. */
+
+    for (*logname = 0; *logname == 0; /* void */ ) {
+
+	/* Write issue file and prompt, with "parity" bit == 0. */
+
+	do_prompt(op, tp);
+
+	/* Read name, watch for break, parity, erase, kill, end-of-line. */
+
+	for (bp = logname, cp->eol = 0; cp->eol == 0; /* void */ ) {
+
+	    /* Do not report trivial EINTR/EIO errors. */
+
+	    if (read(0, &c, 1) < 1) {
+		if (errno == EINTR || errno == EIO)
+		    exit(0);
+		error(_("%s: read: %m"), op->tty);
+	    }
+	    /* Do BREAK handling elsewhere. */
+
+	    if ((c == 0) && op->numspeed > 1)
+		return (0);
+	    /* Do parity bit handling. */
+
+	    if (op->eightbits) {
+		ascval = c;
+	    } else if (c != (ascval = (c & 0177))) {	/* "parity" bit on */
+		for (bits = 1, mask = 1; mask & 0177; mask <<= 1)
+		    if (mask & ascval)
+			bits++;			/* count "1" bits */
+		cp->parity |= ((bits & 1) ? 1 : 2);
+	    }
+	    /* Do erase, kill and end-of-line processing. */
+
+	    switch (ascval) {
+	    case CR:
+	    case NL:
+		*bp = 0;			/* terminate logname */
+		cp->eol = ascval;		/* set end-of-line char */
+		break;
+	    case BS:
+	    case DEL:
+	    case '#':
+		cp->erase = ascval;		/* set erase character */
+		if (bp > logname) {
+		    (void) write(1, erase[cp->parity], 3);
+		    bp--;
+		}
+		break;
+	    case CTL('U'):
+	    case '@':
+		cp->kill = ascval;		/* set kill character */
+		while (bp > logname) {
+		    (void) write(1, erase[cp->parity], 3);
+		    bp--;
+		}
+		break;
+	    case CTL('D'):
+		exit(0);
+	    default:
+		if (!isascii(ascval) || !isprint(ascval)) {
+		     /* ignore garbage characters */ ;
+		} else if (bp - logname >= sizeof(logname) - 1) {
+		    error(_("%s: input overrun"), op->tty);
+		} else {
+		    (void) write(1, &c, 1);	/* echo the character */
+		    *bp++ = ascval;		/* and store it */
+		}
+		break;
+	    }
+	}
+    }
+    /* Handle names with upper case and no lower case. */
+    if ((op->flags & F_LCUC) && (cp->capslock = caps_lock(logname))) {
+	for (bp = logname; *bp; bp++)
+	    if (isupper(*bp))
+		*bp = tolower(*bp);		/* map name to lower case */
+    }
+    return (logname);
+}
+
+/* termio_final - set the final tty mode bits */
+void
+termio_final(op, tp, cp)
+     struct options *op;
+     struct termios *tp;
+     struct chardata *cp;
+{
+    /* General terminal-independent stuff. */
+
+    tp->c_iflag |= IXON | IXOFF;		/* 2-way flow control */
+    tp->c_lflag |= ICANON | ISIG | ECHO | ECHOE | ECHOK| ECHOKE;
+      /* no longer| ECHOCTL | ECHOPRT*/
+    tp->c_oflag |= OPOST;
+    /* tp->c_cflag = 0; */
+    tp->c_cc[VINTR] = DEF_INTR;			/* default interrupt */
+    tp->c_cc[VQUIT] = DEF_QUIT;			/* default quit */
+    tp->c_cc[VEOF] = DEF_EOF;			/* default EOF character */
+    tp->c_cc[VEOL] = DEF_EOL;
+#ifdef __linux__
+    tp->c_cc[VSWTC] = DEF_SWITCH;		/* default switch character */
+#elif defined(VSWTCH)
+    tp->c_cc[VSWTCH] = DEF_SWITCH;		/* default switch character */
+#endif
+
+    /* Account for special characters seen in input. */
+
+    if (cp->eol == CR) {
+	tp->c_iflag |= ICRNL;			/* map CR in input to NL */
+	tp->c_oflag |= ONLCR;			/* map NL in output to CR-NL */
+    }
+    tp->c_cc[VERASE] = cp->erase;		/* set erase character */
+    tp->c_cc[VKILL] = cp->kill;			/* set kill character */
+
+    /* Account for the presence or absence of parity bits in input. */
+
+    switch (cp->parity) {
+    case 0:					/* space (always 0) parity */
+	break;
+    case 1:					/* odd parity */
+	tp->c_cflag |= PARODD;
+	/* FALLTHROUGH */
+    case 2:					/* even parity */
+	tp->c_cflag |= PARENB;
+	tp->c_iflag |= INPCK | ISTRIP;
+	/* FALLTHROUGH */
+    case (1 | 2):				/* no parity bit */
+	tp->c_cflag &= ~CSIZE;
+	tp->c_cflag |= CS7;
+	break;
+    }
+    /* Account for upper case without lower case. */
+
+    if (cp->capslock) {
+#ifdef IUCLC
+	tp->c_iflag |= IUCLC;
+#endif
+#ifdef XCASE	
+	tp->c_lflag |= XCASE;
+#endif
+#ifdef OLCUC
+	tp->c_oflag |= OLCUC;
+#endif
+    }
+    /* Optionally enable hardware flow control */
+
+#ifdef	CRTSCTS
+    if (op->flags & F_RTSCTS)
+	tp->c_cflag |= CRTSCTS;
+#endif
+
+    /* Finally, make the new settings effective */
+
+    if (tcsetattr(0, TCSANOW, tp) < 0)
+	error("%s: tcsetattr: TCSANOW: %m", op->tty);
+}
+
+/* caps_lock - string contains upper case without lower case */
+int
+caps_lock(s)
+     char   *s;
+{
+    int     capslock;
+
+    for (capslock = 0; *s; s++) {
+	if (islower(*s))
+	    return (0);
+	if (capslock == 0)
+	    capslock = isupper(*s);
+    }
+    return (capslock);
+}
+
+/* bcode - convert speed string to speed code; return 0 on failure */
+int
+bcode(s)
+     char   *s;
+{
+    struct Speedtab *sp;
+    long    speed = atol(s);
+
+    for (sp = speedtab; sp->speed; sp++)
+	if (sp->speed == speed)
+	    return (sp->code);
+    return (0);
+}
+
+/* usage - explain */
+
+void
+usage()
+{
+    fprintf(stderr, _("Usage: %s [-8hiLmUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
+    exit(1);
+}
+
+/* error - report errors to console or syslog; only understands %s and %m */
+
+#define	str2cpy(b,s1,s2)	strcat(strcpy(b,s1),s2)
+
+void
+error(const char *fmt, ...) {
+    va_list ap;
+#ifndef	USE_SYSLOG
+    int     fd;
+#endif
+    char    buf[BUFSIZ];
+    char   *bp;
+
+    /*
+     * If the diagnostic is reported via syslog(3), the process name is
+     * automatically prepended to the message. If we write directly to
+     * /dev/console, we must prepend the process name ourselves.
+     */
+
+#ifdef USE_SYSLOG
+    buf[0] = '\0';
+    bp = buf;
+#else
+    (void) str2cpy(buf, progname, ": ");
+    bp = buf + strlen(buf);
+#endif
+
+    /*
+     * %s expansion is done by hand. On a System V Release 2 system without
+     * shared libraries and without syslog(3), linking with the the stdio
+     * library would make the program three times as big...
+     *
+     * %m expansion is done here as well. Too bad syslog(3) does not have a
+     * vsprintf() like interface.
+     */
+
+    va_start(ap, fmt);
+    while (*fmt && bp < &buf[BUFSIZ-1]) {
+	if (strncmp(fmt, "%s", 2) == 0) {
+	    xstrncpy(bp, va_arg(ap, char *), &buf[BUFSIZ-1] - bp);
+	    bp += strlen(bp);
+	    fmt += 2;
+	} else if (strncmp(fmt, "%m", 2) == 0) {
+	    xstrncpy(bp, strerror(errno), &buf[BUFSIZ-1] - bp);
+	    bp += strlen(bp);
+	    fmt += 2;
+	} else {
+	    *bp++ = *fmt++;
+	}
+    }
+    *bp = 0;
+    va_end(ap);
+
+    /*
+     * Write the diagnostic directly to /dev/console if we do not use the
+     * syslog(3) facility.
+     */
+
+#ifdef	USE_SYSLOG
+    (void) openlog(progname, LOG_PID, LOG_AUTHPRIV);
+    (void) syslog(LOG_ERR, "%s", buf);
+    closelog();
+#else
+    /* Terminate with CR-LF since the console mode is unknown. */
+    (void) strcat(bp, "\r\n");
+    if ((fd = open("/dev/console", 1)) >= 0) {
+	(void) write(fd, buf, strlen(buf));
+	(void) close(fd);
+    }
+#endif
+    (void) sleep((unsigned) 10);		/* be kind to init(8) */
+    exit(1);
+}
diff --git a/util-linux-ng-2.17.2/login-utils/checktty.c b/util-linux-ng-2.17.2/login-utils/checktty.c
new file mode 100644
index 0000000..c28ee83
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/checktty.c
@@ -0,0 +1,573 @@
+/* checktty.c - linked into login, checks user against /etc/usertty
+   Created 25-Aug-95 by Peter Orbaek <poe@daimi.aau.dk>
+   Fixed by JDS June 1996 to clear lists and close files
+
+   1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+   - added Native Language Support
+
+*/
+
+#include <sys/types.h>
+#include <sys/param.h>
+
+#include <pwd.h>
+#include <grp.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/stat.h>
+#include <malloc.h>
+#include <netdb.h>
+#include <sys/syslog.h>
+#include <ctype.h>
+#include "nls.h"
+
+#include <sys/sysmacros.h>
+#ifdef HAVE_LINUX_MAJOR_H
+#include <linux/major.h>
+#endif
+
+#include "pathnames.h"
+#include "login.h"
+#include "xstrncpy.h"
+
+#ifndef TTY_MAJOR
+#define TTY_MAJOR 4
+#endif
+
+static gid_t mygroups[NGROUPS];
+static int   num_groups;
+
+#define NAMELEN 128
+
+/* linked list of names */
+struct grplist {
+    struct grplist *next;
+    char name[NAMELEN];
+};
+        
+enum State { StateUsers, StateGroups, StateClasses };
+
+#define CLASSNAMELEN 32
+
+struct ttyclass {
+    struct grplist *first;
+    struct ttyclass *next;
+    char classname[CLASSNAMELEN];
+};
+
+struct ttyclass *ttyclasses = NULL;
+
+static int
+am_in_group(char *group)
+{
+	struct group *g;
+	gid_t *ge;
+	
+	g = getgrnam(group);
+	if (g) {
+		for (ge = mygroups; ge < mygroups + num_groups; ge++) {
+			if (g->gr_gid== *ge) return 1;
+		}
+	}
+    	return 0;
+}
+
+static void
+find_groups(gid_t defgrp, const char *user)
+{
+	num_groups = getgroups(NGROUPS, mygroups);
+}
+
+static struct ttyclass *
+new_class(char *class)
+{
+    struct ttyclass *tc;
+
+    tc = (struct ttyclass *)malloc(sizeof(struct ttyclass));
+    if (tc == NULL) {
+	printf(_("login: memory low, login may fail\n"));
+	syslog(LOG_WARNING, _("can't malloc for ttyclass"));
+	return NULL;
+    }
+
+    tc->next = ttyclasses;
+    tc->first = NULL;
+    xstrncpy(tc->classname, class, CLASSNAMELEN);
+    ttyclasses = tc;
+    return tc;
+}
+
+static void
+add_to_class(struct ttyclass *tc, char *tty)
+{
+    struct grplist *ge;
+
+    if (tc == NULL) return;
+
+    ge = (struct grplist *)malloc(sizeof(struct grplist));
+    if (ge == NULL) {
+	printf(_("login: memory low, login may fail\n"));
+	syslog(LOG_WARNING, _("can't malloc for grplist"));
+	return;
+    }
+
+    ge->next = tc->first;
+    xstrncpy(ge->name, tty, NAMELEN);
+    tc->first = ge;
+}
+
+
+/* return true if tty is a pty. Very linux dependent */
+static int
+isapty(const char *tty)
+{
+#ifdef __linux__
+    char devname[100];
+    struct stat stb;
+
+    /* avoid snprintf - old systems do not have it */
+    if (strlen(tty) + 6 > sizeof(devname))
+	    return 0;
+    sprintf(devname, "/dev/%s", tty);
+
+    if((stat(devname, &stb) >= 0) && S_ISCHR(stb.st_mode)) {
+	    int majordev = major(stb.st_rdev);
+
+	    /* this is for linux versions before 1.3: use major 4 */
+	    if(majordev == TTY_MAJOR && minor(stb.st_rdev) >= 192)
+		    return 1;
+
+#if defined(PTY_SLAVE_MAJOR)
+	    /* this is for linux 1.3 and newer: use major 3 */
+	    if(majordev == PTY_SLAVE_MAJOR)
+		    return 1;
+#endif
+
+#if defined(UNIX98_PTY_SLAVE_MAJOR) && defined(UNIX98_PTY_MAJOR_COUNT)
+	    /* this is for linux 2.1.116 and newer: use majors 136-143 */
+	    if(majordev >= UNIX98_PTY_SLAVE_MAJOR &&
+	       majordev < UNIX98_PTY_SLAVE_MAJOR + UNIX98_PTY_MAJOR_COUNT)
+		    return 1;
+#endif
+
+    }
+#endif	/* __linux__ */
+    return 0;
+}
+
+
+/* IPv4 -- pattern is x.x.x.x/y.y.y.y (net/mask)*/
+static int
+hnmatch_ip4(const char *pat)
+{
+	int x1, x2, x3, x4, y1, y2, y3, y4;
+	unsigned long p, mask, a;
+	unsigned char *ha;
+
+	/* pattern is an IP QUAD address and a mask x.x.x.x/y.y.y.y */
+	if (sscanf(pat, "%d.%d.%d.%d/%d.%d.%d.%d",
+			&x1, &x2, &x3, &x4, &y1, &y2, &y3, &y4) < 8)
+		return 0;
+
+	p = (((unsigned long)x1<<24)+((unsigned long)x2<<16)
+	     +((unsigned long)x3<<8)+((unsigned long)x4));
+	mask = (((unsigned long)y1<<24)+((unsigned long)y2<<16)
+		+((unsigned long)y3<<8)+((unsigned long)y4));
+
+	if (hostaddress[0] == 0)
+		return 0;
+
+	ha = (unsigned char *)hostaddress;
+	a = (((unsigned long)ha[0]<<24)+((unsigned long)ha[1]<<16)
+	     +((unsigned long)ha[2]<<8)+((unsigned long)ha[3]));
+	return ((p & mask) == (a & mask));
+}
+
+/* IPv6 -- pattern is [hex:hex:....]/number ([net]/mask) */
+static int
+hnmatch_ip6(const char *pat)
+{
+	char *patnet;
+	char *patmask;
+	struct in6_addr addr;
+	struct addrinfo hints, *res;
+	struct sockaddr_in6 net;
+	int mask_len, i = 0;
+	char *p;
+
+	if (pat == NULL || *pat != '[')
+		return 0;
+
+	memcpy(&addr, hostaddress, sizeof(addr));
+
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_family = AF_INET6;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
+
+	patnet = strdup(pat);
+
+	/* match IPv6 address against [netnumber]/prefixlen */
+	if (!(p = strchr(patnet, ']')))
+		goto mismatch;
+
+	*p++ = '\0';
+
+	if (! (*p == '/' && isdigit((unsigned char) *(p + 1))))
+		goto mismatch;
+
+	patmask = p + 1;
+
+	/* prepare net address */
+	if (getaddrinfo(patnet + 1, NULL, &hints, &res) != 0)
+		goto mismatch;
+
+	memcpy(&net, res->ai_addr, sizeof(net));
+	freeaddrinfo(res);
+
+	/* convert mask to number */
+	if ((mask_len = atoi(patmask)) < 0 || mask_len > 128)
+		goto mismatch;
+
+	/* compare */
+	while (mask_len > 0) {
+		if (mask_len < 32) {
+			u_int32_t mask = htonl(~(0xffffffff >> mask_len));
+
+			if ((*(u_int32_t *)&addr.s6_addr[i] & mask) !=
+			    (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask))
+				goto mismatch;
+			break;
+		}
+		if (*(u_int32_t *)&addr.s6_addr[i] !=
+		    *(u_int32_t *)&net.sin6_addr.s6_addr[i])
+			goto mismatch;
+		i += 4;
+		mask_len -= 32;
+	}
+
+	free(patnet);
+	return 1;
+
+mismatch:
+	free(patnet);
+	return 0;
+}
+
+/* match the hostname hn against the pattern pat */
+static int
+hnmatch(const char *hn, const char *pat)
+{
+
+	if ((hn == NULL) && (strcmp(pat, "localhost") == 0))
+		return 1;
+	if ((hn == NULL) || *hn == '\0')
+		return 0;
+
+	if (*pat >= '0' && *pat <= '9')
+		return hostfamily == AF_INET ? hnmatch_ip4(pat) : 0;
+	else if (*pat == '[')
+		return hostfamily == AF_INET6 ? hnmatch_ip6(pat) : 0;
+	else {
+		/* pattern is a suffix of a FQDN */
+		int 	n = strlen(pat),
+			m = strlen(hn);
+
+		if (n > m)
+			return 0;
+		return (strcasecmp(pat, hn + m - n) == 0);
+	}
+}
+
+#ifdef MAIN_TEST_CHECKTTY
+
+char	hostaddress[16];
+sa_family_t hostfamily;
+char	*hostname;
+void	sleepexit(int eval) {}		/* dummy for this test */
+void	badlogin(const char *s) {}	/* dummy for this test */
+
+int
+main(int argc, char **argv)
+{
+	struct addrinfo hints, *info = NULL;
+	struct addrexp {
+		const char *range;
+		const char *ip;
+	} alist[] = {
+		{ "130.225.16.0/255.255.254.0",	"130.225.16.1" },
+		{ "130.225.16.0/255.255.254.0",	"10.20.30.1" },
+		{ "130.225.0.0/255.254.0.0",	"130.225.16.1" },
+		{ "130.225.0.0/255.254.0.0",	"130.225.17.1" },
+		{ "130.225.0.0/255.254.0.0",	"150.160.170.180" },
+		{ "[3ffe:505:2:1::]/64",	"3ffe:505:2:1::" },
+		{ "[3ffe:505:2:1::]/64",	"3ffe:505:2:2::" },
+		{ "[3ffe:505:2:1::]/64",	"3ffe:505:2:1:ffff:ffff::" },
+		{ NULL, NULL }
+	}, *item;
+
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_family = AF_UNSPEC;
+	hints.ai_flags = AI_NUMERICHOST |  AI_PASSIVE | AI_ADDRCONFIG;
+	hints.ai_socktype = SOCK_STREAM;
+
+	for (item = alist; item->range; item++) {
+
+		printf("hnmatch() on %-30s <-- %-15s: ", item->range, item->ip);
+
+		if (getaddrinfo(item->ip, NULL, &hints, &info)==0 && info) {
+			if (info->ai_family == AF_INET)	{
+			    struct sockaddr_in *sa =
+				    	(struct sockaddr_in *) info->ai_addr;
+			    memcpy(hostaddress, &(sa->sin_addr),
+					sizeof(sa->sin_addr));
+			}
+			else if (info->ai_family == AF_INET6) {
+			    struct sockaddr_in6 *sa =
+				    	(struct sockaddr_in6 *) info->ai_addr;
+			    memcpy(hostaddress, &(sa->sin6_addr),
+					sizeof(sa->sin6_addr));
+			}
+			hostfamily = info->ai_family;
+			freeaddrinfo(info);
+			printf("%s\n", hnmatch("dummy", item->range) ?
+						"match" : "mismatch");
+		}
+		else
+			printf("getaddrinfo() failed\n");
+
+	}
+	return 0;
+}
+#endif /* MAIN_TEST_CHECKTTY */
+
+static char *wdays[] = { "sun", "mon", "tue", "wed", "thu", "fri", "sat" };
+
+/* example timespecs:
+
+   mon:tue:wed:8-17
+
+   meaning monday, tuesday or wednesday between 8:00 and 17:59
+
+   4:5:13:fri
+
+   meaning fridays from 4:00 to 5:59 and from 13:00 to 13:59
+*/
+static int
+timeok(struct tm *t, char *spec)
+{
+    char *p, *q;
+    int dayok = 0;
+    int hourok = 0;
+    int h, h2;
+    char *sp;
+
+    sp = spec;
+    while ((p = strsep(&sp, ":"))) {
+	if (*p >= '0' && *p <= '9') {
+	    h = atoi(p);
+	    if (h == t->tm_hour) hourok = 1;
+	    if ((q = strchr(p, '-')) && (q[1] >= '0' && q[1] <= '9')) {
+		h2 = atoi(q+1);
+		if (h <= t->tm_hour && t->tm_hour <= h2) hourok = 1;
+	    }
+	} else if (strcasecmp(wdays[t->tm_wday], p) == 0) {
+	    dayok = 1;
+	}
+    }
+
+    return (dayok && hourok);
+}
+
+/* return true if tty equals class or is in the class defined by class.
+   Also return true if hostname matches the hostname pattern, class
+   or a pattern in the class named by class. */
+static int
+in_class(const char *tty, char *class)
+{
+    struct ttyclass *tc;
+    struct grplist *ge;
+    time_t t;
+    char *p;
+    char timespec[256];
+    struct tm *tm;
+    char *n;
+
+    time(&t);
+    tm = localtime(&t);
+
+    if (class[0] == '[') {
+	if ((p = strchr(class, ']'))) {
+	    *p = 0;
+	    xstrncpy(timespec, class+1, sizeof(timespec));
+	    *p = ']';
+	    if(!timeok(tm, timespec)) return 0;
+	    class = p+1;
+	}
+	/* really ought to warn about syntax error */
+    }
+
+    if (strcmp(tty, class) == 0) return 1;
+
+    if ((class[0] == '@') && isapty(tty)
+	&& hnmatch(hostname, class+1)) return 1;
+
+    for (tc = ttyclasses; tc; tc = tc->next) {
+	if (strcmp(tc->classname, class) == 0) {
+	    for (ge = tc->first; ge; ge = ge->next) {
+
+		n = ge->name;
+		if (n[0] == '[') {
+		    if ((p = strchr(n, ']'))) {
+			*p = 0;
+			xstrncpy(timespec, n+1, sizeof(timespec));
+			*p = ']';
+			if(!timeok(tm, timespec)) continue;
+			n = p+1;
+		    }
+		    /* really ought to warn about syntax error */
+		}
+
+		if (strcmp(n, tty) == 0) return 1;
+
+		if ((n[0] == '@') && isapty(tty)
+		    && hnmatch(hostname, n+1)) return 1;
+	    }
+	    return 0;
+	}
+    }
+    return 0;
+}
+
+/* start JDS - SBA */
+static void 
+free_group(struct grplist *ge)
+{
+    if (ge) {
+	memset(ge->name, 0, NAMELEN);
+	free_group(ge->next);
+	free(ge->next);
+	ge->next = NULL;
+    }
+}
+
+static void 
+free_class(struct ttyclass *tc)
+{
+    if (tc) {
+	memset(tc->classname, 0, CLASSNAMELEN);
+	free_group(tc->first);
+	tc->first = NULL;
+	free_class(tc->next);
+	free(tc->next);
+	tc->next = NULL;
+    }
+}
+
+static void 
+free_all(void)
+{
+    free_class(ttyclasses);
+    ttyclasses = NULL;
+}
+/* end JDS - SBA */
+
+void
+checktty(const char *user, const char *tty, struct passwd *pwd)
+{
+    FILE *f;
+    char buf[256], defaultbuf[256];
+    char *ptr;
+    enum State state = StateUsers;
+    int found_match = 0;
+
+    /* no /etc/usertty, default to allow access */
+    if (!(f = fopen(_PATH_USERTTY, "r"))) return;
+
+    if (pwd == NULL) {
+	fclose(f);
+	return;  /* misspelled username handled elsewhere */
+    }
+
+    find_groups(pwd->pw_gid, user);
+
+    defaultbuf[0] = 0;
+    while(fgets(buf, 255, f)) {
+
+	/* strip comments */
+	for(ptr = buf; ptr < buf + 256; ptr++) 
+	  if(*ptr == '#') *ptr = 0;
+
+	if (buf[0] == '*') {
+	    xstrncpy(defaultbuf, buf, 256);
+	    continue;
+	}
+
+	if (strncmp("GROUPS", buf, 6) == 0) {
+	    state = StateGroups;
+	    continue;
+	} else if (strncmp("USERS", buf, 5) == 0) {
+	    state = StateUsers;
+	    continue;
+	} else if (strncmp("CLASSES", buf, 7) == 0) {
+	    state = StateClasses;
+	    continue;
+	}
+
+	strtok(buf, " \t");
+	if((state == StateUsers && (strncmp(user, buf, 8) == 0))
+	   || (state == StateGroups && am_in_group(buf))) {
+	    found_match = 1;  /* we found a line matching the user */
+	    while((ptr = strtok(NULL, "\t\n "))) {
+		if (in_class(tty, ptr)) {
+		    fclose(f);
+		    free_all(); /* JDS */
+		    return;
+		}
+	    }
+	} else if (state == StateClasses) {
+	    /* define a new tty/host class */
+	    struct ttyclass *tc = new_class(buf);
+
+	    while ((ptr = strtok(NULL, "\t\n "))) {
+		add_to_class(tc, ptr);
+	    }
+	}
+    }
+    fclose(f);
+
+    /* user is not explicitly mentioned in /etc/usertty, if there was
+       a default rule, use that */
+    if (defaultbuf[0]) {
+	strtok(defaultbuf, " \t");
+	while((ptr = strtok(NULL, "\t\n "))) {
+	    if (in_class(tty, ptr)) {
+		free_all(); /* JDS */
+		return;
+	    }
+	}
+
+	/* there was a default rule, but user didn't match, reject! */
+	printf(_("Login on %s from %s denied by default.\n"), tty, hostname);
+	badlogin(user);
+	sleepexit(1);
+    }
+
+    if (found_match) {
+	/* if we get here, /etc/usertty exists, there's a line
+	   matching our username, but it doesn't contain the
+	   name of the tty where the user is trying to log in.
+	   So deny access! */
+
+	printf(_("Login on %s from %s denied.\n"), tty, hostname);
+	badlogin(user);
+	sleepexit(1);
+    }
+
+    /* users not matched in /etc/usertty are by default allowed access
+       on all tty's */
+    free_all(); /* JDS */
+}
diff --git a/util-linux-ng-2.17.2/login-utils/chfn.1 b/util-linux-ng-2.17.2/login-utils/chfn.1
new file mode 100644
index 0000000..9328cc8
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/chfn.1
@@ -0,0 +1,78 @@
+.\"
+.\"  chfn.1 -- change your finger information
+.\"  (c) 1994 by salvatore valente <svalente@athena.mit.edu>
+.\"
+.\"  this program is free software.  you can redistribute it and
+.\"  modify it under the terms of the gnu general public license.
+.\"  there is no warranty.
+.\"
+.\"  $Author: faith $
+.\"  $Revision: 1.1 $
+.\"  $Date: 1995/03/12 01:29:16 $
+.\"
+.TH CHFN 1 "October 13 1994" "chfn" "Linux Reference Manual"
+.SH NAME
+chfn \- change your finger information
+.SH SYNOPSIS
+.B chfn
+.RB [ \-f
+.IR full-name ]
+.RB [ \-o
+.IR office ]
+,RB [ \-p
+.IR office-phone ]
+.RB [ \-h
+.IR home-phone ]
+.BR \-u ]
+.RB [ \-v ]
+.RI [ username ]
+.SH DESCRIPTION
+.B chfn
+is used to change your finger information.  This information is
+stored in the
+.I /etc/passwd
+file, and is displayed by the
+.B finger
+program.  The Linux
+.B finger
+command will display four pieces of information that can be changed by
+.BR chfn :
+your real name, your work room and phone, and your home phone.
+.SS COMMAND LINE
+Any of the four pieces of information can be specified on the command
+line.  If no information is given on the command line,
+.B chfn
+enters interactive mode.
+.SS INTERACTIVE MODE
+In interactive mode,
+.B chfn
+will prompt for each field.  At a prompt, you can enter the new information,
+or just press return to leave the field unchanged.  Enter the keyword
+"none" to make the field blank.
+.SH OPTIONS
+.TP
+.BI "\-f, \-\-full-name " full-name
+Specify your real name.
+.TP
+.BI "\-o, \-\-office " office
+Specify your office room number.
+.TP
+.BI "\-p, \-\-office-phone " office-phone
+Specify your office phone number.
+.TP
+.BI "\-h, \-\-home-phone " home-phone
+Specify your home phone number.
+.TP
+.B "\-u, \-\-help"
+Print a usage message and exit.
+.TP
+.B "-v, \-\-version"
+Print version information and exit.
+.SH "SEE ALSO"
+.BR finger (1),
+.BR passwd (5)
+.SH AUTHOR
+Salvatore Valente <svalente@mit.edu>
+.SH AVAILABILITY
+The chfn command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/login-utils/chfn.c b/util-linux-ng-2.17.2/login-utils/chfn.c
new file mode 100644
index 0000000..df8cbea
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/chfn.c
@@ -0,0 +1,533 @@
+/*
+ *   chfn.c -- change your finger information
+ *   (c) 1994 by salvatore valente <svalente@athena.mit.edu>
+ *
+ *   this program is free software.  you can redistribute it and
+ *   modify it under the terms of the gnu general public license.
+ *   there is no warranty.
+ *
+ *   $Author: aebr $
+ *   $Revision: 1.18 $
+ *   $Date: 1998/06/11 22:30:11 $
+ *
+ * Updated Thu Oct 12 09:19:26 1995 by faith@cs.unc.edu with security
+ * patches from Zefram <A.Main@dcs.warwick.ac.uk>
+ *
+ * Hacked by Peter Breitenlohner, peb@mppmu.mpg.de,
+ * to remove trailing empty fields.  Oct 5, 96.
+ *
+ *  1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ *  - added Native Language Support
+ *    
+ *
+ */
+
+#define _BSD_SOURCE           /* for strcasecmp() */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <errno.h>
+#include <ctype.h>
+#include <getopt.h>
+#include "my_crypt.h"
+#include "islocal.h"
+#include "setpwnam.h"
+#include "xstrncpy.h"
+#include "nls.h"
+#include "env.h"
+
+#ifdef HAVE_LIBSELINUX
+#include <selinux/selinux.h>
+#include <selinux/av_permissions.h>
+#include "selinux_utils.h"
+#endif
+
+#if defined(REQUIRE_PASSWORD) && defined(HAVE_SECURITY_PAM_MISC_H)
+#include <security/pam_appl.h>
+#include <security/pam_misc.h>
+
+#define PAM_FAIL_CHECK(_ph, _rc) \
+    do { \
+	if ((_rc) != PAM_SUCCESS) { \
+	    fprintf(stderr, "\n%s\n", pam_strerror((_ph), (_rc))); \
+	    pam_end((_ph), (_rc)); \
+	    exit(1); \
+	} \
+    } while(0)
+
+#endif
+
+typedef unsigned char boolean;
+#define false 0
+#define true 1
+
+static char *whoami;
+
+static char buf[1024];
+
+struct finfo {
+    struct passwd *pw;
+    char *username;
+    char *full_name;
+    char *office;
+    char *office_phone;
+    char *home_phone;
+    char *other;
+};
+
+static boolean parse_argv (int argc, char *argv[], struct finfo *pinfo);
+static void usage (FILE *fp);
+static void parse_passwd (struct passwd *pw, struct finfo *pinfo);
+static void ask_info (struct finfo *oldfp, struct finfo *newfp);
+static char *prompt (char *question, char *def_val);
+static int check_gecos_string (char *msg, char *gecos);
+static boolean set_changed_data (struct finfo *oldfp, struct finfo *newfp);
+static int save_new_data (struct finfo *pinfo);
+static void *xmalloc (int bytes);
+
+#define memzero(ptr, size) memset((char *) ptr, 0, size)
+
+/* we do not accept gecos field sizes longer than MAX_FIELD_SIZE */
+#define MAX_FIELD_SIZE		256
+
+int main (int argc, char **argv) {
+    char *cp;
+    uid_t uid;
+    struct finfo oldf, newf;
+    boolean interactive;
+    int status;
+
+    sanitize_env();
+    setlocale(LC_ALL, "");	/* both for messages and for iscntrl() below */
+    bindtextdomain(PACKAGE, LOCALEDIR);
+    textdomain(PACKAGE);
+
+    /* whoami is the program name for error messages */
+    whoami = argv[0];
+    if (! whoami) whoami = "chfn";
+    for (cp = whoami; *cp; cp++)
+	if (*cp == '/') whoami = cp + 1;
+
+    /*
+     *	"oldf" contains the users original finger information.
+     *	"newf" contains the changed finger information, and contains NULL
+     *	       in fields that haven't been changed.
+     *	in the end, "newf" is folded into "oldf".
+     *	the reason the new finger information is not put _immediately_ into
+     *	"oldf" is that on the command line, new finger information can
+     *	be specified before we know what user the information is being
+     *	specified for.
+     */
+    uid = getuid ();
+    memzero (&oldf, sizeof (oldf));
+    memzero (&newf, sizeof (newf));
+
+    interactive = parse_argv (argc, argv, &newf);
+    if (! newf.username) {
+	parse_passwd (getpwuid (uid), &oldf);
+	if (! oldf.username) {
+	    fprintf (stderr, _("%s: you (user %d) don't exist.\n"), whoami, uid);
+	    return (-1); }
+    }
+    else {
+	parse_passwd (getpwnam (newf.username), &oldf);
+	if (! oldf.username) {
+	    cp = newf.username;
+	    fprintf (stderr, _("%s: user \"%s\" does not exist.\n"), whoami, cp);
+	    return (-1); }
+    }
+
+    if (!(is_local(oldf.username))) {
+       fprintf (stderr, _("%s: can only change local entries; use yp%s instead.\n"),
+           whoami, whoami);
+       exit(1);
+    }
+
+#ifdef HAVE_LIBSELINUX
+    if (is_selinux_enabled() > 0) {
+      if(uid == 0) {
+	if (checkAccess(oldf.username,PASSWD__CHFN)!=0) {
+	  security_context_t user_context;
+	  if (getprevcon(&user_context) < 0)
+	    user_context=(security_context_t) strdup(_("Unknown user context"));
+	  fprintf(stderr, _("%s: %s is not authorized to change the finger info of %s\n"),
+		  whoami, user_context, oldf.username);
+	  freecon(user_context);
+	  exit(1);
+	}
+      }
+      if (setupDefaultContext("/etc/passwd") != 0) {
+	fprintf(stderr,_("%s: Can't set default context for /etc/passwd"),
+		whoami);
+	exit(1);
+      }
+    }
+#endif
+
+    /* Reality check */
+    if (uid != 0 && uid != oldf.pw->pw_uid) {
+	errno = EACCES;
+	perror (whoami);
+	return (-1);
+    }
+
+    printf (_("Changing finger information for %s.\n"), oldf.username);
+
+#ifdef REQUIRE_PASSWORD
+#ifdef HAVE_SECURITY_PAM_MISC_H
+    if(uid != 0) {
+	pam_handle_t *pamh = NULL;
+	struct pam_conv conv = { misc_conv, NULL };
+	int retcode;
+
+	retcode = pam_start("chfn", oldf.username, &conv, &pamh);
+	if(retcode != PAM_SUCCESS) {
+	    fprintf(stderr, _("%s: PAM failure, aborting: %s\n"),
+		    whoami, pam_strerror(pamh, retcode));
+	    exit(1);
+	}
+
+	retcode = pam_authenticate(pamh, 0);
+	PAM_FAIL_CHECK(pamh, retcode);
+
+	retcode = pam_acct_mgmt(pamh, 0);
+	if (retcode == PAM_NEW_AUTHTOK_REQD)
+	    retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
+	PAM_FAIL_CHECK(pamh, retcode);
+
+	retcode = pam_setcred(pamh, 0);
+	PAM_FAIL_CHECK(pamh, retcode);
+
+	pam_end(pamh, 0);
+	/* no need to establish a session; this isn't a session-oriented
+	 * activity... */
+    }
+# else /* HAVE_SECURITY_PAM_MISC_H */
+    /* require password, unless root */
+    if(uid != 0 && oldf.pw->pw_passwd && oldf.pw->pw_passwd[0]) {
+	char *pwdstr = getpass(_("Password: "));
+	if(strncmp(oldf.pw->pw_passwd,
+		   crypt(pwdstr, oldf.pw->pw_passwd), 13)) {
+	    puts(_("Incorrect password."));
+	    exit(1);
+	}
+    }
+# endif /* HAVE_SECURITY_PAM_MISC_H */
+#endif /* REQUIRE_PASSWORD */
+
+
+    if (interactive) ask_info (&oldf, &newf);
+
+    if (! set_changed_data (&oldf, &newf)) {
+	printf (_("Finger information not changed.\n"));
+	return 0;
+    }
+    status = save_new_data (&oldf);
+    return status;
+}
+
+/*
+ *  parse_argv () --
+ *	parse the command line arguments.
+ *	returns true if no information beyond the username was given.
+ */
+static boolean parse_argv (argc, argv, pinfo)
+    int argc;
+    char *argv[];
+    struct finfo *pinfo;
+{
+    int index, c, status;
+    boolean info_given;
+
+    static struct option long_options[] = {
+	{ "full-name",	  required_argument, 0, 'f' },
+	{ "office",	  required_argument, 0, 'o' },
+	{ "office-phone", required_argument, 0, 'p' },
+	{ "home-phone",   required_argument, 0, 'h' },
+	{ "help",	  no_argument,       0, 'u' },
+	{ "version",	  no_argument,	     0, 'v' },
+	{ NULL,		  no_argument,	     0, '0' },
+    };
+
+    optind = 0;
+    info_given = false;
+    while (true) {
+	c = getopt_long (argc, argv, "f:r:p:h:o:uv", long_options, &index);
+	if (c == -1) break;
+	/* version?  output version and exit. */
+	if (c == 'v') {
+	    printf ("%s\n", PACKAGE_STRING);
+	    exit (0);
+	}
+	if (c == 'u') {
+	    usage (stdout);
+	    exit (0);
+	}
+	/* all other options must have an argument. */
+	if (! optarg) {
+	    usage (stderr);
+	    exit (-1);
+	}
+	/* ok, we were given an argument */
+	info_given = true;
+	status = 0;
+
+	xstrncpy (buf, whoami, sizeof(buf)-128); 
+	strcat (buf, ": ");
+
+	/* now store the argument */
+	switch (c) {
+	case 'f':
+	    pinfo->full_name = optarg;
+	    strcat (buf, "full name");
+	    status = check_gecos_string (buf, optarg);
+	    break;
+	case 'o':
+	    pinfo->office = optarg;
+	    strcat (buf, "office");
+	    status = check_gecos_string (buf, optarg);
+	    break;
+	case 'p':
+	    pinfo->office_phone = optarg;
+	    strcat (buf, "office phone");
+	    status = check_gecos_string (buf, optarg);
+	    break;
+	case 'h':
+	    pinfo->home_phone = optarg;
+	    strcat (buf, "home phone");
+	    status = check_gecos_string (buf, optarg);
+	    break;
+	default:
+	    usage (stderr);
+	    status = (-1);
+	}
+	if (status < 0) exit (status);
+    }
+    /* done parsing arguments.	check for a username. */
+    if (optind < argc) {
+	if (optind + 1 < argc) {
+	    usage (stderr);
+	    exit (-1);
+	}
+	pinfo->username = argv[optind];
+    }
+    return (! info_given);
+}
+
+/*
+ *  usage () --
+ *	print out a usage message.
+ */
+static void usage (fp)
+    FILE *fp;
+{
+    fprintf (fp, _("Usage: %s [ -f full-name ] [ -o office ] "), whoami);
+    fprintf (fp, _("[ -p office-phone ]\n	[ -h home-phone ] "));
+    fprintf (fp, _("[ --help ] [ --version ]\n"));
+}
+
+/*
+ *  parse_passwd () --
+ *	take a struct password and fill in the fields of the
+ *	struct finfo.
+ */
+static void parse_passwd (pw, pinfo)
+    struct passwd *pw;
+    struct finfo *pinfo;
+{
+    char *gecos;
+    char *cp;
+
+    if (pw) {
+	pinfo->pw = pw;
+	pinfo->username = pw->pw_name;
+	/* use pw_gecos - we take a copy since PAM destroys the original */
+	gecos = strdup(pw->pw_gecos);
+	cp = (gecos ? gecos : "");
+	pinfo->full_name = cp;
+	cp = strchr (cp, ',');
+	if (cp) { *cp = 0, cp++; } else return;
+	pinfo->office = cp;
+	cp = strchr (cp, ',');
+	if (cp) { *cp = 0, cp++; } else return;
+	pinfo->office_phone = cp;
+	cp = strchr (cp, ',');
+	if (cp) { *cp = 0, cp++; } else return;
+	pinfo->home_phone = cp;
+	/*  extra fields contain site-specific information, and
+	 *  can not be changed by this version of chfn.	 */
+	cp = strchr (cp, ',');
+	if (cp) { *cp = 0, cp++; } else return;
+	pinfo->other = cp;
+    }
+}
+
+/*
+ *  ask_info () --
+ *	prompt the user for the finger information and store it.
+ */
+static void ask_info (oldfp, newfp)
+    struct finfo *oldfp;
+    struct finfo *newfp;
+{
+    newfp->full_name = prompt (_("Name"), oldfp->full_name);
+    newfp->office = prompt (_("Office"), oldfp->office);
+    newfp->office_phone = prompt (_("Office Phone"), oldfp->office_phone);
+    newfp->home_phone = prompt (_("Home Phone"), oldfp->home_phone);
+    printf ("\n");
+}
+
+/*
+ *  prompt () --
+ *	ask the user for a given field and check that the string is legal.
+ */
+static char *prompt (question, def_val)
+    char *question;
+    char *def_val;
+{
+    static char *blank = "none";
+    int len;
+    char *ans, *cp;
+  
+    while (true) {
+	if (! def_val) def_val = "";
+	printf("%s [%s]: ", question, def_val);
+	*buf = 0;
+	if (fgets (buf, sizeof (buf), stdin) == NULL) {
+	    printf (_("\nAborted.\n"));
+	    exit (-1);
+	}
+	/* remove the newline at the end of buf. */
+	ans = buf;
+	while (isspace (*ans)) ans++;
+	len = strlen (ans);
+	while (len > 0 && isspace (ans[len-1])) len--;
+	if (len <= 0) return NULL;
+	ans[len] = 0;
+	if (! strcasecmp (ans, blank)) return "";
+	if (check_gecos_string (NULL, ans) >= 0) break;
+    }
+    cp = (char *) xmalloc (len + 1);
+    strcpy (cp, ans);
+    return cp;
+}
+
+/*
+ *  check_gecos_string () --
+ *	check that the given gecos string is legal.  if it's not legal,
+ *	output "msg" followed by a description of the problem, and
+ *	return (-1).
+ */
+static int check_gecos_string (msg, gecos)
+    char *msg;
+    char *gecos;
+{
+    int i, c;
+
+    if (strlen(gecos) > MAX_FIELD_SIZE) {
+	if (msg != NULL)
+	    printf("%s: ", msg);
+	printf(_("field is too long.\n"));
+	return -1;
+    }
+
+    for (i = 0; i < strlen (gecos); i++) {
+	c = gecos[i];
+	if (c == ',' || c == ':' || c == '=' || c == '"' || c == '\n') {
+	    if (msg) printf ("%s: ", msg);
+	    printf (_("'%c' is not allowed.\n"), c);
+	    return (-1);
+	}
+	if (iscntrl (c)) {
+	    if (msg) printf ("%s: ", msg);
+	    printf (_("Control characters are not allowed.\n"));
+	    return (-1);
+	}
+    }
+    return (0);
+}
+
+/*
+ *  set_changed_data () --
+ *	incorporate the new data into the old finger info.
+ */
+static boolean set_changed_data (oldfp, newfp)
+    struct finfo *oldfp;
+    struct finfo *newfp;
+{
+    boolean changed = false;
+
+    if (newfp->full_name) {
+	oldfp->full_name = newfp->full_name; changed = true; }
+    if (newfp->office) {
+	oldfp->office = newfp->office; changed = true; }
+    if (newfp->office_phone) {
+	oldfp->office_phone = newfp->office_phone; changed = true; }
+    if (newfp->home_phone) {
+	oldfp->home_phone = newfp->home_phone; changed = true; }
+
+    return changed;
+}
+
+/*
+ *  save_new_data () --
+ *	save the given finger info in /etc/passwd.
+ *	return zero on success.
+ */
+static int save_new_data (pinfo)
+     struct finfo *pinfo;
+{
+    char *gecos;
+    int len;
+
+    /* null fields will confuse printf(). */
+    if (! pinfo->full_name) pinfo->full_name = "";
+    if (! pinfo->office) pinfo->office = "";
+    if (! pinfo->office_phone) pinfo->office_phone = "";
+    if (! pinfo->home_phone) pinfo->home_phone = "";
+    if (! pinfo->other) pinfo->other = "";
+
+    /* create the new gecos string */
+    len = (strlen (pinfo->full_name) + strlen (pinfo->office) +
+	   strlen (pinfo->office_phone) + strlen (pinfo->home_phone) +
+	   strlen (pinfo->other) + 4);
+    gecos = (char *) xmalloc (len + 1);
+    sprintf (gecos, "%s,%s,%s,%s,%s", pinfo->full_name, pinfo->office,
+	     pinfo->office_phone, pinfo->home_phone, pinfo->other);
+
+    /* remove trailing empty fields (but not subfields of pinfo->other) */
+    if (! pinfo->other[0] ) {
+       while (len > 0 && gecos[len-1] == ',') len--;
+       gecos[len] = 0;
+    }
+
+    /* write the new struct passwd to the passwd file. */
+    pinfo->pw->pw_gecos = gecos;
+    if (setpwnam (pinfo->pw) < 0) {
+	perror ("setpwnam");
+	printf( _("Finger information *NOT* changed.  Try again later.\n" ));
+	return (-1);
+    }
+    printf (_("Finger information changed.\n"));
+    return 0;
+}
+
+/*
+ *  xmalloc () -- malloc that never fails.
+ */
+static void *xmalloc (bytes)
+    int bytes;
+{
+    void *vp;
+
+    vp = malloc (bytes);
+    if (! vp && bytes > 0) {
+	perror (_("malloc failed"));
+	exit (-1);
+    }
+    return vp;
+}
diff --git a/util-linux-ng-2.17.2/login-utils/chsh.1 b/util-linux-ng-2.17.2/login-utils/chsh.1
new file mode 100644
index 0000000..6e00df3
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/chsh.1
@@ -0,0 +1,61 @@
+.\"
+.\"  chsh.1 -- change your login shell
+.\"  (c) 1994 by salvatore valente <svalente@athena.mit.edu>
+.\"
+.\"  this program is free software.  you can redistribute it and
+.\"  modify it under the terms of the gnu general public license.
+.\"  there is no warranty.
+.\"
+.\"  $Author: faith $
+.\"  $Revision: 1.1 $
+.\"  $Date: 1995/03/12 01:28:58 $
+.\"
+.TH CHSH 1 "7 October 1998" "chsh" "Linux Reference Manual"
+.SH NAME
+chsh \- change your login shell
+.SH SYNOPSIS
+.B chsh
+.RB [ \-s
+.IR shell ]
+.RB [ \-l ]
+.RB [ \-u ]
+.RB [ \-v ]
+.RI [ username ]
+.SH DESCRIPTION
+.B chsh
+is used to change your login shell.
+If a shell is not given on the command line,
+.B chsh
+prompts for one.
+.SS VALID SHELLS
+.B chsh
+will accept the full pathname of any executable file on the system.
+However, it will issue a warning if the shell is not listed in the
+.I /etc/shells
+file.
+On the other hand, it can also be configured such that it will
+only accept shells listed in this file, unless you are root.
+.SH OPTIONS
+.TP
+.BI "\-s, \-\-shell " shell
+Specify your login shell.
+.TP
+.B "\-l, \-\-list-shells"
+Print the list of shells listed in
+.I /etc/shells
+and exit.
+.TP
+.B "\-u, \-\-help"
+Print a usage message and exit.
+.TP
+.B "-v, \-\-version"
+Print version information and exit.
+.SH "SEE ALSO"
+.BR login (1),
+.BR passwd (5),
+.BR shells (5)
+.SH AUTHOR
+Salvatore Valente <svalente@mit.edu>
+.SH AVAILABILITY
+The chsh command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/login-utils/chsh.c b/util-linux-ng-2.17.2/login-utils/chsh.c
new file mode 100644
index 0000000..08b1e0d
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/chsh.c
@@ -0,0 +1,443 @@
+/*
+ *   chsh.c -- change your login shell
+ *   (c) 1994 by salvatore valente <svalente@athena.mit.edu>
+ *
+ *   this program is free software.  you can redistribute it and
+ *   modify it under the terms of the gnu general public license.
+ *   there is no warranty.
+ *
+ *   $Author: aebr $
+ *   $Revision: 1.19 $
+ *   $Date: 1998/06/11 22:30:14 $
+ *
+ * Updated Thu Oct 12 09:33:15 1995 by faith@cs.unc.edu with security
+ *   patches from Zefram <A.Main@dcs.warwick.ac.uk>
+ *
+ * Updated Mon Jul  1 18:46:22 1996 by janl@math.uio.no with security
+ *   suggestion from Zefram.  Disallowing users with shells not in /etc/shells
+ *   from changing their shell.
+ *
+ *   1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+ *   - added Native Language Support
+ *
+ *
+ */
+
+#if 0
+#define _POSIX_SOURCE 1
+#endif
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <errno.h>
+#include <ctype.h>
+#include <getopt.h>
+#include "my_crypt.h"
+#include "islocal.h"
+#include "setpwnam.h"
+#include "nls.h"
+#include "env.h"
+#include "pathnames.h"
+
+#if defined(REQUIRE_PASSWORD) && defined(HAVE_SECURITY_PAM_MISC_H)
+#include <security/pam_appl.h>
+#include <security/pam_misc.h>
+
+#define PAM_FAIL_CHECK(_ph, _rc) \
+    do { \
+	if ((_rc) != PAM_SUCCESS) { \
+	    fprintf(stderr, "\n%s\n", pam_strerror((_ph), (_rc))); \
+	    pam_end((_ph), (_rc)); \
+	    exit(1); \
+	} \
+    } while(0)
+
+#endif /* PAM */
+
+#ifdef HAVE_LIBSELINUX
+#include <selinux/selinux.h>
+#include <selinux/av_permissions.h>
+#include "selinux_utils.h"
+#endif
+
+typedef unsigned char boolean;
+#define false 0
+#define true 1
+
+/* Only root is allowed to assign a luser a non-listed shell, by default */
+#define ONLY_LISTED_SHELLS 1
+
+
+static char *whoami;
+
+static char buf[FILENAME_MAX];
+
+struct sinfo {
+    char *username;
+    char *shell;
+};
+
+static void parse_argv (int argc, char *argv[], struct sinfo *pinfo);
+static void usage (FILE *fp);
+static char *prompt (char *question, char *def_val);
+static int check_shell (char *shell);
+static boolean get_shell_list (char *shell);
+static void *xmalloc (int bytes);
+
+#define memzero(ptr, size) memset((char *) ptr, 0, size)
+
+int
+main (int argc, char *argv[]) {
+    char *cp, *shell, *oldshell;
+    uid_t uid;
+    struct sinfo info;
+    struct passwd *pw;
+
+    sanitize_env();
+    setlocale(LC_ALL, "");
+    bindtextdomain(PACKAGE, LOCALEDIR);
+    textdomain(PACKAGE);
+
+    /* whoami is the program name for error messages */
+    whoami = argv[0];
+    if (! whoami) whoami = "chsh";
+    for (cp = whoami; *cp; cp++)
+	if (*cp == '/') whoami = cp + 1;
+
+    uid = getuid ();
+    memzero (&info, sizeof (info));
+
+    parse_argv (argc, argv, &info);
+    pw = NULL;
+    if (! info.username) {
+	pw = getpwuid (uid);
+	if (! pw) {
+	    fprintf (stderr, _("%s: you (user %d) don't exist.\n"), whoami, uid);
+	    return (-1); }
+    }
+    else {
+	pw = getpwnam (info.username);
+	if (! pw) {
+	    cp = info.username;
+	    fprintf (stderr, _("%s: user \"%s\" does not exist.\n"), whoami, cp);
+	    return (-1); }
+    }
+
+    if (!(is_local(pw->pw_name))) {
+       fprintf (stderr, _("%s: can only change local entries; use yp%s instead.\n"),
+           whoami, whoami);
+       exit(1);
+    }
+
+#ifdef HAVE_LIBSELINUX
+    if (is_selinux_enabled() > 0) {
+      if(uid == 0) {
+	if (checkAccess(pw->pw_name,PASSWD__CHSH)!=0) {
+	  security_context_t user_context;
+	  if (getprevcon(&user_context) < 0)
+	    user_context=(security_context_t) strdup(_("Unknown user context"));
+	  fprintf(stderr, _("%s: %s is not authorized to change the shell of %s\n"),
+		  whoami, user_context, pw->pw_name);
+	  freecon(user_context);
+	  exit(1);
+	}
+      }
+      if (setupDefaultContext("/etc/passwd") != 0) {
+	fprintf(stderr,_("%s: Can't set default context for /etc/passwd"),
+		whoami);
+	exit(1);
+      }
+    }
+#endif
+
+    oldshell = pw->pw_shell;
+    if (oldshell == NULL || *oldshell == '\0')
+	    oldshell = _PATH_BSHELL;			/* default */
+
+    /* reality check */
+    if (uid != 0 && uid != pw->pw_uid) {
+	errno = EACCES;
+	fprintf(stderr,_("%s: Running UID doesn't match UID of user we're "
+			 "altering, shell change denied\n"), whoami);
+	return (-1);
+    }
+    if (uid != 0 && !get_shell_list(oldshell)) {
+	errno = EACCES;
+	fprintf(stderr,_("%s: Your shell is not in /etc/shells, shell change"
+		" denied\n"),whoami);
+	return (-1);
+    }
+
+    shell = info.shell;
+
+    printf( _("Changing shell for %s.\n"), pw->pw_name );
+
+#ifdef REQUIRE_PASSWORD
+#ifdef HAVE_SECURITY_PAM_MISC_H
+    if(uid != 0) {
+	pam_handle_t *pamh = NULL;
+	struct pam_conv conv = { misc_conv, NULL };
+	int retcode;
+
+	retcode = pam_start("chsh", pw->pw_name, &conv, &pamh);
+	if(retcode != PAM_SUCCESS) {
+	    fprintf(stderr, _("%s: PAM failure, aborting: %s\n"),
+		    whoami, pam_strerror(pamh, retcode));
+	    exit(1);
+	}
+
+	retcode = pam_authenticate(pamh, 0);
+	PAM_FAIL_CHECK(pamh, retcode);
+
+	retcode = pam_acct_mgmt(pamh, 0);
+	if (retcode == PAM_NEW_AUTHTOK_REQD)
+	    retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
+	PAM_FAIL_CHECK(pamh, retcode);
+
+	retcode = pam_setcred(pamh, 0);
+	PAM_FAIL_CHECK(pamh, retcode);
+
+	pam_end(pamh, 0);
+	/* no need to establish a session; this isn't a session-oriented
+	 * activity... */
+    }
+#else /* HAVE_SECURITY_PAM_MISC_H */
+    /* require password, unless root */
+    if(uid != 0 && pw->pw_passwd && pw->pw_passwd[0]) {
+	char *pwdstr = getpass(_("Password: "));
+	if(strncmp(pw->pw_passwd,
+		   crypt(pwdstr, pw->pw_passwd), 13)) {
+	    puts(_("Incorrect password."));
+	    exit(1);
+	}
+    }
+#endif /* HAVE_SECURITY_PAM_MISC_H */
+#endif /* REQUIRE_PASSWORD */
+
+    if (! shell) {
+	shell = prompt (_("New shell"), oldshell);
+	if (! shell) return 0;
+    }
+
+    if (check_shell (shell) < 0) return (-1);
+
+    if (! strcmp (pw->pw_shell, shell)) {
+	printf (_("Shell not changed.\n"));
+	return 0;
+    }
+    pw->pw_shell = shell;
+    if (setpwnam (pw) < 0) {
+	perror ("setpwnam");
+	printf( _("Shell *NOT* changed.  Try again later.\n") );
+	return (-1);
+    }
+    printf (_("Shell changed.\n"));
+    return 0;
+}
+
+/*
+ *  parse_argv () --
+ *	parse the command line arguments, and fill in "pinfo" with any
+ *	information from the command line.
+ */
+static void
+parse_argv (int argc, char *argv[], struct sinfo *pinfo) {
+    int index, c;
+
+    static struct option long_options[] = {
+	{ "shell",	 required_argument, 0, 's' },
+	{ "list-shells", no_argument,	    0, 'l' },
+	{ "help",	 no_argument,	    0, 'u' },
+	{ "version",	 no_argument,	    0, 'v' },
+	{ NULL,		 no_argument,	    0, '0' },
+    };
+
+    optind = c = 0;
+    while (c != EOF) {
+	c = getopt_long (argc, argv, "s:luv", long_options, &index);
+	switch (c) {
+	case -1:
+	    break;
+	case 'v':
+	    printf ("%s\n", PACKAGE_STRING);
+	    exit (0);
+	case 'u':
+	    usage (stdout);
+	    exit (0);
+	case 'l':
+	    get_shell_list (NULL);
+	    exit (0);
+	case 's':
+	    if (! optarg) {
+		usage (stderr);
+		exit (-1);
+	    }
+	    pinfo->shell = optarg;
+	    break;
+	default:
+	    usage (stderr);
+	    exit (-1);
+	}
+    }
+    /* done parsing arguments.	check for a username. */
+    if (optind < argc) {
+	if (optind + 1 < argc) {
+	    usage (stderr);
+	    exit (-1);
+	}
+	pinfo->username = argv[optind];
+    }
+}
+
+/*
+ *  usage () --
+ *	print out a usage message.
+ */
+static void
+usage (FILE *fp) {
+    fprintf (fp,
+	     _("Usage: %s [ -s shell ] [ --list-shells ] "
+	       "[ --help ] [ --version ]\n"
+	       "       [ username ]\n"), whoami);
+}
+
+/*
+ *  prompt () --
+ *	ask the user for a given field and return it.
+ */
+static char *
+prompt (char *question, char *def_val) {
+    int len;
+    char *ans, *cp;
+
+    if (! def_val) def_val = "";
+    printf("%s [%s]: ", question, def_val);
+    *buf = 0;
+    if (fgets (buf, sizeof (buf), stdin) == NULL) {
+	printf (_("\nAborted.\n"));
+	exit (-1);
+    }
+    /* remove the newline at the end of buf. */
+    ans = buf;
+    while (isspace (*ans)) ans++;
+    len = strlen (ans);
+    while (len > 0 && isspace (ans[len-1])) len--;
+    if (len <= 0) return NULL;
+    ans[len] = 0;
+    cp = (char *) xmalloc (len + 1);
+    strcpy (cp, ans);
+    return cp;
+}
+
+/*
+ *  check_shell () -- if the shell is completely invalid, print
+ *	an error and return (-1).
+ *	if the shell is a bad idea, print a warning.
+ */
+static int
+check_shell (char *shell) {
+    int i, c;
+
+    if (!shell)
+	return (-1);
+
+    if (*shell != '/') {
+	printf (_("%s: shell must be a full path name.\n"), whoami);
+	return (-1);
+    }
+    if (access (shell, F_OK) < 0) {
+	printf (_("%s: \"%s\" does not exist.\n"), whoami, shell);
+	return (-1);
+    }
+    if (access (shell, X_OK) < 0) {
+	printf (_("%s: \"%s\" is not executable.\n"), whoami, shell);
+	return (-1);
+    }
+    /* keep /etc/passwd clean. */
+    for (i = 0; i < strlen (shell); i++) {
+	c = shell[i];
+	if (c == ',' || c == ':' || c == '=' || c == '"' || c == '\n') {
+	    printf (_("%s: '%c' is not allowed.\n"), whoami, c);
+	    return (-1);
+	}
+	if (iscntrl (c)) {
+	    printf (_("%s: Control characters are not allowed.\n"), whoami);
+	    return (-1);
+	}
+    }
+#ifdef ONLY_LISTED_SHELLS
+    if (! get_shell_list (shell)) {
+       if (!getuid())
+	  printf (_("Warning: \"%s\" is not listed in /etc/shells.\n"), shell);
+       else {
+	  printf (_("%s: \"%s\" is not listed in /etc/shells.\n"),
+		  whoami, shell);
+	  printf( _("%s: Use -l option to see list.\n"), whoami );
+	  exit(1);
+       }
+    }
+#else
+    if (! get_shell_list (shell)) {
+       printf (_("Warning: \"%s\" is not listed in /etc/shells.\n"), shell);
+       printf( _("Use %s -l to see list.\n"), whoami );
+    }
+#endif
+    return 0;
+}
+
+/*
+ *  get_shell_list () -- if the given shell appears in /etc/shells,
+ *	return true.  if not, return false.
+ *	if the given shell is NULL, /etc/shells is outputted to stdout.
+ */
+static boolean
+get_shell_list (char *shell_name) {
+    FILE *fp;
+    boolean found;
+    int len;
+
+    found = false;
+    fp = fopen ("/etc/shells", "r");
+    if (! fp) {
+	if (! shell_name) printf (_("No known shells.\n"));
+	return true;
+    }
+    while (fgets (buf, sizeof (buf), fp) != NULL) {
+	/* ignore comments */
+	if (*buf == '#') continue;
+	len = strlen (buf);
+	/* strip the ending newline */
+	if (buf[len - 1] == '\n') buf[len - 1] = 0;
+	/* ignore lines that are too damn long */
+	else continue;
+	/* check or output the shell */
+	if (shell_name) {
+	    if (! strcmp (shell_name, buf)) {
+		found = true;
+		break;
+	    }
+	}
+	else printf ("%s\n", buf);
+    }
+    fclose (fp);
+    return found;
+}
+
+/*
+ *  xmalloc () -- malloc that never fails.
+ */
+static void *
+xmalloc (int bytes) {
+    void *vp;
+
+    vp = malloc (bytes);
+    if (! vp && bytes > 0) {
+	perror (_("malloc failed"));
+	exit (-1);
+    }
+    return vp;
+}
diff --git a/util-linux-ng-2.17.2/login-utils/fastboot.8 b/util-linux-ng-2.17.2/login-utils/fastboot.8
new file mode 100644
index 0000000..386d971
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/fastboot.8
@@ -0,0 +1 @@
+.so man8/shutdown.8
diff --git a/util-linux-ng-2.17.2/login-utils/fasthalt.8 b/util-linux-ng-2.17.2/login-utils/fasthalt.8
new file mode 100644
index 0000000..386d971
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/fasthalt.8
@@ -0,0 +1 @@
+.so man8/shutdown.8
diff --git a/util-linux-ng-2.17.2/login-utils/halt.8 b/util-linux-ng-2.17.2/login-utils/halt.8
new file mode 100644
index 0000000..386d971
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/halt.8
@@ -0,0 +1 @@
+.so man8/shutdown.8
diff --git a/util-linux-ng-2.17.2/login-utils/initctl.8 b/util-linux-ng-2.17.2/login-utils/initctl.8
new file mode 100644
index 0000000..3dd26e3
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/initctl.8
@@ -0,0 +1,110 @@
+.\" Copyright (C) 2000-2001  Richard Gooch
+.\"
+.\" 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+.\"
+.\" Richard Gooch may be reached by email at  rgooch@atnf.csiro.au
+.\" The postal address is:
+.\"   Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
+.\"
+.\"	initctl.8		Richard Gooch	21-FEB-2001
+.\"
+.TH INITCTL 8 "21 Feb 2001" "Util-Linux Package"
+.SH NAME
+initctl \- utility to control simpleinit(8)
+.SH SYNOPSIS
+.B need
+.RB [ \-r ]
+.I service
+.br
+.B display-services
+.br
+.B provide
+.I service
+.SH OVERVIEW
+The \fBinitctl\fP programme is designed to help improve the
+robustness, scalability and readability of system boot scripts. It is
+now possible to write a modularised set of boot scripts without the
+complex and fragile numbered symlink scheme used in SysV-style boot
+scripts. Each script can simply declare, using \fBneed\fP(8), what
+must run before them.
+.SH DESCRIPTION for need
+The \fBneed\fP programme is a utility that tells \fBsimpleinit\fP(8)
+to start a \fIservice\fP (usually a script in \fI/sbin/init.d\fP) and
+will wait for the service to become available. If the service is
+already available, it will not be started again.
+
+The \fB-r\fP option is used to tell \fBsimpleinit\fP(8) to "roll back"
+(stop) services up to (but not including) \fIservice\fP. If
+\fIservice\fP is not specified, all services are stopped. The \fB-r\fP
+option thus allows the system to be partially or wholly shut down in
+an orderly fashion. The \fBshutdown\fP(8) programme still needs to be
+run.
+
+.SH DESCRIPTION for display-services
+When invoked as \fBdisplay-services\fP it will write the list of
+currently available services and the list of failed services to the
+standard output.
+
+.SH DESCRIPTION for provide
+When invoked as \fBprovide\fP it tells \fBsimpleinit\fP(8) that the
+parent (calling) process will be providing a service with name
+\fIservice\fP. If the calling process exits successfully (status 0)
+the service is deemed to be available. Only one instance of
+\fIservice\fP may be started, so alternate providers will block and
+may fail.
+
+Using \fBprovide\fP it is possible to have multiple potential
+providers for the same (generic) service (e.g. \fBsendmail\fP and
+\fBqmail\fP both provide a \fBmta\fP service), where only one actually
+provides the service. This may be used by service startup scripts
+which check for configuration files.
+.SH EXIT CODE
+The exit code from \fBneed\fP is 0 if the service was successfully
+started, 1 if the service failed badly, and 2 if the service is
+unavailable (i.e. disabled in configuration files). These exit codes
+reflect the exit codes from the service startup scripts.
+
+The exit code from \fBneed -r\fP is 0 if the service was successfully
+stopped, 1 if the service could not be stopped, and 2 if the service
+was not available to start with. The service shutdown scripts may only
+return 0 (for success) or 1 (for failure).
+
+The exit code from \fBprovide\fP is 0 if the service may be provided,
+1 if it may not, and 2 if the parent process is not a child of
+init. It may block waiting for another provider which is initialising
+the service.
+.SH SIGNALS
+\fBinitctl\fP(8) uses \fBSIGUSR1\fP, \fBSIGUSR2\fP and \fBSIGPOLL\fP
+for communication with \fBsimpleinit\fP(8). Don't send these signals
+to it.
+.SH FILES
+.PD 0
+.TP 20
+.BI /dev/initctl
+This is the control FIFO, created by \fBsimpleinit\fP(8), which
+\fBinitctl\fP(8) writes commands to.
+.SH SEE ALSO
+.BR simpleinit (8),
+.BR init (8)
+.PP
+A more complete discussion of the new boot script system, based on
+\fBneed\fP(8), is available from:
+http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/
+.SH AUTHOR
+Richard Gooch (rgooch@atnf.csiro.au)
+
+.SH AVAILABILITY
+The initctl command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/login-utils/initctl.c b/util-linux-ng-2.17.2/login-utils/initctl.c
new file mode 100644
index 0000000..3b38b49
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/initctl.c
@@ -0,0 +1,217 @@
+/*  initctl.c
+
+    Source file for  initctl  (init(8) control tool).
+
+    Copyright (C) 2000  Richard Gooch
+
+    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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+    Richard Gooch may be reached by email at  rgooch@atnf.csiro.au
+    The postal address is:
+      Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
+*/
+
+/*
+    This tool will send control messages to init(8). For example, it may
+    request init(8) to start a service and will wait for that service to be
+    available. If the service is already available, init(8) will not start it
+    again.
+    This tool may also be used to inspect the list of currently available
+    services.
+
+
+    Written by      Richard Gooch   28-FEB-2000
+
+    Updated by      Richard Gooch   11-OCT-2000: Added provide support.
+
+    Last updated by Richard Gooch   6-NOV-2000: Renamed to initctl.c
+
+
+*/
+#include <unistd.h>
+#include <stdio.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include "simpleinit.h"
+
+
+static void signal_handler (int sig);
+
+
+static int caught_signal = 0;
+
+
+int main (int argc, char **argv)
+{
+    int fd, nbytes;
+    struct sigaction sa;
+    sigset_t ss;
+    char *ptr;
+    long *buffer;
+    struct command_struct *command;
+
+    buffer = calloc(COMMAND_SIZE / sizeof (long) + 1, sizeof(long));
+    if (!buffer) {
+	    fprintf (stderr, "Unable allocate buffer for command\n");
+	    exit(1);
+    }
+    command = (struct command_struct *) buffer;
+
+    sigemptyset (&ss);
+    sigaddset (&ss, SIG_PRESENT);
+    sigaddset (&ss, SIG_NOT_PRESENT);
+    sigaddset (&ss, SIG_FAILED);
+    sigprocmask (SIG_BLOCK, &ss, NULL);
+    sigemptyset (&sa.sa_mask);
+    sa.sa_flags = 0;
+    sa.sa_handler = signal_handler;
+    sigaction (SIG_PRESENT, &sa, NULL);
+    sigaction (SIG_NOT_PRESENT, &sa, NULL);
+    sigaction (SIG_FAILED, &sa, NULL);
+    command->pid = getpid ();
+    command->ppid = getppid ();
+    if ( ( ptr = strrchr (argv[0], '/') ) == NULL ) ptr = argv[0];
+    else ++ptr;
+    /*  First generate command number by looking at invocation name  */
+    if (strcmp (ptr, "display-services") == 0)
+	command->command = COMMAND_DUMP_LIST;
+    else if (strcmp (ptr, "need") == 0) command->command = COMMAND_NEED;
+    else if (strcmp (ptr, "provide") == 0) command->command = COMMAND_PROVIDE;
+    else command->command = COMMAND_TEST;
+    /*  Now check for switches  */
+    if ( (argc > 1) && (argv[1][0] == '-') )
+    {
+	switch (argv[1][1])
+	{
+	  case 'n':
+	    command->command = COMMAND_NEED;
+	    break;
+	  case 'r':
+	    command->command = COMMAND_ROLLBACK;
+	    break;
+	  case 'd':
+	    command->command = COMMAND_DUMP_LIST;
+	    break;
+	  case 'p':
+	    command->command = COMMAND_PROVIDE;
+	    break;
+	  default:
+	    fprintf (stderr, "Illegal switch: \"%s\"\n", argv[1]);
+	    exit (1);
+	    /*break;*/
+	}
+	--argc;
+	++argv;
+    }
+    switch (command->command)
+    {
+      case COMMAND_NEED:
+      case COMMAND_PROVIDE:
+	if (argc < 2)
+	{
+	    fprintf (stderr, "Usage:\tneed|provide programme\n");
+	    exit (1);
+	}
+	/*  Fall through  */
+      case COMMAND_ROLLBACK:
+	if (argc > 1) strcpy (command->name, argv[1]);
+	else command->name[0] = '\0';
+	break;
+      case COMMAND_DUMP_LIST:
+	if (tmpnam (command->name) == NULL)
+	{
+	    fprintf (stderr, "Unable to create a unique filename\t%s\n",
+		     ERRSTRING);
+	    exit (1);
+	}
+	if (mkfifo (command->name, S_IRUSR) != 0)
+	{
+	    fprintf (stderr, "Unable to create FIFO: \"%s\"\t%s\n",
+		     command->name, ERRSTRING);
+	    exit (1);
+	}
+	break;
+    }
+    if ( ( fd = open ("/dev/initctl", O_WRONLY, 0) ) < 0 )
+    {
+	fprintf (stderr, "Error opening\t%s\n", ERRSTRING);
+	exit (1);
+    }
+    if (write (fd, buffer, COMMAND_SIZE) < COMMAND_SIZE)
+    {
+	fprintf (stderr, "Error writing\t%s\n", ERRSTRING);
+	exit (1);
+    }
+    close (fd);
+    if (command->command != COMMAND_DUMP_LIST)
+    {
+	sigemptyset (&ss);
+	while (caught_signal == 0) sigsuspend (&ss);
+	switch (command->command)
+	{
+	  case COMMAND_PROVIDE:
+	    switch (caught_signal)
+	    {
+	      case SIG_PRESENT:
+		return 1;
+	      case SIG_NOT_PRESENT:
+		return 0;
+	      case SIG_NOT_CHILD:
+		fprintf (stderr, "Error\n");
+		return 2;
+	      default:
+		return 3;
+	    }
+	    break;
+	  default:
+	    switch (caught_signal)
+	    {
+	      case SIG_PRESENT:
+		return 0;
+	      case SIG_NOT_PRESENT:
+		return 2;
+	      case SIG_FAILED:
+		return 1;
+	      default:
+		return 3;
+	    }
+	    break;
+	}
+	return 3;
+    }
+    /*  Read back the data and display it  */
+    if ( ( fd = open (command->name, O_RDONLY, 0) ) < 0 )
+    {
+	fprintf (stderr, "Error opening:\"%s\"\t%s\n",
+		 command->name, ERRSTRING);
+	exit (1);
+    }
+    unlink (command->name);
+    fflush (stdout);
+    while ( ( nbytes = read (fd, buffer, COMMAND_SIZE) ) > 0 )
+	write (1, buffer, nbytes);
+    close (fd);
+    return (0);
+}   /*  End Function main  */
+
+static void signal_handler (int sig)
+{
+    caught_signal = sig;
+}   /*  End Function signal_handler  */
diff --git a/util-linux-ng-2.17.2/login-utils/islocal.c b/util-linux-ng-2.17.2/login-utils/islocal.c
new file mode 100644
index 0000000..762a4e9
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/islocal.c
@@ -0,0 +1,115 @@
+/* 
+   islocal.c - returns true if user is registered in the local
+   /etc/passwd file. Written by Alvaro Martinez Echevarria, 
+   alvaro@enano.etsit.upm.es, to allow peaceful coexistence with yp. Nov 94.
+
+   Hacked a bit by poe@daimi.aau.dk
+   See also ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil*
+
+   Hacked by Peter Breitenlohner, peb@mppmu.mpg.de,
+     to distinguish user names where one is a prefix of the other,
+     and to use "pathnames.h". Oct 5, 96.   
+
+   1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+   - added Native Language Support
+
+   2008-04-06 James Youngman, jay@gnu.org
+   - Completely rewritten to remove assumption that /etc/passwd
+     lines are < 1024 characters long.  Also added unit tests.
+
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "nls.h"
+#include "pathnames.h"
+#include "islocal.h"
+
+static int
+is_local_in_file(const char *user, const char *filename)
+{
+	int local = 0;
+	size_t match;
+	int chin, skip;
+	FILE *f;
+
+        if (NULL == (f=fopen(filename, "r")))
+                return -1;
+
+	match = 0u;
+	skip = 0;
+	while ((chin = getc(f)) != EOF) {
+		if (skip) {
+			/* Looking for the start of the next line. */
+			if ('\n' == chin) {
+				/* Start matching username at the next char. */
+				skip = 0;
+				match = 0u;
+			}
+		} else {
+			if (':' == chin) {
+				if (0 == user[match]) {
+					local = 1; /* Success. */
+					/* next line has no test coverage, but it is
+					 * just an optimisation anyway. */
+					break;
+				} else {
+					/* we read a whole username, but it is
+					 * the wrong user.  Skip to the next
+					 * line. */
+					skip = 1;
+				}
+			} else if ('\n' == chin) {
+				/* This line contains no colon; it's malformed.
+				 * No skip since we are already at the start of
+				 * the next line. */
+				match = 0u;
+			} else if (chin != user[match]) {
+				/* username does not match. */
+				skip = 1;
+			} else {
+				++match;
+			}
+		}
+	}
+	fclose(f);
+	return local;
+}
+
+int
+is_local(const char *user)
+{
+	int rv;
+	if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0) {
+		perror(_PATH_PASSWD);
+		fprintf(stderr, _("Failed to open %s for reading, exiting."),
+			_PATH_PASSWD);
+		exit(1);
+	} else {
+		return rv;
+	}
+}
+
+#if MAIN_TEST_ISLOCAL
+int
+main (int argc, char *argv[])
+{
+	if (argc < 2) {
+		fprintf(stderr, "No test passwd file was specified.\n");
+		return 1;
+	} else {
+		int i;
+		for (i = 2; i < argc; i++) {
+			const int rv = is_local_in_file(argv[i], argv[1]);
+			if (rv < 0) {
+				perror(argv[1]);
+				return 2;
+			}
+			printf("%d:%s\n", rv, argv[i]);
+		}
+		return 0;
+	}
+}
+#endif
diff --git a/util-linux-ng-2.17.2/login-utils/islocal.h b/util-linux-ng-2.17.2/login-utils/islocal.h
new file mode 100644
index 0000000..2c58799
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/islocal.h
@@ -0,0 +1 @@
+extern int is_local(const char *user);
diff --git a/util-linux-ng-2.17.2/login-utils/last.1 b/util-linux-ng-2.17.2/login-utils/last.1
new file mode 100644
index 0000000..314e5d9
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/last.1
@@ -0,0 +1,62 @@
+.TH LAST 1 "20 March 1992"
+.SH NAME
+last \(em indicate last logins by user or terminal
+.SH SYNOPSIS
+.ad l
+.B last
+.RB [ \-\fP\fInumber\fP ]
+.RB [ \-f
+.IR filename ]
+.RB [ \-t
+.IR tty ]
+.RB [ \-h
+.IR hostname ]
+.RB [ \-i
+.IR address ]
+.RB [ \-l ]
+.RB [ \-y ]
+.RI [ name ...]
+.ad b
+.SH DESCRIPTION
+\fBLast\fP looks back in the \fBwtmp\fP file which records all logins
+and logouts for information about a user, a teletype or any group of
+users and teletypes.  Arguments specify names of users or teletypes of
+interest.  If multiple arguments are given, the information which
+applies to any of the arguments is printed.  For example ``\fBlast root
+console\fP'' would list all of root's sessions as well as all sessions
+on the console terminal.  \fBLast\fP displays the sessions of the
+specified users and teletypes, most recent first, indicating the times
+at which the session began, the duration of the session, and the
+teletype which the session took place on.  If the session is still
+continuing or was cut short by a reboot, \fBlast\fP so indicates.
+.LP
+The pseudo-user \fBreboot\fP logs in at reboots of the system.
+.LP
+\fBLast\fP with no arguments displays a record of all logins and
+logouts, in reverse order.
+.LP
+If \fBlast\fP is interrupted, it indicates how far the search has
+progressed in \fBwtmp\fP.  If interrupted with a quit signal \fBlast\fP
+indicates how far the search has progressed so far, and the search
+continues.
+.SH OPTIONS
+.IP \fB\-\fP\fInumber\fP
+limit the number of entries displayed to that specified by \fInumber\fP.
+.IP "\fB\-f\fP \fIfilename\fP"
+Use \fIfilename\fP as the name of the accounting file instead of
+.BR /var/log/wtmp .
+.IP "\fB\-h\fP \fIhostname\fP"
+List only logins from \fIhostname\fP.
+.IP "\fB\-i\fP \fIIP address\fP"
+List only logins from \fIIP address\fP.
+.IP "\fB\-l\fP"
+List IP addresses of remote hosts instead of truncated host names.
+.IP "\fB\-t\fP \fItty\fP"
+List only logins on \fItty\fP.
+.IP "\fB\-y\fP"
+Also report year of dates.
+.SH FILES
+/var/log/wtmp \(em login data base
+.SH AVAILABILITY
+The last command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
diff --git a/util-linux-ng-2.17.2/login-utils/last.c b/util-linux-ng-2.17.2/login-utils/last.c
new file mode 100644
index 0000000..0c4c0a1
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/last.c
@@ -0,0 +1,478 @@
+/*
+ * Berkeley last for Linux. Currently maintained by poe@daimi.aau.dk at
+ * ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil*
+ *
+ * Copyright (c) 1987 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+ /* 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
+  * - added Native Language Support
+  */
+
+ /* 2001-02-14 Marek Zelem <marek@fornax.sk>
+  * - using mmap() on Linux - great speed improvement
+  */
+
+/*
+ * last
+ */
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <utmp.h>
+#include <stdio.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "pathnames.h"
+#include "nls.h"
+
+#define	SECDAY	(24*60*60)			/* seconds in a day */
+#define	NO	0				/* false/no */
+#define	YES	1				/* true/yes */
+
+static struct utmp	utmpbuf;
+
+#define	HMAX	(int)sizeof(utmpbuf.ut_host)	/* size of utmp host field */
+#define	LMAX	(int)sizeof(utmpbuf.ut_line)	/* size of utmp tty field */
+#define	NMAX	(int)sizeof(utmpbuf.ut_name)	/* size of utmp name field */
+
+#ifndef MIN
+#define MIN(a,b)	(((a) < (b)) ? (a) : (b))
+#endif
+
+/* maximum sizes used for printing */
+/* probably we want a two-pass version that computes the right length */
+int hmax = MIN(HMAX, 16);
+int lmax = MIN(LMAX, 8);
+int nmax = MIN(NMAX, 16);
+
+typedef struct arg {
+	char	*name;				/* argument */
+#define	HOST_TYPE	-2
+#define	TTY_TYPE	-3
+#define	USER_TYPE	-4
+#define INET_TYPE	-5
+	int	type;				/* type of arg */
+	struct arg	*next;			/* linked list pointer */
+} ARG;
+ARG	*arglist;				/* head of linked list */
+
+typedef struct ttytab {
+	long	logout;				/* log out time */
+	char	tty[LMAX + 1];			/* terminal name */
+	struct ttytab	*next;			/* linked list pointer */
+} TTY;
+TTY	*ttylist;				/* head of linked list */
+
+static long	currentout,			/* current logout value */
+		maxrec;				/* records to display */
+static char	*file = _PATH_WTMP;		/* wtmp file */
+
+static int	doyear = 0;			/* output year in dates */
+static int	dolong = 0;			/* print also ip-addr */
+
+static void wtmp(void);
+static void addarg(int, char *);
+static void hostconv(char *);
+static void onintr(int);
+static int want(struct utmp *, int);
+TTY *addtty(char *);
+static char *ttyconv(char *);
+
+int
+main(int argc, char **argv) {
+	extern int	optind;
+	extern char	*optarg;
+	int	ch;
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	while ((ch = getopt(argc, argv, "0123456789yli:f:h:t:")) != -1)
+		switch((char)ch) {
+		case '0': case '1': case '2': case '3': case '4':
+		case '5': case '6': case '7': case '8': case '9':
+			/*
+			 * kludge: last was originally designed to take
+			 * a number after a dash.
+			 */
+			if (!maxrec)
+				maxrec = atol(argv[optind - 1] + 1);
+			break;
+		case 'f':
+			file = optarg;
+			break;
+		case 'h':
+			hostconv(optarg);
+			addarg(HOST_TYPE, optarg);
+			break;
+		case 't':
+			addarg(TTY_TYPE, ttyconv(optarg));
+			break;
+		case 'y':
+			doyear = 1;
+			break;
+		case 'l':
+			dolong = 1;
+			break;
+		case 'i':
+			addarg(INET_TYPE, optarg);
+			break;
+		case '?':
+		default:
+			fputs(_("usage: last [-#] [-f file] [-t tty] [-h hostname] [user ...]\n"), stderr);
+			exit(1);
+		}
+	for (argv += optind; *argv; ++argv) {
+#define	COMPATIBILITY
+#ifdef	COMPATIBILITY
+		/* code to allow "last p5" to work */
+		addarg(TTY_TYPE, ttyconv(*argv));
+#endif
+		addarg(USER_TYPE, *argv);
+	}
+	wtmp();
+	exit(0);
+}
+
+static char *utmp_ctime(struct utmp *u)
+{
+	time_t t = (time_t) u->ut_time;
+	return ctime(&t);
+}
+
+/*
+ * print_partial_line --
+ *	print the first part of each output line according to specified format
+ */
+static void
+print_partial_line(struct utmp *bp) {
+    char *ct;
+
+    ct = utmp_ctime(bp);
+    printf("%-*.*s  %-*.*s ", nmax, nmax, bp->ut_name, 
+	   lmax, lmax, bp->ut_line);
+
+    if (dolong) {
+	if (bp->ut_addr) {
+	    struct in_addr foo;
+	    foo.s_addr = bp->ut_addr;
+	    printf("%-*.*s ", hmax, hmax, inet_ntoa(foo));
+	} else {
+	    printf("%-*.*s ", hmax, hmax, "");
+	}
+    } else {
+	printf("%-*.*s ", hmax, hmax, bp->ut_host);
+    }
+
+    if (doyear) {
+	printf("%10.10s %4.4s %5.5s ", ct, ct + 20, ct + 11);
+    } else {
+	printf("%10.10s %5.5s ", ct, ct + 11);
+    }
+}
+
+/*
+ * wtmp --
+ *	read through the wtmp file
+ */
+static void
+wtmp(void) {
+	register struct utmp	*bp;		/* current structure */
+	register TTY	*T;			/* tty list entry */
+	long	delta;				/* time difference */
+	char *crmsg = NULL;
+	char *ct = NULL;
+	int fd;
+	struct utmp *utl;
+	struct stat st;
+	int utl_len;
+	int listnr = 0;
+	int i;
+
+	utmpname(file);
+
+	{
+#if defined(_HAVE_UT_TV)
+		struct timeval tv;
+		gettimeofday(&tv, NULL);
+		utmpbuf.ut_tv.tv_sec = tv.tv_sec;
+		utmpbuf.ut_tv.tv_usec = tv.tv_usec;
+#else
+		time_t t;
+		time(&t);
+		utmpbuf.ut_time = t;
+#endif
+	}
+
+	(void)signal(SIGINT, onintr);
+	(void)signal(SIGQUIT, onintr);
+
+	if ((fd = open(file,O_RDONLY)) < 0)
+		exit(1);
+	fstat(fd, &st);
+	utl_len = st.st_size;
+	utl = mmap(NULL, utl_len, PROT_READ|PROT_WRITE,
+		   MAP_PRIVATE|MAP_FILE, fd, 0);
+	if (utl == NULL)
+		exit(1);
+	listnr = utl_len/sizeof(struct utmp);
+
+	if(listnr) 
+		ct = utmp_ctime(&utl[0]);
+
+	for(i = listnr - 1; i >= 0; i--) {
+		bp = utl+i;
+		/*
+		 * if the terminal line is '~', the machine stopped.
+		 * see utmp(5) for more info.
+		 */
+		if (!strncmp(bp->ut_line, "~", LMAX)) {
+		    /* 
+		     * utmp(5) also mentions that the user 
+		     * name should be 'shutdown' or 'reboot'.
+		     * Not checking the name causes e.g. runlevel
+		     * changes to be displayed as 'crash'. -thaele
+		     */
+		    if (!strncmp(bp->ut_user, "reboot", NMAX) ||
+			!strncmp(bp->ut_user, "shutdown", NMAX)) {	
+			/* everybody just logged out */
+			for (T = ttylist; T; T = T->next)
+			    T->logout = -bp->ut_time;
+		    }
+
+		    currentout = -bp->ut_time;
+		    crmsg = (strncmp(bp->ut_name, "shutdown", NMAX)
+			    ? "crash" : "down ");
+		    if (!bp->ut_name[0])
+			(void)strcpy(bp->ut_name, "reboot");
+		    if (want(bp, NO)) {
+			ct = utmp_ctime(bp);
+			if(bp->ut_type != LOGIN_PROCESS) {
+			    print_partial_line(bp);
+			    putchar('\n');
+			}
+			if (maxrec && !--maxrec)
+			    return;
+		    }
+		    continue;
+		}
+		/* find associated tty */
+		for (T = ttylist;; T = T->next) {
+		    if (!T) {
+			/* add new one */
+			T = addtty(bp->ut_line);
+			break;
+		    }
+		    if (!strncmp(T->tty, bp->ut_line, LMAX))
+			break;
+		}
+		if (bp->ut_name[0] && bp->ut_type != LOGIN_PROCESS
+		    && bp->ut_type != DEAD_PROCESS
+		    && want(bp, YES)) {
+
+		    print_partial_line(bp);
+
+		    if (!T->logout)
+			puts(_("  still logged in"));
+		    else {
+			if (T->logout < 0) {
+			    T->logout = -T->logout;
+			    printf("- %s", crmsg);
+			}
+			else
+			    printf("- %5.5s", ctime(&T->logout)+11);
+			delta = T->logout - bp->ut_time;
+			if (delta < SECDAY)
+			    printf("  (%5.5s)\n", asctime(gmtime(&delta))+11);
+			else
+			    printf(" (%ld+%5.5s)\n", delta / SECDAY, asctime(gmtime(&delta))+11);
+		    }
+		    if (maxrec != -1 && !--maxrec)
+			return;
+		}
+		T->logout = bp->ut_time;
+		utmpbuf.ut_time = bp->ut_time;
+	}
+	munmap(utl,utl_len);
+	close(fd);
+	if(ct) printf(_("\nwtmp begins %s"), ct); 	/* ct already ends in \n */
+}
+
+/*
+ * want --
+ *	see if want this entry
+ */
+static int
+want(struct utmp *bp, int check) {
+	register ARG	*step;
+
+	if (check) {
+		/*
+		 * when uucp and ftp log in over a network, the entry in
+		 * the utmp file is the name plus their process id.  See
+		 * etc/ftpd.c and usr.bin/uucp/uucpd.c for more information.
+		 */
+		if (!strncmp(bp->ut_line, "ftp", sizeof("ftp") - 1))
+			bp->ut_line[3] = '\0';
+		else if (!strncmp(bp->ut_line, "uucp", sizeof("uucp") - 1))
+			bp->ut_line[4] = '\0';
+	}
+	if (!arglist)
+		return(YES);
+
+	for (step = arglist; step; step = step->next)
+		switch(step->type) {
+		case HOST_TYPE:
+			if (!strncmp(step->name, bp->ut_host, HMAX))
+				return(YES);
+			break;
+		case TTY_TYPE:
+			if (!strncmp(step->name, bp->ut_line, LMAX))
+				return(YES);
+			break;
+		case USER_TYPE:
+			if (!strncmp(step->name, bp->ut_name, NMAX))
+				return(YES);
+			break;
+		case INET_TYPE:
+			if (bp->ut_addr == inet_addr(step->name))
+			  return(YES);
+			break;
+	}
+	return(NO);
+}
+
+/*
+ * addarg --
+ *	add an entry to a linked list of arguments
+ */
+static void
+addarg(int type, char *arg) {
+	register ARG	*cur;
+
+	if (!(cur = (ARG *)malloc((unsigned int)sizeof(ARG)))) {
+		fputs(_("last: malloc failure.\n"), stderr);
+		exit(1);
+	}
+	cur->next = arglist;
+	cur->type = type;
+	cur->name = arg;
+	arglist = cur;
+}
+
+/*
+ * addtty --
+ *	add an entry to a linked list of ttys
+ */
+TTY *
+addtty(char *ttyname) {
+	register TTY	*cur;
+
+	if (!(cur = (TTY *)malloc((unsigned int)sizeof(TTY)))) {
+		fputs(_("last: malloc failure.\n"), stderr);
+		exit(1);
+	}
+	cur->next = ttylist;
+	cur->logout = currentout;
+	memcpy(cur->tty, ttyname, LMAX);
+	return(ttylist = cur);
+}
+
+/*
+ * hostconv --
+ *	convert the hostname to search pattern; if the supplied host name
+ *	has a domain attached that is the same as the current domain, rip
+ *	off the domain suffix since that's what login(1) does.
+ */
+static void
+hostconv(char *arg) {
+	static int	first = 1;
+	static char	*hostdot,
+			name[MAXHOSTNAMELEN];
+	char	*argdot;
+
+	if (!(argdot = strchr(arg, '.')))
+		return;
+	if (first) {
+		first = 0;
+		if (gethostname(name, sizeof(name))) {
+			perror(_("last: gethostname"));
+			exit(1);
+		}
+		hostdot = strchr(name, '.');
+	}
+	if (hostdot && !strcmp(hostdot, argdot))
+		*argdot = '\0';
+}
+
+/*
+ * ttyconv --
+ *	convert tty to correct name.
+ */
+static char *
+ttyconv(char *arg) {
+	char	*mval;
+
+	/*
+	 * kludge -- we assume that all tty's end with
+	 * a two character suffix.
+	 */
+	if (strlen(arg) == 2) {
+		/* either 6 for "ttyxx" or 8 for "console" */
+		if (!(mval = malloc((unsigned int)8))) {
+			fputs(_("last: malloc failure.\n"), stderr);
+			exit(1);
+		}
+		if (!strcmp(arg, "co"))
+			(void)strcpy(mval, "console");
+		else {
+			(void)strcpy(mval, "tty");
+			(void)strcpy(mval + 3, arg);
+		}
+		return(mval);
+	}
+	if (!strncmp(arg, "/dev/", sizeof("/dev/") - 1))
+		return(arg + 5);
+	return(arg);
+}
+
+/*
+ * onintr --
+ *	on interrupt, we inform the user how far we've gotten
+ */
+static void
+onintr(int signo) {
+	char	*ct;
+
+	ct = utmp_ctime(&utmpbuf);
+	printf(_("\ninterrupted %10.10s %5.5s \n"), ct, ct + 11);
+	if (signo == SIGINT)
+		exit(1);
+	(void)fflush(stdout);			/* fix required for rsh */
+}
diff --git a/util-linux-ng-2.17.2/login-utils/login.1 b/util-linux-ng-2.17.2/login-utils/login.1
new file mode 100644
index 0000000..1227381
--- /dev/null
+++ b/util-linux-ng-2.17.2/login-utils/login.1
@@ -0,0 +1,344 @@
+.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
+.\" May be distributed under the GNU General Public License
+.TH LOGIN 1 "4 November 1996" "Util-linux 1.6" "Linux Programmer's Manual"
+.SH NAME
+login \- sign on
+.SH SYNOPSIS
+.BR "login [ " name " ]"
+.br
+.B "login \-p"
+.br
+.BR "login \-h " hostname
+.br
+.BR "login \-f " name
+.SH DESCRIPTION
+.B login
+is used when signing onto a system.
+
+If an argument is not given,
+.B login
+prompts for the username.
+
+If the user is
+.I not
+root, and if
+.I /etc/nologin
+exists, the contents of this file are printed to the screen, and the
+login is terminated.  This is typically used to prevent logins when the
+system is being taken down.
+
+If special access restrictions are specified for the user in
+.IR /etc/usertty ,
+these must be met, or the log in attempt will be denied and a 
+.B syslog
+message will be generated. See the section on "Special Access Restrictions".
+
+If the user is root, then the login must be occurring on a tty listed in
+.IR /etc/securetty .
+Failures will be logged with the
+.B syslog
+facility.
+
+After these conditions have been checked, the password will be requested and
+checked (if a password is required for this username).  Ten attempts
+are allowed before
+.B login
+dies, but after the first three, the response starts to get very slow.
+Login failures are reported via the
+.B syslog
+facility.  This facility is also used to report any successful root logins.
+
+If the file
+.I .hushlogin
+exists, then a "quiet" login is performed (this disables the checking
+of mail and the printing of the last login time and message of the day).
+Otherwise, if
+.I /var/log/lastlog
+exists, the last login time is printed (and the current login is
+recorded).
+
+Random administrative things, such as setting the UID and GID of the
+tty are performed.  The TERM environment variable is preserved, if it
+exists (other environment variables are preserved if the
+.B \-p
+option is used).  Then the HOME, PATH, SHELL, TERM, MAIL, and LOGNAME
+environment variables are set.  PATH defaults to
+.I /usr/local/bin:/bin:/usr/bin
+for normal users, and to
+.I /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+for root.  Last, if this is not a "quiet" login, the message of the
+day is printed and the file with the user's name in
+.I /var/spool/mail
+will be checked, and a message printed if it has non-zero length.
+
+The user's shell is then started.  If no shell is specified for the
+user in
+.BR /etc/passwd ,
+then
+.B /bin/sh
+is used.  If there is no directory specified in
+.IR /etc/passwd ,
+then
+.I /
+is used (the home directory is checked for the
+.I .hushlogin
+file described above).
+.SH OPTIONS
+.TP
+.B \-p
+Used by
+.BR getty (8)
+to tell
+.B login
+not to destroy the environment
+.TP
+.B \-f
+Used to skip a second login authentication.  This specifically does
+.B not
+work for root, and does not appear to work well under Linux.
+.TP
+.B \-h
+Used by other servers (i.e.,
+.BR telnetd (8))
+to pass the name of the remote host to
+.B login
+so that it may be placed in utmp and wtmp.  Only the superuser may use
+this option.
+
+Note that the \fB-h\fP option has impact on the \fBPAM service name\fP. The standard
+service name is "login", with the \fB-h\fP option the name is "remote". It's
+necessary to create a proper PAM config files (e.g.
+.I /etc/pam.d/login
+and 
+.I /etc/pam.d/remote
+).
+
+.SH "SPECIAL ACCESS RESTRICTIONS"
+The file
+.I /etc/securetty
+lists the names of the ttys where root is allowed to log in. One name
+of a tty device without the /dev/ prefix must be specified on each
+line.  If the file does not exist, root is allowed to log in on any
+tty.
+.PP
+On most modern Linux systems PAM (Pluggable Authentication Modules)
+is used. On systems that do not use PAM, the file
+.I /etc/usertty
+specifies additional access restrictions for specific users.
+If this file does not exist, no additional access restrictions are
+imposed. The file consists of a sequence of sections. There are three
+possible section types: CLASSES, GROUPS and USERS. A CLASSES section
+defines classes of ttys and hostname patterns, A GROUPS section
+defines allowed ttys and hosts on a per group basis, and a USERS
+section defines allowed ttys and hosts on a per user basis.
+.PP
+Each line in this file in may be no longer than 255
+characters. Comments start with # character and extend to the end of
+the line.
+.PP
+.SS "The CLASSES Section"
+A CLASSES section begins with the word CLASSES at the start of a line
+in all upper case. Each following line until the start of a new
+section or the end of the file consists of a sequence of words
+separated by tabs or spaces. Each line defines a class of ttys and
+host patterns.
+.PP
+The word at the beginning of a line becomes defined as a collective
+name for the ttys and host patterns specified at the rest of the
+line. This collective name can be used in any subsequent GROUPS or
+USERS section. No such class name must occur as part of the definition