Changeset 2030

Show
Ignore:
Timestamp:
30/11/11 15:57:22 (18 months ago)
Author:
matthijs
Message:

build-system: Retry unmounting if it fails during fmg plugin generation.

Sometimes, the loop device seems to be in use when the unmount is tried
(presumably Nautilus or udisks is looking at it or something). When this
happens, lsof is used to find out which process is occupying the device
(for debugging) and the unmount is retried after sleeping for 5 seconds.

This hasn't been thoroughly tested (since the problem hasn't occured
since I created this fix), but it seems to work at least when the umount
works.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/include/package-fon.mk

    r1858 r2030  
    202202        mkdir $$(PLUGIN_DIR_$(1))/var 
    203203 
    204         $(SUDO) umount $$(PLUGIN_DIR_$(1)) 
     204        # If unmounting does not work, retry after a few seconds in case 
     205        # # something is still using it... 
     206        $(SUDO) umount $$(PLUGIN_DIR_$(1)) || { lsof $$(PLUGIN_DIR_$(1)) ; sleep 5 ; $(SUDO) umount $$(PLUGIN_DIR_$(1)); } 
     207 
    205208 
    206209        # Clean up