If configuring the network times out, there will be no /run/net-*.conf
files present, and the attempt to source any interface config file will
fail. In this failure mode, dash (or 'bash --posix') immediately exits,
regardless of 'set -e' or not.
This precludes a caller from (cleanly) handling network bring-up
failure, particularly if the caller cares about the variables set from
sourcing the ipconfig config file.
paul@haley ~ % cat repro.sh
#!/bin/sh
. /nonexistent
echo hello
paul@haley ~ % dash ./repro.sh
./repro.sh: 3: .: cannot open /nonexistent: No such file
paul@haley ~ % sh ./repro.sh
./repro.sh: 3: .: cannot open /nonexistent: No such file
paul@haley ~ % bash ./repro.sh
./repro.sh: line 3: /nonexistent: No such file or directory
hello
paul@haley ~ % bash --posix ./repro.sh
./repro.sh: line 3: /nonexistent: No such file or directory
paul@haley ~ %
Co-authored-by: Pierre Neyron <pierre.neyron@imag.fr>
Closes: #1025730
To support using `set -eu` in initramfs-tools script (e.g. in
kdump-tools), the functions in `scripts/functions` need to support
`set -u` as well.
Signed-off-by: Benjamin Drung <bdrung@debian.org>
The test-common script constructs a trivial root filesytem including
klibc.so and the klibc commands. Since the filename of klibc.so
contains a hash, it uses dpkg to list files in libklibc and greps
through that list.
Since klibc 2.0.13-3, the canonical location of klibc.so is in
/usr/lib rather than /lib and the regex used no longer matches.
Change the regex to ignore the directory part of the filename.
The interpreter path in klibc binaries now also uses /usr/lib, so we
need to install it in /usr/lib rather than /lib. To be compatible
with both old and new klibc, usr-merge our trivial root filesystem.
Since `cp -a` serves as fallback, there's no need to clutter
the output.
Before:
```
$ sudo update-initramfs -u
ln: failed to create hard link '/boot/initrd.img-6.1.0-3-amd64.dpkg-bak' => '/boot/initrd.img-6.1.0-3-amd64': Operation not permitted
update-initramfs: Generating /boot/initrd.img-6.1.0-3-amd64
```
After:
```
$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.1.0-3-amd64
```
Signed-off-by: szubersk <szuberskidamian@gmail.com>
zfs presents mount points in /proc/mounts as a virtual one named
by the underlying dataset, while current implementation of
dep_add_modules_mount() wants a real mount point.
Users who run zfs as rootfs is required to install zfs-initramfs
to handle more details so there is no potential risk for not
handling kernel modules here until we have built-in zfs support.
Signed-off-by: Aron Xu <aron@debian.org>
[наб: fix whitespace error, subject typo]
Closes: #934736
With MODULES=dep, we try to walk the /sys/devices/platform/edp-panel
device to include panel drivers because they are needed get a display
output on some devices. This is a bit wrong, because the "edp-panel"
here is the name of a device-tree node that is not necessarily a panel.
Instead, walk the devices bound under the panel drivers for modules to
add to initramfs. Check not only for panel-edp, but panel-simple and
those available over dp-aux bus as well.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Support for coreboot framebuffer is currently built-in on Debian kernel.
If it's available on the system we don't need other graphics-related
modules when MODULES=dep. Add it to the list of devices we check to
disable adding those modules.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Use shunit2 for adding some unit tests to cover the functionality of
`_generate_hosts_content` and `netinfo_to_resolv_conf`.
Signed-off-by: Benjamin Drung <bdrung@debian.org>
live-boot generates `/etc/hostname`, `/etc/hosts`, and
`/etc/resolv.conf` in `do_netsetup` from `9990-networking.sh`.
kdump-tools needs similar code for generating a self-contained initrd
for dumping a crashed kernel via network.
Ubuntu carries a patch for initramfs-tools that adds
`netinfo_to_resolv_conf` to configure `/etc/resolv.conf` which is more
complex than the code from live-boot.
To prevent code duplication, implement `netinfo_to_resolv_conf` and
`persist_hostname` as helper functions and let `configure_networking`
call these functions.
Let `netinfo_to_resolv_conf` support multiple `/run/net-<device>` style
files to allow Ubuntu to reuse this code.
Signed-off-by: Benjamin Drung <bdrung@debian.org>
Various maintscripts contain code related to adjustments to be done
when upgrading from versions older than 0.123 or 0.126.
This code has not been run for a long time, considering that
old-old-stable (Debian 9, 2017) shipped with version 0.130.
It can thus be removed.
UFS is SCSI-like and its drivers used to be built under
drivers/scsi/ufs, but in 5.19 they're moving to drivers/ufs. Keep
including them in the "scsi" module class.
Signed-off-by: Ben Hutchings <benh@debian.org>
These are long obsolete:
- ieee1394 was replaced by firewire, and removed in Linux 2.6.37
- i2o was removed in Linux 4.2
The ide subsystem has also been removed in Linux 5.14 and most of its
drivers were replaced with libata-based drivers long ago. But some
ia64 and m68k machines still needed ide-based drivers until quite
recently, so I will give their users some more time to upgrade the
kernel.
Signed-off-by: Ben Hutchings <benh@debian.org>
Added a COMPRESSLEVEL parameter to initramfs.conf, a -l flag to
mkinitramfs, and updated initramfs.conf.5 and mkinitramfs.8 to match.
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
OpenZFS currently doesn't support resuming from swap devices
backed by ZVOL. Without this correction boot process hangs at
initramfs stage.
Signed-off-by: szubersk <szuberskidamian@gmail.com>
configure_networking can now wait for a named net device, but the net
device may be specified by hardware (MAC) address or not at all.
* Factor out the hardware-address-to-device lookup into a function
* Add a function to check whether any suitable device exists
* Change the wait loop to use the appropriate check for device
existence
* Update the IP variable after the wait loop, so it follows the
hardware-address-to-device lookup
Closes: #911727
Signed-off-by: Ben Hutchings <benh@debian.org>
Make the order of precedence for setting device name explicit.
Split _handle_device_vs_ip into two functions, one to update DEVICE
and one to update IP. This allows setting the device name in a way
that obviously follows the order of precedence, and also enables
improvements to the device wait loop.
Signed-off-by: Ben Hutchings <benh@debian.org>
Many devices do not have any built-in Ethernet support, or have
built-in USB Ethernet adapters.
Remove the exclusion of the drivers/net/usb directory, and instead
exclude only the specific modules that are known to be non-Ethernet
(e.g. WWAN or USB-to-USB cables).
Closes: #980788
This driver module is required to initialize Ethernet (FEC) on ARM64
iMX8M devices.
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
If the busybox-static package is installed, the modprobe implementation
used will be the one from busybox, which behaves slightly differently.
Specifically, the busybox implementation does not support `install`
commands from modprobe.d conf files:
https://git.busybox.net/busybox/tree/modutils/modprobe.c?h=1_31_stable#n279
Since mkinitramfs already ensures that /sbin/modprobe is copied into
/sbin for the initrd, it is safe to fully-qualify the modprobe call and
never invoke the busybox version.