File tree Expand file tree Collapse file tree 3 files changed +35
-25
lines changed Expand file tree Collapse file tree 3 files changed +35
-25
lines changed Original file line number Diff line number Diff line change 5050 run : nix-shell --run .github/workflows/formatters-and-linters.sh
5151
5252 - name : Build Hook Tarballs
53- run : nix-shell --run 'make TAG=${{steps.commitid.outputs.short}} dist'
53+ run : |
54+ # fixes "write /run/user/1001/355792648: no space left on device" error
55+ sudo mount -o remount,size=3G /run/user/1001 || true
56+ nix-shell --run 'make TAG=${{steps.commitid.outputs.short}} dist'
5457
5558 - name : Publish Hook
5659 if : github.ref == 'refs/heads/main'
Original file line number Diff line number Diff line change 77# false: run the dhcp client as a service
88set -x
99
10+ parse_cmdline () {
11+ c=$( cat /proc/cmdline)
12+ c=" ${c##* " $1 " =} "
13+ c=" ${c%% * } "
14+ echo " $c "
15+ }
16+
1017run_dhcp_client () {
1118 one_shot=" $1 "
1219 al=" eth*"
1320
14- # shellcheck disable=SC2013
15- for x in $( cat /proc/cmdline) ; do
16- # shellcheck disable=SC2022
17- echo " $x " | grep -qe ' vlan_id*' || continue
18- vlan_id=" ${x# vlan_id=} "
19- if [ -n " $vlan_id " ]; then
20- al=" eth*.*"
21- fi
22- done
21+ vlan_id=$( parse_cmdline vlan_id)
22+ if [ -n " $vlan_id " ]; then
23+ al=" eth*.*"
24+ fi
2325
2426 # Boots send kernel command line parameter "ip=dhcp", this causes the system to configure the network interface(s) with DHCP.
2527 # When an environment's network configuration has this machine connected a trunked interface with a default/native VLAN, the
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22
33# This script will set up VLAN interfaces if `vlan_id=` in `/proc/cmdline` has a value
44set -x
55
6+ parse_cmdline () {
7+ c=$( cat /proc/cmdline)
8+ c=" ${c##* " $1 " =} "
9+ c=" ${c%% * } "
10+ echo " $c "
11+ }
12+
613add_vlan_interface () {
7- # shellcheck disable=SC2013
8- for param in $( cat /proc/cmdline) ; do
9- # shellcheck disable=SC2022
10- echo " $param " | grep -qe ' vlan_id*' || continue
11- vlan_id=" ${param# vlan_id=} "
12- if [ -n " $vlan_id " ]; then
13- for ifname in $( ip -4 -o link show | awk -F' : ' ' {print $2}' ) ; do
14- [ " $ifname " = " lo" ] && continue
15- [ " $ifname " = " docker0" ] && continue
16- ip link add link " $ifname " name " $ifname .$vlan_id " type vlan id " $vlan_id "
17- ip link set " $ifname .$vlan_id " up
18- done
19- return
14+ vlan_id=$( parse_cmdline vlan_id)
15+ if [ -n " $vlan_id " ]; then
16+ hw_addr=$( parse_cmdline hw_addr)
17+ if [ -n " $hw_addr " ]; then
18+ ifname=$( ip -br link | awk ' $3 ~ /' " ${hw_addr} " ' / {print $1}' )
19+ if [ -n " $ifname " ]; then
20+ ip link set dev " ${ifname} " up || true
21+ ip link add link " ${ifname} " name " ${ifname} .${vlan_id} " type vlan id " ${vlan_id} " || true
22+ ip link set " ${ifname} .${vlan_id} " up || true
23+ return
24+ fi
2025 fi
21- done
26+ fi
2227}
2328
2429# we always return true so that a failure here doesn't block the next container service from starting. Ideally, we always
You can’t perform that action at this time.
0 commit comments