--- autodir-0.99.9.orig/config.guess +++ autodir-0.99.9/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2003-06-17' +timestamp='2008-01-23' # 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 @@ -17,13 +18,15 @@ # # 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. +# 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 to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -53,8 +56,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +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." @@ -66,11 +69,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +107,7 @@ 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 -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$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 ; } ; @@ -123,7 +126,7 @@ ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +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) @@ -136,13 +139,6 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -## for Red Hat Linux -if test -f /etc/redhat-release ; then - VENDOR=redhat ; -else - VENDOR= ; -fi - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -165,6 +161,7 @@ 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 @@ -203,50 +200,32 @@ # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + 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:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *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 @@ -284,42 +263,49 @@ "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/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; + 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 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + 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 0;; + 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 0;; + 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 @@ -327,32 +313,32 @@ else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + 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 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + 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 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -361,10 +347,10 @@ esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + 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 @@ -376,10 +362,10 @@ echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + 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 @@ -390,37 +376,40 @@ # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -444,32 +433,33 @@ exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $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 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -485,29 +475,29 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + 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 0 ;; # Note that: echo "'`uname -s`'" gives '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 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -515,7 +505,7 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -530,15 +520,19 @@ exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + 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 0 ;; - *:AIX:*:[45]) + 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 @@ -551,28 +545,28 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -634,9 +628,19 @@ esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + 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 __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -644,11 +648,11 @@ fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -676,150 +680,192 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + 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 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + 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 0 ;; + 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 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; + 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 0 ;; - i*:MINGW*:*) + exit ;; + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + 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 0 ;; + 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 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + 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 0 ;; + 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 0 ;; + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit 0 ;; + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + 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 0 ;; + exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -836,8 +882,12 @@ #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 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -855,15 +905,22 @@ #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 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; ppc:Linux:*:*) - echo powerpc-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo powerpc-unknown-linux-gnu + exit ;; ppc64:Linux:*:*) - echo powerpc64-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo powerpc64-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -877,7 +934,7 @@ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -885,25 +942,31 @@ PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-ibm-linux + exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) - echo x86_64-${VENDOR:-unknown}-linux-gnu - exit 0 ;; + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -921,15 +984,15 @@ ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; + exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; + exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -946,23 +1009,33 @@ LIBC=gnulibc1 # endif #else - #ifdef __INTEL_COMPILER + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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 0 ;; + 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... @@ -970,24 +1043,27 @@ # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + 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 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + 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 @@ -995,15 +1071,16 @@ else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + 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 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /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 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*: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) + 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 0 + && { 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 0 ;; + && { 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 0 ;; + && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1095,68 +1172,81 @@ else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + 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 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + 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 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + 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 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1164,22 +1254,25 @@ UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1190,28 +1283,47 @@ UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + 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 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1243,7 +1355,7 @@ #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1332,11 +1444,12 @@ } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$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 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1345,22 +1458,22 @@ case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1371,7 +1484,9 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + 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 --- autodir-0.99.9.orig/config.sub +++ autodir-0.99.9/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2003-06-18' +timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,14 +22,15 @@ # # 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. - +# 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 . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -70,8 +72,8 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +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." @@ -83,11 +85,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +101,7 @@ *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,7 +120,9 @@ # 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* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -144,7 +148,7 @@ -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) + -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; @@ -169,6 +173,10 @@ -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/'` @@ -185,6 +193,10 @@ # 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/'` @@ -228,14 +240,17 @@ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k \ - | m32r | m68000 | m68k | m88k | mcore \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -244,28 +259,33 @@ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | s390 | s390x \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -276,6 +296,9 @@ ;; 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 @@ -295,20 +318,20 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ + | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -317,34 +340,43 @@ | 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-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | s390-* | s390x-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; + # 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) @@ -361,6 +393,9 @@ basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -378,6 +413,9 @@ amd64) basic_machine=x86_64-pc ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -409,6 +447,14 @@ basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; c90) basic_machine=c90-cray os=-unicos @@ -437,12 +483,27 @@ 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 ;; @@ -465,6 +526,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -615,6 +680,14 @@ 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 ;; @@ -630,6 +703,10 @@ basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; @@ -643,10 +720,6 @@ mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -659,6 +732,9 @@ basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -727,10 +803,6 @@ np1) basic_machine=np1-gould ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -738,9 +810,12 @@ basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson @@ -758,6 +833,14 @@ 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 ;; @@ -767,6 +850,12 @@ 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 ;; @@ -823,6 +912,10 @@ basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -833,6 +926,12 @@ 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 @@ -843,6 +942,10 @@ sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei os=-seiux @@ -854,6 +957,9 @@ basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -943,6 +1049,10 @@ basic_machine=tic6x-unknown os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -956,6 +1066,10 @@ tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -999,6 +1113,10 @@ basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1029,6 +1147,9 @@ romp) basic_machine=romp-ibm ;; + mmix) + basic_machine=mmix-knuth + ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1045,13 +1166,10 @@ we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1124,19 +1242,23 @@ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -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* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -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*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1154,12 +1276,15 @@ os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -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|'` ;; @@ -1172,6 +1297,9 @@ -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1193,6 +1321,9 @@ -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1215,6 +1346,9 @@ -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1251,6 +1385,9 @@ -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; -none) ;; *) @@ -1273,6 +1410,12 @@ # system, and we'll never get to this point. case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1282,8 +1425,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1310,6 +1453,9 @@ m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; @@ -1328,9 +1474,15 @@ *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; + *-knuth) + os=-mmixware + ;; *-wec) os=-proelf ;; @@ -1463,9 +1615,15 @@ -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; @@ -1490,7 +1648,7 @@ esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) --- autodir-0.99.9.orig/src/auto_fs4.h +++ autodir-0.99.9/src/auto_fs4.h @@ -0,0 +1,105 @@ +/* -*- c -*- + * linux/include/linux/auto_fs4.h + * + * Copyright 1999-2000 Jeremy Fitzhardinge + * + * This file is part of the Linux kernel and is made available under + * the terms of the GNU General Public License, version 2, or at your + * option, any later version, incorporated herein by reference. + */ + +#ifndef _LINUX_AUTO_FS4_H +#define _LINUX_AUTO_FS4_H + +/* Include common v3 definitions */ +#include + +/* autofs v4 definitions */ +#undef AUTOFS_PROTO_VERSION +#undef AUTOFS_MIN_PROTO_VERSION +#undef AUTOFS_MAX_PROTO_VERSION + +#define AUTOFS_PROTO_VERSION 5 +#define AUTOFS_MIN_PROTO_VERSION 3 +#define AUTOFS_MAX_PROTO_VERSION 5 + +#define AUTOFS_PROTO_SUBVERSION 0 + +/* Mask for expire behaviour */ +#define AUTOFS_EXP_IMMEDIATE 1 +#define AUTOFS_EXP_LEAVES 2 + +/* Daemon notification packet types */ +enum autofs_notify { + NFY_NONE, + NFY_MOUNT, + NFY_EXPIRE +}; + +/* Kernel protocol version 4 packet types */ + +/* Expire entry (umount request) */ +#define autofs_ptype_expire_multi 2 + +/* Kernel protocol version 5 packet types */ + +/* Indirect mount missing and expire requests. */ +#define autofs_ptype_missing_indirect 3 +#define autofs_ptype_expire_indirect 4 + +/* Direct mount missing and expire requests */ +#define autofs_ptype_missing_direct 5 +#define autofs_ptype_expire_direct 6 + +/* v4 multi expire (via pipe) */ +struct autofs_packet_expire_multi { + struct autofs_packet_hdr hdr; + autofs_wqt_t wait_queue_token; + int len; + char name[NAME_MAX+1]; +}; + +union autofs_packet_union { + struct autofs_packet_hdr hdr; + struct autofs_packet_missing missing; + struct autofs_packet_expire expire; + struct autofs_packet_expire_multi expire_multi; +}; + +/* autofs v5 packet struct and union */ +struct autofs_v5_packet { + struct autofs_packet_hdr hdr; + autofs_wqt_t wait_queue_token; + __u32 dev; + __u64 ino; + __u32 uid; + __u32 gid; + __u32 pid; + __u32 tgid; + __u32 len; + char name[NAME_MAX+1]; +}; + +typedef struct autofs_v5_packet autofs_packet_missing_indirect_t; +typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; +typedef struct autofs_v5_packet autofs_packet_missing_direct_t; +typedef struct autofs_v5_packet autofs_packet_expire_direct_t; + +union autofs_v5_packet_union { + struct autofs_packet_hdr hdr; + autofs_packet_missing_indirect_t missing_indirect; + autofs_packet_expire_indirect_t expire_indirect; + autofs_packet_missing_direct_t missing_direct; + autofs_packet_expire_direct_t expire_direct; +}; + +#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) +#define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI +#define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI +#define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) +#define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int) +#define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int) +#define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int) + + +#endif /* _LINUX_AUTO_FS4_H */ --- autodir-0.99.9.orig/src/expire.c +++ autodir-0.99.9/src/expire.c @@ -27,7 +27,8 @@ #include #include #include -#include +#include "auto_fs4.h" + #include "msg.h" #include "thread.h" --- autodir-0.99.9.orig/debian/docs +++ autodir-0.99.9/debian/docs @@ -0,0 +1,4 @@ +NEWS +README +debian/Autodir-HOWTO.html +debian/Autodir-HOWTO.xml --- autodir-0.99.9.orig/debian/autodir.default +++ autodir-0.99.9/debian/autodir.default @@ -0,0 +1,73 @@ +# Defaults for autodir initscript sourced by /etc/init.d/autodir +# installed at /etc/default/autodir by the maintainer scripts + +# Master system-wide autodir switches. The initscript +# will not run one or both if they are not set to yes. +RUN_AUTOHOME="no" +RUN_AUTOGROUP="no" + +# Where (virtual) home/group directories are supposed to be? +# Visible to applications +AUTOHOME_HOME=/home +AUTOGROUP_HOME=/group + +# How long to wait in seconds +# before it is assumed home directory +# is inactive and unmounted. +# +# Servers like IMAP/POP access home directories every 10min +# in most configurations -- client side default mail check duraion. +# Therefore it is beter to make it 11min in this situation. +# +# If your site has different requirements, change according to that. +AUTOHOME_TIMEOUT=660 + +# How long to wait in seconds +# before it is assumed home directory +# is inactive and unmounted. +AUTOGROUP_TIMEOUT=300 + +# Authome module paths +AUTOHOME_MODULE="/usr/lib/autodir/autohome.so" +AUTOGROUP_MODULE="/usr/lib/autodir/autogroup.so" + +# realpath => path where real home directories should reside +# level => Default value is ok for almost all sites. See Autodir-HOWTO +# skel => Location of skel files. absolute path is expected +# noskel => Don not copy skel files to home directories +AUTOHOME_OPTIONS="realpath=/autohome,level=2,skel=/etc/skel" + +# realpath => path where real group directories should reside. +# level => Default value is ok for almost all sites. See Autodir-HOWTO. +# nosetgid => Default is to setgid the group directory created. +# nopriv => Default is to create group directory for every kind of group. +# If your site has user private groups and you dont want +# group directories created for these, use this option. +AUTOGROUP_OPTIONS="realpath=/autogroup,level=2" + +# If you desire backup feature and you know what this feature is, then uncomment it! +# Full path to program as well as arguments. +# %x characters are replaced with appropriate values. +# Following is just example. Do not use it as is! +# See Autodir-HOWTO for further info. + +#AUTOHOME_BACKUP="'/bin/tar cf /tmp/%N.tar.gz %L'" +#AUTOGROUP_BACKUP="'/bin/tar cf /tmp/%N.tar.gz %L'" + +# How long to wait after a home directory is unmounted +# to start backup. Value expected in seconds and can not exceed one day. + +#AUTOHOME_BACKWAIT=600 +#AUTOGROUP_BACKWAIT=600 + +# Backup priority. 1 to 40 inclusive. Smaller value means higher priority. + +#AUTOHOME_BACKPRI=30 +#AUTOGROUP_BACKPRI=30 + +# Max backup program execusions not to exceed at any given time. + +#AUTOHOME_MAXBACK=150 +#AUTOGROUP_MAXBACK=150 + + --- autodir-0.99.9.orig/debian/preinst +++ autodir-0.99.9/debian/preinst @@ -0,0 +1,39 @@ +#! /bin/sh +# preinst script for autodir +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Currently does nothing... + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- autodir-0.99.9.orig/debian/watch +++ autodir-0.99.9/debian/watch @@ -0,0 +1,6 @@ +# Compulsory line, this is a version 3 file +version=3 +# Uncomment to find new files on sourceforge, for debscripts >= 2.9 +http://sf.net/intraperson/autodir-([\d\.]+)\.tar\.gz + + --- autodir-0.99.9.orig/debian/compat +++ autodir-0.99.9/debian/compat @@ -0,0 +1 @@ +4 --- autodir-0.99.9.orig/debian/control +++ autodir-0.99.9/debian/control @@ -0,0 +1,23 @@ +Source: autodir +Section: non-free/utils +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Francesco Paolo Lovergine +Build-Depends: debhelper (>= 4.0.0), autotools-dev, libltdl7-dev, libcap-dev +Standards-Version: 3.6.2 + +Package: autodir +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Automatically creates home and group directories for LDAP/NIS/SQL/local accounts + A modular and thread-enabled tool to create and/or mounting and managing + automagically and transparently user/group home directories, on demand. + . + It can work with any authentication framework (e.g. system files, NIS, LDAP or SQL) + and does not require PAM, which is a required feature for session-less service + such as smtp servers. + . + Automounter version 4 (autofs4) has to be enabled when compiling the kernel. + Debian packaged kernels have it enabled as module. + . + Home page: http://www.intraperson.com/autodir/ --- autodir-0.99.9.orig/debian/prerm +++ autodir-0.99.9/debian/prerm @@ -0,0 +1,41 @@ +#! /bin/sh +# prerm script for autodir +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +PACKAGE=autodir +INIT=/etc/init.d/$PACKAGE + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- autodir-0.99.9.orig/debian/Autodir-HOWTO.xml +++ autodir-0.99.9/debian/Autodir-HOWTO.xml @@ -0,0 +1,699 @@ + + + + +
+ + + + + Autodir HOWTO + Rahul Sundaram + + Venkata Ramana + Enaganti + + +
ramana <> intraperson dot com
+
+
+ + + 2004-09-23 + + + + + 1.02 + 2004-12-25 + VRE + Minor updates + + + 1.00 + 2004-09-23 + VRE + Initial release, reviewed by Rahul Sundaram at TLDP + + + 0.32 + 2004-09-13 + VRE + New sections like requirements and others. + + + 0.10 + 2004-06-24 + VRE + second draft + + + 0.9 + 2004-06-11 + VRE + first draft + + + + + + + This HOWTO is about Autodir installation, configuration and other issues related to Autodir. + + + +
+ + + + + +Introduction + +Autodir offers a simple and effective means to create directories like home directories in a transparent manner. It relies on the autofs protocol for its operation. + +This document explains how to create directories on demand using Autodir in a transparent way to the applications. This document also explains using transparent backup feature that is possible with Autodir without bringing system down for backup purpose for all directories managed by Autodir. + + + + Copyright and License + + + This document, Autodir HOWTO, + is copyrighted (c) 2004 by Venkata Ramana Enaganti. + +This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + + Linux is a registered trademark of Linus Torvalds. + + + + + Disclaimer + + + No liability for the contents of this document can be accepted. + Use the concepts, examples and information at your own risk. + There may be errors and inaccuracies, that could be damaging to + your system. Proceed with caution, and although this is highly + unlikely, the author(s) do not take any responsibility. + + + + All copyrights are held by their by their respective owners, + unless specifically noted otherwise. Use of a term in this + document should not be regarded as affecting the validity of any + trademark or service mark. Naming of particular products or + brands should not be seen as endorsements. + + + + + + Feedback + + + Feedback is most certainly welcome for this document. Send + your additions, comments and criticisms to the following + email address : ramana <> intraperson dot com. + + + + New Versions of this Document + The latest version of this HOWTO will be made available from http://www.intraperson.com/autodir/. + + + Credits / Contributors + + + In this document, I have the pleasure of acknowledging for language and technical review work: + + + + + + Rahul Sundaramrahulsundaram@yahoo.co.in + + + + + + + + + + + + + + Before going to details... + +After releasing intraperson beta, I started working on a administration guide that deals with administration aspects of intraPerson. For more details check http://www.intraperson.com. But I was stuck with one simple thing. It is easy to create users in ldap -- at least I think so; but how to create home directories for those users in ldap wherever those ldap accounts are imported? + +I found some solutions But I was not satisfied as every solution has serious drawback attached with it. But after going through autofs documents and hacking little bit, I arrived at conclusion that autofs protocol might offer much better solution to this challenge. + +The result is Autodir, based on the autofs protocol. + + + + +Why not pam_mkhomedir? +PAM module pam_mkhomedir uses Pluggable Authentication Module architecture for its operation. As such, there are some limitations associated with it. For instance: + + +Some servers may not authenticate users but they may expect user directories to exist. This means they do not use PAM, and in turn, pam_mkhomedir does not get a chance to create home directories. The notorious example is on email servers. + +PAM is always an optional component for authentication. Some may not use PAM at all and use a different method to authenticate users. In this case pam_mkhomedir is never going to be used. + +Generally /home is owned by root and only root users can create home directories in it. Therefore the server that wishes to create home directories through PAM must be run as root, or else the home directory must be made similar in permission to /tmp. + + +Finally, Autodir is much wider in scope and supports many more interesting features. + + + + + Where it can be used + + +Where user accounts reside in centralized database like ldap, SQL, NIS, NIS+ or other databases, from which user and groups are imported to other systems. To create, for example home, group directories in those systems which import these accounts from centralized database, on demand. + +To exploit its transparent backup feature for 24*7 online systems. + +It can be also used even when accounts are in a local system, to some extent hiding what accounts exist in /home directory, for example. + + + + + + + What it is not + +Autodir can create directories but it does not remove them once user, group entries are removed from system accounts database. And there may be some more limitations with modules used with Autodir. Check appropriate sections. + + + + + + Differences between Autodir and Autofs + +Now the important issue arises as there is already an autofs package to handle mounts and Autodir is in similar line with the autofs package. + + + +The main purpose of autofs is to deal with network mounts on demand instead of mounting all at the same time, which results in preserving system resources. Though there is some support in the autofs package to mount home directories on demand, the requirement is that these home directories must exist already. + +On the other side, Autodir specializes only in local directory creation and mounting them on demand. + +Autodir can also create real directories in disk file systems such that they do not reside in one single flat base directory. This is how utilities like useradd create by default. In a standard file system setup, all home directories reside in base /home directory. For file systems like ext2, ext3 performance will degrade if large number of home directories exist in single base directory. + + For applications accessing these directories, Autodir presents all directories for them in a single autofs mounted virtual base directory on demand; actual directories are created in subdirectories of some other directory in hierarchical style. + + For example, the real home for a user with uid user1 will be created as /autohome/u/us/user1 if configured that way, but mounted in /home on demand for applications accessing home directory in /home/user1. + +Permissions for real base directory, where actual home directories are kept /autohome in the above example, are kept in such a way that /autohome can not be accessed by anyone except by root. + +This mounting of directories on demand and unmounting when not in use presents an interesting opportunity -- the ability to tell when a directory is in use and when it is not in use. This simply means a program like backup can be started when a directory is unmounted. + +Autodir exploits this capability by starting the command-line mentioned backup whenever a directory becomes unused. + + + +There is one more important issue to be presented if you are an administrator reading this document. Autodir does not call external programs mount and umount, as is the case with the autofs package; rather, it uses system calls directly. As a side effect, it is faster and more reliable, but mtab is not updated. I felt this was not necessary as all mounts and unmounts are local directories. + + + +Another minor difference is that Autodir is completely multi-threaded. Autofs is also expected to be multi-threaded in future versions. + + + + + + + +How it works + +Autodir uses modules to get specific functionality. The core Autodir implements generic functionality on which modules can exploit and add specific functionality of their own. + +At any moment only one module can be added to Autodir. If there are two modules, for example autohome, autogroup, two processes of Autodir should be created so that each process will have required modules attached to it. + +For further explanation I chose the autohome module which handles transparent home directory creation. + + + + + +autohome module creates user home directories on demand if these does not exist already. + +It is assumed user accounts exists but not their home directories. Either because these accounts were created with the -M option with useradd or these accounts were imported from ldap, NIS or some other external database for which home directories are yet to be created. + +It also assumed for this explanation only that all user home directories are expected to be in the /home directory. + + + + +Some fine details are intentionally kept aside to make explanation easy to understand. + +First autofs file system is mounted on /home directory by Autodir. And this is informed to the Linux kernel that /home is managed by user space application Autodir from now on. + +Do not bother too much about autofs file system if you do not understand about it. Just think some special kind of file system something in similarity with memory based file system but with some additional special properties. + + + + +----------------+ + | Linux Kernel | + +----------------+ + / \ + / \ + / \ + / \ + +-------------+ +--------+ +------------+ +-----------------+ + | Application |------>| /home |<----->| Autodir |<------>| autohome module | + +-------------+ +--------+ +------------+ +-----------------+ + \ / + \ +----------------+ / + +-| /autohome |<------------------+ + +----------------+ + + +Whenever an application or daemon needs access to user's home directory, for example /home/userhome1, they directly enter into /home/userhome1 to access it. Kernel which notices this, informs to Autodir if userhome1 directory does not exist already in /home. + +Autodir, in turn, passes this request to autohome module. autohome module does not touch /home directory. Instead it manages real home directories some where else, for example in /autohome as shown in the above figure. + +autohome module creates real home directory if it does not exist already in /autohome directory. After it is successfully created or failed to created, whatever the outcome, it is reported back to Autodir along with the path to real home directory -- if successful. + +If autohome module reports success, Autodir creates userhome1 directory under /home and mounts real home directory from /autohome on it. At the end Autodir informs this to the kernel whether this whole operation successful or failure. Accordingly kernel allows application to enter the directory or reports that no such directory exists, in case of failure, back to the application. + + + + + Some definitions + +Before going further it is better to understand the following terms to simplify explanation. + + + +Virtual directories These directories do not exist on disk. Instead these are created and deleted on demand in memory. If system reboots all these directories vanish. In the previous figure, all directories under /home are virtual directories. + +Virtual base directory This is the directory that holds all Virtual directories. This directory does exist on disk and therefore it remains even after reboot. In the previous figure /home is virtual base directory. + +Real directories These are the directories that actually reside on the disk. Even after reboot, these remain intact. In the previous figure all directories created under /autohome are real directories. + +Real base directory This is the directory that holds all real directories. In the above figure /autohome is real base directory. + + + +Each virtual directory is mapped to real directory. Which means whatever written or modified to virtual directory is actually sent to real directory. + +On reboot of the system real directories and their content remain intact. But virtual directories are again created on demand as exactly as they were before. + +Virtual directories are removed if these are not used for a specified time period and created again if necessary. When Virtual directory is removed backup program is started on corresponding real directory if backup is configured. + +Applications should access only virtual directories. Real directories are hidden from applications except for root. But there is one exception. Backup programs always access only real directories. + + + + +Directory organization under real base directory + +Why special organization under real base directory? If we just create all real directories in one real base directory there could be performance penalty when there are large number of real directories to be created. File systems like ext2/ext3 are not optimized for this kind of flat directory structure. + +It would be much better if real base directory is divided into more subdirectories or even dividing these subdirectories again into more subdirectories. And in the final subdirectories actual home directories are kept! + +There are three types of directory organization. + + + +level 0Actually no organization. All home directories are created directly under real base directory. + +level 1Real base directory is divided into more subdirectories. These subdirectories names are derived from first letter of the final directory to be created. For example, if user1 directory is to be created, first a directory named 'u' is created under real base directory. Then in that subdirectory actual directory user1 created as /<real_base_directory>/u/user1. + +level 2Same as level 1 organization but after first level of subdirectories, second level subdirectories also created. Name for which is derived form starting two letters of the final directory to be created. For example, for user user1 as with the above example, /<real_base_directory>/u/us/user1 is created. + + + + + + +Virtual directory expiration + +When an application tries to access virtual directory in virtual base directory, Autodir creates virtual directory in it if it does not exist already and mounts the real directory on it from real base directory. But once this happens and if this virtual directory is not accessed from virtual base directory for a specified time period by any application, this directory is removed and accordingly that corresponding real directory in real base directory is marked for backup. + +The time period to wait for expiration can be given through command line option to Autodir. + + + + + Backup support + + Autodir supports backup program launching when a virtual directory is removed after a period of inactivity. Removal of virtual directory is itself is an assurance that no other application can access the content and modify it. + +Like there is wait duration for expiring virtual directory, for backup also Autodir waits some more time, after virtual directory expiration, for starting backup. This time period can be configured through command line option to Autodir. + +By design, backup programs are expected to operate on real directory but not on virtual directory. If backup program try to access virtual directory Autodir assumes some regular application is in need of that directory and backup program is killed even if the virtual directory accessing process is backup program itself. + +A separate backup process for each real directory is used. The backup program can be given arguments of real directory on which to operate. + +Backup support is independent of any particular module being used. It is applicable to all modules with Autodir. + +Backup programs should never access virtual directory or virtual base directory. + +Backup feature is not much useful if virtual directories are accessed all the time by applications. + + + + +Backup program requirements + +Autodir demands some extra requirements from backup program being used. The reason for this is that when backup is working on real directory and with corresponding expired virtual directory and that virtual directory is requested again by an application while backup is running, backup is killed. First SIGTERM is sent to gracefully stop it. But if it does not shutdown in time -- one second at this moment; SIGKILL will be sent which is guaranteed to stop the backup. + +When and only when backup stopped, application is given access to the virtual directory requested. + +Whatever backup is used, it should be able to recover from this signal gracefully, not causing unrecoverable side effects. + +One more important issue is that the environment under which it is run. All backup programs are run as root user. But at the same time all unnecessary root privileges are taken away using POSIX capabilities. In other words these backup programs can read any file or directory that belongs to any user on the system and nothing more than that. Other than that it is like ordinary user level process. + + + + +Module options + +There are two kinds of options that can be passed to Autodir. In the first type, options are for autodir itself and are common irrespective of which module is used. There are other type of options which are specific to the module being used. These options called suboptions and are passed to the module being used differently with main option -o. This is similar to mount command suboptions. + +For example, suboptions to the example module autohome can be passed as, + + +-o 'realpath=/tmp/autohome,level=2,noskel' + + +Here realpath, level, noskel are suboptions for autohome module. + + + + +Autodir requirements + + + +Linux kernel equal to or later version of 2.4. These kernel versions support mounting one directory on another directory. At this moment Autodir is not ported to other Unices but this may change in future. + + + +Autodir requires autofs kernel module based on protocol version 4. But it does not require autofs user level package. Autofs kernel module is pretty standard and almost all distributions include it. + + + + + + + +Loading autofs kernel module + +Autodir uses autofs kernel module for its operation. Kernel module autofs4 must be loaded before even starting autodir for its proper operation. + +This can be done as root user and using modprobe. But first old autofs module, if it is already loaded must be removed as, + + +# rmmod autofs + + +Now insert autofs4 module as, + + +# modprobe autofs4 + + +Latest versions of Autodir switched to autofs4 kernel module from older autofs module. + + + + +Importing user and group accounts +If user and group accounts reside in centralized database these must be imported before starting Autodir. How to do this is out of scope of this HOWTO. But there are number of documents which explain how to do this in clear manner. + + + + Getting it + +At this moment Autodir available in tar, rpm formats. More information can be found at http://www.intraperson.com/autodir/. + +If source is downloaded, follow these simple steps to install it. + + + + +Unpack the source. +$ tar zxvf <tar file name> + + + +Move to the expanded directory and execute the following. +$ ./configure +$ make +# make install + + + + +configure script check for required libraries. If these are not present it will stop from proceeding. + + + + +Managing Home directories + +This section will explain how to configure Autodir so that user home directories are created on demand. For this purpose autohome module is used which deals with specifics of home directory creation. + +To load autohome module with Autodir, use option -m. For example, -m /usr/lib/autodir/autohome.so. + +When an application tries to access home directory, that home directory is used to check if there is any user with user name same as the directory being accessed. If user name exist with this criteria then home directory is created. Otherwise no such file or directory is reported back to application. + +autohome does not deal with creating user accounts on local systems or in ldap or in any other database. It only deals with creating home directories once these accounts exist and imported to local system from databases like ldap, NIS. + +It is worth mentioning one limitation with autohome module. It expects that user name and home directory are related to each other. For example, for user user1 the home directory should be /home/user1 or /some/directory/name/user1 but not /some/directory/name/userhome1. This can be supported but it will be burden on system resources as each password entry has to be examined from first to last. + +If the existing user password database is such that user home directories are distributed under different base directories, for example /home/class1/user1, /home/class2/user2332, then autohome configuration becomes complicated and it is not recommended. + + +Base directories for autohome + +Next step in setup is to decide where will be virtual base directory and real base directory for home directory creation. + +What is virtual base directory and what is real base directory in the context of autohome module? + +It all depends on how user accounts are created. If an user account created for user name user1 with home directory /home/user1 then /home will become virtual base directory. + +Then what is real base directory? It can be any directory. Only thing that must be kept in mind is, there should be enough space as all actual files are stored here instead of in virtual base directory. + +In most server configurations /home is a separate partition mounted on it. But if /home is made virtual base directory files are not stored in that directory! The solution is, do not mount partition on /home but instead mount it under somewhere else and make it real base directory. + +Autodir option -d is used to specify virtual base directory. For example autodir -d /home assuming /home is virtual base directory. + +It is little tricky to specify real base directory. real base directory is managed by autohome module so this option must be passed to the module through module suboptions. If the real base directory is /var/autohome then it is specified with option -o as -o realpath=/var/autohome. + + + + +Directory organization + +Please refer to directory organization under real base directory for detailed explanation of this topic. + +autohome does support this kind of organization. The suboption used to specify directory organization desired, is with level suboption. For example, -o level=2. + + + + + Misc suboptions for autohome + +Suboption skel can be used if skeleton path is not default value /etc/skel like -o skel=/some/other/dir. + +Suboption noskel can be used with -o to indicate not to copy skeleton files to home directories when created. + + + + +Summing up with an example + +First, import user accounts from centralized database like, for example, ldap. + +Next, autofs kernel module must be loaded into the Linux kernel. This can be done as described in loading autofs kernel module section. + +If /home is to be used for home directories then /home will become virtual directory and specified to autodir with -d /home option. + +Assuming autohome module is located at /usr/lib/autodir/autohome.so, this module can be loaded with autodir as -m /usr/lib/autodir/autohome.so. Note that full path for module is given. + +Where actually real home directories reside is given with realpath suboption. If it is /autohome, it can be given as realpath=/autohome. + +With all these options autodir can be started as, + + +# autodir -d /home \ + -m /usr/lib/autodir/autohome.so \ + -o 'realpath=/autohome' \ + + +Once Autodir is started, /home directory will be blank in the beginning. Whether Autodir working properly or not can be tested by changing directory to one of the home directories as root user or as the owner of the home directory. + + + + + + +Managing group directories + +autogroup module is for creating group directories on demand for common group access. It can be used with Samba, for example, to dynamically create shared directories for group of people. + +autogroup module check for requested directory with valid groups from system group database. + +autogroup can be used to create home directories as well, provided that there exists user private group for each user. This way all group and home directories can be created at one place with one module. But no skeleton files are copied and the autogroup suboption nopriv should not be used. + +autogroup configuration is same as autohome module but unlike autohome, virtual base directory can be placed anywhere and any name can be given to it. It is not dictated by system accounts. + +The module autogroup can be used with Autodir using option -m. For example, -m /usr/lib/autodir/autogroup.so. + +All suboptions explained in managing home directories are same for autogroup except skel, noskel as these are meaningless for autogroup module. But there are other suboptions specific for autogroup. These are given below. + + + +noprivSome Linux installations use user private groups. If directories for these groups are not to be created, then use this suboption. + + + + + + + Autodir options + +In this section some of the options to Autodir are explained. Backup options are explained in backup section. + + + +-dFor specifying virtual base directory. If this path does not exist, it will be created. Absolute path is expected for this option. + +-tExpiration timeout for virtual directories. For more details refer to virtual directory expiration. + +-mModule to be used with Autodir. Currently autohome and autogroup are available. Full path to the module expected. + +-oAll suboptions that are to be passed to module are given here. This option passing syntax is similar to mount command with its -o option. See specific module sections for more info. + +-fStay foreground and log all messages to the console. For debugging purpose and to see how Autodir works. + +-lThis option expects path name to filename to which Autodir will write its process id. + +-hHelp about all options supported by Autodir. + +-vVersion information about Autodir. + + + + + + + +Backup options + +These options are passed to Autodir to request backup support. + + + +-bThis is the main option to specify backup program path and arguments to it. The path given should be absolute path otherwise Autodir does not accept it. + +-wWhenever a virtual directory is not used for a period of time, it is assumed inactive and it is unmounted. After unmounting directory, whether to launch backup immediately or to wait some more time is decided with this option. It takes arguments in seconds. It is the minimum time to wait before starting backup after virtual directory expiration. It should not exceed more then one day. + +-pThis is the priority to be given to backup process. This is in the range of 1 to 40 inclusive. Lower value mean higher priority and vice versa. Default value is 30. + +-cThis restricts maximum number of backup process at any given time. Default is 150. + + +Argument for -b is inclusive of absolute backup program path as well as its own arguments. Therefore it is recommended to use single quotes around this argument + +Option -b takes path to executable file as well as arguments to it. But the arguments to it are interpreted for %x character sequences and replaced with predefined strings as follows. + + + +%NReplaced with virtual directory name. + +%LReplaced with absolute path to real directory. + +%KReplaced with host name. + +OthersOthers are fed to strftime. See man page for strftime for more information. + + + + + + +Examples + +# autodir -d /home \ + -m /usr/lib/autodir/autohome.so \ + -t 1000 \ + -f \ + -o 'realpath=/autohome,level=1,skel=/etc/skel' \ + -l /var/run/autodir.pid + + + +# autodir -d /home \ + -m /usr/lib/autodir/autohome.so \ + -t 300 \ + -b '/bin/tar cf /tmp/%N%F.tar %L' \ + -w 600 \ + -o 'realpath=/tmp/autohome,level=2,noskel' \ + -l /var/run/autodir.pid + + + +# autodir -d /var/abase/ \ + -m /usr/lib/autodir/autogroup.so \ + -t 300 \ + -b '/bin/tar cf /tmp/%N%F.tar %L' \ + -w 86400 \ + -o 'nopriv,nosetgid,realpath=/var/realbase,level=0' + + + + + + RPM specific + +Autodir can be installed from rpms as, + +# rpm -ivh autodir-0.28-4.i386.rpm + + +When installed from rpms, two startup scripts are provided namely /etc/rc.d/init.d/autohome and /etc/rc.d/init.d/autogroup. One for starting Autodir with autohome module and another for starting with autogroup module. + +Script configuration files /etc/sysconfig/autohome, /etc/sysconfig/autogroup can be used to specify what options can be passed to Autodir. + + + + + Further Information + +Mailing list for autodir http://lists.sourceforge.net/mailman/listinfo/intraperson-autodir. + +Official website is at http://www.intraperson.com/autodir/. + +Autofs mailing list http://linux.kernel.org/mailman/listinfo/autofs. + +Automount HOWTO can be found at http://www.tldp.org + +Autofs Hacking http://www.goop.org/~jeremy/autofs. + + + +
+ --- autodir-0.99.9.orig/debian/README.Debian +++ autodir-0.99.9/debian/README.Debian @@ -0,0 +1,22 @@ +autodir for Debian +------------------ + +Autodir requires a phisical path on a disk volume to be used for creating users directory. +That is typically /autohome or something else, where it will create a complete gerarchy +of directories for all users. Autofs is then used to mount on a virtual path (e.g. /home) +each user or group home. Both them are a choice of the administrator, so autodir +comes unconfigured just after installation. + +Please, configure /etc/default/autodir in order to use the program, you will tipically have +to move in advance current contents of e.g. /home/someone directory under /autohome/s/so/someone +for every user 'someone', but that's definitively your choice. +The init script used in this package is Debian specific, so please do not bother autodir author +with report about possible bugs. + +Also ensure to have your accounting system (system passwd, LDAP, SQL, NIS or what else) +up and running and home paths coherent with your previous choices. The program requires +also version 4 of autofs, it doesn't work with previous one! The required module is +loaded automagically at startup if available, or you need to have it compiled in +statically in your kernel. + + -- Francesco Paolo Lovergine , Tue, 17 Jan 2006 15:20:06 +0100 --- autodir-0.99.9.orig/debian/Autodir-HOWTO.html +++ autodir-0.99.9/debian/Autodir-HOWTO.html @@ -0,0 +1,81 @@ +Autodir HOWTO

