1747 Commits

Author SHA1 Message Date
Ben Hutchings
1c6cef3071 Merge branch 'dep-add-panels-wildcard' into 'master'
hook-functions: dep_add_modules: Generalise wildcard for panel drivers

See merge request kernel-team/initramfs-tools!105
2024-05-20 21:30:39 +00:00
Benjamin Drung
05ea8a5795 Skip compression support check if /boot/config-${version} is missing
```
update-initramfs: Generating /boot/initrd.img-5.19.0-35-generic
grep: /boot/config-5.19.0-35-generic: No such file or directory
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
grep: /boot/config-5.19.0-35-generic: No such file or directory
E: gzip compression (CONFIG_RD_GZIP) not supported by kernel
update-initramfs: failed for /boot/initrd.img-5.19.0-35-generic with 1.
```

LP: #2018171
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-20 22:43:00 +02:00
Alper Nebi Yasak
465ae6b526 hook-functions: dep_add_modules: Generalise wildcard for panel drivers
With MODULES=dep, we walk a few /sys/ paths to include panel drivers
based on what we know. These might not be enough to catch everything,
and we don't have enough data to know what we are missing.

Instead of only walking sysfs directories for select buses and specific
panel drivers, do it for any panel-related driver under any bus.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-05-20 23:25:34 +03:00
Alper Nebi Yasak
36c7300448 hook-functions: dep_add_modules: Include mipi-dsi panel drivers
Apparently display panels connected over MIPI DSI can show up under /sys
as e.g. `/sys/bus/mipi-dsi/drivers/panel-boe-tv101wum-nl6/` on a MT8183
Chromebook tablet [1]. The related `mt8183-kukui.dtsi` device-tree file
indeed has the `panel` device under a `&dsi0` section. Presumably, we
also need to include modules for this and similar drivers in initramfs
to get a working display on these boards.

Add a wildcard for the mipi-dsi bus to the list of /sys/ paths we walk
for panel drivers when MODULES=dep.

[1] https://lore.kernel.org/linux-mediatek/CAJMQK-jOgkRzYOTsiuUY4X8hzcGQL0XRiJSs7giiShnRb=nO_A@mail.gmail.com/

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-05-20 23:04:16 +03:00
Ben Hutchings
815fb13fbb Merge branch 'hyperv' into 'master'
Add hyper-v modules, needed to enter LUKS password

See merge request kernel-team/initramfs-tools!69
2024-05-20 10:42:45 +00:00
Arnaud Rebillout
8f2f49e1f0 Add hyper-keyboard module, needed to enter LUKS password in Hyper-V
Originally reported in the Kali Linux bug tracker: it's not possible to
type the LUKS password, in case of full disk encryption, in a Gen2
Hyper-V virtual machine. This is due to missing support for keyboard.

The original bug is at https://bugs.kali.org/view.php?id=7846, and I'll
quote the bits that are relevant:

> Because Generation 2 virtual machines in Hyper-V are presented with a
> minimal set of EFI hardware, the kernel module "hyperv_keyboard" must
> be present to interact with the console keyboard. On systems with disk
> encryption, the user will be prompted for the key to decrypt the disk,
> but cannot enter the password because no keyboard driver is present.
>
> [...]
>
> This module *is* present when the grub menu is presented and later
> when the kernel is fully loaded.  FYI, if some mechanism requires a
> mouse or touch, the hid_hyperv module will also be needed.

This issue also affects Debian, as discussed in:
<https://forums.debian.net/viewtopic.php?t=131468>

This issue was also reported in the Ubuntu tracker, back in 2016:
<https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1567107>
It was fixed in Ubuntu, but the changes never made it to Debian.

This commit adds the module hyperv-keyboard along with the other
keyboard drivers.

Closes: #1028511
2024-05-20 09:59:21 +07:00
Ben Hutchings
b7f5a3ceaa Merge branch 'merge-manual_add_modules-calls' into 'master'
Merge consecutive manual_add_modules calls into one

