Update initrd with IPv6 improvements

Patching content from upstream dracut for IPv6 improvements:
8061a43284
031e2f7bb8

These changes are present in the Centos8 initrd, but not Centos7.

The changes include:
- Addressing a race condition in the IPv6 DAD handling:
  https://bugzilla.redhat.com/show_bug.cgi?id=1765013
- Add a check for router advertise route (proto ra) prior to
  continuing with dracut init

Change-Id: I9021b3c3af639caed81d085eb889ed2d1bf98380
Story: 2009009
Task: 42709
Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
Don Penney 2020-08-19 14:32:38 -04:00
parent dbc3f3c7c4
commit 319690c084
2 changed files with 40 additions and 1 deletions

View File

@ -114,6 +114,45 @@ rm -f ./usr/lib/udev/rules.d/71-biosdevname.rules ./usr/sbin/biosdevname
exit exit
EOF EOF
echo "-->patch usr/lib/net-lib.sh with IPv6 improvements from newer dracut"
patch usr/lib/net-lib.sh <<EOF
--- ../initrd.orig/usr/lib/net-lib.sh 2020-08-18 19:37:17.063163840 -0400
+++ usr/lib/net-lib.sh 2020-08-19 09:47:15.237089800 -0400
@@ -645,7 +645,8 @@
timeout=\$((\$timeout*10))
while [ \$cnt -lt \$timeout ]; do
- [ -z "\$(ip -6 addr show dev "\$1" scope link tentative)" ] \\
+ [ -n "\$(ip -6 addr show dev "\$1" scope link)" ] \\
+ && [ -z "\$(ip -6 addr show dev "\$1" scope link tentative)" ] \\
&& return 0
[ -n "\$(ip -6 addr show dev "\$1" scope link dadfailed)" ] \\
&& return 1
@@ -662,7 +663,9 @@
timeout=\$((\$timeout*10))
while [ \$cnt -lt \$timeout ]; do
- [ -z "\$(ip -6 addr show dev "\$1" tentative)" ] \\
+ [ -n "\$(ip -6 addr show dev "\$1")" ] \\
+ && [ -z "\$(ip -6 addr show dev "\$1" tentative)" ] \\
+ && [ -n "\$(ip -6 route list proto ra dev "\$1" | grep ^default)" ] \\
&& return 0
[ -n "\$(ip -6 addr show dev "\$1" dadfailed)" ] \\
&& return 1
@@ -679,8 +682,9 @@
timeout=\$((\$timeout*10))
while [ \$cnt -lt \$timeout ]; do
- [ -z "\$(ip -6 addr show dev "\$1" tentative)" ] \\
- && [ -n "\$(ip -6 route list proto ra dev "\$1")" ] \\
+ [ -n "\$(ip -6 addr show dev "\$1")" ] \\
+ && [ -z "\$(ip -6 addr show dev "\$1" tentative)" ] \\
+ && [ -n "\$(ip -6 route list proto ra dev "\$1" | grep ^default)" ] \\
&& return 0
sleep 0.1
cnt=\$((\$cnt+1))
EOF
echo "--> Rebuild the initrd" echo "--> Rebuild the initrd"
if [ -f $output_dir/new-initrd.img ]; then if [ -f $output_dir/new-initrd.img ]; then
mv -f $output_dir/new-initrd.img $output_dir/initrd.img-backup-$timestamp mv -f $output_dir/new-initrd.img $output_dir/initrd.img-backup-$timestamp

View File

@ -30,7 +30,7 @@ commands =
-not -name \*~ \ -not -name \*~ \
-not -name \*.md \ -not -name \*.md \
-name \*.sh \ -name \*.sh \
-print0 | xargs --no-run-if-empty -0 bashate -v -e 'E*' -i E006,E010" -print0 | xargs --no-run-if-empty -0 bashate -v -e 'E*' -i E003,E006,E010"
bash -c "find {toxinidir}/build-tools \ bash -c "find {toxinidir}/build-tools \
-not \( -type d -name .?\* -prune \) \ -not \( -type d -name .?\* -prune \) \
-type f \ -type f \