IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
It is not that easy to ship find-package as part of rpm-build.
We have to drop find-package from the filelist of rpm as well. For this
change to enter Sisyphus, both rpm-build and rpm have to be changed and
rebuilt in their own base build chroots.
If rpm-build is built to include find-package first, rpm is
uninstallable in the base chroot due to a misconflict, so it cannot be
rebuilt.
If rpm is built to exclude find-package first, it disappears from the
base chroot altogether, making rpm-build break, so no
package can be built as well.
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/find-package` file is installed from the rpm project. We
replace our copy with that one, so the installed file does not change
but is installed as part of rpm-build.
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.
It is intended to check the sanity of systemd units installed in the
buildroot. As of today, it errors out on executable unit files and units
passing nobody as User=, Group= or in SupplementaryGroups=.
Linux kernel supports the direct loading of compressed modules
(via finit_module system call) since version 5.15. However
decompression options are less flexible (and are set at
the compile time). In particular kernel can read lzma archives
only with a dictionary size exactly 1 MiB, and crc32 checksum.
kmod started to make use of direct module loading since version
31. However kmod does not fall back to decompressing in the userspace
if the kernel compressed modules, which causes serious troubles
(boot failures, some devices not working, etc).
To avoid the problem teach process-debuginfo.in to re-compress
kernel modules correctly (crc32 checksum, 1 MiB dictionary)
so the kernel can load them directly.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fbf5892df21a8ccfcb2fda0fd65bc3169c89ed28
Reviewed-by: Vitaly Chikunov <vt@altlinux.org>
crash is unable to handle vmlinux split into vmlinux.debug because it
cannot find `.symtab`[1]. This is not expected to be fixed soon.
Really, there is not point to split it because both halves are in
the same -debuginfo package and this is only complicates things.
This also undoes approach taken in 894f4140c ("process-debuginfo: Add
.gnu_debuglink symlink for vmlinux").
Link: https://github.com/crash-utility/crash/issues/160
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
`eu-strip --strip-all` started to strip .symtab for un-def kernel
triggering different code path in crash(8) thus making it follow
value of `.gnu_debuglink` section and miss vmlinux.debug.
Also, this seems to be more portable overall - we can find vmlinux by
prepending `/usr/lib/debug` or by appending `.debug`.
With educated guess we assume eu-strip will put "BASENAME.debug" in
`.gnu_debuglink`.
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This script is designed to ignore lines that don't follow the expected
format, but it is widely known that the output format of readelf utility
from the binutils project can be quite unreliable. The output format
may vary on certain architectures and ELFs created with certain build
tools may contain symbols with peculiar bits that affect the output.
Here is a couple of examples illustrating these issues:
* On PowerPC, ELF symbols frequently include the localentry bit.
For instance:
$ readelf --wide --dyn-syms /lib64/libcrypto.so.1.1 | grep ASN1_VISIBLESTRING_new
157: 00000000000938c0 60 FUNC GLOBAL DEFAULT [<localentry>: 8] 11 ASN1_VISIBLESTRING_new@@OPENSSL_1_1_0
* On x86_64, a proprietary blob /usr/lib64/libjcPKCS11ds.so (distributed
as an ELF) and on armh /usr/lib/libLLVM-16.so, contain symbols with
OS-specific bits:
$ readelf --wide --dyn-syms /usr/lib64/libjcPKCS11ds.so | grep _ZNSt7collateIwE2idE
2572: 00000000002df9c8 8 OBJECT <OS specific>: 10 DEFAULT 26 _ZNSt7collateIwE2idE
$ readelf --wide --dyn-syms /usr/lib/libLLVM-16.so | grep _ZN4llvm13AllAnalysesOnINS_6ModuleEE6SetKeyE
45060: 05af0478 8 OBJECT <OS specific>: 10 DEFAULT 26 _ZN4llvm13AllAnalysesOnINS_6ModuleEE6SetKeyE@@LLVM_16
The issue related to PowerPC localentry bits was resolved in the commit
4f4a1d146 ("lib.prov, lib.req: enhance ProvidedSymbols") a long time
ago. The issue related to OS-specific bits was discovered recently [1].
Instead of attempting to resolve the output issues of binutils' readelf
utility concerning OS-specific bits, it is more convenient to use
readelf from elfutils. It has more reliable output (including the
handling of the cases described earlier) and is extensively utilized
within the project anyway.
[1] https://bugzilla.altlinux.org/46447
Reported-by: Konstantin A. Lepikhov <lakostis@altlinux.ru>
Reported-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Fixes: https://bugzilla.altlinux.org/46447
Starting with systemd-239, Exec*= lines of unit files
are no longer required to reference absolute paths.
systemd-services.req, however, was expecting an absolute paths.
Given the new system-update-cleanup.service:
ExecStart=rm -fv /system-update
systemd-services.req used to find "/system-update" requirement:
systemd-services.req: /usr/src/tmp/systemd-buildroot/lib/systemd/system/system-update-cleanup.service: /system-update -> /system-update (raw, not installed)
This change updates systemd-services.req to the new systemd unit files
semantics, and also cleanups the code by removing redundant grep.
`.BTF' section is needed to load kernel modules if
`CONFIG_DEBUG_INFO_BTF_MODULES' is enabled. This requirement is
introduced in Linux commit c446fdacb10d ("bpf: fix
register_btf_kfunc_id_set for !CONFIG_DEBUG_INFO_BTF").
`--keep-section=.BTF' is added also for vmlinux processing, because
commit seems to affect vmlinux (in case of `CONFIG_DEBUG_INFO_BTF').
Encountered error message:
# modprobe nf_nat; dmesg | tail -1
modprobe: ERROR: could not insert 'nf_nat': Unknown symbol in module, or unknown parameter (see dmesg)
[16781.315808] missing module BTF, cannot register kfuncs
Reported-by: Andrew A. Vasilyev <andy@altlinux.org>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
It means that we support all module compression methods supported by
the modern Linux kernel because the v5.15 version supports gzip-, xz-,
zstd-compressed and uncompressed modules.
SC2162 ("read without -r will mangle backslashes") and SC2086: ("Double
quote to prevent globbing and word splitting"). These actually seem to
be harmless in our case.
While strip is verbose when it fails to process files,
it's not quite obvious that it exits with a non-zero status,
hence an explicit diagnostics message might be useful.
Strip LTO sections and symbols from objects and archives (static
libraries). %brp_strip_none macro is respected.
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
There was two forgotten file instances. Fix error such as:
/root/tmp/rpm-tmp.80ZNEF: line 1: /usr/sbin/post_service: No such file or directory
error: %post(traefik-2.4.14-alt1.x86_64) scriptlet failed, exit status 127
error: traefik-2.4.14-alt1.x86_64: install failed
Fixes: 5ef5c8ff4 ("Use file4 instead of file")
`strip' is called by `install -s` that could occur in unpatched
Makefiles, breaking debuginfo generation.
Try to catch `install` invocations via:
- %__install macro used in `make INSTALL=`.
- Prefix PATH with `/usr/libexec/rpm-build` with install and strip
wrappers.
Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
debugedit sometimes output top level directory, since we do not filter
regular files in process-debuginfo since 309af2d59 ("debuginfo: Create
empty src/debug directories for paths with `..'") we need to filter
them out before passing into %files for debuginfo package.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: 309af2d59 ("debuginfo: Create empty src/debug directories for paths with `..'")
Create empty directories under `/usr/src/debug` tree for source paths
containing `..` (for example `../../src` in elfutils). This should fix
debuginfo sources for autotools builds in subdir.
Fixes: https://bugzilla.altlinux.org/39175
Consider another directory level when searching for vmlinux, for kernel
builds in sub-directory using `make O=output_dir'. Also, improve warning
message making it more understandable.
Reason: ae1ecef8 ("process-debuginfo: Do not call eu-elfcompress if it doesn't exist")
Fixes: 8682814b ("debuginfo: Try to uncompress if debugedit failed to extract sources list")
Do not add (uncompressed) module (or vmlinux) into debuginfo package if
it does not actually exists.
Due to other bugs there could be compressed kernel module, (which
implies adding uncompressed module into debuginfo), but, uncompressed
version (which brp-debuginfo should create) does not exist, making
build errors such as:
error: No such file or directory: /usr/src/tmp/kernel-image-std-def-buildroot/usr/lib/debug/lib/modules/5.8.0-std-def-alt1/kernel/fs/nfs/flexfilelayout/nfs_layout_flexfiles.ko
Reported-by: Anton V. Boyarshinov <boyarsh@altlinux.org>
Fixes: 7aa048df ("Generate debuginfo for kernel packages")
`%dir /' would cause errors (ALT#38842):
error: No such file or directory: /usr/src/tmp/broken-debug-buildroot/usr/lib/debug/lib/modules
error: No such file or directory: /usr/src/tmp/broken-debug-buildroot/usr/lib/debug/lib/modules/vmlinux
Reported-by: Vitaly Lipatov <lav@altlinux.org>
BZ: https://bugzilla.altlinux.org/show_bug.cgi?id=38842
If debugedit failed to extract sources list, uncompress and try again.
Then compress back.
ps. Interesting relevant reading:
https://blogs.oracle.com/solaris/elf_section_compression-v2
Spelling suggestions by Dmitry V. Levin <ldv@altlinux.org>.
Terminate build if stripped ELF files are found. Usage:
%define _stripped_files_terminate_build 1
Formatting suggestions by Dmitry V. Levin <ldv@altlinux.org>.