Autodir HOWTO

Venkata Ramana Enaganti

2004-09-23

Revision History
Revision 1.022004-12-25VRE
Minor updates
Revision 1.002004-09-23VRE
Initial release, reviewed by Rahul Sundaram at TLDP
Revision 0.322004-09-13VRE
New sections like requirements and others.
Revision 0.102004-06-24VRE
second draft
Revision 0.92004-06-11VRE
first draft

Abstract

+ This HOWTO is about Autodir installation, configuration and other issues related to Autodir. +


Introduction

Autodir offers a simple and effective means to create directories like home directories in a transparent manner. It relies on the autofs protocol for its operation.

This document explains how to create directories on demand using Autodir in a transparent way to the applications. This document also explains using transparent backup feature that is possible with Autodir without bringing system down for backup purpose for all directories managed by Autodir.

Copyright and License

+ This document, Autodir HOWTO, + is copyrighted (c) 2004 by Venkata Ramana Enaganti. + +This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + +

+ Linux is a registered trademark of Linus Torvalds. +

Disclaimer

+ No liability for the contents of this document can be accepted. + Use the concepts, examples and information at your own risk. + There may be errors and inaccuracies, that could be damaging to + your system. Proceed with caution, and although this is highly + unlikely, the author(s) do not take any responsibility. +

