Commit Graph

5739 Commits (052)

Author SHA1 Message Date
Nathan Rini 678627f349 retry image download forever 2019-10-25 11:37:43 +02:00
Frederick Grose 3c8c807db1 iso-scan: Release resources on iso-scan boots with rd.live.ram
Unmounting the image iso, detaching its loop device, and unmounting
its parent partition can simplify installation to the parent disk.

Note that programs or scripts using the /run/initramfs/live mount
point will fail.
2019-10-25 11:35:15 +02:00
Martin Wilck 78efd6988e iscsi: fix error messages with iSCSI root
Fixes these error messages during intird build:

cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
cat: '/sys/devices/platform/host3/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
2019-10-25 11:34:24 +02:00
Norbert Lange 1aa2d1eddf fix check whether the rootfs init is usable
this now correctly handles:
-   plain files
-   relative symlinks
-   absolute symlinks
2019-10-25 11:30:43 +02:00
tpgxyz 519186e9e6 add mksh support 2019-10-25 11:29:30 +02:00
Harald Hoyer 64082786b2
dracut.spec: add 90ppcmac 2019-10-25 09:23:30 +02:00
q66 159175d525 modules.d: add a module for early fan control on PowerPC Macs
The goal of this module is to enable automatic loading of the
thermal/fan control modules on PowerPC based Macs, as on some
modular kernel configurations this will not happen automatically
which will result in the fans spinning up to 100% until they are
manually loaded.

This is especially a problem in live systems where it takes some
time to boot up and the spin-up happens before the system even
leaves initramfs.
2019-10-25 09:20:04 +02:00
Martin Wilck 9b9dd9993e 35network-legacy: only skip waiting for interfaces if netroot is set
Commmit 8a33e52e2f94 assumes that dracut's work is done if a root device
is found. This holds usually for booting computers, but it may be wrong
for other environments.

Only short-cut the waiting if $netroot is also set.

Fixes: 8a33e52e2f94 ("network: stop waiting for interfaces if root device is present")
References: bsc#1152006
2019-10-25 09:18:12 +02:00
Martin Wilck c0e5e48aab fixup "Dracut: only login to one target at a time"
On SLE15-SP1 at least, iscsiadm doesn't support combining --op and --login":

> # iscsiadm -m node -T iqn.2018-06.de.suse.zeus:01 --op=update  --name=node.startup --value=onboot --login
> iscsiadm: Invalid parameters. Login/logout and op passed in

This breaks iSCSI login in initrd, and thus, iSCSI boot.

Fix it by not coalescing everything into a single iscsiadm command.
Fixes: a59b776bc215 ("Dracut: only login to one target at a time")
References: bsc#1152650
2019-10-25 09:18:12 +02:00
Martin Wilck 28749d9973 iscsiroot: remove bashisms
According to the dracut README, module code to be run in
the initrd must be POSIX-compliant. Replace remaining
bashisms (as reported by checkbashisms) with POSIX compliant
code.

The use of "type" is not strictly POSIX compliant, but it's
all over the place in dracut code. dash supports it, anyway.
2019-10-25 09:18:12 +02:00
Martin Wilck ac7582af48 iscsiroot: try targets only once
In multipath scenarios, "iscsiadm -m node" may contain
several records with the same target.
There's no point in trying "iscsiadm --login" multiple
time for the same target, through the same portal.

Moreover, warn if the desired target is not on the node
list.
2019-10-25 09:18:12 +02:00
Martin Wilck 0d5597044f iscsiroot: there's never more than one target per call
iscsi_target_name is set by iscsi_root, and thus can't have
more than one member. This allows us to get rid of one bashism
in iscsiroot.sh.
2019-10-25 09:18:12 +02:00
Martin Wilck 5fbe772b44 iscsiroot: parse_iscsi_root overwrites command line args
iscsi_target_name, iscsi_target_ip, iscsi_target_port are
unconditionally overwritten by parse_iscsi_root. Don't set
them here, for code clarity.
2019-10-25 09:18:12 +02:00
Martin Wilck 906896e220 network: stop waiting for interfaces if root device is present 2019-10-25 09:18:12 +02:00
Martin Wilck f551886f5c iscsi: don't continue waiting if the root device is present
dracut waits for every iscsiroot connection to be established
before switching root. This is not necessary in multipath scenarios,
where a single path is usually sufficient to set up the root device,
and where users expect booting to succeed unless all paths are down.

