~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel

Last commit made on 2024-07-05
Get this branch:
git clone -b ubuntu/devel https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools
Members of Ubuntu Core Development Team can upload to this branch. Log in for directions.

Branch merges

Branch information

Recent commits

7833d4c... by Benjamin Drung

Release initramfs-tools 0.142ubuntu30

Signed-off-by: Benjamin Drung <email address hidden>

3f3d90b... by Jeffery To

hooks/resume: Fix resume device type check

blkid will exit with success if it can gather information about the
device, even if the device does not match the specified type.

This fixes the device type check by getting the type value and testing
it directly.

Signed-off-by: Jeffery To <email address hidden>

0ea0fb6... by Benjamin Drung

Release initramfs-tools 0.142ubuntu29

Signed-off-by: Benjamin Drung <email address hidden>

0ca68bd... by Benjamin Drung

resume: always write valid resume device to /sys/power/resume

Users report that hibernation does not work on Ubuntu 24.04 (noble). The
initrd only sets the major:minor in `/sys/power/resume` in case of
resuming from hibernation, but systemd v255 will not allow hibernate to
start if the resume device has not be set in the kernel.

`blkid -p -o value -s TYPE $device` reports `swap` for swap partitions
and for swap files on Ubuntu 24.04 (noble). The type for resume images
is `swsuspend`.

So also set the major:minor in `/sys/power/resume` when the swap type is
`swap`.

Fixes: b3a78e4f8057 (" - resume: only resume when the partition contains a resume image - Fix resuming a hibernate session from a swapfile")
Fixes: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2057687

Merged branch ~bdrung/ubuntu/+source/initramfs-tools:swap
8fd3b04... by Benjamin Drung

fsck: Mention file system name in failed identification warning

`update-initramfs` might be unable to identify the file system type of
the root file system:

```
$ update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.15.0-1059-kvm
W: Couldn't identify type of root file system for fsck hook
```

This error message can be confusing and misleading for the user. The
Ubuntu bug reported initially assumed it to be a bug in initramfs-tools
but later found out that the file system missed the label.

Mention the file system name in failed identification warning to help
the user finding the reason.

Bug-Ubuntu: https://launchpad.net/bugs/2068077
Forwarded: https://salsa.debian.org/kernel-team/initramfs-tools/-/merge_requests/118
Signed-off-by: Benjamin Drung <email address hidden>

68dae92... by Jeffery To

Fix resume failure due to resume=UUID=... in certain cases

If resume= has not been set on the kernel command line, and either:
* RESUME=UUID=... is set in /etc/initramfs-tools/conf.d/resume
* RESUME=auto is set in /etc/initramfs-tool/conf.d/resume and swap is a
  traditional partition (not in LVM)

Then the resume variable will be set to a UUID, which causes the resume
local-premount script to fail as it expects the resume variable to be a
device path.

This moves the UUID handling further down, outside of the parse kernel
command line options loop, to catch these cases.

Fixes: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1769297
Fixes: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1853982
Fixes: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1957194
Signed-off-by: Jeffery To <email address hidden>

326e5a7... by Benjamin Drung

Release initramfs-tools 0.142ubuntu28

Signed-off-by: Benjamin Drung <email address hidden>

0a8e905... by Benjamin Drung

auto_add_modules: group dracut-install calls for block modules

Group calls to `dracut-install` that use the same `-s` parameter.

Benchmark results
=================

Benchmark on a Raspberry Pi Zero 2W on Ubuntu 24.04 (noble) on
2024-06-04. Previous commit:

```
bdrung@zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
  Time (mean ± σ): 228.483 s ± 5.953 s [User: 57.447 s, System: 162.737 s]
  Range (min … max): 219.897 s … 240.041 s 10 runs
```

This commit:

```
bdrung@zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
  Time (mean ± σ): 226.658 s ± 5.861 s [User: 54.878 s, System: 160.566 s]
  Range (min … max): 220.091 s … 237.076 s 10 runs
```

bb20916... by Benjamin Drung

Use copy_modules_dir instead of dracut-install calls

dracut-install has some startup costs and reducing the number of
dracut-install will increase the execution time. So use
`copy_modules_dir` again for calls that do not use `-s`.

Benchmark results
=================

Benchmark on a Raspberry Pi Zero 2W on Ubuntu 24.04 (noble) on
2024-06-04. Previous commit:

```
bdrung@zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
  Time (mean ± σ): 236.326 s ± 6.033 s [User: 62.455 s, System: 165.245 s]
  Range (min … max): 229.254 s … 244.094 s 10 runs
```

This commit:

```
bdrung@zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
  Time (mean ± σ): 228.483 s ± 5.953 s [User: 57.447 s, System: 162.737 s]
  Range (min … max): 219.897 s … 240.041 s 10 runs
```

The expected difference (for two dracut-install calls less) is a few
seconds which fits within the margin of error. The changes of the range
is a good indicator.

3121df3... by Benjamin Drung

reduce number of dracut-install calls

dracut-install has a slow start-up time on ARM devices. Alper Nebi Yasak
wrote: "On my ARM64 Chromebooks dracut-install takes about 2-3 seconds
to start up even for a single module." [1]

Instead of `manual_add_modules` calling `dracut-install` directly,
collect the wanted kernel modules in a temporary file. Call
dracut-install at the end on all modules in one go.

Since the `vmxnet` hook from `open-vm-tools` and `bootcdinitramfshook`
from `bootcd` look at the copied kernel modules, call
`apply_add_modules` before calling the hooks to not break those hooks.

`hidden_dep_add_modules` looks at the installed kernel modules. So call
`apply_add_modules` before it. Since it is the last function that
installs kernel modules, let it call dracut-install directly.

This can be a breaking change. To restore the previous behavior, call
`apply_add_modules` without arguments after a `manual_add_modules` call.

Benchmark results
=================

Benchmark on a Raspberry Pi Zero 2W on Ubuntu 24.04 (noble) on
2024-06-03. initramfs-tools 0.142ubuntu25.1:

```
bdrung@zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
  Time (mean ± σ): 402.751 s ± 5.592 s [User: 166.316 s, System: 228.909 s]
  Range (min … max): 394.380 s … 411.445 s 10 runs
```

This commit:

```
bdrung@zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
  Time (mean ± σ): 236.326 s ± 6.033 s [User: 62.455 s, System: 165.245 s]
  Range (min … max): 229.254 s … 244.094 s 10 runs
```

LP: #2065180
Forwarded: https://salsa.debian.org/kernel-team/initramfs-tools/-/merge_requests/114
[1] https://salsa.debian.org/kernel-team/initramfs-tools/-/merge_requests/102