+ All copyrights are held by their by their respective owners, + unless specifically noted otherwise. Use of a term in this + document should not be regarded as affecting the validity of any + trademark or service mark. Naming of particular products or + brands should not be seen as endorsements. +

Feedback

+ Feedback is most certainly welcome for this document. Send + your additions, comments and criticisms to the following + email address : . +

New Versions of this Document

The latest version of this HOWTO will be made available from http://www.intraperson.com/autodir/.

Credits / Contributors

+ In this document, I have the pleasure of acknowledging for language and technical review work: +

Before going to details...

After releasing intraperson beta, I started working on a administration guide that deals with administration aspects of intraPerson. For more details check http://www.intraperson.com. But I was stuck with one simple thing. It is easy to create users in ldap -- at least I think so; but how to create home directories for those users in ldap wherever those ldap accounts are imported?

I found some solutions But I was not satisfied as every solution has serious drawback attached with it. But after going through autofs documents and hacking little bit, I arrived at conclusion that autofs protocol might offer much better solution to this challenge.

The result is Autodir, based on the autofs protocol.

Why not pam_mkhomedir?

PAM module pam_mkhomedir uses Pluggable Authentication Module architecture for its operation. As such, there are some limitations associated with it. For instance:

  • Some servers may not authenticate users but they may expect user directories to exist. This means they do not use PAM, and in turn, pam_mkhomedir does not get a chance to create home directories. The notorious example is on email servers.

  • PAM is always an optional component for authentication. Some may not use PAM at all and use a different method to authenticate users. In this case pam_mkhomedir is never going to be used.

  • Generally /home is owned by root and only root users can create home directories in it. Therefore the server that wishes to create home directories through PAM must be run as root, or else the home directory must be made similar in permission to /tmp.

