diff mbox series

grub2-editenv: does depend since recently on liblzma

Message ID 595788f0f47084127561ab5d5fbbbe23@dev.tdt.de
State Superseded
Headers show
Series grub2-editenv: does depend since recently on liblzma | expand

Commit Message

Florian Eckert May 20, 2021, 7:41 a.m. UTC
Hello Dirk,

I have build a fresh master branch recently,
Since your last change [1] on grub2, I have now a new dependency on 
liblzma for the install package grub2-editenv.

root@st-dev-07 /usr/lib # ldd /root/grub-editenv
         /lib/ld-musl-x86_64.so.1 (0x7f684b088000)
         liblzma.so.5 => /usr/lib/liblzma.so.5 (0x7f684b06d000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7f684b059000)
         libc.so => /lib/ld-musl-x86_64.so.1 (0x7f684b088000)

This was not the case before your update.

root@st-dev-07 /usr/sbin # ldd /usr/sbin/grub-editenv
         /lib/ld-musl-x86_64.so.1 (0x7fd970176000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fd970162000)
         libc.so => /lib/ld-musl-x86_64.so.1 (0x7fd970176000)

My build complains that it cannot satisfy the runtime package dependency 
for grub2-editenv.


install -d -m0755 
/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv/usr/sbin
install -m0755 
/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/grub-editenv 
/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv/usr/sbin/
find 
/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv 
-name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm 
-rf
Package grub2-editenv is missing dependencies for the following 
libraries:
liblzma.so.5
make[2]: *** [Makefile:166: 
/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/bin/APOS/feckert/master/master-Maggie-455-ga5edc0e8e/x86_64/targets/x86/64/packages/grub2-editenv_2.06~rc1-1_x86_64.ipk] 
Error 1
make[2]: Leaving directory 
'/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/package/boot/grub2'
time: package/boot/grub2/pc/compile#78.64#9.79#83.88
     ERROR: package/boot/grub2 failed to build (build variant: pc).
make[1]: *** [package/Makefile:116: package/boot/grub2/compile] Error 1
make[1]: Leaving directory 
'/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt'
make: *** 
[/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/include/toplevel.mk:230: 
package/boot/grub2/compile] Error 2


This is because it lacks dependency on liblzma during build package 
install.

If I add the following changes to the package all works as expected.

This is a hotfix but I dont´t think this is the final solution, because 
lzma is provided by the package xz.
And This is maintained in the package feed [2].

A dependency from a core package to the package feed is not allowed as I 
know?

The best would be to move xz to openwrt core.
But as far as I know this was the case before, but then it was moved to 
the package feed for reasons I don't know.
What is your opinion on this or how can we solve this in another way?
Or do you not have this problem?


Best regards

Florian


[1] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e74d81ece2e2932a4f370d8e6d180061a6a2c229
[2] https://github.com/openwrt/packages/tree/master/utils/xz

Comments

Dirk Neukirchen May 20, 2021, 10:17 a.m. UTC | #1
Hello Florian

On 20.05.21 09:41, Florian Eckert wrote:
> What is your opinion on this or how can we solve this in another way?
> Or do you not have this problem?
>
liblzma detection is automatic  - so this seems to be some hidden error before / build environment related

disabling it is possible according to configure.ac


"LZMA" (liblzma -> USE_LIBLZMA, lzma.h) is used in grub util/mkimage.c

looking at grub code - lzma.h/liblzma from xz means "GRUB_COMPRESSION_XZ" / compress_kernel_xz

disabling it then prints

"Without liblzma (no support for XZ-compressed mips images) (explicitly disabled)"

-

afaik we do not support grub on MIPS; but --compress=xz  is also disabled by that so many cmdline defaults might not be working : (util/grub-mkimage.c)

Notice that grub contains an grub-core/lib/xzembed/xz.h for some other XZ functionality (grub-core/fs/squash4.c:    COMPRESSION_XZ = 4)

Attached the simple patch that is build-tested with:

CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_generic=y
CONFIG_TARGET_x86_generic_DEVICE_generic=y
CONFIG_DEVEL=y
CONFIG_BUILD_LOG=y
CONFIG_EXPERIMENTAL=y
# CONFIG_FEED_luci is not set
# CONFIG_FEED_packages is not set
# CONFIG_FEED_routing is not set
# CONFIG_FEED_telephony is not set
CONFIG_LINUX_5_10=y
CONFIG_PACKAGE_grub2-editenv=y
CONFIG_PACKAGE_kmod-mdio-devres=y
CONFIG_PACKAGE_liblzma=y
CONFIG_TESTING_KERNEL=y

no lzma error , lzma linkage  seems fine : checked compile.log for the disable msg + @build path the config.log

Feel free to add / modify etc

sry for strange formatting - thunderbird update currently messes with text-only settings that worked fine before


>
> Best regards
>
> Florian
>
>
> [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e74d81ece2e2932a4f370d8e6d180061a6a2c229
> [2] https://github.com/openwrt/packages/tree/master/utils/xz


Greetings, Dirk
diff mbox series

Patch

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index b3cb5e076f..885be65dc6 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -46,7 +46,7 @@  define Package/grub2-editenv
    SUBMENU:=Boot Loaders
    TITLE:=Grub2 Environment editor
    URL:=http://www.gnu.org/software/grub/
-  DEPENDS:=@TARGET_x86
+  DEPENDS:=@TARGET_x86 +liblzma
    VARIANT:=pc
  endef