Don't wait for the iscsi portal to start if the root device has
already been found.
2019-10-25 09:18:12 +02:00
Lee Duncan 1ab6778ee4 Dracut: only login to one target at a time
For handling the configuration where there are two
paths to an iscsi root target, each using a different
NIC. In such a case, the initramfs was trying to configure
the first NIC, then call iscsiroot to login to both targets,
which would fail for the 2nd target, since the path to the
2nd target was not yet configured. This would eventually
work after a timeout. But it's better to login to just
one target at a time.
This change makes the initramfs handle multiple paths to an
iscsi target better by logging into only one target at a time,
rather than trying to login to all targets when only one of
several NICs is up.

This can be further optimized by using the initrd parameter
"rd.iscsi.testroute", which would skip iscsiadm login attempts
for targets to which no route exists.

If the script is called again via the timeout initqueue,
we try "iscsiadm -L onboot" again, hoping that some targets
may now have become reachable.
2019-10-25 09:18:12 +02:00
jbash aka John Bashinski 7f0b48627a
Documentation: add systemd warning for rd.luks.key, clean up related text
Harald Hoyer <harald@redhat.com>: Squashed commit of the following:

commit 4b5e5da6061983964a85d1671bd1c97c48ee76f1
Author: jbash aka John Bashinski <jbash@velvet.com>
Date:   Thu Aug 1 13:21:35 2019 -0400

    Documentation: add systemd warning for rd.luks.key, clean up related text
2019-10-23 14:48:04 +02:00
Kairui Song 5d88809319 99squash: Only start the cleaner on switch-root
Currently it starts the cleaner early and do the clean up job if switch
root is called. It's better to just start the service only on switch
root to avoid any risk of service dependency failure and make is
simpler.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-10-23 14:40:24 +02:00
gaoyi da36b76ab0 dracut: check_vol_slaves_all must return 1 when lvm vgs failed
reason:when filter/global_filter is set in lvm.conf, lvm vgs may be
failed

Signed-off-by: gaoyi <ymuemc@163.com>
2019-10-23 14:38:11 +02:00
Kairui Song a69e6c4eae Only generate hostonly-kernel-modules list in strict mode
Fixes #617.
2019-10-23 14:33:36 +02:00
Lukas Nykryn daa49cc221 net-lib: check if addr exists before checking for dad state
Before we check if dad is done we should first make sure,
that there is a link local address where we do the check.

Due to this issue, on ipv6 only setups sometimes dhclient started
asking for ip address, before the link local address was present
and failed immediately.
2019-10-23 10:44:26 +02:00
Daniel Molkentin 224175d8bc dracut-functions.sh: remove declared unused variables 2019-10-22 13:50:36 +02:00
Daniel Molkentin b4769b332d dracut-init.sh: remove obsolete for_each_kmod_dep() 2019-10-22 13:50:36 +02:00
Colin Walters 72ae1c4fe7 99base: Rework `/etc/initrd-release` to derive from real os-release
I'd like to rework CoreOS Ignition (which runs in the initramfs)
to include some values from the *real* `/etc/os-release` in
HTTP headers.

Looking at this, it turns out dracut eats almost all of the useful
information from it.  I don't think `dracut` should be the `ID`
here...dracut's not an OS itself, it's a way to *build* little
operating systems.  It'd be kind of like if Fedora's Koji
injected itself into `/etc/os-release`.

This code dates back a long time; not sure of all the rationale
behind it.