Finally, Autodir is much wider in scope and supports many more interesting features.

Where it can be used

  • Where user accounts reside in centralized database like ldap, SQL, NIS, NIS+ or other databases, from which user and groups are imported to other systems. To create, for example home, group directories in those systems which import these accounts from centralized database, on demand.

  • To exploit its transparent backup feature for 24*7 online systems.

  • It can be also used even when accounts are in a local system, to some extent hiding what accounts exist in /home directory, for example.

What it is not

Autodir can create directories but it does not remove them once user, group entries are removed from system accounts database. And there may be some more limitations with modules used with Autodir. Check appropriate sections.

Differences between Autodir and Autofs

Now the important issue arises as there is already an autofs package to handle mounts and Autodir is in similar line with the autofs package.

  • The main purpose of autofs is to deal with network mounts on demand instead of mounting all at the same time, which results in preserving system resources. Though there is some support in the autofs package to mount home directories on demand, the requirement is that these home directories must exist already.

    On the other side, Autodir specializes only in local directory creation and mounting them on demand.

    Autodir can also create real directories in disk file systems such that they do not reside in one single flat base directory. This is how utilities like useradd create by default. In a standard file system setup, all home directories reside in base /home directory. For file systems like ext2, ext3 performance will degrade if large number of home directories exist in single base directory.

    For applications accessing these directories, Autodir presents all directories for them in a single autofs mounted virtual base directory on demand; actual directories are created in subdirectories of some other directory in hierarchical style.

    For example, the real home for a user with uid user1 will be created as /autohome/u/us/user1 if configured that way, but mounted in /home on demand for applications accessing home directory in /home/user1.

    Permissions for real base directory, where actual home directories are kept /autohome in the above example, are kept in such a way that /autohome can not be accessed by anyone except by root.

    This mounting of directories on demand and unmounting when not in use presents an interesting opportunity -- the ability to tell when a directory is in use and when it is not in use. This simply means a program like backup can be started when a directory is unmounted.

    Autodir exploits this capability by starting the command-line mentioned backup whenever a directory becomes unused.

  • There is one more important issue to be presented if you are an administrator reading this document. Autodir does not call external programs mount and umount, as is the case with the autofs package; rather, it uses system calls directly. As a side effect, it is faster and more reliable, but mtab is not updated. I felt this was not necessary as all mounts and unmounts are local directories.

  • Another minor difference is that Autodir is completely multi-threaded. Autofs is also expected to be multi-threaded in future versions.

