Commit Graph

4611 Commits (1856ae95c873a6fe855b3dccd0144f1a96b9e71c)

Author SHA1 Message Date
Alexander Kurtz 016613c774 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.

[0] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator
[1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
[2] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator/gpt-auto-generator.c#L928
2016-05-06 17:53:36 +02:00
Harald Hoyer a365b67db0 Merge pull request #127 from Keruspe/master
configure: don't hardcode pkg-config
2016-05-04 11:13:54 +02:00
Marc-Antoine Perennou 699414f5a5 configure: don't hardcode pkg-config
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-05-04 10:18:54 +02:00
Harald Hoyer ab4cccf2a7 Merge pull request #126 from AnchorCat/volatile-journal
systemd: ensure journal is volatile
2016-05-04 09:25:37 +02:00
Michael Chapman 5dea430e08 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.
2016-05-04 10:49:56 +10:00
Harald Hoyer e4749a35e5 Merge pull request #125 from rubenk/patch-1
Fix small typo in dracut.cmdline(7)
2016-04-29 15:52:17 +02:00
Ruben Kerkhof ae753baec0 Fix small typo in dracut.cmdline(7) 2016-04-29 15:34:47 +02:00
Harald Hoyer 7b79d63fa4 Merge pull request #124 from glensc/os-release-dir
ensure parent dir for /usr/lib/initrd-release exists
2016-04-27 13:04:43 +02:00
Elan Ruusamäe bb44294b62 ensure parent dir for /usr/lib/initrd-release exists 2016-04-27 13:08:42 +03:00
Xunlei Pang 4fa5c235a7 network/net-lib.sh: delete duplicated DNS items from "/etc/resolv.conf"
Users can pass the DNS information throught "nameserver=" cmdline,
there maybe duplicated inputs.

"/etc/resolv.conf" have some restrictions on the number of DNS items
effective, so make sure that this file contains no duplicated items.

We achieve this by simply making the file have no duplicated lines.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Xunlei Pang cf376023e6 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.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Guido Trentalancia 5f91ed0b53 dracut: 10i18n: support default loadkeys/setfont data paths using symbolic links
Avoid keymap/font not found error when loadkeys/setfont
are compiled with the default data directory path.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-04-21 14:14:31 +02:00
Harald Hoyer bf75218e45 watchdog: start traversing the device tree from the right directory
start with the device subtree, not with the parent of it
2016-04-18 15:50:42 +02:00
Harald Hoyer fe83231e30 watchdog: clean return of installkernel()
return 0, otherwise if _alldrivers is empty, the return code is fail
2016-04-18 15:50:33 +02:00
Harald Hoyer 3f60444ec1 removed obsolete kernel module functions and host_modules variable
module_is_host_only()
find_kernel_modules_by_path()
find_kernel_modules()
2016-04-15 16:48:13 +02:00
Harald Hoyer eab32bda80 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.
2016-04-15 16:48:13 +02:00
Harald Hoyer fa295f0bcd dracut_install: honor --silent flag 2016-04-15 15:25:27 +02:00
Harald Hoyer 0297fdcb3e Merge pull request #123 from dracut-mailing-devs/40374262.eB5p3XdtTH@linux-lm3i.site
Correctly handle module aliases
2016-04-15 12:05:44 +02:00
Harald Hoyer 9d74747f92 drop to shell on die() if rd.shell=1 is set explicitly 2016-04-15 12:03:03 +02:00
Harald Hoyer 74e2d1e69f 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
2016-04-15 11:47:59 +02:00
Harald Hoyer ad438af207 Merge pull request #121 from dracut-mailing-devs/2751555c29f26f69a63888745513edeceb39d416.1458099200.git.panand@redhat.com
Install kernel module for active watchdog
2016-04-15 10:56:31 +02:00
Guido Trentalancia f3f019d947 95resume: avoid possible symbolic link creation error on bootup
Avoid symbolic link creation error.
2016-04-15 10:38:04 +02:00
Harald Hoyer 2db14045c1 kate config 2016-04-15 10:27:48 +02:00
Harald Hoyer db7d61cff7 base/init.sh: don't mount /run with noexec, if the initramfs lives there
If the initramfs was built with prefix=/run/... /run can't be mounted
with noexec, otherwise no binary can be run.

Guard against it by looking where /bin/sh is really located.
2016-04-14 14:58:34 +02:00
Harald Hoyer b99e72427b Revert "fcoe: no need to copy lldpad state"
This reverts commit e93ff1cf9a.

seems like the file has to be copied back in the real root.

https://bugzilla.redhat.com/show_bug.cgi?id=1246217
2016-04-14 13:38:24 +02:00
Harald Hoyer 6fcd5c8e3b NEWS: update for 045 2016-04-14 11:53:14 +02:00
Harald Hoyer b14b039e90 dracut-install: add --help documentation 2016-04-14 11:51:36 +02:00
Harald Hoyer 7ef36aef28 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).

