diff options
Diffstat (limited to 'target/linux/bcm53xx/base-files')
4 files changed, 64 insertions, 3 deletions
diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 5752b7760d..231566cfa0 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -89,10 +89,15 @@ bcm53xx_setup_macs() netgear,r8500) # As vendor doesn't use eth0 its MAC may be missing. Use one from eth2. et2macaddr="$(nvram get et2macaddr)" - [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" + ;; + meraki,mr32) + # The MAC is stored on an AT24C64 eeprom and not on the nvram + et2macaddr=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) ;; esac + [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" + wan_macaddr="$(nvram get wan_hwaddr)" case "$board" in asus,rt-ac87u) diff --git a/target/linux/bcm53xx/base-files/etc/diag.sh b/target/linux/bcm53xx/base-files/etc/diag.sh index 1a9332327a..bf5b779aa8 100644 --- a/target/linux/bcm53xx/base-files/etc/diag.sh +++ b/target/linux/bcm53xx/base-files/etc/diag.sh @@ -18,6 +18,9 @@ get_status_led() { status_led=$(basename $status_led_file) return fi; + + # And finally, let's also try the device-Tree aliases node + status_led="$(get_dt_led status)" } set_state() { diff --git a/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx b/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx new file mode 100644 index 0000000000..9e7c4b821e --- /dev/null +++ b/target/linux/bcm53xx/base-files/lib/preinit/07_set_preinit_iface_bcm53xx @@ -0,0 +1,14 @@ +set_preinit_iface() { + . /lib/functions.sh + + case $(board_name) in + meraki,mr32) + # switch needs to be out of the vlan mode. + swconfig dev switch0 set reset 1 + swconfig dev switch0 set enable_vlan 0 + swconfig dev switch0 set apply 1 + ;; + esac +} + +boot_hook_add preinit_main set_preinit_iface diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 40b2ef67be..cbb8290275 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -96,7 +96,7 @@ platform_identify() { echo "unknown" } -platform_check_image() { +platform_other_check_image() { [ "$#" -gt 1 ] && return 1 local file_type=$(platform_identify "$1") @@ -227,6 +227,25 @@ platform_check_image() { return $error } +platform_check_image() { + case "$(board_name)" in + meraki,mr32) + # Ideally, REQUIRE_IMAGE_METADATA=1 would suffice + # but this would require converting all other + # devices too. + nand_do_platform_check meraki-mr32 "$1" + return $? + ;; + *) + platform_other_check_image "$1" + return $? + ;; + esac + + return 1 +} + + # $(1): image for upgrade (with possible extra header) # $(2): offset of trx in image platform_do_upgrade_nand_trx() { @@ -393,7 +412,7 @@ platform_img_from_seama() { echo -n $dir/image-entity.bin } -platform_do_upgrade() { +platform_other_do_upgrade() { local file_type=$(platform_identify "$1") local trx="$1" local cmd= @@ -424,3 +443,23 @@ platform_do_upgrade() { default_do_upgrade "$trx" "$cmd" } + +platform_do_upgrade() { + case "$(board_name)" in + meraki,mr32) + CI_KERNPART="part.safe" + nand_do_upgrade "$1" + ;; + *) + platform_other_do_upgrade "$1" + ;; + esac +} + +platform_nand_pre_upgrade() { + case "$(board_name)" in + meraki,mr32) + CI_KERNPART="part.safe" + ;; + esac +} |