How it works

Autodir uses modules to get specific functionality. The core Autodir implements generic functionality on which modules can exploit and add specific functionality of their own.

At any moment only one module can be added to Autodir. If there are two modules, for example autohome, autogroup, two processes of Autodir should be created so that each process will have required modules attached to it.

For further explanation I chose the autohome module which handles transparent home directory creation.

Note

  • autohome module creates user home directories on demand if these does not exist already.

  • It is assumed user accounts exists but not their home directories. Either because these accounts were created with the -M option with useradd or these accounts were imported from ldap, NIS or some other external database for which home directories are yet to be created.

  • It also assumed for this explanation only that all user home directories are expected to be in the /home directory.

Note

Some fine details are intentionally kept aside to make explanation easy to understand.

First autofs file system is mounted on /home directory by Autodir. And this is informed to the Linux kernel that /home is managed by user space application Autodir from now on.

Note

Do not bother too much about autofs file system if you do not understand about it. Just think some special kind of file system something in similarity with memory based file system but with some additional special properties.
+
+                                +----------------+
+                                |  Linux Kernel  |
+                                +----------------+
+                                  /        \
+                                 /          \
+                                /            \
+                               /              \
+   +-------------+       +--------+       +------------+        +-----------------+
+   | Application |------>| /home  |<----->|  Autodir   |<------>| autohome module |
+   +-------------+       +--------+       +------------+        +-----------------+
+                              \                                          /
+                               \  +----------------+                    /
+                                +-|   /autohome    |<------------------+
+                                  +----------------+
+

Whenever an application or daemon needs access to user's home directory, for example /home/userhome1, they directly enter into /home/userhome1 to access it. Kernel which notices this, informs to Autodir if userhome1 directory does not exist already in /home.

Autodir, in turn, passes this request to autohome module. autohome module does not touch /home directory. Instead it manages real home directories some where else, for example in /autohome as shown in the above figure.

autohome module creates real home directory if it does not exist already in /autohome directory. After it is successfully created or failed to created, whatever the outcome, it is reported back to Autodir along with the path to real home directory -- if successful.

If autohome module reports success, Autodir creates userhome1 directory under /home and mounts real home directory from /autohome on it. At the end Autodir informs this to the kernel whether this whole operation successful or failure. Accordingly kernel allows application to enter the directory or reports that no such directory exists, in case of failure, back to the application.

Some definitions

Before going further it is better to understand the following terms to simplify explanation.

Virtual directories

These directories do not exist on disk. Instead these are created and deleted on demand in memory. If system reboots all these directories vanish. In the previous figure, all directories under /home are virtual directories.

Virtual base directory

This is the directory that holds all Virtual directories. This directory does exist on disk and therefore it remains even after reboot. In the previous figure /home is virtual base directory.

Real directories

These are the directories that actually reside on the disk. Even after reboot, these remain intact. In the previous figure all directories created under /autohome are real directories.

Real base directory

This is the directory that holds all real directories. In the above figure /autohome is real base directory.

Each virtual directory is mapped to real directory. Which means whatever written or modified to virtual directory is actually sent to real directory.

On reboot of the system real directories and their content remain intact. But virtual directories are again created on demand as exactly as they were before.

Virtual directories are removed if these are not used for a specified time period and created again if necessary. When Virtual directory is removed backup program is started on corresponding real directory if backup is configured.

Important

Applications should access only virtual directories. Real directories are hidden from applications except for root. But there is one exception. Backup programs always access only real directories.

Directory organization under real base directory

Why special organization under real base directory? If we just create all real directories in one real base directory there could be performance penalty when there are large number of real directories to be created. File systems like ext2/ext3 are not optimized for this kind of flat directory structure.

It would be much better if real base directory is divided into more subdirectories or even dividing these subdirectories again into more subdirectories. And in the final subdirectories actual home directories are kept!

There are three types of directory organization.

level 0

Actually no organization. All home directories are created directly under real base directory.

level 1

Real base directory is divided into more subdirectories. These subdirectories names are derived from first letter of the final directory to be created. For example, if user1 directory is to be created, first a directory named 'u' is created under real base directory. Then in that subdirectory actual directory user1 created as /<real_base_directory>/u/user1.

level 2

Same as level 1 organization but after first level of subdirectories, second level subdirectories also created. Name for which is derived form starting two letters of the final directory to be created. For example, for user user1 as with the above example, /<real_base_directory>/u/us/user1 is created.

Virtual directory expiration