https://bugzilla.redhat.com/show_bug.cgi?id=1218130
(cherry picked from commit d2846fdcce9b8de0edecdf0e06a4b86fc8de542c)
2016-04-13 14:11:17 +02:00
Harald Hoyer 9bb030c5d8 dracut-init.sh: beautify instmods() 2016-04-13 14:00:26 +02:00
Harald Hoyer fe6e0c23ad dracut-install: simplify error logic
error out early, if "--optional" is not set
2016-04-13 13:56:52 +02:00
Harald Hoyer 8d9ab2755d Fix regressions with dracut-install with kernel modules
Make sure, the same modules are installed as before.
2016-04-13 11:47:20 +02:00
Harald Hoyer 607fec3e79 Use pkg-config for libkmod CFLAGS and LIBS 2016-04-13 11:13:32 +02:00
Harald Hoyer 794b2d2c75 Use dracut-install to install kernel modules
dracut-install can now install kernel modules and their corresponding
firmware files.
2016-04-11 16:32:10 +02:00
Harald Hoyer ff8f702689 dracut-init.sh: mark error messages with FAILED 2016-04-11 15:25:11 +02:00
Harald Hoyer 98fd06934c lsinitrd.sh: fixed unpack and skipcpio search 2016-04-11 15:24:01 +02:00
Harald Hoyer 374ef3ed2b dracut-init.sh: Add file argument to sed's
fixup for 06a1d07690
2016-04-11 13:37:17 +02:00
Harald Hoyer f7f5b82b43 dracut.sh: call dracut-install with "-f" in FIPS mode
in fips mode, dracut-install was called with "-H" instead of "-f" in
FIPS mode

missed conversion of commit 26cd262a6a
2016-04-11 11:57:30 +02:00
Harald Hoyer c395993eaf Merge pull request #122 from scop/fixes
Various shell script improvements
2016-03-29 11:19:58 +02:00
Ville Skyttä 06a1d07690 dracut-init.sh: Simplify udev rule grepping 2016-03-28 12:09:06 +03:00
Ville Skyttä bcabe0fe25 Clean up some bashisms from /bin/sh scripts 2016-03-28 11:52:14 +03:00
Ville Skyttä dec3dfa4b3 nfs/module-setup.sh: Use colon instead of dot for chown user/group separator 2016-03-28 11:39:36 +03:00
Ville Skyttä 9430ae301e Do not use deprecated egrep/fgrep 2016-03-28 11:38:34 +03:00
Harald Hoyer 97bbba6938 lsinitrd: add "--unpack" to lsinitrd
also "--unpackearly" and "--verbose"
2016-03-17 14:45:24 +01:00
Pratyush Anand e343c85763 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>
2016-03-16 05:05:51 +01:00
Pratyush Anand 3aac682744 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.

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6551881c86c791237a3bebf11eb3bd70b60ea782
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=906d7a5cfeda508e7361f021605579a00cd82815
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=33b711269ade3f6bc9d9d15e4343e6fa922d999b

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>
2016-03-16 05:05:51 +01:00
Pratyush Anand 89da227de9 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>
2016-03-16 05:05:51 +01:00
Harald Hoyer 472928ec3d dracut.conf.5.asc: fix bold 2016-03-14 14:16:12 +01:00
Harald Hoyer b127294def dracut-install: catch ldd message "cannot execute binary file" 2016-03-14 10:59:29 +01:00
Harald Hoyer 556ff7c76a dracut-systemd/dracut-pre-pivot.sh: Break at switch_root only for bare rd.break
similar to commit ddfea6b54c

Previously, any rd.break=breakpoint would cause a break at the
given breakpoint and also at switch_root.
2016-03-07 12:38:23 +01:00
Harald Hoyer cb6d49bc9d Merge branch 'master' of github.com:haraldh/dracut 2016-02-29 15:07:41 +01:00