Harald Hoyer [Wed, 8 Jun 2016 07:33:48 +0000 (09:33 +0200)]
cope with "rd.shell=0" in the testsuite
If emergency and shutdown-emergency hooks are called, the systemd should
poweroff the testsuite, therefore "rd.shell=0" is given on the test
suite kernel command lines.
"rd.shell=0" has to be parsed correctly by the test suite real root init
also.
Alexander Kurtz [Fri, 6 May 2016 15:25:37 +0000 (17:25 +0200)]
dracut-systemd/dracut-cmdline.sh: Don't error out if there is no root= argument.
Thanks to systemd's gpt-auto-generator [0] (which implements the Discoverable
Partitions Specification [1]), it is no longer necessary to always specify the
root= argument.
However, dracut would still refuse to boot if there was no root= argument (or
if it was set to the special value "gpt-auto" [2]). This commit stops dracut
from aborting the boot process in these cases and simply lets systemd do its
magic.
Michael Chapman [Wed, 4 May 2016 00:49:56 +0000 (10:49 +1000)]
systemd: ensure journal is volatile
If journald.conf already contains Storage=persistent, journald will
write to /var/log/journal/, which ends up at /run/initramfs/log/journal/
after switching root. We want to make sure early boot logs are written
to /run/log/journal/ so they can be flushed to /var/log/journal/ after
switching root.
Xunlei Pang [Tue, 26 Apr 2016 10:05:10 +0000 (18:05 +0800)]
network: dhcp before parsing specified dns through cmdline
I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x",
the dns I provided didn't appear in the "/etc/resolv.conf".
After some debugging, found that when setup dhcp DNS, in setup_interface()
and setup_interface6(), it has:
echo "search $search $domain" > /tmp/net.$netif.resolv.conf
So if "$search $domain" isn't NULL(this is ture in my kdump environment),
the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp
will be discarded.
This patch addresses it by handling dhcp first. In fact this is also the
way the NetworkManager in 1st kernel works.
Harald Hoyer [Fri, 15 Apr 2016 13:29:52 +0000 (15:29 +0200)]
dracut-install: make use of _cleanup_ macros and improve hostonly check
If a module is renamed or another module takes care of the old one,
all of the alias strings have to be checked against the current set of
loaded modules.
This is still incomplete, because to be absolutely correct, all the
/sys/*...*/modalias files would have to be checked, if they match the
modules alias strings.
Harald Hoyer [Fri, 15 Apr 2016 09:27:20 +0000 (11:27 +0200)]
watchdog/module-setup.sh: rewrite
- use local variables with _
- use associative array for the kernel modules
- install emergency hook even in the systemd case
- follow device path until /sys is reached
- set kernel version for modprobe checking
Harald Hoyer [Wed, 6 Apr 2016 08:24:58 +0000 (10:24 +0200)]
plymouth/plymouth-pretrigger.sh: also trigger acpi subsystem
Trigger the acpi subsystem. This will ensure hv_vmbus gets loaded before
plymouth is started, which will make the graphics device become
available before plymouth is started too (and the keyboard ! which might
also be important for plymouth in some setups).
Pratyush Anand [Wed, 16 Mar 2016 03:46:24 +0000 (09:16 +0530)]
watchdog: ensure that module is loaded as early as possible
It is expected that a watchdog module will disable an active watchdog when
its probe is called ie, when it is loaded. So an early load of the module
will help to disable it earlier.
This can be helpful in some corner cases where kdump and watchdog daemon
both are active.
Testing:
-- When watchdog kernel modules were added
# dracut --no-hostonly initramfs-test.img -a watchdog
# lsinitrd initramfs-test.img -f etc/cmdline.d/00-watchdog.conf
rd.driver.pre=iTCO_wdt,lpc_ich,
Signed-off-by: Pratyush Anand <panand@redhat.com> Cc: Dave Young <dyoung@redhat.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Harald Hoyer <harald@redhat.com>
Pratyush Anand [Wed, 16 Mar 2016 03:39:10 +0000 (09:09 +0530)]
watchdog: install module for active watchdog
Recently following patches have been added in upstream Linux kernel, which
(1) fixes parent of watchdog_device so that
/sys/class/watchdog/watchdogn/device is populated. (2) adds some sysfs
device attributes so that different watchdog status can be read.
With the above support, now we can find out whether a watchdog is active or
not. We can also find out the driver/module responsible for that watchdog
device.
Proposed patch uses above support and then adds module of active watchdog
in initramfs generated by dracut for hostonly mode. Kernel module for
inactive watchdog will be added as well for none hostonly mode.
When an user does not want to add kernel module, then one should exclude
complete dracut watchdog module with --omit.
Testing:
-- When watchdog is active watchdog modules were added
# cat /sys/class/watchdog/watchdog0/identity
iTCO_wdt
# cat /sys/class/watchdog/watchdog0/state
active
# dracut --hostonly initramfs-test.img -a watchdog
# lsinitrd initramfs-test.img | grep iTCO
-rw-r--r-- 1 root root 9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
-rw-r--r-- 1 root root 19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko
-- When watchdog is inactive then watchdog modules were not added
# cat /sys/class/watchdog/watchdog0/state
inactive
# dracut --hostonly initramfs-test.img -a watchdog
# lsinitrd initramfs-test.img | grep iTCO
-- When watchdog is inactive, but no hostonly mode, watchdog modules were added
# cat /sys/class/watchdog/watchdog0/state
inactive
# dracut --no-hostonly initramfs-test.img -a watchdog
# lsinitrd initramfs-test.img | grep iTCO
-rw-r--r-- 1 root root 9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
-rw-r--r-- 1 root root 19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko
Signed-off-by: Pratyush Anand <panand@redhat.com> Cc: Dave Young <dyoung@redhat.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Harald Hoyer <harald@redhat.com>
Pratyush Anand [Wed, 16 Mar 2016 03:39:09 +0000 (09:09 +0530)]
watchdog: Do not add hooks if systemd module is included
When systemd is present, let it manage watchdog feed.
Signed-off-by: Pratyush Anand <panand@redhat.com> Cc: Dave Young <dyoung@redhat.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Harald Hoyer <harald@redhat.com>
Pekka Wallendahl [Mon, 18 Jan 2016 18:28:22 +0000 (20:28 +0200)]
multipath: fix majmin_to_mpath_dev()
* Multipath device names only start with the mpath-prefix if the option
use_userfriendly_names is set true in /etc/multipath.conf and if user
has not set any aliases in the said file. Thus the for-loop should go
through all files in /dev/mapper/, not just ones starting with 'mpath'
* Bash is perfectly capable to extend `/dev/mapper/*` notation without a
need to pass it to an external ls
* Changed the function to use a local variable $_dev instead of the
global $dev, which seemed to be the original intention as the local
_dev was defined but not used
Alexander Tsoy [Tue, 5 Jan 2016 19:11:57 +0000 (22:11 +0300)]
base/dracut-lib.sh:dev_unit_name() guard against $dev beginning with "-"
crypt/parse-crypt.sh generate initqueue job which always call
dev_unit_name() with an argument beginning with "-". This results
in the following error: