]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/porterbox/files/setup-all-dchroots
Set up armhf porting chroots on armel hosts
[dsa-puppet.git] / modules / porterbox / files / setup-all-dchroots
1 #!/bin/bash
2
3 ##
4 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
5 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
6 ##
7
8 # Copyright (c) 2013 Peter Palfrader
9 #
10 # Permission is hereby granted, free of charge, to any person
11 # obtaining a copy of this software and associated documentation
12 # files (the "Software"), to deal in the Software without
13 # restriction, including without limitation the rights to use,
14 # copy, modify, merge, publish, distribute, sublicense, and/or sell
15 # copies of the Software, and to permit persons to whom the
16 # Software is furnished to do so, subject to the following
17 # conditions:
18 #
19 # The above copyright notice and this permission notice shall be
20 # included in all copies or substantial portions of the Software.
21 #
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
24 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
27 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 # OTHER DEALINGS IN THE SOFTWARE.
30
31 DPKGARCH=$(dpkg --print-architecture)
32 UNAMEARCH=$(uname -m)
33
34 get_suites() {
35     case "$1" in
36       armhf|s390x)
37         echo "sid jessie wheezy"
38         ;;
39       s390)
40         echo "wheezy squeeze"
41         ;;
42       *)
43         echo "sid jessie wheezy squeeze"
44         ;;
45     esac
46 }
47
48 archs="$DPKGARCH"
49 case "$DPKGARCH" in
50     amd64)
51         archs="$archs i386"
52         ;;
53     armhf)
54         archs="$archs armel"
55         ;;
56     armel)
57         if [ "$(uname -m)" = "armv7l" ] && grep -w vfpv3 -q /proc/cpuinfo ; then
58             archs="$archs armhf"
59         fi
60         ;;
61     s390|s390x)
62         archs="s390 s390x"
63         ;;
64 esac
65
66 err=0
67
68 for a in $archs; do
69     for s in `get_suites "$a"`; do
70         setup-dchroot -f -a "$a" "$s" || err=1
71     done
72 done
73
74 exit $err