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