Commit Graph

24 Commits

Author SHA1 Message Date
Arseny Maslennikov
6bfa4a28aa /usr/lib/rpm/functions: split away to rpmb-functions
In an environment created by `hsh --initroot-only`:
  $ for i in /usr/lib/rpm/*; do rpm -qf --qf='%{name}: '"$i"'\n' "$i"; done | grep '^rpm:'
  rpm: /usr/lib/rpm/0ldconfig.filetrigger
  rpm: /usr/lib/rpm/GROUPS
  rpm: /usr/lib/rpm/find-package
  rpm: /usr/lib/rpm/functions
  rpm: /usr/lib/rpm/macros.d
  rpm: /usr/lib/rpm/pdeath_execute
  rpm: /usr/lib/rpm/platform
  rpm: /usr/lib/rpm/posttrans-filetriggers
  rpm: /usr/lib/rpm/postupdate
  rpm: /usr/lib/rpm/rpmd
  rpm: /usr/lib/rpm/rpmdb_loadcvt
  rpm: /usr/lib/rpm/rpme
  rpm: /usr/lib/rpm/rpmi
  rpm: /usr/lib/rpm/rpmk
  rpm: /usr/lib/rpm/rpmpopt-4.13.0.1
  rpm: /usr/lib/rpm/rpmq
  rpm: /usr/lib/rpm/rpmu
  rpm: /usr/lib/rpm/rpmv

The `scripts/functions` file is provided from the rpm project in real
installations. Let's ensure scripts in this package use the functions
file from this package.
2024-03-03 23:38:10 +03:00
93297e9c33 s/egrep/grep -E/ 2022-04-26 08:00:00 +00:00
Gleb Fotengauer-Malinovskiy
b996912c5d brp-debuginfo.in, process-debuginfo.in: add support for zstd-compressed modules 2021-11-03 03:11:44 +03:00
5ef5c8ff4a Use file4 instead of file
This will allow upgrading system file to v5, leaving rpmbuild using
stable file v4.
2021-08-12 13:23:31 +03:00
cd0eca00e9 brp-debuginfo: Add debug sources check
Warn if debuginfo is present, but debug sources aren't.

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-18 03:45:22 +03:00
aba565d889 debuginfo: Implement %_stripped_files_terminate_build
Terminate build if stripped ELF files are found. Usage:

  %define _stripped_files_terminate_build 1

Formatting suggestions by Dmitry V. Levin <ldv@altlinux.org>.
2020-08-23 17:01:20 +03:00
1f5bc5f866 debuginfo: Warn if stripped ELFs are found 2020-08-23 17:00:58 +03:00
deaca8d8e3 debuginfo: Show warnings if .debug sections are absent
Actually, `.debug_line` section is checked (implicitly by debugedit)
which should go together with all `.debug_*` sections. This
simplification will make check faster.

Note: Only non-stripped binaries are checked.

Spelling fixes, usage of `Warning' function, and redirect to stderr is
suggested by Dmitry V. Levin <ldv@altlinux.org>.
2020-08-21 23:37:05 +03:00
ce2db3795b brp-debuginfo: fix thinko in the previous fix
Re-enable processing of ELF relocatable objects that *are* kernel modules.

Reported-by: Vitaly Chikunov <vt@altlinux.org>
Fixes: d71728c2c8 ("brp-debuginfo: fix handling of packages containing
ELF relocatable objects")
2020-07-09 08:00:00 +00:00
d71728c2c8 brp-debuginfo: fix handling of packages containing ELF relocatable objects
Do not try to process ELF relocatable objects that are not kernel
modules, this fixes the following regression:

/usr/lib/rpm/debugedit: ./usr/lib64/gcc/x86_64-alt-linux/9/crtfastmath.o: DWARF version 0 unhandled
objdump: ./usr/lib64/gcc/x86_64-alt-linux/9/crtfastmath.o: bad value
verify-elf: ERROR: ./usr/lib64/gcc/x86_64-alt-linux/9/crtfastmath.o: objdump failed

Fixes: 7aa048df38 ("Generate debuginfo for kernel packages")
2020-07-08 08:00:00 +00:00
50705f69b7 debuginfo: Fix processing of hard-linked binaries
while-end output into the pipe forgets all set inside variables.

Error message:

  ln: .debuginfo/src/: hard link not allowed for directory
2020-07-07 13:44:03 +03:00
5cc014bed6 Process debuginfo in parallel
- Split processing of single binary into separate script.
- Call it from xargs -P.
2020-07-05 01:06:16 +03:00
7aa048df38 Generate debuginfo for kernel packages
- Support uncompressed (std-def) and compressed (un-def) modules. Also,
  support xz(1) compression if we'd switch to it.
- If module is uncompressed it stays in the kernel-image rpm, if it's
  compressed then uncompressed module goes into /usr/lib/debug tree and
  will be in debuginfo rpm. Compressed modules will be re-compressed after
  stripping.
- vmlinuz binary triggers extraction of vmlinux from the kernel-source
  tree, and it's then placed into /usr/lib/debug tree, then processed and
  stripped as usual.
- Logic of processing of vmlinux binary for domU packages is not changed.
  Some flavours do not even pack it. Thus, do not remove your
  `%brp_strip_none'.
- Output of file(1) for vmlinuz is only parsed for filename, because, on
  different architectures it detects completely different things.
- Debug files are compressed with `eu-elfcompress'.
- You still need to enable `CONFIG_DEBUG_INFO=y' in for `.config'.
  No other changes to spec should be needed.

Thanks to Nikita Ermakov for starting this work.
2020-07-05 01:06:16 +03:00
696f192aea scripts: ignore ELF shared objects with "no" machine type
When scanning files for deps, debuginfo, fixup, and verify_elf,
ignore files with type that matches "ELF * shared object, no machine, *"
pattern.

These are ELF files generated by GNU Guile, ignore them for now.
2017-04-18 16:42:41 +00:00
6fb9f3ddc8 brp-debuginfo: add $RPM_DEBUGINFO_SKIPLIST support 2013-10-29 00:51:04 +00:00
Alexey Tourbin
033bb95511 brp-debuginfo: pass LD_ORIGIN_PATH=/usr/bin to eu-strip
This is the same as with eu-findtextrel and eu-elflint; eu-strip
needs to load EBL backend only with --strip-debug, though.
2011-02-05 23:34:11 +03:00
Alexey Tourbin
91656ccf79 brp-debuginfo: hopefully fixed hardlink support
Note that 'sh -e' mode is unreliable when the last pipeline command
is non-simple command (such as while loop).  So the script was somehow
failing on hardlinks and it went unnoticed.  I choose to replace
pipe-to-while with a temporary file for now.
2011-02-05 01:27:25 +03:00
Alexey Tourbin
614b27b4d1 brp-debuginfo: added /usr/src to prune_paths 2011-02-05 01:27:23 +03:00
Alexey Tourbin
845fefb64f brp-debuginfo: recognize $RPM_BRP_STRIP_DEBUG and $RPM_BRP_STRIP_NONE
This finally provides missing strip controls.  Note that even with
STRIP_NONE, the file will be edited with debugedit.  So there is no
way to bypass brp-debuginfo completely (and maybe we should tolerate
debugedit failures with STRIP_NONE).  But there is also an advantage:
/usr/src/debug sources will be installed even for non-stripped files!
This is why sources are now associated with .debuginfo/src/"$f"
instead of .debuginfo/src/"$debugf".
2011-02-03 11:30:45 +03:00
Alexey Tourbin
0f284964f3 4.0.4-alt100.14
- debugedit.c: Imported from rpm.org.
- brp-debuginfo: Initial revision, replaces brp-strip.
- verify-elf: Do not descend into /usr/lib/debug.
- build/checkFiles.c: Skip /usr/lib/debug and /usr/src/debug for now.
- platform.in: Always use -g in %optflags.
2011-01-30 04:20:31 +03:00
Alexey Tourbin
f41c1bffca brp-debuginfo: preserve timestamps 2011-01-30 03:35:57 +03:00
Alexey Tourbin
4bdee95777 brp-debuginfo: handle sources 2011-01-30 03:32:08 +03:00
Alexey Tourbin
78a1d2b844 brp-debuginfo: make symbolic links 2011-01-30 03:32:06 +03:00
Alexey Tourbin
f13cfad5f8 brp-debuginfo: intial revision, replaces brp-strip 2011-01-30 03:10:15 +03:00