FS#39059 - [systemd] [mkinitcpio] systemd hook fails to find some files

Attached to Project: Arch Linux
Opened by zless (roentgen) - Thursday, 27 February 2014, 06:20 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 27 February 2014, 20:11 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Allan McRae (Allan)
Dave Reisner (falconindy)
Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

When rebuilding the init image some files fail to add.
The verbose mkinitcpio log shows:

# mkinitcpio -v -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -v -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g
/boot/initramfs-linux.img
==> Starting build: 3.13.5-1-ARCH
-> Running build hook: [/usr/lib/initcpio/install/systemd]
adding file: /bin/mount
adding symlink: /usr/lib/libmount.so.1 -> libmount.so.1.1.0
adding file: /usr/lib/libmount.so.1.1.0
adding symlink: /usr/lib/libc.so.6 -> libc-2.19.so
adding file: /usr/lib/libc-2.19.so
adding symlink: /usr/lib/libblkid.so.1 -> libblkid.so.1.1.0
adding file: /usr/lib/libblkid.so.1.1.0
adding symlink: /usr/lib/libuuid.so.1 -> libuuid.so.1.3.0
adding file: /usr/lib/libuuid.so.1.3.0
adding symlink: /lib64/ld-linux-x86-64.so.2 -> ld-2.19.so
adding file: /usr/lib/ld-2.19.so
adding file: /usr/bin/modprobe
adding symlink: /usr/lib/libz.so.1 -> libz.so.1.2.8
adding file: /usr/lib/libz.so.1.2.8
adding file: /init
adding symlink: /usr/lib/libpam.so.0 -> libpam.so.0.83.1
adding file: /usr/lib/libpam.so.0.83.1
adding symlink: /usr/lib/libcap.so.2 -> libcap.so.2.24
adding file: /usr/lib/libcap.so.2.24
adding symlink: /usr/lib/libkmod.so.2 -> libkmod.so.2.2.6
adding file: /usr/lib/libkmod.so.2.2.6
adding symlink: /usr/lib/librt.so.1 -> librt-2.19.so
adding file: /usr/lib/librt-2.19.so
adding symlink: /usr/lib/libpthread.so.0 -> libpthread-2.19.so
adding file: /usr/lib/libpthread-2.19.so
adding symlink: /usr/lib/libdl.so.2 -> libdl-2.19.so
adding file: /usr/lib/libdl-2.19.so
adding symlink: /usr/lib/libattr.so.1 -> libattr.so.1.1.0
adding file: /usr/lib/libattr.so.1.1.0
adding file: /usr/bin/systemd-tmpfiles
adding file: /usr/lib/systemd/system-generators/systemd-fstab-generator
adding file: /usr/lib/udev/rules.d/50-udev-default.rules
adding file: /usr/lib/udev/rules.d/60-persistent-storage.rules
==> ERROR: file not found: `'
==> ERROR: file not found: `'
==> ERROR: file not found: `'
==> ERROR: file not found: `'
==> ERROR: file not found: `'
adding file: /usr/lib/udev/rules.d/64-btrfs.rules
adding file: /usr/lib/udev/rules.d/80-drivers.rules
adding file: /usr/lib/udev/rules.d/99-systemd.rules
==> ERROR: file not found: `'
adding file: /usr/lib/systemd/system/ctrl-alt-del.target
adding file: /usr/lib/systemd/system/systemd-reboot.service
adding file: /usr/lib/systemd/system/shutdown.target

I am not sure what's causing it. As seen in the pacman.log it worked fine with systemd 209.3 on February 23.

Additional info:
systemd 210-1
bash 4.3-1

This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 27 February 2014, 20:11 GMT
Reason for closing:  Fixed
Additional comments about closing:  testing/systemd-210-2
Comment by Doug Newgard (Scimmia) - Thursday, 27 February 2014, 06:59 GMT
I'm guessing that it's mkinitcpio needing to be updated for changes in systemd, but I'm really not sure. Luckily, they have a common maintainer, so we'll see what falconindy says.
Comment by kinodont (kinodont) - Thursday, 27 February 2014, 08:00 GMT
Confirmed. Happens when processing the systemd hook but only with bash 4.3-1 and readline 6.3-1 installed.
After downgrading these two packages to their versions in core (bash 4.2.045-5, readline 6.2.004-2), the errors disappeared.
Comment by Zachary Cook (Zeik) - Thursday, 27 February 2014, 08:00 GMT
It seems /usr/lib/udev/scsi_id and /usr/lib/udev/ata_id are not being found and added to the initial ramdisk (see attached journal.txt)

With some strace+grep magic, I think I found the problem (see attached systemd-hook-trace.txt)

Escaped quotes in the filenames look like the culprit, I think initcpio-install-systemd might need to be fixed.

Also a bit off topic, as I was looking at initcpio-install-systemd, I saw that it has a TODO about sd-bus that might apply since v209.

EDIT: After reading Lucas' comment it seems that might be the real problem.
Comment by Thomas Bächler (brain0) - Thursday, 27 February 2014, 09:51 GMT
Adding Tom to assignees, since he wrote the systemd hook. Note that I have been booting with the mkinitcpio images without trouble despite the errors.
Comment by Dave Reisner (falconindy) - Thursday, 27 February 2014, 14:51 GMT
> Adding Tom to assignees, since he wrote the systemd hook.
Well, but I wrote the strip_quotes function, which is where this seems to have broken. Seems more like a regression in bash 4.3. I've distilled the problem down to the attached script. Using eval instead of declare -g appears to work around the issue, but eval is really no solution here.

Adding Allan (bash maintainer).
Comment by Dave Reisner (falconindy) - Thursday, 27 February 2014, 15:16 GMT
Might be even simpler than this...

fn() { local v=1; declare -g v=2; echo "v=$v"; }; fn

The combination of 'local' and declare -g is what fails... Reported upstream.
Comment by Dave Reisner (falconindy) - Thursday, 27 February 2014, 15:30 GMT
Blah... #bash points me in the right direction. this seems to be working as intended based on this particular changelog item:

builtins/declare.def
- declare_internal: if -g given with name=value, but variable is not
found in the global variable table, make sure to call
bind_global_variable so the variable is created and modified at
global scope. Fixes a bug where declare -g x=y could modify `x'
at a previous function scope

I can fix this in the systemd hook. See attached.

Loading...