Handle rootfs correctly
This commit is contained in:
parent
8e0b475887
commit
2630148dc7
@ -1,6 +1,6 @@
|
|||||||
Name: kexec-tools
|
Name: kexec-tools
|
||||||
Version: 2.0.3
|
Version: 2.0.3
|
||||||
Release: 32%{?dist}
|
Release: 33%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
Summary: The kexec/kdump userspace component.
|
Summary: The kexec/kdump userspace component.
|
||||||
@ -289,6 +289,9 @@ done
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 25 2012 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-33
|
||||||
|
- Handle rootfs correctly.
|
||||||
|
|
||||||
* Tue Jan 10 2012 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-32
|
* Tue Jan 10 2012 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-32
|
||||||
- Fix add_dracut_arg in mkdumprd.
|
- Fix add_dracut_arg in mkdumprd.
|
||||||
|
|
||||||
|
19
mkdumprd
19
mkdumprd
@ -65,6 +65,10 @@ to_dev_name() {
|
|||||||
echo $dev
|
echo $dev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_rootdev() {
|
||||||
|
mount | grep 'on / ' | grep -v rootfs | awk '{print $1}'
|
||||||
|
}
|
||||||
|
|
||||||
to_mount() {
|
to_mount() {
|
||||||
local _dev=$(to_dev_name $1)
|
local _dev=$(to_dev_name $1)
|
||||||
echo "$(grep "$_dev" /proc/mounts | cut -d' ' -f1-4)"
|
echo "$(grep "$_dev" /proc/mounts | cut -d' ' -f1-4)"
|
||||||
@ -75,6 +79,7 @@ check_remote() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_dracut_mount "$(to_mount "$(get_rootdev)")"
|
||||||
if [ -n "$conf_file" ]; then
|
if [ -n "$conf_file" ]; then
|
||||||
while read config_opt config_val;
|
while read config_opt config_val;
|
||||||
do
|
do
|
||||||
@ -83,7 +88,16 @@ if [ -n "$conf_file" ]; then
|
|||||||
extra_modules="$extra_modules $config_val"
|
extra_modules="$extra_modules $config_val"
|
||||||
;;
|
;;
|
||||||
ext[234]|xfs|btrfs|minix)
|
ext[234]|xfs|btrfs|minix)
|
||||||
add_dracut_mount "$(to_mount $config_val)"
|
_dev=$(to_dev_name "$config_val")
|
||||||
|
_mnt=$(to_mount "$config_val")
|
||||||
|
if [ "$_dev" = "$(get_rootdev)" ]; then
|
||||||
|
:
|
||||||
|
elif [ -n "$_mnt" ]; then
|
||||||
|
add_dracut_mount "$_mnt"
|
||||||
|
else
|
||||||
|
echo "Dump target $config_val is probably not mounted."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
raw)
|
raw)
|
||||||
#TODO
|
#TODO
|
||||||
@ -120,6 +134,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
dracut "${dracut_args[@]}" -M "$@"
|
dracut "${dracut_args[@]}" -M "$@"
|
||||||
|
_rc=$?
|
||||||
sync
|
sync
|
||||||
exit $?
|
exit $_rc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user