Created
June 26, 2020 03:31
-
-
Save mcprat/8a48e5a0ee8d73c6812b9fc65ab6ae07 to your computer and use it in GitHub Desktop.
ENS202EXT OEM upgrade process pre-script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rootfs_mtd="$(cat /proc/mtd | grep \"rootfs\" | cut -d : -f 1)" | |
rootfs_size="$(($( ( fw_printenv | grep ^rootfs_size= | cut -d = -f 2 ) 2>&- )))" | |
if [ ! -f "/rom/note" -a -n "${rootfs_mtd}" -a ${rootfs_size} -gt 0 ]; then | |
. /lib/functions/boot.sh && | |
umount -l /jffs && | |
pivot /rom /mnt && | |
umount -l /mnt && | |
{ | |
dd if=/dev/${rootfs_mtd} of=/tmp/root.squashfs bs=${rootfs_size} count=1 && | |
mount /tmp/root.squashfs /mnt && | |
pivot /mnt /rom && | |
umount -l /rom | |
} 2>&- || true && | |
ramoverlay && | |
[ -n "${flag_disable_umount}" ] && touch ${flag_disable_umount} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment