Hi Team,
We are using swupdate to update rootfs of our device.
We are able to update rootfs on any one partition one time, and after reboot if try for another partition it is going to corrupted flash block state.
Example (One scenario) :
SW description :
software =
{
version = "0.1";
Multi = {
hardware-compatibility:["1.0"];
stable : {
copy1 : {
images : (
{
filename = "rootfs_sw.ubi";
type = "flash";
device = "/dev/mtd8";
}
);
scripts : (
{
filename = "post_install.sh";
type = "postinstall";
}
);
bootenv : (
{
name = "rootfspart";
value = "9";
},
{
name = "bootargs";
value = "console=ttymxc3,115200 root=ubi0:rootfs rw rootwait ubi.mtd=8 ubi.mtd=10 rootfstype=ubifs";
},
{
name = "bootargs_nor";
value = "console=ttymxc3,115200 root=ubi0:rootfs rw rootwait ubi.mtd=8 ubi.mtd=10 rootfstype=ubifs";
}
);
};
copy2 : {
images : (
{
filename = "rootfs_sw.ubi";
type="flash";
device="/dev/mtd9";
}
);
scripts : (
{
filename = "post_install.sh";
type = "postinstall";
}
);
bootenv : (
{
name = "rootfspart";
value = "8";
},
{
name = "bootargs";
value = "console=ttymxc3,115200 root=ubi0:rootfs rw rootwait ubi.mtd=9 ubi.mtd=10 rootfstype=ubifs";
},
{
name = "bootargs_nor";
value = "console=ttymxc3,115200 root=ubi0:rootfs rw rootwait ubi.mtd=9 ubi.mtd=10 rootfstype=ubifs";
}
);
};
};
};
};
Commands used to update rootfs :
swupdate -v -i rootfs_1.1.swu -H Multi:1.0 -e stable,copy2 -f /etc/swupdate.cfg &
swupdate -v -i rootfs_1.1.swu -H Multi:1.0 -e stable,copy1 -f /etc/swupdate.cfg &
We initially throught flash might not happened properly, so give sometime to flash the rootfs properly, we added sleep in post_install scripts. But that also did not work.
Post_install.sh :
#!/bin/sh
sleep 60
echo "Running post install scripts. reboot now"
# SW_STATUS=$(fw_printenv recovery_status)
# while [ "$SW_STATUS" == "recovery_status=in_progress" ]
# do
# sleep 5
# SW_STATUS=$(fw_printenv recovery_status)
# echo $(fw_printenv recovery_status)
# echo "Sleep for 5more min"
# done
echo $(fw_printenv recovery_status)
reboot
Could you check our above config files & scripts and please revert back for the missing details.
Thanks & Regards,
Manonmani