Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X": 1) "default dump_to_rootfs" is specified. 2) fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
In diskless environment, if "path XXX" is located at the root fs(i.e. root nfs), we must call kdump_install_net(), otherwise kdump will lose the network connection.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- dracut-module-setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1f96bb8..1937792 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -390,10 +390,9 @@ default_dump_target_install_conf() _save_path=$_mntpoint/$_save_path fi
+ _fstype=$(get_fs_type_from_target $_target) if [ "$_mntpoint" != "/" ]; then - _fstype=$(get_fs_type_from_target $_target) - - if $(is_fs_type_nfs $_fstype); then + if is_fs_type_nfs $_fstype; then kdump_install_net "$_target" _fstype="nfs" else @@ -405,6 +404,9 @@ default_dump_target_install_conf() # strip the duplicated "/" _save_path=$(echo $_save_path | tr -s /) _save_path=${_save_path##"$_mntpoint"} + elif is_fs_type_nfs $_fstype; then + # root is nfs mount(diskless environment) + kdump_install_net "$_target" fi
#erase the old path line, then insert the parsed path
On 03/30/2017 at 04:10 PM, Xunlei Pang wrote:
In diskless environment, if "path XXX" is located at the root fs(i.e. root nfs), we must call kdump_install_net(), otherwise kdump will lose the network connection.
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1f96bb8..1937792 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -390,10 +390,9 @@ default_dump_target_install_conf() _save_path=$_mntpoint/$_save_path fi
- _fstype=$(get_fs_type_from_target $_target) if [ "$_mntpoint" != "/" ]; then
_fstype=$(get_fs_type_from_target $_target)
if $(is_fs_type_nfs $_fstype); then
if is_fs_type_nfs $_fstype; then kdump_install_net "$_target" _fstype="nfs" else
@@ -405,6 +404,9 @@ default_dump_target_install_conf() # strip the duplicated "/" _save_path=$(echo $_save_path | tr -s /) _save_path=${_save_path##"$_mntpoint"}
- elif is_fs_type_nfs $_fstype; then
# root is nfs mount(diskless environment)
kdump_install_net "$_target"
Considered more, should we regard this case as the remote nfs dumping, so to add IP information in the dump folder name, i.e. two more lines here? + _fstype="nfs" + echo "$_fstype $_target" >> ${initdir}/tmp/$$-kdump.conf
Regards, Xunlei
fi #erase the old path line, then insert the parsed path
On 03/30/17 at 06:32pm, Xunlei Pang wrote:
On 03/30/2017 at 04:10 PM, Xunlei Pang wrote:
In diskless environment, if "path XXX" is located at the root fs(i.e. root nfs), we must call kdump_install_net(), otherwise kdump will lose the network connection.
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1f96bb8..1937792 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -390,10 +390,9 @@ default_dump_target_install_conf() _save_path=$_mntpoint/$_save_path fi
- _fstype=$(get_fs_type_from_target $_target) if [ "$_mntpoint" != "/" ]; then
_fstype=$(get_fs_type_from_target $_target)
if $(is_fs_type_nfs $_fstype); then
if is_fs_type_nfs $_fstype; then kdump_install_net "$_target" _fstype="nfs" else
@@ -405,6 +404,9 @@ default_dump_target_install_conf() # strip the duplicated "/" _save_path=$(echo $_save_path | tr -s /) _save_path=${_save_path##"$_mntpoint"}
- elif is_fs_type_nfs $_fstype; then
# root is nfs mount(diskless environment)
kdump_install_net "$_target"
Considered more, should we regard this case as the remote nfs dumping, so to add IP information in the dump folder name, i.e. two more lines here?
_fstype="nfs"
echo "$_fstype $_target" >> ${initdir}/tmp/$$-kdump.conf
Yes, we should. But if we regard root fs as normal fs dump, drop the special handling for rootfs then we will have same code for both cases
Regards, Xunlei
fi #erase the old path line, then insert the parsed path
kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
In diskless environment, if "path XXX" is located at the root fs(i.e. root nfs), we must call kdump_install_net(), otherwise kdump will lose the network connection.
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1f96bb8..1937792 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -390,10 +390,9 @@ default_dump_target_install_conf() _save_path=$_mntpoint/$_save_path fi
- _fstype=$(get_fs_type_from_target $_target) if [ "$_mntpoint" != "/" ]; then
Since we are removing root= in this series, after removed root= this chunk should be unified without checking root or not?
This can be put to the end of the series or merge into patch 3/4?
_fstype=$(get_fs_type_from_target $_target)
if $(is_fs_type_nfs $_fstype); then
if is_fs_type_nfs $_fstype; then kdump_install_net "$_target" _fstype="nfs" else
@@ -405,6 +404,9 @@ default_dump_target_install_conf() # strip the duplicated "/" _save_path=$(echo $_save_path | tr -s /) _save_path=${_save_path##"$_mntpoint"}
elif is_fs_type_nfs $_fstype; then
# root is nfs mount(diskless environment)
kdump_install_net "$_target"
fi
#erase the old path line, then insert the parsed path
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
On 03/31/2017 at 10:38 AM, Dave Young wrote:
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
In diskless environment, if "path XXX" is located at the root fs(i.e. root nfs), we must call kdump_install_net(), otherwise kdump will lose the network connection.
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1f96bb8..1937792 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -390,10 +390,9 @@ default_dump_target_install_conf() _save_path=$_mntpoint/$_save_path fi
- _fstype=$(get_fs_type_from_target $_target) if [ "$_mntpoint" != "/" ]; then
Since we are removing root= in this series, after removed root= this chunk should be unified without checking root or not?
This can be put to the end of the series or merge into patch 3/4?
Yes, we can merge this one into PATCH3, then we will only have the following format for kdump.conf under kdump: ext[234]|xfs|btrfs|minix|nfs XXX path YYY
Will do, thanks for the idea!
Regards, Xunlei
_fstype=$(get_fs_type_from_target $_target)
if $(is_fs_type_nfs $_fstype); then
if is_fs_type_nfs $_fstype; then kdump_install_net "$_target" _fstype="nfs" else
@@ -405,6 +404,9 @@ default_dump_target_install_conf() # strip the duplicated "/" _save_path=$(echo $_save_path | tr -s /) _save_path=${_save_path##"$_mntpoint"}
elif is_fs_type_nfs $_fstype; then
# root is nfs mount(diskless environment)
kdump_install_net "$_target"
fi
#erase the old path line, then insert the parsed path
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \ - sed -e "s/\b$arg=[^ ]*\b//g" \ - -e "s/\b$arg\b//g" \ + sed -e "s/\b$arg=[^ ]*//g" \ + -e "s/^$arg\b//g" \ + -e "s/[[:space:]]$arg\b//g" \ -e "s/\s+/ /g"` done echo $cmdline
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
-e "s/\b$arg\b//g" \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
done echo $cmdline-e "s/[[:space:]]$arg\b//g" \ -e "s/\s\+/ /g"`
Seems I got below: root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw root rd.lvm.lv rw root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw root:/ ip rw
The test script like below: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline
Thanks Dave
On 03/31/2017 at 11:25 AM, Dave Young wrote:
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
-e "s/\b$arg\b//g" \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
done echo $cmdline-e "s/[[:space:]]$arg\b//g" \ -e "s/\s\+/ /g"`
Seems I got below: root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw root rd.lvm.lv rw root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw root:/ ip rw
The test script like below:
I guess you missed arg="root"
cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline
Thanks Dave
On 03/31/17 at 11:44am, Xunlei Pang wrote:
On 03/31/2017 at 11:25 AM, Dave Young wrote:
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
-e "s/\b$arg\b//g" \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
done echo $cmdline-e "s/[[:space:]]$arg\b//g" \ -e "s/\s\+/ /g"`
Seems I got below: root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw root rd.lvm.lv rw root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw root:/ ip rw
The test script like below:
I guess you missed arg="root"
Oops, yes, I did not add arg= this time.. But even add it it is still below result about the nfs cmdline case: [arg=root] root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw :/ ip=ens3:dhcp rw
[arg=root=] root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw nfs4:192.168.122.9:/ ip=ens3:dhcp rw
cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline
Thanks Dave
On 03/31/2017 at 11:51 AM, Dave Young wrote:
On 03/31/17 at 11:44am, Xunlei Pang wrote:
On 03/31/2017 at 11:25 AM, Dave Young wrote:
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
-e "s/\b$arg\b//g" \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
done echo $cmdline-e "s/[[:space:]]$arg\b//g" \ -e "s/\s\+/ /g"`
Seems I got below: root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw root rd.lvm.lv rw root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw root:/ ip rw
The test script like below:
I guess you missed arg="root"
Oops, yes, I did not add arg= this time.. But even add it it is still below result about the nfs cmdline case: [arg=root] root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw :/ ip=ens3:dhcp rw
[arg=root=]
I think we only support passing "root" not "root=".
So from your test results, they are obviously wrong, that's why I modified it to be:
sed -e "s/\b$arg=[^ ]*//g" \ -e "s/^$arg\b//g" \ -e "s/[[:space:]]$arg\b//g" \ -e "s/\s+/ /g"`
Regards, Xunlei
root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw nfs4:192.168.122.9:/ ip=ens3:dhcp rw
cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" echo $cmdline cmdline=`echo $cmdline | \ sed -e "s/\b$arg=[^ ]*\b//g" \ -e "s/\b$arg\b//g" \ -e "s/\s+/ /g"` echo $cmdline
Thanks Dave
On 03/31/17 at 12:01pm, Xunlei Pang wrote:
On 03/31/2017 at 11:51 AM, Dave Young wrote:
On 03/31/17 at 11:44am, Xunlei Pang wrote:
On 03/31/2017 at 11:25 AM, Dave Young wrote:
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
-e "s/\b$arg\b//g" \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
done echo $cmdline-e "s/[[:space:]]$arg\b//g" \ -e "s/\s\+/ /g"`
Seems I got below: root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw root rd.lvm.lv rw root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw root:/ ip rw
The test script like below:
I guess you missed arg="root"
Oops, yes, I did not add arg= this time.. But even add it it is still below result about the nfs cmdline case: [arg=root] root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw :/ ip=ens3:dhcp rw
[arg=root=]
I think we only support passing "root" not "root=".
So from your test results, they are obviously wrong, that's why I modified it to be:
sed -e "s/\b$arg=[^ ]*//g" \ -e "s/^$arg\b//g" \ -e "s/[[:space:]]$arg\b//g" \ -e "s/\s+/ /g"`
This version works, I tested wrong version :(
For the arg=root=, it is also clear per discussion in irc..
Thanks Dave
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
For the following scripts: cmdline="root=/dev/mapper/fedora-root rd.lvm.lv=fedora/root rw" remove_cmdline_param $cmdline "root"
cmdline="root=nfs4:192.168.122.9:/ ip=ens3:dhcp rw" remove_cmdline_param $cmdline "root"
The current implementation will get the wrong results: "rd.lvm.lv=fedora/ rw" ":/ ip=ens3:dhcp rw"
After this patch we can get the correct results: "rd.lvm.lv=fedora/root rw" "ip=ens3:dhcp rw"
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4d68be0..01a2ad8 100755 --- a/kdumpctl +++ b/kdumpctl @@ -68,8 +68,9 @@ remove_cmdline_param()
for arg in $@; do cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
-e "s/\b$arg\b//g" \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
done echo $cmdline-e "s/[[:space:]]$arg\b//g" \ -e "s/\s\+/ /g"`
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{ + grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null +} + # This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
+ # Always remove "root=X", as we now explicitly generate all kinds + # of dump target mount information including root fs. But we keep + # it if "default dump_to_rootfs" is specified(non-root dumping). + # + # We do this before KDUMP_COMMANDLINE_APPEND, if one really care + # about it(e.g. for debug purpose), then can pass "root=X" using + # KDUMP_COMMANDLINE_APPEND. + # + # Don't remove "root=X" in case of fadump? + if [ $DEFAULT_DUMP_MODE = "kdump" ] && ! is_dump_to_rootfs; then + cmdline=`remove_cmdline_param "$cmdline" root` + fi + cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=`get_bootcpu_initial_apicid` @@ -512,11 +530,16 @@ check_dump_fs_modified() fi fi
- if ! findmnt $_target >/dev/null; then - echo "Dump target $_target is probably not mounted." - return 2 - fi - _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)" + if ! findmnt $_target >/dev/null; then + echo "Dump target $_target is probably not mounted." + return 2 + fi + + if [[ "$_target" = "$(get_root_fs_device)" ]]; then + _new_mntpoint="/sysroot" + else + _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)" + fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) if [[ -z "$_dracut_args" ]];then diff --git a/mkdumprd b/mkdumprd index f30d9c2..5a25853 100644 --- a/mkdumprd +++ b/mkdumprd @@ -80,12 +80,6 @@ add_dracut_sshkey() { add_dracut_arg "--sshkey" "$1" }
-target_is_root() { - local _t - _t=$(findmnt -k -n -r -o TARGET $1|sort|head -1) - [ "$_t" = "/" ] -} - # caller should ensure $1 is valid and mounted in 1st kernel to_mount() { local _dev=$1 _source _target _fstype _options _mntopts _pdev @@ -247,13 +241,13 @@ verify_core_collector() { }
add_mount() { - if ! target_is_root "$1"; then - local _mnt=$(to_mount "$1") - if [ $? -ne 0 ]; then - exit 1 - fi - add_dracut_mount "$_mnt" + local _mnt=$(to_mount "$1") + + if [ $? -ne 0 ]; then + exit 1 fi + + add_dracut_mount "$_mnt" }
get_block_dump_target() @@ -274,7 +268,6 @@ handle_default_dump_target() { local _target local _mntpoint - local _fstype
is_user_configured_dump_target && return
@@ -293,13 +286,9 @@ handle_default_dump_target() SAVE_PATH=$_mntpoint/$SAVE_PATH fi
- if [ "$_mntpoint" != "/" ]; then - SAVE_PATH=${SAVE_PATH##"$_mntpoint"} - _fstype=$(get_fs_type_from_target $_target) - - add_mount "$_target" - check_size fs $_target - fi + SAVE_PATH=${SAVE_PATH##"$_mntpoint"} + add_mount "$_target" + check_size fs $_target }
get_default_action_target()
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
if [ $DEFAULT_DUMP_MODE = "kdump" ] && ! is_dump_to_rootfs; then
cmdline=`remove_cmdline_param "$cmdline" root`
fi
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=`get_bootcpu_initial_apicid`
@@ -512,11 +530,16 @@ check_dump_fs_modified() fi fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
if [[ "$_target" = "$(get_root_fs_device)" ]]; then
_new_mntpoint="/sysroot"
else
_new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) if [[ -z "$_dracut_args" ]];then
diff --git a/mkdumprd b/mkdumprd index f30d9c2..5a25853 100644 --- a/mkdumprd +++ b/mkdumprd @@ -80,12 +80,6 @@ add_dracut_sshkey() { add_dracut_arg "--sshkey" "$1" }
-target_is_root() {
- local _t
- _t=$(findmnt -k -n -r -o TARGET $1|sort|head -1)
- [ "$_t" = "/" ]
-}
# caller should ensure $1 is valid and mounted in 1st kernel to_mount() { local _dev=$1 _source _target _fstype _options _mntopts _pdev @@ -247,13 +241,13 @@ verify_core_collector() { }
add_mount() {
- if ! target_is_root "$1"; then
local _mnt=$(to_mount "$1")
if [ $? -ne 0 ]; then
exit 1
fi
add_dracut_mount "$_mnt"
- local _mnt=$(to_mount "$1")
- if [ $? -ne 0 ]; then
fiexit 1
- add_dracut_mount "$_mnt"
}
get_block_dump_target() @@ -274,7 +268,6 @@ handle_default_dump_target() { local _target local _mntpoint
local _fstype
is_user_configured_dump_target && return
@@ -293,13 +286,9 @@ handle_default_dump_target() SAVE_PATH=$_mntpoint/$SAVE_PATH fi
- if [ "$_mntpoint" != "/" ]; then
SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
_fstype=$(get_fs_type_from_target $_target)
add_mount "$_target"
check_size fs $_target
- fi
- SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
- add_mount "$_target"
- check_size fs $_target
}
get_default_action_target()
Otherwise patch looks fine to me.
~Pratyush
On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!
On 03/31/17 at 01:03pm, Xunlei Pang wrote:
On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!
Another concern is about iscsi, I found dracut supports root=iscsi:... There are username, passwd etc, although in theory we have code to detect iscsi luns it should work, but most of the test cases are iscsi disk as root device, root iscsi depends on root= cmdline. So I worry that non-root iscsi was not tested well, so not sure if we can assemble iscsi disk correctly after dropping root=.
So we either test it and confirm or just not to strip root= for iscsi case as well.
Thanks Dave
On 03/31/2017 at 02:11 PM, Dave Young wrote:
On 03/31/17 at 01:03pm, Xunlei Pang wrote:
On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!
Another concern is about iscsi, I found dracut supports root=iscsi:... There are username, passwd etc, although in theory we have code to detect iscsi luns it should work, but most of the test cases are iscsi disk as root device, root iscsi depends on root= cmdline. So I worry that non-root iscsi was not tested well, so not sure if we can assemble iscsi disk correctly after dropping root=.
So we either test it and confirm or just not to strip root= for iscsi case as well.
This is indeed a concern, I will try to find an iscsi machine to have a look.
Regards, Xunlei
On 03/31/2017 at 02:11 PM, Dave Young wrote:
On 03/31/17 at 01:03pm, Xunlei Pang wrote:
On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!
Another concern is about iscsi, I found dracut supports root=iscsi:... There are username, passwd etc, although in theory we have code to detect iscsi luns it should work, but most of the test cases are iscsi disk as root device, root iscsi depends on root= cmdline. So I worry that non-root iscsi was not tested well, so not sure if we can assemble iscsi disk correctly after dropping root=.
So we either test it and confirm or just not to strip root= for iscsi case as well.
For iscsi as non-root devices, removing "root=X" doesn't matter.
For iscsi as root device cases 1) For full offload HBA hardware does everything for us, the iscsi device is just like we operate a local disk. 2) For iBFT or OF iscsi dracut will also generate "ip=ibft" and "rd.iscsi.firmware=1" in "--hostonly-cmdline" mode, although Fedora doesn't have this, it will inherit them from the 1st kernel cmdline. As for the "root=X", it does not care. 3) For software iscsi I setup a software iscsi environment, and did some tests(also read some code), it turns out that it doesn't matter. As kdump will generate "netroot=iscsi:xxx" and add the device we added to /etc/fstab, dracut 95iscsi::iscsiroot.sh will take care of "netroot=XXX" without "root=X". I met one issue on Fedora during software iscsi tests, it's related to "x-initrd.mount" we discussed last week. When testing on RHEL7, it works well with my patches. We can continue discuss "x-initrd.mount" issue in the old thread, anyway a separate issue.
Thus, I think we can safely strip "root=" for iscsi cases.
Besides, there are also NBD, rhel7 doesn't support NBD, I think we can ignore that on Fedora as well. As for NFS root we can always rely on /etc/fstab, all the things can be correctly handled during mount, there is nothing wrong after we remove "root=X"(I setup a nfs root environment and confirmed that).
Regards, Xunlei
On 04/05/17 at 04:10pm, Xunlei Pang wrote:
On 03/31/2017 at 02:11 PM, Dave Young wrote:
On 03/31/17 at 01:03pm, Xunlei Pang wrote:
On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!
Another concern is about iscsi, I found dracut supports root=iscsi:... There are username, passwd etc, although in theory we have code to detect iscsi luns it should work, but most of the test cases are iscsi disk as root device, root iscsi depends on root= cmdline. So I worry that non-root iscsi was not tested well, so not sure if we can assemble iscsi disk correctly after dropping root=.
So we either test it and confirm or just not to strip root= for iscsi case as well.
For iscsi as non-root devices, removing "root=X" doesn't matter.
For iscsi as root device cases
- For full offload HBA hardware does everything for us, the iscsi device is just like we operate a local disk.
- For iBFT or OF iscsi dracut will also generate "ip=ibft" and "rd.iscsi.firmware=1" in "--hostonly-cmdline" mode, although Fedora doesn't have this, it will inherit them from the 1st kernel cmdline. As for the "root=X", it does not care.
- For software iscsi I setup a software iscsi environment, and did some tests(also read some code), it turns out that it doesn't matter. As kdump will generate "netroot=iscsi:xxx" and add the device we added to /etc/fstab, dracut 95iscsi::iscsiroot.sh will take care of "netroot=XXX" without "root=X".
Thanks for the verification, I think iscsi should be fine according to your above test..
I met one issue on Fedora during software iscsi tests, it's related to "x-initrd.mount" we discussed last week. When testing on RHEL7, it works well with my patches. We can continue discuss "x-initrd.mount" issue in the old thread, anyway a separate issue.
Thus, I think we can safely strip "root=" for iscsi cases.
Besides, there are also NBD, rhel7 doesn't support NBD, I think we can ignore that on Fedora as well. As for NFS root we can always rely on /etc/fstab, all the things can be correctly handled during mount, there is nothing wrong after we remove "root=X"(I setup a nfs root environment and confirmed that).
For NFS root as long as findmnt works it should also work in kdump initrd so it should be safe
Thanks Dave
On 04/05/2017 at 05:14 PM, Dave Young wrote:
On 04/05/17 at 04:10pm, Xunlei Pang wrote:
On 03/31/2017 at 02:11 PM, Dave Young wrote:
On 03/31/17 at 01:03pm, Xunlei Pang wrote:
On 03/31/2017 at 12:52 PM, Pratyush Anand wrote:
On Thursday 30 March 2017 01:40 PM, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs. But we keep
- # it if "default dump_to_rootfs" is specified(non-root dumping).
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really care
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- #
- # Don't remove "root=X" in case of fadump?
Better to check for != "fadump" then.
Will update, thanks!
Another concern is about iscsi, I found dracut supports root=iscsi:... There are username, passwd etc, although in theory we have code to detect iscsi luns it should work, but most of the test cases are iscsi disk as root device, root iscsi depends on root= cmdline. So I worry that non-root iscsi was not tested well, so not sure if we can assemble iscsi disk correctly after dropping root=.
So we either test it and confirm or just not to strip root= for iscsi case as well.
For iscsi as non-root devices, removing "root=X" doesn't matter.
For iscsi as root device cases
- For full offload HBA hardware does everything for us, the iscsi device is just like we operate a local disk.
- For iBFT or OF iscsi dracut will also generate "ip=ibft" and "rd.iscsi.firmware=1" in "--hostonly-cmdline" mode, although Fedora doesn't have this, it will inherit them from the 1st kernel cmdline. As for the "root=X", it does not care.
- For software iscsi I setup a software iscsi environment, and did some tests(also read some code), it turns out that it doesn't matter. As kdump will generate "netroot=iscsi:xxx" and add the device we added to /etc/fstab, dracut 95iscsi::iscsiroot.sh will take care of "netroot=XXX" without "root=X".
Thanks for the verification, I think iscsi should be fine according to your above test..
I met one issue on Fedora during software iscsi tests, it's related to "x-initrd.mount" we discussed last week. When testing on RHEL7, it works well with my patches. We can continue discuss "x-initrd.mount" issue in the old thread, anyway a separate issue.
Thus, I think we can safely strip "root=" for iscsi cases.
Besides, there are also NBD, rhel7 doesn't support NBD, I think we can ignore that on Fedora as well. As for NFS root we can always rely on /etc/fstab, all the things can be correctly handled during mount, there is nothing wrong after we remove "root=X"(I setup a nfs root environment and confirmed that).
For NFS root as long as findmnt works it should also work in kdump initrd so it should be safe
Agree.
Thanks for your review, I will send v2 later.
Regards, Xunlei
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
# Always remove "root=X", as we now explicitly generate all kinds
# of dump target mount information including root fs. But we keep
# it if "default dump_to_rootfs" is specified(non-root dumping).
#
# We do this before KDUMP_COMMANDLINE_APPEND, if one really care
# about it(e.g. for debug purpose), then can pass "root=X" using
# KDUMP_COMMANDLINE_APPEND.
#
# Don't remove "root=X" in case of fadump?
if [ $DEFAULT_DUMP_MODE = "kdump" ] && ! is_dump_to_rootfs; then
cmdline=`remove_cmdline_param "$cmdline" root`
fi
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=`get_bootcpu_initial_apicid`
@@ -512,11 +530,16 @@ check_dump_fs_modified() fi fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
if [[ "$_target" = "$(get_root_fs_device)" ]]; then
_new_mntpoint="/sysroot"
else
_new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) if [[ -z "$_dracut_args" ]];then
diff --git a/mkdumprd b/mkdumprd index f30d9c2..5a25853 100644 --- a/mkdumprd +++ b/mkdumprd @@ -80,12 +80,6 @@ add_dracut_sshkey() { add_dracut_arg "--sshkey" "$1" }
-target_is_root() {
- local _t
- _t=$(findmnt -k -n -r -o TARGET $1|sort|head -1)
- [ "$_t" = "/" ]
-}
# caller should ensure $1 is valid and mounted in 1st kernel to_mount() { local _dev=$1 _source _target _fstype _options _mntopts _pdev @@ -247,13 +241,13 @@ verify_core_collector() { }
add_mount() {
- if ! target_is_root "$1"; then
local _mnt=$(to_mount "$1")
if [ $? -ne 0 ]; then
exit 1
fi
add_dracut_mount "$_mnt"
- local _mnt=$(to_mount "$1")
- if [ $? -ne 0 ]; then
fiexit 1
- add_dracut_mount "$_mnt"
If we add root as default dump target, but we have also "default dump_to_rootfs" then we will have both root= and the extra dracut mount item, will this be a problem?
}
get_block_dump_target() @@ -274,7 +268,6 @@ handle_default_dump_target() { local _target local _mntpoint
local _fstype
is_user_configured_dump_target && return
@@ -293,13 +286,9 @@ handle_default_dump_target() SAVE_PATH=$_mntpoint/$SAVE_PATH fi
- if [ "$_mntpoint" != "/" ]; then
SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
_fstype=$(get_fs_type_from_target $_target)
add_mount "$_target"
check_size fs $_target
- fi
- SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
- add_mount "$_target"
- check_size fs $_target
}
get_default_action_target()
1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
On 03/31/2017 at 02:15 PM, Dave Young wrote:
On 03/30/17 at 04:10pm, Xunlei Pang wrote:
Since the current dracut of Fedora already supports not always mounting root device, we can remove "root=X" from the command line directly, and always get the dump target specified in "/etc/kdump.conf" and mount it. If the dump target is located at root filesystem, we will add the root mount info explicitly from kdump side instead of from dracut side.
For example, in case of nfs/ssh/usb/raw/etc(non-root) dumping, kdump will not mount the unnecessary root fs after this change.
This patch removes "root=X" via the "KDUMP_COMMANDLINE_REMOVE" (if "default dump_to_rootfs" is specified, don't remove "root=X"), and mounts non-root target under "/kdumproot", the root target still under "/sysroot"(to be align with systemd sysroot.mount).
After removing "root=X", we now add root fs mount information explicitly from the kdump side.
Changed check_dump_fs_modified() a little to avoid rebuild when dump target is root, since we add root fs mount explicitly now.
Signed-off-by: Xunlei Pang xlpang@redhat.com
kdumpctl | 33 ++++++++++++++++++++++++++++----- mkdumprd | 29 +++++++++-------------------- 2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 01a2ad8..0fb5e7b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -171,6 +171,11 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
+is_dump_to_rootfs() +{
- grep "^default[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+}
# This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -192,6 +197,19 @@ prepare_cmdline() # These params can be removed configurably cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}`
# Always remove "root=X", as we now explicitly generate all kinds
# of dump target mount information including root fs. But we keep
# it if "default dump_to_rootfs" is specified(non-root dumping).
#
# We do this before KDUMP_COMMANDLINE_APPEND, if one really care
# about it(e.g. for debug purpose), then can pass "root=X" using
# KDUMP_COMMANDLINE_APPEND.
#
# Don't remove "root=X" in case of fadump?
if [ $DEFAULT_DUMP_MODE = "kdump" ] && ! is_dump_to_rootfs; then
cmdline=`remove_cmdline_param "$cmdline" root`
fi
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=`get_bootcpu_initial_apicid`
@@ -512,11 +530,16 @@ check_dump_fs_modified() fi fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
if [[ "$_target" = "$(get_root_fs_device)" ]]; then
_new_mntpoint="/sysroot"
else
_new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
fi
_dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) if [[ -z "$_dracut_args" ]];then
diff --git a/mkdumprd b/mkdumprd index f30d9c2..5a25853 100644 --- a/mkdumprd +++ b/mkdumprd @@ -80,12 +80,6 @@ add_dracut_sshkey() { add_dracut_arg "--sshkey" "$1" }
-target_is_root() {
- local _t
- _t=$(findmnt -k -n -r -o TARGET $1|sort|head -1)
- [ "$_t" = "/" ]
-}
# caller should ensure $1 is valid and mounted in 1st kernel to_mount() { local _dev=$1 _source _target _fstype _options _mntopts _pdev @@ -247,13 +241,13 @@ verify_core_collector() { }
add_mount() {
- if ! target_is_root "$1"; then
local _mnt=$(to_mount "$1")
if [ $? -ne 0 ]; then
exit 1
fi
add_dracut_mount "$_mnt"
- local _mnt=$(to_mount "$1")
- if [ $? -ne 0 ]; then
fiexit 1
- add_dracut_mount "$_mnt"
If we add root as default dump target, but we have also "default dump_to_rootfs" then we will have both root= and the extra dracut mount item, will this be a problem?
I've verified this case, it doesn't matter. On the other hand it's odd to turn on "dump_to_rootfs" for a root dump target.
So I think it is fine on this point.
Regards, Xunlei
}
get_block_dump_target() @@ -274,7 +268,6 @@ handle_default_dump_target() { local _target local _mntpoint
local _fstype
is_user_configured_dump_target && return
@@ -293,13 +286,9 @@ handle_default_dump_target() SAVE_PATH=$_mntpoint/$SAVE_PATH fi
- if [ "$_mntpoint" != "/" ]; then
SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
_fstype=$(get_fs_type_from_target $_target)
add_mount "$_target"
check_size fs $_target
- fi
- SAVE_PATH=${SAVE_PATH##"$_mntpoint"}
- add_mount "$_target"
- check_size fs $_target
}
get_default_action_target()
1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
This reverts commit 892bea7aa
We already eliminated the root filesystem by removing "root=X" in case of non-root dumping, and for livecd it must be non-root dumping according to "live-image-kdump-howto.txt".
So it's time to revert this commit.
Also update "live-image-kdump-howto.txt", make sure users do not configure "default dump_to_rootfs".
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 4 ---- live-image-kdump-howto.txt | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 0fb5e7b..aacc2ec 100755 --- a/kdumpctl +++ b/kdumpctl @@ -184,10 +184,6 @@ prepare_cmdline()
if [ -z "$KDUMP_COMMANDLINE" ]; then cmdline=`cat /proc/cmdline` - # 'root' parameter will cause kdump failure in live images - if [[ ${cmdline} == *"root=live:"* ]]; then - KDUMP_COMMANDLINE_REMOVE="${KDUMP_COMMANDLINE_REMOVE} root" - fi else cmdline=${KDUMP_COMMANDLINE} fi diff --git a/live-image-kdump-howto.txt b/live-image-kdump-howto.txt index e0bc9f1..1695a1c 100644 --- a/live-image-kdump-howto.txt +++ b/live-image-kdump-howto.txt @@ -13,6 +13,8 @@ When kdump kernel boots in a live environment, the default target /var/crash is in RAM so you need to change the dump target to an external disk or a network dump target.
+Besides, make sure that "default dump_to_rootfs" is not specified. + 3. Start kdump service
$ kdumpctl start
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X": 1) "default dump_to_rootfs" is specified. 2) fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
Looks good from fadump perspective..
Thanks
Hari
On Thursday 30 March 2017 02:46 PM, Dave Young wrote:
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X":
- "default dump_to_rootfs" is specified.
- fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
On 03/31/2017 at 05:22 PM, Hari Bathini wrote:
Looks good from fadump perspective..
Hi Hari,
Thanks for your feedback. To make it clear, do you mean if we can remove "root=X" for fadump like did for kdump, or not?
Regards, Xunlei
Thanks
Hari
On Thursday 30 March 2017 02:46 PM, Dave Young wrote:
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X":
- "default dump_to_rootfs" is specified.
- fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
Hi Xunlei,
fadump boots like a regular kernel using the default kernel parameters, expect that it updates the default initrd to include kdump dracut module (this is to save the vmcore generated by firmware). So, I don't understand what you mean by removing "root=X" for fadump..
Thanks Hari
On Friday 31 March 2017 03:39 PM, Xunlei Pang wrote:
On 03/31/2017 at 05:22 PM, Hari Bathini wrote:
Looks good from fadump perspective..
Hi Hari,
Thanks for your feedback. To make it clear, do you mean if we can remove "root=X" for fadump like did for kdump, or not?
Regards, Xunlei
Thanks
Hari
On Thursday 30 March 2017 02:46 PM, Dave Young wrote:
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X":
- "default dump_to_rootfs" is specified.
- fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
On 03/31/2017 at 06:22 PM, Hari Bathini wrote:
Hi Xunlei,
fadump boots like a regular kernel using the default kernel parameters, expect that it updates the default initrd to include kdump dracut module (this is to save the vmcore generated by firmware). So, I don't understand what you mean by removing "root=X" for fadump..
For example, "cat /proc/cmdline" of 1st kernel is "BOOT_IMAGE=/vmlinuz-4.9.13-101.fc24.x86_64 crashkernel=161M root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet"
and we specify an NFS dumping in /etc/kdump.conf, so for normal kdump, in this patchset, we will not pass "root=/dev/mapper/fedora-root" to kdump kernel(i.e. the root fs of 1st kernel will not be mounted under kdump kernel). We want to know if we can apply the same logic for fadump in this patchset?
Regards, Xunlei
Thanks Hari
On Friday 31 March 2017 03:39 PM, Xunlei Pang wrote:
On 03/31/2017 at 05:22 PM, Hari Bathini wrote:
Looks good from fadump perspective..
Hi Hari,
Thanks for your feedback. To make it clear, do you mean if we can remove "root=X" for fadump like did for kdump, or not?
Regards, Xunlei
Thanks
Hari
On Thursday 30 March 2017 02:46 PM, Dave Young wrote:
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X":
- "default dump_to_rootfs" is specified.
- fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
On Friday 31 March 2017 04:01 PM, Xunlei Pang wrote:
On 03/31/2017 at 06:22 PM, Hari Bathini wrote:
Hi Xunlei,
fadump boots like a regular kernel using the default kernel parameters, expect that it updates the default initrd to include kdump dracut module (this is to save the vmcore generated by firmware). So, I don't understand what you mean by removing "root=X" for fadump..
For example, "cat /proc/cmdline" of 1st kernel is "BOOT_IMAGE=/vmlinuz-4.9.13-101.fc24.x86_64 crashkernel=161M root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet"
and we specify an NFS dumping in /etc/kdump.conf, so for normal kdump, in this patchset, we will not pass "root=/dev/mapper/fedora-root" to kdump kernel(i.e. the root fs of 1st kernel will not be mounted under kdump kernel). We want to know if we can apply the same logic for fadump in this patchset?
Can't be applied to fadump as fadump derives its parameters from default boot loader while kdump from kexec..?
Thanks Hari
Thanks Hari
On Friday 31 March 2017 03:39 PM, Xunlei Pang wrote:
On 03/31/2017 at 05:22 PM, Hari Bathini wrote:
Looks good from fadump perspective..
Hi Hari,
Thanks for your feedback. To make it clear, do you mean if we can remove "root=X" for fadump like did for kdump, or not?
Regards, Xunlei
Thanks
Hari
On Thursday 30 March 2017 02:46 PM, Dave Young wrote:
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X":
- "default dump_to_rootfs" is specified.
- fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)
On 03/31/2017 at 06:57 PM, Hari Bathini wrote:
On Friday 31 March 2017 04:01 PM, Xunlei Pang wrote:
On 03/31/2017 at 06:22 PM, Hari Bathini wrote:
Hi Xunlei,
fadump boots like a regular kernel using the default kernel parameters, expect that it updates the default initrd to include kdump dracut module (this is to save the vmcore generated by firmware). So, I don't understand what you mean by removing "root=X" for fadump..
For example, "cat /proc/cmdline" of 1st kernel is "BOOT_IMAGE=/vmlinuz-4.9.13-101.fc24.x86_64 crashkernel=161M root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet"
and we specify an NFS dumping in /etc/kdump.conf, so for normal kdump, in this patchset, we will not pass "root=/dev/mapper/fedora-root" to kdump kernel(i.e. the root fs of 1st kernel will not be mounted under kdump kernel). We want to know if we can apply the same logic for fadump in this patchset?
Can't be applied to fadump as fadump derives its parameters from default boot loader while kdump from kexec..?
kdump also inherits cmdline of 1st kernel, but since after crash fadump will boot as a normal kernel eventually, I think we agree on the fact that we can't apply the same logic of this patchset on fadump.
Thank you!
Thanks Hari
Thanks Hari
On Friday 31 March 2017 03:39 PM, Xunlei Pang wrote:
On 03/31/2017 at 05:22 PM, Hari Bathini wrote:
Looks good from fadump perspective..
Hi Hari,
Thanks for your feedback. To make it clear, do you mean if we can remove "root=X" for fadump like did for kdump, or not?
Regards, Xunlei
Thanks
Hari
On Thursday 30 March 2017 02:46 PM, Dave Young wrote:
For fadump part, it seems good, but let's cc Hari to confirm about it.
----- Original Message ----- From: "Xunlei Pang" xlpang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Xunlei Pang" xlpang@redhat.com Sent: Thursday, March 30, 2017 4:10:18 PM Subject: [PATCH 0/4] remove "root=X" for kdump boot
Previously, I've sent out two versions of the targets hook framework. after discussion we decided to finish "removing root=X" first using the approach of v1, thus I drafted this patch series. We can continue the targets hook framework if we really need it in the future.
This patch series focuses on removing "root=X" for kdump, and always add the dump target(even for root target) via dracut's "--mount ..." explicitly.
There are two cases we don't remove "root=X":
- "default dump_to_rootfs" is specified.
- fadump, AFAIK fadump can directly switch to root after vmcore dumping, I am not sure, would be apprieciated if someone has a clear answer.
PATCH1 is a bug fix I found during my nfs diskless tests. PATCH2 is a bug fix needed by PATCH3. PATCH3 is the actual implemenation. PATCH4 is a revert patch due to having PATCH3.
Xunlei Pang (4): module-setup: install network for diskless environment kdumpctl: fix a bug in remove_cmdline_param() kdumpctl: remove "root=X" for kdump boot Revert "kdumpctl: filter 'root' kernel parameter when running in live images"
dracut-module-setup.sh | 8 +++++--- kdumpctl | 42 +++++++++++++++++++++++++++++++----------- live-image-kdump-howto.txt | 2 ++ mkdumprd | 29 +++++++++-------------------- 4 files changed, 47 insertions(+), 34 deletions(-)