See merge request kernel-team/initramfs-tools!101
2024-05-19 22:07:53 +00:00
Ben Hutchings
142d51703e Merge branch 'cros-modules-mt8173-mt8183' into 'master'
hook-functions: auto_add_modules: Add modules for MT8173/MT8183 Chromebooks

See merge request kernel-team/initramfs-tools!87
2024-05-19 21:57:02 +00:00
Ben Hutchings
00c8e8553b Merge branch 'bring-up-networking' into 'master'
Bring up networking if ip is specified on cmdline

See merge request kernel-team/initramfs-tools!77
2024-05-19 21:55:32 +00:00
Benjamin Drung
05692dc284 Merge consecutive manual_add_modules calls into one
`manual_add_modules` can take multiple kernel modules as parameter.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 23:43:50 +02:00
Benjamin Drung
d75a58bab1 Bring up networking if ip is specified on cmdline
If the kernel command line has `ip=` in it, it is arguable that
configure_networking should be run.

Add `qemu-net` autopkgtest to test the behavior for several values of
the `ip=` cmdline parameter.

Closes: #789067
LP: #1463846
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 23:11:38 +02:00
Benjamin Drung
3c026972c8 test: create /lib64 to /usr/lib64 symlink as well
The `/lib64` to `/usr/lib64` symlink is needed for
`/usr/lib64/ld-linux-x86-64.so.2`. Otherwise dash will not find the
programs.
2024-05-19 22:14:18 +02:00
Benjamin Drung
f9dbdc628f test: Check that the network is not configured
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 22:14:18 +02:00
Ben Hutchings
febab1cc76 Merge branch 'wrap-and-sort' into 'master'
Run wrap-and-sort

See merge request kernel-team/initramfs-tools!99
2024-05-19 19:21:04 +00:00
Alper Nebi Yasak
85239a1412 hook-functions: auto_add_modules: Add modules for MT8173/8183 Chromebooks
Include drivers for MediaTek USB3 Dual Role controller along with other
USB drives. ARM64 Chromebooks do not have a usable platform framebuffer
available with their stock firmware, so add the drivers needed to get
visible output (for initramfs password prompts).

There seem to be a few dependency chains not expressed in module info
with these devices. Add those who would not be included even with a
devlink supplier relation as hidden dependencies.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-05-19 21:07:51 +03:00
Ben Hutchings
ecc53f96cc Merge branch 'drop-obsolete-maint-script' into 'master'
initramfs-tools-core: drop support for upgrading from < 0.138

See merge request kernel-team/initramfs-tools!100
2024-05-19 18:01:52 +00:00
Benjamin Drung
c9d970c665 initramfs-tools-core: drop support for upgrading from < 0.138
lintian complains: X: initramfs-tools-core:
maintainer-script-supports-ancient-package-version 0.138
(2020-09-11 < 2021-08-14) [postinst:11]
2024-05-19 18:55:54 +02:00
Benjamin Drung
995a33cf18 Run wrap-and-sort
Run `wrap-and-sort`.
2024-05-19 18:23:51 +02:00
Ben Hutchings
c7946327d8 Merge branch 'ignore-ldd-warning' into 'master'
copy_exec: ignore ldd output lines not starting with a tab

See merge request kernel-team/initramfs-tools!95
2024-05-19 16:14:07 +00:00
Ben Hutchings
5dc06f36de Merge branch 'simplify-pipefail' into 'master'
mkinitramfs: Simplify pipefail implementation

See merge request kernel-team/initramfs-tools!98
2024-05-19 16:09:34 +00:00
Ben Hutchings
c1fc311333 Merge branch 'fix-missing-hostname' into 'master'
persist_hostname: fix missing hostname command

See merge request kernel-team/initramfs-tools!97
2024-05-19 15:35:43 +00:00
Benjamin Drung
dbd1a568f5 copy_exec: ignore ldd output lines not starting with a tab
ldd can print warnings about user installed libraries:

