On 21/05/13 18:34, Michael Heimpold wrote: > Hi Wolfgang Denx, > >>> Closing a file descriptor does not guarantee that the data has been >>> successfully saved to disk, as the kernel might defer the write. >> >> What is the exact problem you are trying to fix? >> >> I mean, when exactly does adding the sync play a role? > > I'm using fw_setenv during system update process. The sequence > of such a shell script is something like (much simplified): > > ... > fw_setenv state=2 > dd if=... of=/dev/mmcblk0... > fw_setenv state=1 > ... > reboot
Not sure what final "OS" environment you're running, but I would think that "reboot" would sync for you ? For instance, under BusyBox, we have:- # reboot --help BusyBox v1.14.0 (2012-02-15 10:28:26 GMT) multi-call binary Usage: reboot [-d delay] [-n] [-f] Reboot the system Options: -d Delay interval for rebooting -n No call to sync() -f Force reboot (don't go through init) ... and under Ubuntu, we have ... $ reboot --help Usage: reboot [OPTION]... Reboot the system. Options: -n, --no-sync don't sync before reboot or halt ... So by default, reboot would (should ?) call sync automatically. This might point to some other issue ? Mark J. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot