Fix some bugs to make the static route work in the 2nd kernel.
Minfei Huang (2): module-setup: Do not show the noisy in the terminal module-setup: Correct the ethernet device name to make it work in 2nd kernel
dracut-module-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
It is boring that internal result is shown in the terminal. Do not print anything to standard output by using the command "grep".
Signed-off-by: Minfei Huang mhuang@redhat.com --- dracut-module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index dcebc47..9299b5d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -212,7 +212,7 @@ get_routes() { local _route
_route=`/sbin/ip route get to $_target 2>&1` - if /sbin/ip route get to $_target | grep "via"; + if /sbin/ip route get to $_target | grep -q "via"; then # route going to a different subnet via a router echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}' \
For ethX, it fails to specify the static route in 2nd kernel, because of the wrong ethernet device name.
To make kdump work, we add a prefix "kdump-" before the ethernet device name (commit ba7660f37e792be082b7e0c9e73b76647db5e902).
Signed-off-by: Minfei Huang mhuang@redhat.com --- dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 9299b5d..d95abd2 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -215,11 +215,11 @@ get_routes() { if /sbin/ip route get to $_target | grep -q "via"; then # route going to a different subnet via a router - echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}' \ + echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $(kdump_setup_ifname $5))}' \ >> ${initdir}/etc/cmdline.d/45route-static.conf else # route going to a different subnet though directly connected - echo $_route | awk '{printf("rd.route=%s::%s\n", $1, $3)}' \ + echo $_route | awk '{printf("rd.route=%s::%s\n", $1, $(kdump_setup_ifname $3))}' \ >> ${initdir}/etc/cmdline.d/45route-static.conf fi
On 12/01/14 at 05:08pm, Minfei Huang wrote:
For ethX, it fails to specify the static route in 2nd kernel, because of the wrong ethernet device name.
To make kdump work, we add a prefix "kdump-" before the ethernet device name (commit ba7660f37e792be082b7e0c9e73b76647db5e902).
Signed-off-by: Minfei Huang mhuang@redhat.com
dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 9299b5d..d95abd2 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -215,11 +215,11 @@ get_routes() { if /sbin/ip route get to $_target | grep -q "via"; then # route going to a different subnet via a router
echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $5)}' \
echo $_route | awk '{printf("rd.route=%s:%s:%s\n", $1, $3, $(kdump_setup_ifname $5))}' \
Is this gonna work? You're calling kdump_setup_ifname() within awk. You need to figure something out.
Thanks WANG Chao
>> ${initdir}/etc/cmdline.d/45route-static.conf else # route going to a different subnet though directly connected
echo $_route | awk '{printf("rd.route=%s::%s\n", $1, $3)}' \
fiecho $_route | awk '{printf("rd.route=%s::%s\n", $1, $(kdump_setup_ifname $3))}' \ >> ${initdir}/etc/cmdline.d/45route-static.conf
-- 1.8.3.1
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec