From 1f615248f437ea422359830ed11fc06c86030f55 Mon Sep 17 00:00:00 2001 From: Erwan Prioul Date: Wed, 20 Feb 2019 16:57:03 +0100 Subject: [PATCH] Add support of Ubuntu 18.04 on next Signed-off-by: Erwan Prioul --- .../monolithic/bionic_dh_change_dest.patch | 120 ++++++++++++++++++ configs/next/distros/ubuntu-18.mk | 87 +++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 configs/next/deb/monolithic/bionic_dh_change_dest.patch create mode 100644 configs/next/distros/ubuntu-18.mk diff --git a/configs/next/deb/monolithic/bionic_dh_change_dest.patch b/configs/next/deb/monolithic/bionic_dh_change_dest.patch new file mode 100644 index 000000000..5be346f0c --- /dev/null +++ b/configs/next/deb/monolithic/bionic_dh_change_dest.patch @@ -0,0 +1,120 @@ +# Copyright 2019 IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--- a/dh_strip 2018-03-30 ++++ b/dh_strip 2019-02-21 +@@ -15,7 +15,7 @@ + + =head1 SYNOPSIS + +-B [S>] [B<-X>I] [B<--dbg-package=>I] [B<--keep-debug>] ++B [S>] [B<-X>I] [B<--dbg-package=>I] [B<--keep-debug>] [B<--dest=>I] + + =head1 DESCRIPTION + +@@ -45,6 +45,18 @@ + stripped. You may use this option multiple times to build up a list of + things to exclude. + ++=item B<--dest=>I ++ ++Typically, debug information is always placed under /usr/lib/debug on debian ++packages. However, it is sometimes desirable to install to an alternative ++prefix, such as /opt. The value passed through B is prepended to ++/lib/debug (notice that the 'usr' part has been removed), and becomes the ++installation path for debug information. For instance, the following command ++will install all debug information into a package named foo-deb.deb and under ++I. ++ ++ dh_strip --dbg-package=foo-dbg --dest=/opt ++ + =item B<--dbg-package=>I + + B in the package build directory. B<--dbg-package> ++file in F in the package build directory. B<--dbg-package> + is easier to use than this option, but this option is more flexible. + + This option implies B<--no-automatic-dbgsym> and I be used +@@ -136,8 +148,10 @@ + + =cut + ++my $dest; + init(options => { + "keep-debug" => \$dh{K_FLAG}, ++ "dest=s" => \$dest, + 'dbgsym-migration=s' => \$dh{MIGRATE_DBGSYM}, + 'automatic-dbgsym!' => \$dh{ENABLE_DBGSYM}, + # Deprecated variants +@@ -282,30 +296,44 @@ + my $file_info = get_file_type($file, $use_build_id ? 1 : 0); + return unless $file_info =~ /not stripped/; + ++ my ($base_file)=$file=~/^\Q$tmp\E(.*)/; ++ my ($base_debug_path, $debug_symlink, $debug_dir); ++ ++ $debug_path=$desttmp."${dest}/lib/debug/".$base_file; ++ $base_debug_path="${dest}/lib/debug/".$base_file; ++ ++ # Make symlinks based on the build-ID ++ + if ($use_build_id) { + if ($file_info =~ m/BuildID\[sha1]\s*=\s*([0-9a-f]{2})([0-9a-f]+)/ or + `LC_ALL=C readelf -n $file`=~ /^\s+Build ID: ([0-9a-f]{2})([0-9a-f]+)$/m) { +- $debug_path=$desttmp."/usr/lib/debug/.build-id/$1/$2.debug"; ++ $debug_symlink=$desttmp."${dest}/lib/debug/.build-id/$1/$2"; + $debug_build_id="${1}${2}"; + push(@build_ids, $debug_build_id); +- } else { +- # For dbgsyms, we need build-id (else it will not be +- # co-installable). +- return if $use_build_id > 1; ++ ++ # Create the directory ++ $debug_dir=dirname($debug_symlink); ++ if(! -d $debug_dir) { ++ doit("install", "-d", $debug_dir); ++ } ++ ++ # Create the symlinks ++ if(! -l "$debug_symlink") { ++ doit("ln", "-s", "$base_file", "$debug_symlink"); ++ } ++ if(! -l "$debug_symlink.debug") { ++ doit("ln", "-s", "$base_debug_path", "$debug_symlink.debug"); ++ } + } + } +- if (not $debug_path) { +- # Either not using build_id OR no build-id available +- my ($base_file)=$file=~/^\Q$tmp\E(.*)/; +- $debug_path=$desttmp."/usr/lib/debug/".$base_file; +- } ++ # Create the build-id directory + install_dir(dirname($debug_path)); + if (compat(8) && $use_build_id < 2) { + doit($objcopy, "--only-keep-debug", $file, $debug_path); + } + else { + # Compat 9 OR a dbgsym package. +- doit($objcopy, "--only-keep-debug", "--compress-debug-sections", $file, $debug_path) unless -e $debug_path; ++ doit($objcopy, "--only-keep-debug", $file, $debug_path) unless -e $debug_path; + } + + # No reason for this to be executable. diff --git a/configs/next/distros/ubuntu-18.mk b/configs/next/distros/ubuntu-18.mk new file mode 100644 index 000000000..b2cc81e6b --- /dev/null +++ b/configs/next/distros/ubuntu-18.mk @@ -0,0 +1,87 @@ +# Copyright 2017 IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Distro dependent basic definitions for Ubuntu 18.04 LTS +# ======================================================= +# This Makefile include contains the definitions for the distro being used +# for the build process. It contains kernel version infos and distro specific +# sanity checks. + +# Informs the distro supported power archs +AT_SUPPORTED_ARCHS := ppc64le + +# You may force the BUILD_IGNORE_AT_COMPAT general condition by distro +#BUILD_IGNORE_AT_COMPAT := yes + +# Kernel version to build toolchain against +# - As this distro only supports one arch variation (ppc64le), there is no +# need to conditionally define these versions based on arch. +AT_KERNEL := 4.15 # Current distro kernel version for runtime. +# TODO: fill this when our packaging system starts supporting runtime-compat +# on Ubuntu. +#AT_OLD_KERNEL := # Previous distro kernel version for runtime-compat. + +# Inform the mainly supported distros +AT_SUPPORTED_DISTROS := bionic + +# Inform the compatibility supported distros +#AT_COMPAT_DISTROS := + +# Sign the repository and packages +#AT_SIGN_PKGS := yes +#AT_SIGN_REPO := yes +#AT_SIGN_PKGS_CROSS := no +#AT_SIGN_REPO_CROSS := yes + +# ID of GNUPG key used to sign our packages (main/compat) +AT_GPG_KEYID := 6976A827 +AT_GPG_KEYIDC := 3052930D +# ID of GNUPG key used to sign our repositories (main/compat) +AT_GPG_REPO_KEYID := 3052930D +AT_GPG_REPO_KEYIDC := 3052930D + +# Options required by the command to update the repository metadata +AT_REPOCMD_OPTS := -p -s sha1 --simple-md-filenames --no-database + +# As some distros have special requirements for configuration upon final +# AT installation, put in this macro, the final configurations required +# after the main build and prior to the rpm build +define distro_final_config + echo "nothing to do." +endef + +# Inform the list of packages to check +ifndef AT_DISTRO_REQ_PKGS + AT_CROSS_PKGS_REQ := + AT_NATIVE_PKGS_REQ := libxslt libpopt-dev libqt4-dev \ + libc6-dev libbz2-dev xsltproc docbook-xsl \ + libsqlite3-dev + AT_COMMON_PKGS_REQ := zlib1g-dev libncurses5-dev ncurses-term flex bison \ + texinfo subversion cvs gawk fakeroot debhelper \ + autoconf rsync curl bc libxml2-utils automake \ + dpkg-sig xutils-dev libtool wget dh-systemd \ + docbook2x pkg-config autoconf-archive make \ + libffi-dev python3 git + AT_CROSS_PGMS_REQ := + AT_NATIVE_PGMS_REQ := + AT_COMMON_PGMS_REQ := +endif + +# If needed, define the necessary distro related sanity checks. +define distro_sanity + echo "nothing to test here" +endef + +# Inform if the systemd service to monitor the loader cache should be used. +USE_SYSTEMD := yes