Public bug reported:

# initramfs-tools dhcpcd hook uses obsolete paths, preventing kernel
package configuration

**Package:** initramfs-tools-core  
**Affected component:** `/usr/share/initramfs-tools/hooks/dhcpcd`  
**Severity:** Prevents initramfs generation and can leave installed kernels 
unbootable  
**Status:** Recovered using compatibility symlinks

### Summary

During recovery from an interrupted Ubuntu upgrade, `mkinitramfs`
consistently failed because the `dhcpcd` initramfs hook referenced files
under `/usr/lib/dhcpcd/`, while the installed `dhcpcd-base` package
placed those files under `/usr/libexec/`.

The failure prevented three installed kernel packages from completing
configuration. The system subsequently failed to boot because its LVM
root filesystem could not be activated during early boot.

Creating compatibility symlinks for the mismatched paths allowed
initramfs generation and package configuration to complete. The machine
subsequently booted successfully.

### Affected packages

- `initramfs-tools-core`: owns the failing `dhcpcd` hook
- `dhcpcd-base`: provides the executable and hook files
- `dhcpcd`: not installed as a separate package
- `linux-image-7.0.0-30-generic`
- `linux-image-7.0.0-34-generic`
- `linux-image-7.0.0-38-generic`

Exact package versions should be collected from the recovered system.

### Observed behavior

Running:

```bash
dpkg --configure -a
```

failed while configuring each affected kernel:

```text
E: /usr/share/initramfs-tools/hooks/dhcpcd failed with return 1
```

A separate, instrumented `mkinitramfs` invocation exposed the underlying
file-path failures.

**First mismatch: executable**

The initramfs hook expected:

```text
/usr/lib/dhcpcd/dhcpcd-run-hooks
```

The installed `dhcpcd-base` package provided:

```text
/usr/libexec/dhcpcd-run-hooks
```

After adding a compatibility symlink, the instrumented build confirmed
that `copy_exec` resolved the executable and copied it into the
temporary initramfs tree.

**Second mismatch: DHCP hook files**

The build then failed while attempting to copy:

```text
/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname
```

The relevant trace was:

```text
+ copy_file config /usr/lib/dhcpcd/dhcpcd-hooks/30-hostname
+ src=/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname
+ target=/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname
+ [ -f /usr/lib/dhcpcd/dhcpcd-hooks/30-hostname ]
+ return 2
E: /usr/share/initramfs-tools/hooks/dhcpcd failed with return 2.
```

The installed package actually provided:

```text
/usr/libexec/dhcpcd-hooks/30-hostname
```

This location was verified using:

```bash
dpkg -L dhcpcd-base | grep 30-hostname
```

### Recovery workaround

Within a chroot of the installed system, the following compatibility
symlinks were created:

```bash
mkdir -p /usr/lib/dhcpcd

ln -s /usr/libexec/dhcpcd-run-hooks \
    /usr/lib/dhcpcd/dhcpcd-run-hooks

ln -s /usr/libexec/dhcpcd-hooks \
    /usr/lib/dhcpcd/dhcpcd-hooks
```

Afterward, initramfs generation succeeded, and the previously incomplete
package configuration was repaired.

The following checks confirmed recovery:

- `/boot/initrd.img-7.0.0-38-generic` was successfully generated.
- `dpkg --audit` returned no outstanding package configuration problems.
- The machine booted successfully from its LVM root filesystem.

### Expected behavior

The `dhcpcd` initramfs hook should use paths compatible with the
installed `dhcpcd-base` package, allowing initramfs generation to
complete without manual filesystem modifications.

### Actual behavior

The hook references paths absent from the installed package, causing
initramfs generation to fail and preventing kernel package
configuration.

### Impact

This failure occurred during an interrupted OS upgrade and complicated
recovery significantly.

Because the system uses LVM for its root filesystem, a valid initramfs
is essential for booting. The latest installed kernel had no generated
initramfs, and the existing kernels could not successfully activate the
root volume during boot.

The precise contribution of this packaging mismatch to the failures of
the older kernels has not been independently established.

### Suggested investigation

Please investigate whether the `dhcpcd` hook in `initramfs-tools-core`
is compatible with the filesystem layout provided by the installed
`dhcpcd-base` package.

In particular:

- Verify the executable and hook directory paths.
- Determine whether the affected package versions can legitimately coexist 
during upgrades.
- Ensure a missing DHCP hook file does not unnecessarily prevent generation of 
an otherwise functional local-root initramfs.
- Consider an upgrade or compatibility test covering this combination of 
packages.

### Supporting evidence

An instrumented `mkinitramfs` build log is available and captures the
path resolution, successful executable copy, and subsequent failure on
`30-hostname`.

The compatibility symlinks are a recovery workaround, not a proposed
permanent packaging fix.

-----
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 26.04.1 LTS
Release:        26.04
Codename:       resolute

-----
# dpkg-query -W initramfs-tools-core initramfs-tools dhcpcd-base
dhcpcd-base     1:10.3.0-7
initramfs-tools 0.142ubuntu25.8
initramfs-tools-core    0.142ubuntu25.8
-----

** Affects: initramfs-tools (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2171568

Title:
  Upgrading laptop doesn't succeed due to dhcpcd issue

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2171568/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to