```
$ env --unset=LD_PRELOAD ldd /usr/lib/x86_64-linux-gnu/plymouth//two-step.so
/usr/lib/x86_64-linux-gnu/plymouth//two-step.so: /usr/local/lib/x86_64-linux-gnu/libpng16.so.16: no version information available (required by /lib/x86_64-linux-gnu/libply-splash-graphics.so.5)
    linux-vdso.so.1 (0x00007ffc0f9fe000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f349dd70000)
    libply.so.5 => /lib/x86_64-linux-gnu/libply.so.5 (0x00007f349dd52000)
    libply-splash-core.so.5 => /lib/x86_64-linux-gnu/libply-splash-core.so.5 (0x00007f349dd2f000)
    libply-splash-graphics.so.5 => /lib/x86_64-linux-gnu/libply-splash-graphics.so.5 (0x00007f349dd1e000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f349daf6000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f349de84000)
    libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f349daca000)
    libpng16.so.16 => /usr/local/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f349da7e000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f349da62000)
```

This causes `copy_exec` to parse the warning and wanting to install the
analyzed `two-step.so` library again (and then failing).

LP: #2046570
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 17:10:40 +02:00
Benjamin Drung
e11494312f mkinitramfs: Simplify pipefail implementation
Echoing shell code that sets the variables `ec1` and `ec2` when
evaluated is way too complicated for implementing pipefail (which is not
available in dash). Just write the exit code to FD 3 instead.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 16:36:31 +02:00
Ben Hutchings
a345082d86 Merge branch 'log-mkinitramfs-call' into 'master'
test: log build_initramfs call

See merge request kernel-team/initramfs-tools!94
2024-05-19 14:12:21 +00:00
Ben Hutchings
2e4c3e52f7 Merge branch 'qemu-nodefaults' into 'master'
test: Call qemu with -nodefaults

See merge request kernel-team/initramfs-tools!81
2024-05-19 14:11:28 +00:00
Ben Hutchings
46d85003e4 Merge branch 'dep-syswalk-devlink-suppliers' into 'master'
hook-functions: sys_walk_mod_add: Add devlink suppliers as dependencies

See merge request kernel-team/initramfs-tools!85
2024-05-19 14:10:21 +00:00
Benjamin Drung
9a106739a0 persist_hostname: fix missing hostname command
Without busybox `persist_hostname` will fail:

```
/init: 491: /init: hostname: not found
```

Write directly to the kernel to set the hostname instead.
2024-05-19 16:03:45 +02:00
Benjamin Drung
51719202e2 test: log build_initramfs call
Log `build_initramfs` call to make debugging easier.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 15:47:50 +02:00
Benjamin Drung
1f6bfe7076 test: Call qemu with -nodefaults
To potentially reduce the execution time a bit, call qemu with
`-nodefaults`. Only the serial console is needed to be setup.

The execution time of `amd64-virtio-only` on an AMD Ryzen 7 5700G system
reduced from 10.01 +- 0.04 seconds to 9.82 +- 0.04 seconds. This
improvement is neglectable on amd64, but could be noticeable on slower
architectures.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 15:47:04 +02:00
Alper Nebi Yasak
3c86dbad71 hook-functions: sys_walk_mod_add: Add devlink suppliers as dependencies
With MODULES=dep, we walk through sysfs to add device-specific modules,
and their dependencies based on `modprobe --show-depends`. However in
embedded systems, a lot dependency relations ended up being expressed
only in device-tree instead of in the usual ways.

This dependency information is exposed in sysfs as a "devlink" [1],
where each involved driver is a "consumer" or "supplier" [2] of the
link. Not including suppliers for a driver in initramfs can make it
defer probing indefinitely, leading to breakage. This led to dracut
including them as well [3].

While walking sysfs for modules we want to add, also walk their
suppliers and add those as well. The supplier dependencies can have
cycles in them, so we can't recursively call sys_walk_mod_add. Instead,
do an iterative traversal of the dependency graph to collect all device
paths we need to look into, then actually add the modules for those.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-devlink?h=v6.6
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-devices-supplier?h=v6.6
[3] https://github.com/dracutdevs/dracut/pull/2075

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-05-19 15:21:57 +03:00
Ben Hutchings
9dc8ac0c78 Merge branch 'all-archs' into 'master'
Run autopkgtest on more architectures

