Bugzilla – Bug 1218241
OBS: package update-bootloader-rpm-macros not updated?
Last modified: 2024-03-25 03:16:46 UTC
During a tumbleweed installation I found this error message in /var/log/zypp/history: # 2023-12-19 18:23:09 memtest86+-6.20-1.5.x86_64.rpm installed ok # Additional rpm output: # /var/tmp/rpm-tmp.8KMeqQ: line 8: mkdir: command not found # /var/tmp/rpm-tmp.8KMeqQ: line 9: touch: command not found # 2023-12-19 18:23:09|install|memtest86+|6.20-1.5|x86_64||openSUSE-20231218-0|ee2631678b90625b50b3d7958edb6b3de3b7a65904e686ffc5bec04a47abe955989e0c61e53fc72db7341fec937d466d2f21ffaac611293dd081177f7e007f0f| The error is due to the presence in memtest86+.spec: %post %update_bootloader_check_type_refresh_post grub2 grub2-efi such macro expand to some commands using mkdir and touch which would requires in the spec file: Requires(post): coreutils The same spec file contains the macro: %update_bootloader_requires which was supposed to expando to: Requires(post): coreutils but it didn't. Recently with SR 1132646 I added such line to the macro %update_bootloader_requires in the package update-bootloader-rpm-macros. Now if I build locally memtest86+ on the latest tumbleweed the rpm contains requires: coreutils, but the memtest86+ rpm included with tumbleweed does not contains such requires causing still the error I talked about above. Looks like OBS is not using the latest version of update-bootloader-rpm-macros but still the previous one. Am I right? Is it possible to update update-bootloader-rpm-macros to the latest version for the OBS builds fixing then the above installation error?
It appears that memtest86+ currently shipped in tumbleweed does not requires yet coreutils because it has not been rebuild after the update of update-bootloader-rpm-macros. Probably the trigger of a rebuild of memtest86+ should solve the problem.
I waited some time but the situation has not changed: during the installation I still see the error message about the memtest86+ package in /var/log/zypp/history. The package memtest86+ build on obs does not requires the package coreutils, despite such requirement is included in the macro %update_bootloader_requires of the package update-bootloader-rpm-macros. If I build memtest86+ locally, then the package, correctly, requires coreutils.
(In reply to Giacomo Comes from comment #2) > I waited some time but the situation has not changed: > during the installation I still see the error message about the memtest86+ > package in /var/log/zypp/history. > The package memtest86+ build on obs does not requires the package coreutils, > despite such requirement is included in the macro %update_bootloader_requires > of the package update-bootloader-rpm-macros. > If I build memtest86+ locally, then the package, correctly, requires > coreutils. Actually I could reproduce the problem locally: > host> osc co Base:System memtest86+ > host> cd Base:System/memtest86+ > host> osc build --clean --noverify standard i586 Once it's finished, check the resultant rpm and 'Requires(post): coreutils' was not there: > host> rpm -pq --requires /var/tmp/build-root/standard-i586/home/abuild/rpmbuild/RPMS/i586/memtest86+-7.00-0.i586.rpm > /bin/sh > /bin/sh > rpmlib(CompressedFileNames) <= 3.0.4-1 > rpmlib(FileDigests) <= 4.6.0-1 > rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Use osc shell to check %update_bootloader_requires, and indeed it expands to nothing: > host> osc shell --noinit standard i586 > abuild@host:~> rpm --eval "%{?update_bootloader_requires}" > abuild@host:~> exit However if we change the name from %update_bootloader_requires to anything else, for example %update_bootloader_require (no plural), it works!! > host> sudo sed -i 's/update_bootloader_requires/update_bootloader_require/' /var/tmp/build-root/standard-i586/usr/lib/rpm/macros.d/macros.update-bootloader > host> osc shell --noinit standard i586 > abuild@host:~> rpm --eval "%{?update_bootloader_require}" > Requires(post): coreutils > abuild@host:~> exit Likely that the %update_bootloader_requires is redefined somewhere in the build system, however I couldn't find a clue in the build system either: > host> cd /var/tmp/build-root/standard-i586 > host> sudo rg update_bootloader_requires > ... Frankly I have ran out of idea now. Let's check with rpm expert to in a hope to shed us some light about the seemingly rpm marco name issue found here. Hi Jan, Would you please help to take a look on what may cause the issue ? Thanks in advanced.
I works if installing update-bootloader-rpm-macros to the host, so something's really fishy in the buildroot.
This is caused by the openSUSE:Factory prjconf: # from update-bootloader-rpm-macros - impacts build deps %update_bootloader_requires %nil
(In reply to Fabian Vogt from comment #5) > This is caused by the openSUSE:Factory prjconf: > > # from update-bootloader-rpm-macros - impacts build deps > %update_bootloader_requires %nil This probably was added when %update_bootloader_requires was defined as: Requires(posttrans): perl-Bootloader causing problems. Actually I'm not sure how useful is %update_bootloader_requires any more. There are only few packages the uses it and almost all use this construct: %if 0%{?update_bootloader_requires:1} %update_bootloader_requires %else <some other value> %endif And since in openSUSE:Factory's prjconf the macro gets undefined, it means that no packages is really using the macro right now.
(In reply to Fabian Vogt from comment #5) > This is caused by the openSUSE:Factory prjconf: > > # from update-bootloader-rpm-macros - impacts build deps > %update_bootloader_requires %nil Thanks for your help and pointing this out.
(In reply to Giacomo Comes from comment #6) > (In reply to Fabian Vogt from comment #5) > > This is caused by the openSUSE:Factory prjconf: > > > > # from update-bootloader-rpm-macros - impacts build deps > > %update_bootloader_requires %nil > > This probably was added when %update_bootloader_requires > was defined as: Requires(posttrans): perl-Bootloader > causing problems. Very much likely, but with this change that _prjconf redefinition seemed to be unnecessary. https://build.opensuse.org/package/rdiff/Base:System/update-bootloader-rpm-macros?linkrev=base&rev=7 > > Actually I'm not sure how useful is %update_bootloader_requires any more. It was used/useful in the past, but the attempt to getting rid of perl-Bootloader dependency making it useless by design. > There are only few packages the uses it and almost all use this construct: > %if 0%{?update_bootloader_requires:1} > %update_bootloader_requires > %else > <some other value> > %endif I didn't answer for other packages, but indeed grub has this construct: > %if 0%{?update_bootloader_requires:1} > %update_bootloader_requires > %else > Requires: perl-Bootloader > Requires(post): perl-Bootloader > %endif The %else was added back then to bailout old SLE release without update-bootloader-rpm-macros, you can notice similar %if .. %else ... in the %post section that update-bootloader has invoked directly without taking these macros. I think those fallback %else can be removed given all SLE distribution has update-bootloader-rpm-macros. By doing so, it also makes the attempt to getting rid of perl-Bootloader dependency from grub packages really to work as expect. > And since in openSUSE:Factory's prjconf the macro gets undefined, > it means that no packages is really using the macro right now. I'll try to make a new update-bootloader-rpm-macros submission to silence those `mkdir' and `touch' failure to align with the plan of not adding up dependencies. It is fine doing so given perl-Bootloader must not being used by the system given it has dependency to coreutils as well. Is that work for you ? Also we need to check with YaST how they handle the dependency during the installation so the potential breakage if grub stops requiring perl-Bootloader can be addressed. We probably don't want this movement to surprise them. Thanks.
Set assignee back to myself before we can find proper resolution.
(In reply to Michael Chang from comment #8) > I'll try to make a new update-bootloader-rpm-macros submission to silence > those `mkdir' and `touch' failure to align with the plan of not adding up > dependencies. It is fine doing so given perl-Bootloader must not being used > by the system given it has dependency to coreutils as well. Is that work for > you ? If the macro %update_bootloader_check_type_refresh_post does not use 'mkdir' and 'touch' any more, that should fix the issue with memtest86+
(In reply to Giacomo Comes from comment #10) > (In reply to Michael Chang from comment #8) > > I'll try to make a new update-bootloader-rpm-macros submission to silence > > those `mkdir' and `touch' failure to align with the plan of not adding up > > dependencies. It is fine doing so given perl-Bootloader must not being used > > by the system given it has dependency to coreutils as well. Is that work for > > you ? > > If the macro %update_bootloader_check_type_refresh_post does not use 'mkdir' > and 'touch' any more, that should fix the issue with memtest86+ OK. Then I will add a check to the mkdir, and do nothing if not present or executable.
Josef, see comment #8.
well, kernel-default has Require(post) for perl-bootloader and installation itself does not need perl-bootlaoder as it call grub themself. It is needed only for kernel update or any other rpm that needs refresh of boot menu. So from out POV we are OK with removing this dependency from grub.
(In reply to Josef Reidinger from comment #13) > well, kernel-default has Require(post) for perl-bootloader and installation > itself does not need perl-bootlaoder as it call grub themself. It is needed > only for kernel update or any other rpm that needs refresh of boot menu. > So from out POV we are OK with removing this dependency from grub. Hi Josef, Thanks a lot for the clarification. The SR has been created: https://build.opensuse.org/request/show/1160540 (In reply to Michael Chang from comment #11) > (In reply to Giacomo Comes from comment #10) > > (In reply to Michael Chang from comment #8) > > > I'll try to make a new update-bootloader-rpm-macros submission to silence > > > those `mkdir' and `touch' failure to align with the plan of not adding up > > > dependencies. It is fine doing so given perl-Bootloader must not being used > > > by the system given it has dependency to coreutils as well. Is that work for > > > you ? > > > > If the macro %update_bootloader_check_type_refresh_post does not use 'mkdir' > > and 'touch' any more, that should fix the issue with memtest86+ > > OK. Then I will add a check to the mkdir, and do nothing if not present or > executable. Hi Giacomo, The updated update-bootloader-rpm-macros, has been released. With all modifications completed, mark the resolution as fixed. Thanks.