I changed it so that we keep extending the VERSION/PRETTY_NAME
with the dracut version, but otherwise "pass through" the
rest of the real `/etc/os-release` we were built from unchanged.
2019-10-22 13:49:03 +02:00
Daniel Molkentin 8e9b094b21 99base: Do not hardcode ANSI_COLOR
Take it from /etc/os-release instead, as distributions
usually customize this setting, but keep it as default value.
2019-10-22 13:49:03 +02:00
Daniel Molkentin 8a063c50a3 01systemd-initrd: remove redundant code from 99base 2019-10-22 13:49:03 +02:00
Böszörményi Zoltán c9b3c89f94 Make TEST-16-DMSQUASH Python 3 compatible
This change still supports Python 2.6 and 2.7 but loses support
for Python 2.5.

The reason for this change was that Fedora 30 does not ship
python-imgcreate but ships python3-imgcreate.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-22 12:42:10 +02:00
Harald Hoyer 1fcc70fe57
Merge branch 'nolange-fix_ipv2_for_busybox' 2019-10-21 14:43:44 +02:00
Harald Hoyer 5e7ef0ab3d
Merge branch 'fix_ipv2_for_busybox' of https://github.com/nolange/dracut into nolange-fix_ipv2_for_busybox 2019-10-21 14:41:12 +02:00
Marko Myllynen 42d93d3482 Use eurlatgr as default console font
Fedora and others have used eurlatgr as the default console font
for some time now, or suggested using it:

https://fedoraproject.org/wiki/Changes/NewDefaultConsoleFont
https://wiki.archlinux.org/index.php/Linux_console#Fonts

The Fedora Change page lists some of the benefits and this file
lists all the characters (glyphs) supported by the font:

http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=blob;f=data/consolefonts/README.eurlatgr

The notable downside is that the font does not support Arabic,
Cyrillic or Hebrew as LatArCyrHeb-16 (partially) does, so in cases
where support for languages using them is needed a non-default
console font should be used. Fedora, for instance, uses langtable
to decide the console font to use based on installation language:

https://bugzilla.redhat.com/show_bug.cgi?id=1209460
2019-10-21 13:07:07 +02:00
Harald Hoyer 22c8a5c73f
Do not sort the resulting /run/initramfs/state/etc/resolv.conf
nameserver priorities should be preserved

Resolves: https://github.com/dracutdevs/dracut/issues/652
2019-10-21 11:50:20 +02:00
Colin Walters ce0344d325 Move README to README.md
The `README.md` was nearly empty.  Move the travis bits into
`README`, then rename `README` to `README.md`.

This matches the Github standard.  A major compelling feature
of Github is how prominently it displays a project's `README.md`,
so let's ensure ours has content.
2019-10-19 15:16:50 +02:00
Frantisek Sumsal 920048ff50 travis: switch to Bionic 2019-09-25 12:19:00 +02:00
Lubomir Rintel 31e18286fc test: fix preserving server.log with V=1
This is essentially equivalent to what commit 712f471ebf
('test/test-functions: correctly move server.log') does for V=2.
2019-09-15 17:54:08 +00:00
logan 4a8ad28808 added additional useful filesystem tools 2019-09-15 17:51:06 +00:00
Benjamin Marzinski 9dd9329f7a modules.d: fix udev rules detection of multipath devices
Starting with the 0.7.7 release of the multipath tools, the multipath
udev rules always set a value in ENV{DM_MULTIPATH_DEVICE_PATH} for any
device that multipath scans. A value of 0 means that the device is not
claimed by multipath, and a value of 1 means that it is. Because of
this, udev rules that check ENV{DM_MULTIPATH_DEVICE_PATH}=="?*" will
always return True, and act as if every scanned device is claimed by
multipath. Checking ENV{DM_MULTIPATH_DEVICE_PATH}=="1" will work
correctly for both the old and new versions of the multipath tools.
2019-09-04 13:43:20 +02:00
Jonas Witschel 3436067663 rootfs-block: suppress spurious printing of rootflags
getarg prints the value so it inadvertently shows up in the dracut
output.
2019-09-03 16:49:05 +02:00
Jonas Witschel f39aa529c5 crypt: create locking directory /run/cryptsetup
For LUKS2 partitions cryptsetup needs a locking directory. If it does
not exist, cryptsetup will create it, but produce a warning

