[tools] unionfs patches against 0.8.6
Ray Van Dolson
rvandolson at esri.com
Sun Oct 12 07:54:38 CEST 2008
Dag, here is a patch against the 0.8.6 sources for the unionfs stuff I
sent in while ago.
This patch adds support for a "unionopts" configuration file item
(under [main]) that allows you to specify options you want to pass to
the underlying unionfs and fuse calls. The default remains a fairly
conservative "allow_other", but some users may wish to add other
options to help with performance.
The patch also includes an initial documentation file for using unionfs
with mrepo.
Thanks as always for your work on mrepo.
Ray
--
Ray Van Dolson
ESRI, Systems Administrator
909-793-2853 x2892
-------------- next part --------------
diff -uNr mrepo-0.8.6.orig/docs/unionfs-support.txt mrepo-0.8.6.unionfsopts/docs/unionfs-support.txt
--- mrepo-0.8.6.orig/docs/unionfs-support.txt 1969-12-31 16:00:00.000000000 -0800
+++ mrepo-0.8.6.unionfsopts/docs/unionfs-support.txt 2008-10-11 22:46:18.000000000 -0700
@@ -0,0 +1,102 @@
+unionfs-fuse support in mrepo
+=============================
+
+Packages Required
+-----------------
+
+dkms
+~~~~
+DKMS project delivers a framework where kernel dependent module source can
+reside so that it is very easy to rebuild modules as you upgrade kernels.
+This makes kernel updates easy as all the kernel dependent modules are
+managed by dkms and get regenerated in case of kernel update. Further details
+can be obtained at:
+
+ http://linux.dell.com/projects.shtml
+
+dkms-fuse
+~~~~~~~~~
+Fuse kernel module in dkms
+
+fuse
+~~~~
+Fuse is filesystem implemented in userspace. 'With FUSE it is possible to
+implement a fully functional filesystem in a userspace program.' Please look
+at
+
+ http://fuse.sourceforge.net for details
+
+unionfs-fuse
+~~~~~~~~~~~~
+This is the FUSE based implementation of unionfs. It can merge together
+the contents of multiple directories into one unified tree. Its application
+within mrepo is primarily to merge multiple loop-mounted ISO files into a
+single path where everything can be accessed seamlesslly.
+
+ http://podgorny.cz/moin/UnionFsFuse
+
+Installing fuse and unionfs-fuse
+--------------------------------
+fuse and related packages can be installed directly using the apt/yum from
+rpmforge using
+
+ http://dag.wieers.com/rpm/packages/rpmforge-release/[rpmforge-release]
+
+package.
+
+Once the rpmforge-release package is installed
+
+ yum install dkms-fuse fuse-unionfs
+
+This should pull all other dependent packages (dkms, dkms-fuse, fuse and
+fuse-unionfs)
+
+Or manually get following packages for your distro:
+
+Using dkms to install fuse kernel module
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The dkms rpm is available http://dag.wieers.com/rpm/packages/dkms/
+The dkms-fuse rpm is available http://dag.wieers.com/rpm/packages/dkms-fuse/
+
+Installing the fuse userspace package
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The fuse packages is available http://dag.wieers.com/rpm/packages/fuse/
+The fuse-unionfs rpm is available http://packages.sw.be/fuse-unionfs/
+
+Configuring Mrepo
+-----------------
+
+Changes in mrepo.conf
+~~~~~~~~~~~~~~~~~~~~~
+
+unionfs support is enabled by default in mrepo version 0.8.6 and newer.
+However, you can override several options or completely disable its
+functionality by adjusting a few options in the [main] section of
+/etc/mrepo.conf:
+
+ unionfs = yes|no
+ This will enable or disable unionfs support globally.
+
+ unionfscmd = <path>
+ Provide the full path to the unionfs binary (by default it is
+ /usr/bin/unionfs).
+
+ unionopts = <option list>
+ This should be a comma separated list of options to pass to unionfs and
+ the underlying fuse system. By default the only option is "allow_other".
+
+You can also enable or disable unionfs on a per distribution basis by editing
+the corresponding /etc/mrepo.conf.d/*.conf file. Simply add:
+
+ unionfs = yes|no
+
+To this configuration file to enable or disable unionfs merging for the
+distribution in question. When enabled, mrepo will attempt to merge together
+all of the files mounted in the iso = configuration line.
+
+Misc
+----
+
+The unionfs support for mrepo was initially added by Ray Van Dolson
+<rayvd at fedoraproject.org>. Feel free to direct questions regarding unionfs
+support to him as well as to the mrepo project proper.
diff -uNr mrepo-0.8.6.orig/mrepo mrepo-0.8.6.unionfsopts/mrepo
--- mrepo-0.8.6.orig/mrepo 2008-10-06 13:46:37.000000000 -0700
+++ mrepo-0.8.6.unionfsopts/mrepo 2008-10-11 22:23:51.000000000 -0700
@@ -22,7 +22,7 @@
__version__ = "$Revision: 6444 $"
# $Source$
-VERSION = '0.8.6'
+VERSION = "0.8.6"
archs = {
'alpha': ('alpha', 'alphaev5', 'alphaev56', 'alphaev6', 'alphaev67'),
@@ -184,6 +184,7 @@
### FIXME: See if fuse module is loaded
self.fuseiso = self.getoption('main', 'fuseiso', 'yes') not in disable
self.unionfs = self.getoption('main', 'unionfs', 'yes') not in disable
+ self.unionopts = self.getoption('main', 'unionopts', 'allow_other')
self.no_proxy = self.getoption('main', 'no_proxy', None)
self.ftp_proxy = self.getoption('main', 'ftp_proxy', None)
@@ -556,8 +557,10 @@
### Create the 'os' directory for the merged trees.
unionfs_mountpoint = os.path.join(self.dir, 'os')
mkdir(unionfs_mountpoint)
- info(2, "%s -o allow_other,fsname=%s %s %s" % (cf.cmd['unionfs'], unionfs_name, ':'.join(mountpoints), unionfs_mountpoint))
- run("%s -o allow_other,fsname=%s %s %s" % (cf.cmd['unionfs'], unionfs_name, ':'.join(mountpoints), unionfs_mountpoint))
+ # Generate optionts for unionfs. Per man-page one option per -o.
+ unionopts = ' '.join([ "-o %s" % x for x in cf.unionopts.split(',') ])
+ info(2, "%s %s -o fsname=%s %s %s" % (cf.cmd['unionfs'], unionopts, unionfs_name, ':'.join([ "%s=RO" % x for x in mountpoints ]), unionfs_mountpoint))
+ run("%s %s -o fsname=%s %s %s" % (cf.cmd['unionfs'], unionopts, unionfs_name, ':'.join([ "%s=RO" % x for x in mountpoints ]), unionfs_mountpoint))
return discs
More information about the tools
mailing list