FS#41468 - [mkinitcpio] 18-1 build warning is triggered wrongly

Attached to Project: Arch Linux
Opened by Cem Aydin (rebootl) - Monday, 04 August 2014, 18:52 GMT
Last edited by Dave Reisner (falconindy) - Friday, 05 September 2014, 12:56 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Thomas Bächler (brain0)
Dave Reisner (falconindy)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Introduced by this commit: https://projects.archlinux.org/mkinitcpio.git/commit/?id=02d387b2370215d51d1aa8958fce42cd099bee29

This should filter out files not matching *.conf from /etc/modprobe.d which it does well, but if the alphabetically last file in there is not matching, then the final build warning "==> WARNING: errors were encountered during the build. The image may not be complete." is triggered.

I think it would be good to fix this cause adding in a filter to (un)match files that then triggers a build warning doesn't really make sense...

I've got a fix for this but due to the trap in mkinitcpio not getting the return code from an explicit return statement it may be a bit crappy, attached.

Also please see the discussion: https://bbs.archlinux.org/viewtopic.php?id=185204
A few people affected.


Additional info:
* package version(s) 18-1
* config and/or log files etc.


Steps to reproduce:

without "bad" file working fine:
--------------------------

[root@hplaptop mkinitcpio]# ls /etc/modprobe.d
nobeep.conf
[root@hplaptop mkinitcpio]# mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 3.15.8-1-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [autodetect]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [resume]
-> Running build hook: [filesystems]
-> Running build hook: [keyboard]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 3.15.8-1-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [modconf]
-> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: smsmdtv
-> Running build hook: [resume]
-> Running build hook: [filesystems]
-> Running build hook: [keyboard]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful

with "bad" file:
----------------

[root@hplaptop mkinitcpio]# touch /etc/modprobe.d/zzz.foo
[root@hplaptop mkinitcpio]# mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 3.15.8-1-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [autodetect]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [resume]
-> Running build hook: [filesystems]
-> Running build hook: [keyboard]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> WARNING: errors were encountered during the build. The image may not be complete.
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 3.15.8-1-ARCH
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [modconf]
-> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: smsmdtv
-> Running build hook: [resume]
-> Running build hook: [filesystems]
-> Running build hook: [keyboard]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> WARNING: errors were encountered during the build. The image may not be complete.
This task depends upon

Closed by  Dave Reisner (falconindy)
Friday, 05 September 2014, 12:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  backported fix to mkinitcpio 18-2
Comment by Dave Reisner (falconindy) - Monday, 04 August 2014, 19:27 GMT
Thanks for opening a bug.

All you really needed to do here was convert the compound commands to if/then blocks (I did that locally this morning). Errors from any function starting with "add_" are automatically collected.
Comment by Cem Aydin (rebootl) - Monday, 04 August 2014, 21:32 GMT
Oh well, yeah that was also the first thing I did, but then I thought it doesn't work. You mean in this case, it's working because the function inside the blocks, add_symlink and add_file are add_* functions too?
Yes, of course, that would make sense then, ok.
Thanks
Comment by Dave Reisner (falconindy) - Monday, 04 August 2014, 21:39 GMT Comment by Cem Aydin (rebootl) - Monday, 04 August 2014, 21:58 GMT
Yes, I actually had seen the trap there before (posted that on the forum https://bbs.archlinux.org/viewtopic.php?pid=1443684#p1443684 ) but just didn't realize that the functions in the block would trigger it on their own... I've never used a trap like this, so, at least I've learned something ;)
Comment by Francis Moreau (fmoreau) - Friday, 05 September 2014, 06:31 GMT
Hello, is this been fixed finally ? thanks.

Loading...