canonical / canonical/core-initrd

ubuntu-core-initramfs fails in oracular: /etc needs to be created before ldconfig is run

Open
#254 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
18
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Hi,

Installing kernels (with u-c-i installed) on oracular fails as ldconfig fails to run:

```
Processing triggers for linux-image-unsigned-6.10.0-20-generic (6.10.0-20.20) ...
/etc/kernel/postinst.d/ubuntu-core-initramfs:
/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: No such file or directory
Traceback (most recent call last):
File "/usr/bin/ubuntu-core-initramfs", line 875, in
main()
File "/usr/bin/ubuntu-core-initramfs", line 871, in main
globals()[args.subcmd.replace("-", "_")](parser, args)
File "/usr/bin/ubuntu-core-initramfs", line 650, in create_initrd
install_misc(main, rootfs)
File "/usr/bin/ubuntu-core-initramfs", line 482, in install_misc
check_call(["ldconfig", "-r", dest_dir])
File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ldconfig', '-r', '/tmp/tmpg_hc5zl_.ubuntu-core-initramfs/main']' returned non-zero exit status 1.
run-parts: /etc/kernel/postinst.d/ubuntu-core-initramfs exited with return code 1
```

creating /etc by adding it to the files installed by install_misc makes sure it exists before ldconfig, so it seems as if it used to be included there indirectly by something else.

This is easy to reproduce on a chroot as well.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the ubuntu-core-initramfs script, especially install_misc and the ldconfig call shown in the traceback. Reproduce the failure in an Oracular chroot, then verify that installing a kernel completes successfully and ldconfig can create its cache under the generated initramfs root.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python, ubuntu
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.