target/rockchip:set default lan, sync platform.sh
This commit is contained in:
parent
7e64288b1f
commit
856fcdaf9e
@ -10,6 +10,7 @@ rockchip_setup_interfaces()
|
||||
case "$board" in
|
||||
friendlyarm,nanopi-r2s)
|
||||
ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
|
||||
ucidef_set_interface "lan" ipaddr "192.168.100.1"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interface_lan 'eth0'
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
# modified by jjm2473
|
||||
# 1. keep overlay partition when upgrade
|
||||
# 2. reset rom uuid in ext_overlay (aka sandbox mode) when upgrade
|
||||
platform_check_image() {
|
||||
local diskdev partdev diff
|
||||
|
||||
@ -5,6 +8,7 @@ platform_check_image() {
|
||||
echo "Unable to determine upgrade device"
|
||||
return 1
|
||||
}
|
||||
[ "$SAVE_CONFIG" -eq 1 ] && return 0
|
||||
|
||||
get_partitions "/dev/$diskdev" bootdisk
|
||||
|
||||
@ -30,7 +34,7 @@ platform_copy_config() {
|
||||
|
||||
if export_partdevice partdev 1; then
|
||||
mount -o rw,noatime "/dev/$partdev" /mnt
|
||||
cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
|
||||
rm -f "/mnt/$BACKUP_FILE"
|
||||
umount /mnt
|
||||
fi
|
||||
}
|
||||
@ -45,16 +49,21 @@ platform_do_upgrade() {
|
||||
|
||||
sync
|
||||
|
||||
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
|
||||
get_partitions "/dev/$diskdev" bootdisk
|
||||
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" -o -n "$UPGRADE_BACKUP" ]; then
|
||||
[ -n "$UPGRADE_BACKUP" ] || get_partitions "/dev/$diskdev" bootdisk
|
||||
|
||||
#extract the boot sector from the image
|
||||
get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b
|
||||
|
||||
get_partitions /tmp/image.bs image
|
||||
|
||||
#compare tables
|
||||
diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
|
||||
if [ -n "$UPGRADE_BACKUP" ]; then
|
||||
#keep overlay partition when upgrade
|
||||
diff=
|
||||
else
|
||||
#compare tables
|
||||
diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
|
||||
fi
|
||||
else
|
||||
diff=1
|
||||
fi
|
||||
@ -72,9 +81,17 @@ platform_do_upgrade() {
|
||||
|
||||
#iterate over each partition from the image and write it to the boot disk
|
||||
while read part start size; do
|
||||
if [ -n "$UPGRADE_BACKUP" -a "$part" -ge 3 ]; then
|
||||
v "Skip partition $part >= 3 when upgrading"
|
||||
continue
|
||||
fi
|
||||
if export_partdevice partdev $part; then
|
||||
echo "Writing image to /dev/$partdev..."
|
||||
get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
|
||||
if [ "$part" -eq 3 ]; then
|
||||
echo "RESET000" | dd of="/dev/$partdev" bs=512 count=1 conv=sync,fsync 2>/dev/null
|
||||
else
|
||||
get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
|
||||
fi
|
||||
else
|
||||
echo "Unable to find partition $part device, skipped."
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user