aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/.svn
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.svn')
-rw-r--r--scripts/.svn/entries1360
-rw-r--r--scripts/.svn/prop-base/abs2rel.pl.svn-base9
-rw-r--r--scripts/.svn/prop-base/arm-magic.sh.svn-base9
-rw-r--r--scripts/.svn/prop-base/brcmImage.pl.svn-base5
-rw-r--r--scripts/.svn/prop-base/bundle-libraries.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/combined-ext-image.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/config.guess.svn-base9
-rw-r--r--scripts/.svn/prop-base/config.rpath.svn-base5
-rw-r--r--scripts/.svn/prop-base/config.sub.svn-base5
-rw-r--r--scripts/.svn/prop-base/deptest.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/diffconfig.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/dl_cleanup.py.svn-base5
-rw-r--r--scripts/.svn/prop-base/download.pl.svn-base9
-rw-r--r--scripts/.svn/prop-base/env.svn-base5
-rw-r--r--scripts/.svn/prop-base/ext-toolchain.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/feeds.svn-base5
-rw-r--r--scripts/.svn/prop-base/gen-dependencies.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/getver.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/ipkg-make-index.sh.svn-base9
-rw-r--r--scripts/.svn/prop-base/ipkg.svn-base9
-rw-r--r--scripts/.svn/prop-base/kconfig.pl.svn-base9
-rw-r--r--scripts/.svn/prop-base/make-ipkg-dir.sh.svn-base9
-rw-r--r--scripts/.svn/prop-base/md5sum.svn-base5
-rw-r--r--scripts/.svn/prop-base/metadata.pl.svn-base9
-rw-r--r--scripts/.svn/prop-base/om-fwupgradecfg-gen.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/pad_image.svn-base5
-rw-r--r--scripts/.svn/prop-base/patch-kernel.sh.svn-base9
-rw-r--r--scripts/.svn/prop-base/patch-specs.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/relink-lib.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/remote-gdb.svn-base5
-rw-r--r--scripts/.svn/prop-base/rstrip.sh.svn-base9
-rw-r--r--scripts/.svn/prop-base/slugimage.pl.svn-base9
-rw-r--r--scripts/.svn/prop-base/strip-kmod.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/symlink-tree.sh.svn-base5
-rw-r--r--scripts/.svn/prop-base/timestamp.pl.svn-base9
-rw-r--r--scripts/.svn/prop-base/update-package-md5sum.svn-base5
-rw-r--r--scripts/.svn/text-base/abs2rel.pl.svn-base16
-rw-r--r--scripts/.svn/text-base/arm-magic.sh.svn-base42
-rw-r--r--scripts/.svn/text-base/brcmImage.pl.svn-base162
-rw-r--r--scripts/.svn/text-base/bundle-libraries.sh.svn-base111
-rw-r--r--scripts/.svn/text-base/combined-ext-image.sh.svn-base61
-rw-r--r--scripts/.svn/text-base/combined-image.sh.svn-base34
-rw-r--r--scripts/.svn/text-base/config.guess.svn-base1502
-rw-r--r--scripts/.svn/text-base/config.rpath.svn-base666
-rw-r--r--scripts/.svn/text-base/config.sub.svn-base1730
-rw-r--r--scripts/.svn/text-base/deptest.sh.svn-base211
-rw-r--r--scripts/.svn/text-base/diffconfig.sh.svn-base11
-rw-r--r--scripts/.svn/text-base/dl_cleanup.py.svn-base231
-rw-r--r--scripts/.svn/text-base/download.pl.svn-base207
-rw-r--r--scripts/.svn/text-base/env.svn-base224
-rw-r--r--scripts/.svn/text-base/ext-toolchain.sh.svn-base581
-rw-r--r--scripts/.svn/text-base/feeds.svn-base640
-rw-r--r--scripts/.svn/text-base/freebsd.sh.svn-base1
-rw-r--r--scripts/.svn/text-base/gen-dependencies.sh.svn-base24
-rw-r--r--scripts/.svn/text-base/getver.sh.svn-base34
-rw-r--r--scripts/.svn/text-base/ipkg-make-index.sh.svn-base28
-rw-r--r--scripts/.svn/text-base/ipkg.svn-base1183
-rw-r--r--scripts/.svn/text-base/kconfig.pl.svn-base182
-rw-r--r--scripts/.svn/text-base/make-ipkg-dir.sh.svn-base21
-rw-r--r--scripts/.svn/text-base/md5sum.svn-base2
-rw-r--r--scripts/.svn/text-base/metadata.pl.svn-base844
-rw-r--r--scripts/.svn/text-base/metadata.pm.svn-base159
-rw-r--r--scripts/.svn/text-base/om-fwupgradecfg-gen.sh.svn-base70
-rw-r--r--scripts/.svn/text-base/openbsd.sh.svn-base24
-rw-r--r--scripts/.svn/text-base/pad_image.svn-base100
-rw-r--r--scripts/.svn/text-base/patch-kernel.sh.svn-base54
-rw-r--r--scripts/.svn/text-base/patch-specs.sh.svn-base90
-rw-r--r--scripts/.svn/text-base/relink-lib.sh.svn-base14
-rw-r--r--scripts/.svn/text-base/remote-gdb.svn-base82
-rw-r--r--scripts/.svn/text-base/rstrip.sh.svn-base39
-rw-r--r--scripts/.svn/text-base/slugimage.pl.svn-base1217
-rw-r--r--scripts/.svn/text-base/strip-kmod.sh.svn-base50
-rw-r--r--scripts/.svn/text-base/symlink-tree.sh.svn-base45
-rw-r--r--scripts/.svn/text-base/timestamp.pl.svn-base69
-rw-r--r--scripts/.svn/text-base/update-package-md5sum.svn-base38
75 files changed, 12386 insertions, 0 deletions
diff --git a/scripts/.svn/entries b/scripts/.svn/entries
new file mode 100644
index 0000000..69b7ed7
--- /dev/null
+++ b/scripts/.svn/entries
@@ -0,0 +1,1360 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/scripts
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+deptest.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+cef548535fd6d7914eef6856ce8fad5a
+2010-12-08T16:08:14.644185Z
+24350
+mb
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5541
+
+config.rpath
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+997e6d6329fdd69c134439110922c96b
+2011-02-27T15:39:27.064530Z
+25753
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+18343
+
+update-package-md5sum
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+6159b3717de6804a4e72c92e4b05e5b2
+2010-01-03T17:06:06.812530Z
+19019
+lars
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1193
+
+env
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+7397f07e13e0e242cfb4ba411fe9f65c
+2012-02-16T19:24:34.867738Z
+30602
+florian
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4727
+
+kconfig.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+a5c59fd8abc21d13418baad7385ea925
+2012-07-22T21:00:07.669605Z
+32788
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3723
+
+make-ipkg-dir.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+fd5ca6eb94e6dac671e81f1a64417f67
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+747
+
+metadata.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+e4cf97ccb15029d143c81ff75baab021
+2012-10-22T22:16:19.572495Z
+33892
+jogo
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+20648
+
+config.guess
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+7698736a872ea2567864c9d0cdac1648
+2010-07-20T13:21:00.110508Z
+22312
+kaloz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+44973
+
+metadata.pm
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+3f94ac56db0e6f38c1ba9705236c069b
+2011-07-02T06:49:09.936330Z
+27344
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4526
+
+om-fwupgradecfg-gen.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+d6d0dc6eba405d93479d91c985a439ee
+2012-11-18T09:32:36.885076Z
+34233
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1812
+
+config.sub
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+f0a763ce74af75e92121dbb745036cfa
+2012-11-30T10:53:55.517290Z
+34432
+florian
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+34901
+
+brcmImage.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+e8a513e9d2d35e098cd7dd5eb83c4138
+2009-01-29T15:15:21.639040Z
+14265
+florian
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3843
+
+strip-kmod.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+a2f0c6690a2390fc11b212561b9c4f31
+2012-03-19T21:09:47.100582Z
+31031
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+841
+
+openbsd.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+ef86f86f823d93cb346e01f417c00c60
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+507
+
+getver.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+78283f0057f021f677b42a0bd9078ec3
+2011-10-26T14:54:57.903911Z
+28604
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+686
+
+pad_image
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+fb2ca733bc45992e580986408cfdaf23
+2010-03-18T23:35:21.174408Z
+20294
+florian
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2436
+
+diffconfig.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+c56fc86e725519c518f7149bdad1d908
+2011-03-28T23:25:18.879251Z
+26349
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+660
+
+combined-image.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+03bfdbb4c402220ccf11b1eed830f3b9
+2009-12-24T10:34:37.785565Z
+18920
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1020
+
+download.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+5011758a5a579d264466fee2a9bd3f73
+2013-02-28T23:49:36.904591Z
+35838
+luka
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5681
+
+patch-specs.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+f76537f55e2f598f6f04088c65e3876a
+2012-01-29T20:19:06.829972Z
+29948
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1780
+
+freebsd.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+e336eccb4a1d954153f934a8ec3f82d4
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+275
+
+ipkg-make-index.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+e4b32f95b8978508089b2079c4793bde
+2012-06-11T01:29:11.327970Z
+32187
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+789
+
+remote-gdb
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+2f508506bb4c55d5e3833ecdbd4cf028
+2012-11-08T11:22:09.590699Z
+34118
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1603
+
+feeds
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+a6455f1a46e3a94a2a02f548e6a164eb
+2012-06-25T00:27:03.754594Z
+32499
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+14771
+
+patch-kernel.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+3a1b737e5f9ff6503ea4af754b9738bd
+2010-10-08T09:21:01.250670Z
+23314
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1391
+
+slugimage.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+e4a213b8616346338a7cb10722b1771b
+2008-09-23T18:29:44.564549Z
+12674
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+41501
+
+ext-toolchain.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+f3436e43695aed16f3278e69f07f17b1
+2013-02-20T15:06:10.027599Z
+35703
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+14590
+
+ipkg
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+247c8f89221bbda9318e28f764d291c9
+2013-02-21T11:45:25.151196Z
+35717
+jogo
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+28383
+
+flashing
+dir
+
+bundle-libraries.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+0c55793273d24b53ceb36e6d578fe23d
+2013-01-28T15:54:27.466442Z
+35349
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2641
+
+rstrip.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+893599511bba25fa3766ae3501ee4c3b
+2012-02-20T17:38:26.597822Z
+30662
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+800
+
+symlink-tree.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+6f9cd1ec9a388954e57ba7bf5cfc6a5f
+2013-02-21T11:45:27.104308Z
+35718
+jogo
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+707
+
+dl_cleanup.py
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+c5e410e3510a1ef976d69f3ff956794c
+2013-02-17T21:37:14.722252Z
+35645
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5942
+
+relink-lib.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+2454dfd91f6d660027e47814a33f034d
+2011-03-01T05:40:38.127510Z
+25800
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+403
+
+abs2rel.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+8569906f429f49cd40fdfd4102af59b2
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+330
+
+config
+dir
+
+arm-magic.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+35b3216fae0e984d657425347992e9a7
+2012-11-11T21:04:30.981243Z
+34165
+kaloz
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2015
+
+gen-dependencies.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+1e77842449b8e15d134a508d7cc1ce04
+2012-06-12T22:02:41.785278Z
+32272
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+653
+
+combined-ext-image.sh
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+d8a79b0d4e0968b6167609a21bab1103
+2011-11-30T07:43:58.697431Z
+29358
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1885
+
+md5sum
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+1e9de7e5754619b159b0bcb3a3caa5d9
+2009-01-25T19:00:43.746744Z
+14180
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+25
+
+timestamp.pl
+file
+
+
+
+
+2013-03-17T12:13:06.000000Z
+538686f3318d45862601e04d9a835c71
+2010-04-14T22:21:15.743722Z
+20856
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1371
+
diff --git a/scripts/.svn/prop-base/abs2rel.pl.svn-base b/scripts/.svn/prop-base/abs2rel.pl.svn-base
new file mode 100644
index 0000000..701d3eb
--- /dev/null
+++ b/scripts/.svn/prop-base/abs2rel.pl.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:copyright
+V 30
+Copyright (C) 2007 OpenWrt.org
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/arm-magic.sh.svn-base b/scripts/.svn/prop-base/arm-magic.sh.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/arm-magic.sh.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/brcmImage.pl.svn-base b/scripts/.svn/prop-base/brcmImage.pl.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/brcmImage.pl.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/bundle-libraries.sh.svn-base b/scripts/.svn/prop-base/bundle-libraries.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/bundle-libraries.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/combined-ext-image.sh.svn-base b/scripts/.svn/prop-base/combined-ext-image.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/combined-ext-image.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/config.guess.svn-base b/scripts/.svn/prop-base/config.guess.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/config.guess.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/config.rpath.svn-base b/scripts/.svn/prop-base/config.rpath.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/config.rpath.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/config.sub.svn-base b/scripts/.svn/prop-base/config.sub.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/config.sub.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/deptest.sh.svn-base b/scripts/.svn/prop-base/deptest.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/deptest.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/diffconfig.sh.svn-base b/scripts/.svn/prop-base/diffconfig.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/diffconfig.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/dl_cleanup.py.svn-base b/scripts/.svn/prop-base/dl_cleanup.py.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/dl_cleanup.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/download.pl.svn-base b/scripts/.svn/prop-base/download.pl.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/download.pl.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/env.svn-base b/scripts/.svn/prop-base/env.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/env.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/ext-toolchain.sh.svn-base b/scripts/.svn/prop-base/ext-toolchain.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/ext-toolchain.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/feeds.svn-base b/scripts/.svn/prop-base/feeds.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/feeds.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/gen-dependencies.sh.svn-base b/scripts/.svn/prop-base/gen-dependencies.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/gen-dependencies.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/getver.sh.svn-base b/scripts/.svn/prop-base/getver.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/getver.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/ipkg-make-index.sh.svn-base b/scripts/.svn/prop-base/ipkg-make-index.sh.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/ipkg-make-index.sh.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/ipkg.svn-base b/scripts/.svn/prop-base/ipkg.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/ipkg.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/kconfig.pl.svn-base b/scripts/.svn/prop-base/kconfig.pl.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/kconfig.pl.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/make-ipkg-dir.sh.svn-base b/scripts/.svn/prop-base/make-ipkg-dir.sh.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/make-ipkg-dir.sh.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/md5sum.svn-base b/scripts/.svn/prop-base/md5sum.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/md5sum.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/metadata.pl.svn-base b/scripts/.svn/prop-base/metadata.pl.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/metadata.pl.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/om-fwupgradecfg-gen.sh.svn-base b/scripts/.svn/prop-base/om-fwupgradecfg-gen.sh.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/scripts/.svn/prop-base/om-fwupgradecfg-gen.sh.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/scripts/.svn/prop-base/pad_image.svn-base b/scripts/.svn/prop-base/pad_image.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/pad_image.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/patch-kernel.sh.svn-base b/scripts/.svn/prop-base/patch-kernel.sh.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/patch-kernel.sh.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/patch-specs.sh.svn-base b/scripts/.svn/prop-base/patch-specs.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/patch-specs.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/relink-lib.sh.svn-base b/scripts/.svn/prop-base/relink-lib.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/relink-lib.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/remote-gdb.svn-base b/scripts/.svn/prop-base/remote-gdb.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/remote-gdb.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/rstrip.sh.svn-base b/scripts/.svn/prop-base/rstrip.sh.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/rstrip.sh.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/slugimage.pl.svn-base b/scripts/.svn/prop-base/slugimage.pl.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/slugimage.pl.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/strip-kmod.sh.svn-base b/scripts/.svn/prop-base/strip-kmod.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/strip-kmod.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/symlink-tree.sh.svn-base b/scripts/.svn/prop-base/symlink-tree.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/symlink-tree.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/timestamp.pl.svn-base b/scripts/.svn/prop-base/timestamp.pl.svn-base
new file mode 100644
index 0000000..03b5bfa
--- /dev/null
+++ b/scripts/.svn/prop-base/timestamp.pl.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/prop-base/update-package-md5sum.svn-base b/scripts/.svn/prop-base/update-package-md5sum.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/scripts/.svn/prop-base/update-package-md5sum.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/scripts/.svn/text-base/abs2rel.pl.svn-base b/scripts/.svn/text-base/abs2rel.pl.svn-base
new file mode 100644
index 0000000..3b0de10
--- /dev/null
+++ b/scripts/.svn/text-base/abs2rel.pl.svn-base
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+use strict;
+require File::Spec;
+
+my $source = shift @ARGV;
+my $target = shift @ARGV;
+my $result = File::Spec->abs2rel($source, $target);
+
+print "$result\n";
diff --git a/scripts/.svn/text-base/arm-magic.sh.svn-base b/scripts/.svn/text-base/arm-magic.sh.svn-base
new file mode 100644
index 0000000..eff9b4d
--- /dev/null
+++ b/scripts/.svn/text-base/arm-magic.sh.svn-base
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+#
+# Empty/wrong machtype-workaround generator
+#
+# Copyright (C) 2006-2012 Imre Kaloz <kaloz@openwrt.org>
+# based on linux/arch/arm/boot/compressed/head-xscale.S
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# NOTE: for now it's for only IXP4xx in big endian mode
+
+# list of supported boards, in "boardname machtypeid" format
+for board in "avila 526" "gateway7001 731" "nslu2 597" "nas100d 865" "wg302v1 889" "wg302v2 890" "pronghorn 928" "pronghornmetro 1040" "compex 1273" "wrt300nv2 1077" "loft 849" "dsmg600 964" "fsg3 1091" "ap1000 1543" "tw2662 1658" "tw5334 1664" "ixdpg425 604" "cambria 1468" "sidewinder 1041" "ap42x 4418"
+do
+ set -- $board
+ hexid=$(printf %x\\n $2)
+ if [ "$2" -lt "256" ]; then
+ # we have a low machtypeid, we just need a "mov" (e3a)
+ printf "\xe3\xa0\x10\x$hexid" > $BIN_DIR/openwrt-$1-zImage
+ else
+ # we have a high machtypeid, we need a "mov" (e3a) and an "orr" (e38)
+ if [ "$2" -lt "4096" ]; then
+ printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "2 3")\xe3\x81\x1c\x$(echo $hexid|cut -b 1)" > $BIN_DIR/openwrt-$1-zImage
+ else
+ printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "3 4")\xe3\x81\x1c\x$(echo $hexid|cut -b "1 2")" > $BIN_DIR/openwrt-$1-zImage
+ fi
+ fi
+ # generate the image
+ cat $BIN_DIR/$IMG_PREFIX-zImage >> $BIN_DIR/openwrt-$1-zImage
+done
diff --git a/scripts/.svn/text-base/brcmImage.pl.svn-base b/scripts/.svn/text-base/brcmImage.pl.svn-base
new file mode 100644
index 0000000..9a3acb4
--- /dev/null
+++ b/scripts/.svn/text-base/brcmImage.pl.svn-base
@@ -0,0 +1,162 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2009 Henk Vergonet <Henk.Vergonet@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+# Description:
+# Replacement for brcmImagebuilder
+#
+# Disclaimer:
+# Use this software at your own risk.
+#
+# Changelog:
+# 2009-01-01 Henk.Vergonet at gmail.com
+#
+use strict;
+use Getopt::Std;
+use Compress::Zlib;
+
+my $version = "0.1";
+my %arg = (
+ o => 'bcm963xx_fs_kernel',
+ b => 'OpenWrt',
+ c => '6348',
+ s => 64,
+ f => 0xbfc00000,
+ x => 0x00010000,
+ a => 0x80010000,
+ e => 0x80010000,
+ i => 2,
+);
+my $prog = $0;
+$prog =~ s/^.*\///;
+getopts("r:k:o:lc:b:s:f:i:a:e:tpvh", \%arg);
+
+die "usage: $prog ~opts~
+
+ -r <file> : input rootfs file
+ -k <file> : input kernel file
+ -o <file> : output image file, default $arg{o}
+ -l : littleendian system, default ".($arg{l} ? 'yes' : 'no')."
+ -c <chipid> : default $arg{c}
+ -b <boardid> : default $arg{b}
+ -s <size_kb> : erase sise flash, default $arg{s}
+ -f <baseaddr> : flash base, default ".sprintf('0x%x', $arg{f})."
+ -x <cfelen> : length of cfe, default ".sprintf('0x%x', $arg{x})."
+ -i : 2=dual image, default $arg{i}
+
+ -a <loadaddr> : Kernel load address, default ".sprintf('0x%x', $arg{a})."
+ -e <entryaddr>: Kernel entry address, default ".sprintf('0x%x', $arg{e})."
+ -t : Prefix kernel with load,entry,size
+
+ -p : Add a 'gOtO' partition
+
+ -v : be more verbose
+ -h : help, version $version
+
+EXAMPLES:
+ $prog -k kern -r rootfs
+" if $arg{h} || !$arg{k} || !$arg{r};
+
+sub Read_Image
+{
+ open my $fh, $_[0] or die "open $_[0]: $!";
+ local $/; # Set input to "slurp" mode.
+ my $buf = <$fh>;
+ close $fh;
+ return $buf;
+}
+
+sub Padlen
+{
+ my $p = $_[0] % $_[1];
+ return ($p ? $_[1] - $p : 0);
+}
+
+sub Pad
+{
+ my ($buf, $off, $bs) = @_[0..2];
+ $buf .= chr(255) x Padlen(length($buf) + $off, $bs);
+ return $buf;
+}
+
+sub bcmImage
+{
+ my ($k, $f) = @_[0..1];
+ my $tmp = $arg{x} + 0x100 + $arg{f};
+
+ # regular: rootfs+kernel
+ my ($img, $fa, $ka) = ( $f.$k, $tmp, $tmp + length($f) );
+
+ # test: kernel+rootfs
+# my ($img, $fa, $ka) = ( $k.$f, $tmp + length($k), $tmp );
+
+ $fa = 0 unless length($f);
+
+ my $hdr = pack("a4a20a14a6a16a2a10a12a10a12a10a12a10a2a2a74Na16",
+ '6',
+ 'LinuxInside',
+ 'ver. 2.0',
+ $arg{c},
+ $arg{b},
+ ($arg{l} ? '0' : '1'),
+ length($img),
+ '0',
+ '0',
+ $fa,
+ length($f),
+ $ka,
+ length($k),
+ ($arg{i}==2 ? '1' : '0'),
+ '', # if 1, the image is INACTIVE; if 0, active
+ '',
+ ~crc32($k, crc32($f)),
+ '');
+ $hdr .= pack('Na16', ~crc32($hdr), '');
+
+ printf "kernel at 0x%x length 0x%x(%u)\n", $ka, length($k), length($k)
+ if $arg{v};
+ printf "rootfs at 0x%x length 0x%x(%u)\n", $fa, length($f), length($f)
+ if $arg{v};
+
+ open(FO, ">$arg{o}");
+ print FO $hdr;
+ print FO $img;
+ close FO;
+}
+
+# MAIN
+
+my $kern = Read_Image $arg{k};
+my $root = Read_Image $arg{r};
+
+$kern = pack('NNN', $arg{a}, $arg{e}, length($kern)).$kern if $arg{t};
+
+# specific fixup for the CFE that expects rootfs-kernel order
+if ($arg{p}) {
+ $kern = Pad($kern, 0x10c, $arg{s} * 1024);
+ my $dummy_root = pack('a4NN',
+ 'gOtO',
+ length($kern)+12,
+ length($root)+Padlen(length($root), $arg{s} * 1024)
+ );
+ $kern .= $root;
+ $root = $dummy_root;
+}
+
+bcmImage($kern, $root);
+
diff --git a/scripts/.svn/text-base/bundle-libraries.sh.svn-base b/scripts/.svn/text-base/bundle-libraries.sh.svn-base
new file mode 100644
index 0000000..869286b
--- /dev/null
+++ b/scripts/.svn/text-base/bundle-libraries.sh.svn-base
@@ -0,0 +1,111 @@
+#!/usr/bin/env bash
+#
+# Script to install host system binaries along with required libraries.
+#
+# Copyright (C) 2012-2013 Jo-Philipp Wich <jow@openwrt.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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
+
+DIR="$1"; shift
+
+_cp() {
+ cp ${VERBOSE:+-v} -L "$1" "$2" || {
+ echo "cp($1 $2) failed" >&2
+ exit 1
+ }
+}
+
+_md() {
+ mkdir ${VERBOSE:+-v} -p "$1" || {
+ echo "mkdir($1) failed" >&2
+ exit 2
+ }
+}
+
+_ln() {
+ ln ${VERBOSE:+-v} -sf "$1" "$2" || {
+ echo "ln($1 $2) failed" >&2
+ exit 3
+ }
+}
+
+for LDD in ${PATH//://ldd }/ldd; do
+ "$LDD" --version >/dev/null 2>/dev/null && break
+ LDD=""
+done
+
+[ -n "$LDD" -a -x "$LDD" ] || {
+ echo "Unable to find working ldd" >&2
+ exit 4
+}
+
+for BIN in "$@"; do
+ [ -n "$BIN" -a -x "$BIN" -a -n "$DIR" ] || {
+ echo "Usage: $0 <destdir> <executable> ..." >&2
+ exit 1
+ }
+
+ [ ! -d "$DIR/bundled/lib" ] && {
+ _md "$DIR/bundled/lib"
+ _md "$DIR/bundled/usr"
+ _ln "../lib" "$DIR/bundled/usr/lib"
+ }
+
+ LDSO=""
+
+ echo "Bundling ${BIN##*/}"
+ for token in $("$LDD" "$BIN" 2>/dev/null); do
+ case "$token" in */*.so*)
+ case "$token" in
+ *ld-*.so*) LDSO="${token##*/}" ;;
+ *) echo " * lib: ${token##*/}" ;;
+ esac
+
+ dest="$DIR/bundled/lib/${token##*/}"
+ ddir="${dest%/*}"
+
+ [ -f "$token" -a ! -f "$dest" ] && {
+ _md "$ddir"
+ _cp "$token" "$dest"
+ }
+ ;; esac
+ done
+
+ _md "$DIR"
+
+ # is a dynamically linked executable
+ if [ -n "$LDSO" ]; then
+ _cp "$BIN" "$DIR/bundled/${BIN##*/}"
+
+ RUN="${LDSO#ld-}"; RUN="run-${RUN%%.so*}.sh"
+
+ [ -x "$DIR/bundled/$RUN" ] || {
+ cat <<-EOF > "$DIR/bundled/$RUN"
+ #!/usr/bin/env bash
+ dir="\$(dirname "\$0")"
+ bin="\$(basename "\$0")"
+ exec -a "\$0" "\$dir/bundled/lib/$LDSO" --library-path "\$dir/bundled/lib" "\$dir/bundled/\$bin" "\$@"
+ EOF
+ chmod ${VERBOSE:+-v} 0755 "$DIR/bundled/$RUN"
+ }
+
+ _ln "./bundled/$RUN" "$DIR/${BIN##*/}"
+
+ # is a static executable or non-elf binary
+ else
+ echo " * not dynamically linked"
+ _cp "$BIN" "$DIR/${BIN##*/}"
+ fi
+done
diff --git a/scripts/.svn/text-base/combined-ext-image.sh.svn-base b/scripts/.svn/text-base/combined-ext-image.sh.svn-base
new file mode 100644
index 0000000..374fe6e
--- /dev/null
+++ b/scripts/.svn/text-base/combined-ext-image.sh.svn-base
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Write image header followed by all specified files
+# The header is padded to 64k, format is:
+# CE magic word ("Combined Extended Image") (2 bytes)
+# <CE_VERSION> file format version field (2 bytes)
+# <TYPE> short description of the target device (32 bytes)
+# <NUM FILES> number of files following the header (2 byte)
+# <file1_name> name of the first file (32 bytes)
+# <file1_length> length of the first file encoded as zero padded 8 digit hex (8 bytes)
+# <file1_md5> md5 checksum of the first file (32 bytes)
+# <fileN_name> name of the Nth file (32 bytes)
+# <fileN_length> length of the Nth file encoded as zero padded 8 digit hex (8 bytes)
+# <fileN_md5> md5 checksum of the Nth file (32 bytes)
+
+## version history
+# * version 1: initial file format with num files / name / length / md5 checksum
+
+ME="${0##*/}"
+
+usage() {
+ echo "Usage: $ME <type> <ext filename> <file1> <filename1> [<file2> <filename2> <fileN> <filenameN>]"
+ [ "$IMG_OUT" ] && rm -f "$IMG_OUT"
+ exit 1
+}
+
+[ "$#" -lt 4 ] && usage
+
+CE_VERSION=1
+IMG_TYPE=$1; shift
+IMG_OUT=$1; shift
+FILE_NUM=$(($# / 2))
+FILES=""
+
+printf "CE%02x%-32s%02x" $CE_VERSION "$IMG_TYPE" $FILE_NUM > $IMG_OUT
+
+while [ "$#" -gt 1 ]
+ do
+ file=$1
+ filename=$2
+
+ [ ! -f "$file" ] && echo "$ME: Not a valid file: $file" && usage
+ FILES="$FILES $file"
+ md5=$(cat "$file" | md5sum -)
+ printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> $IMG_OUT
+ shift 2
+ done
+
+[ "$#" -eq 1 ] && echo "$ME: Filename not specified: $1" && usage
+
+mv $IMG_OUT $IMG_OUT.tmp
+dd if="$IMG_OUT.tmp" of="$IMG_OUT" bs=65536 conv=sync 2>/dev/null
+rm $IMG_OUT.tmp
+
+cat $FILES >> $IMG_OUT
diff --git a/scripts/.svn/text-base/combined-image.sh.svn-base b/scripts/.svn/text-base/combined-image.sh.svn-base
new file mode 100644
index 0000000..5472b2c
--- /dev/null
+++ b/scripts/.svn/text-base/combined-image.sh.svn-base
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+BLKSZ=65536
+
+[ -f "$1" -a -f "$2" ] || {
+ echo "Usage: $0 <kernel image> <rootfs image> [output file]"
+ exit 1
+}
+
+IMAGE=${3:-openwrt-combined.img}
+
+# Make sure provided images are 64k aligned.
+kern="${IMAGE}.kernel"
+root="${IMAGE}.rootfs"
+dd if="$1" of="$kern" bs=$BLKSZ conv=sync 2>/dev/null
+dd if="$2" of="$root" bs=$BLKSZ conv=sync 2>/dev/null
+
+# Calculate md5sum over combined kernel and rootfs image.
+md5=$(cat "$kern" "$root" | md5sum -)
+
+# Write image header followed by kernel and rootfs image.
+# The header is padded to 64k, format is:
+# CI magic word ("Combined Image")
+# <kernel length> length of kernel encoded as zero padded 8 digit hex
+# <rootfs length> length of rootfs encoded as zero padded 8 digit hex
+# <md5sum> checksum of the combined kernel and rootfs image
+( printf "CI%08x%08x%32s" \
+ $(stat -c "%s" "$kern") $(stat -c "%s" "$root") "${md5%% *}" | \
+ dd bs=$BLKSZ conv=sync;
+ cat "$kern" "$root"
+) > ${IMAGE} 2>/dev/null
+
+# Clean up.
+rm -f "$kern" "$root"
diff --git a/scripts/.svn/text-base/config.guess.svn-base b/scripts/.svn/text-base/config.guess.svn-base
new file mode 100644
index 0000000..115f944
--- /dev/null
+++ b/scripts/.svn/text-base/config.guess.svn-base
@@ -0,0 +1,1502 @@
+#! /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, 2010
+# Free Software Foundation, Inc.
+
+timestamp='2010-04-03'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' HUP INT TERM
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/scripts/.svn/text-base/config.rpath.svn-base b/scripts/.svn/text-base/config.rpath.svn-base
new file mode 100644
index 0000000..c547c68
--- /dev/null
+++ b/scripts/.svn/text-base/config.rpath.svn-base
@@ -0,0 +1,666 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2007 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix4* | aix5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ library_names_spec='$libname.a'
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd1*)
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_os" in
+ freebsd[123]*)
+ library_names_spec='$libname$shrext$versuffix' ;;
+ *)
+ library_names_spec='$libname$shrext' ;;
+ esac
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ nto-qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/scripts/.svn/text-base/config.sub.svn-base b/scripts/.svn/text-base/config.sub.svn-base
new file mode 100644
index 0000000..df65a92
--- /dev/null
+++ b/scripts/.svn/text-base/config.sub.svn-base
@@ -0,0 +1,1730 @@
+#! /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, 2010
+# Free Software Foundation, Inc.
+
+timestamp='2010-05-21'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova* | \
+ linux-musl*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile-* | tilegx-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ # This must be matched before tile*.
+ tilegx*)
+ basic_machine=tilegx-unknown
+ os=-linux-gnu
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* | -linux-musl* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/scripts/.svn/text-base/deptest.sh.svn-base b/scripts/.svn/text-base/deptest.sh.svn-base
new file mode 100644
index 0000000..047a0ce
--- /dev/null
+++ b/scripts/.svn/text-base/deptest.sh.svn-base
@@ -0,0 +1,211 @@
+#!/bin/bash
+#
+# Automated OpenWrt package dependency checker
+#
+# Copyright (C) 2009-2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+SCRIPTDIR="$(dirname "$0")"
+[ "${SCRIPTDIR:0:1}" = "/" ] || SCRIPTDIR="$PWD/$SCRIPTDIR"
+BASEDIR="$SCRIPTDIR/.."
+
+DIR="$BASEDIR/tmp/deptest"
+STAMP_DIR_SUCCESS="$DIR/stamp-success"
+STAMP_DIR_FAILED="$DIR/stamp-failed"
+STAMP_DIR_BLACKLIST="$DIR/stamp-blacklist"
+BUILD_DIR="$DIR/build_dir/target"
+BUILD_DIR_HOST="$DIR/build_dir/host"
+KERNEL_BUILD_DIR="$DIR/build_dir/linux"
+STAGING_DIR="$DIR/staging_dir/target"
+STAGING_DIR_HOST="$DIR/staging_dir/host"
+STAGING_DIR_HOST_TMPL="$DIR/staging_dir_host_tmpl"
+BIN_DIR="$DIR/staging_dir/bin_dir"
+LOG_DIR_NAME="logs"
+LOG_DIR="$DIR/$LOG_DIR_NAME"
+
+die()
+{
+ echo "$@"
+ exit 1
+}
+
+usage()
+{
+ echo "deptest.sh [OPTIONS] [PACKAGES]"
+ echo
+ echo "OPTIONS:"
+ echo " --lean Run a lean test. Do not clean the build directory for each"
+ echo " package test."
+ echo " --force Force a test, even if a success/blacklist stamp is available"
+ echo " -j X Number of make jobs"
+ echo
+ echo "PACKAGES are packages to test. If not specified, all installed packages"
+ echo "will be tested."
+}
+
+deptest_make()
+{
+ local target="$1"
+ shift
+ local logfile="$1"
+ shift
+ make -j$nrjobs "$target" \
+ BUILD_DIR="$BUILD_DIR" \
+ BUILD_DIR_HOST="$BUILD_DIR_HOST" \
+ KERNEL_BUILD_DIR="$KERNEL_BUILD_DIR" \
+ BIN_DIR="$BIN_DIR" \
+ STAGING_DIR="$STAGING_DIR" \
+ STAGING_DIR_HOST="$STAGING_DIR_HOST" \
+ FORCE_HOST_INSTALL=1 \
+ V=99 "$@" >"$LOG_DIR/$logfile" 2>&1
+}
+
+clean_kernel_build_dir()
+{
+ # delete everything, except the kernel build dir "linux-X.X.X"
+ (
+ cd "$KERNEL_BUILD_DIR" || die "Failed to enter kernel build dir"
+ for entry in *; do
+ [ -z "$(echo "$entry" | egrep -e '^linux-*.*.*$')" ] || continue
+ rm -rf "$entry" || die "Failed to clean kernel build dir"
+ done
+ )
+}
+
+stamp_exists() # $1=stamp
+{
+ [ -e "$1" -o -L "$1" ]
+}
+
+test_package() # $1=pkgname
+{
+ local pkg="$1"
+ [ -n "$pkg" -a -z "$(echo "$pkg" | grep -e '/')" -a "$pkg" != "." -a "$pkg" != ".." ] || \
+ die "Package name \"$pkg\" contains illegal characters"
+ local SELECTED=
+ for conf in `grep CONFIG_PACKAGE tmp/.packagedeps | grep -E "[ /]$pkg\$" | sed -e 's,package-$(\(CONFIG_PACKAGE_.*\)).*,\1,'`; do
+ grep "$conf=" .config > /dev/null && SELECTED=1 && break
+ done
+ local STAMP_SUCCESS="$STAMP_DIR_SUCCESS/$pkg"
+ local STAMP_FAILED="$STAMP_DIR_FAILED/$pkg"
+ local STAMP_BLACKLIST="$STAMP_DIR_BLACKLIST/$pkg"
+ rm -f "$STAMP_FAILED"
+ stamp_exists "$STAMP_SUCCESS" && [ $force -eq 0 ] && return
+ rm -f "$STAMP_SUCCESS"
+ [ -n "$SELECTED" ] || {
+ echo "Package $pkg is not selected"
+ return
+ }
+ stamp_exists "$STAMP_BLACKLIST" && [ $force -eq 0 ] && {
+ echo "Package $pkg is blacklisted"
+ return
+ }
+ echo "Testing package $pkg..."
+ rm -rf "$STAGING_DIR" "$STAGING_DIR_HOST"
+ mkdir -p "$STAGING_DIR"
+ cp -al "$STAGING_DIR_HOST_TMPL" "$STAGING_DIR_HOST"
+ [ $lean_test -eq 0 ] && {
+ rm -rf "$BUILD_DIR" "$BUILD_DIR_HOST"
+ clean_kernel_build_dir
+ }
+ mkdir -p "$BUILD_DIR" "$BUILD_DIR_HOST"
+ local logfile="$(basename $pkg).log"
+ deptest_make "package/$pkg/compile" "$logfile"
+ if [ $? -eq 0 ]; then
+ ( cd "$STAMP_DIR_SUCCESS"; ln -s "../$LOG_DIR_NAME/$logfile" "./$pkg" )
+ else
+ ( cd "$STAMP_DIR_FAILED"; ln -s "../$LOG_DIR_NAME/$logfile" "./$pkg" )
+ echo "Building package $pkg FAILED"
+ fi
+}
+
+# parse commandline options
+packages=
+lean_test=0
+force=0
+nrjobs=1
+while [ $# -ne 0 ]; do
+ case "$1" in
+ --help|-h)
+ usage
+ exit 0
+ ;;
+ --lean)
+ lean_test=1
+ ;;
+ --force)
+ force=1
+ ;;
+ -j*)
+ if [ -n "${1:2}" ]; then
+ nrjobs="${1:2}"
+ else
+ shift
+ nrjobs="$1"
+ fi
+ ;;
+ *)
+ packages="$packages $1"
+ ;;
+ esac
+ shift
+done
+
+[ -f "$BASEDIR/include/toplevel.mk" ] || \
+ die "Error: Could not find buildsystem base directory"
+[ -f "$BASEDIR/.config" ] || \
+ die "The buildsystem is not configured. Please run make menuconfig."
+cd "$BASEDIR" || die "Failed to enter base directory"
+
+mkdir -p "$STAMP_DIR_SUCCESS" "$STAMP_DIR_FAILED" "$STAMP_DIR_BLACKLIST" \
+ "$BIN_DIR" "$LOG_DIR"
+
+bootstrap_deptest_make()
+{
+ local target="$1"
+ shift
+ local logfile="bootstrap-deptest-$(echo "$target" | tr / -).log"
+ echo "deptest-make $target"
+ deptest_make "$target" "$logfile" "$@" || \
+ die "make $target failed, please check $logfile"
+}
+
+bootstrap_native_make()
+{
+ local target="$1"
+ shift
+ local logfile="bootstrap-native-$(echo "$target" | tr / -).log"
+ echo "make $target"
+ make -j$nrjobs "$target" \
+ V=99 "$@" >"$LOG_DIR/$logfile" 2>&1 || \
+ die "make $target failed, please check $logfile"
+}
+
+[ -d "$STAGING_DIR_HOST_TMPL" ] || {
+ echo "Bootstrapping build environment..."
+ rm -rf "$STAGING_DIR" "$STAGING_DIR_HOST" "$BUILD_DIR" "$BUILD_DIR_HOST" "$KERNEL_BUILD_DIR"
+ mkdir -p "$STAGING_DIR" "$STAGING_DIR_HOST" \
+ "$BUILD_DIR" "$BUILD_DIR_HOST" "$KERNEL_BUILD_DIR"
+ bootstrap_native_make tools/install
+ bootstrap_native_make toolchain/install
+ bootstrap_deptest_make tools/install
+ bootstrap_deptest_make target/linux/install
+ cp -al "$STAGING_DIR_HOST" "$STAGING_DIR_HOST_TMPL"
+ rm -rf "$STAGING_DIR" "$STAGING_DIR_HOST" "$BUILD_DIR" "$BUILD_DIR_HOST"
+ echo "Build environment OK."
+}
+
+if [ -z "$packages" ]; then
+ # iterate over all packages
+ for pkg in `cat tmp/.packagedeps | grep CONFIG_PACKAGE | grep -v curdir | sed -e 's,.*[/=]\s*,,' | sort -u`; do
+ test_package "$pkg"
+ done
+else
+ # only check the specified packages
+ for pkg in $packages; do
+ test_package "$pkg"
+ done
+fi
diff --git a/scripts/.svn/text-base/diffconfig.sh.svn-base b/scripts/.svn/text-base/diffconfig.sh.svn-base
new file mode 100644
index 0000000..c7e8c1e
--- /dev/null
+++ b/scripts/.svn/text-base/diffconfig.sh.svn-base
@@ -0,0 +1,11 @@
+#!/bin/sh
+grep \^CONFIG_TARGET_ .config | head -n3 > tmp/.diffconfig.head
+grep '^CONFIG_ALL=y' .config >> tmp/.diffconfig.head
+grep '^CONFIG_DEVEL=y' .config >> tmp/.diffconfig.head
+grep '^CONFIG_TOOLCHAINOPTS=y' .config >> tmp/.diffconfig.head
+./scripts/config/conf -D tmp/.diffconfig.head -w tmp/.diffconfig.stage1 Config.in >/dev/null
+./scripts/kconfig.pl '>+' tmp/.diffconfig.stage1 .config >> tmp/.diffconfig.head
+./scripts/config/conf -D tmp/.diffconfig.head -w tmp/.diffconfig.stage2 Config.in >/dev/null
+./scripts/kconfig.pl '>' tmp/.diffconfig.stage2 .config >> tmp/.diffconfig.head
+cat tmp/.diffconfig.head
+rm -f tmp/.diffconfig tmp/.diffconfig.head
diff --git a/scripts/.svn/text-base/dl_cleanup.py.svn-base b/scripts/.svn/text-base/dl_cleanup.py.svn-base
new file mode 100644
index 0000000..e5cd52c
--- /dev/null
+++ b/scripts/.svn/text-base/dl_cleanup.py.svn-base
@@ -0,0 +1,231 @@
+#!/usr/bin/env python
+"""
+# OpenWRT download directory cleanup utility.
+# Delete all but the very last version of the program tarballs.
+#
+# Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>
+# Copyright (C) 2013 OpenWrt.org
+"""
+
+import sys
+import os
+import re
+import getopt
+
+# Commandline options
+opt_dryrun = False
+
+
+def parseVer_1234(match, filepath):
+ progname = match.group(1)
+ progversion = (int(match.group(2)) << 64) |\
+ (int(match.group(3)) << 48) |\
+ (int(match.group(4)) << 32) |\
+ (int(match.group(5)) << 16)
+ return (progname, progversion)
+
+def parseVer_123(match, filepath):
+ progname = match.group(1)
+ try:
+ patchlevel = match.group(5)
+ except (IndexError), e:
+ patchlevel = None
+ if patchlevel:
+ patchlevel = ord(patchlevel[0])
+ else:
+ patchlevel = 0
+ progversion = (int(match.group(2)) << 64) |\
+ (int(match.group(3)) << 48) |\
+ (int(match.group(4)) << 32) |\
+ patchlevel
+ return (progname, progversion)
+
+def parseVer_12(match, filepath):
+ progname = match.group(1)
+ try:
+ patchlevel = match.group(4)
+ except (IndexError), e:
+ patchlevel = None
+ if patchlevel:
+ patchlevel = ord(patchlevel[0])
+ else:
+ patchlevel = 0
+ progversion = (int(match.group(2)) << 64) |\
+ (int(match.group(3)) << 48) |\
+ patchlevel
+ return (progname, progversion)
+
+def parseVer_r(match, filepath):
+ progname = match.group(1)
+ progversion = (int(match.group(2)) << 64)
+ return (progname, progversion)
+
+def parseVer_ymd(match, filepath):
+ progname = match.group(1)
+ progversion = (int(match.group(2)) << 64) |\
+ (int(match.group(3)) << 48) |\
+ (int(match.group(4)) << 32)
+ return (progname, progversion)
+
+def parseVer_GIT(match, filepath):
+ progname = match.group(1)
+ st = os.stat(filepath)
+ progversion = int(st.st_mtime) << 64
+ return (progname, progversion)
+
+extensions = (
+ ".tar.gz",
+ ".tar.bz2",
+ ".tar.xz",
+ ".orig.tar.gz",
+ ".orig.tar.bz2",
+ ".orig.tar.xz",
+ ".zip",
+ ".tgz",
+ ".tbz",
+ ".txz",
+)
+
+versionRegex = (
+ (re.compile(r"(.+)[-_]([0-9a-fA-F]{40,40})"), parseVer_GIT), # xxx-GIT_SHASUM
+ (re.compile(r"(.+)[-_](\d+)\.(\d+)\.(\d+)\.(\d+)"), parseVer_1234), # xxx-1.2.3.4
+ (re.compile(r"(.+)[-_](\d\d\d\d)-?(\d\d)-?(\d\d)"), parseVer_ymd), # xxx-YYYY-MM-DD
+ (re.compile(r"(.+)[-_](\d+)\.(\d+)\.(\d+)(\w?)"), parseVer_123), # xxx-1.2.3a
+ (re.compile(r"(.+)[-_](\d+)_(\d+)_(\d+)"), parseVer_123), # xxx-1_2_3
+ (re.compile(r"(.+)[-_](\d+)\.(\d+)(\w?)"), parseVer_12), # xxx-1.2a
+ (re.compile(r"(.+)[-_]r?(\d+)"), parseVer_r), # xxx-r1111
+)
+
+blacklist = [
+ ("linux", re.compile(r"linux-.*")),
+ ("gcc", re.compile(r"gcc-.*")),
+ ("wl_apsta", re.compile(r"wl_apsta.*")),
+ (".fw", re.compile(r".*\.fw")),
+ (".arm", re.compile(r".*\.arm")),
+ (".bin", re.compile(r".*\.bin")),
+ ("rt-firmware", re.compile(r"RT[\d\w]+_Firmware.*")),
+]
+
+class EntryParseError(Exception): pass
+
+class Entry:
+ def __init__(self, directory, filename):
+ self.directory = directory
+ self.filename = filename
+ self.progname = ""
+ self.fileext = ""
+
+ for ext in extensions:
+ if filename.endswith(ext):
+ filename = filename[0:0-len(ext)]
+ self.fileext = ext
+ break
+ else:
+ print self.filename, "has an unknown file-extension"
+ raise EntryParseError("ext")
+ for (regex, parseVersion) in versionRegex:
+ match = regex.match(filename)
+ if match:
+ (self.progname, self.version) = parseVersion(
+ match, directory + "/" + filename + self.fileext)
+ break
+ else:
+ print self.filename, "has an unknown version pattern"
+ raise EntryParseError("ver")
+
+ def deleteFile(self):
+ path = (self.directory + "/" + self.filename).replace("//", "/")
+ print "Deleting", path
+ if not opt_dryrun:
+ os.unlink(path)
+
+ def __eq__(self, y):
+ return self.filename == y.filename
+
+ def __ge__(self, y):
+ return self.version >= y.version
+
+def usage():
+ print "OpenWRT download directory cleanup utility"
+ print "Usage: " + sys.argv[0] + " [OPTIONS] <path/to/dl>"
+ print ""
+ print " -d|--dry-run Do a dry-run. Don't delete any files"
+ print " -B|--show-blacklist Show the blacklist and exit"
+ print " -w|--whitelist ITEM Remove ITEM from blacklist"
+
+def main(argv):
+ global opt_dryrun
+
+ try:
+ (opts, args) = getopt.getopt(argv[1:],
+ "hdBw:",
+ [ "help", "dry-run", "show-blacklist", "whitelist=", ])
+ if len(args) != 1:
+ usage()
+ return 1
+ except getopt.GetoptError:
+ usage()
+ return 1
+ directory = args[0]
+ for (o, v) in opts:
+ if o in ("-h", "--help"):
+ usage()
+ return 0
+ if o in ("-d", "--dry-run"):
+ opt_dryrun = True
+ if o in ("-w", "--whitelist"):
+ for i in range(0, len(blacklist)):
+ (name, regex) = blacklist[i]
+ if name == v:
+ del blacklist[i]
+ break
+ else:
+ print "Whitelist error: Item", v,\
+ "is not in blacklist"
+ return 1
+ if o in ("-B", "--show-blacklist"):
+ for (name, regex) in blacklist:
+ print name
+ return 0
+
+ # Create a directory listing and parse the file names.
+ entries = []
+ for filename in os.listdir(directory):
+ if filename == "." or filename == "..":
+ continue
+ for (name, regex) in blacklist:
+ if regex.match(filename):
+ if opt_dryrun:
+ print filename, "is blacklisted"
+ break
+ else:
+ try:
+ entries.append(Entry(directory, filename))
+ except (EntryParseError), e: pass
+
+ # Create a map of programs
+ progmap = {}
+ for entry in entries:
+ if entry.progname in progmap.keys():
+ progmap[entry.progname].append(entry)
+ else:
+ progmap[entry.progname] = [entry,]
+
+ # Traverse the program map and delete everything but the last version
+ for prog in progmap:
+ lastVersion = None
+ versions = progmap[prog]
+ for version in versions:
+ if lastVersion is None or version >= lastVersion:
+ lastVersion = version
+ if lastVersion:
+ for version in versions:
+ if version != lastVersion:
+ version.deleteFile()
+ if opt_dryrun:
+ print "Keeping", lastVersion.filename
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv))
diff --git a/scripts/.svn/text-base/download.pl.svn-base b/scripts/.svn/text-base/download.pl.svn-base
new file mode 100644
index 0000000..f2b064b
--- /dev/null
+++ b/scripts/.svn/text-base/download.pl.svn-base
@@ -0,0 +1,207 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+use strict;
+use warnings;
+use File::Basename;
+use File::Copy;
+
+@ARGV > 2 or die "Syntax: $0 <target dir> <filename> <md5sum> [<mirror> ...]\n";
+
+my $target = shift @ARGV;
+my $filename = shift @ARGV;
+my $md5sum = shift @ARGV;
+my $scriptdir = dirname($0);
+my @mirrors;
+my $ok;
+
+sub localmirrors {
+ my @mlist;
+ open LM, "$scriptdir/localmirrors" and do {
+ while (<LM>) {
+ chomp $_;
+ push @mlist, $_ if $_;
+ }
+ close LM;
+ };
+ open CONFIG, "<".$ENV{'TOPDIR'}."/.config" and do {
+ while (<CONFIG>) {
+ /^CONFIG_LOCALMIRROR="(.+)"/ and do {
+ chomp;
+ my @local_mirrors = split(/;/, $1);
+ push @mlist, @local_mirrors;
+ };
+ }
+ close CONFIG;
+ };
+
+ return @mlist;
+}
+
+sub which($) {
+ my $prog = shift;
+ my $res = `which $prog`;
+ $res or return undef;
+ $res =~ /^no / and return undef;
+ $res =~ /not found/ and return undef;
+ return $res;
+}
+
+my $md5cmd = which("md5sum") || which("md5") || die 'no md5 checksum program found, please install md5 or md5sum';
+chomp $md5cmd;
+
+sub download
+{
+ my $mirror = shift;
+ my $options = $ENV{WGET_OPTIONS} || "";
+
+ $mirror =~ s!/$!!;
+
+ if ($mirror =~ s!^file://!!) {
+ if (! -d "$mirror") {
+ print STDERR "Wrong local cache directory -$mirror-.\n";
+ cleanup();
+ return;
+ }
+
+ if (! -d "$target") {
+ system("mkdir", "-p", "$target/");
+ }
+
+ if (! open TMPDLS, "find $mirror -follow -name $filename 2>/dev/null |") {
+ print("Failed to search for $filename in $mirror\n");
+ return;
+ }
+
+ my $link;
+
+ while (defined(my $line = readline TMPDLS)) {
+ chomp ($link = $line);
+ if ($. > 1) {
+ print("$. or more instances of $filename in $mirror found . Only one instance allowed.\n");
+ return;
+ }
+ }
+
+ close TMPDLS;
+
+ if (! $link) {
+ print("No instances of $filename found in $mirror.\n");
+ return;
+ }
+
+ print("Copying $filename from $link\n");
+ copy($link, "$target/$filename.dl");
+
+ if (system("$md5cmd '$target/$filename.dl' > '$target/$filename.md5sum'")) {
+ print("Failed to generate md5 sum for $filename\n");
+ return;
+ }
+ } else {
+ open WGET, "wget -t5 --timeout=20 --no-check-certificate $options -O- '$mirror/$filename' |" or die "Cannot launch wget.\n";
+ open MD5SUM, "| $md5cmd > '$target/$filename.md5sum'" or die "Cannot launch md5sum.\n";
+ open OUTPUT, "> $target/$filename.dl" or die "Cannot create file $target/$filename.dl: $!\n";
+ my $buffer;
+ while (read WGET, $buffer, 1048576) {
+ print MD5SUM $buffer;
+ print OUTPUT $buffer;
+ }
+ close MD5SUM;
+ close WGET;
+ close OUTPUT;
+
+ if ($? >> 8) {
+ print STDERR "Download failed.\n";
+ cleanup();
+ return;
+ }
+ }
+
+ my $sum = `cat "$target/$filename.md5sum"`;
+ $sum =~ /^(\w+)\s*/ or die "Could not generate md5sum\n";
+ $sum = $1;
+
+ if (($md5sum =~ /\w{32}/) and ($sum ne $md5sum)) {
+ print STDERR "MD5 sum of the downloaded file does not match (file: $sum, requested: $md5sum) - deleting download.\n";
+ cleanup();
+ return;
+ }
+
+ unlink "$target/$filename";
+ system("mv", "$target/$filename.dl", "$target/$filename");
+ cleanup();
+}
+
+sub cleanup
+{
+ unlink "$target/$filename.dl";
+ unlink "$target/$filename.md5sum";
+}
+
+@mirrors = localmirrors();
+
+foreach my $mirror (@ARGV) {
+ if ($mirror =~ /^\@SF\/(.+)$/) {
+ # give sourceforge a few more tries, because it redirects to different mirrors
+ for (1 .. 5) {
+ push @mirrors, "http://downloads.sourceforge.net/$1";
+ }
+ } elsif ($mirror =~ /^\@GNU\/(.+)$/) {
+ push @mirrors, "ftp://ftp.gnu.org/gnu/$1";
+ push @mirrors, "http://ftpmirror.gnu.org/$1";
+ push @mirrors, "ftp://ftp.belnet.be/mirror/ftp.gnu.org/gnu/$1";
+ push @mirrors, "ftp://ftp.mirror.nl/pub/mirror/gnu/$1";
+ push @mirrors, "http://mirror.switch.ch/ftp/mirror/gnu/$1";
+ } elsif ($mirror =~ /^\@KERNEL\/(.+)$/) {
+ my @extra = ( $1 );
+ if ($filename =~ /linux-\d+\.\d+(?:\.\d+)?-rc/) {
+ push @extra, "$extra[0]/testing";
+ } elsif ($filename =~ /linux-(\d+\.\d+(?:\.\d+)?)/) {
+ push @extra, "$extra[0]/longterm/v$1";
+ }
+ foreach my $dir (@extra) {
+ push @mirrors, "ftp://ftp.all.kernel.org/pub/$dir";
+ push @mirrors, "http://ftp.all.kernel.org/pub/$dir";
+ push @mirrors, "ftp://ftp.de.kernel.org/pub/$dir";
+ push @mirrors, "http://ftp.de.kernel.org/pub/$dir";
+ push @mirrors, "ftp://ftp.fr.kernel.org/pub/$dir";
+ push @mirrors, "http://ftp.fr.kernel.org/pub/$dir";
+ }
+ } elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
+ push @mirrors, "http://ftp.gnome.org/pub/GNOME/sources/$1";
+ push @mirrors, "http://ftp.unina.it/pub/linux/GNOME/sources/$1";
+ push @mirrors, "http://fr2.rpmfind.net/linux/gnome.org/sources/$1";
+ push @mirrors, "ftp://ftp.dit.upm.es/pub/GNOME/sources/$1";
+ push @mirrors, "ftp://ftp.no.gnome.org/pub/GNOME/sources/$1";
+ push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1";
+ push @mirrors, "http://ftp.belnet.be/mirror/ftp.gnome.org/sources/$1";
+ push @mirrors, "http://linorg.usp.br/gnome/sources/$1";
+ push @mirrors, "http://mirror.aarnet.edu.au/pub/GNOME/sources/$1";
+ push @mirrors, "http://mirrors.ibiblio.org/pub/mirrors/gnome/sources/$1";
+ push @mirrors, "ftp://ftp.cse.buffalo.edu/pub/Gnome/sources/$1";
+ push @mirrors, "ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/sources/$1";
+ }
+ else {
+ push @mirrors, $mirror;
+ }
+}
+
+#push @mirrors, 'http://mirror1.openwrt.org';
+push @mirrors, 'http://mirror2.openwrt.org/sources';
+push @mirrors, 'http://downloads.openwrt.org/sources';
+
+while (!$ok) {
+ my $mirror = shift @mirrors;
+ $mirror or die "No more mirrors to try - giving up.\n";
+
+ download($mirror);
+ -f "$target/$filename" and $ok = 1;
+}
+
+$SIG{INT} = \&cleanup;
+
diff --git a/scripts/.svn/text-base/env.svn-base b/scripts/.svn/text-base/env.svn-base
new file mode 100644
index 0000000..24d4bec
--- /dev/null
+++ b/scripts/.svn/text-base/env.svn-base
@@ -0,0 +1,224 @@
+#!/usr/bin/env bash
+BASEDIR="$PWD"
+ENVDIR="$PWD/env"
+
+usage() {
+ cat <<EOF
+Usage: $0 [options] <command> [arguments]
+Commands:
+ help This help text
+ list List environments
+ clear Delete all environment and revert to flat config/files
+ new <name> Create a new environment
+ switch <name> Switch to a different environment
+ delete <name> Delete an environment
+ rename <newname> Rename the current environment
+ diff Show differences between current state and environment
+ save Save your changes to the environment
+ revert Revert your changes since last save
+
+Options:
+
+EOF
+ exit ${1:-1}
+}
+
+error() {
+ echo "$0: $*"
+ exit 1
+}
+
+ask_bool() {
+ local DEFAULT="$1"; shift
+ local def defstr val
+ case "$DEFAULT" in
+ 1) def=0; defstr="Y/n";;
+ 0) def=1; defstr="y/N";;
+ *) def=; defstr="y/n";;
+ esac
+ while [ -z "$val" ]; do
+ local VAL
+
+ echo -n "$* ($defstr): "
+ read VAL
+ case "$VAL" in
+ y*|Y*) val=0;;
+ n*|N*) val=1;;
+ *) val="$def";;
+ esac
+ done
+ return "$val"
+}
+
+env_init() {
+ local CREATE="$1"
+ if [ -z "$CREATE" ]; then
+ [ -d "$ENVDIR" ] || exit 0
+ fi
+ [ -x "$(which git 2>/dev/null)" ] || error "Git is not installed"
+ mkdir -p "$ENVDIR" || error "Failed to create the environment directory"
+ cd "$ENVDIR" || error "Failed to switch to the environment directory"
+ [ -d .git ] || {
+ git init &&
+ touch .config &&
+ mkdir files &&
+ git add . &&
+ git commit -q -m "Initial import"
+ } || {
+ rm -rf .git
+ error "Failed to initialize the environment directory"
+ }
+}
+
+env_sync_data() {
+ [ \! -L "$BASEDIR/.config" -a -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR"
+ git add .
+ git add -u
+}
+
+env_sync() {
+ local STR="$1"
+ env_sync_data
+ git commit -m "${STR:-Update} at $(date)"
+}
+
+env_link_config() {
+ rm -f "$BASEDIR/.config"
+ ln -s env/.config "$BASEDIR/.config"
+ mkdir -p "$ENVDIR/files"
+ [ -L "$BASEDIR/files" ] || ln -s env/files "$BASEDIR/files"
+}
+
+env_do_reset() {
+ git reset --hard HEAD
+ git clean -d -f
+}
+
+env_list() {
+ env_init
+ git branch --color | grep -vE '^. master$'
+}
+
+env_diff() {
+ env_init
+ env_sync_data
+ git diff --cached --color
+ env_link_config
+}
+
+env_save() {
+ env_init
+ env_sync
+ env_link_config
+}
+
+env_revert() {
+ env_init
+ env_do_reset
+ env_link_config
+}
+
+env_ask_sync() {
+ env_sync_data
+ LINES="$(env_diff | wc -l)" # implies env_init
+ [ "$LINES" -gt 0 ] && {
+ if ask_bool 1 "Do you want to save your changes"; then
+ env_sync
+ else
+ env_do_reset
+ fi
+ }
+}
+
+env_clear() {
+ env_init
+ [ -L "$BASEDIR/.config" ] && rm -f "$BASEDIR/.config"
+ [ -L "$BASEDIR/files" ] && rm -f "$BASEDIR/files"
+ [ -f "$ENVDIR/.config" ] || ( cd "$ENVDIR/files" && find | grep -vE '^\.$' > /dev/null )
+ env_sync_data
+ if ask_bool 1 "Do you want to keep your current config and files"; then
+ mkdir -p "$BASEDIR/files"
+ shopt -s dotglob
+ cp -a "$ENVDIR/files/"* "$BASEDIR/files" 2>/dev/null >/dev/null
+ shopt -u dotglob
+ cp "$ENVDIR/.config" "$BASEDIR/"
+ else
+ rm -rf "$BASEDIR/files" "$BASEDIR/.config"
+ fi
+ cd "$BASEDIR"
+ rm -rf "$ENVDIR"
+}
+
+env_delete() {
+ local name="${1##*/}"
+ env_init
+ [ -z "$name" ] && usage
+ branch="$(git branch | grep '^\* ' | awk '{print $2}')"
+ [ "$name" = "$branch" ] && error "cannot delete the currently selected environment"
+ git branch -D "$name"
+}
+
+env_switch() {
+ local name="${1##*/}"
+ [ -z "$name" ] && usage
+
+ env_init
+ env_ask_sync
+ git checkout "$name" || error "environment '$name' not found"
+ env_link_config
+}
+
+env_rename() {
+ local NAME="${1##*/}"
+ env_init
+ git branch -m "$NAME"
+}
+
+env_new() {
+ local NAME="$1"
+ local branch
+ local from="master"
+
+ [ -z "$NAME" ] && usage
+ env_init 1
+
+ branch="$(git branch | grep '^\* ' | awk '{print $2}')"
+ if [ -n "$branch" -a "$branch" != "master" ]; then
+ env_ask_sync
+ if ask_bool 0 "Do you want to clone the current environment?"; then
+ from="$branch"
+ fi
+ rm -f "$BASEDIR/.config" "$BASEDIR/files"
+ fi
+ git checkout -b "$1" "$from"
+ if [ -f "$BASEDIR/.config" -o -d "$BASEDIR/files" ]; then
+ if ask_bool 1 "Do you want to start your configuration repository with the current configuration?"; then
+ [ -d "$BASEDIR/files" -a \! -L "$BASEDIR/files" ] && {
+ mkdir -p "$ENVDIR/files"
+ shopt -s dotglob
+ mv "$BASEDIR/files/"* "$ENVDIR/files/" 2>/dev/null
+ shopt -u dotglob
+ rmdir "$BASEDIR/files"
+ }
+ env_sync
+ else
+ rm -rf "$BASEDIR/.config" "$BASEDIR/files"
+ fi
+ fi
+ env_link_config
+}
+
+COMMAND="$1"; shift
+case "$COMMAND" in
+ help) usage 0;;
+ new) env_new "$@";;
+ list) env_list "$@";;
+ clear) env_clear "$@";;
+ switch) env_switch "$@";;
+ delete) env_delete "$@";;
+ rename) env_rename "$@";;
+ diff) env_diff "$@";;
+ save) env_save "$@";;
+ revert) env_revert "$@";;
+ *) usage;;
+esac
diff --git a/scripts/.svn/text-base/ext-toolchain.sh.svn-base b/scripts/.svn/text-base/ext-toolchain.sh.svn-base
new file mode 100644
index 0000000..3ebaa21
--- /dev/null
+++ b/scripts/.svn/text-base/ext-toolchain.sh.svn-base
@@ -0,0 +1,581 @@
+#!/usr/bin/env bash
+#
+# Script for various external toolchain tasks, refer to
+# the --help output for more information.
+#
+# Copyright (C) 2012 Jo-Philipp Wich <jow@openwrt.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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
+
+CC=""
+CXX=""
+CPP=""
+
+CFLAGS=""
+TOOLCHAIN="."
+
+LIBC_TYPE=""
+
+
+# Library specs
+LIB_SPECS="
+ c: ld-* lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}
+ rt: librt-* librt
+ pthread: libpthread-* libpthread
+ stdcpp: libstdc++
+ gcc: libgcc_s
+ ssp: libssp
+ gfortran: libgfortran
+"
+
+# Binary specs
+BIN_SPECS="
+ ldd: ldd
+ ldconfig: ldconfig
+ gdb: gdb
+ gdbserver: gdbserver
+"
+
+
+test_c() {
+ cat <<-EOT | "${CC:-false}" $CFLAGS -o /dev/null -x c - 2>/dev/null
+ #include <stdio.h>
+
+ int main(int argc, char **argv)
+ {
+ printf("Hello, world!\n");
+ return 0;
+ }
+ EOT
+}
+
+test_cxx() {
+ cat <<-EOT | "${CXX:-false}" $CFLAGS -o /dev/null -x c++ - 2>/dev/null
+ #include <iostream>
+
+ using namespace std;
+
+ int main()
+ {
+ cout << "Hello, world!" << endl;
+ return 0;
+ }
+ EOT
+}
+
+test_softfloat() {
+ cat <<-EOT | "$CC" $CFLAGS -msoft-float -o /dev/null -x c - 2>/dev/null
+ int main(int argc, char **argv)
+ {
+ double a = 0.1;
+ double b = 0.2;
+ double c = (a + b) / (a * b);
+ return 1;
+ }
+ EOT
+}
+
+test_uclibc() {
+ local sysroot="$("$CC" $CFLAGS -print-sysroot 2>/dev/null)"
+ if [ -d "${sysroot:-$TOOLCHAIN}" ]; then
+ local lib
+ for lib in "${sysroot:-$TOOLCHAIN}"/{lib,usr/lib,usr/local/lib}/ld-uClibc*.so*; do
+ if [ -f "$lib" ] && [ ! -h "$lib" ]; then
+ return 0
+ fi
+ done
+ fi
+ return 1
+}
+
+test_feature() {
+ local feature="$1"; shift
+
+ # find compilers, libc type
+ probe_cc
+ probe_cxx
+ probe_libc
+
+ # common toolchain feature tests
+ case "$feature" in
+ c) test_c; return $? ;;
+ c++) test_cxx; return $? ;;
+ soft*) test_softfloat; return $? ;;
+ esac
+
+ # assume eglibc/glibc supports all libc features
+ if [ "$LIBC_TYPE" != "uclibc" ]; then
+ return 0
+ fi
+
+ # uclibc feature tests
+ local inc
+ local sysroot="$("$CC" "$@" -muclibc -print-sysroot 2>/dev/null)"
+ for inc in "include" "usr/include" "usr/local/include"; do
+ local conf="${sysroot:-$TOOLCHAIN}/$inc/bits/uClibc_config.h"
+ if [ -f "$conf" ]; then
+ case "$feature" in
+ lfs) grep -q '__UCLIBC_HAS_LFS__ 1' "$conf"; return $?;;
+ ipv6) grep -q '__UCLIBC_HAS_IPV6__ 1' "$conf"; return $?;;
+ rpc) grep -q '__UCLIBC_HAS_RPC__ 1' "$conf"; return $?;;
+ locale) grep -q '__UCLIBC_HAS_LOCALE__ 1' "$conf"; return $?;;
+ wchar) grep -q '__UCLIBC_HAS_WCHAR__ 1' "$conf"; return $?;;
+ threads) grep -q '__UCLIBC_HAS_THREADS__ 1' "$conf"; return $?;;
+ esac
+ fi
+ done
+
+ return 1
+}
+
+
+find_libs() {
+ local spec="$(echo "$LIB_SPECS" | sed -ne "s#^[[:space:]]*$1:##ip")"
+
+ if [ -n "$spec" ] && probe_cpp; then
+ local libdir libdirs
+ for libdir in $(
+ "$CPP" $CFLAGS -v -x c /dev/null 2>&1 | \
+ sed -ne 's#:# #g; s#^LIBRARY_PATH=##p'
+ ); do
+ if [ -d "$libdir" ]; then
+ libdirs="$libdirs $(cd "$libdir"; pwd)/"
+ fi
+ done
+
+ local pattern
+ for pattern in $(eval echo $spec); do
+ find $libdirs -name "$pattern.so*" | sort -u
+ done
+
+ return 0
+ fi
+
+ return 1
+}
+
+find_bins() {
+ local spec="$(echo "$BIN_SPECS" | sed -ne "s#^[[:space:]]*$1:##ip")"
+
+ if [ -n "$spec" ] && probe_cpp; then
+ local sysroot="$("$CPP" -print-sysroot)"
+
+ local bindir bindirs
+ for bindir in $(
+ echo "${sysroot:-$TOOLCHAIN}/bin";
+ echo "${sysroot:-$TOOLCHAIN}/usr/bin";
+ echo "${sysroot:-$TOOLCHAIN}/usr/local/bin";
+ "$CPP" $CFLAGS -v -x c /dev/null 2>&1 | \
+ sed -ne 's#:# #g; s#^COMPILER_PATH=##p'
+ ); do
+ if [ -d "$bindir" ]; then
+ bindirs="$bindirs $(cd "$bindir"; pwd)/"
+ fi
+ done
+
+ local pattern
+ for pattern in $(eval echo $spec); do
+ find $bindirs -name "$pattern" | sort -u
+ done
+
+ return 0
+ fi
+
+ return 1
+}
+
+
+wrap_bin_cc() {
+ local out="$1"
+ local bin="$2"
+
+ echo '#!/bin/sh' > "$out"
+ echo 'for arg in "$@"; do' >> "$out"
+ echo ' case "$arg" in -l*|-L*|-shared|-static)' >> "$out"
+ echo -n ' exec "'"$bin"'" '"$CFLAGS"' ${STAGING_DIR:+' >> "$out"
+ echo -n '-idirafter "$STAGING_DIR/usr/include" ' >> "$out"
+ echo -n '-L "$STAGING_DIR/usr/lib" ' >> "$out"
+ echo '-Wl,-rpath-link,"$STAGING_DIR/usr/lib"} "$@" ;;' >> "$out"
+ echo ' esac' >> "$out"
+ echo 'done' >> "$out"
+ echo -n 'exec "'"$bin"'" '"$CFLAGS"' ${STAGING_DIR:+' >> "$out"
+ echo '-idirafter "$STAGING_DIR/usr/include"} "$@"' >> "$out"
+
+ chmod +x "$out"
+}
+
+wrap_bin_ld() {
+ local out="$1"
+ local bin="$2"
+
+ echo '#!/bin/sh' > "$out"
+ echo -n 'exec "'"$bin"'" ${STAGING_DIR:+' >> "$out"
+ echo -n '-L "$STAGING_DIR/usr/lib" ' >> "$out"
+ echo '-rpath-link "$STAGING_DIR/usr/lib"} "$@"' >> "$out"
+
+ chmod +x "$out"
+}
+
+wrap_bin_other() {
+ local out="$1"
+ local bin="$2"
+
+ echo '#!/bin/sh' > "$out"
+ echo 'exec "'"$bin"'" "$@"' >> "$out"
+
+ chmod +x "$out"
+}
+
+wrap_bins() {
+ if probe_cc; then
+ mkdir -p "$1" || return 1
+
+ local cmd
+ for cmd in "${CC%-*}-"*; do
+ if [ -x "$cmd" ]; then
+ local out="$1/${cmd##*/}"
+ local bin="$cmd"
+
+ if [ -x "$out" ] && ! grep -q STAGING_DIR "$out"; then
+ mv "$out" "$out.bin"
+ bin='$(dirname "$0")/'"${out##*/}"'.bin'
+ fi
+
+ case "${cmd##*/}" in
+ *-*cc|*-*cc-*|*-*++|*-*++-*|*-cpp)
+ wrap_bin_cc "$out" "$bin"
+ ;;
+ *-ld)
+ wrap_bin_ld "$out" "$bin"
+ ;;
+ *)
+ wrap_bin_other "$out" "$bin"
+ ;;
+ esac
+ fi
+ done
+
+ return 0
+ fi
+
+ return 1
+}
+
+
+print_config() {
+ local mktarget="$1"
+ local mksubtarget
+
+ local target="$("$CC" $CFLAGS -dumpmachine)"
+ local cpuarch="${target%%-*}"
+ local prefix="${CC##*/}"; prefix="${prefix%-*}-"
+ local config="${0%/scripts/*}/.config"
+
+ # if no target specified, print choice list and exit
+ if [ -z "$mktarget" ]; then
+ # prepare metadata
+ if [ ! -f "${0%/scripts/*}/tmp/.targetinfo" ]; then
+ "${0%/*}/scripts/config/mconf" prepare-tmpinfo
+ fi
+
+ local mktargets=$(
+ sed -ne "
+ /^Target: / { h };
+ /^Target-Arch: $cpuarch\$/ { x; s#^Target: ##p }
+ " "${0%/scripts/*}/tmp/.targetinfo" | sort -u
+ )
+
+ for mktarget in $mktargets; do
+ case "$mktarget" in */*)
+ mktargets=$(echo "$mktargets" | sed -e "/^${mktarget%/*}\$/d")
+ esac
+ done
+
+ if [ -n "$mktargets" ]; then
+ echo "Available targets:" >&2
+ echo $mktargets >&2
+ else
+ echo -e "Could not find a suitable OpenWrt target for " >&2
+ echo -e "CPU architecture '$cpuarch' - you need to " >&2
+ echo -e "define one first!" >&2
+ fi
+ return 1
+ fi
+
+ # bail out if there is a .config already
+ if [ -f "${0%/scripts/*}/.config" ]; then
+ echo "There already is a .config file, refusing to overwrite!" >&2
+ return 1
+ fi
+
+ case "$mktarget" in */*)
+ mksubtarget="${mktarget#*/}"
+ mktarget="${mktarget%/*}"
+ ;; esac
+
+
+ echo "CONFIG_TARGET_${mktarget}=y" > "$config"
+
+ if [ -n "$mksubtarget" ]; then
+ echo "CONFIG_TARGET_${mktarget}_${mksubtarget}=y" >> "$config"
+ fi
+
+ if test_feature "softfloat"; then
+ echo "CONFIG_SOFT_FLOAT=y" >> "$config"
+ else
+ echo "# CONFIG_SOFT_FLOAT is not set" >> "$config"
+ fi
+
+ if test_feature "ipv6"; then
+ echo "CONFIG_IPV6=y" >> "$config"
+ else
+ echo "# CONFIG_IPV6 is not set" >> "$config"
+ fi
+
+ if test_feature "locale"; then
+ echo "CONFIG_BUILD_NLS=y" >> "$config"
+ else
+ echo "# CONFIG_BUILD_NLS is not set" >> "$config"
+ fi
+
+ echo "CONFIG_DEVEL=y" >> "$config"
+ echo "CONFIG_EXTERNAL_TOOLCHAIN=y" >> "$config"
+ echo "CONFIG_TOOLCHAIN_ROOT=\"$TOOLCHAIN\"" >> "$config"
+ echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config"
+ echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config"
+
+ if [ "$LIBC_TYPE" != glibc ]; then
+ echo "CONFIG_TOOLCHAIN_LIBC=\"$LIBC_TYPE\"" >> "$config"
+ fi
+
+ local lib
+ for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN; do
+ local file
+ local spec=""
+ local llib="$(echo "$lib" | sed -e 's#.*#\L&#')"
+ for file in $(find_libs "$lib"); do
+ spec="${spec:+$spec }$(echo "$file" | sed -e "s#^$TOOLCHAIN#.#")"
+ done
+ if [ -n "$spec" ]; then
+ echo "CONFIG_PACKAGE_lib${llib}=y" >> "$config"
+ echo "CONFIG_LIB${lib}_FILE_SPEC=\"$spec\"" >> "$config"
+ else
+ echo "# CONFIG_PACKAGE_lib${llib} is not set" >> "$config"
+ fi
+ done
+
+ local bin
+ for bin in LDD LDCONFIG; do
+ local file
+ local spec=""
+ local lbin="$(echo "$bin" | sed -e 's#.*#\L&#')"
+ for file in $(find_bins "$bin"); do
+ spec="${spec:+$spec }$(echo "$file" | sed -e "s#^$TOOLCHAIN#.#")"
+ done
+ if [ -n "$spec" ]; then
+ echo "CONFIG_PACKAGE_${lbin}=y" >> "$config"
+ echo "CONFIG_${bin}_FILE_SPEC=\"$spec\"" >> "$config"
+ else
+ echo "# CONFIG_PACKAGE_${lbin} is not set" >> "$config"
+ fi
+ done
+
+ # inflate
+ make -C "${0%/scripts/*}" defconfig
+ return 0
+}
+
+
+probe_cc() {
+ if [ -z "$CC" ]; then
+ local bin
+ for bin in "bin" "usr/bin" "usr/local/bin"; do
+ local cmd
+ for cmd in "$TOOLCHAIN/$bin/"*-*cc*; do
+ if [ -x "$cmd" ] && [ ! -h "$cmd" ]; then
+ CC="$(cd "${cmd%/*}"; pwd)/${cmd##*/}"
+ return 0
+ fi
+ done
+ done
+ return 1
+ fi
+ return 0
+}
+
+probe_cxx() {
+ if [ -z "$CXX" ]; then
+ local bin
+ for bin in "bin" "usr/bin" "usr/local/bin"; do
+ local cmd
+ for cmd in "$TOOLCHAIN/$bin/"*-*++*; do
+ if [ -x "$cmd" ] && [ ! -h "$cmd" ]; then
+ CXX="$(cd "${cmd%/*}"; pwd)/${cmd##*/}"
+ return 0
+ fi
+ done
+ done
+ return 1
+ fi
+ return 0
+}
+
+probe_cpp() {
+ if [ -z "$CPP" ]; then
+ local bin
+ for bin in "bin" "usr/bin" "usr/local/bin"; do
+ local cmd
+ for cmd in "$TOOLCHAIN/$bin/"*-cpp*; do
+ if [ -x "$cmd" ] && [ ! -h "$cmd" ]; then
+ CPP="$(cd "${cmd%/*}"; pwd)/${cmd##*/}"
+ return 0
+ fi
+ done
+ done
+ return 1
+ fi
+ return 0
+}
+
+probe_libc() {
+ if [ -z "$LIBC_TYPE" ]; then
+ if test_uclibc; then
+ LIBC_TYPE="uclibc"
+ else
+ LIBC_TYPE="glibc"
+ fi
+ fi
+ return 0
+}
+
+
+while [ -n "$1" ]; do
+ arg="$1"; shift
+ case "$arg" in
+ --toolchain)
+ [ -d "$1" ] || {
+ echo "Toolchain directory '$1' does not exist." >&2
+ exit 1
+ }
+ TOOLCHAIN="$(cd "$1"; pwd)"; shift
+ ;;
+
+ --cflags)
+ CFLAGS="${CFLAGS:+$CFLAGS }$1"; shift
+ ;;
+
+ --print-libc)
+ if probe_cc; then
+ probe_libc
+ echo "$LIBC_TYPE"
+ exit 0
+ fi
+ echo "No C compiler found in '$TOOLCHAIN'." >&2
+ exit 1
+ ;;
+
+ --print-target)
+ if probe_cc; then
+ exec "$CC" $CFLAGS -dumpmachine
+ fi
+ echo "No C compiler found in '$TOOLCHAIN'." >&2
+ exit 1
+ ;;
+
+ --print-bin)
+ if [ -z "$1" ]; then
+ echo "Available programs:" >&2
+ echo $(echo "$BIN_SPECS" | sed -ne 's#:.*$##p') >&2
+ exit 1
+ fi
+
+ find_bins "$1" || exec "$0" --toolchain "$TOOLCHAIN" --print-bin
+ exit 0
+ ;;
+
+ --print-libs)
+ if [ -z "$1" ]; then
+ echo "Available libraries:" >&2
+ echo $(echo "$LIB_SPECS" | sed -ne 's#:.*$##p') >&2
+ exit 1
+ fi
+
+ find_libs "$1" || exec "$0" --toolchain "$TOOLCHAIN" --print-libs
+ exit 0
+ ;;
+
+ --test)
+ test_feature "$1"
+ exit $?
+ ;;
+
+ --wrap)
+ [ -n "$1" ] || exec "$0" --help
+ wrap_bins "$1"
+ exit $?
+ ;;
+
+ --config)
+ if probe_cc; then
+ print_config "$1"
+ exit $?
+ fi
+ echo "No C compiler found in '$TOOLCHAIN'." >&2
+ exit 1
+ ;;
+
+ -h|--help)
+ me="$(basename "$0")"
+ echo -e "\nUsage:\n" >&2
+ echo -e " $me --toolchain {directory} --print-libc" >&2
+ echo -e " Print the libc implementation and exit.\n" >&2
+ echo -e " $me --toolchain {directory} --print-target" >&2
+ echo -e " Print the GNU target name and exit.\n" >&2
+ echo -e " $me --toolchain {directory} --print-bin {program}" >&2
+ echo -e " Print executables belonging to given program," >&2
+ echo -e " omit program argument to get a list of names.\n" >&2
+ echo -e " $me --toolchain {directory} --print-libs {library}" >&2
+ echo -e " Print shared objects belonging to given library," >&2
+ echo -e " omit library argument to get a list of names.\n" >&2
+ echo -e " $me --toolchain {directory} --test {feature}" >&2
+ echo -e " Test given feature, exit code indicates success." >&2
+ echo -e " Possible features are 'c', 'c++', 'softfloat'," >&2
+ echo -e " 'lfs', 'rpc', 'ipv6', 'wchar', 'locale' and " >&2
+ echo -e " 'threads'.\n" >&2
+ echo -e " $me --toolchain {directory} --wrap {directory}" >&2
+ echo -e " Create wrapper scripts for C and C++ compiler, " >&2
+ echo -e " linker, assembler and other key executables in " >&2
+ echo -e " the directory given with --wrap.\n" >&2
+ echo -e " $me --toolchain {directory} --config {target}" >&2
+ echo -e " Analyze the given toolchain and print a suitable" >&2
+ echo -e " .config for the given target. Omit target " >&2
+ echo -e " argument to get a list of names.\n" >&2
+ echo -e " $me --help" >&2
+ echo -e " Display this help text and exit.\n\n" >&2
+ echo -e " Most commands also take a --cflags parameter which " >&2
+ echo -e " is used to specify C flags to be passed to the " >&2
+ echo -e " cross compiler when performing tests." >&2
+ echo -e " This paremter may be repeated multiple times." >&2
+ exit 1
+ ;;
+
+ *)
+ echo "Unknown argument '$arg'" >&2
+ exec $0 --help
+ ;;
+ esac
+done
+
+exec $0 --help
diff --git a/scripts/.svn/text-base/feeds.svn-base b/scripts/.svn/text-base/feeds.svn-base
new file mode 100644
index 0000000..b1bdee5
--- /dev/null
+++ b/scripts/.svn/text-base/feeds.svn-base
@@ -0,0 +1,640 @@
+#!/usr/bin/perl
+use Getopt::Std;
+use FindBin;
+use Cwd;
+use lib "$FindBin::Bin";
+use metadata;
+use warnings;
+use strict;
+use Cwd 'abs_path';
+
+chdir "$FindBin::Bin/..";
+$ENV{TOPDIR}=getcwd();
+$ENV{GIT_CONFIG_PARAMETERS}="'core.autocrlf=false'";
+
+my $mk=`which gmake 2>/dev/null`; # select the right 'make' program
+chomp($mk); # trim trailing newline
+$mk or $mk = "make"; # default to 'make'
+
+# check version of make
+my @mkver = split /\s+/, `$mk -v`, 4;
+my $valid_mk = 1;
+$mkver[0] =~ /^GNU/ or $valid_mk = 0;
+$mkver[1] =~ /^Make/ or $valid_mk = 0;
+$mkver[2] >= "3.81" or $valid_mk = 0;
+$valid_mk or die "Unsupported version of make found: $mk\n";
+
+my @feeds;
+my %build_packages;
+my %installed;
+my %feed_cache;
+
+my $feed_package = {};
+my $feed_src = {};
+
+sub parse_config() {
+ my $line = 0;
+ my %name;
+
+ open FEEDS, "feeds.conf" or
+ open FEEDS, "feeds.conf.default" or
+ die "Unable to open feeds configuration";
+ while (<FEEDS>) {
+ chomp;
+ s/#.+$//;
+ next unless /\S/;
+ my @line = split /\s+/, $_, 3;
+ my @src;
+ $line++;
+
+ my $valid = 1;
+ $line[0] =~ /^src-\w+$/ or $valid = 0;
+ $line[1] =~ /^\w+$/ or $valid = 0;
+ @src = split /\s+/, $line[2];
+ $valid or die "Syntax error in feeds.conf, line: $line\n";
+
+ $name{$line[1]} and die "Duplicate feed name '$line[1]', line: $line\n";
+ $name{$line[1]} = 1;
+
+ push @feeds, [$line[0], $line[1], \@src];
+ }
+ close FEEDS;
+}
+
+sub update_location($$)
+{
+ my $name = shift;
+ my $url = shift;
+ my $old_url;
+
+ -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1;
+
+ if( open LOC, "< ./feeds/$name.tmp/location" )
+ {
+ chomp($old_url = readline LOC);
+ close LOC;
+ }
+
+ if( !$old_url || $old_url ne $url )
+ {
+ if( open LOC, "> ./feeds/$name.tmp/location" )
+ {
+ print LOC $url, "\n";
+ close LOC;
+ }
+ return $old_url ? 1 : 0;
+ }
+
+ return 0;
+}
+
+sub update_index($)
+{
+ my $name = shift;
+
+ -d "./feeds/$name.tmp" or mkdir "./feeds/$name.tmp" or return 1;
+ -d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1;
+
+ system("$mk -s prepare-mk OPENWRT_BUILD= TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+ system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPS=\"$ENV{TOPDIR}/include/package*.mk\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
+ system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
+
+ return 0;
+}
+
+my %update_method = (
+ 'src-svn' => {
+ 'init' => "svn checkout '%s' '%s'",
+ 'update' => "svn update",
+ 'controldir' => ".svn",
+ 'revision' => "svn info | grep 'Revision' | cut -d ' ' -f 2 | tr -d '\n'"},
+ 'src-cpy' => {
+ 'init' => "cp -Rf '%s' '%s'",
+ 'update' => "",
+ 'revision' => "echo -n 'local'"},
+ 'src-link' => {
+ 'init' => "ln -s '%s' '%s'",
+ 'update' => "",
+ 'revision' => "echo -n 'local'"},
+ 'src-git' => {
+ 'init' => "git clone --depth 1 '%s' '%s'",
+ 'init_branch' => "git clone --depth 1 --branch '%s' '%s' '%s'",
+ 'update' => "git pull",
+ 'controldir' => ".git",
+ 'revision' => "git show --abbrev-commit HEAD | head -n 1 | cut -d ' ' -f 2 | tr -d '\n'"},
+ 'src-gitsvn' => {
+ 'init' => "git svn clone -r HEAD '%s' '%s'",
+ 'update' => "git svn rebase",
+ 'controldir' => ".git",
+ 'revision' => "git show --abbrev-commit HEAD | head -n 1 | cut -d ' ' -f 2 | tr -d '\n'"},
+ 'src-bzr' => {
+ 'init' => "bzr checkout --lightweight '%s' '%s'",
+ 'update' => "bzr update",
+ 'controldir' => ".bzr"},
+ 'src-hg' => {
+ 'init' => "hg clone '%s' '%s'",
+ 'update' => "hg pull --update",
+ 'controldir' => ".hg"},
+ 'src-darcs' => {
+ 'init' => "darcs get '%s' '%s'",
+ 'update' => "darcs pull -a",
+ 'controldir' => "_darcs"},
+);
+
+# src-git: pull broken
+# src-cpy: broken if `basename $src` != $name
+
+sub update_feed_via($$$$) {
+ my $type = shift;
+ my $name = shift;
+ my $src = shift;
+ my $relocate = shift;
+
+ my $m = $update_method{$type};
+ my $localpath = "./feeds/$name";
+ my $safepath = $localpath;
+ $safepath =~ s/'/'\\''/;
+ my ($base, $branch) = split(/;/, $src, 2);
+
+ if( $relocate || !$m->{'update'} || !-d "$localpath/$m->{'controldir'}" ) {
+ system("rm -rf '$safepath'");
+ if ($m->{'init_branch'} and $branch) {
+ system(sprintf($m->{'init_branch'}, $branch, $base, $safepath)) == 0 or return 1;
+ } else {
+ system(sprintf($m->{'init'}, $src, $safepath)) == 0 or return 1;
+ }
+ } else {
+ system("cd '$safepath'; $m->{'update'}") == 0 or return 1;
+ }
+
+ return 0;
+}
+
+sub get_feed($) {
+ my $feed = shift;
+
+ if (!defined($feed_cache{$feed})) {
+ my $file = "./feeds/$feed.index";
+
+ clear_packages();
+ -f $file or do {
+ print "Ignoring feed '$feed' - index missing\n";
+ return;
+ };
+ parse_package_metadata($file) or return;
+ $feed_cache{$feed} = [ { %package }, { %srcpackage } ];
+ }
+
+ $feed_package = $feed_cache{$feed}->[0];
+ $feed_src = $feed_cache{$feed}->[1];
+ return $feed_cache{$feed}->[0];
+}
+
+sub get_installed() {
+ system("$mk -s prepare-tmpinfo OPENWRT_BUILD=");
+ clear_packages();
+ parse_package_metadata("./tmp/.packageinfo");
+ %installed = %package;
+}
+
+sub search_feed {
+ my $feed = shift;
+ my @substr = @_;
+ my $display;
+
+ return unless @substr > 0;
+ get_feed($feed);
+ foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) {
+ my $pkg = $feed_package->{$name};
+ my $substr;
+ my $pkgmatch = 1;
+
+ next if $pkg->{vdepends};
+ foreach my $substr (@substr) {
+ my $match;
+ foreach my $key (qw(name title description src)) {
+ $pkg->{$key} and $substr and $pkg->{$key} =~ m/$substr/i and $match = 1;
+ }
+ $match or undef $pkgmatch;
+ };
+ $pkgmatch and do {
+ $display or do {
+ print "Search results in feed '$feed':\n";
+ $display = 1;
+ };
+ printf "\%-25s\t\%s\n", $pkg->{name}, $pkg->{title};
+ };
+ }
+ return 0;
+}
+
+sub search {
+ my %opts;
+
+ getopt('r:', \%opts);
+ foreach my $feed (@feeds) {
+ search_feed($feed->[1], @ARGV) if (!defined($opts{r}) or $opts{r} eq $feed->[1]);
+ }
+}
+
+sub list_feed {
+ my $feed = shift;
+
+ get_feed($feed);
+ foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) {
+ my $pkg = $feed_package->{$name};
+ next if $pkg->{vdepends};
+ if($pkg->{name}) {
+ printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title};
+ }
+ }
+
+ return 0;
+}
+
+sub list {
+ my %opts;
+
+ getopts('r:d:sh', \%opts);
+ if ($opts{h}) {
+ usage();
+ return 0;
+ }
+ if ($opts{s}) {
+ foreach my $feed (@feeds) {
+ my $localpath = "./feeds/$feed->[1]";
+ my $m = $update_method{$feed->[0]};
+ my $revision;
+ if( !$m->{'revision'} ) {
+ $revision = "X";
+ }
+ elsif( $m->{'controldir'} && -d "$localpath/$m->{'controldir'}" ) {
+ $revision = `cd '$localpath'; $m->{'revision'}`;
+ }
+ else {
+ $revision = "local";
+ }
+ if ($opts{d}) {
+ printf "%s%s%s%s%s%s%s\n", $feed->[1], $opts{d}, $feed->[0], $opts{d}, $revision, $opts{d}, join(", ", @{$feed->[2]});
+ }
+ else {
+ printf "\%-8s \%-8s \%-8s \%s\n", $feed->[1], $feed->[0], $revision, join(", ", @{$feed->[2]});
+ }
+ }
+ return 0;
+ }
+ foreach my $feed (@feeds) {
+ list_feed($feed->[1], @ARGV) if (!defined($opts{r}) or $opts{r} eq $feed->[1]);
+ }
+ return 0;
+}
+
+sub install_generic() {
+ my $feed = shift;
+ my $pkg = shift;
+ my $path = $pkg->{makefile};
+
+ if($path) {
+ $path =~ s/\/Makefile$//;
+
+ -d "./package/feeds" or mkdir "./package/feeds";
+ -d "./package/feeds/$feed->[1]" or mkdir "./package/feeds/$feed->[1]";
+ system("ln -sf ../../../$path ./package/feeds/$feed->[1]/");
+ } else {
+ warn "Package is not valid\n";
+ return 1;
+ }
+
+ return 0;
+}
+
+my %install_method = (
+ 'src-svn' => \&install_generic,
+ 'src-cpy' => \&install_generic,
+ 'src-link' => \&install_generic,
+ 'src-git' => \&install_generic,
+ 'src-gitsvn' => \&install_generic,
+ 'src-bzr' => \&install_generic,
+ 'src-hg' => \&install_generic,
+ 'src-darcs' => \&install_generic,
+);
+
+my %feed;
+
+sub lookup_package($$) {
+ my $feed = shift;
+ my $package = shift;
+
+ foreach my $feed ($feed, @feeds) {
+ next unless $feed->[1];
+ next unless $feed{$feed->[1]};
+ $feed{$feed->[1]}->{$package} and return $feed;
+ }
+ return;
+}
+
+sub install_package {
+ my $feed = shift;
+ my $name = shift;
+ my $ret = 0;
+
+ $feed = lookup_package($feed, $name);
+ $feed or do {
+ $installed{$name} and return 0;
+ # TODO: check if it's already installed within ./package directory
+ $feed_src->{$name} or -d "./package/$name" or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n";
+ return 0;
+ };
+
+ # switch to the metadata for the selected feed
+ get_feed($feed->[1]);
+
+ my $pkg = $feed{$feed->[1]}->{$name} or return 1;
+ $pkg->{name} or do {
+ $installed{$name} and return 0;
+ # TODO: check if this is an alias package, maybe it's known by another name
+ warn "WARNING: Package '$name' is not available in feed $feed->[1].\n";
+ return 0;
+ };
+ my $src = $pkg->{src};
+ my $type = $feed->[0];
+ $src or $src = $name;
+
+ # previously installed packages set the runtime package
+ # newly installed packages set the source package
+ $installed{$src} and return 0;
+
+ # check previously installed packages
+ $installed{$name} and return 0;
+ $installed{$src} = 1;
+ warn "Installing package '$src'\n";
+
+ $install_method{$type} or do {
+ warn "Unknown installation method: '$type'\n";
+ return 1;
+ };
+
+ &{$install_method{$type}}($feed, $pkg) == 0 or do {
+ warn "failed.\n";
+ return 1;
+ };
+
+ # install all dependencies referenced from the source package
+ foreach my $vpkg (@{$feed_src->{$src}}) {
+ foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) {
+ next if $dep =~ /@/;
+ $dep =~ s/^\+//;
+ $dep =~ s/^.+://;
+ $dep =~ s/\/.+$//;
+ next unless $dep;
+ install_package($feed, $dep) == 0 or $ret = 1;
+ }
+ }
+
+ return $ret;
+}
+
+sub refresh_config {
+ my $default = shift;
+
+ # workaround for timestamp check
+ system("rm -f tmp/.packageinfo");
+
+ # refresh the config
+ if ($default) {
+ system("$mk oldconfig CONFDEFAULT=\"$default\" Config.in >/dev/null 2>/dev/null");
+ } else {
+ system("$mk defconfig Config.in >/dev/null 2>/dev/null");
+ }
+}
+
+sub install {
+ my $name;
+ my %opts;
+ my $feed;
+ my $ret = 0;
+
+ getopts('ap:d:h', \%opts);
+
+ if ($opts{h}) {
+ usage();
+ return 0;
+ }
+
+ get_installed();
+
+ foreach my $f (@feeds) {
+ # index all feeds
+ $feed{$f->[1]} = get_feed($f->[1]);
+
+ # look up the preferred feed
+ $opts{p} and $f->[1] eq $opts{p} and $feed = $f;
+ }
+
+ if($opts{a}) {
+ foreach my $f (@feeds) {
+ if (!defined($opts{p}) or $opts{p} eq $f->[1]) {
+ printf "Installing all packages from feed %s.\n", $f->[1];
+ get_feed($f->[1]);
+ foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) {
+ my $p = $feed_package->{$name};
+ next if $p->{vdepends};
+ if( $p->{name} ) {
+ install_package($feed, $p->{name}) == 0 or $ret = 1;
+ get_feed($f->[1]);
+ }
+ }
+ }
+ }
+ } else {
+ while ($name = shift @ARGV) {
+ install_package($feed, $name) == 0 or $ret = 1;
+ }
+ }
+
+ # workaround for timestamp check
+
+ # set the defaults
+ if ($opts{d} and $opts{d} =~ /^[ymn]$/) {
+ refresh_config($opts{d});
+ }
+
+ return $ret;
+}
+
+sub uninstall {
+ my %opts;
+ my $name;
+ my $uninstall;
+
+ getopts('ah', \%opts);
+
+ if ($opts{h}) {
+ usage();
+ return 0;
+ }
+
+ if ($opts{a}) {
+ system("rm -rvf ./package/feeds");
+ $uninstall = 1;
+ } else {
+ if($#ARGV == -1) {
+ warn "WARNING: no package to uninstall\n";
+ return 0;
+ }
+ get_installed();
+ while ($name = shift @ARGV) {
+ my $pkg = $installed{$name};
+ $pkg or do {
+ warn "WARNING: $name not installed\n";
+ next;
+ };
+ $pkg->{src} and $name = $pkg->{src};
+ warn "Uninstalling package '$name'\n";
+ system("rm -f ./package/feeds/*/$name");
+ $uninstall = 1;
+ }
+ }
+ $uninstall and refresh_config();
+ return 0;
+}
+
+sub update_feed($$$$)
+{
+ my $type=shift;
+ my $name=shift;
+ my $src=shift;
+ my $perform_update=shift;
+ my $force_relocate=update_location( $name, "@$src" );
+
+ if( $force_relocate ) {
+ warn "Source of feed $name has changed, replacing copy\n";
+ }
+ $update_method{$type} or do {
+ warn "Unknown type '$type' in feed $name\n";
+ return 1;
+ };
+ $perform_update and do {
+ my $failed = 1;
+ foreach my $feedsrc (@$src) {
+ warn "Updating feed '$name' from '$feedsrc' ...\n";
+ next unless update_feed_via($type, $name, $feedsrc, $force_relocate) == 0;
+ $failed = 0;
+ last;
+ }
+ $failed and do {
+ warn "failed.\n";
+ return 1;
+ };
+ };
+ warn "Create index file './feeds/$name.index' \n";
+ update_index($name) == 0 or do {
+ warn "failed.\n";
+ return 1;
+ };
+ return 0;
+}
+
+sub update {
+ my %opts;
+ my $feed_name;
+ my $perform_update=1;
+
+ $ENV{SCAN_COOKIE} = $$;
+ $ENV{OPENWRT_VERBOSE} = 's';
+
+ getopts('ahi', \%opts);
+
+ if ($opts{h}) {
+ usage();
+ return 0;
+ }
+
+ if ($opts{i}) {
+ # don't update from (remote) repository
+ # only re-create index information
+ $perform_update=0;
+ }
+
+ -d "feeds" or do {
+ mkdir "feeds" or die "Unable to create the feeds directory";
+ };
+
+ if ( ($#ARGV == -1) or $opts{a}) {
+ foreach my $feed (@feeds) {
+ my ($type, $name, $src) = @$feed;
+ update_feed($type, $name, $src, $perform_update);
+ }
+ } else {
+ while ($feed_name = shift @ARGV) {
+ foreach my $feed (@feeds) {
+ my ($type, $name, $src) = @$feed;
+ if($feed_name ne $name) {
+ next;
+ }
+ update_feed($type, $name, $src, $perform_update);
+ }
+ }
+ }
+
+ refresh_config();
+
+ return 0;
+}
+
+sub usage() {
+ print <<EOF;
+Usage: $0 <command> [options]
+
+Commands:
+ list [options]: List feeds, their content and revisions (if installed)
+ Options:
+ -s : List of feed names and their URL.
+ -r <feedname>: List packages of specified feed.
+ -d <delimiter>: Use specified delimiter to distinguish rows (default: spaces)
+
+ install [options] <package>: Install a package
+ Options:
+ -a : Install all packages from all feeds or from the specified feed using the -p option.
+ -p <feedname>: Prefer this feed when installing packages.
+ -d <y|m|n>: Set default for newly installed packages.
+
+ search [options] <substring>: Search for a package
+ Options:
+ -r <feedname>: Only search in this feed
+
+ uninstall -a|<package>: Uninstall a package
+ Options:
+ -a : Uninstalls all packages.
+
+ update -a|<feedname(s)>: Update packages and lists of feeds in feeds.conf .
+ Options:
+ -a : Update all feeds listed within feeds.conf. Otherwise the specified feeds will be updated.
+ -i : Recreate the index only. No feed update from repository is performed.
+
+ clean: Remove downloaded/generated files.
+
+EOF
+ exit(1);
+}
+
+my %commands = (
+ 'list' => \&list,
+ 'update' => \&update,
+ 'install' => \&install,
+ 'search' => \&search,
+ 'uninstall' => \&uninstall,
+ 'clean' => sub {
+ system("rm -rf feeds");
+ }
+);
+
+my $arg = shift @ARGV;
+$arg or usage();
+parse_config;
+foreach my $cmd (keys %commands) {
+ $arg eq $cmd and do {
+ exit(&{$commands{$cmd}}());
+ };
+}
+usage();
diff --git a/scripts/.svn/text-base/freebsd.sh.svn-base b/scripts/.svn/text-base/freebsd.sh.svn-base
new file mode 100644
index 0000000..3107861
--- /dev/null
+++ b/scripts/.svn/text-base/freebsd.sh.svn-base
@@ -0,0 +1 @@
+env PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/All/ pkg_add -r gmake-3.82.tbz bash-4.1.11.tbz python27-2.7.2_3.tbz gtar-1.26.tbz findutils-4.5.10_2.tbz coreutils-8.12.tbz getopt-1.1.4_2.tbz wget-1.13.4_1.tbz gnugrep-2.9.tbz gawk-4.0.0.tbz
diff --git a/scripts/.svn/text-base/gen-dependencies.sh.svn-base b/scripts/.svn/text-base/gen-dependencies.sh.svn-base
new file mode 100644
index 0000000..df8073e
--- /dev/null
+++ b/scripts/.svn/text-base/gen-dependencies.sh.svn-base
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+SELF=${0##*/}
+
+READELF="${READELF:-readelf}"
+TARGETS=$*
+XARGS="${XARGS:-xargs -r}"
+
+[ -z "$TARGETS" ] && {
+ echo "$SELF: no directories / files specified"
+ echo "usage: $SELF [PATH...]"
+ exit 1
+}
+
+find $TARGETS -type f -a -exec file {} \; | \
+ sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.* stripped/\1/p' | \
+ $XARGS -n1 readelf -d | \
+ awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \
+ sort -u
diff --git a/scripts/.svn/text-base/getver.sh.svn-base b/scripts/.svn/text-base/getver.sh.svn-base
new file mode 100644
index 0000000..8bb384b
--- /dev/null
+++ b/scripts/.svn/text-base/getver.sh.svn-base
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+export LANG=C
+export LC_ALL=C
+[ -n "$TOPDIR" ] && cd $TOPDIR
+
+try_version() {
+ [ -f version ] || return 1
+ REV="$(cat version)"
+ [ -n "$REV" ]
+}
+
+try_svn() {
+ [ -d .svn ] || return 1
+ REV="$(svn info | awk '/^Last Changed Rev:/ { print $4 }')"
+ REV="${REV:+r$REV}"
+ [ -n "$REV" ]
+}
+
+try_git() {
+ [ -d .git ] || return 1
+ REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')"
+ REV="${REV:+r$REV}"
+ [ -n "$REV" ]
+}
+
+try_hg() {
+ [ -d .hg ] || return 1
+ REV="$(hg log -r-1 --template '{desc}' | awk '{print $2}' | sed 's/\].*//')"
+ REV="${REV:+$REV}"
+ [ -n "$REV" ]
+}
+
+try_version || try_svn || try_git || try_hg || REV="unknown"
+echo "$REV"
diff --git a/scripts/.svn/text-base/ipkg-make-index.sh.svn-base b/scripts/.svn/text-base/ipkg-make-index.sh.svn-base
new file mode 100644
index 0000000..cbfa450
--- /dev/null
+++ b/scripts/.svn/text-base/ipkg-make-index.sh.svn-base
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+set -e
+
+pkg_dir=$1
+
+if [ -z $pkg_dir ] || [ ! -d $pkg_dir ]; then
+ echo "Usage: ipkg-make-index <package_directory>" >&2
+ exit 1
+fi
+
+which md5sum >/dev/null 2>&1 || alias md5sum=md5
+
+for pkg in `find $pkg_dir -name '*.ipk' | sort`; do
+ name="${pkg##*/}"
+ name="${name%%_*}"
+ [[ "$name" = "kernel" ]] && continue
+ [[ "$name" = "libc" ]] && continue
+ echo "Generating index for package $pkg" >&2
+ file_size=$(ls -l $pkg | awk '{print $5}')
+ md5sum=$(md5sum $pkg | awk '{print $1}')
+ # Take pains to make variable value sed-safe
+ sed_safe_pkg=`echo $pkg | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g'`
+ tar -xzOf $pkg ./control.tar.gz | tar xzOf - ./control | sed -e "s/^Description:/Filename: $sed_safe_pkg\\
+Size: $file_size\\
+MD5Sum: $md5sum\\
+Description:/"
+ echo ""
+done
diff --git a/scripts/.svn/text-base/ipkg.svn-base b/scripts/.svn/text-base/ipkg.svn-base
new file mode 100644
index 0000000..57fe9dd
--- /dev/null
+++ b/scripts/.svn/text-base/ipkg.svn-base
@@ -0,0 +1,1183 @@
+#!/bin/sh
+# ipkg - the itsy package management system
+#
+# Copyright (C) 2001 Carl D. Worth
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+set -e
+
+# By default do not do globbing. Any command wanting globbing should
+# explicitly enable it first and disable it afterwards.
+set -o noglob
+
+ipkg_is_upgrade () {
+ local A B a b
+ A=$(echo $1 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g").
+ B=$(echo $2 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g").
+ while [ \! -z "$A" ] && [ \! -z "$B" ]; do {
+ set $A; a=$1; shift; A=$*
+ set $B; b=$1; shift; B=$*
+ [ "$a" -lt "$b" ] 2>&- && return 1
+ { [ "$a" -gt "$b" ] 2>&- || [ "$a" ">" "$b" ]; } && return
+ }; done
+ return 1
+}
+
+which md5sum 2>&1 >/dev/null || alias md5sum=md5
+
+ipkg_srcs() {
+ local srcre="$1"
+ sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
+}
+
+ipkg_src_names() {
+ sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
+}
+
+ipkg_src_byname() {
+ local src="$1"
+ ipkg_srcs $src | head -n 1
+}
+
+ipkg_dests() {
+ local destre="`echo $1 | ipkg_protect_slashes`"
+ sed -ne "/^dest[[:space:]]\+$destre/{
+s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
+s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
+p
+}" < $IPKG_CONF
+}
+
+ipkg_dest_names() {
+ sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
+}
+
+ipkg_dests_all() {
+ ipkg_dests '.*'
+}
+
+ipkg_state_dirs() {
+ ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
+}
+
+ipkg_dest_default() {
+ ipkg_dests_all | head -n 1
+}
+
+ipkg_dest_default_name() {
+ ipkg_dest_names | head -n 1
+}
+
+ipkg_dest_byname() {
+ local dest="$1"
+ ipkg_dests $dest | head -n 1
+}
+
+ipkg_option() {
+ local option="$1"
+ sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
+}
+
+ipkg_load_configuration() {
+ if [ -z "$IPKG_CONF_DIR" ]; then
+ IPKG_CONF_DIR=/etc
+ fi
+
+ IPKG_CONF="$IPKG_CONF_DIR/ipkg.conf"
+
+ if [ -z "$IPKG_OFFLINE_ROOT" ]; then
+ IPKG_OFFLINE_ROOT="`ipkg_option offline_root`"
+ fi
+ # Export IPKG_OFFLINE_ROOT for use by update-alternatives
+ export IPKG_OFFLINE_ROOT
+ if [ -n "$DEST_NAME" ]; then
+ IPKG_ROOT="`ipkg_dest_byname $DEST_NAME`"
+ if [ -z "$IPKG_ROOT" ]; then
+ if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
+ IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
+ else
+ echo "ipkg: invalid destination specification: $DEST_NAME
+Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
+ ipkg_dest_names >&2
+ return 1
+ fi
+ fi
+ else
+ IPKG_ROOT="`ipkg_dest_default`"
+ fi
+
+ # Global ipkg state directories
+ IPKG_DIR_PREFIX=usr/lib/opkg
+ IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
+ IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
+ if [ -z "$IPKG_TMP" ]; then
+ IPKG_TMP=$IPKG_ROOT/tmp/ipkg
+ fi
+
+ [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
+
+ # Destination specific ipkg meta-data directory
+ IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
+
+ # Proxy Support
+ IPKG_PROXY_USERNAME="`ipkg_option proxy_username`"
+ IPKG_PROXY_PASSWORD="`ipkg_option proxy_password`"
+ IPKG_HTTP_PROXY="`ipkg_option http_proxy`"
+ IPKG_FTP_PROXY="`ipkg_option ftp_proxy`"
+ IPKG_NO_PROXY="`ipkg_option no_proxy`"
+ if [ -n "$IPKG_HTTP_PROXY" ]; then
+ export http_proxy="$IPKG_HTTP_PROXY"
+ fi
+
+ if [ -n "$IPKG_FTP_PROXY" ]; then
+ export ftp_proxy="$IPKG_FTP_PROXY"
+ fi
+
+ if [ -n "$IPKG_NO_PROXY" ]; then
+ export no_proxy="$IPKG_NO_PROXY"
+ fi
+
+ IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\|Architecture\)'
+}
+
+ipkg_usage() {
+ [ $# -gt 0 ] && echo "ipkg: $*"
+ echo "
+usage: ipkg [options...] sub-command [arguments...]
+where sub-command is one of:
+
+Package Manipulation:
+ update Update list of available packages
+ upgrade Upgrade all installed packages to latest version
+ install <pkg> Download and install <pkg> (and dependencies)
+ install <file.ipk> Install package <file.ipk>
+ install <file.deb> Install package <file.deb>
+ remove <pkg> Remove package <pkg>
+
+Informational Commands:
+ list List available packages and descriptions
+ files <pkg> List all files belonging to <pkg>
+ search <file> Search for a packaging providing <file>
+ info [pkg [<field>]] Display all/some info fields for <pkg> or all
+ status [pkg [<field>]] Display all/some status fields for <pkg> or all
+ depends <pkg> Print uninstalled package dependencies for <pkg>
+
+Options:
+ -d <dest_name> Use <dest_name> as the the root directory for
+ -dest <dest_name> package installation, removal, upgrading.
+ <dest_name> should be a defined dest name from the
+ configuration file, (but can also be a directory
+ name in a pinch).
+ -o <offline_root> Use <offline_root> as the root for offline installation.
+ -offline <offline_root>
+
+Force Options (use when ipkg is too smart for its own good):
+ -force-depends Make dependency checks warnings instead of errors
+ -force-defaults Use default options for questions asked by ipkg.
+ (no prompts). Note that this will not prevent
+ package installation scripts from prompting.
+" >&2
+ exit 1
+}
+
+ipkg_dir_part() {
+ local dir="`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`"
+ if [ -z "$dir" ]; then
+ dir="./"
+ fi
+ echo $dir
+}
+
+ipkg_file_part() {
+ echo $1 | sed 's/.*\///'
+}
+
+ipkg_protect_slashes() {
+ sed -e 's/\//\\\//g'
+}
+
+ipkg_download() {
+ local src="$1"
+ local dest="$2"
+
+ local src_file="`ipkg_file_part $src`"
+ local dest_dir="`ipkg_dir_part $dest`"
+ if [ -z "$dest_dir" ]; then
+ dest_dir="$IPKG_TMP"
+ fi
+
+ local dest_file="`ipkg_file_part $dest`"
+ if [ -z "$dest_file" ]; then
+ dest_file="$src_file"
+ fi
+
+ # Proxy support
+ local proxyuser=""
+ local proxypassword=""
+ local proxyoption=""
+
+ if [ -n "$IPKG_PROXY_USERNAME" ]; then
+ proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
+ proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
+ fi
+
+ if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
+ proxyoption="--proxy=on"
+ fi
+
+ rm -f $IPKG_TMP/$src_file
+ case "$src" in
+ http://* | ftp://*)
+ if ! wget --passive-ftp $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
+ echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err" >&2
+ return 1
+ fi
+ mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
+ ;;
+ file:/* )
+ ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
+ ;;
+ *)
+ echo "DEBUG: $src"
+ ;;
+ esac
+
+ return 0
+}
+
+ipkg_update() {
+ if [ ! -e "$IPKG_LISTS_DIR" ]; then
+ mkdir -p $IPKG_LISTS_DIR
+ fi
+
+ local err=
+ for src_name in `ipkg_src_names`; do
+ local src="`ipkg_src_byname $src_name`"
+ if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
+ echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
+ err=t
+ else
+ echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
+ fi
+ done
+
+ [ -n "$err" ] && return 1
+
+ return 0
+}
+
+ipkg_list() {
+ for src in `ipkg_src_names`; do
+ if ipkg_require_list $src; then
+# black magic...
+sed -ne "
+/^Package:/{
+s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
+h
+}
+/^Description:/{
+s/^Description:[[:space:]]*\(.*\)/\1/
+H
+g
+s/\\
+/ - /
+p
+}
+" $IPKG_LISTS_DIR/$src
+ fi
+ done
+}
+
+ipkg_extract_paragraph() {
+ local pkg="$1"
+ sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
+}
+
+ipkg_extract_field() {
+ local field="$1"
+# blacker magic...
+ sed -ne "
+: TOP
+/^$field:/{
+p
+n
+b FIELD
+}
+d
+: FIELD
+/^$/b TOP
+/^[^[:space:]]/b TOP
+p
+n
+b FIELD
+"
+}
+
+ipkg_extract_value() {
+ sed -e "s/^[^:]*:[[:space:]]*//"
+}
+
+ipkg_require_list() {
+ [ $# -lt 1 ] && return 1
+ local src="$1"
+ if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
+ echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
+ echo " You probably want to run \`ipkg update'" >&2
+ return 1
+ fi
+ return 0
+}
+
+ipkg_info() {
+ for src in `ipkg_src_names`; do
+ if ipkg_require_list $src; then
+ case $# in
+ 0)
+ cat $IPKG_LISTS_DIR/$src
+ ;;
+ 1)
+ ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
+ ;;
+ *)
+ ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
+ ;;
+ esac
+ fi
+ done
+}
+
+ipkg_status_sd() {
+ [ $# -lt 1 ] && return 0
+ sd="$1"
+ shift
+ if [ -f $sd/status ]; then
+ case $# in
+ 0)
+ cat $sd/status
+ ;;
+ 1)
+ ipkg_extract_paragraph $1 < $sd/status
+ ;;
+ *)
+ ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
+ ;;
+ esac
+ fi
+ return 0
+}
+
+ipkg_status_all() {
+ for sd in `ipkg_state_dirs`; do
+ ipkg_status_sd $sd $*
+ done
+}
+
+ipkg_status() {
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_status_sd $IPKG_STATE_DIR $*
+ else
+ ipkg_status_all $*
+ fi
+}
+
+ipkg_status_matching_sd() {
+ local sd="$1"
+ local re="$2"
+ if [ -f $sd/status ]; then
+ sed -ne "
+: TOP
+/^Package:/{
+s/^Package:[[:space:]]*//
+s/[[:space:]]*$//
+h
+}
+/$re/{
+g
+p
+b NEXT
+}
+d
+: NEXT
+/^$/b TOP
+n
+b NEXT
+" < $sd/status
+ fi
+ return 0
+}
+
+ipkg_status_matching_all() {
+ for sd in `ipkg_state_dirs`; do
+ ipkg_status_matching_sd $sd $*
+ done
+}
+
+ipkg_status_matching() {
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_status_matching_sd $IPKG_STATE_DIR $*
+ else
+ ipkg_status_matching_all $*
+ fi
+}
+
+ipkg_status_installed_sd() {
+ local sd="$1"
+ local pkg="$2"
+ ipkg_status_sd $sd $pkg Status | grep -q "Status: install ok installed"
+}
+
+ipkg_status_installed_all() {
+ local ret=1
+ for sd in `ipkg_state_dirs`; do
+ if `ipkg_status_installed_sd $sd $*`; then
+ ret=0
+ fi
+ done
+ return $ret
+}
+
+ipkg_status_mentioned_sd() {
+ local sd="$1"
+ local pkg="$2"
+ [ -n "`ipkg_status_sd $sd $pkg Status`" ]
+}
+
+ipkg_files() {
+ local pkg="$1"
+ if [ -n "$DEST_NAME" ]; then
+ dests=$IPKG_ROOT
+ else
+ dests="`ipkg_dests_all`"
+ fi
+ for dest in $dests; do
+ if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
+ dest_sed="`echo $dest | ipkg_protect_slashes`"
+ sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
+ fi
+ done
+}
+
+ipkg_search() {
+ local pattern="$1"
+
+ for dest_name in `ipkg_dest_names`; do
+ dest="`ipkg_dest_byname $dest_name`"
+ dest_sed="`echo $dest | ipkg_protect_slashes`"
+
+ set +o noglob
+ local list_files="`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`"
+ set -o noglob
+ for file in $list_files; do
+ if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
+ local pkg="`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`"
+ [ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)"
+ sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
+ fi
+ done
+ done
+}
+
+ipkg_status_remove_sd() {
+ local sd="$1"
+ local pkg="$2"
+
+ if [ ! -f $sd/status ]; then
+ mkdir -p $sd
+ touch $sd/status
+ fi
+ sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
+ mv $sd/status.new $sd/status
+}
+
+ipkg_status_remove_all() {
+ for sd in `ipkg_state_dirs`; do
+ ipkg_status_remove_sd $sd $*
+ done
+}
+
+ipkg_status_remove() {
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_status_remove_sd $IPKG_STATE_DIR $*
+ else
+ ipkg_status_remove_all $*
+ fi
+}
+
+ipkg_status_update_sd() {
+ local sd="$1"
+ local pkg="$2"
+
+ ipkg_status_remove_sd $sd $pkg
+ ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
+ echo "" >> $sd/status
+}
+
+ipkg_status_update() {
+ ipkg_status_update_sd $IPKG_STATE_DIR $*
+}
+
+ipkg_unsatisfied_dependences() {
+ local pkg=$1
+ local deps="`ipkg_get_depends $pkg`"
+ local remaining_deps=
+ for dep in $deps; do
+ local installed="`ipkg_get_installed $dep`"
+ if [ "$installed" != "installed" ] ; then
+ remaining_deps="$remaining_deps $dep"
+ fi
+ done
+ ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
+ echo $remaining_deps
+}
+
+ipkg_safe_pkg_name() {
+ local pkg=$1
+ local spkg="`echo pkg_$pkg | sed -e y/-+./___/`"
+ echo $spkg
+}
+
+ipkg_set_depends() {
+ local pkg=$1; shift
+ local new_deps="$*"
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ ## setvar ${pkg}_depends "$new_deps"
+ echo $new_deps > $IPKG_TMP/${pkg}.depends
+}
+
+ipkg_get_depends() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ cat $IPKG_TMP/${pkg}.depends
+ ## eval "echo \$${pkg}_depends"
+}
+
+ipkg_set_installed() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ echo installed > $IPKG_TMP/${pkg}.installed
+ ## setvar ${pkg}_installed "installed"
+}
+
+ipkg_set_uninstalled() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ ### echo ipkg_set_uninstalled $pkg > /dev/console
+ echo uninstalled > $IPKG_TMP/${pkg}.installed
+ ## setvar ${pkg}_installed "uninstalled"
+}
+
+ipkg_get_installed() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ if [ -f $IPKG_TMP/${pkg}.installed ]; then
+ cat $IPKG_TMP/${pkg}.installed
+ fi
+ ## eval "echo \$${pkg}_installed"
+}
+
+ipkg_depends() {
+ local new_pkgs="$*"
+ local all_deps=
+ local installed_pkgs="`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`"
+ for pkg in $installed_pkgs; do
+ ipkg_set_installed $pkg
+ done
+ while [ -n "$new_pkgs" ]; do
+ all_deps="$all_deps $new_pkgs"
+ local new_deps=
+ for pkg in $new_pkgs; do
+ if echo $pkg | grep -q '[^A-Za-z0-9.+-]'; then
+ echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [A-Za-z0-9.+-])" >&2
+ return 1
+ fi
+ # TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
+ new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
+s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
+s/,/ /g
+s/ \+/ /g'`
+ ipkg_set_depends $pkg $new_deps
+ done
+
+ new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\n/g' | sort | uniq`
+
+ local maybe_new_pkgs=
+ for pkg in $new_deps; do
+ if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
+ maybe_new_pkgs="$maybe_new_pkgs $pkg"
+ fi
+ done
+
+ new_pkgs=
+ for pkg in $maybe_new_pkgs; do
+ if ! echo $all_deps | grep -q "\<$pkg\>"; then
+ if [ -z "`ipkg_info $pkg`" ]; then
+ echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
+ ipkg_set_installed $pkg
+ else
+ new_pkgs="$new_pkgs $pkg"
+ ipkg_set_uninstalled $pkg
+ fi
+ else
+ ipkg_set_uninstalled $pkg
+ fi
+ done
+ done
+
+ echo $all_deps
+}
+
+ipkg_get_install_dest() {
+ local dest="$1"
+ shift
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local info_dir=$sd/info
+
+ local requested_pkgs="$*"
+ local pkgs="`ipkg_depends $*`"
+
+ mkdir -p $info_dir
+ for pkg in $pkgs; do
+ if ! ipkg_status_mentioned_sd $sd $pkg; then
+ echo "Package: $pkg
+Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
+ fi
+ done
+ ## mark the packages that we were directly requested to install as uninstalled
+ for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
+
+ local new_pkgs=
+ local pkgs_installed=0
+ while [ -n "pkgs" ]; do
+ curcheck=0
+ ## echo "pkgs to install: {$pkgs}" > /dev/console
+ for pkg in $pkgs; do
+ curcheck="`expr $curcheck + 1`"
+ local is_installed="`ipkg_get_installed $pkg`"
+ if [ "$is_installed" = "installed" ]; then
+ echo "$pkg is installed"
+ continue
+ fi
+
+ local remaining_deps="`ipkg_unsatisfied_dependences $pkg`"
+ if [ -n "$remaining_deps" ]; then
+ new_pkgs="$new_pkgs $pkg"
+ ### echo "Dependences not satisfied for $pkg: $remaining_deps"
+ if [ $curcheck -ne `echo $pkgs|wc -w` ]; then
+ continue
+ fi
+ fi
+
+ local filename=
+ for src in `ipkg_src_names`; do
+ if ipkg_require_list $src; then
+ filename="`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`"
+ [ -n "$filename" ] && break
+ fi
+ done
+
+ if [ -z "$filename" ]; then
+ echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR" >&2
+ echo "ipkg_get_install: Check the spelling and maybe run \`ipkg update'." >&2
+ ipkg_status_remove_sd $sd $pkg
+ return 1;
+ fi
+
+ local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
+ if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
+ echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
+ return 1
+ fi
+
+ if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
+ echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file" >&2
+ echo "ipkg_get_install: I'll leave it there for you to try a manual installation" >&2
+ return 1
+ fi
+
+ ipkg_set_installed $pkg
+ pkgs_installed="`expr $pkgs_installed + 1`"
+ rm $tmp_pkg_file
+ done
+ ### echo "Installed $pkgs_installed package(s) this round"
+ if [ $pkgs_installed -eq 0 ]; then
+ if [ -z "$new_pkgs" ]; then
+ break
+ fi
+ fi
+ pkgs_installed=0
+ pkgs="$new_pkgs"
+ new_pkgs=
+ curcheck=0
+ done
+}
+
+ipkg_get_install() {
+ ipkg_get_install_dest $IPKG_ROOT $*
+}
+
+ipkg_install_file_dest() {
+ local dest="$1"
+ local filename="$2"
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local info_dir=$sd/info
+
+ if [ ! -f "$filename" ]; then
+ echo "ipkg_install_file: ERROR: File $filename not found" >&2
+ return 1
+ fi
+
+ local pkg="`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`"
+ local ext="`echo $filename | sed 's/.*\.//'`"
+ local pkg_extract_stdout
+ if [ "$ext" = "ipk" ]; then
+ pkg_extract_stdout="tar -xzOf"
+ elif [ "$ext" = "deb" ]; then
+ pkg_extract_stdout="ar p"
+ else
+ echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)" >&2
+ return 1
+ fi
+
+ # Check dependencies
+ local depends="`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`"
+
+ # Don't worry about deps that are scheduled for installation
+ local missing_deps=
+ for dep in $depends; do
+ if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
+ missing_deps="$missing_deps $dep"
+ fi
+ done
+
+ if [ ! -z "$missing_deps" ]; then
+ if [ -n "$FORCE_DEPENDS" ]; then
+ echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps" >&2
+ else
+ echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
+ $missing_deps" >&2
+ echo "ipkg_install_file: You may want to use \`ipkg install' to install these." >&2
+ return 1
+ fi
+ fi
+
+ mkdir -p $IPKG_TMP/$pkg/control
+ mkdir -p $IPKG_TMP/$pkg/data
+ mkdir -p $info_dir
+
+ if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; zcat | tar -xf - ) ; then
+ echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename" >&2
+ return 1
+ fi
+
+ if [ -n "$IPKG_OFFLINE_ROOT" ]; then
+ if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
+ echo "*** Warning: Package $pkg may not be installed in offline mode" >&2
+ echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)" >&2
+ echo "Package: $pkg
+Status: install ok pending" | ipkg_status_update_sd $sd $pkg
+ mkdir -p $IPKG_PENDING_DIR
+ cp -f $filename $IPKG_PENDING_DIR
+ rm -r $IPKG_TMP/$pkg/control
+ rm -r $IPKG_TMP/$pkg/data
+ rmdir $IPKG_TMP/$pkg
+ return 0
+ fi
+ fi
+
+
+ printf "Unpacking $pkg..."
+ set +o noglob
+ for file in $IPKG_TMP/$pkg/control/*; do
+ local base_file="`ipkg_file_part $file`"
+ mv $file $info_dir/$pkg.$base_file
+ done
+ set -o noglob
+ rm -r $IPKG_TMP/$pkg/control
+
+ if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; zcat | tar -xf - ) ; then
+ echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename" >&2
+ return 1
+ fi
+ echo "Done."
+
+ printf "Configuring $pkg..."
+ export PKG_ROOT=$dest
+ if [ -x "$info_dir/$pkg.preinst" ]; then
+ if ! $info_dir/$pkg.preinst install; then
+ echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
+ rm -rf $IPKG_TMP/$pkg/data
+ rmdir $IPKG_TMP/$pkg
+ return 1
+ fi
+ fi
+
+ local old_conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
+ local new_conffiles=
+ if [ -f "$info_dir/$pkg.conffiles" ]; then
+ for conffile in `cat $info_dir/$pkg.conffiles`; do
+ if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
+ local use_maintainers_conffile=
+ if [ -z "$FORCE_DEFAULTS" ]; then
+ while true; do
+ printf "Configuration file \`$conffile'
+ ==> File on system created by you or by a script.
+ ==> File also in package provided by package maintainer.
+ What would you like to do about it ? Your options are:
+ Y or I : install the package maintainer's version
+ N or O : keep your currently-installed version
+ D : show the differences between the versions (if diff is installed)
+ The default action is to keep your current version.
+*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
+ read response
+ case "$response" in
+ [YyIi] | [Yy][Ee][Ss])
+ use_maintainers_conffile=t
+ break
+ ;;
+ [Dd])
+ echo "
+diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
+ diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
+ echo "[Press ENTER to continue]"
+ read junk
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ fi
+ if [ -n "$use_maintainers_conffile" ]; then
+ local md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
+ new_conffiles="$new_conffiles $conffile $md5sum"
+ else
+ new_conffiles="$new_conffiles $conffile <custom>"
+ rm $IPKG_TMP/$pkg/data/$conffile
+ fi
+ else
+ md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
+ new_conffiles="$new_conffiles $conffile $md5sum"
+ fi
+ done
+ fi
+
+ local owd="`pwd`"
+ (cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))
+ rm -rf $IPKG_TMP/$pkg/data
+ rmdir $IPKG_TMP/$pkg
+ rm -f $info_dir/$pkg.list
+ $pkg_extract_stdout $filename ./data.tar.gz | zcat | tar tf - | sed -e '/\/$/d; s/^\.//' > $info_dir/$pkg.list
+
+ if [ -x "$info_dir/$pkg.postinst" ]; then
+ $info_dir/$pkg.postinst configure
+ fi
+
+ if [ -n "$new_conffiles" ]; then
+ new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
+ fi
+ local sed_safe_offline_root="`echo ${IPKG_OFFLINE_ROOT} | ipkg_protect_slashes`"
+ local sed_safe_root="`echo $dest | sed -e "s/^${sed_safe_offline_root}//" | ipkg_protect_slashes`"
+ sed -e "s/\(Package:.*\)/\1\\
+Status: install ok installed\\
+Root: ${sed_safe_root}\\
+${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
+
+ rm -f $info_dir/$pkg.control
+ rm -f $info_dir/$pkg.conffiles
+ rm -f $info_dir/$pkg.preinst
+ rm -f $info_dir/$pkg.postinst
+
+ echo "Done."
+}
+
+ipkg_install_file() {
+ ipkg_install_file_dest $IPKG_ROOT $*
+}
+
+ipkg_install() {
+ while [ $# -gt 0 ]; do
+ local pkg="$1"
+ shift
+
+ case "$pkg" in
+ http://* | ftp://*)
+ local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
+ if ipkg_download $pkg $tmp_pkg_file; then
+ ipkg_install_file $tmp_pkg_file
+ rm $tmp_pkg_file
+ fi
+ ;;
+ file:/*.ipk | file://*.deb)
+ local ipkg_filename="`echo $pkg|sed 's/^file://'`"
+ ipkg_install_file $ipkg_filename
+ ;;
+ *.ipk | *.deb)
+ ipkg_install_file $pkg
+ ;;
+ *)
+ ipkg_get_install $pkg || true
+ ;;
+ esac
+ done
+}
+
+ipkg_install_pending() {
+ [ -n "$IPKG_OFFLINE_ROOT" ] && return 0
+
+ if [ -d "$IPKG_PENDING_DIR" ]; then
+ set +o noglob
+ local pending="`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null`" || true
+ set -o noglob
+ if [ -n "$pending" ]; then
+ echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
+ echo $pending
+ for filename in $pending; do
+ if ipkg_install_file $filename; then
+ rm $filename
+ fi
+ done
+ fi
+ fi
+ return 0
+}
+
+ipkg_install_wanted() {
+ local wanted="`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`"
+
+ if [ -n "$wanted" ]; then
+ echo "The following package were previously requested but have not been installed:"
+ echo $wanted
+
+ if [ -n "$FORCE_DEFAULTS" ]; then
+ echo "Installing them now."
+ else
+ printf "Install them now [Y/n] ? "
+ read response
+ case "$response" in
+ [Nn] | [Nn][Oo])
+ return 0
+ ;;
+ esac
+ fi
+
+ ipkg_install $wanted
+ fi
+
+ return 0
+}
+
+ipkg_upgrade_pkg() {
+ local pkg="$1"
+ local avail_ver="`ipkg_info $pkg Version | ipkg_extract_value | head -n 1`"
+
+ is_installed=
+ for dest_name in `ipkg_dest_names`; do
+ local dest="`ipkg_dest_byname $dest_name`"
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local inst_ver="`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`"
+ if [ -n "$inst_ver" ]; then
+ is_installed=t
+
+ if [ -z "$avail_ver" ]; then
+ echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
+ return 0
+ fi
+
+ if [ "$avail_ver" = "$inst_ver" ]; then
+ echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
+ elif ipkg_is_upgrade "$avail_ver" "$inst_ver"; then
+ echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
+ ipkg_get_install_dest $dest $pkg
+ else
+ echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
+ fi
+ fi
+ done
+
+ if [ -z "$is_installed" ]; then
+ echo "Package $pkg does not appear to be installed"
+ return 0
+ fi
+
+}
+
+ipkg_upgrade() {
+ if [ $# -lt 1 ]; then
+ local pkgs="`ipkg_status_matching 'Status:.*[[:space:]]installed'`"
+ else
+ pkgs="$*"
+ fi
+
+ for pkg in $pkgs; do
+ ipkg_upgrade_pkg $pkg
+ done
+}
+
+ipkg_remove_pkg_dest() {
+ local dest="$1"
+ local pkg="$2"
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local info_dir=$sd/info
+
+ if ! ipkg_status_installed_sd $sd $pkg; then
+ echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
+ if ipkg_status_mentioned_sd $sd $pkg; then
+ echo "Purging mention of $pkg from the ipkg database"
+ ipkg_status_remove_sd $sd $pkg
+ fi
+ return 1
+ fi
+
+ echo "ipkg_remove: Removing $pkg... "
+
+ local files="`cat $info_dir/$pkg.list`"
+
+ export PKG_ROOT=$dest
+ if [ -x "$info_dir/$pkg.prerm" ]; then
+ $info_dir/$pkg.prerm remove
+ fi
+
+ local conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
+
+ local dirs_to_remove=
+ for file in $files; do
+ if [ -d "$dest/$file" ]; then
+ dirs_to_remove="$dirs_to_remove $dest/$file"
+ else
+ if echo " $conffiles " | grep -q " $file "; then
+ if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
+ rm -f $dest/$file
+ fi
+ else
+ rm -f $dest/$file
+ fi
+ fi
+ done
+
+ local removed_a_dir=t
+ while [ -n "$removed_a_dir" ]; do
+ removed_a_dir=
+ local new_dirs_to_remove=
+ for dir in $dirs_to_remove; do
+ if rmdir $dir >/dev/null 2>&1; then
+ removed_a_dir=t
+ else
+ new_dirs_to_remove="$new_dirs_to_remove $dir"
+ fi
+ done
+ dirs_to_remove="$new_dirs_to_remove"
+ done
+
+ if [ -n "$dirs_to_remove" ]; then
+ echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
+ echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
+ fi
+
+ if [ -x "$info_dir/$pkg.postrm" ]; then
+ $info_dir/$pkg.postrm remove
+ fi
+
+ ipkg_status_remove_sd $sd $pkg
+ set +o noglob
+ rm -f $info_dir/$pkg.*
+ set -o noglob
+
+ echo "Done."
+}
+
+ipkg_remove_pkg() {
+ local pkg="$1"
+ for dest in `ipkg_dests_all`; do
+ local sd=$dest/$IPKG_DIR_PREFIX
+ if ipkg_status_mentioned_sd $sd $pkg; then
+ ipkg_remove_pkg_dest $dest $pkg
+ fi
+ done
+}
+
+ipkg_remove() {
+ while [ $# -gt 0 ]; do
+ local pkg="$1"
+ shift
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_remove_pkg_dest $IPKG_ROOT $pkg
+ else
+ ipkg_remove_pkg $pkg
+ fi
+ done
+}
+
+###########
+# ipkg main
+###########
+
+# Parse options
+while [ $# -gt 0 ]; do
+ arg="$1"
+ case $arg in
+ -d | -dest)
+ [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+ DEST_NAME="$2"
+ shift
+ ;;
+ -o | -offline)
+ [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+ IPKG_OFFLINE_ROOT="$2"
+ shift
+ ;;
+ -force-depends)
+ FORCE_DEPENDS=t
+ ;;
+ -force-defaults)
+ FORCE_DEFAULTS=t
+ ;;
+ -*)
+ ipkg_usage "unknown option $arg"
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+[ $# -lt 1 ] && ipkg_usage "ipkg must have one sub-command argument"
+cmd="$1"
+shift
+
+ipkg_load_configuration
+mkdir -p /tmp/ipkg
+
+case "$cmd" in
+update|upgrade|list|info|status|install_pending)
+ ;;
+install|depends|remove|files|search)
+ [ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument" >&2
+ ;;
+*)
+ echo "ERROR: unknown sub-command \`$cmd'" >&2
+ ipkg_usage
+ ;;
+esac
+
+# Only install pending if we have an interactive sub-command
+case "$cmd" in
+upgrade|install)
+ ipkg_install_pending
+ ipkg_install_wanted
+ ;;
+esac
+
+ipkg_$cmd $*
+for a in `ls $IPKG_TMP`; do
+ rm -rf $IPKG_TMP/$a
+done
diff --git a/scripts/.svn/text-base/kconfig.pl.svn-base b/scripts/.svn/text-base/kconfig.pl.svn-base
new file mode 100644
index 0000000..b91cdf3
--- /dev/null
+++ b/scripts/.svn/text-base/kconfig.pl.svn-base
@@ -0,0 +1,182 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+use warnings;
+use strict;
+
+my @arg;
+my $PREFIX = "CONFIG_";
+
+sub set_config($$$$) {
+ my $config = shift;
+ my $idx = shift;
+ my $newval = shift;
+ my $mod_plus = shift;
+
+ if (!defined($config->{$idx}) or !$mod_plus or
+ $config->{$idx} eq '#undef' or $newval eq 'y') {
+ $config->{$idx} = $newval;
+ }
+}
+
+sub load_config($$) {
+ my $file = shift;
+ my $mod_plus = shift;
+ my %config;
+
+ open FILE, "$file" or die "can't open file";
+ while (<FILE>) {
+ chomp;
+ /^$PREFIX(.+?)=(.+)/ and do {
+ set_config(\%config, $1, $2, $mod_plus);
+ next;
+ };
+ /^# $PREFIX(.+?) is not set/ and do {
+ set_config(\%config, $1, "#undef", $mod_plus);
+ next;
+ };
+ /^#/ and next;
+ /^(.+)$/ and warn "WARNING: can't parse line: $1\n";
+ }
+ return \%config;
+}
+
+
+sub config_and($$) {
+ my $cfg1 = shift;
+ my $cfg2 = shift;
+ my %config;
+
+ foreach my $config (keys %$cfg1) {
+ my $val1 = $cfg1->{$config};
+ my $val2 = $cfg2->{$config};
+ $val2 and ($val1 eq $val2) and do {
+ $config{$config} = $val1;
+ };
+ }
+ return \%config;
+}
+
+
+sub config_add($$$) {
+ my $cfg1 = shift;
+ my $cfg2 = shift;
+ my $mod_plus = shift;
+ my %config;
+
+ for ($cfg1, $cfg2) {
+ my %cfg = %$_;
+
+ foreach my $config (keys %cfg) {
+ if ($mod_plus and $config{$config}) {
+ next if $config{$config} eq "y";
+ next if $cfg{$config} eq '#undef';
+ }
+ $config{$config} = $cfg{$config};
+ }
+ }
+ return \%config;
+}
+
+sub config_diff($$$) {
+ my $cfg1 = shift;
+ my $cfg2 = shift;
+ my $new_only = shift;
+ my %config;
+
+ foreach my $config (keys %$cfg2) {
+ if (!defined($cfg1->{$config}) or $cfg1->{$config} ne $cfg2->{$config}) {
+ next if $new_only and !defined($cfg1->{$config}) and $cfg2->{$config} eq '#undef';
+ $config{$config} = $cfg2->{$config};
+ }
+ }
+ return \%config
+}
+
+sub config_sub($$) {
+ my $cfg1 = shift;
+ my $cfg2 = shift;
+ my %config = %{$cfg1};
+
+ foreach my $config (keys %$cfg2) {
+ delete $config{$config};
+ }
+ return \%config;
+}
+
+sub print_cfgline($$) {
+ my $name = shift;
+ my $val = shift;
+ if ($val eq '#undef' or $val eq 'n') {
+ print "# $PREFIX$name is not set\n";
+ } else {
+ print "$PREFIX$name=$val\n";
+ }
+}
+
+
+sub dump_config($) {
+ my $cfg = shift;
+ die "argument error in dump_config" unless ($cfg);
+ my %config = %$cfg;
+ foreach my $config (sort keys %config) {
+ print_cfgline($config, $config{$config});
+ }
+}
+
+sub parse_expr {
+ my $pos = shift;
+ my $mod_plus = shift;
+ my $arg = $arg[$$pos++];
+
+ die "Parse error" if (!$arg);
+
+ if ($arg eq '&') {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos);
+ return config_and($arg1, $arg2);
+ } elsif ($arg =~ /^\+/) {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos);
+ return config_add($arg1, $arg2, 0);
+ } elsif ($arg =~ /^m\+/) {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos, 1);
+ return config_add($arg1, $arg2, 1);
+ } elsif ($arg eq '>') {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos);
+ return config_diff($arg1, $arg2, 0);
+ } elsif ($arg eq '>+') {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos);
+ return config_diff($arg1, $arg2, 1);
+ } elsif ($arg eq '-') {
+ my $arg1 = parse_expr($pos);
+ my $arg2 = parse_expr($pos);
+ return config_sub($arg1, $arg2);
+ } else {
+ return load_config($arg, $mod_plus);
+ }
+}
+
+while (@ARGV > 0 and $ARGV[0] =~ /^-\w+$/) {
+ my $cmd = shift @ARGV;
+ if ($cmd =~ /^-n$/) {
+ $PREFIX = "";
+ } elsif ($cmd =~ /^-p$/) {
+ $PREFIX = shift @ARGV;
+ } else {
+ die "Invalid option: $cmd\n";
+ }
+}
+@arg = @ARGV;
+
+my $pos = 0;
+dump_config(parse_expr(\$pos));
+die "Parse error" if ($arg[$pos]);
diff --git a/scripts/.svn/text-base/make-ipkg-dir.sh.svn-base b/scripts/.svn/text-base/make-ipkg-dir.sh.svn-base
new file mode 100644
index 0000000..902a4b5
--- /dev/null
+++ b/scripts/.svn/text-base/make-ipkg-dir.sh.svn-base
@@ -0,0 +1,21 @@
+#!/bin/sh
+BASE=http://svn.openwrt.org/openwrt/trunk/openwrt
+TARGET=$1
+CONTROL=$2
+VERSION=$3
+ARCH=$4
+
+WD=$(pwd)
+
+mkdir -p "$TARGET/CONTROL"
+grep '^[^(Version|Architecture)]' "$CONTROL" > "$TARGET/CONTROL/control"
+grep '^Maintainer' "$CONTROL" 2>&1 >/dev/null || \
+ echo "Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>" >> "$TARGET/CONTROL/control"
+grep '^Source' "$CONTROL" 2>&1 >/dev/null || {
+ pkgbase=$(echo "$WD" | sed -e "s|^$TOPDIR/||g")
+ [ "$pkgbase" = "$WD" ] && src="N/A" || src="$BASE/$pkgbase"
+ echo "Source: $src" >> "$TARGET/CONTROL/control"
+}
+echo "Version: $VERSION" >> "$TARGET/CONTROL/control"
+echo "Architecture: $ARCH" >> "$TARGET/CONTROL/control"
+chmod 644 "$TARGET/CONTROL/control"
diff --git a/scripts/.svn/text-base/md5sum.svn-base b/scripts/.svn/text-base/md5sum.svn-base
new file mode 100644
index 0000000..a5779c4
--- /dev/null
+++ b/scripts/.svn/text-base/md5sum.svn-base
@@ -0,0 +1,2 @@
+#!/bin/sh
+cat "$@" | md5
diff --git a/scripts/.svn/text-base/metadata.pl.svn-base b/scripts/.svn/text-base/metadata.pl.svn-base
new file mode 100644
index 0000000..b04cd8c
--- /dev/null
+++ b/scripts/.svn/text-base/metadata.pl.svn-base
@@ -0,0 +1,844 @@
+#!/usr/bin/env perl
+use FindBin;
+use lib "$FindBin::Bin";
+use strict;
+use metadata;
+
+my %board;
+
+sub confstr($) {
+ my $conf = shift;
+ $conf =~ tr#/\.\-/#___#;
+ return $conf;
+}
+
+sub parse_target_metadata() {
+ my $file = shift @ARGV;
+ my ($target, @target, $profile);
+ my %target;
+
+ open FILE, "<$file" or do {
+ warn "Can't open file '$file': $!\n";
+ return;
+ };
+ while (<FILE>) {
+ chomp;
+ /^Target:\s*(.+)\s*$/ and do {
+ my $name = $1;
+ $target = {
+ id => $name,
+ board => $name,
+ boardconf => confstr($name),
+ conf => confstr($name),
+ profiles => [],
+ features => [],
+ depends => [],
+ subtargets => []
+ };
+ push @target, $target;
+ $target{$name} = $target;
+ if ($name =~ /([^\/]+)\/([^\/]+)/) {
+ push @{$target{$1}->{subtargets}}, $2;
+ $target->{board} = $1;
+ $target->{boardconf} = confstr($1);
+ $target->{subtarget} = 1;
+ $target->{parent} = $target{$1};
+ }
+ };
+ /^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
+ /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
+ /^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1;
+ /^Target-Arch-Packages:\s*(.+)\s*$/ and $target->{arch_packages} = $1;
+ /^Target-Features:\s*(.+)\s*$/ and $target->{features} = [ split(/\s+/, $1) ];
+ /^Target-Depends:\s*(.+)\s*$/ and $target->{depends} = [ split(/\s+/, $1) ];
+ /^Target-Description:/ and $target->{desc} = get_multiline(*FILE);
+ /^Target-Optimization:\s*(.+)\s*$/ and $target->{cflags} = $1;
+ /^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1;
+ /^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1;
+ /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
+ /^Default-Subtarget:\s*(.+)\s*$/ and $target->{def_subtarget} = $1;
+ /^Default-Packages:\s*(.+)\s*$/ and $target->{packages} = [ split(/\s+/, $1) ];
+ /^Target-Profile:\s*(.+)\s*$/ and do {
+ $profile = {
+ id => $1,
+ name => $1,
+ packages => []
+ };
+ push @{$target->{profiles}}, $profile;
+ };
+ /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
+ /^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ];
+ /^Target-Profile-Description:\s*(.*)\s*/ and $profile->{desc} = get_multiline(*FILE);
+ /^Target-Profile-Config:/ and $profile->{config} = get_multiline(*FILE, "\t");
+ /^Target-Profile-Kconfig:/ and $profile->{kconfig} = 1;
+ }
+ close FILE;
+ foreach my $target (@target) {
+ next if @{$target->{subtargets}} > 0;
+ @{$target->{profiles}} > 0 or $target->{profiles} = [
+ {
+ id => 'Default',
+ name => 'Default',
+ packages => []
+ }
+ ];
+ }
+ return @target;
+}
+
+sub gen_kconfig_overrides() {
+ my %config;
+ my %kconfig;
+ my $package;
+ my $pkginfo = shift @ARGV;
+ my $cfgfile = shift @ARGV;
+
+ # parameter 2: build system config
+ open FILE, "<$cfgfile" or return;
+ while (<FILE>) {
+ /^(CONFIG_.+?)=(.+)$/ and $config{$1} = 1;
+ }
+ close FILE;
+
+ # parameter 1: package metadata
+ open FILE, "<$pkginfo" or return;
+ while (<FILE>) {
+ /^Package:\s*(.+?)\s*$/ and $package = $1;
+ /^Kernel-Config:\s*(.+?)\s*$/ and do {
+ my @config = split /\s+/, $1;
+ foreach my $config (@config) {
+ my $val = 'm';
+ my $override;
+ if ($config =~ /^(.+?)=(.+)$/) {
+ $config = $1;
+ $override = 1;
+ $val = $2;
+ }
+ if ($config{"CONFIG_PACKAGE_$package"} and ($config ne 'n')) {
+ next if $kconfig{$config} eq 'y';
+ $kconfig{$config} = $val;
+ } elsif (!$override) {
+ $kconfig{$config} or $kconfig{$config} = 'n';
+ }
+ }
+ };
+ };
+ close FILE;
+
+ foreach my $kconfig (sort keys %kconfig) {
+ if ($kconfig{$kconfig} eq 'n') {
+ print "# $kconfig is not set\n";
+ } else {
+ print "$kconfig=$kconfig{$kconfig}\n";
+ }
+ }
+}
+
+sub merge_package_lists($$) {
+ my $list1 = shift;
+ my $list2 = shift;
+ my @l = ();
+ my %pkgs;
+
+ foreach my $pkg (@$list1, @$list2) {
+ $pkgs{$pkg} = 1;
+ }
+ foreach my $pkg (keys %pkgs) {
+ push @l, $pkg unless ($pkg =~ /^-/ or $pkgs{"-$pkg"});
+ }
+ return sort(@l);
+}
+
+sub target_config_features(@) {
+ my $ret;
+
+ while ($_ = shift @_) {
+ /broken/ and $ret .= "\tdepends BROKEN\n";
+ /audio/ and $ret .= "\tselect AUDIO_SUPPORT\n";
+ /display/ and $ret .= "\tselect DISPLAY_SUPPORT\n";
+ /gpio/ and $ret .= "\tselect GPIO_SUPPORT\n";
+ /pci/ and $ret .= "\tselect PCI_SUPPORT\n";
+ /pcie/ and $ret .= "\tselect PCIE_SUPPORT\n";
+ /usb/ and $ret .= "\tselect USB_SUPPORT\n";
+ /usbgadget/ and $ret .= "\tselect USB_GADGET_SUPPORT\n";
+ /pcmcia/ and $ret .= "\tselect PCMCIA_SUPPORT\n";
+ /rtc/ and $ret .= "\tselect RTC_SUPPORT\n";
+ /squashfs/ and $ret .= "\tselect USES_SQUASHFS\n";
+ /jffs2/ and $ret .= "\tselect USES_JFFS2\n";
+ /ext4/ and $ret .= "\tselect USES_EXT4\n";
+ /targz/ and $ret .= "\tselect USES_TARGZ\n";
+ /cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n";
+ /ubifs/ and $ret .= "\tselect USES_UBIFS\n";
+ /fpu/ and $ret .= "\tselect HAS_FPU\n";
+ /spe_fpu/ and $ret .= "\tselect HAS_SPE_FPU\n";
+ /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n";
+ /powerpc64/ and $ret .= "\tselect powerpc64\n";
+ /nommu/ and $ret .= "\tselect NOMMU\n";
+ }
+ return $ret;
+}
+
+sub target_name($) {
+ my $target = shift;
+ my $parent = $target->{parent};
+ if ($parent) {
+ return $target->{parent}->{name}." - ".$target->{name};
+ } else {
+ return $target->{name};
+ }
+}
+
+sub kver($) {
+ my $v = shift;
+ $v =~ tr/\./_/;
+ if (substr($v,0,2) eq "2_") {
+ $v =~ /(\d+_\d+_\d+)(_\d+)?/ and $v = $1;
+ } else {
+ $v =~ /(\d+_\d+)(_\d+)?/ and $v = $1;
+ }
+ return $v;
+}
+
+sub print_target($) {
+ my $target = shift;
+ my $features = target_config_features(@{$target->{features}});
+ my $help = $target->{desc};
+ my $confstr;
+
+ chomp $features;
+ $features .= "\n";
+ if ($help =~ /\w+/) {
+ $help =~ s/^\s*/\t /mg;
+ $help = "\thelp\n$help";
+ } else {
+ undef $help;
+ }
+
+ my $v = kver($target->{version});
+ if (@{$target->{subtargets}} == 0) {
+ $confstr = <<EOF;
+config TARGET_$target->{conf}
+ bool "$target->{name}"
+ select LINUX_$v
+EOF
+ }
+ else {
+ $confstr = <<EOF;
+config TARGET_$target->{conf}
+ bool "$target->{name}"
+EOF
+ }
+ if ($target->{subtarget}) {
+ $confstr .= "\tdepends TARGET_$target->{boardconf}\n";
+ }
+ if (@{$target->{subtargets}} > 0) {
+ $confstr .= "\tselect HAS_SUBTARGETS\n";
+ grep { /broken/ } @{$target->{features}} and $confstr .= "\tdepends BROKEN\n";
+ } else {
+ $confstr .= $features;
+ }
+
+ if ($target->{arch} =~ /\w/) {
+ $confstr .= "\tselect $target->{arch}\n";
+ }
+ foreach my $dep (@{$target->{depends}}) {
+ my $mode = "depends";
+ my $flags;
+ my $name;
+
+ $dep =~ /^([@\+\-]+)(.+)$/;
+ $flags = $1;
+ $name = $2;
+
+ next if $name =~ /:/;
+ $flags =~ /-/ and $mode = "deselect";
+ $flags =~ /\+/ and $mode = "select";
+ $flags =~ /@/ and $confstr .= "\t$mode $name\n";
+ }
+ $confstr .= "$help\n\n";
+ print $confstr;
+}
+
+sub gen_target_config() {
+ my @target = parse_target_metadata();
+ my %defaults;
+
+ my @target_sort = sort {
+ target_name($a) cmp target_name($b);
+ } @target;
+
+
+ print <<EOF;
+choice
+ prompt "Target System"
+ default TARGET_ar71xx
+ reset if !DEVEL
+
+EOF
+
+ foreach my $target (@target_sort) {
+ next if $target->{subtarget};
+ print_target($target);
+ }
+
+ print <<EOF;
+endchoice
+
+choice
+ prompt "Subtarget" if HAS_SUBTARGETS
+EOF
+ foreach my $target (@target) {
+ next unless $target->{def_subtarget};
+ print <<EOF;
+ default TARGET_$target->{conf}_$target->{def_subtarget} if TARGET_$target->{conf}
+EOF
+ }
+ print <<EOF;
+
+EOF
+ foreach my $target (@target) {
+ next unless $target->{subtarget};
+ print_target($target);
+ }
+
+print <<EOF;
+endchoice
+
+choice
+ prompt "Target Profile"
+
+EOF
+
+ foreach my $target (@target) {
+ my $profiles = $target->{profiles};
+
+ foreach my $profile (@$profiles) {
+ print <<EOF;
+config TARGET_$target->{conf}_$profile->{id}
+ bool "$profile->{name}"
+ depends TARGET_$target->{conf}
+$profile->{config}
+EOF
+ $profile->{kconfig} and print "\tselect PROFILE_KCONFIG\n";
+ my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
+ foreach my $pkg (@pkglist) {
+ print "\tselect DEFAULT_$pkg\n";
+ $defaults{$pkg} = 1;
+ }
+ my $help = $profile->{desc};
+ if ($help =~ /\w+/) {
+ $help =~ s/^\s*/\t /mg;
+ $help = "\thelp\n$help";
+ } else {
+ undef $help;
+ }
+ print "$help\n";
+ }
+ }
+
+ print <<EOF;
+endchoice
+
+config HAS_SUBTARGETS
+ bool
+
+config TARGET_BOARD
+ string
+
+EOF
+ foreach my $target (@target) {
+ $target->{subtarget} or print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
+ }
+ print <<EOF;
+config TARGET_ARCH_PACKAGES
+ string
+
+EOF
+ foreach my $target (@target) {
+ next if @{$target->{subtargets}} > 0;
+ print "\t\tdefault \"".($target->{arch_packages} || $target->{board})."\" if TARGET_".$target->{conf}."\n";
+ }
+ print <<EOF;
+
+config DEFAULT_TARGET_OPTIMIZATION
+ string
+EOF
+ foreach my $target (@target) {
+ next if @{$target->{subtargets}} > 0;
+ print "\tdefault \"".$target->{cflags}."\" if TARGET_".$target->{conf}."\n";
+ }
+ print "\tdefault \"-Os -pipe -funit-at-a-time\"\n";
+
+ my %kver;
+ foreach my $target (@target) {
+ my $v = kver($target->{version});
+ next if $kver{$v};
+ $kver{$v} = 1;
+ print <<EOF;
+
+config LINUX_$v
+ bool
+
+EOF
+ }
+ foreach my $def (sort keys %defaults) {
+ print "\tconfig DEFAULT_".$def."\n";
+ print "\t\tbool\n\n";
+ }
+}
+
+my %dep_check;
+sub __find_package_dep($$) {
+ my $pkg = shift;
+ my $name = shift;
+ my $deps = ($pkg->{vdepends} or $pkg->{depends});
+
+ return 0 unless defined $deps;
+ foreach my $dep (@{$deps}) {
+ next if $dep_check{$dep};
+ $dep_check{$dep} = 1;
+ return 1 if $dep eq $name;
+ return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1));
+ }
+ return 0;
+}
+
+# wrapper to avoid infinite recursion
+sub find_package_dep($$) {
+ my $pkg = shift;
+ my $name = shift;
+
+ %dep_check = ();
+ return __find_package_dep($pkg, $name);
+}
+
+sub package_depends($$) {
+ my $a = shift;
+ my $b = shift;
+ my $ret;
+
+ return 0 if ($a->{submenu} ne $b->{submenu});
+ if (find_package_dep($a, $b->{name}) == 1) {
+ $ret = 1;
+ } elsif (find_package_dep($b, $a->{name}) == 1) {
+ $ret = -1;
+ } else {
+ return 0;
+ }
+ return $ret;
+}
+
+sub mconf_depends {
+ my $pkgname = shift;
+ my $depends = shift;
+ my $only_dep = shift;
+ my $res;
+ my $dep = shift;
+ my $seen = shift;
+ my $parent_condition = shift;
+ $dep or $dep = {};
+ $seen or $seen = {};
+
+ $depends or return;
+ my @depends = @$depends;
+ foreach my $depend (@depends) {
+ my $m = "depends";
+ my $flags = "";
+ $depend =~ s/^([@\+]+)// and $flags = $1;
+ my $vdep;
+ my $condition = $parent_condition;
+
+ next if $condition eq $depend;
+ next if $seen->{"$parent_condition:$depend"};
+ $seen->{"$parent_condition:$depend"} = 1;
+ if ($depend =~ /^(.+):(.+)$/) {
+ if ($1 ne "PACKAGE_$pkgname") {
+ if ($condition) {
+ $condition = "$condition && $1";
+ } else {
+ $condition = $1;
+ }
+ }
+ $depend = $2;
+ }
+ next if $package{$depend} and $package{$depend}->{buildonly};
+ if ($vdep = $package{$depend}->{vdepends}) {
+ $depend = join("||", map { "PACKAGE_".$_ } @$vdep);
+ } else {
+ $flags =~ /\+/ and do {
+ # Menuconfig will not treat 'select FOO' as a real dependency
+ # thus if FOO depends on other config options, these dependencies
+ # will not be checked. To fix this, we simply emit all of FOO's
+ # depends here as well.
+ $package{$depend} and mconf_depends($pkgname, $package{$depend}->{depends}, 1, $dep, $seen, $condition);
+
+ $m = "select";
+ next if $only_dep;
+ };
+ $flags =~ /@/ or $depend = "PACKAGE_$depend";
+ if ($condition) {
+ if ($m =~ /select/) {
+ next if $depend eq $condition;
+ $depend = "$depend if $condition";
+ } else {
+ $depend = "!($condition) || $depend";
+ }
+ }
+ }
+ $dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
+ }
+ foreach my $depend (keys %$dep) {
+ my $m = $dep->{$depend};
+ $res .= "\t\t$m $depend\n";
+ }
+ return $res;
+}
+
+sub print_package_config_category($) {
+ my $cat = shift;
+ my %menus;
+ my %menu_dep;
+
+ return unless $category{$cat};
+
+ print "menu \"$cat\"\n\n";
+ my %spkg = %{$category{$cat}};
+
+ foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) {
+ foreach my $pkg (@{$spkg{$spkg}}) {
+ next if $pkg->{buildonly};
+ my $menu = $pkg->{submenu};
+ if ($menu) {
+ $menu_dep{$menu} or $menu_dep{$menu} = $pkg->{submenudep};
+ } else {
+ $menu = 'undef';
+ }
+ $menus{$menu} or $menus{$menu} = [];
+ push @{$menus{$menu}}, $pkg;
+ }
+ }
+ my @menus = sort {
+ ($a eq 'undef' ? 1 : 0) or
+ ($b eq 'undef' ? -1 : 0) or
+ ($a cmp $b)
+ } keys %menus;
+
+ foreach my $menu (@menus) {
+ my @pkgs = sort {
+ package_depends($a, $b) or
+ ($a->{name} cmp $b->{name})
+ } @{$menus{$menu}};
+ if ($menu ne 'undef') {
+ $menu_dep{$menu} and print "if $menu_dep{$menu}\n";
+ print "menu \"$menu\"\n";
+ }
+ foreach my $pkg (@pkgs) {
+ my $title = $pkg->{name};
+ my $c = (72 - length($pkg->{name}) - length($pkg->{title}));
+ if ($c > 0) {
+ $title .= ("." x $c). " ". $pkg->{title};
+ }
+ $title = "\"$title\"";
+ print "\t";
+ $pkg->{menu} and print "menu";
+ print "config PACKAGE_".$pkg->{name}."\n";
+ $pkg->{hidden} and $title = "";
+ print "\t\t".($pkg->{tristate} ? 'tristate' : 'bool')." $title\n";
+ print "\t\tdefault y if DEFAULT_".$pkg->{name}."\n";
+ foreach my $default (split /\s*,\s*/, $pkg->{default}) {
+ print "\t\tdefault $default\n";
+ }
+ print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
+ print mconf_depends($pkg->{name}, $pkg->{mdepends}, 0);
+ print "\t\thelp\n";
+ print $pkg->{description};
+ print "\n";
+
+ $pkg->{config} and print $pkg->{config}."\n";
+ }
+ if ($menu ne 'undef') {
+ print "endmenu\n";
+ $menu_dep{$menu} and print "endif\n";
+ }
+ }
+ print "endmenu\n\n";
+
+ undef $category{$cat};
+}
+
+sub print_package_features() {
+ keys %features > 0 or return;
+ print "menu \"Package features\"\n";
+ foreach my $n (keys %features) {
+ my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}};
+ print <<EOF;
+choice
+ prompt "$features[0]->{target_title}"
+ default FEATURE_$features[0]->{name}
+EOF
+
+ foreach my $feature (@features) {
+ print <<EOF;
+ config FEATURE_$feature->{name}
+ bool "$feature->{title}"
+EOF
+ $feature->{description} =~ /\w/ and do {
+ print "\t\thelp\n".$feature->{description}."\n";
+ };
+ }
+ print "endchoice\n"
+ }
+ print "endmenu\n\n";
+}
+
+sub gen_package_config() {
+ parse_package_metadata($ARGV[0]) or exit 1;
+ print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n";
+ foreach my $preconfig (keys %preconfig) {
+ foreach my $cfg (keys %{$preconfig{$preconfig}}) {
+ my $conf = $preconfig{$preconfig}->{$cfg}->{id};
+ $conf =~ tr/\.-/__/;
+ print <<EOF
+ config UCI_PRECONFIG_$conf
+ string "$preconfig{$preconfig}->{$cfg}->{label}" if IMAGEOPT
+ depends PACKAGE_$preconfig
+ default "$preconfig{$preconfig}->{$cfg}->{default}"
+
+EOF
+ }
+ }
+ print "source \"package/*/image-config.in\"\n";
+ if (scalar glob "package/feeds/*/*/image-config.in") {
+ print "source \"package/feeds/*/*/image-config.in\"\n";
+ }
+ print_package_features();
+ print_package_config_category 'Base system';
+ foreach my $cat (keys %category) {
+ print_package_config_category $cat;
+ }
+}
+
+sub get_conditional_dep($$) {
+ my $condition = shift;
+ my $depstr = shift;
+ if ($condition) {
+ if ($condition =~ /^!(.+)/) {
+ return "\$(if \$(CONFIG_$1),,$depstr)";
+ } else {
+ return "\$(if \$(CONFIG_$condition),$depstr)";
+ }
+ } else {
+ return $depstr;
+ }
+}
+
+sub gen_package_mk() {
+ my %conf;
+ my %dep;
+ my %done;
+ my $line;
+
+ parse_package_metadata($ARGV[0]) or exit 1;
+ foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
+ my $config;
+ my $pkg = $package{$name};
+ my @srcdeps;
+
+ next if defined $pkg->{vdepends};
+
+ if ($ENV{SDK}) {
+ $conf{$pkg->{src}} or do {
+ $config = 'm';
+ $conf{$pkg->{src}} = 1;
+ };
+ } else {
+ $config = "\$(CONFIG_PACKAGE_$name)"
+ }
+ if ($config) {
+ $pkg->{buildonly} and $config = "";
+ print "package-$config += $pkg->{subdir}$pkg->{src}\n";
+ if ($pkg->{variant}) {
+ if (!defined($done{$pkg->{src}})) {
+ print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n";
+ }
+ print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
+ }
+ $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
+ }
+
+ next if $done{$pkg->{src}};
+ $done{$pkg->{src}} = 1;
+
+ if (@{$pkg->{buildtypes}} > 0) {
+ print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n";
+ }
+
+ foreach my $spkg (@{$srcpackage{$pkg->{src}}}) {
+ foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
+ $dep =~ /@/ or do {
+ $dep =~ s/\+//g;
+ push @srcdeps, $dep;
+ };
+ }
+ }
+ foreach my $type (@{$pkg->{buildtypes}}) {
+ my @extra_deps;
+ my %deplines;
+
+ next unless $pkg->{"builddepends/$type"};
+ foreach my $dep (@{$pkg->{"builddepends/$type"}}) {
+ my $suffix = "";
+ my $condition;
+
+ if ($dep =~ /^(.+):(.+)/) {
+ $condition = $1;
+ $dep = $2;
+ }
+ if ($dep =~ /^(.+)(\/.+)/) {
+ $dep = $1;
+ $suffix = $2;
+ }
+
+ my $idx = "";
+ my $pkg_dep = $package{$dep};
+ if (defined($pkg_dep) && defined($pkg_dep->{src})) {
+ $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
+ } elsif (defined($srcpackage{$dep})) {
+ $idx = $subdir{$dep}.$dep;
+ } else {
+ next;
+ }
+ my $depstr = "\$(curdir)/$idx$suffix/compile";
+ my $depline = get_conditional_dep($condition, $depstr);
+ if ($depline) {
+ $deplines{$depline}++;
+ }
+ }
+ my $depline = join(" ", sort keys %deplines);
+ if ($depline) {
+ $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/$type/compile += $depline\n";
+ }
+ }
+
+ my $hasdeps = 0;
+ my %deplines;
+ foreach my $deps (@srcdeps) {
+ my $idx;
+ my $condition;
+ my $prefix = "";
+ my $suffix = "";
+
+ if ($deps =~ /^(.+):(.+)/) {
+ $condition = $1;
+ $deps = $2;
+ }
+ if ($deps =~ /^(.+)(\/.+)/) {
+ $deps = $1;
+ $suffix = $2;
+ }
+
+ my $pkg_dep = $package{$deps};
+ my @deps;
+
+ if ($pkg_dep->{vdepends}) {
+ @deps = @{$pkg_dep->{vdepends}};
+ } else {
+ @deps = ($deps);
+ }
+
+ foreach my $dep (@deps) {
+ $pkg_dep = $package{$deps};
+ if (defined $pkg_dep->{src}) {
+ ($pkg->{src} ne $pkg_dep->{src}.$suffix) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
+ } elsif (defined($srcpackage{$dep})) {
+ $idx = $subdir{$dep}.$dep;
+ }
+ $idx .= $suffix;
+ undef $idx if $idx =~ /^(kernel)|(base-files)$/;
+ if ($idx) {
+ my $depline;
+ next if $pkg->{src} eq $pkg_dep->{src}.$suffix;
+ next if $dep{$condition.":".$pkg->{src}."->".$idx};
+ next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
+ my $depstr;
+
+ if ($pkg_dep->{vdepends}) {
+ $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
+ $dep{$pkg->{src}."->($dep)".$idx} = 1;
+ } else {
+ $depstr = "\$(curdir)/$idx/compile";
+ $dep{$pkg->{src}."->".$idx} = 1;
+ }
+ $depline = get_conditional_dep($condition, $depstr);
+ if ($depline) {
+ $deplines{$depline}++;
+ }
+ }
+ }
+ }
+ my $depline = join(" ", sort keys %deplines);
+ if ($depline) {
+ $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n";
+ }
+ }
+
+ if ($line ne "") {
+ print "\n$line";
+ }
+ foreach my $preconfig (keys %preconfig) {
+ my $cmds;
+ foreach my $cfg (keys %{$preconfig{$preconfig}}) {
+ my $conf = $preconfig{$preconfig}->{$cfg}->{id};
+ $conf =~ tr/\.-/__/;
+ $cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n";
+ }
+ next unless $cmds;
+ print <<EOF
+
+ifndef DUMP_TARGET_DB
+\$(TARGET_DIR)/etc/uci-defaults/$preconfig: FORCE
+ ( \\
+$cmds \\
+ ) > \$@
+
+ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),)
+ package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig
+endif
+endif
+
+EOF
+ }
+}
+
+sub gen_package_source() {
+ parse_package_metadata($ARGV[0]) or exit 1;
+ foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
+ my $pkg = $package{$name};
+ if ($pkg->{name} && $pkg->{source}) {
+ print "$pkg->{name}: ";
+ print "$pkg->{source}\n";
+ }
+ }
+}
+
+sub parse_command() {
+ my $cmd = shift @ARGV;
+ for ($cmd) {
+ /^target_config$/ and return gen_target_config();
+ /^package_mk$/ and return gen_package_mk();
+ /^package_config$/ and return gen_package_config();
+ /^kconfig/ and return gen_kconfig_overrides();
+ /^package_source$/ and return gen_package_source();
+ }
+ print <<EOF
+Available Commands:
+ $0 target_config [file] Target metadata in Kconfig format
+ $0 package_mk [file] Package metadata in makefile format
+ $0 package_config [file] Package metadata in Kconfig format
+ $0 kconfig [file] [config] Kernel config overrides
+ $0 package_source [file] Package source file information
+
+EOF
+}
+
+parse_command();
diff --git a/scripts/.svn/text-base/metadata.pm.svn-base b/scripts/.svn/text-base/metadata.pm.svn-base
new file mode 100644
index 0000000..5efef46
--- /dev/null
+++ b/scripts/.svn/text-base/metadata.pm.svn-base
@@ -0,0 +1,159 @@
+package metadata;
+use base 'Exporter';
+use strict;
+use warnings;
+our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features clear_packages parse_package_metadata get_multiline);
+
+our %package;
+our %preconfig;
+our %srcpackage;
+our %category;
+our %subdir;
+our %features;
+
+sub get_multiline {
+ my $fh = shift;
+ my $prefix = shift;
+ my $str;
+ while (<$fh>) {
+ last if /^@@/;
+ $str .= (($_ and $prefix) ? $prefix . $_ : $_);
+ }
+
+ return $str ? $str : "";
+}
+
+sub clear_packages() {
+ %subdir = ();
+ %preconfig = ();
+ %package = ();
+ %srcpackage = ();
+ %category = ();
+ %features = ();
+}
+
+sub parse_package_metadata($) {
+ my $file = shift;
+ my $pkg;
+ my $feature;
+ my $makefile;
+ my $preconfig;
+ my $subdir;
+ my $src;
+
+ open FILE, "<$file" or do {
+ warn "Cannot open '$file': $!\n";
+ return undef;
+ };
+ while (<FILE>) {
+ chomp;
+ /^Source-Makefile: \s*((.+\/)([^\/]+)\/Makefile)\s*$/ and do {
+ $makefile = $1;
+ $subdir = $2;
+ $src = $3;
+ $subdir =~ s/^package\///;
+ $subdir{$src} = $subdir;
+ $srcpackage{$src} = [];
+ undef $pkg;
+ };
+ next unless $src;
+ /^Package:\s*(.+?)\s*$/ and do {
+ undef $feature;
+ $pkg = {};
+ $pkg->{src} = $src;
+ $pkg->{makefile} = $makefile;
+ $pkg->{name} = $1;
+ $pkg->{title} = "";
+ $pkg->{default} = "m if ALL";
+ $pkg->{depends} = [];
+ $pkg->{mdepends} = [];
+ $pkg->{builddepends} = [];
+ $pkg->{buildtypes} = [];
+ $pkg->{subdir} = $subdir;
+ $pkg->{tristate} = 1;
+ $package{$1} = $pkg;
+ push @{$srcpackage{$src}}, $pkg;
+ };
+ /^Feature:\s*(.+?)\s*$/ and do {
+ undef $pkg;
+ $feature = {};
+ $feature->{name} = $1;
+ $feature->{priority} = 0;
+ };
+ $feature and do {
+ /^Target-Name:\s*(.+?)\s*$/ and do {
+ $features{$1} or $features{$1} = [];
+ push @{$features{$1}}, $feature;
+ };
+ /^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1;
+ /^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1;
+ /^Feature-Name:\s*(.+?)\s*$/ and $feature->{title} = $1;
+ /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
+ next;
+ };
+ next unless $pkg;
+ /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
+ /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
+ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
+ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
+ /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1;
+ /^Source: \s*(.+)\s*$/ and $pkg->{source} = $1;
+ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
+ /^Provides: \s*(.+)\s*$/ and do {
+ my @vpkg = split /\s+/, $1;
+ foreach my $vpkg (@vpkg) {
+ $package{$vpkg} or $package{$vpkg} = {
+ name => $vpkg,
+ vdepends => [],
+ src => $src,
+ subdir => $subdir,
+ makefile => $makefile
+ };
+ push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
+ }
+ };
+ /^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ];
+ /^Depends: \s*(.+)\s*$/ and $pkg->{depends} = [ split /\s+/, $1 ];
+ /^Hidden: \s*(.+)\s*$/ and $pkg->{hidden} = 1;
+ /^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1;
+ /^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1;
+ /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
+ /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
+ /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ];
+ /^Category: \s*(.+)\s*$/ and do {
+ $pkg->{category} = $1;
+ defined $category{$1} or $category{$1} = {};
+ defined $category{$1}->{$src} or $category{$1}->{$src} = [];
+ push @{$category{$1}->{$src}}, $pkg;
+ };
+ /^Description: \s*(.*)\s*$/ and $pkg->{description} = "\t\t $1\n". get_multiline(*FILE, "\t\t ");
+ /^Type: \s*(.+)\s*$/ and do {
+ $pkg->{type} = [ split /\s+/, $1 ];
+ undef $pkg->{tristate};
+ foreach my $type (@{$pkg->{type}}) {
+ $type =~ /ipkg/ and $pkg->{tristate} = 1;
+ }
+ };
+ /^Config:\s*(.*)\s*$/ and $pkg->{config} = "$1\n".get_multiline(*FILE, "\t");
+ /^Prereq-Check:/ and $pkg->{prereq} = 1;
+ /^Preconfig:\s*(.+)\s*$/ and do {
+ my $pkgname = $pkg->{name};
+ $preconfig{$pkgname} or $preconfig{$pkgname} = {};
+ if (exists $preconfig{$pkgname}->{$1}) {
+ $preconfig = $preconfig{$pkgname}->{$1};
+ } else {
+ $preconfig = {
+ id => $1
+ };
+ $preconfig{$pkgname}->{$1} = $preconfig;
+ }
+ };
+ /^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1;
+ /^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1;
+ /^Preconfig-Default:\s*(.*?)\s*$/ and $preconfig->{default} = $1;
+ }
+ close FILE;
+ return 1;
+}
+
+1;
diff --git a/scripts/.svn/text-base/om-fwupgradecfg-gen.sh.svn-base b/scripts/.svn/text-base/om-fwupgradecfg-gen.sh.svn-base
new file mode 100644
index 0000000..779598a
--- /dev/null
+++ b/scripts/.svn/text-base/om-fwupgradecfg-gen.sh.svn-base
@@ -0,0 +1,70 @@
+#/bin/sh
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+usage() {
+ echo "Usage: $0 <OM2P|MR600> <out file path> <kernel path> <rootfs path>"
+ rm -f $CFG_OUT
+ exit 1
+}
+
+[ "$#" -lt 4 ] && usage
+
+CE_TYPE=$1
+CFG_OUT=$2
+KERNEL_PATH=$3
+ROOTFS_PATH=$4
+
+case $CE_TYPE in
+ OM2P)
+ MAX_PART_SIZE=7168
+ KERNEL_FLASH_ADDR=0x1c0000
+ FLASH_BS=262144
+ MD5_SKIP_BLOCKS=1
+ ;;
+ MR600)
+ MAX_PART_SIZE=7808
+ KERNEL_FLASH_ADDR=0xb0000
+ FLASH_BS=65536
+ MD5_SKIP_BLOCKS=4
+ ;;
+ *)
+ echo "Error - unsupported ce type: $CE_TYPE"
+ exit 1
+ ;;
+esac
+
+CHECK_BS=65536
+
+KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH")
+KERNEL_MD5=$(md5=$(md5sum $KERNEL_PATH); echo ${md5%% *})
+KERNEL_PART_SIZE=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024)))
+
+ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); printf "0x%x" $addr)
+ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH")
+ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS))
+ROOTFS_MD5=$(md5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | md5sum); echo ${md5%% *})
+ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS)))
+ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE))
+
+cat << EOF > $CFG_OUT
+[vmlinux]
+filename=kernel
+md5sum=$KERNEL_MD5
+flashaddr=$KERNEL_FLASH_ADDR
+checksize=0x0
+cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; saveenv
+cmd_fail=reset
+
+[rootfs]
+filename=rootfs
+md5sum=$ROOTFS_MD5
+flashaddr=$ROOTFS_FLASH_ADDR
+checksize=$ROOTFS_CHECK_SIZE
+cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; setenv rootfs_size_1 $ROOTFS_PART_SIZE; saveenv
+cmd_fail=reset
+EOF
diff --git a/scripts/.svn/text-base/openbsd.sh.svn-base b/scripts/.svn/text-base/openbsd.sh.svn-base
new file mode 100644
index 0000000..dc9f4f7
--- /dev/null
+++ b/scripts/.svn/text-base/openbsd.sh.svn-base
@@ -0,0 +1,24 @@
+#!/bin/sh
+ver=$(uname -r)
+arch=$(uname -m)
+echo "Preparing OpenBSD $arch $ver for OpenWrt"
+PKG_PATH="http://ftp.openbsd.org/pub/OpenBSD/${ver}/packages/${arch}/"
+export PKG_PATH
+pkg_add -v gmake
+pkg_add -v findutils
+pkg_add -v coreutils
+pkg_add -v gdiff
+pkg_add -v rsync--
+pkg_add -v git
+pkg_add -v bash
+pkg_add -v unzip
+pkg_add -v wget
+pkg_add -v gtar--
+pkg_add -v ggrep
+pkg_add -v gawk
+pkg_add -v gsed
+pkg_add -v xz
+pkg_add -v apr-util--
+pkg_add -v cyrus-sasl--
+pkg_add -v subversion
+pkg_add -v gnugetopt
diff --git a/scripts/.svn/text-base/pad_image.svn-base b/scripts/.svn/text-base/pad_image.svn-base
new file mode 100644
index 0000000..14f1499
--- /dev/null
+++ b/scripts/.svn/text-base/pad_image.svn-base
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+function usage {
+ echo "Usage: prepare_image image_type kernel_image rootfs_image header_size"
+ echo "Padd root and kernel image to the correct size and append the jffs2 start marker as needed"
+ exit 1
+}
+
+function pad_file {
+ echo "Padding $1 to size $2"
+ dd if=$1 of=$1.paddingtempfile bs=$2 count=1 conv=sync &> /dev/null
+ mv $1.paddingtempfile $1
+}
+
+#filesize filestart padding
+function calc_pad {
+ [ $((($1 + $2) & ($3 - 1))) == 0 ] && {
+ echo $1
+ return 0
+ }
+ echo $(((($1 + $2) | ($3 - 1)) + 1 - $2))
+}
+
+function prep_squash {
+ echo "kernel_size: $kernel_size"
+ echo "header_size: $header_size"
+ kernel_pad_size=$(calc_pad $kernel_size $header_size 32)
+ kernel_end=$(($header_size + $kernel_pad_size))
+ pad_file $kernel_image $kernel_pad_size
+
+ #4k
+ rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 4096)
+ pad_file $rootfs_image $rootfs_pad_size
+ echo -ne '\xde\xad\xc0\xde' >> $rootfs_image
+
+ #8k
+ rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 8192)
+ [ $rootfs_pad_size == rootfs_old_padsize ] || {
+ pad_file $rootfs_image $rootfs_pad_size
+ rootfs_old_padsize=$rootfs_pad_size
+ echo -ne '\xde\xad\xc0\xde' >> $rootfs_image
+ }
+
+ #64k
+ rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 65536)
+ [ $rootfs_pad_size == rootfs_old_padsize ] || {
+ pad_file $rootfs_image $rootfs_pad_size
+ rootfs_old_padsize=$rootfs_pad_size
+ echo -ne '\xde\xad\xc0\xde' >> $rootfs_image
+ }
+
+ #128k
+ rootfs_pad_size=$(calc_pad $rootfs_size $kernel_end 131072)
+ [ $rootfs_pad_size == rootfs_old_padsize ] || {
+ pad_file $rootfs_image $rootfs_pad_size
+ rootfs_old_padsize=$rootfs_pad_size
+ echo -ne '\xde\xad\xc0\xde' >> $rootfs_image
+ }
+
+}
+
+function prep_jffs2 {
+ kernel_pad_size=$(calc_pad $kernel_size $header_size $1)
+ pad_file $kernel_image $kernel_pad_size
+}
+
+image_type=$1
+kernel_image=$2
+rootfs_image=$3
+header_size=$4
+
+if [ -z "$image_type" ] || [ -z "$rootfs_image" ] || [ -z "$kernel_image" ] || [ -z "$header_size" ]; then
+ usage
+fi
+
+if [ ! -e "$rootfs_image" ] || [ -z "$kernel_image" ]; then
+ echo "input file not found"
+ exit 1
+fi
+
+kernel_size=$(stat -c "%s" "$kernel_image")
+rootfs_size=$(stat -c "%s" "$rootfs_image")
+
+if [ $kernel_size == 0 ] || [ $rootfs_size == 0 ]; then
+ echo "kernel or rootfs empty"
+ exit 1
+fi
+
+case $image_type in
+ squashfs )
+ prep_squash ;;
+ jffs2-64k )
+ prep_jffs2 65536 ;;
+ jffs2-128k )
+ prep_jffs2 131072 ;;
+ * )
+ echo "Unknown image type"
+ exit 1 ;;
+esac
+
diff --git a/scripts/.svn/text-base/patch-kernel.sh.svn-base b/scripts/.svn/text-base/patch-kernel.sh.svn-base
new file mode 100644
index 0000000..91753ba
--- /dev/null
+++ b/scripts/.svn/text-base/patch-kernel.sh.svn-base
@@ -0,0 +1,54 @@
+#! /bin/sh
+# A little script I whipped up to make it easy to
+# patch source trees and have sane error handling
+# -Erik
+#
+# (c) 2002 Erik Andersen <andersen@codepoet.org>
+
+# Set directories from arguments, or use defaults.
+targetdir=${1-.}
+patchdir=${2-../kernel-patches}
+patchpattern=${3-*}
+
+if [ ! -d "${targetdir}" ] ; then
+ echo "Aborting. '${targetdir}' is not a directory."
+ exit 1
+fi
+if [ ! -d "${patchdir}" ] ; then
+ echo "Aborting. '${patchdir}' is not a directory."
+ exit 1
+fi
+
+for i in ${patchdir}/${patchpattern} ; do
+ case "$i" in
+ *.gz)
+ type="gzip"; uncomp="gunzip -dc"; ;;
+ *.bz)
+ type="bzip"; uncomp="bunzip -dc"; ;;
+ *.bz2)
+ type="bzip2"; uncomp="bunzip2 -dc"; ;;
+ *.zip)
+ type="zip"; uncomp="unzip -d"; ;;
+ *.Z)
+ type="compress"; uncomp="uncompress -c"; ;;
+ *)
+ type="plaintext"; uncomp="cat"; ;;
+ esac
+ [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue
+ echo ""
+ echo "Applying ${i} using ${type}: "
+ ${uncomp} ${i} | ${PATCH:-patch} -f -p1 -E -d ${targetdir}
+ if [ $? != 0 ] ; then
+ echo "Patch failed! Please fix $i!"
+ exit 1
+ fi
+done
+
+# Check for rejects...
+if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+ echo "Aborting. Reject files found."
+ exit 1
+fi
+
+# Remove backup files
+find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
diff --git a/scripts/.svn/text-base/patch-specs.sh.svn-base b/scripts/.svn/text-base/patch-specs.sh.svn-base
new file mode 100644
index 0000000..3307b6b
--- /dev/null
+++ b/scripts/.svn/text-base/patch-specs.sh.svn-base
@@ -0,0 +1,90 @@
+#!/usr/bin/env bash
+
+DIR="$1"
+
+if [ -d "$DIR" ]; then
+ DIR="$(cd "$DIR"; pwd)"
+else
+ echo "Usage: $0 toolchain-dir"
+ exit 1
+fi
+
+echo -n "Locating cpp ... "
+for bin in bin usr/bin usr/local/bin; do
+ for cmd in "$DIR/$bin/"*-cpp; do
+ if [ -x "$cmd" ]; then
+ echo "$cmd"
+ CPP="$cmd"
+ break
+ fi
+ done
+done
+
+if [ ! -x "$CPP" ]; then
+ echo "Can't locate a cpp executable in '$DIR' !"
+ exit 1
+fi
+
+patch_specs() {
+ local found=0
+
+ for lib in $(STAGING_DIR="$DIR" "$CPP" -x c -v /dev/null 2>&1 | sed -ne 's#:# #g; s#^LIBRARY_PATH=##p'); do
+ if [ -d "$lib" ]; then
+ grep -qs "STAGING_DIR" "$lib/specs" && rm -f "$lib/specs"
+ if [ $found -lt 1 ]; then
+ echo -n "Patching specs ... "
+ STAGING_DIR="$DIR" "$CPP" -dumpspecs | awk '
+ mode ~ "link" {
+ sub("%{L.}", "%{L*} -L %:getenv(STAGING_DIR /usr/lib) -rpath-link %:getenv(STAGING_DIR /usr/lib)")
+ }
+ mode ~ "cpp" {
+ $0 = $0 " -idirafter %:getenv(STAGING_DIR /usr/include)"
+ }
+ {
+ print $0
+ mode = ""
+ }
+ /^\*cpp:/ {
+ mode = "cpp"
+ }
+ /^\*link.*:/ {
+ mode = "link"
+ }
+ ' > "$lib/specs"
+ echo "ok"
+ found=1
+ fi
+ fi
+ done
+
+ [ $found -gt 0 ]
+ return $?
+}
+
+
+VERSION="$(STAGING_DIR="$DIR" "$CPP" --version | sed -ne 's/^.* (.*) //; s/ .*$//; 1p')"
+VERSION="${VERSION:-unknown}"
+
+case "${VERSION##* }" in
+ 2.*|3.*|4.0.*|4.1.*|4.2.*)
+ echo "The compiler version does not support getenv() in spec files."
+ echo -n "Wrapping binaries instead ... "
+
+ if "${0%/*}/ext-toolchain.sh" --toolchain "$DIR" --wrap "${CPP%/*}"; then
+ echo "ok"
+ exit 0
+ else
+ echo "failed"
+ exit $?
+ fi
+ ;;
+ *)
+ if patch_specs; then
+ echo "Toolchain successfully patched."
+ exit 0
+ else
+ echo "Failed to locate library directory!"
+ exit 1
+ fi
+ ;;
+esac
diff --git a/scripts/.svn/text-base/relink-lib.sh.svn-base b/scripts/.svn/text-base/relink-lib.sh.svn-base
new file mode 100644
index 0000000..5367b70
--- /dev/null
+++ b/scripts/.svn/text-base/relink-lib.sh.svn-base
@@ -0,0 +1,14 @@
+#!/bin/sh
+[ $# -lt 4 -o -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] && {
+ echo "Usage: $0 <cross> <reference> <pic .a> <destination>"
+ exit 1
+}
+
+cross="$1"; shift
+ref="$1"; shift
+pic="$1"; shift
+dest="$1"; shift
+
+SYMBOLS="$(${cross}nm "$ref" | grep -E '........ [TW] ' | awk '$3 {printf "-u%s ", $3}')"
+set -x
+${cross}gcc -nostdlib -nostartfiles -shared -Wl,--gc-sections -o "$dest" $SYMBOLS "$pic" "$@"
diff --git a/scripts/.svn/text-base/remote-gdb.svn-base b/scripts/.svn/text-base/remote-gdb.svn-base
new file mode 100644
index 0000000..a470ac7
--- /dev/null
+++ b/scripts/.svn/text-base/remote-gdb.svn-base
@@ -0,0 +1,82 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use FindBin '$Bin';
+use File::Temp 'tempfile';
+
+@ARGV == 2 || do {
+ die "Usage: $0 <host:port> <executable>\n";
+ exit 1;
+};
+
+if( opendir SD, "$Bin/../staging_dir" )
+{
+ my ( $tid, $arch, $libc, @arches );
+
+ if( $ARGV[1] =~ m!\btarget-(.+?)_([^_]+libc[^/]+)\b!i )
+ {
+ print("Using target $1 ($2)\n");
+ ($arch, $libc) = ($1, $2);
+ }
+ else
+ {
+ # Find arches
+ print("Choose target:\n");
+
+ while( defined( my $e = readdir SD ) )
+ {
+ if( -d "$Bin/../staging_dir/$e" && $e =~ /^target-(.+?)_([^_]+libc.+)/i )
+ {
+ push @arches, [ $1, $2 ];
+ printf(" %2d) %s (%s)\n", @arches + 0, $1, $2);
+ }
+ }
+
+ if( @arches > 1 )
+ {
+ # Query arch
+ do {
+ print("Target? > ");
+ chomp($tid = <STDIN>);
+ } while( !defined($tid) || $tid !~ /^\d+$/ || $tid < 1 || $tid > @arches );
+
+ ($arch, $libc) = @{$arches[$tid-1]};
+ }
+ else
+ {
+ ($arch, $libc) = @{$arches[0]};
+ }
+ }
+
+ closedir SD;
+
+ # Find gdb
+ my ($gdb) = glob("$Bin/../staging_dir/toolchain-${arch}_*_${libc}*/bin/*-gdb");
+ if( defined($gdb) && -x $gdb )
+ {
+ my ( $fh, $fp ) = tempfile();
+
+ # Find sysroot
+ my ($sysroot) = glob("$Bin/../staging_dir/target-${arch}_${libc}/root-*/");
+
+ print $fh "set sysroot $sysroot\n" if $sysroot;
+ print $fh "target remote $ARGV[0]\n";
+
+ my $file = -f "$sysroot/$ARGV[1]" ? "$sysroot/$ARGV[1]" : $ARGV[1];
+ system($gdb, '-x', $fp, $file);
+
+ close($fh);
+ unlink($fp);
+ }
+ else
+ {
+ print("No gdb found! Make sure that CONFIG_GDB is set!\n");
+ exit(1);
+ }
+}
+else
+{
+ print("No staging_dir found! You need to compile at least once!\n");
+ exit(1);
+}
diff --git a/scripts/.svn/text-base/rstrip.sh.svn-base b/scripts/.svn/text-base/rstrip.sh.svn-base
new file mode 100644
index 0000000..4665ff5
--- /dev/null
+++ b/scripts/.svn/text-base/rstrip.sh.svn-base
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+SELF=${0##*/}
+
+[ -z "$STRIP" ] && {
+ echo "$SELF: strip command not defined (STRIP variable not set)"
+ exit 1
+}
+
+TARGETS=$*
+
+[ -z "$TARGETS" ] && {
+ echo "$SELF: no directories / files specified"
+ echo "usage: $SELF [PATH...]"
+ exit 1
+}
+
+find $TARGETS -type f -a -exec file {} \; | \
+ sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*,.* stripped/\1:\2/p' | \
+(
+ IFS=":"
+ while read F S; do
+ echo "$SELF: $F:$S"
+ [ "${S}" = "relocatable" ] && {
+ eval "$STRIP_KMOD $F"
+ } || {
+ b=$(stat -c '%a' $F)
+ eval "$STRIP $F"
+ a=$(stat -c '%a' $F)
+ [ "$a" = "$b" ] || chmod $b $F
+ }
+ done
+ true
+)
diff --git a/scripts/.svn/text-base/slugimage.pl.svn-base b/scripts/.svn/text-base/slugimage.pl.svn-base
new file mode 100644
index 0000000..deac6ac
--- /dev/null
+++ b/scripts/.svn/text-base/slugimage.pl.svn-base
@@ -0,0 +1,1217 @@
+#!/usr/bin/env perl
+#
+# SlugImage : Manipulate NSLU2 firmware images
+# Dwayne Fontenot (jacques)
+# Rod Whitby (rwhitby)
+# www.nslu2-linux.org
+#
+# Copyright (c) 2004, 2006, Dwayne Fontenot & Rod Whitby
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# Neither the name of the NSLU2-Linux Development Team nor the names
+# of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+use strict;
+use warnings;
+
+use Getopt::Long qw(:config no_ignore_case);
+use POSIX qw(tmpnam);
+
+my($debug) = 0;
+my($quiet) = 0;
+my($flash_start) = 0x50000000;
+my($flash_len) = 0x00800000;
+my($block_size) = 0x00020000;
+my($kernel_offset) = 0x00060000;
+my($kernel_size) = 0x00100000;
+my($ramdisk_offset) = 0x00160000;
+my(@cleanup);
+
+# The last 70 bytes of the SercommRedBootTrailer (i.e. excluding MAC
+# address). Needed to create an image with an empty RedBoot partition
+# since the Sercomm upgrade tool checks for this trailer.
+# http://www.nslu2-linux.org/wiki/Info/SercommRedBootTrailer
+my @sercomm_redboot_trailer = (0x4573, 0x4372, 0x4d6f, 0x006d, 0x0001,
+ 0x0400, 0x3170, 0x5895, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0003, 0x2300,
+ 0x0063, 0x0000, 0x7320, 0x7245, 0x6f43, 0x6d4d);
+
+# There's a 16 byte Sercomm trailer at the end of the flash. It is used
+# by RedBoot to detect a Sercomm flash layout and to configure the
+# Sercomm upgrade system.
+# http://www.nslu2-linux.org/wiki/Info/SercommFlashTrailer
+my @sercomm_flash_trailer = (0x0100, 0x0000, 0x6323, 0xf790, 0x5265,
+ 0x4f63, 0x4d6d, 0xb400);
+
+# Take $data, and pad it out to $total_len bytes, appending 0xff's.
+sub padBytes {
+ my($data,$total_len) = @_;
+
+ # 0xFF is used to pad, as it's the erase value of the flash.
+ my($pad_char) = pack("C",0xff);
+ my($pad_len) = $total_len - length($data);
+
+ # A request for negative padding is indicative of a logic error ...
+ if (length($data) > $total_len) {
+ die sprintf("padBytes error: data (%d) is longer than total_len (%d)", length($data), $total_len);
+ }
+
+ return $data . ($pad_char x $pad_len);
+}
+
+# Return the next multiple of block_size larger than or equal to $data_len.
+sub paddedSize {
+ my($data_len) = @_;
+
+ use integer;
+ return (($data_len - 1) / $block_size) * $block_size + $block_size;
+}
+
+# Return the number of block_size blocks required to hold $data_len.
+sub numBlocks {
+ my($data_len) = @_;
+
+ use integer;
+ return (($data_len - 1) / $block_size) + 1;
+}
+
+# Pack the name, address, size and optional skip regions of a partition entry into binary form.
+sub createPartitionEntry {
+ my($name, $flash_base, $size, $skips) = @_;
+ my $entry;
+
+ my($zero_long) = 0x0000;
+
+ # Pack the partition entry according to the format that RedBoot (and the MTD partition parsing code) requires.
+ $entry = pack("a16N5x212N2",$name,$flash_base,$zero_long,$size,$zero_long,$zero_long,$zero_long,$zero_long);
+
+ # Optionally put a skip header into the padding area.
+ if (defined $skips) {
+ my $i = scalar(@$skips);
+ foreach my $region (@$skips) {
+ substr($entry, -8 - 12*$i, 12) =
+ pack("a4N2", "skip", $region->{'offset'}, $region->{'size'});
+ $i--;
+ }
+ }
+
+ return $entry;
+}
+
+# Parse partition entry and return anon array ref [$name, $offset, $size, $skip] or return 0 on partition terminator.
+sub parsePartitionEntry {
+ my($partition_entry) = @_;
+
+ my($entry_len) = 0x100;
+ length($partition_entry) eq $entry_len or die "parsePartitionEntry: partition entry length is not $entry_len!\n";
+
+ # Unpack the partition table entry, saving those values in which we are interested.
+ my($name, $flash_base, $size, $dummy_long, $padding, $skips);
+ ($name, $flash_base, $dummy_long, $size, $dummy_long, $dummy_long, $padding, $dummy_long, $dummy_long) =
+ unpack("a16N5a212N2",$partition_entry);
+
+ # A partition entry starting with 0xFF terminates the table.
+ if (unpack("C", $name) eq 0xff) {
+ # %%% FIXME: This should only skip, not terminate. %%%
+ $debug and print "Found terminator for <FIS directory>\n";
+ return 0;
+ }
+
+ # Remove trailing nulls from the partition name.
+ $name =~ s/\000+//;
+
+ # Extract the skip regions out of the padding area.
+ $padding =~ s/^\000+//;
+ $padding =~ s/\000*skip(........)\000*/$1/g;
+ $padding =~ s/\000+$//;
+
+ # Store the skip regions in an array for later use.
+ while (length($padding)) {
+ my $region = {};
+ ($region->{'offset'}, $region->{'size'}) =
+ unpack("N2", $padding);
+ $debug and printf("Found skip region at 0x%05X, size 0x%05X\n",
+ $region->{'offset'}, $region->{'size'});
+ push(@$skips, $region);
+ $padding = substr($padding,8);
+ }
+
+ return [$name, $flash_base - $flash_start, $size, $skips];
+}
+
+# Return partition table from data is one exists, otherwise return 0.
+sub findPartitionTable {
+ my($data_buf) = @_;
+
+ unpack("a7", $data_buf) eq 'RedBoot' or return 0;
+ return substr($data_buf, 0, 0x1000)
+}
+
+# Parse partition table and return array of anonymous array references ([$name, $offset, $size, $skips], ...).
+sub parsePartitionTable {
+ my($partition_table) = @_;
+
+ my(@partitions, $fields_ref);
+ my($entry_len) = 0x100;
+ my($partition_count) = 0;
+
+ # Loop through the fixed size partition table entries, and store the entries in @partitions.
+ # %%% FIXME: This doesn't handle the case of a completely full partition table. %%%
+ while ($fields_ref = parsePartitionEntry(substr($partition_table, $partition_count * $entry_len, $entry_len))) {
+ $debug and printf("Found <%s> at 0x%08X (%s)%s\n", $fields_ref->[0], $fields_ref->[1],
+ ($fields_ref->[2] >= $block_size ?
+ sprintf("%d blocks", numBlocks($fields_ref->[2])) :
+ sprintf("0x%05X bytes", $fields_ref->[2])),
+ (defined $fields_ref->[3] ?
+ sprintf(" [%s]",
+ join(", ",
+ map { sprintf("0x%05X/0x%05X", $_->{'offset'},$_->{'size'}) }
+ @{$fields_ref->[3]})) :
+ ""));
+ $partitions[$partition_count++] = $fields_ref;
+ }
+ return(@partitions);
+}
+
+# Create an empty jffs2 block.
+sub jffs2Block {
+ return padBytes(pack("N3", 0x19852003, 0x0000000c, 0xf060dc98), $block_size);
+}
+
+# Write out $data to $filename,
+sub writeOut {
+ my($data, $filename) = @_;
+
+ open FILE,">$filename" or die "Can't open file \"$filename\": $!\n";
+
+ if (defined($data)) { print FILE $data;}
+
+ close FILE or die "Can't close file \"$filename\": $!\n";
+}
+
+# Not used at the moment.
+sub trailerData {
+ my($product_id) = 0x0001;
+ my($protocol_id) = 0x0000;
+ my($firmware_version) = 0x2325;
+ my($unknown1) = 0x90f7;
+ my($magic_number) = 'eRcOmM';
+ my($unknown2) = 0x00b9;
+
+ return pack("n4a6n",$product_id,$protocol_id,$firmware_version,$unknown1,$magic_number,$unknown2);
+}
+
+# Print the contents of the Sercomm RedBoot trailer.
+sub printRedbootTrailer {
+ my($redboot_data) = @_;
+
+ my($correct_redboot_len) = 0x40000;
+ my($redboot_data_len) = length($redboot_data);
+
+ if ($redboot_data_len != $correct_redboot_len) {
+ printf("Redboot length (0x%08X) is not 0x%08X\n", $redboot_data_len, $correct_redboot_len);
+ return;
+ }
+
+ # The trailer is the last 80 bytes of the redboot partition.
+ my($redboot_trailer) = substr($redboot_data, -80);
+
+ writeOut($redboot_trailer, 'RedbootTrailer');
+
+ my($mac_addr0, $mac_addr1, $mac_addr2, $unknown, $prefix, $ver_ctrl, $down_ctrl, $hid, $hver, $prodid, $prodidmask,
+ $protid, $protidmask, $funcid, $funcidmask, $fver, $cseg, $csize, $postfix) =
+ unpack("n3Na7n2a32n10a7",$redboot_trailer);
+
+ printf("MAC address is %04X%04X%04X\n", $mac_addr0, $mac_addr1, $mac_addr2);
+ printf("unknown: %08X\n", $unknown);
+ printf("%s:%04X:%04X:%s\n", $prefix, $ver_ctrl, $down_ctrl, $postfix);
+ printf("VerControl: %04X\nDownControl: %04X\n", $ver_ctrl, $down_ctrl);
+ printf("hid: %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X\n", unpack("n16", $hid));
+ printf("Hver: %04X\nProdID: %04X\nProtID: %04X\nFuncID: %04X\nFver: %04X\nCseg: %04X\nCsize: %04X\n",
+ $hver, $prodid, $protid, $funcid, $fver, $cseg, $csize);
+}
+
+# remove the optional Loader partition
+sub removeOptionalLoader {
+ my($partitions_ref) = @_;
+
+ my $index;
+ my $count = 0;
+ map {
+ if (not defined $index) {
+ if ($_->{'name'} eq "Loader") {
+ $index = $count;
+ }
+ $count++;
+ }
+ } @$partitions_ref;
+
+ defined $index or die "Cannot find the Loader partition\n";
+
+ splice(@$partitions_ref, $index, 1);
+
+ # Set fixed offsets and sizes for Kernel and Ramdisk
+ map {
+ if ($_->{'name'} eq 'Kernel') {
+ $_->{'offset'} = $kernel_offset;
+ $_->{'size'} = $kernel_size;
+ $_->{'variable'} = 0;
+ }
+ if ($_->{'name'} eq 'Ramdisk') {
+ $_->{'offset'} = $ramdisk_offset;
+ }
+ } @$partitions_ref;
+
+ return;
+}
+
+
+# populate @partitions based on the firmware's partition table
+sub spliceFirmwarePartitions {
+ my($firmware_buf, $partitions_ref) = @_;
+
+ # we know that partition table, if it exists, begins at start of 'FIS directory' and has max length 0x1000
+ my($partition_table);
+ map {
+ $_->{'name'} eq 'FIS directory' and
+ $partition_table = findPartitionTable(substr($firmware_buf, $_->{'offset'}, $_->{'size'}));
+ } @$partitions_ref;
+
+ # return 0 here if no partition table in FIS directory
+ return if not $partition_table;
+
+ my @new_partitions = parsePartitionTable($partition_table);
+
+ # Remove the optional second stage bootloader if it is not found in the FIS directory.
+ if (not grep { $_->[0] eq 'Loader' } @new_partitions) {
+ removeOptionalLoader($partitions_ref);
+ }
+
+ my($partition_count) = 0;
+ my($splice) = 0;
+ map {
+
+ # Skip pseudo partitions.
+ while (($partition_count < scalar(@$partitions_ref)) and
+ $partitions_ref->[$partition_count]->{'pseudo'}) {
+ $debug and printf("Skipped <%s> (pseudo partition)\n", $partitions_ref->[$partition_count]->{'name'});
+ $partition_count++;
+ }
+
+ # If we are in a variable area, and we haven't reached the end of it,
+ # then splice in another partition for use by the later code.
+ if ($splice and ($partitions_ref->[$partition_count]->{'name'} ne $_->[0])) {
+ $debug and printf("Splicing new partition <%s> before <%s>\n",
+ $_->[0], $partitions_ref->[$partition_count]->{'name'});
+ splice(@{$partitions_ref}, $partition_count, 0, ({'name' => "",'variable'=>1,'header'=>0}));
+ }
+
+ my $partition = $partitions_ref->[$partition_count];
+
+ # Variable partitions can be overridden by the real FIS directory
+ if ($partition->{'variable'}) {
+
+ # Only override the filename if the partition name is not set or doesn't match
+ if ($partition->{'name'} ne $_->[0]) {
+
+ if (length($partition->{'name'})) {
+ $debug and printf("Overwriting <%s> with <%s>\n",
+ $partitions_ref->[$partition_count]->{'name'}, $_->[0]);
+ }
+
+ $partition->{'name'} = $_->[0];
+ $partition->{'file'} = $_->[0];
+ }
+
+ # Set the offset, size and skips based on the real partition table
+ $partition->{'offset'} = $_->[1];
+ $partition->{'size'} = $_->[2];
+ $partition->{'skips'} = $_->[3];
+
+ $debug and printf("Locating <%s> at 0x%08X (%s)\n",
+ $partition->{'name'}, $partition->{'offset'},
+ ($partition->{'size'} >= $block_size ?
+ sprintf("%d blocks", numBlocks($partition->{'size'})) :
+ sprintf("0x%05X bytes", $partition->{'size'})));
+
+ $splice = 1;
+ }
+
+ # Fixed partitions cannot be overridden
+ else {
+ ($partition->{'name'} eq $_->[0]) or
+ die "Unexpected partition <",$_->[0],"> (expecting <",$partition->{'name'},">)\n";
+
+ $debug and printf("Locating <%s> at 0x%08X (%s)\n",
+ $partition->{'name'}, $partition->{'offset'},
+ ($partition->{'size'} >= $block_size ?
+ sprintf("%d blocks", numBlocks($partition->{'size'})) :
+ sprintf("0x%05X bytes", $partition->{'size'})));
+
+ $splice = 0;
+ }
+
+ $partition_count++;
+
+ } @new_partitions;
+
+ return;
+}
+
+# Read in an 8MB firmware file, and store the data into @partitions.
+# Note that the data is only stored in a partition if 'offset' and 'size' are defined,
+# and it does not already have data stored in it.
+sub readInFirmware {
+ my($filename, $partitions_ref) = @_;
+
+ my($firmware_buf);
+
+ open FILE,$filename or die "Can't find firmware image \"$filename\": $!\n";
+ read FILE,$firmware_buf,$flash_len or die "Can't read $flash_len bytes from \"$filename\": $!\n";
+ close FILE or die "Can't close \"$filename\": $!\n";
+
+ $debug and printf("Read 0x%08X bytes from \"%s\"\n", length($firmware_buf), $filename);
+
+ spliceFirmwarePartitions($firmware_buf, $partitions_ref);
+
+ # Read the parts of the firmware file into the partitions table.
+ map {
+ if (defined $_->{'offset'} and defined $_->{'size'}) {
+
+ if (defined $_->{'data'}) {
+ $debug and printf("Not overwriting data in <%s>\n", $_->{'name'});
+ }
+ else {
+
+ # Slurp up the data, based on whether a header and/or data is present or not
+ if ($_->{'header'}) {
+
+ # Read the length, and grab the data based on the length.
+ my($data_len) = unpack("N", substr($firmware_buf, $_->{'offset'}));
+
+ # A length of 0xFFFFFFFF means that the area is not initialised
+ if ($data_len != 0xFFFFFFFF) {
+ $debug and printf("Found header size of 0x%08X bytes for <%s>\n", $data_len, $_->{'name'});
+ $_->{'data'} = substr($firmware_buf, $_->{'offset'} + $_->{'header'}, $data_len);
+ }
+ }
+ elsif ($_->{'pseudo'} and not defined $_->{'file'} and
+ (substr($firmware_buf, $_->{'offset'}, $_->{'size'}) eq
+ (pack("C", 0xff) x $_->{'size'}))) {
+ $debug and printf("Skipping empty pseudo partition <%s>\n", $_->{'name'});
+ }
+ else {
+
+ # Grab the whole partition, using the maximum size.
+ $_->{'data'} = substr($firmware_buf, $_->{'offset'}, $_->{'size'});
+ }
+
+ # If skip regions are defined, remove them from the data.
+ if (defined $_->{'skips'}) {
+ my $removed = 0;
+ foreach my $region (@{$_->{'skips'}}) {
+ if (($region->{'offset'} > 0) or
+ not ($_->{'header'} > 0)) {
+ $debug and printf("Removing 0x%05X bytes from offset 0x%05X\n",
+ $region->{'size'}, $region->{'offset'});
+ $region->{'data'} = substr($_->{'data'}, $region->{'offset'} - $removed, $region->{'size'}, '');
+ }
+ $removed += $region->{'size'};
+ }
+ }
+
+ $quiet or defined $_->{'data'} and printf("Read %s into <%s>\n",
+ (length($_->{'data'}) >= $block_size ?
+ sprintf("%d blocks", numBlocks(length($_->{'data'}))) :
+ sprintf("0x%05X bytes", length($_->{'data'}))), $_->{'name'});
+ }
+ }
+ } @$partitions_ref;
+}
+
+# Write the partition data stored in memory out into the files associated with each.
+sub writeOutFirmwareParts {
+ my(@partitions) = @_;
+
+ # Write out the parts of the firmware file.
+ map {
+
+ # We can only write if 'data' and 'file' are defined.
+ if (defined $_->{'file'} and defined $_->{'data'} and length($_->{'data'})) {
+ writeOut($_->{'data'}, $_->{'file'});
+ $quiet or printf("Wrote 0x%08X bytes from <%s> into \"%s\"\n",
+ length($_->{'data'}), $_->{'name'}, $_->{'file'});
+ }
+ else {
+ $debug and printf("Skipping <%s> (%s)\n", $_->{'name'},
+ (not defined $_->{'file'}) ?
+ "no filename specified" :
+ "no data to write");
+ }
+
+ } @partitions;
+
+ return;
+}
+
+# Read in the partition data from the files associated with each and store in memory.
+sub readInFirmwareParts {
+ my(@partitions) = (@_);
+
+ undef $/; # we want to slurp
+
+ map {
+
+ my $file = $_->{'file'};
+ if (defined $file) {
+ open FILE,$file or die "Can't find firmware part \"$file\": $!\n";
+
+ # Slurp in the data
+ $_->{'data'} = <FILE>;
+
+ # close the file
+ close FILE or die "Can't close file \"$file\": $!\n";
+
+ # Optionally byteswap the data
+ if ($_->{'byteswap'}) {
+ # Byte swap the data (which has to be padded to a multiple of 4 bytes).
+ $_->{'data'} = pack("N*", unpack("V*", $_->{'data'}.pack("CCC", 0)));
+ }
+
+ # Keep track of the actual size.
+ my $size;
+
+ if ($_->{'header'}) {
+ if ($_->{'pseudo'}) {
+ $size = $_->{'header'} + length($_->{'data'});
+ }
+ else {
+ $size = paddedSize($_->{'header'} + length($_->{'data'}));
+ }
+ }
+ elsif (not $_->{'pseudo'}) {
+ $size = paddedSize(length($_->{'data'}));
+ }
+ else {
+ $size = length($_->{'data'});
+ }
+
+ # Check to make sure the file contents are not too large.
+ if (defined $_->{'size'} and ($size > $_->{'size'})) {
+ die sprintf("Ran out of flash space in <%s> - %s too large.\n", $_->{'name'},
+ sprintf("0x%05X bytes", ($size - $_->{'size'})));
+ }
+
+ # If the partition does not have a fixed size, the calculate the size.
+ if (not defined $_->{'size'}) {
+ $_->{'size'} = $size;
+ }
+
+ # Keep the user appraised ...
+ $quiet or printf("Read 0x%08X bytes from \"%s\" into <%s> (%s / %s)%s\n",
+ length($_->{'data'}), $_->{'file'}, $_->{'name'},
+ ($size >= $block_size ?
+ sprintf("%d blocks", numBlocks($size)) :
+ sprintf("0x%05X bytes", $size)),
+ ($_->{'size'} >= $block_size ?
+ sprintf("%d blocks", numBlocks($_->{'size'})) :
+ sprintf("0x%05X bytes", $_->{'size'})),
+ ($_->{'byteswap'} ? " (byte-swapped)" : ""));
+ }
+
+ } @partitions;
+
+ return;
+}
+
+# layoutPartitions : this function must be ugly - it needs to verify RedBoot, SysConf, Kernel, Ramdisk, and
+# FIS directory partitions exist, are in the correct order, and do not have more data than can fit in
+# their lengths (fixed for all but Ramdisk, which has a minimum length of one block).
+# If Rootdisk and/or Userdisk exist, it must also verify that their block padded lengths are not
+# too great for the available space.
+# input : an array of hashes, some of which are populated with data
+# output: same reference with start and size (partition not data) also populated. this populated structure
+# can then be passed to buildPartitionTable() to generate the actual partition table data
+sub layoutPartitions {
+ my(@partitions) = @_;
+
+ # Find the kernel partition, and save a pointer to it for later use
+ my $kernel;
+ map { ($_->{'name'} eq "Kernel") && ($kernel = $_); } @partitions;
+ $kernel or die "Couldn't find the kernel partition\n";
+
+ # Find the last variable size partition, and save a pointer to it for later use
+ my $lastdisk;
+ my $directory_offset;
+ my $curdisk = $partitions[0];
+ map {
+ if (not defined $lastdisk) {
+ if ($_->{'name'} eq "FIS directory") {
+ $lastdisk = $curdisk;
+ $directory_offset = $_->{'offset'};
+ }
+ else {
+ $curdisk = $_;
+ }
+ }
+ } @partitions;
+
+ $lastdisk or die "Couldn't find the last variable size partition\n";
+
+ $debug and printf("Last variable size partition is <%s>\n", $lastdisk->{'name'});
+
+ #
+ # here we go through the $partitions array ref and fill in all the values
+ #
+
+ # This points to where the next partition should be placed.
+ my $pointer = $flash_start;
+
+ map {
+
+ $debug and printf("Pointer is 0x%08X\n", $pointer);
+
+ # Determine the start and offset of the current partition.
+ if (defined $_->{'offset'}) {
+ $_->{'start'} = $flash_start + $_->{'offset'};
+ # Check for running past the defined start of the partition.
+ if (($pointer > $_->{'start'}) and not $_->{'pseudo'}) {
+ die sprintf("Ran out of flash space before <%s> - %s too large.\n", $_->{'name'},
+ sprintf("0x%05X bytes", ($pointer - $_->{'start'})));
+ }
+ }
+
+ # If offset is not defined, then calculate it.
+ else {
+ $_->{'start'} = $pointer;
+ $_->{'offset'} = $_->{'start'} - $flash_start;
+ }
+
+ my $size = defined $_->{'data'} ? length($_->{'data'}) : 0;
+
+ # Add skip regions for the partitions with headers.
+ if ($_->{'header'} > 0) {
+ # Define the skip region for the initial Sercomm header.
+ push(@{$_->{'skips'}},
+ { 'offset' => 0, 'size' => $_->{'header'}, 'data' => undef });
+ # Allow for the Sercomm header to be prepended to the data.
+ $size += $_->{'header'};
+
+ # Determine if the partition overlaps the ramdisk boundary.
+ if (($_->{'offset'} < $ramdisk_offset) and
+ (($_->{'offset'} + $size) > $ramdisk_offset)) {
+ # Define the skip region for the inline Sercomm header.
+ push(@{$_->{'skips'}},
+ { 'offset' => ($ramdisk_offset - $_->{'offset'}), 'size' => 16,
+ 'data' => pack("N4", $block_size) });
+ # Allow for the Sercomm header to be inserted in the data.
+ $size += 16;
+ }
+ }
+
+ # Partitions without headers cannot have skip regions.
+ elsif (($_->{'offset'} <= $ramdisk_offset) and
+ (($_->{'offset'} + $size) > $ramdisk_offset)) {
+ # Pad the kernel until it extends past the ramdisk offset.
+ push(@{$kernel->{'skips'}},
+ { 'offset' => ($ramdisk_offset - $kernel->{'offset'}), 'size' => 16,
+ 'data' => pack("N4", $block_size) });
+ $kernel->{'size'} = $ramdisk_offset - $kernel->{'offset'} + $block_size;
+ $kernel->{'data'} = padBytes($kernel->{'data'},
+ $kernel->{'size'} - $kernel->{'header'} - 16);
+ $_->{'offset'} = $ramdisk_offset + $block_size;
+ $_->{'start'} = $flash_start + $_->{'offset'};
+ $pointer = $_->{'start'};
+ $debug and printf("Extending kernel partition past ramdisk offset.\n");
+ }
+
+ # If this is the last variable size partition, then fill the rest of the space.
+ if ($_->{'name'} eq $lastdisk->{'name'}) {
+ $_->{'size'} = paddedSize($directory_offset + $flash_start - $pointer);
+ $debug and printf("Padding last variable partition <%s> to 0x%08X bytes\n", $_->{'name'}, $_->{'size'});
+ }
+
+ die sprintf("Partition size not defined in <%s>.\n", $_->{'name'})
+ unless defined $_->{'size'};
+
+ # Extend to another block if required.
+ if ($size > $_->{'size'}) {
+ if ($_->{'name'} eq $lastdisk->{'name'}) {
+ die sprintf("Ran out of flash space in <%s> - %s too large.\n", $_->{'name'},
+ sprintf("0x%05X bytes", ($size - $_->{'size'})));
+ }
+ $_->{'size'} = $size;
+ printf("Extending partition <%s> to 0x%08X bytes\n", $_->{'name'}, $_->{'size'});
+ }
+
+ # Keep the user appraised ...
+ $debug and printf("Allocated <%s> from 0x%08X to 0x%08X (%s / %s)\n",
+ $_->{'name'}, $_->{'start'}, $_->{'start'} + $_->{'size'},
+ ($size >= $block_size ?
+ sprintf("%d blocks", numBlocks($size)) :
+ sprintf("0x%05X bytes", $size)),
+ ($_->{'size'} >= $block_size ?
+ sprintf("%d blocks", numBlocks($_->{'size'})) :
+ sprintf("0x%05X bytes", $_->{'size'})));
+
+ # Check to make sure we have not run out of room.
+ if (($_->{'start'} + $_->{'size'}) > ($flash_start + $flash_len)) {
+ die "Ran out of flash space in <", $_->{'name'}, ">\n";
+ }
+
+ $debug and printf("Moving pointer from 0x%08X to 0x%08X (0x%08X + 0x%08X)\n",
+ $pointer, paddedSize($_->{'start'} + $_->{'size'}),
+ $_->{'start'}, $_->{'size'});
+
+ # Move the pointer up, in preparation for the next partition.
+ $pointer = paddedSize($_->{'start'} + $_->{'size'});
+
+ } @partitions;
+
+ return;
+}
+
+sub buildPartitionTable {
+ my(@partitions) = @_;
+
+ my($flash_start) = 0x50000000;
+ my($partition_data) = '';
+
+ map {
+
+ # Collate the partition data for all known partitions.
+ if (not $_->{'pseudo'} and defined $_->{'offset'} and defined $_->{'size'}) {
+
+ # Pack and append the binary table entry for this partition.
+ $partition_data .= createPartitionEntry($_->{'name'}, $_->{'offset'} + $flash_start,
+ $_->{'size'}, $_->{'skips'});
+
+ # If this is the FIS directory, then write the partition table data into it.
+ if ($_->{'name'} eq "FIS directory") {
+ # Explicitly terminate the partition data.
+ $partition_data .= pack("C",0xff) x 0x100;
+ $_->{'data'} = padBytes($partition_data, $_->{'size'});
+ }
+
+ my $size = length($_->{'data'});
+
+ # Keep the user appraised ...
+ $debug and printf("Table entry <%s> from 0x%08X to 0x%08X (%s / %s)%s\n",
+ $_->{'name'}, $_->{'start'}, $_->{'start'} + $_->{'size'},
+ ($size >= $block_size ?
+ sprintf("%d blocks", numBlocks($size)) :
+ sprintf("0x%05X bytes", $size)),
+ ($_->{'size'} >= $block_size ?
+ sprintf("%d blocks", numBlocks($_->{'size'})) :
+ sprintf("0x%05X bytes", $_->{'size'})),
+ (defined $_->{'skips'} ?
+ sprintf("\nTable entry <%s> skip %s", $_->{'name'},
+ join(", ",
+ map { sprintf("0x%08X to 0x%08X", $_->{'offset'},
+ $_->{'offset'} + $_->{'size'} - 1) }
+ @{$_->{'skips'}})) :
+ "")
+ );
+ }
+ else {
+ $debug and print "No table entry required for <", $_->{'name'}, ">\n";
+ }
+
+ } @partitions;
+
+ return;
+}
+
+sub writeOutFirmware {
+ my($filename, @partitions) = @_;
+
+ # Clear the image to start.
+ my $image_buf = "";
+
+ map {
+
+ # We can only write a partition if it has an offset, a size, and some data to write.
+ if (defined $_->{'offset'} and defined $_->{'size'} and defined $_->{'data'}) {
+
+ # Keep track of the end of the image.
+ my $end_point = length($image_buf);
+
+ # If the next partition is well past the end of the current image, then pad it.
+ if ($_->{'offset'} > $end_point) {
+ $image_buf .= padBytes("", $_->{'offset'} - $end_point);
+ $quiet or printf("Padded %s before <%s> in \"%s\"\n",
+ ((length($image_buf) - $end_point) >= $block_size ?
+ sprintf("%d blocks", numBlocks(length($image_buf) - $end_point)) :
+ sprintf("0x%05X bytes", length($image_buf) - $end_point)),
+ $_->{'name'}, $filename);
+ }
+
+ # If the next parition is before the end of the current image, then rewind.
+ elsif ($_->{'offset'} < $end_point) {
+ $debug and printf("Rewound %s before <%s> in \"%s\"\n",
+ (($end_point - $_->{'offset'}) >= $block_size ?
+ sprintf("%d blocks", numBlocks($end_point - $_->{'offset'})) :
+ sprintf("0x%05X bytes", $end_point - $_->{'offset'})),
+ $_->{'name'}, $filename);
+# if (($end_point - $_->{'offset'}) >= $block_size) {
+# die "Allocation error: rewound a full block or more ...\n";
+# }
+ }
+
+ # If skip regions are defined, add them to the data.
+ if (defined $_->{'skips'}) {
+ my $added = 0;
+ foreach my $region (@{$_->{'skips'}}) {
+ if (($region->{'offset'} > 0) or
+ not ($_->{'header'} > 0)) {
+ $debug and printf("Inserted 0x%05X bytes (at offset 0x%05X) into <%s>\n",
+ $region->{'size'}, $region->{'offset'}, $_->{'name'});
+ substr($_->{'data'},
+ $region->{'offset'} + $added - $_->{'header'},
+ 0, $region->{'data'});
+ $added += $region->{'size'};
+ }
+ }
+ }
+
+ # Splice the data into the image at the appropriate place, padding as required.
+ substr($image_buf, $_->{'offset'}, $_->{'size'},
+ $_->{'header'} ?
+ padBytes(pack("N4",length($_->{'data'})).$_->{'data'}, $_->{'size'}) :
+ padBytes($_->{'data'}, $_->{'size'}));
+
+ # Keep the user appraised ...
+ $quiet or printf("Wrote %s (0x%08X to 0x%08X) from <%s> into \"%s\"\n",
+ ($_->{'size'} >= $block_size ?
+ sprintf("%2d blocks", numBlocks($_->{'size'})) :
+ sprintf("0x%05X bytes", $_->{'size'})),
+ $_->{'offset'}, $_->{'offset'}+$_->{'size'}, $_->{'name'}, $filename);
+ }
+
+ # If we are not able to write a partition, then give debug information about why.
+ else {
+ $debug and printf("Skipping <%s> (%s)\n", $_->{'name'},
+ (not defined $_->{'offset'}) ? "no offset defined" :
+ ((not defined $_->{'size'}) ? "no size defined" :
+ "no data available"));
+ }
+
+ } @partitions;
+
+ # Write the image to the specified file.
+ writeOut($image_buf, $filename);
+
+ return;
+}
+
+# checkPartitionTable: sanity check partition table - for testing but might evolve into setting @partitions
+# so that we can write out jffs2 partitions from a read image
+# currently not nearly paranoid enough
+sub checkPartitionTable {
+ my($data) = @_;
+
+ my($pointer) = 0;
+ my($entry);
+
+ my($name, $flash_base, $size, $done, $dummy_long, $padding);
+ do {
+ $entry = substr($data, $pointer, 0x100);
+
+ ($name,$flash_base,$dummy_long,$size,$dummy_long,$dummy_long,$padding,$dummy_long,$dummy_long) = unpack("a16N5x212N2",$entry);
+ $name =~ s/\0//g;
+ $debug and printf("pointer: %d\tname: %s%sflash_base: 0x%08X\tsize: 0x%08X\n",
+ $pointer, $name, (" " x (16 - length($name))), $flash_base, $size);
+ $pointer += 0x100;
+ $debug and printf("terminator: 0x%08X\n", unpack("C", substr($data, $pointer, 1)));
+ if (unpack("C", substr($data, $pointer, 1)) eq 0xff) {
+ $done = 1;
+ }
+ } until $done;
+}
+
+sub printPartitions {
+ my(@partitions) = @_;
+
+ my($offset, $size, $skips);
+ map {
+# defined $_->{'size'} ? $size = $_->{'size'} : $size = undef;
+
+ if (defined $_->{'size'}) {
+ $size = $_->{'size'};
+ }
+ else {
+ $size = undef;
+ }
+ if (defined $_->{'offset'}) {
+ $offset = $_->{'offset'};
+ }
+ else {
+ $offset = undef;
+ }
+ if (defined $_->{'skips'}) {
+ $skips = $_->{'skips'};
+ }
+ else {
+ $skips = undef;
+ }
+ printf("%s%s", $_->{'name'}, (" " x (16 - length($_->{'name'}))));
+ if (defined $offset) { printf("0x%08X\t", $offset); } else { printf("(undefined)\t"); };
+ if (defined $size) { printf("0x%08X", $size); } else { printf("(undefined)"); };
+ if (defined $skips) {
+ printf("\t[%s]",
+ join(", ",
+ map { sprintf("0x%05X/0x%05X", $_->{'offset'}, $_->{'size'}); }
+ @$skips));
+ }
+ printf("\n");
+ } @partitions;
+}
+
+sub defaultPartitions {
+
+ return ({'name'=>'RedBoot', 'file'=>'RedBoot',
+ 'offset'=>0x00000000, 'size'=>0x00040000,
+ 'variable'=>0, 'header'=>0, 'pseudo'=>0, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'EthAddr', 'file'=>undef,
+ 'offset'=>0x0003ffb0, 'size'=>0x00000006,
+ 'variable'=>0, 'header'=>0, 'pseudo'=>1, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'SysConf', 'file'=>'SysConf',
+ 'offset'=>0x00040000, 'size'=>0x00020000,
+ 'variable'=>0, 'header'=>0, 'pseudo'=>0, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'Loader', 'file'=>'apex.bin',
+ 'offset'=>undef, 'size'=>undef,
+ 'variable'=>1, 'header'=>16, 'pseudo'=>0, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'Kernel', 'file'=>'vmlinuz',
+ 'offset'=>undef, 'size'=>undef,
+ 'variable'=>1, 'header'=>16, 'pseudo'=>0, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'Ramdisk', 'file'=>'ramdisk.gz',
+ 'offset'=>undef, 'size'=>undef,
+ 'variable'=>1, 'header'=>16, 'pseudo'=>0, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'FIS directory', 'file'=>undef,
+ 'offset'=>0x007e0000, 'size'=>0x00020000,
+ 'variable'=>0, 'header'=>0, 'pseudo'=>0, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'Loader config', 'file'=>undef,
+ 'offset'=>0x007f8000, 'size'=>0x00004000,
+ 'variable'=>0, 'header'=>0, 'pseudo'=>1, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'Microcode', 'file'=>'NPE-B',
+ 'offset'=>0x007fc000, 'size'=>0x00003fe0,
+ 'variable'=>0, 'header'=>16, 'pseudo'=>1, 'data'=>undef, 'byteswap'=>0},
+ {'name'=>'Trailer', 'file'=>'Trailer',
+ 'offset'=>0x007ffff0, 'size'=>0x00000010,
+ 'variable'=>0, 'header'=>0, 'pseudo'=>1, 'data'=>undef, 'byteswap'=>0});
+}
+
+# Main routine starts here ...
+
+my($unpack, $pack, $little, $fatflash, $input, $output, $redboot);
+my($kernel, $sysconf, $ramdisk, $fisdir);
+my($microcode, $trailer, $ethaddr, $loader);
+
+END {
+ # Remove temporary files
+ for my $file (@cleanup) {
+ unlink $file;
+ }
+}
+
+if (!GetOptions("d|debug" => \$debug,
+ "q|quiet" => \$quiet,
+ "u|unpack" => \$unpack,
+ "p|pack" => \$pack,
+ "l|little" => \$little,
+ "F|fatflash" => \$fatflash,
+ "i|input=s" => \$input,
+ "o|output=s" => \$output,
+ "b|redboot=s" => \$redboot,
+ "k|kernel=s" => \$kernel,
+ "s|sysconf=s" => \$sysconf,
+ "r|ramdisk=s" => \$ramdisk,
+ "f|fisdir=s" => \$fisdir,
+ "m|microcode=s" => \$microcode,
+ "t|trailer=s" => \$trailer,
+ "e|ethaddr=s" => \$ethaddr,
+ "L|loader=s" => \$loader,
+ ) or (not defined $pack and not defined $unpack)) {
+ print "Usage: slugimage <options>\n";
+ print "\n";
+ print " [-d|--debug] Turn on debugging output\n";
+ print " [-q|--quiet] Turn off status messages\n";
+ print " [-u|--unpack] Unpack a firmware image\n";
+ print " [-p|--pack] Pack a firmware image\n";
+ print " [-l|--little] Convert Kernel and Ramdisk to little-endian\n";
+ print " [-F|--fatflash] Generate an image for 16MB flash\n";
+ print " [-i|--input] <file> Input firmware image filename\n";
+ print " [-o|--output] <file> Output firmware image filename\n";
+ print " [-b|--redboot] <file> Input/Output RedBoot filename\n";
+ print " [-s|--sysconf] <file> Input/Output SysConf filename\n";
+ print " [-L|--loader] <file> Second stage boot loader filename\n";
+ print " [-k|--kernel] <file> Input/Ouptut Kernel filename\n";
+ print " [-r|--ramdisk] <file> Input/Output Ramdisk filename(s)\n";
+ print " [-f|--fisdir] <file> Input/Output FIS directory filename\n";
+ print " [-m|--microcode] <file> Input/Output Microcode filename\n";
+ print " [-t|--trailer] <file> Input/Output Trailer filename\n";
+ print " [-e|--ethaddr] <AABBCCDDEEFF> Set the Ethernet address\n";
+
+ # %%% TODO %%% Document --ramdisk syntax
+
+ exit 1;
+}
+
+my(@partitions) = defaultPartitions();
+
+if ($pack) {
+ die "Output filename must be specified\n" unless defined $output;
+
+ # If we're creating an image and no RedBoot, SysConf partition is
+ # explicitly specified, simply write an empty one as the upgrade tools
+ # don't touch RedBoot and SysConf anyway. If no Trailer is specified,
+ # put in one.
+ if (not defined $redboot and not -e "RedBoot") {
+ $redboot = tmpnam();
+ open TMP, ">$redboot" or die "Cannot open file $redboot: $!";
+ push @cleanup, $redboot;
+ # The RedBoot partition is 256 * 1024 = 262144; the trailer we add
+ # is 70 bytes.
+ print TMP "\0"x(262144-70);
+ # Upgrade tools check for an appropriate Sercomm trailer.
+ for my $i (@sercomm_redboot_trailer) {
+ print TMP pack "S", $i;
+ }
+ close TMP;
+ }
+ if (not defined $sysconf and not -e "SysConf") {
+ $sysconf = tmpnam();
+ open TMP, ">$sysconf" or die "Cannot open file $sysconf: $!";
+ push @cleanup, $sysconf;
+ # The SysConf partition is 128 * 1024 = 131072
+ print TMP "\0"x131072;
+ close TMP;
+ }
+ if (not defined $trailer and not -e "Trailer") {
+ $trailer = tmpnam();
+ open TMP, ">$trailer" or die "Cannot open file $trailer: $!";
+ push @cleanup, $trailer;
+ for my $i (@sercomm_flash_trailer) {
+ print TMP pack "S", $i;
+ }
+ close TMP;
+ }
+
+ # If the microcode was not specified, then don't complain that it's missing.
+ if (not defined $microcode and not -e "NPE-B") {
+ map { ($_->{'name'} eq 'Microcode') && ($_->{'file'} = undef); } @partitions;
+ }
+}
+
+# Go through the partition options, and set the names and files in @partitions
+if (defined $redboot) { map { ($_->{'name'} eq 'RedBoot') && ($_->{'file'} = $redboot); } @partitions; }
+if (defined $sysconf) { map { ($_->{'name'} eq 'SysConf') && ($_->{'file'} = $sysconf); } @partitions; }
+if (defined $loader) { map { ($_->{'name'} eq 'Loader') && ($_->{'file'} = $loader); } @partitions; }
+if (defined $kernel) { map { ($_->{'name'} eq 'Kernel') && ($_->{'file'} = $kernel); } @partitions; }
+if (defined $fisdir) { map { ($_->{'name'} eq 'FIS directory') && ($_->{'file'} = $fisdir); } @partitions; }
+if (defined $microcode) { map { ($_->{'name'} eq 'Microcode') && ($_->{'file'} = $microcode); } @partitions; }
+if (defined $trailer) { map { ($_->{'name'} eq 'Trailer') && ($_->{'file'} = $trailer); } @partitions; }
+
+if (defined $little) {
+ map {
+ if (($_->{'name'} eq 'Loader') or
+ ($_->{'name'} eq 'Kernel') or
+ ($_->{'name'} eq 'Ramdisk')) {
+ $_->{'byteswap'} = 1;
+ }
+ } @partitions;
+}
+
+if (defined $fatflash) {
+ $flash_len = 0x01000000;
+ map {
+ if (($_->{'name'} eq 'FIS directory') or
+ ($_->{'name'} eq 'Loader config') or
+ ($_->{'name'} eq 'Microcode') or
+ ($_->{'name'} eq 'Trailer')) {
+ $_->{'offset'} += 0x00800000;
+ }
+ } @partitions;
+}
+
+if (defined $ethaddr) {
+ map {
+ if ($_->{'name'} eq 'EthAddr') {
+ $ethaddr =~ s/://g;
+ if (($ethaddr !~ m/^[0-9A-Fa-f]+$/) or (length($ethaddr) != 12)) {
+ die "Invalid ethernet address specification: '".$ethaddr."'\n";
+ }
+ $_->{'data'} = pack("H12", $ethaddr);
+ }
+ } @partitions;
+}
+
+if (defined $ramdisk) {
+
+ # A single filename is used for the ramdisk filename
+ if ($ramdisk !~ m/[:,]/) {
+ map { ($_->{'name'} eq 'Ramdisk') && ($_->{'file'} = $ramdisk); } @partitions;
+ }
+
+ # otherwise, it's a list of name:file mappings
+ else {
+ my @mappings = split(',', $ramdisk);
+
+ # Find the index of the Ramdisk entry
+ my $index;
+ my $count = 0;
+ map {
+ if (not defined $index) {
+ if ($_->{'name'} eq "Ramdisk") {
+ $index = $count;
+ }
+ $count++;
+ }
+ } @partitions;
+
+ defined $index or die "Cannot find the Ramdisk partition\n";
+
+ # Replace the Ramdisk entry with the new mappings
+ splice(@partitions, $index, 1, map {
+
+ # Preserve the information from the ramdisk entry
+ my %entry = %{$partitions[$index]};
+
+ # Parse the mapping
+ ($_ =~ m/^([^:]+):([^:]+)(:([^:]+))?$/) or die "Invalid syntax in --ramdisk\n";
+ $entry{'name'} = $1; $entry{'file'} = $2; my $size = $4;
+
+ # If the mapping is not for the ramdisk, then undefine its attributes
+ if ($entry{'name'} ne 'Ramdisk') {
+ $entry{'offset'} = undef;
+ $entry{'size'} = undef;
+ $entry{'variable'} = 1;
+ $entry{'header'} = 0;
+ $entry{'pseudo'} = 0;
+ $entry{'data'} = undef;
+ $entry{'byteswap'} = 0;
+ }
+
+ # Support specification of the number of blocks for empty jffs2
+ if ($entry{'file'} =~ m/^[0-9]+$/) {
+ $size = $entry{'file'};
+ $entry{'file'} = undef;
+ }
+
+ # If the user has specified a size, then respect their wishes
+ if (defined $size) {
+ $entry{'size'} = $size * $block_size;
+ # Create an empty partition of the requested size.
+ $entry{'data'} = padBytes("", $entry{'size'} - $entry{'header'});
+ }
+
+ \%entry;
+
+ } @mappings);
+ }
+}
+
+# Read in the firmware image
+if ($input) {
+ if ($debug) {
+ print "Initial partition map:\n";
+ printPartitions(@partitions);
+ }
+
+ my $result = readInFirmware($input, \@partitions);
+
+ if ($debug) {
+ print "After reading firmware:\n";
+ printPartitions(@partitions);
+ }
+}
+
+# Unpack the firmware if requested
+if ($unpack) {
+ die "Input filename must be specified\n" unless defined $input;
+
+# map {
+# ($_->{'name'} eq 'FIS directory') and @partitions = checkPartitionTable($_->{'data'});
+# } @partitions;
+
+ writeOutFirmwareParts(@partitions);
+
+}
+
+# Pack the firmware if requested
+if ($pack) {
+
+ if (!defined $loader) {
+ removeOptionalLoader(\@partitions);
+ }
+
+ if ($debug) {
+ print "Initial partition map:\n";
+ printPartitions(@partitions);
+ }
+
+ my $result = readInFirmwareParts(@partitions);
+
+ if ($debug) {
+ print "after readInFirmwareParts():\n";
+ printPartitions(@partitions);
+# map {
+# ($_->{'name'} eq 'RedBoot') && (printRedbootTrailer($_->{'data'}));
+# } @partitions;
+ }
+
+ layoutPartitions(@partitions);
+
+ if ($debug) {
+ print "after layoutPartitions():\n";
+ printPartitions(@partitions);
+ }
+
+ buildPartitionTable(@partitions);
+
+ if ($debug) {
+ print "after buildPartitionTable():\n";
+ printPartitions(@partitions);
+
+# my($lastblock);
+# map {
+# if ($_->{'name'} eq 'FIS directory') {
+# $lastblock = $_->{'data'};
+# }
+# } @partitions;
+
+# print "checkPartitionTable():\n";
+# checkPartitionTable($lastblock);
+ }
+
+ writeOutFirmware($output, @partitions);
+
+}
+
+exit 0;
diff --git a/scripts/.svn/text-base/strip-kmod.sh.svn-base b/scripts/.svn/text-base/strip-kmod.sh.svn-base
new file mode 100644
index 0000000..13e6b58
--- /dev/null
+++ b/scripts/.svn/text-base/strip-kmod.sh.svn-base
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+[ -n "$CROSS" ] || {
+ echo "The variable CROSS must be set to point to the cross-compiler prefix"
+ exit 1
+}
+
+MODULE="$1"
+
+[ "$#" -ne 1 ] && {
+ echo "Usage: $0 <module>"
+ exit 1
+}
+
+ARGS=
+if [ -n "$KEEP_SYMBOLS" ]; then
+ ARGS="-X --strip-debug"
+else
+ ARGS="-x -G __this_module --strip-unneeded"
+fi
+
+${CROSS}objcopy \
+ -R .comment \
+ -R .pdr \
+ -R .mdebug.abi32 \
+ -R .note.gnu.build-id \
+ -R .gnu.attributes \
+ -R .reginfo \
+ $ARGS \
+ "$MODULE" "$MODULE.tmp"
+
+[ -n "$NO_RENAME" ] && {
+ mv "${MODULE}.tmp" "$MODULE"
+ exit 0
+}
+
+${CROSS}nm "$MODULE.tmp" | awk '
+BEGIN {
+ n = 0
+}
+
+$3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ && !def[$3] {
+ print "--redefine-sym "$3"=_"n;
+ n = n + 1
+ def[$3] = 1
+}
+' > "$MODULE.tmp1"
+
+${CROSS}objcopy `cat ${MODULE}.tmp1` ${MODULE}.tmp ${MODULE}.out
+mv "${MODULE}.out" "${MODULE}"
+rm -f "${MODULE}".t*
diff --git a/scripts/.svn/text-base/symlink-tree.sh.svn-base b/scripts/.svn/text-base/symlink-tree.sh.svn-base
new file mode 100644
index 0000000..e44ebda
--- /dev/null
+++ b/scripts/.svn/text-base/symlink-tree.sh.svn-base
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+# Create a new openwrt tree with symlinks pointing at the current tree
+# Usage: ./scripts/symlink-tree.sh <destination>
+
+FILES="
+ BSDmakefile
+ Config.in
+ LICENSE
+ Makefile
+ README
+ dl
+ docs
+ feeds.conf.default
+ include
+ package
+ rules.mk
+ scripts
+ target
+ toolchain
+ tools"
+
+if [ -f feeds.conf ] ; then
+ FILES="$FILES feeds.conf"
+fi
+
+if [ -z "$1" ]; then
+ echo "Syntax: $0 <destination>" >&2
+ exit 1
+fi
+
+if [ -e "$1" ]; then
+ echo "Error: $1 already exists" >&2
+ exit 1
+fi
+
+set -e # fail if any commands fails
+mkdir -p dl "$1"
+for file in $FILES; do
+ [ -e "$PWD/$file" ] || {
+ echo "ERROR: $file does not exist in the current tree" >&2
+ exit 1
+ }
+ ln -s "$PWD/$file" "$1/"
+done
+exit 0
diff --git a/scripts/.svn/text-base/timestamp.pl.svn-base b/scripts/.svn/text-base/timestamp.pl.svn-base
new file mode 100644
index 0000000..e24d814
--- /dev/null
+++ b/scripts/.svn/text-base/timestamp.pl.svn-base
@@ -0,0 +1,69 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+use strict;
+
+sub get_ts($$) {
+ my $path = shift;
+ my $options = shift;
+ my $ts = 0;
+ my $fn = "";
+ $path .= "/" if( -d $path);
+ open FIND, "find $path -type f -and -not -path \\*/.svn\\* -and -not -path \\*CVS\\* $options 2>/dev/null |";
+ while (<FIND>) {
+ chomp;
+ my $file = $_;
+ next if -l $file;
+ my $mt = (stat $file)[9];
+ if ($mt > $ts) {
+ $ts = $mt;
+ $fn = $file;
+ }
+ }
+ close FIND;
+ return ($ts, $fn);
+}
+
+(@ARGV > 0) or push @ARGV, ".";
+my $ts = 0;
+my $n = ".";
+my %options;
+while (@ARGV > 0) {
+ my $path = shift @ARGV;
+ if ($path =~ /^-x/) {
+ my $str = shift @ARGV;
+ $options{"findopts"} .= " -and -not -path '".$str."'"
+ } elsif ($path =~ /^-f/) {
+ $options{"findopts"} .= " -follow";
+ } elsif ($path =~ /^-n/) {
+ my $arg = $ARGV[0];
+ $options{$path} = $arg;
+ } elsif ($path =~ /^-/) {
+ $options{$path} = 1;
+ } else {
+ my ($tmp, $fname) = get_ts($path, $options{"findopts"});
+ if ($tmp > $ts) {
+ if ($options{'-F'}) {
+ $n = $fname;
+ } else {
+ $n = $path;
+ }
+ $ts = $tmp;
+ }
+ }
+}
+
+if ($options{"-n"}) {
+ exit ($n eq $options{"-n"} ? 0 : 1);
+} elsif ($options{"-p"}) {
+ print "$n\n";
+} elsif ($options{"-t"}) {
+ print "$ts\n";
+} else {
+ print "$n\t$ts\n";
+}
diff --git a/scripts/.svn/text-base/update-package-md5sum.svn-base b/scripts/.svn/text-base/update-package-md5sum.svn-base
new file mode 100644
index 0000000..1cf1716
--- /dev/null
+++ b/scripts/.svn/text-base/update-package-md5sum.svn-base
@@ -0,0 +1,38 @@
+#!/usr/bin/env sh
+#
+# update-package-md5sum - Updates md5sum of OpenWrt packages
+#
+# update-package-md5sum will update the md5sum for all recusivly found OpenWrt packages
+# in a given directory.
+#
+# Usage: scripts/update-package-md5sum <package directory>
+#
+# Example: `scripts/update-package-md5sum feeds/packages/python`
+
+DL_FOLDER=`grep -Eo '^CONFIG_DOWNLOAD_FOLDER=".*"$' .config | \
+ sed 's,^CONFIG_DOWNLOAD_FOLDER="\(.*\)"$,\1,'`
+if test -z ${DL_FOLDER}; then
+ DL_FOLDER=./dl
+fi
+
+if test -z "$1"; then
+ echo "Usage: $0 <package directory>"
+ exit
+fi
+
+for file in `find $1 -name Makefile`; do
+ if grep BuildPackage ${file} > /dev/null; then
+ source=`DUMP=1 TOPDIR=\`pwd\` make -f ${file} | grep -m 1 Source | cut -f 2 -d ' '`
+ if test -n "${source}"; then
+ if test ! -f "${DL_FOLDER}/${source}"; then
+ make package/`basename \`dirname ${file}\``/download
+ fi
+ sum=`md5sum ${DL_FOLDER}/${source} 2> /dev/null` || continue
+ echo Updating ${file}...
+ sum=`echo ${sum} | cut -d ' ' -f 1`
+ sed -i "s,^PKG_MD5SUM:=.*,PKG_MD5SUM:=${sum}," ${file}
+ else
+ echo No source for ${file}
+ fi
+ fi
+done