Commit Graph

184 Commits

Author SHA1 Message Date
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
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
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 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
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 ff7d629a56 dracut-module-setup.sh: remove UUID/LABEL quotes before using it
blkid do not support UUID/LABEL with quotes, remove the quotes before converting
to dev name, or the result devname will be nul.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-03-14 10:42:15 +08:00
Cong Wang 97e107b5ab Add support for team devices
V4: Sync with the latest teamd

V3: Drop patch 2/2 which harms readability
    Move inst_dir to kdump_setup_team()
    Avoid saying why teamdctl fails
    Error out for vlan over team, like bridge
    Remove the useless exit in kdump_get_perm_addr()

V2: remove the tmp config file in /tmp
    split the non-team part

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=874025
(This BZ is against RHEL7 though...)

Depends on dracut patch:
http://article.gmane.org/gmane.linux.kernel.initramfs/3043

and depends on latest version of teamd.

This patch adds support for team devices on kdump side.
I tested team active-backup mode and round-robin mode,
vmcore can be dumped over ssh successfully.

Note, currently we don't support stacked devices
on/under team, it is tricky and can be added on request.

Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-01-28 14:04:27 +08:00
Dave Young ae1db90332 add bootdev cmdline param
With recent dracut a bootdev is needed in cmdline, so dracut can waiting for
this nic ready early in initqueue. So in this patch bootdev=${_netnic} is added

[v1->v2]: use standard cmdline file name 70bootdev.conf

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-01-28 14:00:58 +08:00
Dave Young 4874a9539a kdumpnic cmdline file name cleanup
use standard cmdline file name start with digit number: 60kdumpnic.conf

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-01-28 14:00:54 +08:00
Baoquan He 4590f6e33b Optimize redundent code fetching server of network dump
Code in function kdump_install_net used to get server of network dump
is is a little redundent, can be optimized into one line. For nfs/ssh,
this line of code is enough.

Test passed on local kvm guest with Fedora 18.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-12-14 17:23:46 +08:00
Baoquan He 3be6c1228e change the dump dir format to be more readable
Resolves: bz880551

Currently on fedora directory name of kdump is like 14.11.12-03:40:30.
It's not as readable as RHEL6. The old format of dir is host_ip-date-time.
This patch changes it back like ole one as below.
192.168.122.234-2012-10-31-05:17:20

If can't get HOST_IP for a network kudmp, we just fail. Becasue most
likely any attempt to save dump will also fail.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-12-14 17:23:09 +08:00
Dave Young c5c4a7b8b0 add random feeding code for ssh dump
ssh: add random feeding code

openssh usually depends on /dev/urandom to seeding PRNG (pseudo-random number
generator). To ensure there's sufficient entropy just feed /dev/urandom with
saved /var/lib/random-seed which is saved in installing phase.

dracut_install will print error message, so just exit and do not print error
again.

Todo: other dracut_install fail and exit, such as dd, makedumpfile.

[v2->v3]: use [[:blank:]] for whitespace checking.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-11-16 14:07:52 +08:00
Dave Young 7de0cc4a92 use persistent name in kdump.conf of initramfs
In initramfs we should use persistent name created by udev to avoid
device rename issue.

fix by using udev persistent name when we copy the kdump.conf

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-09-20 11:03:14 +08:00
Dave Young 679b4216fa iscsi setup fix
Original host_fs_types could only contain one iscsi slave,
This is due to the check_block_and_slaves will return once the helper function
return TRUE, so only one slave with fs type will be added to host_fs_types[]
Thus, there will no chance to setup other slaves in kdump iscsi setup routine.

Use for_each_host_dev_and_slaves_all to setup all slaves.

Tested by chaowang and myself.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-08-29 09:42:00 +08:00
Dave Young b47c0915d2 refactor net option
Currently net options means either nfs or ssh dump.
Better to split these two into standalone options. That's more clear to user.

after the split, ssh dump need user specify "ssh user@host"
nfs dump need user specify "nfs host:nfsshare"

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-23 15:31:28 +08:00
Dave Young 4d37a55bc1 install core_collector in module-setup.sh
file install code should stay in module-setup.sh, move core_collector installation
code as well.

Note: mkdumpfile is installed twice before, one is dracut cmdline, another is
module_setup.sh. This patch removed the duplicate code in dracut cmdline.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young 9f5af7aca8 install extra_bins in module-setup.sh
moving file install code to module-setup.sh looks better.
This patch move extra_bins installation to module-setup.sh

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young 57f8e18d17 network dns config fix
In case explict DNS setup in ifcfg file, we should add proper cmdline
for dracut network use.

