Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • aports aports
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
  • Issues 658
    • Issues 658
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 337
    • Merge requests 337
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • aportsaports
  • Issues
  • #10750
Closed
Open
Issue created Aug 21, 2019 by Joonas Kuorilehto@joneskooContributor

mkinitfs: ip=dhcp fails on Raspberry 3B+ because network device is not ready

There's different failure modes trying to use ip=dhcp kernel command line option to set up networking to use a remote apkovl or ssh_key file on Raspberry 3B+ using Alpine 3.10.2 armhf Raspberry Pi.

https://github.com/alpinelinux/mkinitfs/blob/master/initramfs-init.in

Here's the problems in the order I found them attempting to make it work.

Problem 1: ip=dhcp does not detect device because interface is down

First I tried ip=dhcp ssh_key=https://.... noquiet. It doesn't work and I got error:

grep: /sys/class/net/eth*/operstate: No such file or directory
ERROR: IP requested but no network device was found

If I boot with init=/bin/sh I can see the eth0 but operstate shows that it's not up even though the cable is plugged in. I conclude that eth0 is not there when the grep runs but is by the time I manually enter the command in init=/bin/sh.

So even if the interface did show as up, it wouldn't be detected. But this problem is actually hidden by the second one.

Problem 2: the interface is not detected when it is configured

If I use ip=dhcp:::::eth0 command line to get around the first problem, I get this:

* Obtaining IP via DHCP (eth0)...: ifconfig: SIOCSIFADDR: No such device

https://github.com/alpinelinux/mkinitfs/blob/master/initramfs-init.in#L194

The problem is that the interface is not yet up.

When I do ifconfig -a in shell, the eth0 is there. From dmesg I infer that it is detected less than a second after the error above.

I suspect the problem is related to the ethernet being connected by USB on Raspberry. I could not find a way to delay the init execution.

Ideally the init should wait for a few seconds until the interface is discovered if it's not detected at this point, but was manually specified like I did.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking