Commit Graph

764 Commits

Author SHA1 Message Date
Baoquan He
cc4abf52c9 Use /lib/dracut/no-emergency-shell to control action on fail
Currently when action_on_fail is enabled, the emergency_shell won't be called
either. In kdump even though user specify the default action as emergency_shell,
dracut still skip it. Now change the implementation of action_on_fail to depend
on a file which is created by kdump when making kdump initrd, then remove it
at the beginning of kdump. This can solve the explicit emergency_shell problem.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-08-02 14:52:32 +08:00
Baoquan He
070a561da5 Revert: kdump.sysconfig: Add option action_on_fail and set its default as continue
This reverts commit 9e964ff4c6.

Currently, because of dracut implementation, in kdump 'default shell' will
call emergency_shell of dracut. If action_on_fail is enabled, emergency_shell
is skipped. Then 'default shell' won't work either.

Here revert the old commit 9e964ff4 so that take other implementation.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-08-02 14:46:55 +08:00
WANG Chao
a88f0848dc dracut-kdump.sh: Redirect kdump script stdout/stderr to /dev/console
Currently in kdump.sh, we redirect stdout to stderr, because dracut
pre-pivot service (which kdump.sh is running within) only output stderr
to console. That behavior is defined in dracut-pre-pivot.service:

[Service]
...
StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
...

