patches and low-level development discussion
 help / color / mirror / code / Atom feed
4cdc112f3936e5fe7e4ee5117e71ecd27e710688 blob 1076 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
#!/bin/execlineb -P
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is>

importas -i INTERFACE INTERFACE

if { test $INTERFACE != lo }

# Our IP is encoded in the NIC-specific portion of the interface's MAC
# address.
backtick -E LOCAL_IP {
  awk -F: "{printf \"100.64.%d.%d\\n\", \"0x\" $5, \"0x\" $6}"
  /sys/class/net/${INTERFACE}/address
}

if { ip address add ${LOCAL_IP}/32 dev $INTERFACE }
if { ip link set $INTERFACE up }
if { ip route add 169.254.0.1 dev $INTERFACE }
if { ip route add default via 169.254.0.1 dev $INTERFACE }

# Try to wait for the network to be up.
# If we time out, well, there's not much we can do, so just carry on.
# In future, it would be better if the network VM notified us about
# network changes.
foreground { printf "Waiting for network… " }
foreground {
  ifte { echo "Connected." } { echo "Timed out." }
  pipeline { seq 10 }
  forstdin _
  if -n {
    redirfd -w 2 /dev/null
    wget -qT 6 -O /dev/null http://ipv4.connman.net/online/status.html
  }
}

/etc/mdev/listen network-online
debug log:

solving 4cdc112 ...
found 4cdc112 in https://spectrum-os.org/lists/archives/spectrum-devel/20220930124940.1013577-3-alyssa.ross@unikie.com/ ||
	https://spectrum-os.org/lists/archives/spectrum-devel/20220930213533.1710618-3-alyssa.ross@unikie.com/
found d8ceda5 in https://spectrum-os.org/git/spectrum
preparing index
index prepared:
100755 d8ceda57598c35457c36e73c76945d4070675260	img/app/etc/mdev/iface

applying [1/2] https://spectrum-os.org/lists/archives/spectrum-devel/20220930124940.1013577-3-alyssa.ross@unikie.com/
diff --git a/img/app/etc/mdev/iface b/img/app/etc/mdev/iface
index d8ceda5..4cdc112 100755

Checking patch img/app/etc/mdev/iface...
Applied patch img/app/etc/mdev/iface cleanly.

skipping https://spectrum-os.org/lists/archives/spectrum-devel/20220930213533.1710618-3-alyssa.ross@unikie.com/ for 4cdc112
index at:
100755 4cdc112f3936e5fe7e4ee5117e71ecd27e710688	img/app/etc/mdev/iface

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).