WARNING: Locking directory /run/cryptsetup is missing!

in the process that we do not want to see in the dracut output.
2019-09-03 16:49:05 +02:00
Jonas Witschel 0a01086456 dracut.sh: suppress "ignored null byte in input" warning
Since Bash 4.4, command substitutions containing null bytes produce a
warning of the form

/usr/sbin/dracut: line 1958: warning: command substitution: ignored null byte in input

Remove the trailing null byte from the UEFI kernel command line file
before printing it to suppress this warning.
2019-09-03 11:28:56 +00:00
Ondrej Dubaj 707d4e79fe added debug-shell to initrd in systemd version >= 240 2019-08-29 15:06:59 +00:00
Renaud Métrich 7a3d661971 Print an error if included item ('-i' option) doesn't exist or is neither a directory nor a regular file
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2019-08-29 13:46:34 +00:00
Tomasz Paweł Gajc 04ff0a1bae Check /usr/sbin for fsck programs 2019-08-29 13:25:57 +00:00
Lubomir Rintel 4d573e3be0 dracut.spec: fix build on openSUSE
When testing the previous commit on openSUSE it turned out that it
didn't really work in the first place, without a few tweaks.
2019-08-29 13:16:00 +00:00
Lubomir Rintel 4e2cc49d75 dracut.spec: fix build with %fedora, %rhel and %suse_version undefined
The RPM build failed on due to missing and unpackaged files on my Fedora
machine that happened to have %fedora set to %nil for reasons long
forgotten.

This is probably not a likely scenario, but some of the conditions in the
SPEC file are still wrong and perhaps worth fixing.
2019-08-29 13:16:00 +00:00
Lukas Nykryn 8084f3f66d net-lib: fix typo $li -> $_li 2019-08-29 12:41:11 +02:00
Petr Vorel cd181d2c4c doc: Fix integrity key name
Default value of EVMKEYDESC (in evm-enable.sh) is "evm-key" and it's
also specified previously in this README file.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2019-08-29 10:21:22 +00:00
Frantisek Sumsal ead8729b44 man: fix several typos 2019-08-28 10:40:33 +02:00
Zbigniew Jędrzejewski-Szmek b1c5cae63f 50-dracut: synchronize option reading code with 51-dracut.install
initrd= option should also be dropped here. There is not reason
for the code to be different in the two places.
2019-08-27 18:33:13 +02:00
Zbigniew Jędrzejewski-Szmek 38b4f4b21c Do not require non-empty kernel cmdline
When booting with Fedora-Server-dvd-x86_64-30-20190411.n.0.iso,
/proc/cmdline is empty (libvirt, qemu host with bios, not sure if that
matters), after installation to disk, anaconda would "crash" in kernel-core
%posttrans, after calling kernel-install, because dracut would fail
with
> Could not determine the kernel command line parameters.
> Please specify the kernel command line in /etc/kernel/cmdline!

I guess it's legitimate, even if unusual, to have no cmdline parameters.
Two changes are done in this patch:
1. do not fail if the cmdline is empty.
2. if /usr/lib/kernel/cmdline or /etc/kernel/cmdline are present, but
   empty, ignore /proc/cmdline. If there's explicit configuration to
   have empty cmdline, don't ignore it.
2019-08-27 18:33:13 +02:00
Takashi Iwai f4e38c0da8 dracut-init.sh: Nuke unused install_kmod_with_fw function
Kill the no longer used function, so that anyone won't be confused and
try to modify this function in future.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-26 14:57:37 +02:00