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
Opened by zless (roentgen) - Thursday, 27 February 2014, 06:20 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 27 February 2014, 20:11 GMT
|
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
Thursday, 27 February 2014, 20:11 GMT
Reason for closing: Fixed
Additional comments about closing: testing/systemd-210-2
After downgrading these two packages to their versions in core (bash 4.2.045-5, readline 6.2.004-2), the errors disappeared.
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.
systemd-hook-trace.txt (1.5 KiB)
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).
fn() { local v=1; declare -g v=2; echo "v=$v"; }; fn
The combination of 'local' and declare -g is what fails... Reported upstream.
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.