Skip to content

Instantly share code, notes, and snippets.

@grifferz
Created January 28, 2022 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grifferz/b503bcf6b296afe388750a42cf2facf3 to your computer and use it in GitHub Desktop.
Save grifferz/b503bcf6b296afe388750a42cf2facf3 to your computer and use it in GitHub Desktop.
Hack to get BitFolk's static IP setup on a Debian Live image
diff -Naur a/usr/lib/live/boot/9990-networking.sh b/usr/lib/live/boot/9990-networking.sh
--- a/usr/lib/live/boot/9990-networking.sh 2022-01-28 21:16:07.880622551 +0000
+++ b/usr/lib/live/boot/9990-networking.sh 2022-01-28 21:15:40.504719118 +0000
@@ -104,16 +104,25 @@
fi
done
else
- for interface in ${DEVICE}; do
- ipconfig -t "$ETHDEV_TIMEOUT" "${interface}" | tee "/netboot-${interface}.config"
-
- [ -e "/run/net-${interface}.conf" ] && . "/run/net-${interface}.conf"
-
- if [ "$IPV4ADDR" != "0.0.0.0" ]
- then
- break
- fi
- done
+ echo "STATICIP: $STATICIP"
+ bfip=$(echo ${STATICIP} | cut -d: -f 1)
+ bfgw=$(echo ${STATICIP} | cut -d: -f 3)
+ bfnet=$(echo ${STATICIP} | cut -d: -f 4)
+ ip address add ${bfip}/${bfnet} dev ${DEVICE}
+ ip link set up dev ${DEVICE}
+ ip link show dev ${DEVICE}
+ ip route add default via ${bfgw}
+ sleep 2
+# for interface in ${DEVICE}; do
+# ipconfig -t "$ETHDEV_TIMEOUT" "${interface}" | tee "/netboot-${interface}.config"
+#
+# [ -e "/run/net-${interface}.conf" ] && . "/run/net-${interface}.conf"
+#
+# if [ "$IPV4ADDR" != "0.0.0.0" ]
+# then
+# break
+# fi
+# done
fi
for interface in ${DEVICE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment