2 # Copyright (C) 2012-2014 OpenWrt.org
5 local cmdline uuid disk dev
7 if read cmdline
< /proc
/cmdline
; then
10 disk
="${cmdline##*block2mtd=}"
14 disk
="${cmdline##*root=}"
20 PARTUUID
=[a-f0-9
][a-f0-9
][a-f0-9
][a-f0-9
][a-f0-9
][a-f0-9
][a-f0-9
][a-f0-9
]-02)
21 uuid
="${cmdline#PARTUUID=}"
23 for disk
in /dev
/[hsv
]d
[a-z
]; do
24 set -- $
(dd if=$disk bs
=1 skip
=440 count
=4 2>/dev
/null |
hexdump -v -e '4/1 "%02x "')
25 if [ "$4$3$2$1" = "$uuid" ]; then
37 if [ -n "$dev" ]; then
38 mount
-t ext4
-o rw
,noatime
"$dev" /mnt
39 mv -f /mnt
/sysupgrade.tgz
/
44 boot_hook_add preinit_mount_root move_config