Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mkinitfs mkinitfs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Our ARM infrastructure is unreachable at the moment, so CI jobs will time-out and packages will not be updated until the servers are back.

  • alpinealpine
  • mkinitfsmkinitfs
  • Merge requests
  • !119

mkinitfs : function ip_choose_if : try to bring up all interfaces before grep operstate

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Justin requested to merge Ba3Hf/mkinitfs:Ba3Hf-master-patch-75981 into master Mar 30, 2023
  • Overview 2
  • Commits 2
  • Pipelines 0
  • Changes 1

there is a case:

  • there are 2 interfaces, one is is connected to public (eth0), one is for internal (eth1)
  • when ip= is used, usually ip=dhcp
  • when device is not assigned in ip=, usually ip=dhcp

here is the logic :

  1. when linux kernel boots, all interfaces status are down by default
  2. linux kernel parse ip=, according to https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt:
<device>	Name of network device to use.

		Default: If the host only has one device, it is used.
			 Otherwise the device is determined using
			 autoconfiguration. This is done by sending
			 autoconfiguration requests out of all devices,
			 and using the device that received the first reply.
  1. internal (eth1) is always faster than public (eth0) to response kernel's autoconfiguration requests
  2. kernel only using the device that received the first reply, and brings up eth1, but keep eth0 down at it's default state.
  3. alpine init finds eth1 according to ip_choose_if function
  4. eth1 has no internet connection
  5. alpne fails to do netboot

this patch let alpine init bring up all interfaces before grep operstate and find the first one that is up, which is eth0. this fixes the boot issue in such case.

without this patch, one has to use parameter ip=:::::eth0:dhcp (parsed by linux kernel and alpine init) or BOOTIF=eth0_macaddr (parsed by alpine init)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: Ba3Hf-master-patch-75981