[U-Boot] [PATCH] test: ums: Add sleep before unmount directory
Lukasz Majewski
l.majewski at majess.pl
Thu Nov 6 22:30:17 CET 2014
On Thu, 06 Nov 2014 10:00:12 -0700
Stephen Warren <swarren at wwwdotorg.org> wrote:
> On 11/06/2014 03:23 AM, Lukasz Majewski wrote:
> > This change helps to run script on machines with quite long uptime.
> > Without this the following error emerges:
> >
> > File: ./dat_14M.img
> > umount: /mnt/tmp-ums-test: device is busy.
> > (In some cases useful info about processes that use
> > the device is found by lsof(8) or fuser(1))
> > TX: md5sum:083d3d22b542d3ecba61b12d17e03f9f
> > mount: /dev/sdd6 already mounted or /mnt/tmp-ums-test busy
> > mount: according to mtab, /dev/sdd6 is already mounted
> > on /mnt/tmp-ums-test
>
> > diff --git a/test/ums/ums_gadget_test.sh
> > b/test/ums/ums_gadget_test.sh
>
> > cp ./$1 $MNT_DIR
> > + sleep 2
> > umount $MNT_DIR
>
> I don't think there's any guarantee the "2" is the exact correct
> amount of time to sleep; I presume you derived the value by trying
> some values until you found one that works, and so the actual value
> required may vary from system to system. How about something like the
> following, which I use in a script that copies a new kernel to an SD
> card, where I experienced a similar issue:
>
> while true; do
> sudo umount /mnt/C-ROOT/
> if [ $? -eq 0 ]; then
> break
> fi
> echo sleeping to wait for umount...
> sleep 1
> done
Stephen, It is exactly what I'm looking for.
Thanks a lot for support.
Best regards,
Lukasz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141106/b2751ed4/attachment.pgp>
More information about the U-Boot
mailing list