a451de3779ee0c1fadec48a19982c30adff298ec
2 # Copyright (C) 2010-2013 OpenWrt.org
6 local cmdline
=$
(cat /proc
/cmdline
)
7 local bootpart
=${cmdline##*root=}
8 bootpart
=${bootpart%% *}
9 local uuid
=${bootpart#PARTUUID=}
14 blkid |
grep "PTUUID=\"$(rootpartuuid)\"" | cut
-d : -f1
17 bootpart_from_uuid
() {
18 blkid |
grep $
(rootpartuuid
)-01 | cut
-d : -f1
21 rootpart_from_uuid
() {
22 blkid |
grep $
(rootpartuuid
)-02 | cut
-d : -f1
25 imx_sdcard_mount_boot
() {
27 [ -f /boot
/uImage
] ||
{
28 mount
-o rw
,noatime $
(bootpart_from_uuid
) /boot
> /dev
/null
32 imx_sdcard_copy_config
() {
34 cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE"
39 imx_sdcard_do_upgrade
() {
40 local board_dir
="$(tar tf "${1}" | grep -m 1 '^sysupgrade-.*/$')"
41 board_dir
="${board_dir%/}"
44 get_image
"$1" |
tar Oxf
- ${board_dir}/kernel
> /boot
/uImage
45 get_image
"$1" |
tar Oxf
- ${board_dir}/root
> $
(rootpart_from_uuid
)
50 imx_sdcard_pre_upgrade
() {
51 [ -z "$UPGRADE_BACKUP" ] && {
57 imx_sdcard_move_config
() {
58 if [ -b $
(bootpart_from_uuid
) ]; then
60 [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /