Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network-legacy without systemd local live ISO boot #2114

Closed
LaszloGombos opened this issue Dec 10, 2022 · 12 comments
Closed

network-legacy without systemd local live ISO boot #2114

LaszloGombos opened this issue Dec 10, 2022 · 12 comments
Labels
base Issues related to the base module bug Our bugs debian Issue tracker for the Debian distribution network-legacy Issues related to the network-legacy module test Issues related to testing

Comments

@LaszloGombos
Copy link
Collaborator

Describe the bug
I have a problem that booting an ISO in a VM using qemu/kvm, the network is not configured properly. If I add a sleep 1 or udevadm settle before the rd.break=initqueue in 99base/init.sh everything works and eth0 gets an IP address. Without it, I the interface is named ens3 and it does not get an IP. I guess it's a corner case because on real hardware (on two notebooks) I had no problems. But looking at the init.sh code I seems reasonable to add udevadm settle (and not udevsettle) before the main loop.
I use network-legacy and no systemd dracut modules on my iso. But systemd-udevd is available in the initrd.

Distribution used
debian

Dracut version
57

Init system
systemd

@LaszloGombos LaszloGombos added bug Our bugs base Issues related to the base module network Issues related to the network module labels Dec 10, 2022
@LaszloGombos
Copy link
Collaborator Author

LaszloGombos commented Dec 10, 2022

I am able to reproduce a failure - https://github.com/LaszloGombos/dracut/actions/runs/3664855075/jobs/6195536000

Scratch this, this is just a dup of #1901

@LaszloGombos
Copy link
Collaborator Author

CC @Mrfai

@LaszloGombos LaszloGombos changed the title issue with base module with networking without systemd base module with networking without systemd Dec 10, 2022
@LaszloGombos LaszloGombos added network-legacy Issues related to the network-legacy module test Issues related to testing and removed network Issues related to the network module labels Dec 10, 2022
@Mrfai
Copy link
Contributor

Mrfai commented Dec 10, 2022

Here are my logs. The problem is IMO that there's no /lib/dracut/hooks/initqueue/ifup-eth0.sh but only the ifup-lo.sh
I do not use root=/dev/nfs, since I boot from ISO and use the root filesystem from the ISO (it's a squashfs), no nfs. But I still set rd.neednet=1. This is the /proc/cmdline

BOOT_IMAGE=/boot/vmlinuz FAI_FLAGS=menu,verbose,createvt FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp rd.debug

init.log
rdsosreport.txt

@Mrfai
Copy link
Contributor

Mrfai commented Dec 10, 2022

This only occurs in the dmesg output (I'm not using systemd) during boot when the network is not configured properly:
[ 4.432306] virtio_net virtio0 ens3: renamed from eth0
Therefore I have ens3 with not IP address. When adding the patch (udevadm settle) the I have a eth0 and no rename in dmesg output

@LaszloGombos
Copy link
Collaborator Author

LaszloGombos commented Dec 10, 2022

@Mrfai Curious, if you add "net.ifnames=0" to kernel command line does it work (without additional patches) ? Also can you list the full list of dracut modules included ? Are you sure nfs dracut module is not included ?

@Mrfai
Copy link
Contributor

Mrfai commented Dec 10, 2022

No, it does not help. The network interface is now called eth0 but still does not get an IP address.

@Mrfai
Copy link
Contributor

Mrfai commented Dec 12, 2022

I've debugged a little bit deeper. This happens when no IP address is assigned and the interface is renamed to ens3.

In 99base/init.sh in the main loop I can see that following files are created in hooks/initqueue
First ifup-lo.sh and 224.sh (IIRC for some nvme devices). In the next iteration ifup-lo.sh is gone but we have ifup-eth0.sh and the file work. And I guess this is why udevsettle exits the loop, without activating eth0.

@LaszloGombos LaszloGombos added the debian Issue tracker for the Debian distribution label Dec 13, 2022
@LaszloGombos
Copy link
Collaborator Author

@LaszloGombos
Copy link
Collaborator Author

LaszloGombos commented Dec 13, 2022

@Mrfai

Also can you list the full list of dracut modules included ?

Perhaps share "dracut --debug -v" output ?

I do not use root=/dev/nfs, since I boot from ISO and use the root filesystem from the ISO (it's a squashfs), no nfs. But I still set rd.neednet=1.

Since this is an unusual need (bring up networking but load the root filesystem from local fs), can you please share a bit more about what you're trying to achieve ? What do you hope to achieve by including the nfs dracut module but not using root=/dev/nfs ?

@LaszloGombos LaszloGombos changed the title base module with networking without systemd networking without systemd local live ISO boot Dec 13, 2022
@LaszloGombos LaszloGombos changed the title networking without systemd local live ISO boot network-legacy without systemd local live ISO boot Dec 13, 2022
@Mrfai
Copy link
Contributor

Mrfai commented Dec 22, 2022

the nfs module is included because I'm using the same initrd (and the root file system) for both booting from network (via root=/dev/nfs) and from an ISO.

@LaszloGombos
Copy link
Collaborator Author

the nfs module is included because I'm using the same initrd (and the root file system) for both booting from network (via root=/dev/nfs) and from an ISO.

@Mrfai Thanks, this use case make sense to me.

When booting from ISO is the ISO on the network or is it on local storage attached the host that you are booting from ?

Why is it important that bring up network for booting from ISO ?

@LaszloGombos
Copy link
Collaborator Author

@Mrfai There is not enough information on this bug to reproduce. If we can not reproduce it, than it would be hard to make progress on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base Issues related to the base module bug Our bugs debian Issue tracker for the Debian distribution network-legacy Issues related to the network-legacy module test Issues related to testing
Projects
None yet
Development

No branches or pull requests

2 participants