Initial commit
This commit is contained in:
39
target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
Executable file
39
target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
Executable file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# Copyright (C) 2014-2016 OpenWrt.org
|
||||
# Copyright (C) 2016 LEDE-Project.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
globalscale,mochabin)
|
||||
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "eth0 eth2"
|
||||
;;
|
||||
iei,puzzle-m901)
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
|
||||
;;
|
||||
iei,puzzle-m902)
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5 eth10 eth11 eth12" "eth0"
|
||||
;;
|
||||
marvell,armada8040-mcbin-doubleshot|\
|
||||
marvell,armada8040-mcbin-singleshot)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
|
||||
;;
|
||||
marvell,armada8040-db)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
|
||||
;;
|
||||
marvell,armada7040-db)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
36
target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh
Executable file
36
target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
platform_do_upgrade_emmc() {
|
||||
local board=$(board_name)
|
||||
local diskdev partdev
|
||||
|
||||
export_bootdevice && export_partdevice diskdev 0 || {
|
||||
v "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
sync
|
||||
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
|
||||
get_partitions "/dev/$diskdev" bootdisk
|
||||
v "Extract boot sector from the image"
|
||||
get_image_dd "$1" of=/tmp/image.bs count=1 bs=512b
|
||||
get_partitions /tmp/image.bs image
|
||||
fi
|
||||
|
||||
#iterate over each partition from the image and write it to the boot disk
|
||||
while read part start size; do
|
||||
if export_partdevice partdev $part; then
|
||||
if [ "$partdev" = "mmcblk0p2" ]; then
|
||||
v "Writing image mmcblk0p3 for /dev/$partdev $start $size"
|
||||
get_image_dd "$1" of="/dev/mmcblk0p3" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
|
||||
elif [ "$partdev" = "mmcblk0p1" ]; then
|
||||
v "Writing image mmcblk0p1 for /dev/$partdev $start $size"
|
||||
get_image_dd "$1" of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
|
||||
fi
|
||||
else
|
||||
v "Unable to find partition $part device, skipped."
|
||||
fi
|
||||
done < /tmp/partmap.image
|
||||
|
||||
v "Writing new UUID to /dev/$diskdev..."
|
||||
get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync
|
||||
|
||||
sleep 1
|
||||
}
|
||||
51
target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh
Executable file
51
target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2014-2016 OpenWrt.org
|
||||
# Copyright (C) 2016 LEDE-Project.org
|
||||
#
|
||||
|
||||
RAMFS_COPY_BIN='fw_printenv fw_setenv'
|
||||
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
platform_check_image() {
|
||||
case "$(board_name)" in
|
||||
globalscale,mochabin|\
|
||||
iei,puzzle-m901|\
|
||||
iei,puzzle-m902|\
|
||||
marvell,armada8040-mcbin-doubleshot|\
|
||||
marvell,armada8040-mcbin-singleshot)
|
||||
legacy_sdcard_check_image "$1"
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
case "$(board_name)" in
|
||||
iei,puzzle-m901|\
|
||||
iei,puzzle-m902)
|
||||
platform_do_upgrade_emmc "$1"
|
||||
;;
|
||||
globalscale,mochabin|\
|
||||
marvell,armada8040-mcbin-doubleshot|\
|
||||
marvell,armada8040-mcbin-singleshot)
|
||||
legacy_sdcard_do_upgrade "$1"
|
||||
;;
|
||||
*)
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
platform_copy_config() {
|
||||
case "$(board_name)" in
|
||||
globalscale,mochabin|\
|
||||
iei,puzzle-m901|\
|
||||
iei,puzzle-m902|\
|
||||
marvell,armada8040-mcbin-doubleshot|\
|
||||
marvell,armada8040-mcbin-singleshot)
|
||||
legacy_sdcard_copy_config
|
||||
;;
|
||||
esac
|
||||
}
|
||||
Reference in New Issue
Block a user