-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Erwan Prioul <[email protected]>
- Loading branch information
Showing
2 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
120 changes: 120 additions & 0 deletions
120
configs/next/deb/monolithic/bionic_dh_change_dest.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>] [B<--dbg-package=>I<package>] [B<--keep-debug>] | ||
+B<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>] [B<--dbg-package=>I<package>] [B<--keep-debug>] [B<--dest=>I<dest>] | ||
|
||
=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<dest> | ||
+ | ||
+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<dest> 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</opt/lib/debug>. | ||
+ | ||
+ dh_strip --dbg-package=foo-dbg --dest=/opt | ||
+ | ||
=item B<--dbg-package=>I<package> | ||
|
||
B<This option is a now special purpose option that you normally do not | ||
@@ -76,7 +88,7 @@ | ||
option. | ||
|
||
Debug symbols will be retained, but split into an independent | ||
-file in F<usr/lib/debug/> in the package build directory. B<--dbg-package> | ||
+file in F<lib/debug/> 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<cannot> 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |