If a kickstart is fetched from a disk (or any other non-network device) and it defines some network configuration, we need to setup such configuration in dracut so that it can be used for fetching the root image. At the same time we also need to make sure our netroot script works with the data gathered from such kickstart.
Vratislav Podzimek (2): Make our manual triggering on network in dracut work (#1082500) Make sure we work with fresh data when trying to do netroot
dracut/anaconda-lib.sh | 5 ++++- dracut/anaconda-netroot.sh | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
We need to generate the net udev rules and then pretend that network devices have just been added.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- dracut/anaconda-lib.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh index 9075c5c..db910b9 100755 --- a/dracut/anaconda-lib.sh +++ b/dracut/anaconda-lib.sh @@ -243,7 +243,10 @@ run_kickstart() { udevadm trigger --action=change --subsystem-match=block fi if [ "$do_net" ]; then - udevadm trigger --action=online --subsystem-match=net + # make dracut create the net udev rules (based on the new cmdline) + . $hookdir/pre-udev/*-net-genrules.sh + udevadm control --reload + udevadm trigger --action=add --subsystem-match=net -v >> /tmp/vp_msgs fi
# and that's it - we're back to the mainloop.
If $repo is not set when we are asked to do netroot we need to make sure we are working with fresh data because things may have gotten processed/setup at some place that could have no way to deliver the new information via the environemnt variable.
Related: rhbz#1082500 Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- dracut/anaconda-netroot.sh | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dracut/anaconda-netroot.sh b/dracut/anaconda-netroot.sh index f080b1f..2fbb6ff 100755 --- a/dracut/anaconda-netroot.sh +++ b/dracut/anaconda-netroot.sh @@ -10,6 +10,12 @@ netif="$1" # get repo info splitsep ":" "$root" prefix repo
+# repo not set? make sure we are using fresh repo information +if [ -z "$repo" ]; then + . $hookdir/cmdline/*parse-anaconda-repo.sh + splitsep ":" "$root" prefix repo +fi + # no repo? non-net root? we're not needed here. [ "$prefix" = "anaconda-net" ] && [ -n "$repo" ] || return 0 # already done? don't run again.
Both look good to me.
On 07/03/2015 02:30 PM, Vratislav Podzimek wrote:
If a kickstart is fetched from a disk (or any other non-network device) and it defines some network configuration, we need to setup such configuration in dracut so that it can be used for fetching the root image. At the same time we also need to make sure our netroot script works with the data gathered from such kickstart.
Vratislav Podzimek (2): Make our manual triggering on network in dracut work (#1082500) Make sure we work with fresh data when trying to do netroot
dracut/anaconda-lib.sh | 5 ++++- dracut/anaconda-netroot.sh | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
anaconda-patches@lists.fedorahosted.org