Public bug reported: The mainline kernel package linux-image-unsigned-7.0.0-070000-generic fails to install because its maintainer scripts use an invalid run-parts invocation. The scripts incorrectly call: run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/<hook>.d /usr/share/kernel/<hook>.d run-parts only accepts a single directory argument. Passing multiple directories causes: run-parts: missing operand This breaks dpkg during: - preinst - postinst - postrm and leaves the package in a broken or half-installed state. Additionally, postinst dynamically generates a trigger script with the same invalid run-parts usage, causing repeated failures even after reinstall attempts. --- Fix: Each run-parts call must be split into two separate calls, one per directory. ### preinst fix Replace: if [ -d /etc/kernel/preinst.d ] || [ -d /usr/share/kernel/preinst.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/preinst.d /usr/share/kernel/preinst.d fi With: if [ -d /etc/kernel/preinst.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /etc/kernel/preinst.d fi if [ -d /usr/share/kernel/preinst.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /usr/share/kernel/preinst.d fi --- ### postinst fix (trigger generation) Replace: cat - >/usr/lib/linux/triggers/$version <<EOF DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/postinst.d /usr/share/kernel/postinst.d EOF With: cat > /usr/lib/linux/triggers/$version <<EOF #!/bin/sh set -e if [ -d /etc/kernel/postinst.d ]; then DEB_MAINT_PARAMS="\$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /etc/kernel/postinst.d fi if [ -d /usr/share/kernel/postinst.d ]; then DEB_MAINT_PARAMS="\$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /usr/share/kernel/postinst.d fi EOF chmod +x /usr/lib/linux/triggers/$version --- ### postrm fix Replace: DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/postrm.d /usr/share/kernel/postrm.d With: if [ -d /etc/kernel/postrm.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /etc/kernel/postrm.d fi if [ -d /usr/share/kernel/postrm.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /usr/share/kernel/postrm.d fi --- Impact: - Prevents dpkg install failures - Allows initramfs and bootloader hooks to run correctly - Stops broken trigger scripts from being generated After applying these fixes to all affected scripts, the kernel installs and configures successfully. ** Affects: linux (Ubuntu) Importance: Undecided Status: New ** Tags: kernel-7.0 kernel-bug mainline-bug -- You received this bug notification because you are subscribed to linux in Ubuntu. Matching subscriptions: Bgg, Bmail, Nb https://bugs.launchpad.net/bugs/2148348 Title: Mainline kernel 7.0 .deb fails to install: invalid run-parts usage in maintainer scripts Status in linux package in Ubuntu: New Bug description: The mainline kernel package linux-image-unsigned-7.0.0-070000-generic fails to install because its maintainer scripts use an invalid run-parts invocation. The scripts incorrectly call: run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/<hook>.d /usr/share/kernel/<hook>.d run-parts only accepts a single directory argument. Passing multiple directories causes: run-parts: missing operand This breaks dpkg during: - preinst - postinst - postrm and leaves the package in a broken or half-installed state. Additionally, postinst dynamically generates a trigger script with the same invalid run-parts usage, causing repeated failures even after reinstall attempts. --- Fix: Each run-parts call must be split into two separate calls, one per directory. ### preinst fix Replace: if [ -d /etc/kernel/preinst.d ] || [ -d /usr/share/kernel/preinst.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/preinst.d /usr/share/kernel/preinst.d fi With: if [ -d /etc/kernel/preinst.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /etc/kernel/preinst.d fi if [ -d /usr/share/kernel/preinst.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /usr/share/kernel/preinst.d fi --- ### postinst fix (trigger generation) Replace: cat - >/usr/lib/linux/triggers/$version <<EOF DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/postinst.d /usr/share/kernel/postinst.d EOF With: cat > /usr/lib/linux/triggers/$version <<EOF #!/bin/sh set -e if [ -d /etc/kernel/postinst.d ]; then DEB_MAINT_PARAMS="\$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /etc/kernel/postinst.d fi if [ -d /usr/share/kernel/postinst.d ]; then DEB_MAINT_PARAMS="\$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /usr/share/kernel/postinst.d fi EOF chmod +x /usr/lib/linux/triggers/$version --- ### postrm fix Replace: DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \ --arg=$image_path /etc/kernel/postrm.d /usr/share/kernel/postrm.d With: if [ -d /etc/kernel/postrm.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /etc/kernel/postrm.d fi if [ -d /usr/share/kernel/postrm.d ]; then DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error \ --arg=$version --arg=$image_path /usr/share/kernel/postrm.d fi --- Impact: - Prevents dpkg install failures - Allows initramfs and bootloader hooks to run correctly - Stops broken trigger scripts from being generated After applying these fixes to all affected scripts, the kernel installs and configures successfully. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2148348/+subscriptions
Комментариев нет:
Отправить комментарий