User Tools

Site Tools


notes:union_mounts_for_building

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
notes:union_mounts_for_building [2012/11/05 13:01]
andy created
notes:union_mounts_for_building [2012/11/16 11:14] (current)
andy [Using unionfs-fuse]
Line 47: Line 47:
   * **''<​mnt-dir>''​** is ''/​home/​user/​projects/​ipsum/​build-mnt''​   * **''<​mnt-dir>''​** is ''/​home/​user/​projects/​ipsum/​build-mnt''​
  
-To unmount ​the partition ​later, simply use standard ''​umount'':​+To unmount ​it later, simply use standard ''​umount'':​
  
 <​code>​ <​code>​
Line 59: Line 59:
  
 <​code>​ <​code>​
-unionfs-fuse -o cow <build-+unionfs-fuse -o cow <build-dir>​=rw:<​source-dir>​=ro <​mnt-dir>​ 
 +</​code>​ 
 + 
 +The **''​cow''​** option enables copy-on-write semantics, without which files located in the source partition will be regarded as read-only (which may be useful for detecting build errors, but can be annoying when compiling broken third-party code or building in a source directory which has already been polluted with build products). 
 + 
 +If you wish to override certain files locally without risking putting them into the source repository, you can insert an extra read-only layer whose files will override those in ''<​source-dir>'',​ but still not be affected by scrubbing the ''<​build-dir>'':​ 
 + 
 +<​code>​ 
 +unionfs-fuse -o cow <​build-dir>​=rw:<​delta-dir>​=ro:<​source-dir>​=ro <​mnt-dir>​ 
 +</​code>​ 
 + 
 +To later unmount it, use the ''​fusermount''​ utility: 
 + 
 +<​code>​ 
 +fusermount -u <​mnt-dir>​ 
 +</​code>​ 
 + 
 + 
 +===== Results ===== 
 + 
 +To perform a build, use the ''<​build-mnt>''​ directory. 
 + 
 +<note important>​Do not edit any source in this location, any changes should be made in ''<​source-dir>''​.</​note>​ 
 + 
 +The result of this setup is that any objects are built in the ''<​build-dir>''​ directory, leaving ''<​source-dir>''​ untouched. This can also be used to detect what files being created and/or changed when performing a build. 
 + 
 +To perform a clean build simply remove everything in ''<​build-dir>''​ and repeat the build. Depending on the package concerned, this may be faster than doing a ''​make clean''​ and can be done selectively on different parts of the tree. 
notes/union_mounts_for_building.1352120512.txt.gz · Last modified: 2012/11/05 13:01 by andy