From 22e439616566498354367c1578cbbc72f5be8b41 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 10 Mar 2016 11:58:59 -0500 Subject: [PATCH 1/5] Add support for xenial release - Test only for the old saucy release for amd64 ONLY to ease future support - format the code around the changes for 4 space --- build-ubunturepo | 57 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index dd8a36f23..1a32468cd 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -63,7 +63,7 @@ for i in $*; do done # Supported distributions -dists="saucy trusty utopic" +dists="saucy trusty utopic xenial" c_flag= # xcat-core (trunk-delvel) path d_flag= # xcat-dep (trunk) path @@ -287,12 +287,13 @@ then mkdir conf for dist in $dists; do - if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then - tmp_out_arch="amd64 ppc64el" - else - tmp_out_arch="amd64" - fi - cat << __EOF__ >> conf/distributions + # for all releases moving forward, support amd64 and ppc64el + tmp_out_arch="amd64 ppc64el" + if [ "$dist" = "saucy" ]; then + # for older releases of Ubuntu that does not support ppc64el + tmp_out_arch="amd64" + fi + cat << __EOF__ >> conf/distributions Origin: xCAT internal repository Label: xcat-core bazaar repository Codename: $dist @@ -314,14 +315,14 @@ __EOF__ amd_files=`ls ../$package_dir_name/*.deb | grep -v "ppc64el"` all_files=`ls ../$package_dir_name/*.deb` for dist in $dists; do - if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then - deb_files=$all_files - else - deb_files=$amd_files - fi - for file in $deb_files; do - reprepro -b ./ includedeb $dist $file; - done + deb_files=$all_files + if [ "$dist" = "saucy" ]; then + # for older releases of Ubuntu that does not support ppc64el + deb_files=$amd_files + fi + for file in $deb_files; do + reprepro -b ./ includedeb $dist $file; + done done #create the mklocalrepo script cat << '__EOF__' > mklocalrepo.sh @@ -416,11 +417,11 @@ then #create the conf/distributions file for dist in $dists; do - if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then - tmp_out_arch="amd64 ppc64el" - else - tmp_out_arch="amd64" - fi + tmp_out_arch="amd64 ppc64el" + if [ "$dist" = "saucy" ]; then + # for older releases of Ubuntu that does not support ppc64el + tmp_out_arch="amd64" + fi cat << __EOF__ >> conf/distributions Origin: xCAT internal repository Label: xcat-dep bazaar repository @@ -443,14 +444,14 @@ __EOF__ amd_files=`ls ../debs/*.deb | grep -v "ppc64el"` all_files=`ls ../debs/*.deb` for dist in $dists; do - if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then - deb_files=$all_files - else - deb_files=$amd_files - fi - for file in $deb_files; do - reprepro -b ./ includedeb $dist $file; - done + deb_files=$all_files + if [ "$dist" = "saucy" ]; then + # for older releases of Ubuntu that does not support ppc64el + deb_files=$amd_files + fi + for file in $deb_files; do + reprepro -b ./ includedeb $dist $file; + done done cat << '__EOF__' > mklocalrepo.sh From e556952bc8b786ab381400bd3b95a2f288d694ba Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 10 Mar 2016 22:01:46 -0500 Subject: [PATCH 2/5] Add checks for required packages before running the build --- build-ubunturepo | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 1a32468cd..dc0d34d65 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -45,11 +45,16 @@ if [[ ! -f /etc/lsb-release ]]; then fi . /etc/lsb-release -REPREPRO=`which reprepro >> /dev/null 2>&1; echo $?` -if [[ ${REPREPRO} != 0 ]]; then - echo "ERROR: Could not find reprepro, verify that reprepro is installed on this machine. Cannot continue!" - exit 1 -fi +# Check the necessary packages before starting the build +declare -a packages=( "reprepro" "devscripts" "debhelper" "libsoap-lite-perl" "libdbi-perl" "quilt" ) + +for package in ${packages[@]}; do + RC=`dpkg -l | grep $package >> /dev/null 2>&1; echo $?` + if [[ ${RC} != 0 ]]; then + echo "ERROR: Could not find $package, install using 'apt-get install $package' to continue" + exit 1 + fi +done # Process cmd line variable assignments, assigning each attr=val pair to a variable of same name for i in $*; do From 489b1f589629878c1d20dda3373ac6c475780d12 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 10 Mar 2016 22:14:58 -0500 Subject: [PATCH 3/5] Change the xcat-dep produced on Ubuntu to be .bz2 extension --- build-ubunturepo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-ubunturepo b/build-ubunturepo index dc0d34d65..3678dc71e 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -484,7 +484,7 @@ __EOF__ chmod -R g+w xcat-dep #create the tar ball - dep_tar_name=xcat-dep-ubuntu-`date +%Y%m%d%H%M`.tar.bz + dep_tar_name=xcat-dep-ubuntu-`date +%Y%m%d%H%M`.tar.bz2 tar -hjcf $dep_tar_name xcat-dep chgrp root $dep_tar_name chmod g+w $dep_tar_name From 32855754e2b45d7fa1c0ef1b08b2c1462b88f201 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 15 Mar 2016 14:02:11 -0400 Subject: [PATCH 4/5] In the latest version of libio-socket-ssl-perl shipped with Ubuntu 16.04, the SSL_VERIFY_PEER requires to be a constant instead of string. The error message printed out is SSL_verify_mode must be a number and not a string at /usr/share/perl5/IO/Socket/SSL.pm line 2166. Need to use IO::Socket::SSL for the SSL_VERIFY_PEER to be set --- perl-xCAT/xCAT/Client.pm | 1 + xCAT-server/lib/xcat/plugins/docker.pm | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index bc3171fa5..c6966e978 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -14,6 +14,7 @@ if ($^O =~ /^aix/i) { } use IO::Handle; use MIME::Base64 qw(decode_base64); +use IO::Socket::SSL; my $inet6support; if ($^O =~ /^aix/i) { # disable AIX IPV6 TODO fix diff --git a/xCAT-server/lib/xcat/plugins/docker.pm b/xCAT-server/lib/xcat/plugins/docker.pm index 148f0c60d..00291f8a8 100755 --- a/xCAT-server/lib/xcat/plugins/docker.pm +++ b/xCAT-server/lib/xcat/plugins/docker.pm @@ -35,7 +35,6 @@ use xCAT::MsgUtils; use Cwd; use xCAT::Usage; use JSON; -#use Data::Dumper; my $verbose; my $global_callback; @@ -1003,7 +1002,7 @@ sub init_async { $async = HTTP::Async->new( slots => $args{slots}, ssl_options => { - SSL_verify_mode => "SSL_VERIFY_PEER", + SSL_verify_mode => SSL_VERIFY_PEER, SSL_ca_file => $ssl_ca_file, SSL_cert_file => $ssl_cert_file, SSL_key_file => $key_file, From cd31f320602b57efa955a42a36fb526ccb799090 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 16 Mar 2016 13:50:10 -0400 Subject: [PATCH 5/5] Make a note in the Ubunut Install guide that explains the lowercase "xcat" --- docs/source/guides/install-guides/apt/install_xcat.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/install-guides/apt/install_xcat.rst b/docs/source/guides/install-guides/apt/install_xcat.rst index 34368c778..a832b063f 100644 --- a/docs/source/guides/install-guides/apt/install_xcat.rst +++ b/docs/source/guides/install-guides/apt/install_xcat.rst @@ -22,10 +22,12 @@ Add the necessary apt-repositories to the management node :: add-apt-repository "deb http://ports.ubuntu.com/ubuntu-ports $(lsb_release -sc) universe" add-apt-repository "deb http://ports.ubuntu.com/ubuntu-ports $(lsb_release -sc)-updates universe" -Install xCAT with the following command: :: +Install xCAT [#]_ with the following command: :: apt-get clean all apt-get update - apt-get install xCAT + apt-get install xcat + +.. [#] Starting with Ubuntu 16.04, the package name 'xCAT' is required to be all lowercase