496acf07b83f9a73a3371f8f6f66cecd90f88818
[armband.git] / patches / opnfv-fuel / 0003-Add-arm64-deb-repositories-setup.patch
1 From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
2 Date: Wed, 24 Feb 2016 20:04:03 +0100
3 Subject: [PATCH] Add arm64 deb repositories setup
4
5 ---
6  build/f_isoroot/f_kscfg/ks.cfg            |  1 +
7  build/install/apt-ftparchive-deb.conf     |  8 +++++++-
8  build/install/apt-ftparchive-release.conf |  2 +-
9  build/install/apt-ftparchive-udeb.conf    |  7 ++++++-
10  build/install/install.sh                  | 22 ++++++++++++++++++----
11  build/install/uninstall.sh                | 20 +++++++++++---------
12  6 files changed, 44 insertions(+), 16 deletions(-)
13
14 diff --git a/build/f_isoroot/f_kscfg/ks.cfg b/build/f_isoroot/f_kscfg/ks.cfg
15 index c93babe..30bad1d 100644
16 --- a/build/f_isoroot/f_kscfg/ks.cfg
17 +++ b/build/f_isoroot/f_kscfg/ks.cfg
18 @@ -448,6 +448,7 @@ cp -r ${SOURCE}/extra-repos ${repodir}/
19  cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64
20  
21  # Copying Ubuntu files
22 +# FIXME: This is missleading as dist/pool may contain multiple arch!
23  mkdir -p ${repodir}/ubuntu/x86_64/images
24  cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64
25  cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64
26 diff --git a/build/install/apt-ftparchive-deb.conf b/build/install/apt-ftparchive-deb.conf
27 index 0d15aec..e6392f8 100644
28 --- a/build/install/apt-ftparchive-deb.conf
29 +++ b/build/install/apt-ftparchive-deb.conf
30 @@ -16,12 +16,18 @@ TreeDefault {
31    Directory "pool";
32  };
33  
34 -BinDirectory "pool/main" {
35 +BinDirectory "pool/main/binary-amd64" {
36    Packages "dists/trusty/main/binary-amd64/Packages";
37    BinOverride "./indices/override.trusty.main";
38    ExtraOverride "./indices/override.trusty.extra.main";
39  };
40  
41 +BinDirectory "pool/main/binary-arm64" {
42 +  Packages "dists/trusty/main/binary-arm64/Packages";
43 +  BinOverride "./indices/override.trusty.main";
44 +  ExtraOverride "./indices/override.trusty.extra.main";
45 +};
46 +
47  Default {
48    Packages {
49      Extensions ".deb";
50 diff --git a/build/install/apt-ftparchive-release.conf b/build/install/apt-ftparchive-release.conf
51 index 02706bd..2838714 100644
52 --- a/build/install/apt-ftparchive-release.conf
53 +++ b/build/install/apt-ftparchive-release.conf
54 @@ -13,6 +13,6 @@ APT::FTPArchive::Release::Label "Ubuntu";
55  APT::FTPArchive::Release::Suite "trusty";
56  APT::FTPArchive::Release::Version "1.04";
57  APT::FTPArchive::Release::Codename "trusty";
58 -APT::FTPArchive::Release::Architectures "amd64";
59 +APT::FTPArchive::Release::Architectures "amd64 arm64";
60  APT::FTPArchive::Release::Components "main";
61  APT::FTPArchive::Release::Description "Ubuntu Trusty Tahr 14.04 LTS";
62 diff --git a/build/install/apt-ftparchive-udeb.conf b/build/install/apt-ftparchive-udeb.conf
63 index 3b5b239..c6ab4fb 100644
64 --- a/build/install/apt-ftparchive-udeb.conf
65 +++ b/build/install/apt-ftparchive-udeb.conf
66 @@ -16,11 +16,16 @@ TreeDefault {
67    Directory "pool";
68  };
69  
70 -BinDirectory "pool/debian-installer" {
71 +BinDirectory "pool/debian-installer/binary-amd64" {
72    Packages "dists/trusty/main/debian-installer/binary-amd64/Packages";
73    BinOverride "./indices/override.trusty.main.debian-installer";
74  };
75  
76 +BinDirectory "pool/debian-installer/binary-arm64" {
77 +  Packages "dists/trusty/main/debian-installer/binary-arm64/Packages";
78 +  BinOverride "./indices/override.trusty.main.debian-installer";
79 +};
80 +
81  Default {
82    Packages {
83      Extensions ".udeb";
84 diff --git a/build/install/install.sh b/build/install/install.sh
85 index 4e0389e..8c29e08 100755
86 --- a/build/install/install.sh
87 +++ b/build/install/install.sh
88 @@ -122,12 +122,24 @@ prep_make_live() {
89      ssh-copy-id root@$FUELHOST
90      sshfs root@1${FUELHOST}:/ $TMP_HOSTMOUNT
91  
92 -    if [ -f  $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
93 +    for arch in arm64 amd64; do
94 +    if [ -f  $REPO/dists/trusty/main/binary-${arch}/Packages.backup ]; then
95 +        echo "Error - found backup file for Packages for ${arch}!"
96 +        exit 1
97 +    fi
98 +
99 +    if [ -f  $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup ]; then
100 +        echo "Error - found backup file for Packages.gz for ${arch}!"
101 +        exit 1
102 +    fi
103 +    done
104 +
105 +    if [ -f  $REPO/dists/trusty/main/binary-arm64/Packages.backup ]; then
106          echo "Error - found backup file for Packages!"
107          exit 1
108      fi
109  
110 -    if [ -f  $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
111 +    if [ -f  $REPO/dists/trusty/main/binary-arm64/Packages.gz.backup ]; then
112          echo "Error - found backup file for Packages.gz!"
113          exit 1
114      fi
115 @@ -142,8 +154,10 @@ prep_make_live() {
116          exit 1
117      fi
118  
119 -    cp $REPO/dists/trusty/main/binary-amd64/Packages $REPO/dists/trusty/main/binary-amd64/Packages.backup
120 -    cp $REPO/dists/trusty/main/binary-amd64/Packages.gz $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup
121 +    for arch in arm64 amd64; do
122 +        cp $REPO/dists/trusty/main/binary-${arch}/Packages $REPO/dists/trusty/main/binary-${arch}/Packages.backup
123 +        cp $REPO/dists/trusty/main/binary-${arch}/Packages.gz $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup
124 +    done
125      cp $REPO/dists/trusty/Release $REPO/dists/trusty/Release.backup
126      cp -Rvp $DEST/etc/puppet $DEST/etc/puppet.backup
127  }
128 diff --git a/build/install/uninstall.sh b/build/install/uninstall.sh
129 index a9e74bc..0266e17 100755
130 --- a/build/install/uninstall.sh
131 +++ b/build/install/uninstall.sh
132 @@ -31,15 +31,17 @@ DEST=$MOUNT
133  REPO=$DEST/var/www/nailgun/ubuntu/fuelweb/x86_64
134  
135  cd $REPO
136 -if [ ! -f  $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
137 -    echo "Error - didn't find backup file for Packages!"
138 -    exit 1
139 -fi
140 -
141 -if [ ! -f  $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
142 -    echo "Error - didn't find backup file for Packages.gz!"
143 -    exit 1
144 -fi
145 +for arch in arm64 amd64; do
146 +    if [ ! -f  $REPO/dists/trusty/main/binary-${arch}/Packages.backup ]; then
147 +        echo "Error - didn't find backup file for Packages for ${arch}!"
148 +        exit 1
149 +    fi
150 +    
151 +    if [ ! -f  $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup ]; then
152 +        echo "Error - didn't find backup file for Packages.gz for ${arch}!"
153 +        exit 1
154 +    fi
155 +done
156  
157  if [ ! -f  $REPO/dists/trusty/Release.backup ]; then
158      echo "Error - didn't find backup file for Release!"