diff -Nru cloop-2.6.31.1.1ubuntu1/advancecomp-1.15/config.guess cloop-2.6.39.2/advancecomp-1.15/config.guess --- cloop-2.6.31.1.1ubuntu1/advancecomp-1.15/config.guess 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/advancecomp-1.15/config.guess 2006-08-12 09:42:14.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2009-06-10' +timestamp='2004-11-12' # 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 @@ -18,15 +17,13 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -56,8 +53,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +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." @@ -69,11 +66,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -107,7 +104,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 "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d -q "$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 ; } ; @@ -126,7 +123,7 @@ ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -161,7 +158,6 @@ 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 @@ -170,7 +166,7 @@ arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ + | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -200,23 +196,55 @@ # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit ;; + exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-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 ;; + sgi:OpenBSD:*:*) + echo mips64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + exit 0 ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -269,43 +297,40 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit ;; + exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit ;; + exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition - exit ;; + exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe - exit ;; + exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit ;; + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit ;; + exit 0;; 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 @@ -313,48 +338,32 @@ else echo pyramid-pyramid-bsd fi - exit ;; + exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit ;; + exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit ;; + exit 0 ;; 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 ;; + sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; 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 ;; + exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -363,10 +372,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 ;; + exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + exit 0 ;; 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 @@ -378,10 +387,10 @@ echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit ;; + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + exit 0 ;; # 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 @@ -392,40 +401,40 @@ # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit ;; + exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -449,33 +458,32 @@ exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit ;; + exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit ;; + exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit ;; + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit ;; + exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit ;; + exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit ;; + exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit ;; + exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -491,29 +499,29 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit ;; + exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit ;; + exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit ;; + exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit ;; + exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit ;; + exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -521,7 +529,7 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -536,19 +544,15 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit ;; - *:AIX:*:[456]) + exit 0 ;; + *:AIX:*:[45]) 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 @@ -561,28 +565,28 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix - exit ;; + exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit ;; + exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit ;; + exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit ;; + exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit ;; + exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit ;; + exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -644,19 +648,9 @@ esac if [ ${HP_ARCH} = "hppa2.0w" ] then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ + # 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 then HP_ARCH="hppa2.0w" else @@ -664,11 +658,11 @@ fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit ;; + exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -696,227 +690,202 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 - exit ;; + exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit ;; + exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit ;; + exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit ;; + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit ;; + exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit ;; + exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit ;; + exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit ;; + exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; 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 ;; + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + exit 0 ;; *: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 ;; + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) + exit 0 ;; + i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd | genuineintel) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; + exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit ;; + exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + exit 0 ;; *: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 ;; + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit ;; + exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu - exit ;; + exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu - exit ;; + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) + exit 0 ;; + mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + CPU=mips #else CPU= #endif #endif EOF - 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; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu - exit ;; + exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu - exit ;; + exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -927,13 +896,10 @@ EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac - objdump --private-headers /bin/sh | grep -q ld.so.1 + 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 ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; + exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -941,31 +907,25 @@ PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit ;; + exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit ;; + exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit ;; + exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; + exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit 0 ;; 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 @@ -981,6 +941,17 @@ elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # 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 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -997,7 +968,7 @@ LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout @@ -1007,23 +978,16 @@ LIBC=dietlibc #endif EOF - 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; } + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; 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 ;; + exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -1031,27 +995,27 @@ # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit ;; + exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) + exit 0 ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; + exit 0 ;; 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 @@ -1059,16 +1023,15 @@ else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + exit 0 ;; + i*86:*:5:[78]*) 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 ;; + exit 0 ;; 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 ;; + exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit ;; + exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit ;; + exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit ;; + exit 0 ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 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; } + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit ;; + exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit ;; + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit ;; + exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1173,84 +1123,69 @@ else echo ns32k-sni-sysv fi - exit ;; + exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit ;; + exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit ;; + exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit ;; + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit ;; + exit 0 ;; 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 ;; + exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit ;; + exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit ;; + exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1258,25 +1193,22 @@ UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; + exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit ;; + exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit ;; + exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1287,50 +1219,41 @@ UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit ;; + exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit ;; + exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit ;; + exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit ;; + exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit ;; + exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its - exit ;; + exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + exit 0 ;; *:*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 ;; + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1362,7 +1285,7 @@ #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); + printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1451,12 +1374,11 @@ } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) @@ -1465,22 +1387,22 @@ case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit ;; + exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit 0 ;; c34*) echo c34-convex-bsd - exit ;; + exit 0 ;; c38*) echo c38-convex-bsd - exit ;; + exit 0 ;; c4*) echo c4-convex-bsd - exit ;; + exit 0 ;; esac fi @@ -1491,9 +1413,7 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + ftp://ftp.gnu.org/pub/gnu/config/ If the version you run ($0) is already up to date, please send the following data and any information you think might be diff -Nru cloop-2.6.31.1.1ubuntu1/advancecomp-1.15/config.sub cloop-2.6.39.2/advancecomp-1.15/config.sub --- cloop-2.6.31.1.1ubuntu1/advancecomp-1.15/config.sub 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/advancecomp-1.15/config.sub 2006-08-12 09:42:14.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2009-06-11' +timestamp='2004-11-30' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -22,15 +21,14 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -72,8 +70,8 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +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." @@ -85,11 +83,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -101,7 +99,7 @@ *local*) # First pass through any local machine types. echo $1 - exit ;; + exit 0;; * ) break ;; @@ -120,10 +118,8 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | 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/'` ;; @@ -153,9 +149,6 @@ os= basic_machine=$1 ;; - -bluegene*) - os=-cnk - ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -177,10 +170,6 @@ -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/'` @@ -197,10 +186,6 @@ # 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/'` @@ -245,28 +230,22 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ + | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -275,26 +254,21 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | moxie \ - | mt \ | msp430 \ - | nios | nios2 \ | ns16k | ns32k \ - | or32 \ + | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -304,9 +278,6 @@ ;; 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 @@ -326,32 +297,28 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ + | avr-* \ + | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ + | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -360,33 +327,26 @@ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ - | mt-* \ | msp430-* \ - | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -450,10 +410,6 @@ basic_machine=m68k-apollo os=-bsd ;; - aros) - basic_machine=i386-pc - os=-aros - ;; aux) basic_machine=m68k-apple os=-aux @@ -462,26 +418,10 @@ basic_machine=ns32k-sequent os=-dynix ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -510,8 +450,8 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16) - basic_machine=cr16-unknown + cr16c) + basic_machine=cr16c-unknown os=-elf ;; crds | unos) @@ -549,10 +489,6 @@ basic_machine=m88k-motorola os=-sysv3 ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -707,14 +643,6 @@ 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 ;; @@ -730,10 +658,6 @@ basic_machine=i386-pc os=-mingw32 ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) basic_machine=m68000-convergent ;; @@ -759,9 +683,6 @@ basic_machine=i386-pc os=-msdos ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; mvs) basic_machine=i370-ibm os=-mvs @@ -837,8 +758,9 @@ basic_machine=hppa1.1-oki os=-proelf ;; - openrisc | openrisc-*) + or32 | or32-*) basic_machine=or32-unknown + os=-coff ;; os400) basic_machine=powerpc-ibm @@ -860,14 +782,6 @@ 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 ;; @@ -877,12 +791,6 @@ 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 ;; @@ -939,10 +847,6 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -969,10 +873,6 @@ sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; sei) basic_machine=mips-sei os=-seiux @@ -984,9 +884,6 @@ basic_machine=sh-hitachi os=-hms ;; - sh5el) - basic_machine=sh5le-unknown - ;; sh64) basic_machine=sh64-unknown ;; @@ -1076,10 +973,6 @@ basic_machine=tic6x-unknown os=-coff ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; tx39) basic_machine=mipstx39-unknown ;; @@ -1155,10 +1048,6 @@ basic_machine=z8k-unknown os=-sim ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1197,10 +1086,13 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1267,30 +1159,26 @@ # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1308,7 +1196,7 @@ os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1420,9 +1308,6 @@ -zvmoe) os=-zvmoe ;; - -dicos*) - os=-dicos - ;; -none) ;; *) @@ -1445,12 +1330,6 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; *-acorn) os=-riscix1.2 ;; @@ -1460,9 +1339,9 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1488,9 +1367,6 @@ m68*-cisco) os=-aout ;; - mep-*) - os=-elf - ;; mips*-cisco) os=-elf ;; @@ -1509,9 +1385,6 @@ *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1620,7 +1493,7 @@ -sunos*) vendor=sun ;; - -cnk*|-aix*) + -aix*) vendor=ibm ;; -beos*) @@ -1683,7 +1556,7 @@ esac echo $basic_machine$os -exit +exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru cloop-2.6.31.1.1ubuntu1/advfs.cc cloop-2.6.39.2/advfs.cc --- cloop-2.6.31.1.1ubuntu1/advfs.cc 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/advfs.cc 2011-07-06 01:31:15.000000000 +0000 @@ -46,7 +46,7 @@ #include #include #include -#include "compressed_loop.h" +#include "cloop.h" #include "portable.h" #include "pngex.h" //#include "utility.h" @@ -293,7 +293,8 @@ //int j=(method<-2)?9:0; for(int j=0; j= 2.6.7 compatibility - AMD 64 compatibility diff -Nru cloop-2.6.31.1.1ubuntu1/changelog.knoppix cloop-2.6.39.2/changelog.knoppix --- cloop-2.6.31.1.1ubuntu1/changelog.knoppix 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/changelog.knoppix 1970-01-01 00:00:00.000000000 +0000 @@ -1,587 +0,0 @@ -cloop (2.628-2) unstable; urgency=low - - * Reflect kernel 2.6.28 block device API changes in order to actually work. - - -- Klaus Knopper Tue, 04 Nov 2008 18:38:02 +0100 - -cloop (2.628-1) unstable; urgency=low - - * Minor source modifications for compiling with kernel 2.6.28 - - -- Klaus Knopper Sat, 25 Oct 2008 23:11:39 +0200 - -cloop (2.625-1) unstable; urgency=low - - * Kernel 2.6.25/26 api changes - - -- Klaus Knopper Mon, 19 May 2008 18:44:27 +0200 - -cloop (2.624-1) unstable; urgency=low - - * Kernel 2.6.24 api change (rq_for_each_segment) - - -- Klaus Knopper Sat, 26 Jan 2008 13:05:45 +0100 - -cloop (2.623-1) unstable; urgency=low - - * Fixed alloc_disk-leak (caused modprobe cloop; rmmod cloop; modprobe cloop to fail). - * Added support for busybox losetup. - - -- Klaus Knopper Sun, 16 Dec 2007 23:10:01 +0200 - -cloop (2.622-1) unstable; urgency=low - - * Rewrite with Kernel-Thread and request-queue for Kernel 2.6.22 and up. - * Abandoned Kernel 2.4 support. - * Replaced obsolete advancecomp-1.9 by 1.15 - - -- Klaus Knopper Sun, 23 Sep 2007 22:19:05 +0200 - -cloop (2.06-2) unstable; urgency=low - - * Patch for Kernel 2.6.22 invalidate_bdev(one arg). - - -- Klaus Knopper Tue, 10 Jul 2007 06:16:26 +0200 - -cloop (2.06-1) unstable; urgency=low - - * Added "cloop_suspend" ioctl and utility contributed by Fabian Franz. - - -- Klaus Knopper Sun, 25 Feb 2007 22:25:52 +0100 - -cloop (2.05-1) unstable; urgency=low - - * Adopted Eduard Blochs debian buildscripts for generic cloop 2.05 - - -- Klaus Knopper Sun, 20 Aug 2006 14:10:24 +0200 - -cloop (2.04-1+eb.1-7) unstable; urgency=low - - * disabled debugging output (ooops...) - * another ugly bug identified by Andreas Krüger (thanks!), broken offset - index generation in tempfile mode (closes: #382762) - * Makefile fixes to adapt to new advfs.cc path - * manpage patch from Andreas to explain extract_compressed_fs usage applied - (closes: #382765) and SGML format fixes - - -- Eduard Bloch Sun, 13 Aug 2006 12:43:44 +0200 - -cloop (2.04-1+eb.1-6) unstable; urgency=low - - * updated advancecomp to 1.15, better documenting (diff) modifications used - to implant advfs.cc - * bugfixes in advfs.cc: - - recognice -m/-f with standard output (closes: #382611) - - compressing block selection, could get stuck in rare cases - - -- Eduard Bloch Sat, 12 Aug 2006 13:26:53 +0200 - -cloop (2.04-1+eb.1-5) unstable; urgency=low - - * not using the install-module rule from the Makefile, installing module - explicitely (closes: #381639) - * added debian/compat to the modules tarball - * fixed broken macros in Millan's patch (closes: #381626) - - -- Eduard Bloch Sun, 06 Aug 2006 19:04:28 +0200 - -cloop (2.04-1+eb.1-4) unstable; urgency=low - - * Dirty little optimisation of the block-for-compression selection - - -- Eduard Bloch Wed, 2 Aug 2006 23:53:05 +0200 - -cloop (2.04-1+eb.1-3) unstable; urgency=low - - * rewrite of the work control in multithreaded advfs/create_compressed_fs, - now definitely not adding a zero block on aligned data (closes: #296179) - * fixed a memory leak in "best" mode and better control for memory - allocation now (finally closes: #164015 and hopefully closes: #380384, - reopen if it doesn't) - * added pt.po (closes: #337546) - * added GNU/kFreeBSD porting patch from Robert Millan (closes: #335872) - - -- Eduard Bloch Wed, 02 Aug 2006 23:51:14 +0200 - -cloop (2.04-1+eb.1-2) unstable; urgency=low - - * removed obsolete CFLAGS from the Makefile, confused current kernel build - system, plus some user hints added. - * compressed_loop.c: removed all conditional blocks with workarounds for - kernel << 2.6.8, including kernel 2.4 related junk. Gets the correct - module name now and no compiler warnings anymore. Fixed intendation. - * debian/control: removed some old cruft, updated to debhelper 5, updated - Standards-Version. - - -- Eduard Bloch Fri, 28 Jul 2006 19:17:18 +0200 - -cloop (2.04-1+eb.1-1) unstable; urgency=low - - * Sync my modified version with 2.04.1 - + fixes for 2.6.17 changes (closes: #376713) - * fixes for compilatin with 2.6.18-rc2 (disabling devfs) - * -s -> -S in create_compressed_fs help output (closes: #360764) - - -- Eduard Bloch Thu, 27 Jul 2006 19:19:30 +0200 - -cloop (2.04-1) unstable; urgency=low - - * Fixed a memory leak when changing loop files. - - -- Klaus Knopper Sun, 14 May 2006 20:06:23 +0200 - -cloop (2.03-2) unstable; urgency=low - - * Fixed KBUILD_BASENAME string quotes - - -- Klaus Knopper Sun, 23 Apr 2006 10:02:10 +0200 - -cloop (2.03-1) unstable; urgency=low - - * Use dynamic major device allocation in case we can't get block device 240 - * devfs cleanups - - -- Klaus Knopper Fri, 17 Feb 2006 10:28:17 +0100 - -cloop (2.02.1+eb.11) UNRELEASED; urgency=low - - * NOT RELEASED YET - * minor fixes in manpage and help output - - -- Eduard Bloch Thu, 6 Oct 2005 12:52:48 +0200 - -cloop (2.02.1+eb.10) unstable; urgency=low - - * synch with Ubuntu: fixes interaction with devmapper layer in the driver. - Thanks for telling me, it is a "great" feeling doing duplicated work! - * cloop-node-control.sh: better ssh options, not allocating pseudo tty, - should help on AIX - * simple fixes to compile advfs.cc on AIX - * added sv.po by Daniel Nylander (closes: #331306) - - -- Eduard Bloch Thu, 06 Oct 2005 12:48:16 +0200 - -cloop (2.02.1+eb.8) unstable; urgency=low - - * create_compressed_fs bugfixes - + correct identification of IP numbers, no longer confusing with the - compatible option syntax - + cygwin workarounds in the recv calls - - -- Eduard Bloch Sun, 25 Sep 2005 18:25:37 +0200 - -cloop (2.02.1+eb.7) unstable; urgency=low - - * -L option for direct compression level choice - * network protocol sligthly changed to create less overhead, also setting - TCP_NODELAY option - * cygwin build fixes - - -- Eduard Bloch Sun, 25 Sep 2005 18:21:59 +0200 - -cloop (2.02.1+eb.6) unstable; urgency=medium - - * added correct KERNELVERSION to kernel make flags (closes: #327792) - - -- Eduard Bloch Thu, 22 Sep 2005 16:22:41 +0200 - -cloop (2.02.1+eb.5) unstable; urgency=medium - - * fixed the option parser to correctly read the nodes list and use -B for - best, not -b (the blocksize) - - -- Eduard Bloch Wed, 14 Sep 2005 22:49:59 +0200 - -cloop (2.02.1+eb.4) unstable; urgency=low - - * made option parser be more relaxed WRT old command syntax - * updated manpage to reflect the new command and driver features - - -- Eduard Bloch Wed, 14 Sep 2005 22:48:17 +0200 - -cloop (2.02.1+eb.3) unstable; urgency=low - - * advfs troughput message display frequency fixed, added ETA info - * added experimental feature: splitting output into chunks of specified size - like with split(1) (however without stdout mode with its problems) - - -- Eduard Bloch Wed, 14 Sep 2005 00:14:34 +0200 - -cloop (2.02.1+eb.2) unstable; urgency=low - - * Added EXTRA_CFLAGS to work around a weird FTBFS with kernel-headers-2.6.* - packages, still looks like a bug _there_ - - -- Eduard Bloch Thu, 08 Sep 2005 19:47:51 +0200 - -cloop (2.02.1+eb.1) experimental; urgency=low - - * rewrote advfs (multithreaded, network client/server feature and better - memory/storage strategies), see header of advfs.cc for details - * made the package native until the sync with KK (or maybe longer) - * integrated advancecomp-1.14, separated the advfs add-on from the main - package and stored it as a patch - * dropped the advfs symlink, creating one was Debian specific and bad idea - anyways. It is installed as create_compressed_fs as usual now. - * removed cruft (.postinst file that has been overwritten anyways) - - -- Eduard Bloch Fri, 02 Sep 2005 21:40:36 +0200 - -cloop (2.02.1-1) unstable; urgency=low - - * New upstream release - + sync with Knoppix version, version string relabeled as usual - * rewrote the Makefile making use of kernel 2.6 build system, created - proper install rules (I should have done this already for #288941). The - strange problem with /usr/src/linux on kernel 2.4 should also go away - (closes: #322360) - * old versions of cloop module source removed (discontinued, they are not - compatible with kernel 2.6 anyways). Get the packages from Stable if you - need to read really old KNOPPIX images. (closes: #259699) - * changelog cleanup, replaced Klaus' invalid local mail addresses - * control file generations cleanup, dropped the old junk in favor of - module-assistant's methods - * updated and simplified (m-a) README.Debian instructions - * using bzip2 for the source tarball - * fixed the templates file installation in the modules packages - * added Vietnamese translation by Clytie Siddall (closes: #313361) - * added pt_BT translation by Rodrigo Tadeu Claro and Andre Luis Lopes - (closes: #303675) - * removed an "a" forgotten in plural form (closes: #313360), thanks Clytie - * advfs patch to use a temporary file rather than memory by Sebastian - Schmidt (closes: #297453) - - -- Eduard Bloch Fri, 19 Aug 2005 22:57:46 +0200 - -cloop (2.01.5-4) unstable; urgency=low - - * patch to fix Large File support in directly specified cloop volumes and - cleanup device configuration on errors (closes: #298111) - - -- Eduard Bloch Sun, 06 Mar 2005 11:33:36 +0100 - -cloop (2.01.5-3) unstable; urgency=medium - - * made regular expression in Makefile more strict (no more false kernel-2.6 - detection, closes: #290957) - * patch for amd64 from Andreas Jochens (closes: #288941) - - -- Eduard Bloch Sun, 06 Feb 2005 11:06:10 +0100 - -cloop (2.01.5-2) unstable; urgency=high - - * added -O2 option to solve symbole resolution problems (closes: #278207) - * added patch from Andreas Jochens for gcc-3.4 compliancy (closes: #258579) - * added Czesh translation (closes: #259179) - - -- Eduard Bloch Wed, 29 Dec 2004 21:52:21 +0100 - -cloop (2.01.5-1) unstable; urgency=low - - * New upstream release - + devfs_unregister patch from Bernhard M. Wiedemann - * changed the manpage license from GFDL to GPL - - -- Eduard Bloch Tue, 12 Oct 2004 10:04:13 +0200 - -cloop (2.01.4-3) unstable; urgency=medium - - * Applied kernel 2.6.8 related patch from Thomas Jahns (closes: #271083) - * Also added his patch for older cloop versions to build with zlib_inflate - _modules_ - though it will still break with older kernels that did not - export the uncompress symbol, see README.Debian and - http://bugs.debian.org/cgi-bin/184246 for details - * adapted the rules file to use common-rules.mk from module-assistant, - including usage of the ROOT_CMD command (closes: #232974). For other - myths about root_cmd in make-kpkg's config, read bugs.debian.org/242974 - - -- Eduard Bloch Sat, 11 Sep 2004 08:39:32 +0200 - -cloop (2.01.4-2) unstable; urgency=low - - * depending on a newer gcc version since 2.95 does not compile advfs. Woody - users can ignore it and set CC=gcc-3.0 to use gcc-3.0 - * explicitely ignoring the knoppix flag file (closes: #252409) - - -- Eduard Bloch Mon, 31 May 2004 11:11:35 +0200 - -cloop (2.01.4-1) unstable; urgency=low - - * New upstream "release", based on Klaus' 2.01-4 package - * Makefiles and build rules fixes to work on recent kernel 2.6 versions - * new Dutch debconf translation (closes: #241426) - - -- Eduard Bloch Mon, 31 May 2004 09:25:23 +0200 - -cloop (2.01-1) unstable; urgency=low - - * New upstream release - + Kernel 2.6 port (version 2.0x only) - * MODVERSIONS include disabled if modversions.h is not existent - - -- Eduard Bloch Fri, 5 Mar 2004 23:04:19 +0100 - -cloop (2.00-3) unstable; urgency=low - - * Made CONFIG_ZLIB_INFLATE=y to requriement again and removed that crappy - inflate.c inclusion completely from 1.02 source. If you wish to - modularize it, send patches (closes: #230091) - - -- Eduard Bloch Mon, 26 Jan 2004 00:35:15 +0100 - -cloop (2.00-2) unstable; urgency=low - - * Removing "knoppix" keyfile until it is clear how to proceed with - Knoppix/Debian integration; fixes build failure on normal Debian - systems (closes: #229310) - - -- Eduard Bloch Mon, 19 Jan 2004 14:39:00 +0100 - -cloop (2.00-1) unstable; urgency=low - - * New upstream release (closes: #222564) - * Kicked INFLATE_C workaround, apparently fixed by upstream - * Added Japanese templates translation, thanks to Hideki Yamane - (Closes: #227544) - * Imported old cloop versions. The most recent module is called cloop.o, the - others are cloop-0.68.o and cloop-1.02.o (closes: #208686) - - -- Eduard Bloch Mon, 19 Jan 2004 13:34:56 +0100 - -cloop (1.02-5) unstable; urgency=low - - * Russian po file translation (Closes: #214332) - * Changed the translators name in fr.po (Closes: #206824) - * Don't run depmod from postrm (Closes: #214439) - - -- Eduard Bloch Sun, 28 Sep 2003 17:27:27 +0200 - -cloop (1.02-4) unstable; urgency=low - - * Load inflate.c from customized location for people that don't want to - follow README.Debian. Closes: #213001 - - -- Eduard Bloch Sat, 20 Sep 2003 14:05:00 +0200 - -cloop (1.02-3) unstable; urgency=low - - * Modifications to build cleanly for KNOPPIX - - -- Eduard Bloch Sat, 20 Sep 2003 13:41:30 +0200 - -cloop (1.02-2) unstable; urgency=low - - * New upstream release (merged with Klaus' source), closes: #210773 - * adapted to work with module-assistant - * renamed modules package to cloop-module-KVERS - * creating more device file in postinst, cloop supports multiple devices - * changed to po-debconf method (closes: #205809) and added French - translation (closes: #206824), thanks to Christian Perrier, and thanks to - Sam Hocevar for help on updating them - * Added German translation too - - -- Eduard Bloch Wed, 17 Sep 2003 18:00:20 +0200 - -cloop (1.02-1) unstable; urgency=low - - * Removed exceed get_file() - * Changed spinlocking code - - -- Klaus Knopper Wed, 27 Aug 2003 13:51:45 +0200 - -cloop (1.0-7) unstable; urgency=low - - * Experimental, for m-a - - -- Eduard Bloch Thu, 4 Sep 2003 15:58:14 +0200 - -cloop (1.0-6) unstable; urgency=low - - * Build against the Sid version of libc6, thanks to David B. Harris for - reminding me - - -- Eduard Bloch Thu, 7 Aug 2003 00:12:58 +0200 - -cloop (1.0-5) unstable; urgency=low - - * Now really fix the clean call, closes: #203990 - - -- Eduard Bloch Sun, 3 Aug 2003 21:50:27 +0200 - -cloop (1.0-4) unstable; urgency=low - - * Fixed the clean rule call, closes: #203990 - - -- Eduard Bloch Sun, 3 Aug 2003 16:29:29 +0200 - -cloop (1.0-3) unstable; urgency=low - - * Resync with the new upstream version - + Changes summary: - - kernel 2.2 support is gone (and removed zlib source copy from the - modules source package) - - multiple device support via the losetup interface - + Also removed zlib three from the package, kernel 2.2 support is gone - * moved the postrm to module package only, depmod return value ignored, - closes: #203948 - - -- Eduard Bloch Sun, 3 Aug 2003 08:01:08 +0200 - -cloop (1.0-2) unstable; urgency=low - - * Removed compressloop until a newer version with 64bit pointers is - available from the author. - - -- root Thu, 24 Jul 2003 01:45:16 +0200 - -cloop (1.0-1) unstable; urgency=low - - * Added multiple cloop device (losetup) support (default 8) - * Removed Kernel 2.2 support - * switched to 64bit offsets in cloop file (no backwards compatibility) - * file=/path/to/file parameter is now optional - - -- Klaus Knopper Sun, 13 Jul 2003 01:29:26 +0200 - -cloop (0.68-5) unstable; urgency=low - - * changed int to u_int32_t for offset - - -- root Wed, 25 Jun 2003 06:16:12 +0200 - -cloop (0.68-4) unstable; urgency=low - - * Eduard Bloch: - - generating control from control.head.{knopper,debian} to appease Klaus. - Consequence for Debian uploads: "new" maintainer ;) - - fixing the incorrectly detected gcc- string, closes: #189998 - - documented the requirement of CONFIG_ZLIB_INFLATE, closes: #184246 - - double-checked that create_compressed_fs.1 is installed, closes: #164014 - - *sigh* changed a copy&paste error in README.Debian, closes: #185999 - - something is still wrong with the genchanges.sh crap, no time to fix - - -- Eduard Bloch Sun, 11 May 2003 12:26:16 +0200 - -cloop (0.68-3) unstable; urgency=low - - * resynced the source with Klaus' tree and prepared for alioth - * Changes summary, Eduard Bloch: - - Use dynamic libz for utils (closes: #176002) - - Minimalistic devfs support - - added dynamic compiler detection and KPKG_DEST_DIR, borrowed from ALSA - Klaus Knopper: - - Added modprobe dependency on bsdcomp - - Updated compressloop - - -- Eduard Bloch Mon, 31 Mar 2003 12:52:37 +0200 - -cloop (0.67-3) unstable; urgency=low - - * New upstream release, merged changes from Klaus Knopper and others, - rev. 0.66-2..0.67-2: - - Added compressloop by Valentijn Sessink - - Use builtin zlib_inflate of Kernel 2.4.x, if available - - Added more gcc options to Makefile - - -- Eduard Bloch Mon, 6 Jan 2003 17:45:48 +0100 - -cloop (0.66-1) unstable; urgency=low - - * Cleaned the zlib source - - -- Eduard Bloch Tue, 20 Aug 2002 09:41:59 +0200 - -cloop (0.66-0.1) unstable; urgency=low - - * Replaced ll_rw_blk in Kernel 2.4 version to enable looping over NFS - * Cleaned up kernel messages - * failed r/w mount now returns EROFS instead of EPERM. - - -- root Sat, 17 Aug 2002 14:02:05 +0200 - -cloop (0.65-1) unstable; urgency=low - - * Handle blockdevices as cloop input files. - - -- root Wed, 24 Apr 2002 16:09:07 +0200 - -cloop (0.64-1) unstable; urgency=low - - * zlib 1.1.4 - - -- Klaus Knopper Wed, 20 Mar 2002 23:18:34 +0100 - -cloop (0.63.1-4) unstable; urgency=low - - * Adopted version numbering and changes-generator from lm-sensors/pcmcia-cs, - now ready to build official modules packages - * Changed all Maintainer entries to my person - - -- Eduard Bloch Wed, 13 Mar 2002 11:25:16 +0100 - -cloop (0.63.1-3) unstable; urgency=high - - * patched the embedded zlib source with 010_doublefree_crash from zlib source - - -- Eduard Bloch Tue, 12 Mar 2002 16:56:21 +0100 - -cloop (0.63-2) unstable; urgency=low - - * "new" maintainer (adopted the package completely) - * Added a kdist rule, needed by make-kpkg in some cases. Closes: #130320 - * A small hack to modify the version info with the target kernel - - -- Eduard Bloch Tue, 22 Jan 2002 19:52:34 +0100 - -cloop (0.63-1.1) unstable; urgency=low - - * merged with the debconf dialog changes - * make a check for existance of /dev/cloop in postinst - - -- Eduard Bloch Wed, 26 Dec 2001 17:48:05 +0100 - -cloop (0.63-1) unstable; urgency=low - - * Bugfix release, fixed request_queue mess. - - -- Klaus Knopper Mon, 25 Dec 2001 04:08:58 +0200 - -cloop (0.62-2) unstable; urgency=low - - * Rewrite of the build system, reused for modules source package. - * Dropped unused source parts from the zlib source. - * copyright file: added reference to the GPL file, comment about usage - of zlib stuff and its copyright notice - * wrote manpage - * moved executables to /usr/bin, not administrative/system programs - - -- Eduard Bloch Fri, 30 Nov 2001 14:24:29 +0100 - -cloop (0.62-1) unstable; urgency=low - - * Added GPL License code for Kernel 2.4.9 and up - - -- Klaus Knopper Thu, 15 Nov 2001 04:08:58 +0200 - -cloop (0.61-1) unstable; urgency=low - - * Checking filp_open() for IS_ERR() to prevent oopses for nonexistent files - * Cleanup of create_compressed_fs.c for newer version of gcc - - -- Klaus Knopper Tue, 31 Jul 2001 04:08:58 +0200 - -cloop (0.60-1) unstable; urgency=low - - * improved 2.4.x read handling vir do_generic_file_read() - - -- Klaus Knopper Fri, 8 Jun 2001 04:08:58 +0200 - -cloop (0.51-1) unstable; urgency=low - - * Initial Release. - - -- Klaus Knopper Thu, 7 Jun 2001 04:08:58 +0200 - -Local variables: -mode: debian-changelog -End: diff -Nru cloop-2.6.31.1.1ubuntu1/cloop.c cloop-2.6.39.2/cloop.c --- cloop-2.6.31.1.1ubuntu1/cloop.c 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/cloop.c 2011-05-27 10:57:42.000000000 +0000 @@ -0,0 +1,1093 @@ +/* + * compressed_loop.c: Read-only compressed loop blockdevice + * hacked up by Rusty in 1999, extended and maintained by Klaus Knopper + * + * A cloop file looks like this: + * [32-bit uncompressed block size: network order] + * [32-bit number of blocks (n_blocks): network order] + * [64-bit file offsets of start of blocks: network order] + * ... + * (n_blocks + 1). + * n_blocks consisting of: + * [compressed block] + * + * Every version greatly inspired by code seen in loop.c + * by Theodore Ts'o, 3/29/93. + * + * Copyright 1999-2009 by Paul `Rusty' Russell & Klaus Knopper. + * Redistribution of this file is permitted under the GNU Public License. + * + */ + +#define CLOOP_NAME "cloop" +#define CLOOP_VERSION "2.639" +#define CLOOP_MAX 8 + +#ifndef KBUILD_MODNAME +#define KBUILD_MODNAME cloop +#endif + +#ifndef KBUILD_BASENAME +#define KBUILD_BASENAME cloop +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* do_div() for 64bit division */ +#include +#include +/* Use zlib_inflate from lib/zlib_inflate */ +#include +#include +#include +#include +#include "cloop.h" + +/* New License scheme */ +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif +#ifdef MODULE_AUTHOR +MODULE_AUTHOR("Klaus Knopper (current maintainer), Paul Russel (initial Kernel 2.2 version)"); +#endif +#ifdef MODULE_DESCRIPTION +MODULE_DESCRIPTION("Transparently decompressing loopback block device"); +#endif + +#ifndef MIN +#define MIN(x,y) ((x) < (y) ? (x) : (y)) +#endif + +#ifndef MAX +#define MAX(x,y) ((x) > (y) ? (x) : (y)) +#endif + +/* Use experimental major for now */ +#define MAJOR_NR 240 + +/* #define DEVICE_NAME CLOOP_NAME */ +/* #define DEVICE_NR(device) (MINOR(device)) */ +/* #define DEVICE_ON(device) */ +/* #define DEVICE_OFF(device) */ +/* #define DEVICE_NO_RANDOM */ +/* #define TIMEOUT_VALUE (6 * HZ) */ + +#include +#include + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, x...) +#endif + +/* One file can be opened at module insertion time */ +/* insmod cloop file=/path/to/file */ +static char *file=NULL; +static unsigned int preload=0; +static unsigned int cloop_max=CLOOP_MAX; +module_param(file, charp, 0); +module_param(preload, uint, 0); +module_param(cloop_max, uint, 0); +MODULE_PARM_DESC(file, "Initial cloop image file (full path) for /dev/cloop"); +MODULE_PARM_DESC(preload, "Preload n blocks of cloop data into memory"); +MODULE_PARM_DESC(cloop_max, "Maximum number of cloop devices (default 8)"); + +static struct file *initial_file=NULL; +static int cloop_major=MAJOR_NR; + +/* Number of buffered decompressed blocks */ +#define BUFFERED_BLOCKS 8 +struct cloop_device +{ + /* Copied straight from the file */ + struct cloop_head head; + + /* An array of offsets of compressed blocks within the file */ + loff_t *offsets; + + /* We buffer some uncompressed blocks for performance */ + int buffered_blocknum[BUFFERED_BLOCKS]; + int current_bufnum; + void *buffer[BUFFERED_BLOCKS]; + void *compressed_buffer; + size_t preload_array_size; /* Size of pointer array in blocks */ + size_t preload_size; /* Number of successfully allocated blocks */ + char **preload_cache; /* Pointers to preloaded blocks */ + + z_stream zstream; + + struct file *backing_file; /* associated file */ + struct inode *backing_inode; /* for bmap */ + + unsigned long largest_block; + unsigned int underlying_blksize; + int clo_number; + int refcnt; + struct block_device *bdev; + int isblkdev; + /* Lock for kernel block device queue */ + spinlock_t queue_lock; + /* mutex for ioctl() */ + struct mutex clo_ctl_mutex; + struct list_head clo_list; + struct task_struct *clo_thread; + wait_queue_head_t clo_event; + struct request_queue *clo_queue; + struct gendisk *clo_disk; + int suspended; + char clo_file_name[LO_NAME_SIZE]; +}; + +/* Changed in 2.639: cloop_dev is now a an array of cloop_dev pointers, + so we can specify how many devices we need via parameters. */ +static struct cloop_device **cloop_dev; +static const char *cloop_name=CLOOP_NAME; +static int cloop_count = 0; + +#if (!(defined(CONFIG_ZLIB_INFLATE) || defined(CONFIG_ZLIB_INFLATE_MODULE))) /* Must be compiled into kernel. */ +#error "Invalid Kernel configuration. CONFIG_ZLIB_INFLATE support is needed for cloop." +#endif + +/* Use __get_free_pages instead of vmalloc, allows up to 32 pages, + * 2MB in one piece */ +static void *cloop_malloc(size_t size) +{ + int order = get_order(size); + if(order <= KMALLOC_MAX_ORDER) + return (void *)kmalloc(size, GFP_KERNEL); + else if(order < MAX_ORDER) + return (void *)__get_free_pages(GFP_KERNEL, order); + return (void *)vmalloc(size); +} + +static void cloop_free(void *mem, size_t size) +{ + int order = get_order(size); + if(order <= KMALLOC_MAX_ORDER) + kfree(mem); + else if(order < MAX_ORDER) + free_pages((unsigned long)mem, order); + else vfree(mem); +} + +static int uncompress(struct cloop_device *clo, + unsigned char *dest, unsigned long *destLen, + unsigned char *source, unsigned long sourceLen) +{ + /* Most of this code can be found in fs/cramfs/uncompress.c */ + int err; + clo->zstream.next_in = source; + clo->zstream.avail_in = sourceLen; + clo->zstream.next_out = dest; + clo->zstream.avail_out = *destLen; + err = zlib_inflateReset(&clo->zstream); + if (err != Z_OK) + { + printk(KERN_ERR "%s: zlib_inflateReset error %d\n", cloop_name, err); + zlib_inflateEnd(&clo->zstream); zlib_inflateInit(&clo->zstream); + } + err = zlib_inflate(&clo->zstream, Z_FINISH); + *destLen = clo->zstream.total_out; + if (err != Z_STREAM_END) return err; + return Z_OK; +} + +static ssize_t cloop_read_from_file(struct cloop_device *clo, struct file *f, char *buf, + loff_t pos, size_t buf_len) +{ + size_t buf_done=0; + while (buf_done < buf_len) + { + size_t size = buf_len - buf_done, size_read; + /* kernel_read() only supports 32 bit offsets, so we use vfs_read() instead. */ + /* int size_read = kernel_read(f, pos, buf + buf_done, size); */ + mm_segment_t old_fs = get_fs(); + set_fs(get_ds()); + size_read = vfs_read(f, (void __user *)(buf + buf_done), size, &pos); + set_fs(old_fs); + + if(size_read <= 0) + { + printk(KERN_ERR "%s: Read error %d at pos %Lu in file %s, " + "%d bytes lost.\n", cloop_name, (int)size_read, pos, + file, (int)size); + memset(buf + buf_len - size, 0, size); + break; + } + buf_done += size_read; + } + return buf_done; +} + +/* This looks more complicated than it is */ +/* Returns number of block buffer to use for this request */ +static int cloop_load_buffer(struct cloop_device *clo, int blocknum) +{ + unsigned int buf_done = 0; + unsigned long buflen; + unsigned int buf_length; + int ret; + int i; + if(blocknum > ntohl(clo->head.num_blocks) || blocknum < 0) + { + printk(KERN_WARNING "%s: Invalid block number %d requested.\n", + cloop_name, blocknum); + return -1; + } + + /* Quick return if the block we seek is already in one of the buffers. */ + /* Return number of buffer */ + for(i=0; ibuffered_blocknum[i]) + { + DEBUGP(KERN_INFO "cloop_load_buffer: Found buffered block %d\n", i); + return i; + } + + buf_length = be64_to_cpu(clo->offsets[blocknum+1]) - be64_to_cpu(clo->offsets[blocknum]); + +/* Load one compressed block from the file. */ + cloop_read_from_file(clo, clo->backing_file, (char *)clo->compressed_buffer, + be64_to_cpu(clo->offsets[blocknum]), buf_length); + + buflen = ntohl(clo->head.block_size); + + /* Go to next position in the block ring buffer */ + clo->current_bufnum++; + if(clo->current_bufnum >= BUFFERED_BLOCKS) clo->current_bufnum = 0; + + /* Do the uncompression */ + ret = uncompress(clo, clo->buffer[clo->current_bufnum], &buflen, clo->compressed_buffer, + buf_length); + /* DEBUGP("cloop: buflen after uncompress: %ld\n",buflen); */ + if (ret != 0) + { + printk(KERN_ERR "%s: zlib decompression error %i uncompressing block %u %u/%lu/%u/%u " + "%Lu-%Lu\n", cloop_name, ret, blocknum, + ntohl(clo->head.block_size), buflen, buf_length, buf_done, + be64_to_cpu(clo->offsets[blocknum]), be64_to_cpu(clo->offsets[blocknum+1])); + clo->buffered_blocknum[clo->current_bufnum] = -1; + return -1; + } + clo->buffered_blocknum[clo->current_bufnum] = blocknum; + return clo->current_bufnum; +} + +/* This function does all the real work. */ +/* returns "uptodate" */ +static int cloop_handle_request(struct cloop_device *clo, struct request *req) +{ + int buffered_blocknum = -1; + int preloaded = 0; + loff_t offset = (loff_t) blk_rq_pos(req)<<9; /* req->sector<<9 */ + struct bio_vec *bvec; + struct req_iterator iter; + rq_for_each_segment(bvec, req, iter) + { + unsigned long len = bvec->bv_len; + char *to_ptr = kmap(bvec->bv_page) + bvec->bv_offset; + while(len > 0) + { + u_int32_t length_in_buffer; + loff_t block_offset = offset; + u_int32_t offset_in_buffer; + char *from_ptr; + /* do_div (div64.h) returns the 64bit division remainder and */ + /* puts the result in the first argument, i.e. block_offset */ + /* becomes the blocknumber to load, and offset_in_buffer the */ + /* position in the buffer */ + offset_in_buffer = do_div(block_offset, ntohl(clo->head.block_size)); + /* Lookup preload cache */ + if(block_offset < clo->preload_size && clo->preload_cache != NULL && + clo->preload_cache[block_offset] != NULL) + { /* Copy from cache */ + preloaded = 1; + from_ptr = clo->preload_cache[block_offset]; + } + else + { + preloaded = 0; + buffered_blocknum = cloop_load_buffer(clo,block_offset); + if(buffered_blocknum == -1) break; /* invalid data, leave inner loop */ + /* Copy from buffer */ + from_ptr = clo->buffer[buffered_blocknum]; + } + /* Now, at least part of what we want will be in the buffer. */ + length_in_buffer = ntohl(clo->head.block_size) - offset_in_buffer; + if(length_in_buffer > len) + { +/* DEBUGP("Warning: length_in_buffer=%u > len=%u\n", + length_in_buffer,len); */ + length_in_buffer = len; + } + memcpy(to_ptr, from_ptr + offset_in_buffer, length_in_buffer); + to_ptr += length_in_buffer; + len -= length_in_buffer; + offset += length_in_buffer; + } /* while inner loop */ + kunmap(bvec->bv_page); + } /* end rq_for_each_segment*/ + return ((buffered_blocknum!=-1) || preloaded); +} + +/* Adopted from loop.c, a kernel thread to handle physical reads and + * decompression. */ +static int cloop_thread(void *data) +{ + struct cloop_device *clo = data; + current->flags |= PF_NOFREEZE; + set_user_nice(current, -15); + while (!kthread_should_stop()||!list_empty(&clo->clo_list)) + { + int err; + err = wait_event_interruptible(clo->clo_event, !list_empty(&clo->clo_list) || + kthread_should_stop()); + if(unlikely(err)) + { + DEBUGP(KERN_ERR "cloop thread activated on error!? Continuing.\n"); + continue; + } + if(!list_empty(&clo->clo_list)) + { + struct request *req; + unsigned long flags; + int uptodate; + spin_lock_irq(&clo->queue_lock); + req = list_entry(clo->clo_list.next, struct request, queuelist); + list_del_init(&req->queuelist); + spin_unlock_irq(&clo->queue_lock); + uptodate = cloop_handle_request(clo, req); + spin_lock_irqsave(&clo->queue_lock, flags); + __blk_end_request_all(req, uptodate ? 0 : -EIO); + spin_unlock_irqrestore(&clo->queue_lock, flags); + } + } + DEBUGP(KERN_ERR "cloop_thread exited.\n"); + return 0; +} + +/* This is called by the kernel block queue management every now and then, + * with successive read requests qeued and sorted in a (hopefully) + * "most efficient way". spin_lock_irq() is being held by the kernel. */ +static void cloop_do_request(struct request_queue *q) +{ + struct request *req; + while((req = blk_fetch_request(q)) != NULL) + { + struct cloop_device *clo; + int rw; + /* quick sanity checks */ + /* blk_fs_request() was removed in 2.6.36 */ + if (unlikely(req == NULL || (req->cmd_type != REQ_TYPE_FS))) + goto error_continue; + rw = rq_data_dir(req); + if (unlikely(rw != READ && rw != READA)) + { + DEBUGP("cloop_do_request: bad command\n"); + goto error_continue; + } + clo = req->rq_disk->private_data; + if (unlikely(!clo->backing_file && !clo->suspended)) + { + DEBUGP("cloop_do_request: not connected to a file\n"); + goto error_continue; + } + list_add_tail(&req->queuelist, &clo->clo_list); /* Add to working list for thread */ + wake_up(&clo->clo_event); /* Wake up cloop_thread */ + continue; /* next request */ + error_continue: + DEBUGP(KERN_ERR "cloop_do_request: Discarding request %p.\n", req); + req->errors++; + __blk_end_request_all(req, -EIO); + } +} + +/* Read header and offsets from already opened file */ +static int cloop_set_file(int cloop_num, struct file *file, char *filename) +{ + struct cloop_device *clo = cloop_dev[cloop_num]; + struct inode *inode; + char *bbuf=NULL; + unsigned int i, offsets_read, total_offsets; + int isblkdev; + int error = 0; + inode = file->f_dentry->d_inode; + isblkdev=S_ISBLK(inode->i_mode)?1:0; + if(!isblkdev&&!S_ISREG(inode->i_mode)) + { + printk(KERN_ERR "%s: %s not a regular file or block device\n", + cloop_name, filename); + error=-EBADF; goto error_release; + } + clo->backing_file = file; + clo->backing_inode= inode ; + if(!isblkdev&&inode->i_size= %u bytes)\n", + cloop_name, (unsigned long)inode->i_size, + (unsigned)sizeof(struct cloop_head)); + error=-EBADF; goto error_release; + } + /* In suspended mode, we have done all checks necessary - FF */ + if (clo->suspended) + return error; + if(isblkdev) + { + struct request_queue *q = bdev_get_queue(inode->i_bdev); + blk_queue_max_hw_sectors(clo->clo_queue, queue_max_hw_sectors(q)); /* Renamed in 2.6.34 */ + blk_queue_max_segments(clo->clo_queue, queue_max_segments(q)); /* Renamed in 2.6.34 */ + /* blk_queue_max_hw_segments(clo->clo_queue, queue_max_hw_segments(q)); */ /* Removed in 2.6.34 */ + blk_queue_max_segment_size(clo->clo_queue, queue_max_segment_size(q)); + blk_queue_segment_boundary(clo->clo_queue, queue_segment_boundary(q)); + blk_queue_merge_bvec(clo->clo_queue, q->merge_bvec_fn); + clo->underlying_blksize = block_size(inode->i_bdev); + } + else + clo->underlying_blksize = PAGE_SIZE; + DEBUGP("Underlying blocksize is %u\n", clo->underlying_blksize); + bbuf = cloop_malloc(clo->underlying_blksize); + if(!bbuf) + { + printk(KERN_ERR "%s: out of kernel mem for block buffer (%lu bytes)\n", + cloop_name, (unsigned long)clo->underlying_blksize); + error=-ENOMEM; goto error_release; + } + total_offsets = 1; /* Dummy total_offsets: will be filled in first time around */ + for (i = 0, offsets_read = 0; offsets_read < total_offsets; i++) + { + unsigned int offset = 0, num_readable; + size_t bytes_read = cloop_read_from_file(clo, file, bbuf, + i*clo->underlying_blksize, + clo->underlying_blksize); + if(bytes_read != clo->underlying_blksize) + { + printk(KERN_ERR "%s: Bad file, read() of first %lu bytes returned %d.\n", + cloop_name, (unsigned long)clo->underlying_blksize, (int)bytes_read); + error=-EBADF; + goto error_release; + } + /* Header will be in block zero */ + if(i==0) + { + memcpy(&clo->head, bbuf, sizeof(struct cloop_head)); + offset = sizeof(struct cloop_head); + if (ntohl(clo->head.block_size) % 512 != 0) + { + printk(KERN_ERR "%s: blocksize %u not multiple of 512\n", + cloop_name, ntohl(clo->head.block_size)); + error=-EBADF; goto error_release; + } + if (clo->head.preamble[0x0B]!='V'||clo->head.preamble[0x0C]<'1') + { + printk(KERN_ERR "%s: Cannot read old 32-bit (version 0.68) images, " + "please use an older version of %s for this file.\n", + cloop_name, cloop_name); + error=-EBADF; goto error_release; + } + if (clo->head.preamble[0x0C]<'2') + { + printk(KERN_ERR "%s: Cannot read old architecture-dependent " + "(format <= 1.0) images, please use an older " + "version of %s for this file.\n", + cloop_name, cloop_name); + error=-EBADF; goto error_release; + } + total_offsets=ntohl(clo->head.num_blocks)+1; + if (!isblkdev && (sizeof(struct cloop_head)+sizeof(loff_t)* + total_offsets > inode->i_size)) + { + printk(KERN_ERR "%s: file too small for %u blocks\n", + cloop_name, ntohl(clo->head.num_blocks)); + error=-EBADF; goto error_release; + } + clo->offsets = cloop_malloc(sizeof(loff_t) * total_offsets); + if (!clo->offsets) + { + printk(KERN_ERR "%s: out of kernel mem for offsets\n", cloop_name); + error=-ENOMEM; goto error_release; + } + } + num_readable = MIN(total_offsets - offsets_read, + (clo->underlying_blksize - offset) + / sizeof(loff_t)); + memcpy(&clo->offsets[offsets_read], bbuf+offset, num_readable * sizeof(loff_t)); + offsets_read += num_readable; + } + { /* Search for largest block rather than estimate. KK. */ + int i; + for(i=0;ioffsets[i+1]) - be64_to_cpu(clo->offsets[i]); + clo->largest_block=MAX(clo->largest_block,d); + } + printk(KERN_INFO "%s: %s: %u blocks, %u bytes/block, largest block is %lu bytes.\n", + cloop_name, filename, ntohl(clo->head.num_blocks), + ntohl(clo->head.block_size), clo->largest_block); + } +/* Combo kmalloc used too large chunks (>130000). */ + { + int i; + for(i=0;ibuffer[i] = cloop_malloc(ntohl(clo->head.block_size)); + if(!clo->buffer[i]) + { + printk(KERN_ERR "%s: out of memory for buffer %lu\n", + cloop_name, (unsigned long) ntohl(clo->head.block_size)); + error=-ENOMEM; goto error_release_free; + } + } + } + clo->compressed_buffer = cloop_malloc(clo->largest_block); + if(!clo->compressed_buffer) + { + printk(KERN_ERR "%s: out of memory for compressed buffer %lu\n", + cloop_name, clo->largest_block); + error=-ENOMEM; goto error_release_free_buffer; + } + clo->zstream.workspace = cloop_malloc(zlib_inflate_workspacesize()); + if(!clo->zstream.workspace) + { + printk(KERN_ERR "%s: out of mem for zlib working area %u\n", + cloop_name, zlib_inflate_workspacesize()); + error=-ENOMEM; goto error_release_free_all; + } + zlib_inflateInit(&clo->zstream); + if(!isblkdev && + be64_to_cpu(clo->offsets[ntohl(clo->head.num_blocks)]) != inode->i_size) + { + printk(KERN_ERR "%s: final offset wrong (%Lu not %Lu)\n", + cloop_name, + be64_to_cpu(clo->offsets[ntohl(clo->head.num_blocks)]), + inode->i_size); + cloop_free(clo->zstream.workspace, zlib_inflate_workspacesize()); clo->zstream.workspace=NULL; + goto error_release_free_all; + } + { + int i; + for(i=0; ibuffered_blocknum[i] = -1; + clo->current_bufnum=0; + } + set_capacity(clo->clo_disk, (sector_t)(ntohl(clo->head.num_blocks)* + (ntohl(clo->head.block_size)>>9))); + clo->clo_thread = kthread_create(cloop_thread, clo, "cloop%d", cloop_num); + if(IS_ERR(clo->clo_thread)) + { + error = PTR_ERR(clo->clo_thread); + clo->clo_thread=NULL; + goto error_release_free_all; + } + if(preload > 0) + { + clo->preload_array_size = ((preload<=ntohl(clo->head.num_blocks))?preload:ntohl(clo->head.num_blocks)); + clo->preload_size = 0; + if((clo->preload_cache = cloop_malloc(clo->preload_array_size * sizeof(char *))) != NULL) + { + int i; + for(i=0; ipreload_array_size; i++) + { + if((clo->preload_cache[i] = cloop_malloc(ntohl(clo->head.block_size))) == NULL) + { /* Out of memory */ + printk(KERN_WARNING "%s: cloop_malloc(%d) failed for preload_cache[%d] (ignored).\n", + cloop_name, ntohl(clo->head.block_size), i); + break; + } + } + clo->preload_size = i; + for(i=0; ipreload_size; i++) + { + int buffered_blocknum = cloop_load_buffer(clo,i); + if(buffered_blocknum >= 0) + { + memcpy(clo->preload_cache[i], clo->buffer[buffered_blocknum], + ntohl(clo->head.block_size)); + } + else + { + printk(KERN_WARNING "%s: can't read block %d into preload cache, set to zero.\n", + cloop_name, i); + memset(clo->preload_cache[i], 0, ntohl(clo->head.block_size)); + } + } + printk(KERN_INFO "%s: preloaded %d blocks into cache.\n", cloop_name, + (int)clo->preload_size); + } + else + { + /* It is not a fatal error if cloop_malloc(clo->preload_size) + * fails, then we just go without cache, but we should at least + * let the user know. */ + printk(KERN_WARNING "%s: cloop_malloc(%d) failed, continuing without preloaded buffers.\n", + cloop_name, (int)(clo->preload_size * sizeof(char *))); + clo->preload_array_size = clo->preload_size = 0; + } + } + wake_up_process(clo->clo_thread); + /* Uncheck */ + return error; +error_release_free_all: + cloop_free(clo->compressed_buffer, clo->largest_block); + clo->compressed_buffer=NULL; +error_release_free_buffer: + { + int i; + for(i=0; ibuffer[i]) + { + cloop_free(clo->buffer[i], ntohl(clo->head.block_size)); + clo->buffer[i]=NULL; + } + } + } +error_release_free: + cloop_free(clo->offsets, sizeof(loff_t) * total_offsets); + clo->offsets=NULL; +error_release: + if(bbuf) cloop_free(bbuf, clo->underlying_blksize); + clo->backing_file=NULL; + return error; +} + +/* Get file from ioctl arg (only losetup) */ +static int cloop_set_fd(int cloop_num, struct file *clo_file, + struct block_device *bdev, unsigned int arg) +{ + struct cloop_device *clo = cloop_dev[cloop_num]; + struct file *file=NULL; + int error = 0; + + /* Already an allocated file present */ + if(clo->backing_file) return -EBUSY; + file = fget(arg); /* get filp struct from ioctl arg fd */ + if(!file) return -EBADF; + error=cloop_set_file(cloop_num,file,"losetup_file"); + set_device_ro(bdev, 1); + if(error) fput(file); + return error; +} + +/* Drop file and free buffers, both ioctl and initial_file */ +static int cloop_clr_fd(int cloop_num, struct block_device *bdev) +{ + struct cloop_device *clo = cloop_dev[cloop_num]; + struct file *filp = clo->backing_file; + int i; + if(clo->refcnt > 1) /* we needed one fd for the ioctl */ + return -EBUSY; + if(filp==NULL) return -EINVAL; + if(clo->clo_thread) { kthread_stop(clo->clo_thread); clo->clo_thread=NULL; } + if(filp!=initial_file) fput(filp); + else { filp_close(initial_file,0); initial_file=NULL; } + clo->backing_file = NULL; + clo->backing_inode = NULL; + if(clo->offsets) { cloop_free(clo->offsets, clo->underlying_blksize); clo->offsets = NULL; } + if(clo->preload_cache) + { + for(i=0; i < clo->preload_size; i++) + cloop_free(clo->preload_cache[i], ntohl(clo->head.block_size)); + cloop_free(clo->preload_cache, clo->preload_array_size * sizeof(char *)); + clo->preload_cache = NULL; + clo->preload_size = clo->preload_array_size = 0; + } + for(i=0; ibuffer[i]) { cloop_free(clo->buffer[i], ntohl(clo->head.block_size)); clo->buffer[i]=NULL; } + if(clo->compressed_buffer) { cloop_free(clo->compressed_buffer, clo->largest_block); clo->compressed_buffer = NULL; } + zlib_inflateEnd(&clo->zstream); + if(clo->zstream.workspace) { cloop_free(clo->zstream.workspace, zlib_inflate_workspacesize()); clo->zstream.workspace = NULL; } + if(bdev) invalidate_bdev(bdev); + if(clo->clo_disk) set_capacity(clo->clo_disk, 0); + return 0; +} + +static int clo_suspend_fd(int cloop_num) +{ + struct cloop_device *clo = cloop_dev[cloop_num]; + struct file *filp = clo->backing_file; + if(filp==NULL || clo->suspended) return -EINVAL; + /* Suspend all running requests - FF */ + clo->suspended=1; + if(filp!=initial_file) fput(filp); + else { filp_close(initial_file,0); initial_file=NULL; } + clo->backing_file = NULL; + clo->backing_inode = NULL; + return 0; +} + +/* Copied from loop.c, stripped down to the really necessary */ +static int cloop_set_status(struct cloop_device *clo, + const struct loop_info64 *info) +{ + if (!clo->backing_file) return -ENXIO; + memcpy(clo->clo_file_name, info->lo_file_name, LO_NAME_SIZE); + clo->clo_file_name[LO_NAME_SIZE-1] = 0; + return 0; +} + +static int cloop_get_status(struct cloop_device *clo, + struct loop_info64 *info) +{ + struct file *file = clo->backing_file; + struct kstat stat; + int err; + if (!file) return -ENXIO; + err = vfs_getattr(file->f_path.mnt, file->f_path.dentry, &stat); + if (err) return err; + memset(info, 0, sizeof(*info)); + info->lo_number = clo->clo_number; + info->lo_device = huge_encode_dev(stat.dev); + info->lo_inode = stat.ino; + info->lo_rdevice = huge_encode_dev(clo->isblkdev ? stat.rdev : stat.dev); + info->lo_offset = 0; + info->lo_sizelimit = 0; + info->lo_flags = 0; + memcpy(info->lo_file_name, clo->clo_file_name, LO_NAME_SIZE); + return 0; +} + +static void cloop_info64_from_old(const struct loop_info *info, + struct loop_info64 *info64) +{ + memset(info64, 0, sizeof(*info64)); + info64->lo_number = info->lo_number; + info64->lo_device = info->lo_device; + info64->lo_inode = info->lo_inode; + info64->lo_rdevice = info->lo_rdevice; + info64->lo_offset = info->lo_offset; + info64->lo_sizelimit = 0; + info64->lo_flags = info->lo_flags; + info64->lo_init[0] = info->lo_init[0]; + info64->lo_init[1] = info->lo_init[1]; + memcpy(info64->lo_file_name, info->lo_name, LO_NAME_SIZE); +} + +static int cloop_info64_to_old(const struct loop_info64 *info64, + struct loop_info *info) +{ + memset(info, 0, sizeof(*info)); + info->lo_number = info64->lo_number; + info->lo_device = info64->lo_device; + info->lo_inode = info64->lo_inode; + info->lo_rdevice = info64->lo_rdevice; + info->lo_offset = info64->lo_offset; + info->lo_flags = info64->lo_flags; + info->lo_init[0] = info64->lo_init[0]; + info->lo_init[1] = info64->lo_init[1]; + memcpy(info->lo_name, info64->lo_file_name, LO_NAME_SIZE); + return 0; +} + +static int cloop_set_status_old(struct cloop_device *clo, + const struct loop_info __user *arg) +{ + struct loop_info info; + struct loop_info64 info64; + + if (copy_from_user(&info, arg, sizeof (struct loop_info))) return -EFAULT; + cloop_info64_from_old(&info, &info64); + return cloop_set_status(clo, &info64); +} + +static int cloop_set_status64(struct cloop_device *clo, + const struct loop_info64 __user *arg) +{ + struct loop_info64 info64; + if (copy_from_user(&info64, arg, sizeof (struct loop_info64))) + return -EFAULT; + return cloop_set_status(clo, &info64); +} + +static int cloop_get_status_old(struct cloop_device *clo, + struct loop_info __user *arg) +{ + struct loop_info info; + struct loop_info64 info64; + int err = 0; + + if (!arg) err = -EINVAL; + if (!err) err = cloop_get_status(clo, &info64); + if (!err) err = cloop_info64_to_old(&info64, &info); + if (!err && copy_to_user(arg, &info, sizeof(info))) err = -EFAULT; + return err; +} + +static int cloop_get_status64(struct cloop_device *clo, + struct loop_info64 __user *arg) +{ + struct loop_info64 info64; + int err = 0; + if (!arg) err = -EINVAL; + if (!err) err = cloop_get_status(clo, &info64); + if (!err && copy_to_user(arg, &info64, sizeof(info64))) err = -EFAULT; + return err; +} +/* EOF get/set_status */ + + +static int cloop_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + struct cloop_device *clo; + int cloop_num, err=0; + if (!bdev) return -EINVAL; + cloop_num = MINOR(bdev->bd_dev); + if (cloop_num < 0 || cloop_num > cloop_count-1) return -ENODEV; + clo = cloop_dev[cloop_num]; + mutex_lock(&clo->clo_ctl_mutex); + switch (cmd) + { /* We use the same ioctls that loop does */ + case LOOP_CHANGE_FD: + case LOOP_SET_FD: + err = cloop_set_fd(cloop_num, NULL, bdev, arg); + if (err == 0 && clo->suspended) + { + /* Okay, we have again a backing file - get reqs again - FF */ + clo->suspended=0; + } + break; + case LOOP_CLR_FD: + err = cloop_clr_fd(cloop_num, bdev); + break; + case LOOP_SET_STATUS: + err = cloop_set_status_old(clo, (struct loop_info __user *) arg); + break; + case LOOP_GET_STATUS: + err = cloop_get_status_old(clo, (struct loop_info __user *) arg); + break; + case LOOP_SET_STATUS64: + err = cloop_set_status64(clo, (struct loop_info64 __user *) arg); + break; + case LOOP_GET_STATUS64: + err = cloop_get_status64(clo, (struct loop_info64 __user *) arg); + break; + case CLOOP_SUSPEND: + err = clo_suspend_fd(cloop_num); + break; + default: + err = -EINVAL; + } + mutex_unlock(&clo->clo_ctl_mutex); + return err; +} + +#ifdef CONFIG_COMPAT +static int cloop_compat_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + switch(cmd) { + case LOOP_SET_CAPACITY: /* Change arg */ + case LOOP_CLR_FD: /* Change arg */ + case LOOP_GET_STATUS64: /* Change arg */ + case LOOP_SET_STATUS64: /* Change arg */ + arg = (unsigned long) compat_ptr(arg); + case LOOP_SET_STATUS: /* unchanged */ + case LOOP_GET_STATUS: /* unchanged */ + case LOOP_SET_FD: /* unchanged */ + case LOOP_CHANGE_FD: /* unchanged */ + return cloop_ioctl(bdev, mode, cmd, arg); + break; + } + return -ENOIOCTLCMD; +} +#endif + + +static int cloop_open(struct block_device *bdev, fmode_t mode) +{ + int cloop_num; + if(!bdev) return -EINVAL; + cloop_num=MINOR(bdev->bd_dev); + if(cloop_num > cloop_count-1) return -ENODEV; + /* Allow write open for ioctl, but not for mount. */ + /* losetup uses write-open and flags=0x8002 to set a new file */ + if(mode & FMODE_WRITE) + { + printk(KERN_WARNING "%s: Can't open device read-write in mode 0x%x\n", cloop_name, mode); + return -EROFS; + } + cloop_dev[cloop_num]->refcnt+=1; + return 0; +} + +static int cloop_close(struct gendisk *disk, fmode_t mode) +{ + int cloop_num, err=0; + if(!disk) return 0; + cloop_num=((struct cloop_device *)disk->private_data)->clo_number; + if(cloop_num < 0 || cloop_num > (cloop_count-1)) return 0; + cloop_dev[cloop_num]->refcnt-=1; + return err; +} + +static struct block_device_operations clo_fops = +{ + owner: THIS_MODULE, + open: cloop_open, + release: cloop_close, +#ifdef CONFIG_COMPAT + compat_ioctl: cloop_compat_ioctl, +#endif + ioctl: cloop_ioctl + /* locked_ioctl ceased to exist in 2.6.36 */ +}; + +static int cloop_register_blkdev(int major_nr) +{ + return register_blkdev(major_nr, cloop_name); +} + +static int cloop_unregister_blkdev(void) +{ + unregister_blkdev(cloop_major, cloop_name); + return 0; +} + +static int cloop_alloc(int cloop_num) +{ + struct cloop_device *clo = (struct cloop_device *) cloop_malloc(sizeof(struct cloop_device));; + if(clo == NULL) goto error_out; + cloop_dev[cloop_num] = clo; + memset(clo, 0, sizeof(struct cloop_device)); + clo->clo_number = cloop_num; + clo->clo_thread = NULL; + init_waitqueue_head(&clo->clo_event); + spin_lock_init(&clo->queue_lock); + mutex_init(&clo->clo_ctl_mutex); + INIT_LIST_HEAD(&clo->clo_list); + clo->clo_queue = blk_init_queue(cloop_do_request, &clo->queue_lock); + if(!clo->clo_queue) + { + printk(KERN_ERR "%s: Unable to alloc queue[%d]\n", cloop_name, cloop_num); + goto error_out; + } + clo->clo_queue->queuedata = clo; + clo->clo_disk = alloc_disk(1); + if(!clo->clo_disk) + { + printk(KERN_ERR "%s: Unable to alloc disk[%d]\n", cloop_name, cloop_num); + goto error_disk; + } + clo->clo_disk->major = cloop_major; + clo->clo_disk->first_minor = cloop_num; + clo->clo_disk->fops = &clo_fops; + clo->clo_disk->queue = clo->clo_queue; + clo->clo_disk->private_data = clo; + sprintf(clo->clo_disk->disk_name, "%s%d", cloop_name, cloop_num); + add_disk(clo->clo_disk); + return 0; +error_disk: + blk_cleanup_queue(clo->clo_queue); +error_out: + return -ENOMEM; +} + +static void cloop_dealloc(int cloop_num) +{ + struct cloop_device *clo = cloop_dev[cloop_num]; + if(clo == NULL) return; + del_gendisk(clo->clo_disk); + blk_cleanup_queue(clo->clo_queue); + put_disk(clo->clo_disk); + cloop_free(clo, sizeof(struct cloop_device)); + cloop_dev[cloop_num] = NULL; +} + +static int __init cloop_init(void) +{ + int error=0; + printk("%s: Initializing %s v"CLOOP_VERSION"\n", cloop_name, cloop_name); + cloop_dev = (struct cloop_device **)cloop_malloc(cloop_max * sizeof(struct cloop_device *)); + if(cloop_dev == NULL) return -ENOMEM; + memset(cloop_dev, 0, cloop_max * sizeof(struct cloop_device *)); + cloop_count=0; + cloop_major=MAJOR_NR; + if(cloop_register_blkdev(MAJOR_NR)) + { + printk(KERN_WARNING "%s: Unable to get major device %d\n", cloop_name, + MAJOR_NR); + /* Try dynamic allocation */ + if((cloop_major=cloop_register_blkdev(0))<0) + { + printk(KERN_ERR "%s: Unable to get dynamic major device\n", cloop_name); + error = -EIO; + goto init_out_cloop_free; + } + printk(KERN_INFO "%s: Got dynamic major device %d, " + "mknod /dev/%s b %d 0\n", + cloop_name, cloop_major, cloop_name, cloop_major); + } + while(cloop_count= LO_NAME_SIZE) namelen = LO_NAME_SIZE-1; + memcpy(cloop_dev[0]->clo_file_name, file, namelen); + cloop_dev[0]->clo_file_name[namelen] = 0; + } + return 0; +init_out_dealloc: + while (cloop_count>0) cloop_dealloc(--cloop_count); + cloop_unregister_blkdev(); +init_out_cloop_free: + cloop_free(cloop_dev, cloop_max * sizeof(struct cloop_device *)); + cloop_dev = NULL; + return error; +} + +static void __exit cloop_exit(void) +{ + int error=0; + if((error=cloop_unregister_blkdev())!=0) + { + printk(KERN_ERR "%s: cannot unregister block device\n", cloop_name); + return; + } + while(cloop_count>0) + { + --cloop_count; + if(cloop_dev[cloop_count]->backing_file) cloop_clr_fd(cloop_count, NULL); + cloop_dealloc(cloop_count); + } + printk("%s: unloaded.\n", cloop_name); +} + +/* The cloop init and exit function registration (especially needed for Kernel 2.6) */ +module_init(cloop_init); +module_exit(cloop_exit); + +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); diff -Nru cloop-2.6.31.1.1ubuntu1/cloop.h cloop-2.6.39.2/cloop.h --- cloop-2.6.31.1.1ubuntu1/cloop.h 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/cloop.h 2007-02-25 21:19:45.000000000 +0000 @@ -0,0 +1,26 @@ +#ifndef _COMPRESSED_LOOP_H +#define _COMPRESSED_LOOP_H + +#define CLOOP_HEADROOM 128 + +/* The cloop header usually looks like this: */ +/* #!/bin/sh */ +/* #V2.00 Format */ +/* ...padding up to CLOOP_HEADROOM... */ +/* block_size (32bit number, network order) */ +/* num_blocks (32bit number, network order) */ + +struct cloop_head +{ + char preamble[CLOOP_HEADROOM]; + u_int32_t block_size; + u_int32_t num_blocks; +}; + +/* data_index (num_blocks 64bit pointers, network order)... */ +/* compressed data (gzip block compressed format)... */ + +/* Cloop suspend IOCTL */ +#define CLOOP_SUSPEND 0x4C07 + +#endif /*_COMPRESSED_LOOP_H*/ diff -Nru cloop-2.6.31.1.1ubuntu1/cloop.mod.c cloop-2.6.39.2/cloop.mod.c --- cloop-2.6.31.1.1ubuntu1/cloop.mod.c 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/cloop.mod.c 2011-07-06 16:40:58.000000000 +0000 @@ -0,0 +1,89 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +struct module __this_module +__attribute__((section(".gnu.linkonce.this_module"))) = { + .name = KBUILD_MODNAME, + .init = init_module, +#ifdef CONFIG_MODULE_UNLOAD + .exit = cleanup_module, +#endif + .arch = MODULE_ARCH_INIT, +}; + +static const struct modversion_info ____versions[] +__used +__attribute__((section("__versions"))) = { + { 0x2d8a3ad2, "module_layout" }, + { 0xacc1ebd1, "param_ops_charp" }, + { 0x13095525, "param_ops_uint" }, + { 0xb5a459dc, "unregister_blkdev" }, + { 0xfc9e6734, "filp_open" }, + { 0xd0d8621b, "strlen" }, + { 0x4f44a1a4, "add_disk" }, + { 0x3c2c5af5, "sprintf" }, + { 0x652fcada, "alloc_disk" }, + { 0xc2cb9a20, "blk_init_queue" }, + { 0xe8cab308, "__mutex_init" }, + { 0xe174aa7, "__init_waitqueue_head" }, + { 0x71a50dbc, "register_blkdev" }, + { 0xc7df9c09, "set_device_ro" }, + { 0x45e9a79, "fget" }, + { 0x834e02c3, "mutex_unlock" }, + { 0xdcc4d3, "mutex_lock" }, + { 0xc6265ac8, "wake_up_process" }, + { 0x920059bf, "kthread_create_on_node" }, + { 0xa9630bdb, "blk_queue_merge_bvec" }, + { 0xf374ba0c, "blk_queue_segment_boundary" }, + { 0x9df0faa, "blk_queue_max_segment_size" }, + { 0xbba977a5, "blk_queue_max_segments" }, + { 0x49244a3c, "blk_queue_max_hw_sectors" }, + { 0xb00ccc33, "finish_wait" }, + { 0xe75663a, "prepare_to_wait" }, + { 0x4292364c, "schedule" }, + { 0xc8b57c27, "autoremove_wake_function" }, + { 0x88941a06, "_raw_spin_unlock_irqrestore" }, + { 0x587c70d8, "_raw_spin_lock_irqsave" }, + { 0xc37aad4a, "kunmap" }, + { 0x2e60bace, "memcpy" }, + { 0x2945edfe, "kmap" }, + { 0x6f5427, "_raw_spin_unlock_irq" }, + { 0xf333a2fb, "_raw_spin_lock_irq" }, + { 0xd2965f6f, "kthread_should_stop" }, + { 0xae1ffdd4, "set_user_nice" }, + { 0x3d91e0b3, "current_task" }, + { 0x4211c3c1, "zlib_inflateInit2" }, + { 0x881039d0, "zlib_inflate" }, + { 0x3ed63055, "zlib_inflateReset" }, + { 0x2bc95bd4, "memset" }, + { 0xeccf092, "vfs_read" }, + { 0x12da5bb2, "__kmalloc" }, + { 0xd6ee688f, "vmalloc" }, + { 0x50eedeb8, "printk" }, + { 0x272dbc4f, "__blk_end_request_all" }, + { 0xb2ba701, "blk_fetch_request" }, + { 0xf09c7f68, "__wake_up" }, + { 0x2da418b5, "copy_to_user" }, + { 0xc00559f3, "vfs_getattr" }, + { 0x33d169c9, "_copy_from_user" }, + { 0xf744654c, "put_disk" }, + { 0xa67c7a0c, "blk_cleanup_queue" }, + { 0x78a9f01a, "del_gendisk" }, + { 0x9cf53a18, "filp_close" }, + { 0x637a9b32, "invalidate_bdev" }, + { 0xce5ac24f, "zlib_inflate_workspacesize" }, + { 0x77ecac9f, "zlib_inflateEnd" }, + { 0x2ebdc1d9, "fput" }, + { 0xb928dcba, "kthread_stop" }, + { 0x37a0cba, "kfree" }, + { 0x999e8297, "vfree" }, +}; + +static const char __module_depends[] +__used +__attribute__((section(".modinfo"))) = +"depends="; + Binary files /tmp/6zGgNIJYpE/cloop-2.6.31.1.1ubuntu1/cloop_suspend and /tmp/FnZnSXm8U_/cloop-2.6.39.2/cloop_suspend differ diff -Nru cloop-2.6.31.1.1ubuntu1/cloop_suspend.c cloop-2.6.39.2/cloop_suspend.c --- cloop-2.6.31.1.1ubuntu1/cloop_suspend.c 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/cloop_suspend.c 2011-07-06 16:47:58.000000000 +0000 @@ -18,60 +18,15 @@ /* We don't use the structure, so that define does not hurt */ #define dev_t int #include -#include "compressed_loop.h" +#include "cloop.h" int main(int argc, char** argv) { if (argc < 2) { - fprintf(stderr, "syntax: cloop_suspend \n"); - return 1; - } - int fd = open(argv[1], O_RDONLY); - - if (fd < 0) - { - perror(argv[1]); - return 1; - } - - if (ioctl(fd, CLOOP_SUSPEND) < 0) - { - perror("ioctl: CLOOP_SUSPEND"); - return 1; - } - - close(fd); - - return 0; -} -/* - * cloop_suspend - Suspend a cloop device until losetup /dev/cloop is - * run again. - * - * Copyright (c) 2007 by Fabian Franz. - * - * License: GPL, v2. - * - */ - -#include -#include -#include -#include -#include -#include - -/* We don't use the structure, so that define does not hurt */ -#define dev_t int -#include -#include "compressed_loop.h" - -int main(int argc, char** argv) -{ - if (argc < 2) - { - fprintf(stderr, "syntax: cloop_suspend \n"); + fprintf(stderr, "syntax: %s \n", argv[0]); + fprintf(stderr, " suspends and unlocks cloop \n"); + fprintf(stderr, " until a new file is loaded via losetup\n"); return 1; } int fd = open(argv[1], O_RDONLY); diff -Nru cloop-2.6.31.1.1ubuntu1/compressed_loop.c cloop-2.6.39.2/compressed_loop.c --- cloop-2.6.31.1.1ubuntu1/compressed_loop.c 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/compressed_loop.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1042 +0,0 @@ -/* - * compressed_loop.c: Read-only compressed loop blockdevice - * hacked up by Rusty in 1999, extended and maintained by Klaus Knopper - * - * A cloop file looks like this: - * [32-bit uncompressed block size: network order] - * [32-bit number of blocks (n_blocks): network order] - * [64-bit file offsets of start of blocks: network order] - * ... - * (n_blocks + 1). - * n_blocks consisting of: - * [compressed block] - * - * Every version greatly inspired by code seen in loop.c - * by Theodore Ts'o, 3/29/93. - * - * Copyright 1999-2009 by Paul `Rusty' Russell & Klaus Knopper. - * Redistribution of this file is permitted under the GNU Public License. - * - */ - -#define CLOOP_NAME "cloop" -#define CLOOP_VERSION "2.631" -#define CLOOP_MAX 8 - -#ifndef KBUILD_MODNAME -#define KBUILD_MODNAME cloop -#endif - -#ifndef KBUILD_BASENAME -#define KBUILD_BASENAME cloop -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* do_div() for 64bit division */ -#include -#include -/* Use zlib_inflate from lib/zlib_inflate */ -#include -#include -#include -#include "compressed_loop.h" - -/* New License scheme */ -#ifdef MODULE_LICENSE -MODULE_LICENSE("GPL"); -#endif -#ifdef MODULE_AUTHOR -MODULE_AUTHOR("Klaus Knopper (current maintainer), Paul Russel (initial Kernel 2.2 version)"); -#endif -#ifdef MODULE_DESCRIPTION -MODULE_DESCRIPTION("Transparently decompressing loopback block device"); -#endif - -#ifndef MIN -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - -/* Use experimental major for now */ -#define MAJOR_NR 240 - -/* #define DEVICE_NAME CLOOP_NAME */ -/* #define DEVICE_NR(device) (MINOR(device)) */ -/* #define DEVICE_ON(device) */ -/* #define DEVICE_OFF(device) */ -/* #define DEVICE_NO_RANDOM */ -/* #define TIMEOUT_VALUE (6 * HZ) */ - -#include -#include - -#if 0 -#define DEBUGP printk -#else -#define DEBUGP(format, x...) -#endif - -/* One file can be opened at module insertion time */ -/* insmod cloop file=/path/to/file */ -static char *file=NULL; -static unsigned int preload=0; -module_param(file, charp, 0); -module_param(preload, uint, 0); -MODULE_PARM_DESC(file, "Initial cloop image file (full path) for /dev/cloop"); -MODULE_PARM_DESC(preload, "Preload n blocks of cloop data into memory"); - -static struct file *initial_file=NULL; -static int cloop_major=MAJOR_NR; - -/* Number of buffered decompressed blocks */ -#define BUFFERED_BLOCKS 8 -struct cloop_device -{ - /* Copied straight from the file */ - struct cloop_head head; - - /* An array of offsets of compressed blocks within the file */ - loff_t *offsets; - - /* We buffer some uncompressed blocks for performance */ - int buffered_blocknum[BUFFERED_BLOCKS]; - int current_bufnum; - void *buffer[BUFFERED_BLOCKS]; - void *compressed_buffer; - size_t preload_array_size; /* Size of pointer array in blocks */ - size_t preload_size; /* Number of successfully allocated blocks */ - char **preload_cache; /* Pointers to preloaded blocks */ - - z_stream zstream; - - struct file *backing_file; /* associated file */ - struct inode *backing_inode; /* for bmap */ - - unsigned long largest_block; - unsigned int underlying_blksize; - int clo_number; - int refcnt; - struct block_device *bdev; - int isblkdev; - /* Lock for kernel block device queue */ - spinlock_t queue_lock; - struct list_head clo_list; - struct task_struct *clo_thread; - wait_queue_head_t clo_event; - struct request_queue *clo_queue; - struct gendisk *clo_disk; - int suspended; - char clo_file_name[LO_NAME_SIZE]; -}; - -static struct cloop_device cloop_dev[CLOOP_MAX]; -static const char *cloop_name=CLOOP_NAME; -static const int cloop_max = CLOOP_MAX; -static int cloop_count = 0; - -#if (!(defined(CONFIG_ZLIB_INFLATE) || defined(CONFIG_ZLIB_INFLATE_MODULE))) /* Must be compiled into kernel. */ -#error "Invalid Kernel configuration. CONFIG_ZLIB_INFLATE support is needed for cloop." -#endif - -/* Use __get_free_pages instead of vmalloc, allows up to 32 pages, - * 2MB in one piece */ -static void *cloop_malloc(size_t size) -{ - int order = get_order(size); - if(order <= KMALLOC_MAX_ORDER) - return (void *)kmalloc(size, GFP_KERNEL); - else if(order < MAX_ORDER) - return (void *)__get_free_pages(GFP_KERNEL, order); - return (void *)vmalloc(size); -} - -static void cloop_free(void *mem, size_t size) -{ - int order = get_order(size); - if(order <= KMALLOC_MAX_ORDER) - kfree(mem); - else if(order < MAX_ORDER) - free_pages((unsigned long)mem, order); - else vfree(mem); -} - -static int uncompress(struct cloop_device *clo, - unsigned char *dest, unsigned long *destLen, - unsigned char *source, unsigned long sourceLen) -{ - /* Most of this code can be found in fs/cramfs/uncompress.c */ - int err; - clo->zstream.next_in = source; - clo->zstream.avail_in = sourceLen; - clo->zstream.next_out = dest; - clo->zstream.avail_out = *destLen; - err = zlib_inflateReset(&clo->zstream); - if (err != Z_OK) - { - printk(KERN_ERR "%s: zlib_inflateReset error %d\n", cloop_name, err); - zlib_inflateEnd(&clo->zstream); zlib_inflateInit(&clo->zstream); - } - err = zlib_inflate(&clo->zstream, Z_FINISH); - *destLen = clo->zstream.total_out; - if (err != Z_STREAM_END) return err; - return Z_OK; -} - -static ssize_t cloop_read_from_file(struct cloop_device *clo, struct file *f, char *buf, - loff_t pos, size_t buf_len) -{ - size_t buf_done=0; - while (buf_done < buf_len) - { - size_t size = buf_len - buf_done, size_read; - /* kernel_read() only supports 32 bit offsets, so we use vfs_read() instead. */ - /* int size_read = kernel_read(f, pos, buf + buf_done, size); */ - mm_segment_t old_fs = get_fs(); - set_fs(get_ds()); - size_read = vfs_read(f, (void __user *)(buf + buf_done), size, &pos); - set_fs(old_fs); - - if(size_read <= 0) - { - printk(KERN_ERR "%s: Read error %d at pos %Lu in file %s, " - "%d bytes lost.\n", cloop_name, size_read, pos, - file, size); - memset(buf + buf_len - size, 0, size); - break; - } - buf_done += size_read; - } - return buf_done; -} - -/* This looks more complicated than it is */ -/* Returns number of block buffer to use for this request */ -static int cloop_load_buffer(struct cloop_device *clo, int blocknum) -{ - unsigned int buf_done = 0; - unsigned long buflen; - unsigned int buf_length; - int ret; - int i; - if(blocknum > ntohl(clo->head.num_blocks) || blocknum < 0) - { - printk(KERN_WARNING "%s: Invalid block number %d requested.\n", - cloop_name, blocknum); - return -1; - } - - /* Quick return if the block we seek is already in one of the buffers. */ - /* Return number of buffer */ - for(i=0; ibuffered_blocknum[i]) - { - DEBUGP(KERN_INFO "cloop_load_buffer: Found buffered block %d\n", i); - return i; - } - - buf_length = be64_to_cpu(clo->offsets[blocknum+1]) - be64_to_cpu(clo->offsets[blocknum]); - -/* Load one compressed block from the file. */ - cloop_read_from_file(clo, clo->backing_file, (char *)clo->compressed_buffer, - be64_to_cpu(clo->offsets[blocknum]), buf_length); - - buflen = ntohl(clo->head.block_size); - - /* Go to next position in the block ring buffer */ - clo->current_bufnum++; - if(clo->current_bufnum >= BUFFERED_BLOCKS) clo->current_bufnum = 0; - - /* Do the uncompression */ - ret = uncompress(clo, clo->buffer[clo->current_bufnum], &buflen, clo->compressed_buffer, - buf_length); - /* DEBUGP("cloop: buflen after uncompress: %ld\n",buflen); */ - if (ret != 0) - { - printk(KERN_ERR "%s: zlib decompression error %i uncompressing block %u %u/%lu/%u/%u " - "%Lu-%Lu\n", cloop_name, ret, blocknum, - ntohl(clo->head.block_size), buflen, buf_length, buf_done, - be64_to_cpu(clo->offsets[blocknum]), be64_to_cpu(clo->offsets[blocknum+1])); - clo->buffered_blocknum[clo->current_bufnum] = -1; - return -1; - } - clo->buffered_blocknum[clo->current_bufnum] = blocknum; - return clo->current_bufnum; -} - -/* This function does all the real work. */ -/* returns "uptodate" */ -static int cloop_handle_request(struct cloop_device *clo, struct request *req) -{ - int buffered_blocknum = -1; - int preloaded = 0; - loff_t offset = (loff_t) blk_rq_pos(req)<<9; /* req->sector<<9 */ - struct bio_vec *bvec; - struct req_iterator iter; - rq_for_each_segment(bvec, req, iter) - { - unsigned long len = bvec->bv_len; - char *to_ptr = kmap(bvec->bv_page) + bvec->bv_offset; - while(len > 0) - { - u_int32_t length_in_buffer; - loff_t block_offset = offset; - u_int32_t offset_in_buffer; - char *from_ptr; - /* do_div (div64.h) returns the 64bit division remainder and */ - /* puts the result in the first argument, i.e. block_offset */ - /* becomes the blocknumber to load, and offset_in_buffer the */ - /* position in the buffer */ - offset_in_buffer = do_div(block_offset, ntohl(clo->head.block_size)); - /* Lookup preload cache */ - if(block_offset < clo->preload_size && clo->preload_cache != NULL && - clo->preload_cache[block_offset] != NULL) - { /* Copy from cache */ - preloaded = 1; - from_ptr = clo->preload_cache[block_offset]; - } - else - { - preloaded = 0; - buffered_blocknum = cloop_load_buffer(clo,block_offset); - if(buffered_blocknum == -1) break; /* invalid data, leave inner loop */ - /* Copy from buffer */ - from_ptr = clo->buffer[buffered_blocknum]; - } - /* Now, at least part of what we want will be in the buffer. */ - length_in_buffer = ntohl(clo->head.block_size) - offset_in_buffer; - if(length_in_buffer > len) - { -/* DEBUGP("Warning: length_in_buffer=%u > len=%u\n", - length_in_buffer,len); */ - length_in_buffer = len; - } - memcpy(to_ptr, from_ptr + offset_in_buffer, length_in_buffer); - to_ptr += length_in_buffer; - len -= length_in_buffer; - offset += length_in_buffer; - } /* while inner loop */ - kunmap(bvec->bv_page); - } /* end rq_for_each_segment*/ - return ((buffered_blocknum!=-1) || preloaded); -} - -/* Adopted from loop.c, a kernel thread to handle physical reads and - * decompression. */ -static int cloop_thread(void *data) -{ - struct cloop_device *clo = data; - current->flags |= PF_NOFREEZE; - set_user_nice(current, -15); - while (!kthread_should_stop()||!list_empty(&clo->clo_list)) - { - int err; - err = wait_event_interruptible(clo->clo_event, !list_empty(&clo->clo_list) || - kthread_should_stop()); - if(unlikely(err)) - { - DEBUGP(KERN_ERR "cloop thread activated on error!? Continuing.\n"); - continue; - } - if(!list_empty(&clo->clo_list)) - { - struct request *req; - unsigned long flags; - int uptodate; - spin_lock_irq(&clo->queue_lock); - req = list_entry(clo->clo_list.next, struct request, queuelist); - list_del_init(&req->queuelist); - spin_unlock_irq(&clo->queue_lock); - uptodate = cloop_handle_request(clo, req); - spin_lock_irqsave(&clo->queue_lock, flags); - __blk_end_request_all(req, uptodate ? 0 : -EIO); - spin_unlock_irqrestore(&clo->queue_lock, flags); - } - } - DEBUGP(KERN_ERR "cloop_thread exited.\n"); - return 0; -} - -/* This is called by the kernel block queue management every now and then, - * with successive read requests qeued and sorted in a (hopefully) - * "most efficient way". spin_lock_irq() is being held by the kernel. */ -static void cloop_do_request(struct request_queue *q) -{ - struct request *req; - while((req = blk_fetch_request(q)) != NULL) - { - struct cloop_device *clo; - int rw; - /* quick sanity checks */ - if (unlikely(!blk_fs_request(req))) goto error_continue; - rw = rq_data_dir(req); - if (unlikely(rw != READ && rw != READA)) - { - DEBUGP("cloop_do_request: bad command\n"); - goto error_continue; - } - clo = req->rq_disk->private_data; - if (unlikely(!clo->backing_file && !clo->suspended)) - { - DEBUGP("cloop_do_request: not connected to a file\n"); - goto error_continue; - } - list_add_tail(&req->queuelist, &clo->clo_list); /* Add to working list for thread */ - wake_up(&clo->clo_event); /* Wake up cloop_thread */ - continue; /* next request */ - error_continue: - DEBUGP(KERN_ERR "cloop_do_request: Discarding request %p.\n", req); - req->errors++; - __blk_end_request_all(req, -EIO); - } -} - -/* Read header and offsets from already opened file */ -static int cloop_set_file(int cloop_num, struct file *file, char *filename) -{ - struct cloop_device *clo=&cloop_dev[cloop_num]; - struct inode *inode; - char *bbuf=NULL; - unsigned int i, offsets_read, total_offsets; - int isblkdev; - int error = 0; - inode = file->f_dentry->d_inode; - isblkdev=S_ISBLK(inode->i_mode)?1:0; - if(!isblkdev&&!S_ISREG(inode->i_mode)) - { - printk(KERN_ERR "%s: %s not a regular file or block device\n", - cloop_name, filename); - error=-EBADF; goto error_release; - } - clo->backing_file = file; - clo->backing_inode= inode ; - if(!isblkdev&&inode->i_size= %u bytes)\n", - cloop_name, (unsigned long)inode->i_size, - (unsigned)sizeof(struct cloop_head)); - error=-EBADF; goto error_release; - } - /* In suspended mode, we have done all checks necessary - FF */ - if (clo->suspended) - return error; - if(isblkdev) - { - struct request_queue *q = bdev_get_queue(inode->i_bdev); - blk_queue_max_sectors(clo->clo_queue, queue_max_sectors(q)); - blk_queue_max_phys_segments(clo->clo_queue, queue_max_phys_segments(q)); - blk_queue_max_hw_segments(clo->clo_queue, queue_max_hw_segments(q)); - blk_queue_max_segment_size(clo->clo_queue, queue_max_segment_size(q)); - blk_queue_segment_boundary(clo->clo_queue, queue_segment_boundary(q)); - blk_queue_merge_bvec(clo->clo_queue, q->merge_bvec_fn); - clo->underlying_blksize = block_size(inode->i_bdev); - } - else - clo->underlying_blksize = PAGE_SIZE; - DEBUGP("Underlying blocksize is %u\n", clo->underlying_blksize); - bbuf = cloop_malloc(clo->underlying_blksize); - if(!bbuf) - { - printk(KERN_ERR "%s: out of kernel mem for block buffer (%lu bytes)\n", - cloop_name, (unsigned long)clo->underlying_blksize); - error=-ENOMEM; goto error_release; - } - total_offsets = 1; /* Dummy total_offsets: will be filled in first time around */ - for (i = 0, offsets_read = 0; offsets_read < total_offsets; i++) - { - unsigned int offset = 0, num_readable; - size_t bytes_read = cloop_read_from_file(clo, file, bbuf, - i*clo->underlying_blksize, - clo->underlying_blksize); - if(bytes_read != clo->underlying_blksize) - { - printk(KERN_ERR "%s: Bad file, read() of first %lu bytes returned %d.\n", - cloop_name, (unsigned long)clo->underlying_blksize, (int)bytes_read); - error=-EBADF; - goto error_release; - } - /* Header will be in block zero */ - if(i==0) - { - memcpy(&clo->head, bbuf, sizeof(struct cloop_head)); - offset = sizeof(struct cloop_head); - if (ntohl(clo->head.block_size) % 512 != 0) - { - printk(KERN_ERR "%s: blocksize %u not multiple of 512\n", - cloop_name, ntohl(clo->head.block_size)); - error=-EBADF; goto error_release; - } - if (clo->head.preamble[0x0B]!='V'||clo->head.preamble[0x0C]<'1') - { - printk(KERN_ERR "%s: Cannot read old 32-bit (version 0.68) images, " - "please use an older version of %s for this file.\n", - cloop_name, cloop_name); - error=-EBADF; goto error_release; - } - if (clo->head.preamble[0x0C]<'2') - { - printk(KERN_ERR "%s: Cannot read old architecture-dependent " - "(format <= 1.0) images, please use an older " - "version of %s for this file.\n", - cloop_name, cloop_name); - error=-EBADF; goto error_release; - } - total_offsets=ntohl(clo->head.num_blocks)+1; - if (!isblkdev && (sizeof(struct cloop_head)+sizeof(loff_t)* - total_offsets > inode->i_size)) - { - printk(KERN_ERR "%s: file too small for %u blocks\n", - cloop_name, ntohl(clo->head.num_blocks)); - error=-EBADF; goto error_release; - } - clo->offsets = cloop_malloc(sizeof(loff_t) * total_offsets); - if (!clo->offsets) - { - printk(KERN_ERR "%s: out of kernel mem for offsets\n", cloop_name); - error=-ENOMEM; goto error_release; - } - } - num_readable = MIN(total_offsets - offsets_read, - (clo->underlying_blksize - offset) - / sizeof(loff_t)); - memcpy(&clo->offsets[offsets_read], bbuf+offset, num_readable * sizeof(loff_t)); - offsets_read += num_readable; - } - { /* Search for largest block rather than estimate. KK. */ - int i; - for(i=0;ioffsets[i+1]) - be64_to_cpu(clo->offsets[i]); - clo->largest_block=MAX(clo->largest_block,d); - } - printk(KERN_INFO "%s: %s: %u blocks, %u bytes/block, largest block is %lu bytes.\n", - cloop_name, filename, ntohl(clo->head.num_blocks), - ntohl(clo->head.block_size), clo->largest_block); - } -/* Combo kmalloc used too large chunks (>130000). */ - { - int i; - for(i=0;ibuffer[i] = cloop_malloc(ntohl(clo->head.block_size)); - if(!clo->buffer[i]) - { - printk(KERN_ERR "%s: out of memory for buffer %lu\n", - cloop_name, (unsigned long) ntohl(clo->head.block_size)); - error=-ENOMEM; goto error_release_free; - } - } - } - clo->compressed_buffer = cloop_malloc(clo->largest_block); - if(!clo->compressed_buffer) - { - printk(KERN_ERR "%s: out of memory for compressed buffer %lu\n", - cloop_name, clo->largest_block); - error=-ENOMEM; goto error_release_free_buffer; - } - clo->zstream.workspace = cloop_malloc(zlib_inflate_workspacesize()); - if(!clo->zstream.workspace) - { - printk(KERN_ERR "%s: out of mem for zlib working area %u\n", - cloop_name, zlib_inflate_workspacesize()); - error=-ENOMEM; goto error_release_free_all; - } - zlib_inflateInit(&clo->zstream); - if(!isblkdev && - be64_to_cpu(clo->offsets[ntohl(clo->head.num_blocks)]) != inode->i_size) - { - printk(KERN_ERR "%s: final offset wrong (%Lu not %Lu)\n", - cloop_name, - be64_to_cpu(clo->offsets[ntohl(clo->head.num_blocks)]), - inode->i_size); - cloop_free(clo->zstream.workspace, zlib_inflate_workspacesize()); clo->zstream.workspace=NULL; - goto error_release_free_all; - } - { - int i; - for(i=0; ibuffered_blocknum[i] = -1; - clo->current_bufnum=0; - } - set_capacity(clo->clo_disk, (sector_t)(ntohl(clo->head.num_blocks)* - (ntohl(clo->head.block_size)>>9))); - clo->clo_thread = kthread_create(cloop_thread, clo, "cloop%d", cloop_num); - if(IS_ERR(clo->clo_thread)) - { - error = PTR_ERR(clo->clo_thread); - clo->clo_thread=NULL; - goto error_release_free_all; - } - if(preload > 0) - { - clo->preload_array_size = ((preload<=ntohl(clo->head.num_blocks))?preload:ntohl(clo->head.num_blocks)); - clo->preload_size = 0; - if((clo->preload_cache = cloop_malloc(clo->preload_array_size * sizeof(char *))) != NULL) - { - int i; - for(i=0; ipreload_array_size; i++) - { - if((clo->preload_cache[i] = cloop_malloc(ntohl(clo->head.block_size))) == NULL) - { /* Out of memory */ - printk(KERN_WARNING "%s: cloop_malloc(%d) failed for preload_cache[%d] (ignored).\n", - cloop_name, ntohl(clo->head.block_size), i); - break; - } - } - clo->preload_size = i; - for(i=0; ipreload_size; i++) - { - int buffered_blocknum = cloop_load_buffer(clo,i); - if(buffered_blocknum >= 0) - { - memcpy(clo->preload_cache[i], clo->buffer[buffered_blocknum], - ntohl(clo->head.block_size)); - } - else - { - printk(KERN_WARNING "%s: can't read block %d into preload cache, set to zero.\n", - cloop_name, i); - memset(clo->preload_cache[i], 0, ntohl(clo->head.block_size)); - } - } - printk(KERN_INFO "%s: preloaded %d blocks into cache.\n", cloop_name, - clo->preload_size); - } - else - { - /* It is not a fatal error if cloop_malloc(clo->preload_size) - * fails, then we just go without cache, but we should at least - * let the user know. */ - printk(KERN_WARNING "%s: cloop_malloc(%d) failed, continuing without preloaded buffers.\n", - cloop_name, clo->preload_size * sizeof(char *)); - clo->preload_array_size = clo->preload_size = 0; - } - } - wake_up_process(clo->clo_thread); - /* Uncheck */ - return error; -error_release_free_all: - cloop_free(clo->compressed_buffer, clo->largest_block); - clo->compressed_buffer=NULL; -error_release_free_buffer: - { - int i; - for(i=0; ibuffer[i]) - { - cloop_free(clo->buffer[i], ntohl(clo->head.block_size)); - clo->buffer[i]=NULL; - } - } - } -error_release_free: - cloop_free(clo->offsets, sizeof(loff_t) * total_offsets); - clo->offsets=NULL; -error_release: - if(bbuf) cloop_free(bbuf, clo->underlying_blksize); - clo->backing_file=NULL; - return error; -} - -/* Get file from ioctl arg (only losetup) */ -static int cloop_set_fd(int cloop_num, struct file *clo_file, - struct block_device *bdev, unsigned int arg) -{ - struct cloop_device *clo=&cloop_dev[cloop_num]; - struct file *file=NULL; - int error = 0; - - /* Already an allocated file present */ - if(clo->backing_file) return -EBUSY; - file = fget(arg); /* get filp struct from ioctl arg fd */ - if(!file) return -EBADF; - error=cloop_set_file(cloop_num,file,"losetup_file"); - if(error) fput(file); - return error; -} - -/* Drop file and free buffers, both ioctl and initial_file */ -static int cloop_clr_fd(int cloop_num, struct block_device *bdev) -{ - struct cloop_device *clo = &cloop_dev[cloop_num]; - struct file *filp = clo->backing_file; - int i; - if(clo->refcnt > 1) /* we needed one fd for the ioctl */ - return -EBUSY; - if(filp==NULL) return -EINVAL; - if(clo->clo_thread) { kthread_stop(clo->clo_thread); clo->clo_thread=NULL; } - if(filp!=initial_file) fput(filp); - else { filp_close(initial_file,0); initial_file=NULL; } - clo->backing_file = NULL; - clo->backing_inode = NULL; - if(clo->offsets) { cloop_free(clo->offsets, clo->underlying_blksize); clo->offsets = NULL; } - if(clo->preload_cache) - { - for(i=0; i < clo->preload_size; i++) - cloop_free(clo->preload_cache[i], ntohl(clo->head.block_size)); - cloop_free(clo->preload_cache, clo->preload_array_size * sizeof(char *)); - clo->preload_cache = NULL; - clo->preload_size = clo->preload_array_size = 0; - } - for(i=0; ibuffer[i]) { cloop_free(clo->buffer[i], ntohl(clo->head.block_size)); clo->buffer[i]=NULL; } - if(clo->compressed_buffer) { cloop_free(clo->compressed_buffer, clo->largest_block); clo->compressed_buffer = NULL; } - zlib_inflateEnd(&clo->zstream); - if(clo->zstream.workspace) { cloop_free(clo->zstream.workspace, zlib_inflate_workspacesize()); clo->zstream.workspace = NULL; } - if(bdev) invalidate_bdev(bdev); - if(clo->clo_disk) set_capacity(clo->clo_disk, 0); - return 0; -} - -static int clo_suspend_fd(int cloop_num) -{ - struct cloop_device *clo = &cloop_dev[cloop_num]; - struct file *filp = clo->backing_file; - if(filp==NULL || clo->suspended) return -EINVAL; - /* Suspend all running requests - FF */ - clo->suspended=1; - if(filp!=initial_file) fput(filp); - else { filp_close(initial_file,0); initial_file=NULL; } - clo->backing_file = NULL; - clo->backing_inode = NULL; - return 0; -} - -/* Copied from loop.c, stripped down to the really necessary */ -static int cloop_set_status(struct cloop_device *clo, - const struct loop_info64 *info) -{ - if (!clo->backing_file) return -ENXIO; - memcpy(clo->clo_file_name, info->lo_file_name, LO_NAME_SIZE); - clo->clo_file_name[LO_NAME_SIZE-1] = 0; - return 0; -} - -static int cloop_get_status(struct cloop_device *clo, - struct loop_info64 *info) -{ - struct file *file = clo->backing_file; - struct kstat stat; - int err; - if (!file) return -ENXIO; - err = vfs_getattr(file->f_path.mnt, file->f_path.dentry, &stat); - if (err) return err; - memset(info, 0, sizeof(*info)); - info->lo_number = clo->clo_number; - info->lo_device = huge_encode_dev(stat.dev); - info->lo_inode = stat.ino; - info->lo_rdevice = huge_encode_dev(clo->isblkdev ? stat.rdev : stat.dev); - info->lo_offset = 0; - info->lo_sizelimit = 0; - info->lo_flags = 0; - memcpy(info->lo_file_name, clo->clo_file_name, LO_NAME_SIZE); - return 0; -} - -static void cloop_info64_from_old(const struct loop_info *info, - struct loop_info64 *info64) -{ - memset(info64, 0, sizeof(*info64)); - info64->lo_number = info->lo_number; - info64->lo_device = info->lo_device; - info64->lo_inode = info->lo_inode; - info64->lo_rdevice = info->lo_rdevice; - info64->lo_offset = info->lo_offset; - info64->lo_sizelimit = 0; - info64->lo_flags = info->lo_flags; - info64->lo_init[0] = info->lo_init[0]; - info64->lo_init[1] = info->lo_init[1]; - memcpy(info64->lo_file_name, info->lo_name, LO_NAME_SIZE); -} - -static int cloop_info64_to_old(const struct loop_info64 *info64, - struct loop_info *info) -{ - memset(info, 0, sizeof(*info)); - info->lo_number = info64->lo_number; - info->lo_device = info64->lo_device; - info->lo_inode = info64->lo_inode; - info->lo_rdevice = info64->lo_rdevice; - info->lo_offset = info64->lo_offset; - info->lo_flags = info64->lo_flags; - info->lo_init[0] = info64->lo_init[0]; - info->lo_init[1] = info64->lo_init[1]; - memcpy(info->lo_name, info64->lo_file_name, LO_NAME_SIZE); - return 0; -} - -static int cloop_set_status_old(struct cloop_device *clo, - const struct loop_info __user *arg) -{ - struct loop_info info; - struct loop_info64 info64; - - if (copy_from_user(&info, arg, sizeof (struct loop_info))) return -EFAULT; - cloop_info64_from_old(&info, &info64); - return cloop_set_status(clo, &info64); -} - -static int cloop_set_status64(struct cloop_device *clo, - const struct loop_info64 __user *arg) -{ - struct loop_info64 info64; - if (copy_from_user(&info64, arg, sizeof (struct loop_info64))) - return -EFAULT; - return cloop_set_status(clo, &info64); -} - -static int cloop_get_status_old(struct cloop_device *clo, - struct loop_info __user *arg) -{ - struct loop_info info; - struct loop_info64 info64; - int err = 0; - - if (!arg) err = -EINVAL; - if (!err) err = cloop_get_status(clo, &info64); - if (!err) err = cloop_info64_to_old(&info64, &info); - if (!err && copy_to_user(arg, &info, sizeof(info))) err = -EFAULT; - return err; -} - -static int cloop_get_status64(struct cloop_device *clo, - struct loop_info64 __user *arg) -{ - struct loop_info64 info64; - int err = 0; - if (!arg) err = -EINVAL; - if (!err) err = cloop_get_status(clo, &info64); - if (!err && copy_to_user(arg, &info64, sizeof(info64))) err = -EFAULT; - return err; -} -/* EOF get/set_status */ - - -static int cloop_ioctl(struct block_device *bdev, fmode_t mode, - unsigned int cmd, unsigned long arg) -{ - struct cloop_device *clo; - int cloop_num, err=0; - if (!bdev) return -EINVAL; - cloop_num = MINOR(bdev->bd_dev); - if (cloop_num < 0 || cloop_num > cloop_count-1) return -ENODEV; - clo = &cloop_dev[cloop_num]; - switch (cmd) - { /* We use the same ioctls that loop does */ - case LOOP_CHANGE_FD: - case LOOP_SET_FD: - err = cloop_set_fd(cloop_num, NULL, bdev, arg); - if (err == 0 && clo->suspended) - { - /* Okay, we have again a backing file - get reqs again - FF */ - clo->suspended=0; - } - break; - case LOOP_CLR_FD: - err = cloop_clr_fd(cloop_num, bdev); - break; - case LOOP_SET_STATUS: - err = cloop_set_status_old(clo, (struct loop_info __user *) arg); - break; - case LOOP_GET_STATUS: - err = cloop_get_status_old(clo, (struct loop_info __user *) arg); - break; - case LOOP_SET_STATUS64: - err = cloop_set_status64(clo, (struct loop_info64 __user *) arg); - break; - case LOOP_GET_STATUS64: - err = cloop_get_status64(clo, (struct loop_info64 __user *) arg); - break; - case CLOOP_SUSPEND: - err = clo_suspend_fd(cloop_num); - break; - default: - err = -EINVAL; - } - return err; -} - -static int cloop_open(struct block_device *bdev, fmode_t mode) -{ - int cloop_num; - if(!bdev) return -EINVAL; - cloop_num=MINOR(bdev->bd_dev); - if(cloop_num > cloop_count-1) return -ENODEV; - /* Allow write open for ioctl, but not for mount. */ - /* losetup uses write-open and flags=0x8002 to set a new file */ - if(mode & FMODE_WRITE) - { - printk(KERN_WARNING "%s: Can't open device read-write in mode 0x%x\n", cloop_name, mode); - return -EROFS; - } - cloop_dev[cloop_num].refcnt+=1; - return 0; -} - -static int cloop_close(struct gendisk *disk, fmode_t mode) -{ - int cloop_num, err=0; - if(!disk) return 0; - cloop_num=((struct cloop_device *)disk->private_data)->clo_number; - if(cloop_num < 0 || cloop_num > (cloop_count-1)) return 0; - cloop_dev[cloop_num].refcnt-=1; - return err; -} - -static struct block_device_operations clo_fops = -{ - owner: THIS_MODULE, - open: cloop_open, - release: cloop_close, - locked_ioctl: cloop_ioctl -}; - -static int cloop_register_blkdev(int major_nr) -{ - return register_blkdev(major_nr, cloop_name); -} - -static int cloop_unregister_blkdev(void) -{ - unregister_blkdev(cloop_major, cloop_name); - return 0; -} - -static int cloop_alloc(int cloop_num) -{ - struct cloop_device *clo = &cloop_dev[cloop_num]; - memset(clo, 0, sizeof(struct cloop_device)); - clo->clo_number = cloop_num; - clo->clo_thread = NULL; - init_waitqueue_head(&clo->clo_event); - spin_lock_init(&clo->queue_lock); - INIT_LIST_HEAD(&clo->clo_list); - clo->clo_queue = blk_init_queue(cloop_do_request, &clo->queue_lock); - if(!clo->clo_queue) - { - printk(KERN_ERR "%s: Unable to alloc queue[%d]\n", cloop_name, cloop_num); - goto error_out; - } - clo->clo_queue->queuedata = clo; - clo->clo_disk = alloc_disk(1); - if(!clo->clo_disk) - { - printk(KERN_ERR "%s: Unable to alloc disk[%d]\n", cloop_name, cloop_num); - goto error_disk; - } - clo->clo_disk->major = cloop_major; - clo->clo_disk->first_minor = cloop_num; - clo->clo_disk->fops = &clo_fops; - clo->clo_disk->queue = clo->clo_queue; - clo->clo_disk->private_data = clo; - sprintf(clo->clo_disk->disk_name, "%s%d", cloop_name, cloop_num); - add_disk(clo->clo_disk); - return 0; -error_disk: - blk_cleanup_queue(clo->clo_queue); -error_out: - return -ENOMEM; -} - -static void cloop_dealloc(int cloop_num) -{ - struct cloop_device *clo = &cloop_dev[cloop_num]; - del_gendisk(clo->clo_disk); - blk_cleanup_queue(clo->clo_queue); - put_disk(clo->clo_disk); -} - -static int __init cloop_init(void) -{ - int error=0; - printk("%s: Initializing %s v"CLOOP_VERSION"\n", cloop_name, cloop_name); - cloop_count=0; - cloop_major=MAJOR_NR; - if(cloop_register_blkdev(MAJOR_NR)) - { - printk(KERN_WARNING "%s: Unable to get major device %d\n", cloop_name, - MAJOR_NR); - /* Try dynamic allocation */ - if((cloop_major=cloop_register_blkdev(0))<0) - { - printk(KERN_ERR "%s: Unable to get dynamic major device\n", cloop_name); - return -EIO; - } - printk(KERN_INFO "%s: Got dynamic major device %d, " - "mknod /dev/%s b %d 0\n", - cloop_name, cloop_major, cloop_name, cloop_major); - } - while(cloop_count= LO_NAME_SIZE) namelen = LO_NAME_SIZE-1; - memcpy(cloop_dev[0].clo_file_name, file, namelen); - cloop_dev[0].clo_file_name[namelen] = 0; - } - return 0; -init_out_dealloc: - while (cloop_count>0) cloop_dealloc(--cloop_count); - cloop_unregister_blkdev(); - return error; -} - -static void __exit cloop_exit(void) -{ - int error=0; - if((error=cloop_unregister_blkdev())!=0) - { - printk(KERN_ERR "%s: cannot unregister block device\n", cloop_name); - return; - } - while(cloop_count>0) - { - --cloop_count; - if(cloop_dev[cloop_count].backing_file) cloop_clr_fd(cloop_count, NULL); - cloop_dealloc(cloop_count); - } - printk("%s: unloaded.\n", cloop_name); -} - -/* The cloop init and exit function registration (especially needed for Kernel 2.6) */ -module_init(cloop_init); -module_exit(cloop_exit); - -#include -#include - -MODULE_INFO(vermagic, VERMAGIC_STRING); diff -Nru cloop-2.6.31.1.1ubuntu1/compressed_loop.h cloop-2.6.39.2/compressed_loop.h --- cloop-2.6.31.1.1ubuntu1/compressed_loop.h 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/compressed_loop.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#ifndef _COMPRESSED_LOOP_H -#define _COMPRESSED_LOOP_H - -#define CLOOP_HEADROOM 128 - -/* The cloop header usually looks like this: */ -/* #!/bin/sh */ -/* #V2.00 Format */ -/* ...padding up to CLOOP_HEADROOM... */ -/* block_size (32bit number, network order) */ -/* num_blocks (32bit number, network order) */ - -struct cloop_head -{ - char preamble[CLOOP_HEADROOM]; - u_int32_t block_size; - u_int32_t num_blocks; -}; - -/* data_index (num_blocks 64bit pointers, network order)... */ -/* compressed data (gzip block compressed format)... */ - -/* Cloop suspend IOCTL */ -#define CLOOP_SUSPEND 0x4C07 - -#endif /*_COMPRESSED_LOOP_H*/ diff -Nru cloop-2.6.31.1.1ubuntu1/create_compressed_fs.c cloop-2.6.39.2/create_compressed_fs.c --- cloop-2.6.31.1.1ubuntu1/create_compressed_fs.c 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/create_compressed_fs.c 2004-02-27 22:23:26.000000000 +0000 @@ -0,0 +1,240 @@ +/* Creates a compressed image, given a file as an argument. + * (c)1999 Paul `Rusty' Russell. GPL. + * + * CHANGELOG: + * * Sun Okt 26 01:05:29 CEST 2003 Klaus Knopper + * - Changed format of index pointers to network byte order + * * Sat Sep 29 2001 Klaus Knopper + * - changed compression to Z_BEST_COMPRESSION, + * * Sat Jun 17 2000 Klaus Knopper + * - Support for reading file from stdin, + * - Changed Preamble. + * * Sat Jul 28 2001 Klaus Knopper + * - cleanup and gcc 2.96 / glibc checking + */ + +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) +#include +#include +typedef uint64_t loff_t; +#ifndef htobe64 +static __inline __uint64_t +__bswap64(__uint64_t _x) +{ + + return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | + ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | + ((_x << 24) & ((__uint64_t)0xff << 40)) | + ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); +} +#if BYTE_ORDER == LITTLE_ENDIAN +#define htobe64(x) __bswap64(x) +#else +#define htobe64(x) +#endif +#endif +#define __cpu_to_be64 htobe64 +#else +#include +#endif +#include +#include +#include "compressed_loop.h" + +#define MAX_KMALLOC_SIZE 2L<<17 + +#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "insmod cloop.o file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" + +struct cb_list +{ + struct cb_list *next; + size_t size; + char data[0]; +}; + +void free_cb_list(struct cb_list *cbl) +{ + if(cbl->next) free_cb_list(cbl->next); + free(cbl); +} + +/* Now using the goto style because it is quicker to read */ +static struct cb_list *create_compressed_blocks(int handle, unsigned long + blocksize, unsigned long *numblocks) +{ + struct cb_list *cbl,**cbp=&cbl; + unsigned long i=0; + unsigned int last; + unsigned long long total_uncompressed=0,total_compressed=0; + unsigned long maxlen = blocksize + blocksize/1000 + 12; + char *compressed, *uncompressed; + if((uncompressed=malloc(blocksize))==NULL) + { + fprintf(stderr, "*** Can't malloc(%ld).\n",blocksize); + return NULL; + } + if((compressed=malloc(maxlen))==NULL) + { + fprintf(stderr, "*** Can't malloc(%ld).\n",blocksize); + goto free_uncompressed; + } + for(i=0,last=0; !last; i++) + { + int z_error; + unsigned long total=0, len = maxlen; + memset(compressed,0,len); memset(uncompressed,0,blocksize); + while(total %6lu [compression ratio %3lu%%, overall: %3Lu%%]\n", i, total, len, total>0?((len*100)/total):100,total_uncompressed>0?((total_compressed*100)/total_uncompressed):100); + (*cbp)->size = len; + memcpy((*cbp)->data, compressed, len); + (*cbp)->next=NULL; + cbp=&((*cbp)->next); + } /* for */ + goto free_compressed; + + error_free_cb_list: + if(cbl) { free_cb_list(cbl); cbl=NULL; i=0; } + + free_compressed: + free(compressed); + free_uncompressed: + free(uncompressed); + + *numblocks=i; + return cbl; +} + +int main(int argc, char **argv) +{ + int in; + unsigned long blocksize; + struct cloop_head head; + unsigned long numblocks; + unsigned long long bytes_so_far; + unsigned long i; + struct cb_list *compressed_blocks,*cbp; + + if (argc != 3) + { + fprintf(stderr, "Usage: %s filename blocksize(bytes).\n",argv[0]); + fprintf(stderr, "Use '-' as filename for stdin.\n"); + return 1; + } + + blocksize = atoi(argv[2]); + if (blocksize == 0 || blocksize % 512 != 0) + { + fprintf(stderr, "*** Blocksize must be a multiple of 512.\n"); + return 1; + } + + if (blocksize > MAX_KMALLOC_SIZE) + { + fprintf(stderr, "WARNING: Blocksize %lu may be too big for a kmalloc() (%lu max).\n",blocksize,MAX_KMALLOC_SIZE); + sleep(2); + } + + if (sizeof(CLOOP_PREAMBLE) > CLOOP_HEADROOM) + { + fprintf(stderr, "*** Preamble (%u chars) > headroom (%u)\n", + sizeof(CLOOP_PREAMBLE), CLOOP_HEADROOM); + return 1; + } + + in=strcmp(argv[1],"-")==0?dup(fileno(stdin)):open(argv[1], O_RDONLY); + + if (in < 0) + { + perror("Opening input"); + return 1; + } + + compressed_blocks = create_compressed_blocks(in, blocksize, &numblocks); + + close(in); + + memset(head.preamble, 0, sizeof(head.preamble)); + memcpy(head.preamble, CLOOP_PREAMBLE, sizeof(CLOOP_PREAMBLE)); + head.block_size = htonl(blocksize); + head.num_blocks = htonl(numblocks); + + fprintf(stderr, "Block size %lu, number of blocks %lu.\n", + blocksize, numblocks); + + bytes_so_far = sizeof(head) + sizeof(loff_t) * (numblocks + 1); + + /* Write out head... */ + write(STDOUT_FILENO, &head, sizeof(head)); + + if (!compressed_blocks) return 1; + + /* Write offsets */ + for (i=0,cbp=compressed_blocks; i < numblocks+1; i++) + { + loff_t tmp; + tmp = __cpu_to_be64(bytes_so_far); + write(STDOUT_FILENO, &tmp, sizeof(tmp)); + if(cbp) { bytes_so_far += cbp->size; cbp=cbp->next; } + } + + /* Now write blocks and free them. */ + for (i = 0, cbp=compressed_blocks; cbp && i < numblocks; i++) + { + if (write(STDOUT_FILENO, cbp->data, cbp->size) != cbp->size) + { + perror("writing block"); + free_cb_list(compressed_blocks); + return 1; + } + cbp=cbp->next; + free(compressed_blocks); compressed_blocks=cbp; + } +#if defined(__FreeBSD__) + /* + * FreeBSD requires padding to 512 byte boundary + */ + bytes_so_far = lseek(STDOUT_FILENO, 0, SEEK_END); + if (bytes_so_far % 512) + { + static char padding[512]; + off_t len = 512 - bytes_so_far % 512; + + if (write(STDOUT_FILENO, padding, len) != len) + { + perror("writing padding block"); + return 1; + } + } +#endif + fprintf(stderr,"Done.\n"); + return 0; +} diff -Nru cloop-2.6.31.1.1ubuntu1/create_compressed_fs.c.deprecated cloop-2.6.39.2/create_compressed_fs.c.deprecated --- cloop-2.6.31.1.1ubuntu1/create_compressed_fs.c.deprecated 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/create_compressed_fs.c.deprecated 1970-01-01 00:00:00.000000000 +0000 @@ -1,240 +0,0 @@ -/* Creates a compressed image, given a file as an argument. - * (c)1999 Paul `Rusty' Russell. GPL. - * - * CHANGELOG: - * * Sun Okt 26 01:05:29 CEST 2003 Klaus Knopper - * - Changed format of index pointers to network byte order - * * Sat Sep 29 2001 Klaus Knopper - * - changed compression to Z_BEST_COMPRESSION, - * * Sat Jun 17 2000 Klaus Knopper - * - Support for reading file from stdin, - * - Changed Preamble. - * * Sat Jul 28 2001 Klaus Knopper - * - cleanup and gcc 2.96 / glibc checking - */ - -#include -#include -#include -#include -#include -#if defined(__FreeBSD__) -#include -#include -typedef uint64_t loff_t; -#ifndef htobe64 -static __inline __uint64_t -__bswap64(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} -#if BYTE_ORDER == LITTLE_ENDIAN -#define htobe64(x) __bswap64(x) -#else -#define htobe64(x) -#endif -#endif -#define __cpu_to_be64 htobe64 -#else -#include -#endif -#include -#include -#include "compressed_loop.h" - -#define MAX_KMALLOC_SIZE 2L<<17 - -#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "insmod cloop.o file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" - -struct cb_list -{ - struct cb_list *next; - size_t size; - char data[0]; -}; - -void free_cb_list(struct cb_list *cbl) -{ - if(cbl->next) free_cb_list(cbl->next); - free(cbl); -} - -/* Now using the goto style because it is quicker to read */ -static struct cb_list *create_compressed_blocks(int handle, unsigned long - blocksize, unsigned long *numblocks) -{ - struct cb_list *cbl,**cbp=&cbl; - unsigned long i=0; - unsigned int last; - unsigned long long total_uncompressed=0,total_compressed=0; - unsigned long maxlen = blocksize + blocksize/1000 + 12; - char *compressed, *uncompressed; - if((uncompressed=malloc(blocksize))==NULL) - { - fprintf(stderr, "*** Can't malloc(%ld).\n",blocksize); - return NULL; - } - if((compressed=malloc(maxlen))==NULL) - { - fprintf(stderr, "*** Can't malloc(%ld).\n",blocksize); - goto free_uncompressed; - } - for(i=0,last=0; !last; i++) - { - int z_error; - unsigned long total=0, len = maxlen; - memset(compressed,0,len); memset(uncompressed,0,blocksize); - while(total %6lu [compression ratio %3lu%%, overall: %3Lu%%]\n", i, total, len, total>0?((len*100)/total):100,total_uncompressed>0?((total_compressed*100)/total_uncompressed):100); - (*cbp)->size = len; - memcpy((*cbp)->data, compressed, len); - (*cbp)->next=NULL; - cbp=&((*cbp)->next); - } /* for */ - goto free_compressed; - - error_free_cb_list: - if(cbl) { free_cb_list(cbl); cbl=NULL; i=0; } - - free_compressed: - free(compressed); - free_uncompressed: - free(uncompressed); - - *numblocks=i; - return cbl; -} - -int main(int argc, char **argv) -{ - int in; - unsigned long blocksize; - struct cloop_head head; - unsigned long numblocks; - unsigned long long bytes_so_far; - unsigned long i; - struct cb_list *compressed_blocks,*cbp; - - if (argc != 3) - { - fprintf(stderr, "Usage: %s filename blocksize(bytes).\n",argv[0]); - fprintf(stderr, "Use '-' as filename for stdin.\n"); - return 1; - } - - blocksize = atoi(argv[2]); - if (blocksize == 0 || blocksize % 512 != 0) - { - fprintf(stderr, "*** Blocksize must be a multiple of 512.\n"); - return 1; - } - - if (blocksize > MAX_KMALLOC_SIZE) - { - fprintf(stderr, "WARNING: Blocksize %lu may be too big for a kmalloc() (%lu max).\n",blocksize,MAX_KMALLOC_SIZE); - sleep(2); - } - - if (sizeof(CLOOP_PREAMBLE) > CLOOP_HEADROOM) - { - fprintf(stderr, "*** Preamble (%u chars) > headroom (%u)\n", - sizeof(CLOOP_PREAMBLE), CLOOP_HEADROOM); - return 1; - } - - in=strcmp(argv[1],"-")==0?dup(fileno(stdin)):open(argv[1], O_RDONLY); - - if (in < 0) - { - perror("Opening input"); - return 1; - } - - compressed_blocks = create_compressed_blocks(in, blocksize, &numblocks); - - close(in); - - memset(head.preamble, 0, sizeof(head.preamble)); - memcpy(head.preamble, CLOOP_PREAMBLE, sizeof(CLOOP_PREAMBLE)); - head.block_size = htonl(blocksize); - head.num_blocks = htonl(numblocks); - - fprintf(stderr, "Block size %lu, number of blocks %lu.\n", - blocksize, numblocks); - - bytes_so_far = sizeof(head) + sizeof(loff_t) * (numblocks + 1); - - /* Write out head... */ - write(STDOUT_FILENO, &head, sizeof(head)); - - if (!compressed_blocks) return 1; - - /* Write offsets */ - for (i=0,cbp=compressed_blocks; i < numblocks+1; i++) - { - loff_t tmp; - tmp = __cpu_to_be64(bytes_so_far); - write(STDOUT_FILENO, &tmp, sizeof(tmp)); - if(cbp) { bytes_so_far += cbp->size; cbp=cbp->next; } - } - - /* Now write blocks and free them. */ - for (i = 0, cbp=compressed_blocks; cbp && i < numblocks; i++) - { - if (write(STDOUT_FILENO, cbp->data, cbp->size) != cbp->size) - { - perror("writing block"); - free_cb_list(compressed_blocks); - return 1; - } - cbp=cbp->next; - free(compressed_blocks); compressed_blocks=cbp; - } -#if defined(__FreeBSD__) - /* - * FreeBSD requires padding to 512 byte boundary - */ - bytes_so_far = lseek(STDOUT_FILENO, 0, SEEK_END); - if (bytes_so_far % 512) - { - static char padding[512]; - off_t len = 512 - bytes_so_far % 512; - - if (write(STDOUT_FILENO, padding, len) != len) - { - perror("writing padding block"); - return 1; - } - } -#endif - fprintf(stderr,"Done.\n"); - return 0; -} diff -Nru cloop-2.6.31.1.1ubuntu1/create_compressed_fs_fast.c cloop-2.6.39.2/create_compressed_fs_fast.c --- cloop-2.6.31.1.1ubuntu1/create_compressed_fs_fast.c 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/create_compressed_fs_fast.c 2007-07-24 12:59:41.000000000 +0000 @@ -0,0 +1,240 @@ +/* Creates a compressed image, given a file as an argument. + * (c)1999 Paul `Rusty' Russell. GPL. + * + * CHANGELOG: + * * Sun Okt 26 01:05:29 CEST 2003 Klaus Knopper + * - Changed format of index pointers to network byte order + * * Sat Sep 29 2001 Klaus Knopper + * - changed compression to Z_BEST_COMPRESSION, + * * Sat Jun 17 2000 Klaus Knopper + * - Support for reading file from stdin, + * - Changed Preamble. + * * Sat Jul 28 2001 Klaus Knopper + * - cleanup and gcc 2.96 / glibc checking + */ + +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) +#include +#include +typedef uint64_t loff_t; +#ifndef htobe64 +static __inline __uint64_t +__bswap64(__uint64_t _x) +{ + + return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | + ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | + ((_x << 24) & ((__uint64_t)0xff << 40)) | + ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); +} +#if BYTE_ORDER == LITTLE_ENDIAN +#define htobe64(x) __bswap64(x) +#else +#define htobe64(x) +#endif +#endif +#define __cpu_to_be64 htobe64 +#else +#include +#endif +#include +#include +#include "compressed_loop.h" + +#define MAX_KMALLOC_SIZE 2L<<17 + +#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "insmod cloop.o file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n" + +struct cb_list +{ + struct cb_list *next; + size_t size; + char data[0]; +}; + +void free_cb_list(struct cb_list *cbl) +{ + if(cbl->next) free_cb_list(cbl->next); + free(cbl); +} + +/* Now using the goto style because it is quicker to read */ +static struct cb_list *create_compressed_blocks(int handle, unsigned long + blocksize, unsigned long *numblocks) +{ + struct cb_list *cbl,**cbp=&cbl; + unsigned long i=0; + unsigned int last; + unsigned long long total_uncompressed=0,total_compressed=0; + unsigned long maxlen = blocksize + blocksize/1000 + 12; + char *compressed, *uncompressed; + if((uncompressed=malloc(blocksize))==NULL) + { + fprintf(stderr, "*** Can't malloc(%ld).\n",blocksize); + return NULL; + } + if((compressed=malloc(maxlen))==NULL) + { + fprintf(stderr, "*** Can't malloc(%ld).\n",blocksize); + goto free_uncompressed; + } + for(i=0,last=0; !last; i++) + { + int z_error; + unsigned long total=0, len = maxlen; + memset(compressed,0,len); memset(uncompressed,0,blocksize); + while(total %6lu [compression ratio %3lu%%, overall: %3Lu%%]\n", i, total, len, total>0?((len*100)/total):100,total_uncompressed>0?((total_compressed*100)/total_uncompressed):100); + (*cbp)->size = len; + memcpy((*cbp)->data, compressed, len); + (*cbp)->next=NULL; + cbp=&((*cbp)->next); + } /* for */ + goto free_compressed; + + error_free_cb_list: + if(cbl) { free_cb_list(cbl); cbl=NULL; i=0; } + + free_compressed: + free(compressed); + free_uncompressed: + free(uncompressed); + + *numblocks=i; + return cbl; +} + +int main(int argc, char **argv) +{ + int in; + unsigned long blocksize; + struct cloop_head head; + unsigned long numblocks; + unsigned long long bytes_so_far; + unsigned long i; + struct cb_list *compressed_blocks,*cbp; + + if (argc != 3) + { + fprintf(stderr, "Usage: %s filename blocksize(bytes).\n",argv[0]); + fprintf(stderr, "Use '-' as filename for stdin.\n"); + return 1; + } + + blocksize = atoi(argv[2]); + if (blocksize == 0 || blocksize % 512 != 0) + { + fprintf(stderr, "*** Blocksize must be a multiple of 512.\n"); + return 1; + } + + if (blocksize > MAX_KMALLOC_SIZE) + { + fprintf(stderr, "WARNING: Blocksize %lu may be too big for a kmalloc() (%lu max).\n",blocksize,MAX_KMALLOC_SIZE); + sleep(2); + } + + if (sizeof(CLOOP_PREAMBLE) > CLOOP_HEADROOM) + { + fprintf(stderr, "*** Preamble (%u chars) > headroom (%u)\n", + sizeof(CLOOP_PREAMBLE), CLOOP_HEADROOM); + return 1; + } + + in=strcmp(argv[1],"-")==0?dup(fileno(stdin)):open(argv[1], O_RDONLY); + + if (in < 0) + { + perror("Opening input"); + return 1; + } + + compressed_blocks = create_compressed_blocks(in, blocksize, &numblocks); + + close(in); + + memset(head.preamble, 0, sizeof(head.preamble)); + memcpy(head.preamble, CLOOP_PREAMBLE, sizeof(CLOOP_PREAMBLE)); + head.block_size = htonl(blocksize); + head.num_blocks = htonl(numblocks); + + fprintf(stderr, "Block size %lu, number of blocks %lu.\n", + blocksize, numblocks); + + bytes_so_far = sizeof(head) + sizeof(loff_t) * (numblocks + 1); + + /* Write out head... */ + write(STDOUT_FILENO, &head, sizeof(head)); + + if (!compressed_blocks) return 1; + + /* Write offsets */ + for (i=0,cbp=compressed_blocks; i < numblocks+1; i++) + { + loff_t tmp; + tmp = __cpu_to_be64(bytes_so_far); + write(STDOUT_FILENO, &tmp, sizeof(tmp)); + if(cbp) { bytes_so_far += cbp->size; cbp=cbp->next; } + } + + /* Now write blocks and free them. */ + for (i = 0, cbp=compressed_blocks; cbp && i < numblocks; i++) + { + if (write(STDOUT_FILENO, cbp->data, cbp->size) != cbp->size) + { + perror("writing block"); + free_cb_list(compressed_blocks); + return 1; + } + cbp=cbp->next; + free(compressed_blocks); compressed_blocks=cbp; + } +#if defined(__FreeBSD__) + /* + * FreeBSD requires padding to 512 byte boundary + */ + bytes_so_far = lseek(STDOUT_FILENO, 0, SEEK_END); + if (bytes_so_far % 512) + { + static char padding[512]; + off_t len = 512 - bytes_so_far % 512; + + if (write(STDOUT_FILENO, padding, len) != len) + { + perror("writing padding block"); + return 1; + } + } +#endif + fprintf(stderr,"Done.\n"); + return 0; +} diff -Nru cloop-2.6.31.1.1ubuntu1/debian/changelog cloop-2.6.39.2/debian/changelog --- cloop-2.6.31.1.1ubuntu1/debian/changelog 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/debian/changelog 2012-01-03 06:52:51.000000000 +0000 @@ -1,9 +1,54 @@ -cloop (2.6.31.1.1ubuntu1) lucid; urgency=low +cloop (2.6.39.2-1ubuntu1) precise; urgency=low * Merge from Debian testing, remaining changes: - Do not build the cloop-src package. + * Add Pre-Depends on dpkg (>= 1.15.6~) since we're using xz compression. - -- Steve Langasek Wed, 27 Jan 2010 09:23:19 -0800 + -- Steve Langasek Mon, 02 Jan 2012 22:52:50 -0800 + +cloop (2.6.39.2-1) unstable; urgency=low + + * Imported new upstream version (closes: 436090, 632603) + * Converted Debian source format to 3.0 (quilt), also using xz where possible + * Move linux-headers-2.6 dependency to linux-headers (closes: 628872) + * Merged extra changelog.knoppix file (documenting Knopper's branch changes) + into common debian/changelog file, dropped the build time merging mess + * Danish translation of the debconf templates from Joe Dalton (closes: 627713) + * Korean translation of the debconf templates from 임영재 (closes: 632291) + + -- Eduard Bloch Mon, 12 Dec 2011 23:40:53 +0100 + +cloop (2.639-2) unstable; urgency=low + + * Change compressed_loop.h -> cloop.h everywhere. + + -- Klaus Knopper Wed, 06 Jul 2011 18:43:20 +0200 + +cloop (2.639-1) unstable; urgency=low + + * Changes for kernel 2.6.39, replace lock_kernel() by mutex_lock() + + -- Klaus Knopper Tue, 10 May 2011 14:18:21 +0200 + +cloop (2.637-1) unstable; urgency=low + + * Add compat_ioctl for compilation in 64bit mode. + + -- Klaus Knopper Tue, 11 Jan 2011 22:57:31 +0100 + +cloop (2.636-1) unstable; urgency=low + + * Changes for new kernel 2.6.36 removed block layer api function and + locked_ioctl. + + -- Klaus Knopper Mon, 25 Oct 2010 22:40:25 +0200 + +cloop (2.634-1) unstable; urgency=low + + * Changes for new kernel 2.6.34 sector limit functions + * Set device read-only by default + + -- Klaus Knopper Wed, 25 Aug 2010 13:36:01 +0200 cloop (2.6.31.1.1) unstable; urgency=low @@ -13,15 +58,6 @@ -- Eduard Bloch Thu, 14 Jan 2010 22:28:22 +0100 -cloop (2.6.28.2.2ubuntu1) karmic; urgency=low - - * Merge from Debian unstable, remaining changes: - - Do not build the cloop-src package. - * Dropped changes, superseded in Debian package: - - Fix build failure with g++-4.3. - - -- Steve Langasek Wed, 03 Jun 2009 20:46:51 +0000 - cloop (2.6.28.2.2) unstable; urgency=low * STL related fixes (using numeric_limits instead of INT_MAX, @@ -32,6 +68,61 @@ -- Eduard Bloch Mon, 30 Mar 2009 23:38:12 +0200 +cloop (2.628-2) unstable; urgency=low + + * Reflect kernel 2.6.28 block device API changes in order to actually work. + + -- Klaus Knopper Tue, 04 Nov 2008 18:38:02 +0100 + +cloop (2.628-1) unstable; urgency=low + + * Minor source modifications for compiling with kernel 2.6.28 + + -- Klaus Knopper Sat, 25 Oct 2008 23:11:39 +0200 + +cloop (2.625-1) unstable; urgency=low + + * Kernel 2.6.25/26 api changes + + -- Klaus Knopper Mon, 19 May 2008 18:44:27 +0200 + +cloop (2.624-1) unstable; urgency=low + + * Kernel 2.6.24 api change (rq_for_each_segment) + + -- Klaus Knopper Sat, 26 Jan 2008 13:05:45 +0100 + +cloop (2.623-1) unstable; urgency=low + + * Fixed alloc_disk-leak (caused modprobe cloop; rmmod cloop; modprobe cloop to fail). + * Added support for busybox losetup. + + -- Klaus Knopper Sun, 16 Dec 2007 23:10:01 +0200 + +cloop (2.622-1) unstable; urgency=low + + * Rewrite with Kernel-Thread and request-queue for Kernel 2.6.22 and up. + * Abandoned Kernel 2.4 support. + * Replaced obsolete advancecomp-1.9 by 1.15 + + -- Klaus Knopper Sun, 23 Sep 2007 22:19:05 +0200 + +cloop (2.6.31.1.1ubuntu1) lucid; urgency=low + + * Merge from Debian testing, remaining changes: + - Do not build the cloop-src package. + + -- Steve Langasek Wed, 27 Jan 2010 09:23:19 -0800 + +cloop (2.6.28.2.2ubuntu1) karmic; urgency=low + + * Merge from Debian unstable, remaining changes: + - Do not build the cloop-src package. + * Dropped changes, superseded in Debian package: + - Fix build failure with g++-4.3. + + -- Steve Langasek Wed, 03 Jun 2009 20:46:51 +0000 + cloop (2.6.28.2.1ubuntu1) jaunty; urgency=low * Merge with Debian; remaining changes: @@ -40,6 +131,18 @@ -- Matthias Klose Thu, 08 Jan 2009 12:01:30 +0100 +cloop (2.06-2) unstable; urgency=low + + * Patch for Kernel 2.6.22 invalidate_bdev(one arg). + + -- Klaus Knopper Tue, 10 Jul 2007 06:16:26 +0200 + +cloop (2.06-1) unstable; urgency=low + + * Added "cloop_suspend" ioctl and utility contributed by Fabian Franz. + + -- Klaus Knopper Sun, 25 Feb 2007 22:25:52 +0100 + cloop (2.6.28.2.1) unstable; urgency=low * Big merge with version 2.628-2 from Knoppix sources @@ -49,6 +152,24 @@ -- Eduard Bloch Mon, 4 Dec 2006 00:11:52 +0100 +cloop (2.05~20060829-1) unstable; urgency=low + + * Merged with Klaus' unreleased version 2.05, compiles with >> 2.6.18.1. + * Added more paranoid check for unreadable initial file passed as parameter, + aborting earlier. + * added forgotten isofs block factor in mkisofs/genisoimage examples and + typo fixes + * better description of the compatibility option mode + * set _FILE_OFFSET_BITS to 64 in advfs.cc + + -- Eduard Bloch Sun, 03 Dec 2006 19:19:05 +0100 + +cloop (2.05-1) unstable; urgency=low + + * Adopted Eduard Blochs debian buildscripts for generic cloop 2.05 + + -- Klaus Knopper Sun, 20 Aug 2006 14:10:24 +0200 + cloop (2.05~20060829-1.2ubuntu2) intrepid; urgency=low * Fix another build failure with g++-4.3. @@ -83,18 +204,6 @@ -- Matthias Klose Mon, 4 Dec 2006 15:38:05 +0100 -cloop (2.05~20060829-1) unstable; urgency=low - - * Merged with Klaus' unreleased version 2.05, compiles with >> 2.6.18.1. - * Added more paranoid check for unreadable initial file passed as parameter, - aborting earlier. - * added forgotten isofs block factor in mkisofs/genisoimage examples and - typo fixes - * better description of the compatibility option mode - * set _FILE_OFFSET_BITS to 64 in advfs.cc - - -- Eduard Bloch Sun, 03 Dec 2006 19:19:05 +0100 - cloop (2.04-1+eb.1-7) unstable; urgency=low * disabled debugging output (ooops...) @@ -668,7 +777,3 @@ -- Klaus Knopper Thu, 7 Jun 2001 04:08:58 +0200 -Local variables: -mode: debian-changelog -End: - diff -Nru cloop-2.6.31.1.1ubuntu1/debian/control cloop-2.6.39.2/debian/control --- cloop-2.6.31.1.1ubuntu1/debian/control 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/debian/control 2012-01-03 06:51:40.000000000 +0000 @@ -3,11 +3,12 @@ Priority: optional Maintainer: Ubuntu Core Developers XSBC-Original-Maintainer: Eduard Bloch -Build-Depends: debhelper (>> 5.0.0), zlib1g-dev, bzip2 -Standards-Version: 3.8.3 +Build-Depends: debhelper (>> 5.0.0), zlib1g-dev, bzip2, xz-utils +Standards-Version: 3.9.2 Package: cloop-utils Architecture: any +Pre-Depends: dpkg (>= 1.15.6~) Depends: ${shlibs:Depends}, ${misc:Depends} Description: Tools for handling with cloop compressed volumes Utilities for creating and unpacking compressed loopback files diff -Nru cloop-2.6.31.1.1ubuntu1/debian/patches/autotools_stuff cloop-2.6.39.2/debian/patches/autotools_stuff --- cloop-2.6.31.1.1ubuntu1/debian/patches/autotools_stuff 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/patches/autotools_stuff 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1,2438 @@ +Description: add autotools-dev related meta files +Author: Eduard Bloch + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- cloop-2.6.39.2.orig/advancecomp-1.15/config.sub ++++ cloop-2.6.39.2/advancecomp-1.15/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, 2004 Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ++# 2011 Free Software Foundation, Inc. + +-timestamp='2004-11-30' ++timestamp='2011-03-23' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software +@@ -21,22 +22,26 @@ timestamp='2004-11-30' + # + # 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. ++# diff and a properly formatted GNU ChangeLog entry. + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. + # Otherwise, we print the canonical config type on stdout and succeed. + ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD ++ + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases + # that are meaningful with *any* GNU software. +@@ -70,8 +75,9 @@ Report bugs and patches to . +-# Please send patches to . Submit a context +-# diff and a properly formatted ChangeLog entry. ++ ++# Originally written by Per Bothner. Please send patches (context ++# diff format) to and include a ChangeLog ++# entry. + # + # This script attempts to guess a canonical system name similar to + # config.sub. If it succeeds, it prints the system name on stdout, and + # exits with 0. Otherwise, it exits with 1. + # +-# The plan is that this can be called by configure scripts if you +-# don't specify an explicit build system type. ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -53,8 +56,9 @@ version="\ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +-Free Software Foundation, Inc. ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 +70,11 @@ Try \`$me --help' for more information." + 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 +108,7 @@ set_cc_for_build=' + trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; + trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; + : ${TMPDIR=/tmp} ; +- { tmp=`(umask 077 && mktemp -d -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 +127,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in + ;; + ,,*) 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) +@@ -158,6 +162,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + 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 +@@ -166,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ +- | grep __ELF__ >/dev/null ++ | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? +@@ -176,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + fi + ;; + *) +- os=netbsd ++ os=netbsd + ;; + esac + # The OS release +@@ -196,62 +201,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" +- exit 0 ;; +- amd64:OpenBSD:*:*) +- echo x86_64-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- amiga:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- cats:OpenBSD:*:*) +- echo arm-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- hp300:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- luna88k:OpenBSD:*:*) +- echo m88k-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 ;; +- sgi:OpenBSD:*:*) +- echo mips64-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sun3:OpenBSD:*:*) +- echo m68k-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 0 ;; ++ exit ;; ++ *:SolidBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} ++ exit ;; + macppc:MirBSD:*:*) +- echo powerppc-unknown-mirbsd${UNAME_RELEASE} +- exit 0 ;; ++ echo powerpc-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) +- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on +@@ -297,40 +270,46 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- exit 0 ;; ++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. ++ exitcode=$? ++ trap '' 0 ++ exit $exitcode ;; + 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 0 ;; ++ exit ;; + *:OS400:*:*) +- echo powerpc-ibm-os400 +- exit 0 ;; ++ 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 +@@ -338,32 +317,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + 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 ;; ++ 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 ;; ++ s390x:SunOS:*:*) ++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; +- i86pc:SunOS:5.*:*) +- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; ++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) ++ echo i386-pc-auroraux${UNAME_RELEASE} ++ exit ;; ++ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) ++ eval $set_cc_for_build ++ SUN_ARCH="i386" ++ # If there is a compiler, see if it is configured for 64-bit objects. ++ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. ++ # This test works for both compilers. ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ SUN_ARCH="x86_64" ++ fi ++ fi ++ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) +@@ -372,10 +370,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + 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 +@@ -387,10 +385,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + 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 +@@ -400,41 +398,41 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-atari-mint${UNAME_RELEASE} ++ 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 ;; ++ echo m68k-atari-mint${UNAME_RELEASE} ++ exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) +- echo m68k-milan-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-milan-mint${UNAME_RELEASE} ++ exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) +- echo m68k-hades-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-hades-mint${UNAME_RELEASE} ++ exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) +- echo m68k-unknown-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-unknown-mint${UNAME_RELEASE} ++ exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} +- exit 0 ;; ++ 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 +@@ -458,35 +456,36 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ + 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` ++ # DG/UX returns AViiON for all architectures ++ UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ +@@ -499,29 +498,29 @@ EOF + 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` +@@ -529,7 +528,7 @@ EOF + 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 +@@ -544,15 +543,19 @@ EOF + 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:*:[4567]) + 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 +@@ -565,28 +568,28 @@ EOF + 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 +@@ -595,52 +598,52 @@ EOF + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` +- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` +- case "${sc_cpu_version}" in +- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 +- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 +- 532) # CPU_PA_RISC2_0 +- case "${sc_kernel_bits}" in +- 32) HP_ARCH="hppa2.0n" ;; +- 64) HP_ARCH="hppa2.0w" ;; ++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` ++ case "${sc_cpu_version}" in ++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 ++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 ++ 532) # CPU_PA_RISC2_0 ++ case "${sc_kernel_bits}" in ++ 32) HP_ARCH="hppa2.0n" ;; ++ 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 +- esac ;; +- esac ++ esac ;; ++ esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ sed 's/^ //' << EOF >$dummy.c ++ ++ #define _HPUX_SOURCE ++ #include ++ #include + +- #define _HPUX_SOURCE +- #include +- #include +- +- int main () +- { +- #if defined(_SC_KERNEL_BITS) +- long bits = sysconf(_SC_KERNEL_BITS); +- #endif +- long cpu = sysconf (_SC_CPU_VERSION); +- +- switch (cpu) +- { +- case CPU_PA_RISC1_0: puts ("hppa1.0"); break; +- case CPU_PA_RISC1_1: puts ("hppa1.1"); break; +- case CPU_PA_RISC2_0: +- #if defined(_SC_KERNEL_BITS) +- switch (bits) +- { +- case 64: puts ("hppa2.0w"); break; +- case 32: puts ("hppa2.0n"); break; +- default: puts ("hppa2.0"); break; +- } break; +- #else /* !defined(_SC_KERNEL_BITS) */ +- puts ("hppa2.0"); break; +- #endif +- default: puts ("hppa1.0"); break; +- } +- exit (0); +- } ++ int main () ++ { ++ #if defined(_SC_KERNEL_BITS) ++ long bits = sysconf(_SC_KERNEL_BITS); ++ #endif ++ long cpu = sysconf (_SC_CPU_VERSION); ++ ++ switch (cpu) ++ { ++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break; ++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break; ++ case CPU_PA_RISC2_0: ++ #if defined(_SC_KERNEL_BITS) ++ switch (bits) ++ { ++ case 64: puts ("hppa2.0w"); break; ++ case 32: puts ("hppa2.0n"); break; ++ default: puts ("hppa2.0"); break; ++ } break; ++ #else /* !defined(_SC_KERNEL_BITS) */ ++ puts ("hppa2.0"); break; ++ #endif ++ default: puts ("hppa1.0"); break; ++ } ++ exit (0); ++ } + EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa +@@ -648,9 +651,19 @@ EOF + 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 -q __LP64__ + then + HP_ARCH="hppa2.0w" + else +@@ -658,11 +671,11 @@ EOF + 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 +@@ -690,216 +703,254 @@ EOF + 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 craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ 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 ;; ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` ++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; + 5000:UNIX_System_V:4.*:*) +- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` +- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" +- exit 0 ;; ++ 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 ;; ++ exit ;; + *:FreeBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` +- exit 0 ;; ++ 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*:*) ++ case ${UNAME_MACHINE} in ++ x86) ++ echo i586-pc-interix${UNAME_RELEASE} ++ exit ;; ++ authenticamd | genuineintel | EM64T) ++ echo x86_64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ IA64) ++ echo ia64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks +- exit 0 ;; ++ exit ;; ++ 8664:Windows_NT:*) ++ echo x86_64-pc-mks ++ exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix +- exit 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 0 ;; ++ exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix +- exit 0 ;; ++ exit ;; ++ alpha:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ EV5) UNAME_MACHINE=alphaev5 ;; ++ EV56) UNAME_MACHINE=alphaev56 ;; ++ PCA56) UNAME_MACHINE=alphapca56 ;; ++ PCA57) UNAME_MACHINE=alphapca56 ;; ++ EV6) UNAME_MACHINE=alphaev6 ;; ++ EV67) UNAME_MACHINE=alphaev67 ;; ++ EV68*) UNAME_MACHINE=alphaev68 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ++ exit ;; + arm*:Linux:*:*) ++ eval $set_cc_for_build ++ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_EABI__ ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ else ++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_PCS_VFP ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ else ++ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf ++ fi ++ 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 0 ;; ++ exit ;; + frv:Linux:*:*) +- echo frv-unknown-linux-gnu +- exit 0 ;; ++ echo frv-unknown-linux-gnu ++ exit ;; ++ i*86:Linux:*:*) ++ LIBC=gnu ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++ #ifdef __dietlibc__ ++ LIBC=dietlibc ++ #endif ++EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ++ echo "${UNAME_MACHINE}-pc-linux-${LIBC}" ++ exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; +- mips:Linux:*:*) +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #undef CPU +- #undef mips +- #undef mipsel +- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mipsel +- #else +- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips +- #else +- CPU= +- #endif +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 +- ;; +- mips64:Linux:*:*) ++ exit ;; ++ mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU +- #undef mips64 +- #undef mips64el ++ #undef ${UNAME_MACHINE} ++ #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mips64el ++ CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips64 ++ CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; +- ppc:Linux:*:*) +- echo powerpc-unknown-linux-gnu +- exit 0 ;; +- ppc64:Linux:*:*) +- echo powerpc64-unknown-linux-gnu +- exit 0 ;; +- alpha:Linux:*:*) +- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +- EV5) UNAME_MACHINE=alphaev5 ;; +- EV56) UNAME_MACHINE=alphaev56 ;; +- PCA56) UNAME_MACHINE=alphapca56 ;; +- PCA57) UNAME_MACHINE=alphapca56 ;; +- EV6) UNAME_MACHINE=alphaev6 ;; +- EV67) UNAME_MACHINE=alphaev67 ;; +- EV68*) UNAME_MACHINE=alphaev68 ;; +- esac +- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null +- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi +- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} +- exit 0 ;; ++ or32:Linux:*:*) ++ echo or32-unknown-linux-gnu ++ exit ;; ++ padre:Linux:*:*) ++ echo sparc-unknown-linux-gnu ++ exit ;; ++ parisc64:Linux:*:* | hppa64:Linux:*:*) ++ echo hppa64-unknown-linux-gnu ++ exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +@@ -907,115 +958,71 @@ EOF + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac +- exit 0 ;; +- parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ ppc64:Linux:*:*) ++ echo powerpc64-unknown-linux-gnu ++ exit ;; ++ ppc:Linux:*:*) ++ echo powerpc-unknown-linux-gnu ++ exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux +- exit 0 ;; ++ exit ;; + sh64*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ 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 ;; ++ tile*:Linux:*:*) ++ echo ${UNAME_MACHINE}-tilera-linux-gnu ++ exit ;; ++ vax:Linux:*:*) ++ echo ${UNAME_MACHINE}-dec-linux-gnu ++ exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu +- exit 0 ;; +- 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 +- # problems with other programs or directories called `ld' in the path. +- # Set LC_ALL=C to ensure ld outputs messages in English. +- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ +- | sed -ne '/supported targets:/!d +- s/[ ][ ]*/ /g +- s/.*supported targets: *// +- s/ .*// +- p'` +- case "$ld_supported_targets" in +- elf32-i386) +- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" +- ;; +- a.out-i386-linux) +- echo "${UNAME_MACHINE}-pc-linux-gnuaout" +- exit 0 ;; +- coff-i386) +- echo "${UNAME_MACHINE}-pc-linux-gnucoff" +- exit 0 ;; +- "") +- # 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 ;; +- esac +- # Determine whether the default compiler is a.out or elf +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include +- #ifdef __ELF__ +- # ifdef __GLIBC__ +- # if __GLIBC__ >= 2 +- LIBC=gnu +- # else +- LIBC=gnulibc1 +- # endif +- # else +- LIBC=gnulibc1 +- # endif +- #else +- #ifdef __INTEL_COMPILER +- 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}-pc-linux-${LIBC}" && exit 0 +- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 +- ;; ++ exit ;; ++ xtensa*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 +- exit 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... +- # I am not positive that other SVR4 systems won't match this, ++ # Unixware is an offshoot of SVR4, but it has its own version ++ # number series starting with 2... ++ # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. +- # Use sysv4.2uw... so that sysv4* matches it. ++ # 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 ;; +- i*86:syllable:*:*) ++ exit ;; ++ i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable +- exit 0 ;; +- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) ++ exit ;; ++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + 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 +@@ -1023,15 +1030,16 @@ EOF + 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 ;; ++ exit ;; + M68*:*:R3V[5678]*:*) +- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; ++ 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 ;; ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4; exit; } ;; ++ NCR*:*:4.2:* | MPRAS*:*:4.2:*) ++ OS_REL='.3' ++ test -r /etc/.relid \ ++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} +- exit 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 ;; +- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) ++ exit ;; ++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + 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` +@@ -1123,69 +1144,94 @@ EOF + else + echo ns32k-sni-sysv + fi +- exit 0 ;; +- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort +- # says +- echo i586-unisys-sysv4 +- exit 0 ;; ++ exit ;; ++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort ++ # says ++ echo i586-unisys-sysv4 ++ 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} ++ echo mips-nec-sysv${UNAME_RELEASE} + else +- echo mips-unknown-sysv${UNAME_RELEASE} ++ 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 ;; ++ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. ++ echo i586-pc-haiku ++ 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:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in +- *86) UNAME_PROCESSOR=i686 ;; ++ i386) ++ eval $set_cc_for_build ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ UNAME_PROCESSOR="x86_64" ++ fi ++ fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then +@@ -1193,22 +1239,28 @@ EOF + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:QNX:*:4*) + echo i386-pc-qnx +- exit 0 ;; ++ exit ;; ++ NEO-?:NONSTOP_KERNEL:*:*) ++ echo neo-tandem-nsk${UNAME_RELEASE} ++ 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 +@@ -1219,41 +1271,50 @@ EOF + 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 ;; ++ echo mips-sei-seiux${UNAME_RELEASE} ++ exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` +- exit 0 ;; ++ exit ;; + *:*VMS:*:*) +- UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in +- A*) echo alpha-dec-vms && exit 0 ;; +- I*) echo ia64-dec-vms && exit 0 ;; +- V*) echo vax-dec-vms && exit 0 ;; ++ 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 0 ;; ++ exit ;; ++ i*86:skyos:*:*) ++ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' ++ exit ;; ++ i*86:rdos:*:*) ++ echo ${UNAME_MACHINE}-pc-rdos ++ exit ;; ++ i*86:AROS:*:*) ++ echo ${UNAME_MACHINE}-pc-aros ++ exit ;; + esac + + #echo '(No uname command or uname output not recognized.)' 1>&2 +@@ -1276,16 +1337,16 @@ main () + #include + printf ("m68k-sony-newsos%s\n", + #ifdef NEWSOS4 +- "4" ++ "4" + #else +- "" ++ "" + #endif +- ); exit (0); ++ ); exit (0); + #endif + #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) +@@ -1374,11 +1435,12 @@ main () + } + 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) + +@@ -1387,22 +1449,22 @@ then + 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 + +@@ -1413,7 +1475,9 @@ This script, last modified $timestamp, h + 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 diff -Nru cloop-2.6.31.1.1ubuntu1/debian/patches/clean_modbuild_remains cloop-2.6.39.2/debian/patches/clean_modbuild_remains --- cloop-2.6.31.1.1ubuntu1/debian/patches/clean_modbuild_remains 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/patches/clean_modbuild_remains 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1,13 @@ +Index: Makefile +=================================================================== +--- a/Makefile (Revision 3855) ++++ b/Makefile (Arbeitskopie) +@@ -59,7 +59,7 @@ + $(CC) -Wall -O2 -s -o $@ $< + + clean: +- rm -rf create_compressed_fs extract_compressed_fs zoom *.o *.ko Module.symvers .cloop* .compressed_loop.* .tmp* ++ rm -rf create_compressed_fs extract_compressed_fs zoom *.o *.ko Module.symvers .cloop* .compressed_loop.* .tmp* modules.order cloop.mod.c + [ -f advancecomp-1.15/Makefile ] && $(MAKE) -C advancecomp-1.15 distclean || true + + dist: clean diff -Nru cloop-2.6.31.1.1ubuntu1/debian/patches/macosx_build cloop-2.6.39.2/debian/patches/macosx_build --- cloop-2.6.31.1.1ubuntu1/debian/patches/macosx_build 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/patches/macosx_build 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1,43 @@ +Description: Basic support for MacOS X +Author: Tim Wilson-Brown +Bug-Debian: http://bugs.debian.org/370204 + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- cloop-2.6.39.2.orig/extract_compressed_fs.c ++++ cloop-2.6.39.2/extract_compressed_fs.c +@@ -10,14 +10,22 @@ + #include + #include + #include ++ ++/*Mac OS X does not have endian.h*/ ++#if defined(__APPLE__) ++#include ++#else + #include ++#endif ++ + #include + #include + #include + #include + #include + +-#ifdef __CYGWIN__ ++/*Mac OS X does not have loff_t*/ ++#if defined(__CYGWIN__) || defined(__APPLE__) + typedef uint64_t loff_t; + #endif + #ifndef be64toh diff -Nru cloop-2.6.31.1.1ubuntu1/debian/patches/series cloop-2.6.39.2/debian/patches/series --- cloop-2.6.31.1.1ubuntu1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/patches/series 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1,3 @@ +clean_modbuild_remains +autotools_stuff +macosx_build diff -Nru cloop-2.6.31.1.1ubuntu1/debian/po/da.po cloop-2.6.39.2/debian/po/da.po --- cloop-2.6.31.1.1ubuntu1/debian/po/da.po 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/po/da.po 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1,28 @@ +# Danish translation cloop. +# Copyright (C) cloop & nedenstående oversættere. +# This file is distributed under the same license as the cloop package. +# Joe Hansen (joedalton2@yahoo.dk), 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: cloop\n" +"Report-Msgid-Bugs-To: blade@debian.org\n" +"POT-Creation-Date: 2006-08-02 23:44+0200\n" +"PO-Revision-Date: 2011-05-23 18:30+01:00\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cloop-module-_KVERS_.templates:1001 +msgid "Create device nodes for compressed loop devices?" +msgstr "Opret enhedsknuder for komprimerede loopenheder?" + +#. Type: boolean +#. Description +#: ../cloop-module-_KVERS_.templates:1001 +msgid "Should the necessary device files in /dev be generated now?" +msgstr "Skal de nødvendige enhedsfiler i /dev oprettes nu?" diff -Nru cloop-2.6.31.1.1ubuntu1/debian/po/ko.po cloop-2.6.39.2/debian/po/ko.po --- cloop-2.6.31.1.1ubuntu1/debian/po/ko.po 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/po/ko.po 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1,29 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: blade@debian.org\n" +"POT-Creation-Date: 2006-08-02 23:44+0200\n" +"PO-Revision-Date: 2011-07-01 16:15+0900\n" +"Last-Translator: 임영재 \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../cloop-module-_KVERS_.templates:1001 +msgid "Create device nodes for compressed loop devices?" +msgstr "드라이브 노드를 만들기 위해 압축 하세요" + +#. Type: boolean +#. Description +#: ../cloop-module-_KVERS_.templates:1001 +msgid "Should the necessary device files in /dev be generated now?" +msgstr "/dev에 필수 파일을 생성하시겠습니까?" + diff -Nru cloop-2.6.31.1.1ubuntu1/debian/rules cloop-2.6.39.2/debian/rules --- cloop-2.6.31.1.1ubuntu1/debian/rules 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/debian/rules 2012-01-03 06:46:19.000000000 +0000 @@ -16,7 +16,10 @@ -include $(MA_DIR)/include/generic.mk -include $(MA_DIR)/include/common-rules.mk -NCPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1) +PARJOBS=-j2 +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +PARJOBS = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +endif binary: binary-indep binary-arch @@ -34,7 +37,7 @@ build: configure-stamp build-stamp build-stamp: dh_testdir - $(MAKE) -j$(NCPUS) utils + $(MAKE) $(PARJOBS) utils touch build-stamp # for m-a @@ -64,7 +67,7 @@ rm -f build-stamp configure-stamp $(MAKE) clean || true -dh_clean - rm -rf debian/cloop-?.?.?* debian/cloop debian/cloop-module debian/cloop-module-?.?.* debian/*.files knoppix CHANGELOG_ + rm -rf debian/cloop-?.?.?* debian/cloop debian/cloop-module debian/cloop-module-?.?.* debian/*.files knoppix install: DH_OPTIONS= install: build @@ -86,9 +89,8 @@ dh_testroot dh_clean -k dh_installdirs -p cloop-src usr/src/modules/cloop - echo $$UID tar -cf - {Makefile,*.[ch],debian/{po,compat,*template*,control*,copyright,rules,dirs,*_KVERS_*,README.Debian,changelog},README} | tar -x -C debian/cloop-src/usr/src/modules/cloop - cat changelog.knoppix CHANGELOG > debian/cloop-src/usr/src/modules/cloop/CHANGELOG + cp CHANGELOG debian/cloop-src/usr/src/modules/cloop/CHANGELOG dh_fixperms -i cd debian/cloop-src/usr/src ; tar -cf - modules | bzip2 -9 > cloop.tar.bz2 ; rm -rf modules @@ -102,7 +104,7 @@ dh_installdebconf -a dh_installdocs -a README debian/README.Debian dh_installexamples -a cloop-node-control.sh - cat changelog.knoppix CHANGELOG > CHANGELOG_ && dh_installchangelogs CHANGELOG_ -a + dh_installchangelogs CHANGELOG -a dh_strip -a dh_link -a dh_compress -a @@ -111,14 +113,14 @@ dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a - dh_builddeb -a + dh_builddeb -a -- -Zxz build-indep: configure-stamp dh_testdir -i dh_testroot -i dh_installdocs -i README debian/README.Debian dh_installexamples -i - cat changelog.knoppix CHANGELOG > CHANGELOG_ && dh_installchangelogs CHANGELOG_ -i + dh_installchangelogs CHANGELOG -i dh_strip -i dh_link -i dh_compress -i @@ -127,7 +129,7 @@ dh_shlibdeps -i dh_gencontrol -i dh_md5sums -i - dh_builddeb -i + dh_builddeb -i -- -Zxz .PHONY: build clean binary-indep binary-arch binary kdist kdist_image kdist_configure kdist_clean kdist .NOTPARALLEL: diff -Nru cloop-2.6.31.1.1ubuntu1/debian/source/format cloop-2.6.39.2/debian/source/format --- cloop-2.6.31.1.1ubuntu1/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/source/format 2012-01-03 07:02:38.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru cloop-2.6.31.1.1ubuntu1/debian/source/options cloop-2.6.39.2/debian/source/options --- cloop-2.6.31.1.1ubuntu1/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/debian/source/options 2012-01-03 06:46:19.000000000 +0000 @@ -0,0 +1 @@ +compression=xz diff -Nru cloop-2.6.31.1.1ubuntu1/extract_compressed_fs.c cloop-2.6.39.2/extract_compressed_fs.c --- cloop-2.6.31.1.1ubuntu1/extract_compressed_fs.c 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/extract_compressed_fs.c 2011-07-06 16:42:59.000000000 +0000 @@ -37,7 +37,7 @@ #endif #endif /* !be64toh */ #define __be64_to_cpu be64toh -#include "compressed_loop.h" +#include "cloop.h" struct compressed_block { @@ -47,7 +47,8 @@ int main(int argc, char *argv[]) { - unsigned int i, handle, output, total_blocks, total_offsets, offsets_size, + int handle, output; + unsigned int i, total_blocks, total_offsets, offsets_size, compressed_buffer_size, uncompressed_buffer_size; struct cloop_head head; unsigned char *compressed_buffer, *uncompressed_buffer; @@ -75,7 +76,8 @@ if(!strcmp(argv[2],"-")) output = STDOUT_FILENO; else { - output = open(argv[2], O_WRONLY|O_LARGEFILE); + output = open(argv[2], O_CREAT|O_WRONLY|O_LARGEFILE, + S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (output < 0) { perror("Opening uncompressed output file\n"); exit(1); diff -Nru cloop-2.6.31.1.1ubuntu1/Makefile cloop-2.6.39.2/Makefile --- cloop-2.6.31.1.1ubuntu1/Makefile 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/Makefile 2011-05-27 11:12:41.000000000 +0000 @@ -1,7 +1,9 @@ #!/usr/bin/make MACHINE=$(shell uname -m) -KERNEL_DIR=/usr/src/linux +ifndef KERNEL_DIR +KERNEL_DIR:=/lib/modules/`uname -r`/build +endif file_exist=$(shell test -f $(1) && echo yes || echo no) @@ -16,7 +18,7 @@ CFLAGS:=-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer endif -KERNOBJ:=compressed_loop.o +KERNOBJ:=cloop.o # Name of module ifeq ($(PATCHLEVEL),6) @@ -38,9 +40,9 @@ # For Kernel 2.6, we now use the "recommended" way to build kernel modules obj-m := cloop.o -cloop-objs := compressed_loop.o +# cloop-objs := cloop.o -$(MODULE): compressed_loop.c compressed_loop.h +$(MODULE): cloop.c cloop.h @echo "Building for Kernel Patchlevel $(PATCHLEVEL)" $(MAKE) modules -C $(KERNEL_DIR) M=$(CURDIR) @@ -54,15 +56,13 @@ $(CC) -Wall -O2 -s -o $@ $< -lz cloop_suspend: cloop_suspend.o - $(CC) -o $@ $< + $(CC) -Wall -O2 -s -o $@ $< clean: - rm -rf create_compressed_fs extract_compressed_fs zoom *.o *.ko Module.symvers .cloop* .compressed_loop.* .tmp* modules.order cloop.mod.c + rm -rf create_compressed_fs extract_compressed_fs zoom *.o *.ko Module.symvers .cloop* .compressed_loop.* .tmp* [ -f advancecomp-1.15/Makefile ] && $(MAKE) -C advancecomp-1.15 distclean || true dist: clean cd .. ; \ tar -cf - cloop/{Makefile,*.[ch],CHANGELOG,README} | \ bzip2 -9 > $(HOME)/redhat/SOURCES/cloop.tar.bz2 - -compressed_loop.o create_compressed_fs.o: compressed_loop.h diff -Nru cloop-2.6.31.1.1ubuntu1/modules.order cloop-2.6.39.2/modules.order --- cloop-2.6.31.1.1ubuntu1/modules.order 1970-01-01 00:00:00.000000000 +0000 +++ cloop-2.6.39.2/modules.order 2011-07-06 17:08:59.000000000 +0000 @@ -0,0 +1 @@ +kernel//build/Microknoppix/Kernel/cloop-2.639/cloop.ko diff -Nru cloop-2.6.31.1.1ubuntu1/patch.advancecomp_15_for_advfs.diff cloop-2.6.39.2/patch.advancecomp_15_for_advfs.diff --- cloop-2.6.31.1.1ubuntu1/patch.advancecomp_15_for_advfs.diff 2010-01-27 17:25:34.000000000 +0000 +++ cloop-2.6.39.2/patch.advancecomp_15_for_advfs.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,270 +0,0 @@ ---- /tmp/advancecomp-1.15/Makefile.in 2005-11-01 09:41:57.000000000 +0100 -+++ advancecomp-1.15/Makefile.in 2006-08-12 12:12:26.356972984 +0200 -@@ -1,8 +1,8 @@ --# Makefile.in generated by automake 1.9.4 from Makefile.am. -+# Makefile.in generated by automake 1.9.6 from Makefile.am. - # @configure_input@ - - # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, --# 2003, 2004 Free Software Foundation, Inc. -+# 2003, 2004, 2005 Free Software Foundation, Inc. - # This Makefile.in is free software; the Free Software Foundation - # gives unlimited permission to copy and/or distribute it, - # with or without modifications, as long as this notice is preserved. -@@ -15,8 +15,6 @@ - @SET_MAKE@ - - --SOURCES = $(advdef_SOURCES) $(advmng_SOURCES) $(advpng_SOURCES) $(advzip_SOURCES) -- - srcdir = @srcdir@ - top_srcdir = @top_srcdir@ - VPATH = @srcdir@ -@@ -39,7 +37,7 @@ - POST_UNINSTALL = : - build_triplet = @build@ - host_triplet = @host@ --bin_PROGRAMS = advzip$(EXEEXT) advpng$(EXEEXT) advmng$(EXEEXT) \ -+bin_PROGRAMS = advfs$(EXEEXT) advpng$(EXEEXT) advmng$(EXEEXT) \ - advdef$(EXEEXT) - DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ -@@ -99,7 +97,7 @@ - WindowIn.$(OBJEXT) WindowOut.$(OBJEXT) - advpng_OBJECTS = $(am_advpng_OBJECTS) - advpng_LDADD = $(LDADD) --am_advzip_OBJECTS = rezip.$(OBJEXT) zip.$(OBJEXT) file.$(OBJEXT) \ -+am_advfs_OBJECTS = advfs.$(OBJEXT) zip.$(OBJEXT) file.$(OBJEXT) \ - data.$(OBJEXT) siglock.$(OBJEXT) compress.$(OBJEXT) \ - zipsh.$(OBJEXT) getopt.$(OBJEXT) snprintf.$(OBJEXT) \ - 7zdeflate.$(OBJEXT) 7zlzma.$(OBJEXT) AriBitCoder.$(OBJEXT) \ -@@ -110,8 +108,8 @@ - LZMAEncoder.$(OBJEXT) LenCoder.$(OBJEXT) \ - LiteralCoder.$(OBJEXT) OutByte.$(OBJEXT) WindowIn.$(OBJEXT) \ - WindowOut.$(OBJEXT) --advzip_OBJECTS = $(am_advzip_OBJECTS) --advzip_LDADD = $(LDADD) -+advfs_OBJECTS = $(am_advfs_OBJECTS) -+advfs_LDADD = $(LDADD) - DEFAULT_INCLUDES = -I. -I$(srcdir) -I. - depcomp = - am__depfiles_maybe = -@@ -120,14 +118,14 @@ - CCLD = $(CC) - LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ -- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) --CXXLD = $(CXX) -+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -pthread -+CXXLD = $(CXX) -pthread - CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ - SOURCES = $(advdef_SOURCES) $(advmng_SOURCES) $(advpng_SOURCES) \ -- $(advzip_SOURCES) -+ $(advfs_SOURCES) - DIST_SOURCES = $(advdef_SOURCES) $(advmng_SOURCES) $(advpng_SOURCES) \ -- $(advzip_SOURCES) -+ $(advfs_SOURCES) - man1dir = $(mandir)/man1 - NROFF = nroff - MANS = $(man_MANS) -@@ -165,6 +163,7 @@ - ECHO_T = @ECHO_T@ - EGREP = @EGREP@ - EXEEXT = @EXEEXT@ -+GREP = @GREP@ - GROFF = @GROFF@ - GZIP = @GZIP@ - INSTALL_DATA = @INSTALL_DATA@ -@@ -191,7 +190,6 @@ - VERSION = @VERSION@ - ac_ct_CC = @ac_ct_CC@ - ac_ct_CXX = @ac_ct_CXX@ --ac_ct_STRIP = @ac_ct_STRIP@ - am__leading_dot = @am__leading_dot@ - am__tar = @am__tar@ - am__untar = @am__untar@ -@@ -202,28 +200,35 @@ - build_os = @build_os@ - build_vendor = @build_vendor@ - datadir = @datadir@ -+datarootdir = @datarootdir@ -+docdir = @docdir@ -+dvidir = @dvidir@ - exec_prefix = @exec_prefix@ - host = @host@ - host_alias = @host_alias@ - host_cpu = @host_cpu@ - host_os = @host_os@ - host_vendor = @host_vendor@ -+htmldir = @htmldir@ - includedir = @includedir@ - infodir = @infodir@ - install_sh = @install_sh@ - libdir = @libdir@ - libexecdir = @libexecdir@ -+localedir = @localedir@ - localstatedir = @localstatedir@ - mandir = @mandir@ - mkdir_p = @mkdir_p@ - oldincludedir = @oldincludedir@ -+pdfdir = @pdfdir@ - prefix = @prefix@ - program_transform_name = @program_transform_name@ -+psdir = @psdir@ - sbindir = @sbindir@ - sharedstatedir = @sharedstatedir@ - sysconfdir = @sysconfdir@ - target_alias = @target_alias@ --advzip_SOURCES = \ -+advfs_SOURCES = \ - rezip.cc \ - zip.cc \ - file.cc \ -@@ -358,10 +363,10 @@ - - EXTRA_DIST = \ - README AUTHORS HISTORY INSTALL COPYING \ -- doc/advdef.d doc/advzip.d doc/advpng.d doc/advmng.d doc/history.d doc/readme.d doc/authors.d doc/install.d \ -- doc/advdef.1 doc/advzip.1 doc/advpng.1 doc/advmng.1 doc/history.1 doc/readme.1 doc/authors.1 doc/install.1 \ -- doc/advdef.txt doc/advzip.txt doc/advpng.txt doc/advmng.txt doc/history.txt doc/readme.txt doc/authors.txt doc/install.txt \ -- doc/advdef.html doc/advzip.html doc/advpng.html doc/advmng.html doc/history.html doc/readme.html doc/authors.html doc/install.html \ -+ doc/advdef.d doc/advfs.d doc/advpng.d doc/advmng.d doc/history.d doc/readme.d doc/authors.d doc/install.d \ -+ doc/advdef.1 doc/advfs.1 doc/advpng.1 doc/advmng.1 doc/history.1 doc/readme.1 doc/authors.1 doc/install.1 \ -+ doc/advdef.txt doc/advfs.txt doc/advpng.txt doc/advmng.txt doc/history.txt doc/readme.txt doc/authors.txt doc/install.txt \ -+ doc/advdef.html doc/advfs.html doc/advpng.html doc/advmng.html doc/history.html doc/readme.html doc/authors.html doc/install.html \ - autogen.sh noautomake.sh \ - 7z/README \ - test/test.lst \ -@@ -435,19 +440,19 @@ - 7z/WindowIn.h \ - 7z/WindowOut.h - --man_MANS = doc/advdef.1 doc/advzip.1 doc/advpng.1 doc/advmng.1 -+man_MANS = doc/advdef.1 doc/advfs.1 doc/advpng.1 doc/advmng.1 - DISTDOS_ROOT = \ - doc/readme.txt doc/authors.txt doc/history.txt doc/copying.txt \ -- advdef.exe advzip.exe advpng.exe advmng.exe -+ advdef.exe advfs.exe advpng.exe advmng.exe - - DISTDOS_DOC = \ -- doc/advdef.txt doc/advzip.txt doc/advpng.txt doc/advmng.txt \ -+ doc/advdef.txt doc/advfs.txt doc/advpng.txt doc/advmng.txt \ - doc/readme.txt doc/authors.txt doc/history.txt \ -- doc/advdef.html doc/advzip.html doc/advpng.html doc/advmng.html \ -+ doc/advdef.html doc/advfs.html doc/advpng.html doc/advmng.html \ - doc/readme.html doc/authors.html doc/history.html - - DISTWEB = \ -- doc/advdef.hh doc/advzip.hh doc/advpng.hh doc/advmng.hh doc/history.hh -+ doc/advdef.hh doc/advfs.hh doc/advpng.hh doc/advmng.hh doc/history.hh - - all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-am -@@ -536,9 +541,9 @@ - advpng$(EXEEXT): $(advpng_OBJECTS) $(advpng_DEPENDENCIES) - @rm -f advpng$(EXEEXT) - $(CXXLINK) $(advpng_LDFLAGS) $(advpng_OBJECTS) $(advpng_LDADD) $(LIBS) --advzip$(EXEEXT): $(advzip_OBJECTS) $(advzip_DEPENDENCIES) -- @rm -f advzip$(EXEEXT) -- $(CXXLINK) $(advzip_LDFLAGS) $(advzip_OBJECTS) $(advzip_LDADD) $(LIBS) -+advfs$(EXEEXT): $(advfs_OBJECTS) $(advfs_DEPENDENCIES) -+ @rm -f advfs$(EXEEXT) -+ $(CXXLINK) $(advfs_LDFLAGS) $(advfs_OBJECTS) $(advfs_LDADD) $(LIBS) -lpthread - - mostlyclean-compile: - -rm -f *.$(OBJEXT) -@@ -582,6 +587,9 @@ - mng.obj: lib/mng.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mng.obj `if test -f 'lib/mng.c'; then $(CYGPATH_W) 'lib/mng.c'; else $(CYGPATH_W) '$(srcdir)/lib/mng.c'; fi` - -+advfs.o: -+ $(CXXCOMPILE) -c -o advfs.o ../advfs.cc -+ - .cc.o: - $(CXXCOMPILE) -c -o $@ $< - -@@ -1027,7 +1035,7 @@ - clean-local: - rm -f check.lst check.zip mappy.mng mappy.png - rm -f basn2c08.png basn3p01.png basn3p02.png basn3p04.png basn3p08.png basn6a08.png basn6a04.png -- rm -f advdef.exe advzip.exe advpng.exe advmng.exe -+ rm -f advdef.exe advfs.exe advpng.exe advmng.exe - rm -f mappy*.png - - maintainer-clean-local: -@@ -1065,31 +1073,31 @@ - doc/copying.txt: COPYING - cat $< | todos > $@ - --check-local: advzip test/test.lst -- @./advzip -a -1 check.zip $(srcdir)/COPYING -- @./advzip -L check.zip > check.lst -- @./advzip -t -p check.zip -- @./advzip -a -2 check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -- @./advzip -a -3 check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -- @./advzip -a -4 check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -- @./advzip -a -1 -N check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -- @./advzip -a -2 -N check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -- @./advzip -a -3 -N check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -- @./advzip -a -4 -N check.zip $(srcdir)/COPYING -- @./advzip -L check.zip >> check.lst -- @./advzip -t -p check.zip -+check-local: advfs test/test.lst -+ @./advfs -a -1 check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip > check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -2 check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -3 check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -4 check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -1 -N check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -2 -N check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -3 -N check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip -+ @./advfs -a -4 -N check.zip $(srcdir)/COPYING -+ @./advfs -L check.zip >> check.lst -+ @./advfs -t -p check.zip - @cp $(srcdir)/test/mappy.mng . - @./advmng -v -z -1 -f -S 8 mappy.mng - @./advmng -L mappy.mng >> check.lst -@@ -1111,7 +1119,7 @@ - - distdos: $(DISTDOS_ROOT) $(DISTDOS_DOC) - i586-pc-msdosdjgpp-strip advdef.exe -- i586-pc-msdosdjgpp-strip advzip.exe -+ i586-pc-msdosdjgpp-strip advfs.exe - i586-pc-msdosdjgpp-strip advpng.exe - i586-pc-msdosdjgpp-strip advmng.exe - rm -f $(PACKAGE)-$(VERSION)-dos-pentium.zip -@@ -1124,7 +1132,7 @@ - - distwindows: $(DISTDOS_ROOT) $(DISTDOS_DOC) - i386-mingw32msvc-strip advdef.exe -- i386-mingw32msvc-strip advzip.exe -+ i386-mingw32msvc-strip advfs.exe - i386-mingw32msvc-strip advpng.exe - i386-mingw32msvc-strip advmng.exe - rm -f $(PACKAGE)-$(VERSION)-windows-pentium.zip