build/install: Fix missing arch list from Release
[armband.git] / patches / opnfv-fuel / multiarch-mirrors / 0001-build-install-Add-arm64-deb-repositories-setup.patch
1 From: Stanislaw Kardach <stanislaw.kardach@cavium.com>
2 Date: Wed, 24 Feb 2016 20:04:03 +0100
3 Subject: [PATCH] build/install: Add arm64 deb repositories setup
4
5 If local MOS mirror patching is enabled, we need to regenerate the
6 repo metadata using apt-ftparchive.
7
8 [ Alexandru Avadanii ]
9 Fixed non-existing paths for deb files, slightly refactoring our
10 approach.
11
12 FIXME: Use UBUNTU_ARCH env var instead of hardcoding the arch list.
13 While fixing that, also take care of missed s/trusty/mos9.0/g
14 in {un,}install.sh.
15
16 Closes-bug: ARMBAND-163
17
18 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
19 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
20 ---
21  build/f_isoroot/f_kscfg/ks.cfg.patch      | 10 ++++++++++
22  build/install/apt-ftparchive-deb.conf     |  9 ++++-----
23  build/install/apt-ftparchive-release.conf |  2 +-
24  build/install/apt-ftparchive-udeb.conf    | 10 ++++------
25  build/install/install.sh                  | 22 ++++++++++++++++++----
26  build/install/uninstall.sh                | 18 ++++++++++--------
27  6 files changed, 47 insertions(+), 24 deletions(-)
28
29 diff --git a/build/f_isoroot/f_kscfg/ks.cfg.patch b/build/f_isoroot/f_kscfg/ks.cfg.patch
30 index a6840e4..84a241f 100644
31 --- a/build/f_isoroot/f_kscfg/ks.cfg.patch
32 +++ b/build/f_isoroot/f_kscfg/ks.cfg.patch
33 @@ -1,5 +1,15 @@
34  *** /dev/null  2016-04-26 10:10:11.481587709 +0200
35  --- ks.cfg     2016-04-26 10:10:11.481587709 +0200
36  ***************
37 +*** 448,453 ****
38 +--- 448,454 ----
39 +  cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64
40 +
41 +  # Copying Ubuntu files
42 ++ # FIXME: This is missleading as dist/pool may contain multiple arch!
43 +  mkdir -p ${repodir}/ubuntu/x86_64/images
44 +  cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64
45 +  cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64
46 +***************
47  *** 579,584 ****
48  --- 579,592 ----
49 diff --git a/build/install/apt-ftparchive-deb.conf b/build/install/apt-ftparchive-deb.conf
50 index edcb1f2..81ead2b 100644
51 --- a/build/install/apt-ftparchive-deb.conf
52 +++ b/build/install/apt-ftparchive-deb.conf
53 @@ -10,14 +10,13 @@
54
55  Dir {
56    ArchiveDir ".";
57 +  CacheDir "/tmp";
58  };
59
60 -TreeDefault {
61 +Tree "dists/mos9.0" {
62 +  Architectures "amd64 arm64";
63    Directory "pool";
64 -};
65 -
66 -BinDirectory "pool/main" {
67 -  Packages "dists/mos9.0/main/binary-amd64/Packages";
68 +  Sections "main";
69  };
70
71  Default {
72 diff --git a/build/install/apt-ftparchive-release.conf b/build/install/apt-ftparchive-release.conf
73 index e40ff68..ceaf71a 100644
74 --- a/build/install/apt-ftparchive-release.conf
75 +++ b/build/install/apt-ftparchive-release.conf
76 @@ -13,6 +13,7 @@ APT::FTPArchive::Release::Label "mos9.0";
77  APT::FTPArchive::Release::Suite "mos9.0";
78  APT::FTPArchive::Release::Version "14.04";
79  APT::FTPArchive::Release::Codename "mos9.0";
80 -APT::FTPArchive::Release::Architectures "amd64";
81 +APT::FTPArchive::Release::Architectures "amd64 arm64";
82  APT::FTPArchive::Release::Components "main";
83  APT::FTPArchive::Release::Description "Ubuntu Trusty Tahr 14.04 LTS";
84 +APT::FTPArchive::Contents "no";
85 diff --git a/build/install/apt-ftparchive-udeb.conf b/build/install/apt-ftparchive-udeb.conf
86 index 3b5b239..8852db7 100644
87 --- a/build/install/apt-ftparchive-udeb.conf
88 +++ b/build/install/apt-ftparchive-udeb.conf
89 @@ -10,15 +10,13 @@
90
91  Dir {
92    ArchiveDir ".";
93 +  CacheDir "/tmp";
94  };
95
96 -TreeDefault {
97 +Tree "dists/mos9.0" {
98 +  Architectures "amd64 arm64";
99    Directory "pool";
100 -};
101 -
102 -BinDirectory "pool/debian-installer" {
103 -  Packages "dists/trusty/main/debian-installer/binary-amd64/Packages";
104 -  BinOverride "./indices/override.trusty.main.debian-installer";
105 +  Sections "main";
106  };
107
108  Default {
109 diff --git a/build/install/install.sh b/build/install/install.sh
110 index d1a49f3..0561207 100755
111 --- a/build/install/install.sh
112 +++ b/build/install/install.sh
113 @@ -122,12 +122,24 @@ prep_make_live() {
114      ssh-copy-id root@$FUELHOST
115      sshfs root@1${FUELHOST}:/ $TMP_HOSTMOUNT
116
117 -    if [ -f  $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
118 +    for arch in arm64 amd64; do
119 +    if [ -f  $REPO/dists/trusty/main/binary-${arch}/Packages.backup ]; then
120 +        echo "Error - found backup file for Packages for ${arch}!"
121 +        exit 1
122 +    fi
123 +
124 +    if [ -f  $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup ]; then
125 +        echo "Error - found backup file for Packages.gz for ${arch}!"
126 +        exit 1
127 +    fi
128 +    done
129 +
130 +    if [ -f  $REPO/dists/trusty/main/binary-arm64/Packages.backup ]; then
131          echo "Error - found backup file for Packages!"
132          exit 1
133      fi
134
135 -    if [ -f  $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
136 +    if [ -f  $REPO/dists/trusty/main/binary-arm64/Packages.gz.backup ]; then
137          echo "Error - found backup file for Packages.gz!"
138          exit 1
139      fi
140 @@ -142,8 +154,10 @@ prep_make_live() {
141          exit 1
142      fi
143
144 -    cp $REPO/dists/trusty/main/binary-amd64/Packages $REPO/dists/trusty/main/binary-amd64/Packages.backup
145 -    cp $REPO/dists/trusty/main/binary-amd64/Packages.gz $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup
146 +    for arch in arm64 amd64; do
147 +        cp $REPO/dists/trusty/main/binary-${arch}/Packages $REPO/dists/trusty/main/binary-${arch}/Packages.backup
148 +        cp $REPO/dists/trusty/main/binary-${arch}/Packages.gz $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup
149 +    done
150      cp $REPO/dists/trusty/Release $REPO/dists/trusty/Release.backup
151      cp -Rvp $DEST/etc/puppet $DEST/etc/puppet.backup
152  }
153 diff --git a/build/install/uninstall.sh b/build/install/uninstall.sh
154 index a9e74bc..e90c632 100755
155 --- a/build/install/uninstall.sh
156 +++ b/build/install/uninstall.sh
157 @@ -31,15 +31,17 @@ DEST=$MOUNT
158  REPO=$DEST/var/www/nailgun/ubuntu/fuelweb/x86_64
159
160  cd $REPO
161 -if [ ! -f  $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
162 -    echo "Error - didn't find backup file for Packages!"
163 -    exit 1
164 -fi
165 +for arch in arm64 amd64; do
166 +    if [ ! -f  $REPO/dists/trusty/main/binary-${arch}/Packages.backup ]; then
167 +        echo "Error - didn't find backup file for Packages for ${arch}!"
168 +        exit 1
169 +    fi
170
171 -if [ ! -f  $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
172 -    echo "Error - didn't find backup file for Packages.gz!"
173 -    exit 1
174 -fi
175 +    if [ ! -f  $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup ]; then
176 +        echo "Error - didn't find backup file for Packages.gz for ${arch}!"
177 +        exit 1
178 +    fi
179 +done
180
181  if [ ! -f  $REPO/dists/trusty/Release.backup ]; then
182      echo "Error - didn't find backup file for Release!"