mkinitramfs fails with copy_file binary '/libgcc_s.so.[1-9]' not found
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| initramfs-tools (Ubuntu) |
New
|
Critical
|
Unassigned | ||
Bug Description
I recently did an 24.10 install and was surprised that the system hangs during the post-install reboot.
Investigation showed that this happens if the installer applies updates, which is done by default, if there is proper network connectivity and archive access.
In case of an install where I disabled the network, hence an offline install was done, the installation incl. post-install reboot was successful.
So I took such a successfully installed system (where no updates were applied) and noticed that currently the available updates are:
$ apt list --upgradable
iproute2/
linux-generic/
linux-headers-
linux-image-
linux-libc-
linux-tools-
So seemed to be kernel related, hence tried to update the kernel manually:
$ sudo apt install linux-image-
Selected version '6.11.0-9.9' (Ubuntu:
Upgrading:
linux-generic linux-image-generic linux-tools-common
linux-
Installing dependencies:
linux-
linux-
linux-
linux-
Suggested packages:
fdutils linux-tools
Summary:
Upgrading: 5, Installing: 7, Removing: 0, Not Upgrading: 1
Download size: 65.3 MB
Space needed: 165 MB / 21.2 GB available
└─ in /boot: 43.1 MB / 1,876 MB available
Continue? [Y/n] Y
...
Setting up linux-generic (6.11.0-9.9) ...
Progress: [ 96%] [██████
Progress: [ 96%] [██████
Progress: [ 96%] [██████
update-initramfs: Generating /boot/initrd.
mkinitramfs: copy_file: binary '/usr/lib/
mkinitramfs: copy_file: binary '/libgcc_
Using config file '/etc/zipl.conf'
Run /lib/s390-
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Run /lib/s390-
Run /lib/s390-
Preparing boot device for LD-IPL: dm-0.
Done.
/etc/kernel/
kdump-tools: Generating /var/lib/
mkinitramfs: copy_file: binary '/usr/lib/
mkinitramfs: copy_file: binary '/libgcc_
/etc/kernel/
Using config file '/etc/zipl.conf'
Run /lib/s390-
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Run /lib/s390-
Run /lib/s390-
Preparing boot device for LD-IPL: dm-0.
Done.
Scanning processes...
Scanning processor microcode...
Scanning linux images...
Pending kernel upgrade!
Running kernel version:
6.11.0-8-generic
Diagnostics:
The currently running kernel version is not the expected kernel version
6.11.0-9-generic.
Restarting the system to load the new kernel will not be handled automatically,
so you should consider rebooting.
Failed to check for processor microcode upgrades.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
I noticed these two lines, that have been spit out by update-initramfs:
update-initramfs: Generating /boot/initrd.
mkinitramfs: copy_file: binary '/usr/lib/
mkinitramfs: copy_file: binary '/libgcc_
Hence I tried to ran update-initramfs on the release kernel 6.11.0-8-8 and it happened there as well:
$ sudo update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.
mkinitramfs: copy_file: binary '/usr/lib/
mkinitramfs: copy_file: binary '/libgcc_
Using config file '/etc/zipl.conf'
Run /lib/s390-
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Run /lib/s390-
Run /lib/s390-
Preparing boot device for LD-IPL: dm-0.
Done.
So it's a initramfs-tools (mkinitramfs) issue rather than a kernel issue,
somewhere in copy_libgcc() (or before).
Seems to be a small issue, but is causing a big impact, since it leads to a broken default installation.

modified the hook-functions script (at line 252 ff) a bit to gather some more details and that's it:
$ grep -A 10 "copy_libgcc()" /usr/share/ initramfs- tools/hook- functions
copy_libgcc() {
local libdir library
libdir="$1" "/libgcc_ s.so.[1- 9]; do img-6.11. 0-8-generic linux-gnu linux-gnu linux-gnu/ libgcc_ s.so.1 udev/dmsetup_ env' not found s.so.[1- 9]' not found tools/zipl_ helper. device- mapper 252:1 tools/zipl_ helper. device- mapper 252:1 tools/zipl_ helper. device- mapper 252:1 linux-gnu/ libgcc_ s.so.1 linux-gnu/ libgcc_ s.so.1
echo "1" "$1"
for library in "${libdir}
echo "2" "${libdir}"
copy_exec "${library}" || return
echo "3" "${library}"
done
}
$ sudo update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.
1 /lib/s390x-
2 /lib/s390x-
3 /lib/s390x-
mkinitramfs: copy_file: binary '/usr/lib/
1
2
mkinitramfs: copy_file: binary '/libgcc_
Using config file '/etc/zipl.conf'
Run /lib/s390-
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Run /lib/s390-
Run /lib/s390-
Preparing boot device for LD-IPL: dm-0.
Done.
$ ls -l /lib/s390x-
-rw-r--r-- 1 root root 80176 Sep 8 15:50 /lib/s390x-
$