Add a kdump_setup_dns function to handle this.
v1->v2: vivek: use echo instead of 'echo -n'

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
dyoung@redhat.com 7148c0a30d add s390x netdev setup
s390x netdev need special cmdline to bring up
parse the ifcfg file to append proper cmdline, also add znet dracut module

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-05 16:52:12 +08:00
dyoung@redhat.com a67cebf1bf Cleanup temp file leaved at /tmp/
module_setup.sh removed comment and blank lines of kdump.conf, then install it
to initramfs, but it leaved the /tmp/$$-kdump.conf which should be removed.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-05 16:41:49 +08:00
Cong Wang f9c56b3f6e Respect bonding mode
Update: use /sys/class/net/bondX/bonding/mode

We should set the mode of the bonding properly
in the second kernel too.

Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-07-05 16:35:16 +08:00
Cong Wang 469bdf2cae Support dump over vlan tagged bonding
Update: error out vlan over bridge case

This patch adds support for vlan tagged bonding,
in theory, we could support other complex setup as well,
in practice, this is not easy, so just support vlan
tagged bonding, which is the one we support in RHEL6.

Note, this patch depends on the dracut patch:
http://marc.info/?l=initramfs&m=134025049228510&w=2

Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-07-05 16:34:54 +08:00
Dave Young 4e4a173698 Add kdump_post and kdump_pre support
Original patch is from Amerigo, but it has changed a lot:
remove multi dump
refreshed with latest git for the dump instruction function restructure
fixed the behavior of do_kdump_pre, if kdump_pre fails it will reboot
update the docs
check the existance and executable of kdump_pre/post files,
also check the timestamp of them for rebuilding.

refresh patch,
Address comments from vivek:
s/hush/bash in docs
fix the copy-paste error in kdump post error message
s/reboot\/halt/reboot in kexec-kdump-howto.txt

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-14 09:57:30 +08:00
Cong Wang e720fcdadf add vlan support
This patch depends on the latest dracut in git.
It adds support of dumping over a vlan device.

Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-06-11 14:03:26 +08:00
Cong Wang 999870558b fix and refactor bond handling code
This patch fixes dumping over a bonding interface,
we should pass ifname= for all its underlying slaves,
which is required by dracut.

And it separates the code into a different function.

Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-06-11 14:03:12 +08:00
Cong Wang 725dae14ac fix and refactor bridge handling code
This patch fixes dumping over a bridge interface,
we should pass ifname= for all its underlying devices,
which is required by dracut.

And it separates the code into different functions,
for later patches to use.

Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-06-11 14:02:47 +08:00
Dave Young 21398a5cdd static ip configuration support
Resolves: bz822739

We hardcoded with dhcp in dracut cmdline before.
Fix it by parsing  ifcfg to get the proper proto,
echo proper cmdline for both static and dhcp
[v1->v2]: amwang - handle PREFIX as well

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Cong Wang <amwang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-05-28 09:49:25 +08:00
Vivek Goyal e30ad0a4ec kdump: Basic iscsi target dump support (software initiator)
BZ: 822701

This patch implements basic software iscsi dump support. Complex iscsi
setups like ibft etc might not work.

iscsi self configuration logic is currenlty part of kdump module. At some
point of time I would like to see it in dracut iscsi module instead of
kdump module when iscsi and other subsystems become self configuration aware
for general boot.

This patch will require work for complex setups. Some of them are.

- IPV6 support
- IBFT support
- Parsing some more advanced parameters and passing to netroot option.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-05-28 09:42:00 +08:00
Vivek Goyal bf247cb56c kdump: Move network device setup in a separate function
BZ: 822701

This allows to reuse same function from iscsi setup code too. Also makes
code more modular.

[dyoung: add a missed space]

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-05-24 13:49:21 +08:00
Dave Young 70dbef8656 Resolves: bz805773
cleanup module_setup.sh, move code blocks to functions.

[v1->v2]: vivek: add kdump_ prefix to kdump functions because dracut
          source this file

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-05-14 10:36:18 +08:00
Dave Young bbd2e7d30a remove dracut-files.tbz2 [v2]
Resolves: bz816864

currently kexec-tools maintains kdump dracut modules as below dir hierarchy:
 [dave@localhost fedpkg]$ tree kexec-tools/kdump_dracut_modules
 kexec-tools/kdump_dracut_modules
 `-- 99kdumpbase
     |-- kdump.sh
     `-- module-setup.sh

But in kexec-tools.spec, sources line is below:
Source100: dracut-files.tbz2

So we need to manually generate the dracut-files.tbz2, upload it, modify
the sources file which contains the md5sum of these binaies, and then do
the building. The more headache problem is this make local tests of
changes to kdump module hard.

To ease future work, move the files to TOPDIR, cp the sources instead.

Thanks for help from dzickus
[v1->v2]: Also remove dracut-files.tbz2 from sources file
          ChaoWang: add prefix to dracut files
2012-05-03 10:06:05 +08:00