What happened?
On a Xiaomi Pad 5 Pro (xiaomi-elish, Snapdragon 870 / SM8250), kernel installation fails during the postinst hook with:
ValueError: Unrecognized arguments: ['/boot/initrd.img-6.18.35-current-sm8250']
run-parts: /etc/kernel/postinst.d/zz-update-abl-kernel exited with return code 1
The device uses Qualcomm's ABL (Android Bootloader) boot chain, which requires generating an Android boot image via mkbootimg after each kernel update. This is handled by the BSP's postinst script /etc/kernel/postinst.d/zz-update-abl-kernel.
The script locates the kernel and initrd using shell wildcards:
/boot/vmlinuz-*-sm8250
/boot/initrd.img-*-sm8250
When multiple kernel versions are present in /boot , the wildcard expands to multiple files — for example:
/boot/initrd.img-6.18.10-current-sm8250
/boot/initrd.img-6.18.35-current-sm8250
This passes two positional arguments where mkbootimg expects only one, and argparse rejects the extra one as unrecognized.
The bug is masked after a fresh install (when only one kernel version exists), but surfaces on the second or later kernel upgrade.
Other affected BSPs (same script, same logic)
| BSP |
Device |
ayn-thor |
AYN Odin |
oneplus-kebab |
OnePlus 8T |
ayn-odin2 |
AYN Odin 2 |
ayn-odin2mini |
AYN Odin 2 Mini |
ayn-odin2portal |
AYN Odin 2 Portal |
How to reproduce?
On xiaomi-elish (or any listed device):
- Install Armbian from a fresh image.
- Run the first kernel upgrade — this will succeed (only one kernel in
/boot).
- Run a second kernel upgrade — this will fail with the error above, because
/boot now contains both the old and new kernel versions.
Or manually:
ls /boot/vmlinuz-*-sm8250 # shows two or more versions
run-parts /etc/kernel/postinst.d/
Suggested fix
Replace wildcard expansion with the kernel version parameter ($1) passed by the Debian kernel hook mechanism:
version="$1"
kernel="/boot/vmlinuz-${version}"
ramdisk="/boot/initrd.img-${version}"
Optionally:
[ -f "$kernel" ] || { echo "Kernel not found: $kernel" >&2; exit 1; }
[ -f "$ramdisk" ] || { echo "Ramdisk not found: $ramdisk" >&2; exit 1; }
This fix applies identically to all six BSPs.
Branch
main (main development branch)
On which host OS are you running the build script and observing this problem?
Other
Are you building on Windows WSL2?
Relevant log URL
No response
Code of Conduct
What happened?
On a Xiaomi Pad 5 Pro (xiaomi-elish, Snapdragon 870 / SM8250), kernel installation fails during the postinst hook with:
The device uses Qualcomm's ABL (Android Bootloader) boot chain, which requires generating an Android boot image via
mkbootimgafter each kernel update. This is handled by the BSP's postinst script/etc/kernel/postinst.d/zz-update-abl-kernel.The script locates the kernel and initrd using shell wildcards:
When multiple kernel versions are present in
/boot, the wildcard expands to multiple files — for example:This passes two positional arguments where
mkbootimgexpects only one, andargparserejects the extra one as unrecognized.The bug is masked after a fresh install (when only one kernel version exists), but surfaces on the second or later kernel upgrade.
Other affected BSPs (same script, same logic)
ayn-thoroneplus-kebabayn-odin2ayn-odin2miniayn-odin2portalHow to reproduce?
On xiaomi-elish (or any listed device):
/boot)./bootnow contains both the old and new kernel versions.Or manually:
Suggested fix
Replace wildcard expansion with the kernel version parameter (
$1) passed by the Debian kernel hook mechanism:Optionally:
This fix applies identically to all six BSPs.
Branch
main (main development branch)
On which host OS are you running the build script and observing this problem?
Other
Are you building on Windows WSL2?
Relevant log URL
No response
Code of Conduct