But during testing, it has been observed that systemd will cache stderr
buffer, and first record to syslog (and it's own journal), then copy the
logs to /dev/console. And this practice is somehow unexpected in our
kdump script. We may have suppressed stdout/stderr that hasn't been
write to /dev/console before we run a force reboot.

With this change of redirecting stdout/stderr to /dev/console, kdump.sh
will output everything immediately to console, not cached/hidden by
systemd.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-08-02 14:46:37 +08:00
Baoquan He
5de822d48d makedumpfile: Add vmap_area_list definition for ppc/ppc64.
Build on ppc/ppc64 failed after makedumpfile-1.5.4 is pulled, since the
variable vmap_area_list is not defined. Back port below commit from
upstream to add it.

commit 150b58eb299066c65ef7713a93effc35c00be03a
Author: Baoquan He <bhe@redhat.com>
Date:   Mon Jul 15 20:37:14 2013 +0800

    [PATCH] Add vmap_area_list definition for ppc/ppc64.

    vmap_area_list is added to get vmalloc_start for ppc/ppc64, but its
    definition is missing, now add them.

    Signed-off-by: Baoquan He <bhe@redhat.com>
2013-07-18 16:05:56 +08:00
Baoquan He
85292672fc Release 2.0.4-6 2013-07-12 11:15:49 +08:00
Baoquan He
1b7bb0ca71 add snappy build 2013-07-12 11:15:15 +08:00
Baoquan He
97354e1aca add lzo build 2013-07-12 11:04:44 +08:00
Baoquan He
7b539a0f47 pull makedumpfile-1.5.4 2013-07-12 10:50:10 +08:00
WANG Chao
791706939e mkdumprd: check return value of subshell
Currently some functions are used in subshell to assign string to a
variable. For example:
 _mnt=$(to_mount "$1")

In this case if we call perror_exit in the subshell, subshell will exit
1, but the parent process (mkdumprd) won't exit.

So we should handle the exit code of a subshell if the subshell calls
perror_exit over a failure.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-07-12 10:02:30 +08:00
WANG Chao
43da5c516d mkdumprd: get_persistent_dev() return original dev if no persistent dev exists.
kvm virtio-blk device, for example /dev/vdb, doesn't have serial id by
default. So there's no persistent device node under /dev/disk/ for
/dev/vdb.
In case no persistent dev for dump target, we should use the original
device name directly, not failing the mkdumprd.

v2: update warn message from Vivek.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-07-12 10:00:37 +08:00
WANG Chao
ee7d1588f4 dracut-kdump.sh: Merge dump_to_rootfs() to dump_fs()
dump_to_rootfs is a special handling of dump_fs. It's better we merge them
together to cleaup code.

Now dump_fs() function takes two types of $1, a mount point like
/sysroot or a dump target device like /dev/mapper/vg-lv_kdump.

v2: remove -F option in makedumpfile case from Vivek

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-07-12 09:57:56 +08:00
WANG Chao
313aef16b7 dracut-kdump.sh: explicitly sync after each dump
After dump the vmcore, explicitly commit changed cache to disk in case
umount fail or chances we'll have an incomplete vmcore.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-07-12 09:56:42 +08:00
Baoquan He
e9098e4123 Correct wrong weekday of changelog
Wrong weekday of changelog exist in old changelog items, now correct it.
2013-07-02 16:10:49 +08:00
Baoquan He
15d191de7c kexec-tools.spec: Remove incorrect description in changelog
Percent signs in .spec files get expanded as macros. Currently in kexec-tools.spec,
'%{dist}' are appended to changelog item. This older changelog is not correctly for
rhel7 with this. Let's remove it to make it clearer.
2013-07-02 15:23:32 +08:00
Baoquan He
4133f793fe Release 2.0.4-5 2013-06-25 16:51:22 +08:00
Dave Young
e779fc632b monitor-dd-progress fix
stdout if line buffered, thus even it's redirect to stderr, it will not show
on console automaticly. Because monitor_dd_progress is only for rawdump
currently, so I think we can just use "echo" instead of "echo -n".

Another problem is sometimes CURRENT_SIZE does not get value when it's used
in $(($CURRENT_SIZE / 1048576)), fix this issue as well.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-06-25 16:45:59 +08:00
Baoquan He
315848036b rawdump: only show dd progress bar when core_collector is not makedumpfile
When using makedumpfile as core_collector, makedumpfile will show its
own progress bar, it will mix with the monitor_dd_progress and cause confusion.
In this patch just call monitor_dd_progress when core_collector is not
makedumpfile

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-06-25 16:42:01 +08:00
Baoquan He
bdb3042f07 kexec-tools.spec: replaces scriptlets with new systemd macros
Fedora 18 changes the way how to work with services in spec files.
It introduces new macros - %systemd_post, %systemd_preun and
%systemd_postun. These macros are functionally equivalent to the
manual scriptlets used in older versions of Fedora.

By using the new unified RPM macros the .spec file code is
simplified a lot.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-06-25 14:34:00 +08:00
WANG Chao
67667bdd66 dracut-kdump.sh: umount fs right before kdump exit
Currently umount fs happens right after saving vmcore. Therefore vmcore
isn't directly accessible in kdump_post script or shell. This patch moves
the umount fs operation down to the very last part, right before kdump
exits.

The patch adds a global variable MOUNTS to keep track which filesystem
is used. And umount these filesystems at do_default_action() and
do_final_action().

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-25 14:15:52 +08:00
WANG Chao
7f59604e41 dracut-kdump.sh: recursively umount fs and its submounts
Certain dracut module will mount fs under real root(/sysroot/ or
$NEWROOT/). Thus root fs can not be umounted by `umount /sysroot/`.

We should use `umount -R /sysroot/` to recursively umount root and
its submounts.

v2: do the same for dump_fs() from Baoquan

Signed-off-by: WANG Chao <chaowang@redhat.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-25 14:15:48 +08:00
WANG Chao
fa0ec28b26 dracut-kdump.sh: cleanup - using local variable names instead of $1/$2 in functions
Replace $1/$2 with local variable names in dump_raw() and dump_ssh()

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-25 14:15:40 +08:00
WANG Chao
7c7cbef612 dracut-kdump.sh: name the invalid vmcore to vmcore-incomplete
When makedumpfile failed, it could still generate a invalid vmcore. It's
better to suffix these invalid vmcore files with "-incomplete", as we do
in RHEL6.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-25 14:15:29 +08:00
WANG Chao
1520307adf dracut-kdump.sh: Output top level information about the kdump progress.
set -x is removed and we'll have little output about the dumping
progress. So it's best to output some messages on the top level to let
user know what's going on.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-25 14:15:16 +08:00
Vivek Goyal
52972364dc kexec-kdump-howto: Add a section for debugging tips
Add a section for debugging tips. I had to spend some time to figure out
how to drop into a shell from kdump_pre/kdump_post scripts. So thought of
documenting that so that somebdoy else can save time.

Also add a method to log serial consoles for virtual machines. I was
loosing some of the messages over reboot. Logging to file is fine. This
can be helful in debugging.

v2: Add method to log serial console for virtual machines
v3: Fix serial console logging instructions.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-06-25 14:01:57 +08:00
Baoquan He
d88e0ab0b3 Release 2.0.4-4 2013-06-18 17:07:57 +08:00
WANG Chao
dd7ce4b5fd dracut-module-setup.sh: improve the approach to get a bridged interface list
When directory is empty, echo * will output *, not empty string. That's
not intended.
Also it looks a little bit nicer now.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-06-18 13:10:21 +08:00
WANG Chao
76602596e0 dracut-module-setup.sh: cleanup - use kdump_get_mac_addr() function
We forget to use kdump_get_mac_addr() in this case. So fix it.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-06-18 13:09:54 +08:00
WANG Chao
7b19ef79c3 dracut-module-setup.sh: use kernel exported mac address in kdump_get_mac_addr()
kernel has exported mac address for each interface, we can get it
directly instead of parsing the output from ip address show.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-06-18 13:09:27 +08:00
WANG Chao
671e18f43b dracut-module-setup.sh: use perm addr of slaves to setup bonding network
Currently we use runtime mac addr to 2nd kernel to setup bonding
interface. But Bonding master will modify its slaves' mac addr and
incorrect mac addr is passed to 2nd kernel. Thus dracut in 2nd kernel
can't find expected slaves and bonding will fail.

Fix this issue by using perm address.

Tested in Fedora 19 KVM guest configured bonding with two slaves.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-06-18 13:08:40 +08:00
Vivek Goyal
cd0a7a87d0 kdump: Do not output debug messages by default
Currently "set -x" is specified in dracut-kdump.sh and I see the script
execution commands by default on console while testing with F19. That's
not right. This should be done only if user asked for it. Remove it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-06-18 12:44:37 +08:00
WANG Chao
56c7c922e1 dracut-module-setup.sh: kdump module depends on drm module
When 1st kernel is using KMS and crash, 2nd kernel can't reset to
nomodeset and the screen is black. In this case, user can't observe the
boot/dump progress and run commands in shell.

So let's pull in drm dracut module to fix this.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-06-18 10:37:44 +08:00
Baoquan He
83ef43e522 mkdumprd: return error if no write permission on save path of server for ssh
When ssh dump, if user doesn't have write permission on save path
of server, the crash kernel can be loaded successfully, but finally
kdump will fail because write is not allowed.

Let's check it in the service start phase, if no write permission
print error message and exit.

For differentiation, change the name of old function mkdir_save_path
to mkdir_save_path_fs.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-18 10:36:16 +08:00
Baoquan He
fa1ca1b73a Release 2.0.4-3 2013-06-13 11:35:20 +08:00
WANG Chao
928c5f1294 mkdumprd: remove -M option for dracut
We shouldn't output what dracut module are used when rebuilding kdump
initrd. It's confusing to user.

And since we've introduced dracut_args in kdump.conf, we can safely
remove this mandatory -M and let user add as his/her need.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-13 11:28:25 +08:00
dyoung@redhat.com
aa15e6b6dc kdumpctl: add selinux relabel when service startup
Dracut root fs is always mounted, but it's not guaranteed to success
because we are in crash/kdump context. So selinux policy can not only
depends on chroot load_policy.

Per discussion with Vivek and Selinux people, relabel kdump files
when the service restart.

Currently only below cases are considerd:
1. target mounted in 1st kernel
2. target mounted as rw, if user mount it as 'ro' they will have to
   relabel the files by themselves.
3. save path is not masked, this means if /var/crash is mount to another
   disk which is different from dump target it will not visible to user
   so user need manually relabel them.
4. only local filesystem based targets.

Tested on F19 machine.
Tested local fs dump and network dump along with different save path
to address above mentioned cases.

Vivek: use function name is_dump_target_configured
       use getfattr -m "security.selinux" instead of ".*"
Daniel: use restorecon instead of chcon.
dyoung: keep minix in local fs list since it has not been deperacated yet.
Vivek: wrap is_dump_target_configured checking in function path_to_be_relabeled
dyoung: use awk instead of cut to print config value for different
        space delimeters
dyoung: mute df error message: `df $_mnt/$_path 2>/dev/null`

For nfs restorecon, since it will be in 3.11 kernel, we can add it when it's
ok in Fedora.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-13 11:28:25 +08:00
dyoung@redhat.com
b156ef0d68 depends on dracut selinux module
depends on 98selinux if 1st kernel selinux is enabled so we can load_policy
and correctly label the vmcore/vmcore-dmesg files.

Since dracut always mount rootfs, the 98selinux will chroot and load_policy,
so this will be ok for Fedora. In case rootfs mount failure we have to check
and relable vmcore files, will add the kdumpctl relabeling code in another
patch.

add 'dracut_args --printsize' to /etc/kdump.conf, it shows below added size:
selinux install size: 16k

Tested on F19:
With this patch applied, vmcore selinux attr is ok.

v1->v2: use sestatus 2>/dev/null to mute error messages

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-13 11:28:25 +08:00
Baoquan He
387a6de171 dracut-kdump.sh: umount rootfs after dump_to_rootfs
In dracut-kdump.sh, kdump did not umount rootfs after dump_to_rootfs, just
like dump_fs does. And in kdump, the FINAL_ACTION is "reboot -f", no umount
action is taken.

Even though "sync" has been executed, it's safer to take a "umount rootfs"
action. Anyway no harm to umount.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-13 11:28:25 +08:00
root
224b700c82 kdump.sysconfig: append "panic=10" to kdump cmdline
When doing kdump If the capture kernel crashes for some reason, the default
behavior appears to be hanging the system without rebooting.  We at least
need an option to reset if the capture kernel crashes.  Business critical
customers tend to want the system to reboot without manual intervention.

Kernel provides a parameter “panic=n” to solve such problem.  If this parameter
is given, the capture kernel will reboot after n seconds in case it panics.

Now add this parameter into “KDUMP_COMMANDLINE_APPEND”, and set the default
waiting time value as 10 seconds.

It's tested on KVM f19, and passed.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-13 11:28:12 +08:00
Baoquan He
5d73c78c8b kexec-kdump-howto: grubby is suggested modifing kernel cmdline
For reserving a chunk of memory for kdump kernel, args need be
appended to kernel cmdline. For different Arch, different
bootloaders and related config files are used, it's a little
annoying. Using grubby, it can be very easy to append a single
arg to kernel cmdline, and can save words in howto document.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
2013-06-13 11:15:39 +08:00
Baoquan He
5f6dfdf8db kexec-tools.spec: removes kexec udev rules for s390
Currenty the kexec-tools package contains udev rules for kdump
that reload kdump in case of memory or CPU hotplug:

$ cat /etc/udev/rules.d/98-kexec.rules
SUBSYSTESUBSYSTEM=="cpu", ACTION=="online", PROGRAM="/bin/systemctl try-restart kdump.service"
SUBSYSTEM=="cpu", ACTION=="offline", PROGRAM="/bin/systemctl try-restart kdump.service"
SUBSYSTEM=="memory", ACTION=="add", PROGRAM="/bin/systemctl try-restart kdump.service"
SUBSYSTEM=="memory", ACTION=="remove", PROGRAM="/bin/systemctl try-restart kdump.service"

On other architectures the rules are necessary because the memory
and CPU layout stored in the kdump in-memory ELF header at kdump
load time. Therefore the kdump kernel has to be reloaded each
time when the CPU or memory configuration changes.

This has drawbacks:

1. During kdump reload the system can't be dumped.
2. On systems with many hotplug events (e.g. on s390 with cpuplugd)
this creates significant overhead

The reload is not necessary on s390 because there the ELF header is
created in the 2nd (kdump) kernel. Therefore, to improve things,
remove the rules for s390.

Log is from IBM, and patch has been tested by IBM and work well.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-04 10:56:56 +08:00
Baoquan He
9e964ff4c6 kdump.sysconfig: Add option action_on_fail and set its default as continue
Upon encountering a failure, dracut can drop user to emergency shell. But
in kdump environment kdump module wants to do the error handling and
wants to handle error as sepecified by user in kdump.conf file (halt,
reboot etc). Now dracut has provided an option action_on_fail=continue
which means dracut just ignores the failure and continues and expects
module to handle the error.

Modify kdump.sysconfig to pass action_on_fail=continue to dracut.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-04 10:55:30 +08:00
Baoquan He
259baae8f3 Add tab key as delimiter for core_collector in kdump.conf
In kdump.conf, space key is used as delimiter by default.

In kdump_install_conf of dracut-module-setup.sh, if specify
core_collector with a tab delimiter, the tool may not be
copied into kdump-initrd.
E.g, core_collector scp		-v

And in dump_ssh of dracut-kdump.sh, dumping will fail caused
by tab key in core_collector.

Here change code to allow tab key as delimiter when specifying
core_collector.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-04 10:54:23 +08:00
dyoung@redhat.com
8ab66d6a68 redirect stdout to stderr
dracut pre-pivot systemd service has below settings:
StandardOutput=syslog
StandardError=syslog+console

Thus kdump_pre/kdump_post output will disapear. Because the output is useful
for users, in case any failure user can watch the console log to see what's
wrong.

Dracut/Systemd people do not want to change the service settings.
So let's redirect the stdout to stderr fo fix it.

Per vivek: redirect whole kdump.sh stdout to stderr instead of only fix
for kdump_pre and kdump_post.

Tested on F19.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-04 10:53:16 +08:00
Baoquan He
6193fc969e Release 2.0.4-2 2013-05-14 11:20:54 +08:00
Baoquan He
ca61e6a1bb kdump: Save vmcore-dmesg.txt before saving vmcore
Save vmcore-dmesg.txt before saving vmcore. For ssh targets, it assumes
that ssh is enabled. No scp logic as I don't have a local copy of
kernel log buffers and saving one will consume extra memory. We
can possibly enhance this logic to save kernel log buffers first locally
and then scp it (For setups which allow scp but disable ssh access).
(log is from Vivek Goyal <vgoyal@redhat.com>)

And add 1 section to describe it in kexec-kdump-howto.txt

v3->v4:
     Remove old description of dmesg in kexec-kdump-howto.txt, now
     add a new section to describe it, and note user kernel log
     buffers won't be available if dump target is raw device.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-05-14 11:17:55 +08:00
WANG Chao
c3635964c4 Remove "ip=" overwrite to 40ip.conf
Currently we overwrite 40ip.conf to make ip and ifname both at the first
line. But getarg() of dracut doesn't have the limitation that all
cmdline args should be at the first line. Therefore, we can remove the
overwrite safely.

After applying this patch, in 2nd kernel,

kdump:/# cat /etc/cmdline.d/40ip.conf
 ip=eth0:dhcp
 ifname=eth0:52:54:00:b2:98:05
kdump:/# source /usr/lib/dracut/dracut-lib.sh
kdump:/# getarg ip
ip=eth0:dhcp
kdump:/# getarg ifname
ifname=eth0:52:54:00:b2:98:05

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-05-14 11:13:25 +08:00
WANG Chao
233bd8765e Add support for bridge over bond/team/vlan.
Kdump module doesn't check if bridge is stack on other complex interface
and setup proper dracut cmdline. That makes dracut fail to setup a working
network environment in 2nd kernel.

This patch adds the ability to setup proper dracut cmdline for bridge over
bond/team/vlan. Although in this timeframe, drauct only supports bridge over
bond among these three complex network, it's worth fixing the other two types
(bridge over team/vlan) along with. It would be much easier for us once
the dracut part is done.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-05-14 09:44:16 +08:00
WANG Chao
0455b7035e Fix bonding options syntax and get all specified options from ifcfg file.
drauct takes bond=<bondname>[:<bondslaves>:[:<options>]] syntax to parse
bond. For example:
 bond=bond0:eth0,eth1:mode=balance-rr

Update v2:
- Get bonding options from corresponding ifcfg. Because it's hard to keep
  track of all the runtime configurable options under /sys/class/net/$netif/
- Remove kdump_get_bond_mode, since it's useless now.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-05-14 09:43:31 +08:00
dyoung@redhat.com
fe96b47828 add dracut_args option to kdump.conf
mkdumprd call dracut to rebuilding kdump initrd, sometimes passing extra
dracut args is helpful. For example user can enable debug output with
--debug, --printsize to print roughly increased initramfs size by each module,
--omit-drivers to omit kernel modules, etc.

This patch enables dracut_args option for passing extra args to dracut.
Also it modifies add_dracut_arg() to treat a string with-in quote as single
string because for dracut options which has its own args, the args need to be
quoted and space seperated.

If add_dracut_arg() gets an string read from kdump.conf and if that string
contains double quotes, then while converting to positional parameters
those double quotes are not interpreted. Hence if /etc/kdump.conf contains
following.

dracut_args --add-drivers "driver1 driver2"

then add_dracut_args() sees following positional parameters

$1= --add-drivers
$2= "driver1
$3= driver2"

Notice, double quotes have been ignored and parameters have been broken
based on white space.

Modify add_dracut_arg() to look for parameters starting with " and
if one is found, it tries to merge all the next parameters till one
is found with ending double quote. Hence effectively simulating
following behavior.

$1= --add-drivers
$2= "driver1 driver2"

[v1->v2]: address quoted substring in dracut_args, also handle the leading
and ending spaces in substring.
[v2->v3]: fix dracut arguments seperator in kdump.conf.
[v3->v4]: improve changelog, thanks vivek.
[v4->v5]: make the manpage more verbose [vivek].

Tested with below dracut_args test cases:
1. dracut_args --add-drivers "pcspkr virtio_net" --omit-drivers "sdhci-pci hid-logitech-dj e1000"
2. dracut_args --add-drivers "   pcspkr virtio_net   " --omit-drivers "sdhci-pci hid-logitech-dj e1000"

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-04-27 10:44:48 +08:00
Baoquan He
9275e07621 kexec-tools.spec: Add ethtool to dependency.
commit 97e107b "Add support for team devices" introduced ethtool to
get permanent address.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
cked-by: Dave Young <dyoung@redhat.com>
2013-04-11 17:01:43 +08:00