When an application tries to access virtual directory in virtual base directory, Autodir creates virtual directory in it if it does not exist already and mounts the real directory on it from real base directory. But once this happens and if this virtual directory is not accessed from virtual base directory for a specified time period by any application, this directory is removed and accordingly that corresponding real directory in real base directory is marked for backup.

The time period to wait for expiration can be given through command line option to Autodir.

Backup support

Autodir supports backup program launching when a virtual directory is removed after a period of inactivity. Removal of virtual directory is itself is an assurance that no other application can access the content and modify it.

Like there is wait duration for expiring virtual directory, for backup also Autodir waits some more time, after virtual directory expiration, for starting backup. This time period can be configured through command line option to Autodir.

By design, backup programs are expected to operate on real directory but not on virtual directory. If backup program try to access virtual directory Autodir assumes some regular application is in need of that directory and backup program is killed even if the virtual directory accessing process is backup program itself.

A separate backup process for each real directory is used. The backup program can be given arguments of real directory on which to operate.

Note

Backup support is independent of any particular module being used. It is applicable to all modules with Autodir.

Important

Backup programs should never access virtual directory or virtual base directory.

Caution

Backup feature is not much useful if virtual directories are accessed all the time by applications.

Backup program requirements

Autodir demands some extra requirements from backup program being used. The reason for this is that when backup is working on real directory and with corresponding expired virtual directory and that virtual directory is requested again by an application while backup is running, backup is killed. First SIGTERM is sent to gracefully stop it. But if it does not shutdown in time -- one second at this moment; SIGKILL will be sent which is guaranteed to stop the backup.

Note

When and only when backup stopped, application is given access to the virtual directory requested.

Important

Whatever backup is used, it should be able to recover from this signal gracefully, not causing unrecoverable side effects.

One more important issue is that the environment under which it is run. All backup programs are run as root user. But at the same time all unnecessary root privileges are taken away using POSIX capabilities. In other words these backup programs can read any file or directory that belongs to any user on the system and nothing more than that. Other than that it is like ordinary user level process.

Module options

There are two kinds of options that can be passed to Autodir. In the first type, options are for autodir itself and are common irrespective of which module is used. There are other type of options which are specific to the module being used. These options called suboptions and are passed to the module being used differently with main option -o. This is similar to mount command suboptions.

For example, suboptions to the example module autohome can be passed as,

+-o 'realpath=/tmp/autohome,level=2,noskel'
+

Here realpath, level, noskel are suboptions for autohome module.

Autodir requirements

  • Linux kernel equal to or later version of 2.4. These kernel versions support mounting one directory on another directory. At this moment Autodir is not ported to other Unices but this may change in future.

  • Autodir requires autofs kernel module based on protocol version 4. But it does not require autofs user level package. Autofs kernel module is pretty standard and almost all distributions include it.

Loading autofs kernel module

Autodir uses autofs kernel module for its operation. Kernel module autofs4 must be loaded before even starting autodir for its proper operation.

This can be done as root user and using modprobe. But first old autofs module, if it is already loaded must be removed as,

+# rmmod autofs
+

Now insert autofs4 module as,

+# modprobe autofs4
+

Important

Latest versions of Autodir switched to autofs4 kernel module from older autofs module.

Importing user and group accounts

If user and group accounts reside in centralized database these must be imported before starting Autodir. How to do this is out of scope of this HOWTO. But there are number of documents which explain how to do this in clear manner.

Getting it

At this moment Autodir available in tar, rpm formats. More information can be found at http://www.intraperson.com/autodir/.

If source is downloaded, follow these simple steps to install it.

  • Unpack the source.

    $ tar zxvf <tar file name>

  • Move to the expanded directory and execute the following.

    $ ./configure

    $ make

    # make install

Note

configure script check for required libraries. If these are not present it will stop from proceeding.

Managing Home directories

This section will explain how to configure Autodir so that user home directories are created on demand. For this purpose autohome module is used which deals with specifics of home directory creation.

To load autohome module with Autodir, use option -m. For example, -m /usr/lib/autodir/autohome.so.

Note

When an application tries to access home directory, that home directory is used to check if there is any user with user name same as the directory being accessed. If user name exist with this criteria then home directory is created. Otherwise no such file or directory is reported back to application.

Note

autohome does not deal with creating user accounts on local systems or in ldap or in any other database. It only deals with creating home directories once these accounts exist and imported to local system from databases like ldap, NIS.

Important

It is worth mentioning one limitation with autohome module. It expects that user name and home directory are related to each other. For example, for user user1 the home directory should be /home/user1 or /some/directory/name/user1 but not /some/directory/name/userhome1. This can be supported but it will be burden on system resources as each password entry has to be examined from first to last.

Note

If the existing user password database is such that user home directories are distributed under different base directories, for example /home/class1/user1, /home/class2/user2332, then autohome configuration becomes complicated and it is not recommended.

Base directories for autohome

Next step in setup is to decide where will be virtual base directory and real base directory for home directory creation.

What is virtual base directory and what is real base directory in the context of autohome module?

It all depends on how user accounts are created. If an user account created for user name user1 with home directory /home/user1 then /home will become virtual base directory.

Then what is real base directory? It can be any directory. Only thing that must be kept in mind is, there should be enough space as all actual files are stored here instead of in virtual base directory.

In most server configurations /home is a separate partition mounted on it. But if /home is made virtual base directory files are not stored in that directory! The solution is, do not mount partition on /home but instead mount it under somewhere else and make it real base directory.

Autodir option -d is used to specify virtual base directory. For example autodir -d /home assuming /home is virtual base directory.

It is little tricky to specify real base directory. real base directory is managed by autohome module so this option must be passed to the module through module suboptions. If the real base directory is /var/autohome then it is specified with option -o as -o realpath=/var/autohome.

Directory organization

Please refer to directory organization under real base directory for detailed explanation of this topic.

autohome does support this kind of organization. The suboption used to specify directory organization desired, is with level suboption. For example, -o level=2.

Misc suboptions for autohome

Suboption skel can be used if skeleton path is not default value /etc/skel like -o skel=/some/other/dir.

Suboption noskel can be used with -o to indicate not to copy skeleton files to home directories when created.

Summing up with an example

First, import user accounts from centralized database like, for example, ldap.

Next, autofs kernel module must be loaded into the Linux kernel. This can be done as described in loading autofs kernel module section.

If /home is to be used for home directories then /home will become virtual directory and specified to autodir with -d /home option.

Assuming autohome module is located at /usr/lib/autodir/autohome.so, this module can be loaded with autodir as -m /usr/lib/autodir/autohome.so. Note that full path for module is given.

Where actually real home directories reside is given with realpath suboption. If it is /autohome, it can be given as realpath=/autohome.

With all these options autodir can be started as,

+# autodir -d /home 						\
+		-m /usr/lib/autodir/autohome.so 		\
+		-o 'realpath=/autohome'			 	\
+

Once Autodir is started, /home directory will be blank in the beginning. Whether Autodir working properly or not can be tested by changing directory to one of the home directories as root user or as the owner of the home directory.

Managing group directories

autogroup module is for creating group directories on demand for common group access. It can be used with Samba, for example, to dynamically create shared directories for group of people.

Note

autogroup module check for requested directory with valid groups from system group database.

Tip

autogroup can be used to create home directories as well, provided that there exists user private group for each user. This way all group and home directories can be created at one place with one module. But no skeleton files are copied and the autogroup suboption nopriv should not be used.

autogroup configuration is same as autohome module but unlike autohome, virtual base directory can be placed anywhere and any name can be given to it. It is not dictated by system accounts.

The module autogroup can be used with Autodir using option -m. For example, -m /usr/lib/autodir/autogroup.so.

All suboptions explained in managing home directories are same for autogroup except skel, noskel as these are meaningless for autogroup module. But there are other suboptions specific for autogroup. These are given below.

nopriv

Some Linux installations use user private groups. If directories for these groups are not to be created, then use this suboption.

Autodir options

In this section some of the options to Autodir are explained. Backup options are explained in backup section.

-d

For specifying virtual base directory. If this path does not exist, it will be created. Absolute path is expected for this option.

-t

Expiration timeout for virtual directories. For more details refer to virtual directory expiration.

-m

Module to be used with Autodir. Currently autohome and autogroup are available. Full path to the module expected.

-o

All suboptions that are to be passed to module are given here. This option passing syntax is similar to mount command with its -o option. See specific module sections for more info.

-f

Stay foreground and log all messages to the console. For debugging purpose and to see how Autodir works.

-l

This option expects path name to filename to which Autodir will write its process id.

-h

Help about all options supported by Autodir.

-v

Version information about Autodir.

Backup options

These options are passed to Autodir to request backup support.

-b

This is the main option to specify backup program path and arguments to it. The path given should be absolute path otherwise Autodir does not accept it.

-w

Whenever a virtual directory is not used for a period of time, it is assumed inactive and it is unmounted. After unmounting directory, whether to launch backup immediately or to wait some more time is decided with this option. It takes arguments in seconds. It is the minimum time to wait before starting backup after virtual directory expiration. It should not exceed more then one day.

-p

This is the priority to be given to backup process. This is in the range of 1 to 40 inclusive. Lower value mean higher priority and vice versa. Default value is 30.

-c

This restricts maximum number of backup process at any given time. Default is 150.

Caution

Argument for -b is inclusive of absolute backup program path as well as its own arguments. Therefore it is recommended to use single quotes around this argument

Option -b takes path to executable file as well as arguments to it. But the arguments to it are interpreted for %x character sequences and replaced with predefined strings as follows.

%N

Replaced with virtual directory name.