See merge request kernel-team/initramfs-tools!80
2024-05-19 11:27:56 +00:00
Ben Hutchings
5594c223fc Merge branch 'improve-test-common' into 'master'
Several improvements for debian/tests/test-common

See merge request kernel-team/initramfs-tools!76
2024-05-19 10:51:59 +00:00
Ben Hutchings
a5e5749572 Merge branch 'lintian' into 'master'
Fix lintian complaints

See merge request kernel-team/initramfs-tools!82
2024-05-19 10:50:05 +00:00
Benjamin Drung
ea3e090d84 Run autopkgtest on more architectures
Extend autopkgtest to also run on `arm64`, `armhf`, `ppc64el`, and
`s390x`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:54:29 +02:00
Benjamin Drung
8e8554bd08 test: Add random number generator to qemu
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:21:43 +02:00
Benjamin Drung
028d6e0e9e autopkgtest: Group tests with identical dependencies
Group tests with identical dependencies that will support the same
number of architectures in a later commit.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:21:43 +02:00
Benjamin Drung
c25336f84d autopkgtest: Rely on linux-image-generic alias on Debian
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:21:43 +02:00
Benjamin Drung
7bcc5ae6c7 autopkgtest: Explicitly specify supported architectures
Explicitly specify supported architectures. Then the restriction
`skip-not-installable` can be dropped.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:21:43 +02:00
Benjamin Drung
680698c1c2 test-common: Wrap long qemu-system-x86_64 line
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:21:06 +02:00
Benjamin Drung
2239b0ecc1 test-common: Support "set -u"
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:21:02 +02:00
Benjamin Drung
0c2367395f Drop Breaks/Conflicts that predate Debian 10 "buster" and Ubuntu 20.04 "focal"
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-19 00:18:38 +02:00
Benjamin Drung
5908b3cc84 Bump Standards-Version to 4.7.0
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-18 19:30:02 +02:00
Benjamin Drung
ad808f4347 Switch to debhelper 13
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-18 19:29:09 +02:00
Benjamin Drung
613c4f53a3 Convert debian/copyright to machine-readable format
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-18 19:29:09 +02:00
Benjamin Drung
b33e6c8c38 Update lintian override to format for lintian 2.116.3
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-18 19:29:09 +02:00
Benjamin Drung
c8d88a58e5 test-common: Use one common temporary directory
Instead of spreading all temporary files in the temporary directory,
create one common sub-directory in the temporary directory named
`initramfs-test` and place everything inside there. This makes looking
at the generated files easier.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-18 19:11:09 +02:00
Ben Hutchings
3436c177b9 Merge branch 'fix-amd64-separate-usr' into 'master'
test: Fix too small ext2 block count

See merge request kernel-team/initramfs-tools!75
2024-05-18 16:14:33 +00:00
Benjamin Drung
124d98bc25 test: Fix too small ext2 block count
The `amd64-separate-usr` autopkgtest fails always in a Debian unstable
schroot environment (with overlayfs) with:

```
genext2fs: couldn't allocate a block (no free space)
```

This is caused by specifying a too small amount of blocks:

```
$ mkdir /tmp/empty
$ genext2fs -b 20 -N 12 -U -d /tmp/empty /tmp/empty.raw
genext2fs: couldn't allocate a block (no free space)
$ genext2fs -b 25 -N 12 -U -d /tmp/empty /tmp/empty.raw
copying from directory /tmp/empty
```

Increase the minimum to 28 blocks solved the failure.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2024-05-18 17:56:40 +02:00
Ben Hutchings
bbe22ecd58 Merge branch 'dep-add-panels-properly' into 'master'
hook-functions: dep_add_modules: Properly include panel drivers

See merge request kernel-team/initramfs-tools!86
2024-05-18 15:49:24 +00:00
Ben Hutchings
f9059f7e54 Merge branch 'dont-die-on-no-networking' into 'master'
scripts/functions: Don't die if configure_networking times out

See merge request kernel-team/initramfs-tools!74
2024-05-18 15:11:29 +00:00