FS#67096 - [mkinitcpio] patch fix for `pxz` module decompression compatibility

Attached to Project: Arch Linux
Opened by T.F. (t-ask) - Wednesday, 24 June 2020, 16:13 GMT
Last edited by freswa (frederik) - Thursday, 25 June 2020, 22:00 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Symlinking `pxz` to `/usr/bin/xz` mkinitcpio is stuck in a `xz` loop because `mkinitcpio`s' functions concatenate kernel module file decompression into one `xz -d module1 module2 ...` command.

Changing `mkinitcpio` module decompression to separately each module fixes this issue and makes it `pxz` compatible.

# Steps to reproduce:

$ ln -s /usr/bin/pxz /usr/bin/xz
$ mkinitcpio -P


Patch:

--- /usr/lib/initcpio/functions.orig 2020-06-24 16:59:36.589798619 +0200
+++ /usr/lib/initcpio/functions 2020-06-24 17:31:51.208969934 +0200
@@ -785,15 +785,13 @@
for m in "$@"; do
case $m in
*.xz)
- xz_comp+=("$moduledest/kernel/${m##*/}")
- ;;
+ (( ${#xz_comp[*]} )) && xz -d "$moduledest/kernel/${m##*/}"
+ ;;
*.gz)
- gz_comp+=("$moduledest/kernel/${m##*/}")
- ;;
+ (( ${#gz_comp[*]} )) && gzip -d "$moduledest/kernel/${m##*/}"
+ ;;
esac
done
- (( ${#xz_comp[*]} )) && xz -d "${xz_comp[@]}"
- (( ${#gz_comp[*]} )) && gzip -d "${gz_comp[@]}"

msg "Generating module dependencies"
install -m644 -t "$moduledest" "$_d_kmoduledir"/modules.builtin
This task depends upon

Closed by  freswa (frederik)
Thursday, 25 June 2020, 22:00 GMT
Reason for closing:  Not a bug
Additional comments about closing:  pxz depends on xz
Comment by Doug Newgard (Scimmia) - Thursday, 25 June 2020, 14:44 GMT
That's a pxz problem, not a mkinitcpio problem.
Comment by Eli Schwartz (eschwartz) - Thursday, 25 June 2020, 14:58 GMT
Some AUR package tries to replace /usr/bin/xz but isn't command-line compatible? How is this a bug?

But actually, how/why does it get in a "loop"? If it cannot perform as expected shouldn't it just error out?
Comment by freswa (frederik) - Thursday, 25 June 2020, 15:57 GMT
I can't reproduce this on arbitrary files. Will try this with mkinitcpio later.

Loading...