Skip to content

Commit

Permalink
rpardini: configs: add blade3 C and do fixes
Browse files Browse the repository at this point in the history
- drop ipv6 config, make it dhcp6
  • Loading branch information
rpardini committed Oct 5, 2024
1 parent ff4232e commit 7d7bb67
Showing 1 changed file with 35 additions and 37 deletions.
72 changes: 35 additions & 37 deletions userpatches/config-rpardini-mixtile-blade3.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if [[ -z "${BLADE3}" ]]; then
echo "BLADE3 not set. Please set it to A/B you want to build for."
echo "BLADE3 not set. Please set it to A/B/C you want to build for."
exit 1
fi

Expand All @@ -17,6 +17,33 @@ enable_extension "rkdevflash"
# That can't be done on edk2. To use edk2 we need to supply 12v power to the board which requires the u.2 breakout board.
# Since we use m.2 nvme breakout, we need to use PD, and thus need to use vendor u-boot.

echo "rpardini-mixtile-blade3 config for ${BOARD}"

declare -g -A board_netconf=()
case ${BLADE3} in
a)
board_netconf[maininterface]="enP2p35s0"
board_netconf[macaddress]="62:66:30:3a:00:54"
board_netconf[ipv4]="192.168.66.142/24"
;;
b)
board_netconf[maininterface]="enP2p35s0"
board_netconf[macaddress]="66:6b:65:61:01:50"
board_netconf[ipv4]="192.168.66.120/24"
;;
c)
declare -g BRANCH=vendor # vendor branch for the C board only
declare -g CLOUD_INIT_RECIPE=arm2024_mixtile-blade3 # which does not have the auto-bridge bootscript.
display_alert "Mixtile Blade 3 C board" "${BOARD} ${BRANCH} -- should be VENDOR" "warn"
board_netconf[maininterface]="enP2p36s0" # different!
board_netconf[macaddress]="72:34:31:63:50:5e" # eth1 in uboot. should be kernel's enP2p36s0
board_netconf[ipv4]="192.168.66.121/24"
;;
*)
exit_with_error "Unknown BLADE3 value ${BLADE3}"
;;
esac

## Blade3 networking
# I've implemented stable-mac in vendor u-boot as well, using rk vendor partition and hacks to r8169 driver.
display_alert "Mixtile Blade 3 BOARD" "${BOARD}" "info"
Expand All @@ -25,15 +52,13 @@ display_alert "Mixtile Blade 3 RELEASE" "${RELEASE}" "info"
display_alert "Mixtile Blade 3 CLOUD_INIT_RECIPE" "${CLOUD_INIT_RECIPE}" "info"
display_alert "Mixtile Blade 3 CLOUD_INIT_INSTANCE_ID" "${CLOUD_INIT_INSTANCE_ID}" "info"

echo "rpardini-mixtile-blade3 config for ${BOARD}"

function post_family_config__force_sata2_overlay_for_edge() {
if [[ "${BRANCH}" != "edge" ]]; then
display_alert "Skipping sata2 overlay for non-edge branch" "${BOARD}" "warn"
return 0
fi

display_alert "Enabling sata2 overlay edge" "${BOARD} ${BRANCH}" "warn"
display_alert "Enabling sata2 overlay for non edge" "${BOARD} ${BRANCH}" "warn"
declare -g -r DEFAULT_OVERLAYS="sata2"
}

Expand All @@ -48,59 +73,32 @@ function post_family_config__force_sata2_overlay_for_legacy() {
}

function cloud_init_modify_network_config__mixtile_blade3() {
if [[ "${BRANCH}" != "edge" ]]; then
display_alert "Skipping network config for non-edge branch" "${BOARD}" "warn"
return 0
fi

declare -A netconf=()
case ${BLADE3} in
a)
netconf[macaddress]="62:66:30:3a:00:54"
netconf[ipv4]="192.168.66.142/24"
netconf[ipv6]="2a02:a466:4d7a:1:6066:30ff:fe3a:54/64"
;;
b)
netconf[macaddress]="66:6b:65:61:01:50"
netconf[ipv4]="192.168.66.120/24"
netconf[ipv6]="2a02:a466:4d7a:1:646b:65ff:fe61:150/64"
;;
*)
exit_with_error "Unknown BLADE3 value ${BLADE3}"
;;

esac

display_alert "Writing Blade3 ${BLADE3} network config to cloud-init" "${BOARD} ${BRANCH}" "warn"
local target_net_conf="${CI_TARGET}${CLOUD_INIT_CONFIG_LOCATION}"/network-config
# Attention, this is YAML, so wihtespace is significant!
cat <<- CLOUD_INIT_NETWORK_CONFIG_WIFI > "${target_net_conf}"
version: 2
renderer: networkd
ethernets:
enP2p35s0:
${board_netconf[maininterface]}:
dhcp4: false
dhcp6: false
optional: true
bridges:
lan:
dhcp4: false
dhcp6: false
dhcp6: true
interfaces:
- enP2p35s0
optional: false # Hmm. This has been controversial in the past, and impedes boot on some bridge configs
macaddress: ${netconf[macaddress]}
- ${board_netconf[maininterface]}
optional: false
macaddress: ${board_netconf[macaddress]}
addresses:
- ${netconf[ipv4]}
- ${netconf[ipv6]}
- ${board_netconf[ipv4]}
routes:
- to: default # legacy was gateway4
via: 192.168.66.1
- to: default # legacy was gateway6
via: 2a02:a466:4d7a:1:5e49:79ff:fe58:2b10
nameservers:
addresses:
- 2a02:a466:4d7a:1:5e49:79ff:fe58:2b10
- 192.168.66.1
CLOUD_INIT_NETWORK_CONFIG_WIFI

Expand Down

0 comments on commit 7d7bb67

Please sign in to comment.