%L

Replaced with absolute path to real directory.

%K

Replaced with host name.

Others

Others are fed to strftime. See man page for strftime for more information.

Examples

+# autodir -d /home 						\
+		-m /usr/lib/autodir/autohome.so 		\
+		-t 1000						\
+		-f 						\
+		-o 'realpath=/autohome,level=1,skel=/etc/skel' 	\
+		-l /var/run/autodir.pid
+
+# autodir -d /home						\
+		-m /usr/lib/autodir/autohome.so			\
+		-t 300						\
+		-b '/bin/tar cf /tmp/%N%F.tar %L'		\
+		-w 600						\
+		-o 'realpath=/tmp/autohome,level=2,noskel'	\
+		-l /var/run/autodir.pid
+
+# autodir -d /var/abase/ 					\
+		-m /usr/lib/autodir/autogroup.so		\
+		-t 300						\
+		-b '/bin/tar cf /tmp/%N%F.tar %L'		\
+		-w 86400					\
+		-o 'nopriv,nosetgid,realpath=/var/realbase,level=0' 
+

RPM specific

Autodir can be installed from rpms as,

+# rpm -ivh autodir-0.28-4.i386.rpm
+

When installed from rpms, two startup scripts are provided namely /etc/rc.d/init.d/autohome and /etc/rc.d/init.d/autogroup. One for starting Autodir with autohome module and another for starting with autogroup module.

Script configuration files /etc/sysconfig/autohome, /etc/sysconfig/autogroup can be used to specify what options can be passed to Autodir.

Further Information

Mailing list for autodir http://lists.sourceforge.net/mailman/listinfo/intraperson-autodir.

Official website is at http://www.intraperson.com/autodir/.

Autofs mailing list http://linux.kernel.org/mailman/listinfo/autofs.

Automount HOWTO can be found at http://www.tldp.org

Autofs Hacking http://www.goop.org/~jeremy/autofs.

--- autodir-0.99.9.orig/debian/postinst +++ autodir-0.99.9/debian/postinst @@ -0,0 +1,44 @@ +#! /bin/sh +# postinst script for autodir +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +PACKAGE=autodir +INIT=/etc/init.d/$PACKAGE + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- autodir-0.99.9.orig/debian/autodir.init +++ autodir-0.99.9/debian/autodir.init @@ -0,0 +1,149 @@ +#!/bin/bash +# +# autodir - Init script used to run autodir on Debian +# This is written starting from the script provided by +# autodir upstream for general use. +# +# Copyright (C) 2005 Francesco P. Lovergine +# +# 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 +# +# On Debian the license is available in /usr/share/common-license/GPL +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/autodir +NAME=autodir +DESC=Autodir + + +[ -x $DAEMON ] || exit 0 + +RUN_AUTOHOME="no" +RUN_AUTOGROUP="no" + +# Include autodir defaults if available +[ -r /etc/default/autodir ] && . /etc/default/autodir + +AUTOHOME_PID=/var/run/autohome.pid +AUTOGROUP_PID=/var/run/autogroup.pid +AUTOHOME_LOCK=/var/lock/autodir/autohome +AUTOGROUP_LOCK=/var/lock/autodir/autogroup + +log_daemon_msg() { + echo -n "$1: $2" +} + +log_end_msg() { + if [ $1 -ne 0 ]; then + echo " failed!" + else + echo "." + fi +} + +# Make sure the autofs filesystem type is available. +load_autofs() { + (grep -q autofs /proc/filesystems || /sbin/modprobe -k autofs4 || /sbin/modprobe -k autofs) 2>/dev/null +} + +run_autohome() { + RETVAL=0 + if [ "$RUN_AUTOHOME" = "yes" ]; then + load_autofs + start-stop-daemon --start --quiet --pidfile $AUTOHOME_PID --exec $DAEMON -- \ + -d $AUTOHOME_HOME -m $AUTOHOME_MODULE \ + ${AUTOHOME_OPTIONS+ -o $AUTOHOME_OPTIONS} \ + ${AUTOHOME_TIMEOUT+ -t $AUTOHOME_TIMEOUT} \ + ${AUTOHOME_BACKUP+ -b $AUTOHOME_BACKUP} \ + ${AUTOHOME_BACKWAIT+ -w $AUTOHOME_BACKWAIT} \ + ${AUTOHOME_BACKPRI+ -p $AUTOHOME_BACKPRI} \ + ${AUTOHOME_MAXBACK+ -c $AUTOHOME_MAXBACK} \ + -l $AUTOHOME_PID 2>/dev/null + RETVAL=$? + [ $RETVAL -eq 0 ] && touch $AUTOHOME_LOCK + fi + return $RETVAL +} + +kill_autohome() { + RETVAL=0 + if [ -r $AUTOHOME_PID ]; then + start-stop-daemon --stop --quiet --pidfile $AUTOHOME_PID --exec $DAEMON + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f $AUTOHOME_LOCK + fi + return $RETVAL +} + +run_autogroup() { + RETVAL=0 + if [ "$RUN_AUTOGROUP" = "yes" ]; then + load_autofs + start-stop-daemon --start --quiet --pidfile $AUTOGROUP_PID --exec $DAEMON -- \ + -d $AUTOGROUP_HOME -m $AUTOGROUP_MODULE \ + ${AUTOGROUP_OPTIONS+ -o $AUTOGROUP_OPTIONS} \ + ${AUTOGROUP_TIMEOUT+ -t $AUTOGROUP_TIMEOUT} \ + ${AUTOGROUP_BACKUP+ -b $AUTOGROUP_BACKUP} \ + ${AUTOGROUP_BACKWAIT+ -w $AUTOGROUP_BACKWAIT} \ + ${AUTOGROUP_BACKPRI+ -p $AUTOGROUP_BACKPRI} \ + ${AUTOGROUP_MAXBACK+ -c $AUTOGROUP_MAXBACK} \ + -l $AUTOGROUP_PID 2>/dev/null + RETVAL=$? + [ $RETVAL -eq 0 ] && touch $AUTOGROUP_LOCK + fi + return $RETVAL +} + +kill_autogroup() { + RETVAL=0 + if [ -r $AUTOGROUP_PID ]; then + start-stop-daemon --stop --quiet --pidfile $AUTOGROUP_PID --exec $DAEMON + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f $AUTOGROUP_LOCK + fi + return $RETVAL +} + +[ -r /lib/lsb/init-functions ] && . /lib/lsb/init-functions + +set -e + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + run_autohome && run_autogroup + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + kill_autohome && kill_autogroup + log_end_msg $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + kill_autohome && kill_autogroup + sleep 1 + run_autohome && run_autogroup + log_end_msg $? + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- autodir-0.99.9.orig/debian/dirs +++ autodir-0.99.9/debian/dirs @@ -0,0 +1,3 @@ +usr/sbin +usr/lib/autodir +var/lock/autodir --- autodir-0.99.9.orig/debian/postrm +++ autodir-0.99.9/debian/postrm @@ -0,0 +1,40 @@ +#! /bin/sh +# postrm script for autodir +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +PACKAGE=autodir + +case "$1" in + purge) + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- autodir-0.99.9.orig/debian/rules +++ autodir-0.99.9/debian/rules @@ -0,0 +1,82 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +# +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: configure + dh_testdir + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + + +build: build-stamp + +build-stamp: config.status + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + -$(MAKE) distclean +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install DESTDIR=$(CURDIR)/debian/autodir + ( cd $(CURDIR)/debian/autodir/usr/lib/autodir && rm -rf *.a *.la ) + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installinit + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- autodir-0.99.9.orig/debian/changelog +++ autodir-0.99.9/debian/changelog @@ -0,0 +1,90 @@ +autodir (0.99.9-2ubuntu1) jaunty; urgency=low + + * Merge from Debian unstable, remaining Ubuntu changes: + - Build-depend on libltdl7-dev. + + -- Luca Falavigna Tue, 04 Nov 2008 20:34:08 +0100 + +autodir (0.99.9-2) unstable; urgency=low + + * New upload to force a rebuild. + (closes: #494271) + + -- Francesco Paolo Lovergine Thu, 04 Sep 2008 09:42:42 +0200 + +autodir (0.99.9-1ubuntu1) intrepid; urgency=low + + * Build-depend on libltdl7-dev. + + -- Luca Falavigna Sat, 13 Sep 2008 13:52:36 +0200 + +autodir (0.99.9-1) unstable; urgency=low + + * New upstream release. + (closes: #407099) + * Watch file revised. + * Still using internal auto_fs4.h version instead of distributed one. + + -- Francesco Paolo Lovergine Sun, 22 Apr 2007 10:40:21 +0200 + +autodir (0.99.8-2) unstable; urgency=low + + * Ian Kent's patch for current autofs_4.h merged instead of using the old auto_fs4.h locally + + -- Francesco Paolo Lovergine Tue, 12 Dec 2006 09:51:16 +0100 + +autodir (0.99.8-1) unstable; urgency=high + + * New upstream version + * Using a locally provided old auto_fs4.h header file in order to not + trash the program in respect with current pre-5 autofs4 interface. + (closes: #399454) + + -- Francesco Paolo Lovergine Sat, 9 Dec 2006 17:21:55 +0100 + +autodir (0.99.7-1) unstable; urgency=medium + + * New upstream version. + Still missing #include added by patching the sources... + + -- Francesco Paolo Lovergine Tue, 7 Nov 2006 23:38:14 +0100 + +autodir (0.99.3-3) unstable; urgency=high + + * Patched to #include before linux/auto_fs4.h + Thanks Roland Stigge. + (closes: #392117) + + -- Francesco Paolo Lovergine Thu, 12 Oct 2006 20:48:06 +0200 + +autodir (0.99.3-2) unstable; urgency=low + + * Changed rules to avoid amd64 breakage. + (closes: #364126) + + -- Francesco Paolo Lovergine Fri, 5 May 2006 14:51:54 +0200 + +autodir (0.99.3-1) unstable; urgency=low + + * New upstream release + + -- Francesco Paolo Lovergine Mon, 20 Feb 2006 16:20:40 +0100 + +autodir (0.99.0-2) unstable; urgency=low + + * Restated better description, and added a note about the need of autofs4 + in the description file and README.Debian. + * Set level=2 not 3 in debian/autodir.default. + + -- Francesco Paolo Lovergine Thu, 19 Jan 2006 18:41:49 +0100 + +autodir (0.99.0-1) unstable; urgency=low + + * Initial release + (closes: #348508) + * Note that I had to rebuild from scratch all autotools stuff using current + versions. This was due to a libtool issue in the upstream tarball. + Hopefully the whole thing will go upstream in a few. + + -- Francesco Paolo Lovergine Tue, 17 Jan 2006 15:20:06 +0100 + --- autodir-0.99.9.orig/debian/copyright +++ autodir-0.99.9/debian/copyright @@ -0,0 +1,212 @@ +This package was debianized by Francesco Paolo Lovergine on +Tue, 17 Jan 2006 15:20:06 +0100. + +It was downloaded from http://www.intraperson.com/autodir/ + +Copyright Holder: Venkata Ramana Enaganti + +License: Creative Commons Attributions 2.0 + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE +COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY +COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS +AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE +TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE +RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS +AND CONDITIONS. + +*1. Definitions* + + 1. *"Collective Work"* means a work, such as a periodical issue, + anthology or encyclopedia, in which the Work in its entirety in + unmodified form, along with a number of other contributions, + constituting separate and independent works in themselves, are + assembled into a collective whole. A work that constitutes a + Collective Work will not be considered a Derivative Work (as + defined below) for the purposes of this License. + 2. *"Derivative Work"* means a work based upon the Work or upon the + Work and other pre-existing works, such as a translation, musical + arrangement, dramatization, fictionalization, motion picture + version, sound recording, art reproduction, abridgment, + condensation, or any other form in which the Work may be recast, + transformed, or adapted, except that a work that constitutes a + Collective Work will not be considered a Derivative Work for the + purpose of this License. For the avoidance of doubt, where the + Work is a musical composition or sound recording, the + synchronization of the Work in timed-relation with a moving image + ("synching") will be considered a Derivative Work for the purpose + of this License. + 3. *"Licensor"* means the individual or entity that offers the Work + under the terms of this License. + 4. *"Original Author"* means the individual or entity who created the + Work. + 5. *"Work"* means the copyrightable work of authorship offered under + the terms of this License. + 6. *"You"* means an individual or entity exercising rights under this + License who has not previously violated the terms of this License + with respect to the Work, or who has received express permission + from the Licensor to exercise rights under this License despite a + previous violation. + +*2. Fair Use Rights.* Nothing in this license is intended to reduce, +limit, or restrict any rights arising from fair use, first sale or other +limitations on the exclusive rights of the copyright owner under +copyright law or other applicable laws. + +*3. License Grant.* Subject to the terms and conditions of this License, +Licensor hereby grants You a worldwide, royalty-free, non-exclusive, +perpetual (for the duration of the applicable copyright) license to +exercise the rights in the Work as stated below: + + 1. to reproduce the Work, to incorporate the Work into one or more + Collective Works, and to reproduce the Work as incorporated in the + Collective Works; + 2. to create and reproduce Derivative Works; + 3. to distribute copies or phonorecords of, display publicly, perform + publicly, and perform publicly by means of a digital audio + transmission the Work including as incorporated in Collective Works; + 4. to distribute copies or phonorecords of, display publicly, perform + publicly, and perform publicly by means of a digital audio + transmission Derivative Works. + 5. + + For the avoidance of doubt, where the work is a musical composition: + + 1. *Performance Royalties Under Blanket Licenses*. Licensor + waives the exclusive right to collect, whether individually + or via a performance rights society (e.g. ASCAP, BMI, + SESAC), royalties for the public performance or public + digital performance (e.g. webcast) of the Work. + 2. *Mechanical Rights and Statutory Royalties*. Licensor waives + the exclusive right to collect, whether individually or via + a music rights agency or designated agent (e.g. Harry Fox + Agency), royalties for any phonorecord You create from the + Work ("cover version") and distribute, subject to the + compulsory license created by 17 USC Section 115 of the US + Copyright Act (or the equivalent in other jurisdictions). + 6. *Webcasting Rights and Statutory Royalties*. For the avoidance of + doubt, where the Work is a sound recording, Licensor waives the + exclusive right to collect, whether individually or via a + performance-rights society (e.g. SoundExchange), royalties for the + public digital performance (e.g. webcast) of the Work, subject to + the compulsory license created by 17 USC Section 114 of the US + Copyright Act (or the equivalent in other jurisdictions). + +The above rights may be exercised in all media and formats whether now +known or hereafter devised. The above rights include the right to make +such modifications as are technically necessary to exercise the rights +in other media and formats. All rights not expressly granted by Licensor +are hereby reserved. + +*4. Restrictions.*The license granted in Section 3 above is expressly +made subject to and limited by the following restrictions: + + 1. You may distribute, publicly display, publicly perform, or + publicly digitally perform the Work only under the terms of this + License, and You must include a copy of, or the Uniform Resource + Identifier for, this License with every copy or phonorecord of the + Work You distribute, publicly display, publicly perform, or + publicly digitally perform. You may not offer or impose any terms + on the Work that alter or restrict the terms of this License or + the recipients' exercise of the rights granted hereunder. You may + not sublicense the Work. You must keep intact all notices that + refer to this License and to the disclaimer of warranties. You may + not distribute, publicly display, publicly perform, or publicly + digitally perform the Work with any technological measures that + control access or use of the Work in a manner inconsistent with + the terms of this License Agreement. The above applies to the Work + as incorporated in a Collective Work, but this does not require + the Collective Work apart from the Work itself to be made subject + to the terms of this License. If You create a Collective Work, + upon notice from any Licensor You must, to the extent practicable, + remove from the Collective Work any reference to such Licensor or + the Original Author, as requested. If You create a Derivative + Work, upon notice from any Licensor You must, to the extent + practicable, remove from the Derivative Work any reference to such + Licensor or the Original Author, as requested. + 2. If you distribute, publicly display, publicly perform, or publicly + digitally perform the Work or any Derivative Works or Collective + Works, You must keep intact all copyright notices for the Work and + give the Original Author credit reasonable to the medium or means + You are utilizing by conveying the name (or pseudonym if + applicable) of the Original Author if supplied; the title of the + Work if supplied; to the extent reasonably practicable, the + Uniform Resource Identifier, if any, that Licensor specifies to be + associated with the Work, unless such URI does not refer to the + copyright notice or licensing information for the Work; and in the + case of a Derivative Work, a credit identifying the use of the + Work in the Derivative Work (e.g., "French translation of the Work + by Original Author," or "Screenplay based on original Work by + Original Author"). Such credit may be implemented in any + reasonable manner; provided, however, that in the case of a + Derivative Work or Collective Work, at a minimum such credit will + appear where any other comparable authorship credit appears and in + a manner at least as prominent as such other comparable authorship + credit. + +*5. Representations, Warranties and Disclaimer* + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR +OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY +KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, +INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF +LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, +WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE +EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +*6. Limitation on Liability.* EXCEPT TO THE EXTENT REQUIRED BY +APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL +THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY +DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF +LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +*7. Termination* + + 1. This License and the rights granted hereunder will terminate + automatically upon any breach by You of the terms of this License. + Individuals or entities who have received Derivative Works or + Collective Works from You under this License, however, will not + have their licenses terminated provided such individuals or + entities remain in full compliance with those licenses. Sections + 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + 2. Subject to the above terms and conditions, the license granted + here is perpetual (for the duration of the applicable copyright in + the Work). Notwithstanding the above, Licensor reserves the right + to release the Work under different license terms or to stop + distributing the Work at any time; provided, however that any such + election will not serve to withdraw this License (or any other + license that has been, or is required to be, granted under the + terms of this License), and this License will continue in full + force and effect unless terminated as stated above. + +*8. Miscellaneous* + + 1. Each time You distribute or publicly digitally perform the Work or + a Collective Work, the Licensor offers to the recipient a license + to the Work on the same terms and conditions as the license + granted to You under this License. + 2. Each time You distribute or publicly digitally perform a + Derivative Work, Licensor offers to the recipient a license to the + original Work on the same terms and conditions as the license + granted to You under this License. + 3. If any provision of this License is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability + of the remainder of the terms of this License, and without further + action by the parties to this agreement, such provision shall be + reformed to the minimum extent necessary to make such provision + valid and enforceable. + 4. No term or provision of this License shall be deemed waived and no + breach consented to unless such waiver or consent shall be in + writing and signed by the party to be charged with such waiver or + consent. + 5. This License constitutes the entire agreement between the parties + with respect to the Work licensed here. There are no + understandings, agreements or representations with respect to the + Work not specified here. Licensor shall not be bound by any + additional provisions that may appear in any communication from + You. This License may not be modified without the mutual written + agreement of the Licensor and You. +