--- /dev/null
+fusefile (1.1-1) unstable; urgency=medium
+
+ * Corrected fragment ranges to be 64-bit (long int)
+ * Allow for fragment pathnames including "/" without range appendix
+ * Fix index oob in -dump function.
+
+ -- Ralph Ronnquist <rrq@rrq.au> Thu, 03 Aug 2023 21:02:13 +1000
+
+fusefile (1.0-1) unstable; urgency=medium
+
+ * Version change for submission to debian
+
+ -- Ralph Ronnquist <rrq@rrq.au> Sun, 25 Jun 2023 17:39:21 +1000
+
+fusefile (0.5.7) unstable; urgency=medium
+
+ * Updated man page.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Sun, 25 Jun 2023 13:37:38 +1000
+
+fusefile (0.5.6) unstable; urgency=medium
+
+ * Added -dump function for dumping fragments including overlay table.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Wed, 21 Jun 2023 00:09:34 +1000
+
+fusefile (0.5.5) unstable; urgency=medium
+
+ * Updated man page.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Thu, 25 May 2023 16:01:40 +1000
+
+fusefile (0.5.4) unstable; urgency=medium
+
+ * Include fusedisk helper script for block mount
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Wed, 24 May 2023 19:48:53 +1000
+fusefile (0.5.3) unstable; urgency=medium
+
+ * Updated package description.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Mon, 03 Oct 2022 13:01:26 +1100
+
+fusefile (0.5.2) unstable; urgency=medium
+
+ * Reworked overlay with new region representaiton.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Fri, 12 Aug 2022 08:57:37 +1000
+
+fusefile (0.5.1) unstable; urgency=medium
+
+ * Fixes to overlay function.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Thu, 11 Aug 2022 01:40:48 +1000
+
+fusefile (0.5) unstable; urgency=medium
+
+ * Added overlay file option.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Tue, 09 Aug 2022 21:22:35 +1000
+
+fusefile (0.4) unstable; urgency=medium
+
+ * Revised into overwriting in sources without size change.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Fri, 15 Jul 2022 12:17:30 +1000
+
+fusefile (0.3) unstable; urgency=medium
+
+ * Added writeability variation
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Thu, 26 May 2022 19:53:05 +1000
+
+fusefile (0.2) unstable; urgency=medium
+
+ * Code refresh for chimaera (bullseye).
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Tue, 05 Apr 2022 19:43:49 +1000
+
+fusefile (0.1) unstable; urgency=medium
+
+ * Initial Release.
+
+ -- Ralph Ronnquist <ralph.ronnquist@gmail.com> Mon, 11 Mar 2018 10:00:00 +1100
--- /dev/null
+Source: fusefile
+Section: admin
+Priority: optional
+Maintainer: Ralph Ronnquist <rrq@rrq.au>
+Build-Depends: debhelper-compat (= 13), libfuse-dev
+Standards-Version: 4.6.2
+Homepage: https://git.devuan.org/rrq/fusefile.git
+Vcs-Browser: https://git.devuan.org/rrq/fusefile/src/branch/debian
+Vcs-Git: https://git.devuan.org/rrq/fusefile.git -b debian
+Rules-Requires-Root: no
+
+Package: fusefile
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, fuse
+Description: Using FUSE to combine file fragments into a single file.
+ fusefile is a FUSE "file mount" that presents a series of fragments
+ of other files as a contiguous concatenation. Technically it bind
+ mounts a driver on top of the filename mountpoint to provide access
+ to the given file fragments as if in a single, contiguous file. The
+ fusefile mount driver offers read/write access to the fused file,
+ distributing written data across the given fragments or to an overlay
+ file.
--- /dev/null
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: fusefile
+Upstream-Contact: Ralph Ronnquist <rrq@rrq.au>
+Source: https://git.devuan.org/rrq/fusefile.git
+
+Files: *
+Copyright: 2018 Ralph Ronnquist <rrq@rrq.au>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
--- /dev/null
+usr/share/man/man8/fusefile.8 usr/share/man/man8/fusedisk.8
--- /dev/null
+[DEFAULT]
+debian-branch=debian
+upstream-branch=master
+upstream-tag=%(version)s
+compression-level=9
--- /dev/null
+#!/usr/bin/make -f
+
+%:
+ dh $@
--- /dev/null
+3.0 (quilt)
--- /dev/null
+version=4
+opts="mode=git, pgpmode=none" \
+https://git.devuan.org/rrq/fusefile \
+refs/tags/([\d\.]+) master uupdate
.br
.B fusefile \fB-dump\fR \fR[\fIfuse-opts\fR] \fBmountpoint\fR \fR[\fIoverlay\fR] \fIfilename/from-to\fR ...
.br
+.B fusefile \fB-push\fR \fR[\fIfuse-opts\fR] \fBmountpoint\fR \fR[\fIoverlay\fR] \fIfilename/from-to\fR ...
+.br
.B fusedisk \fR[\fIfuse-opts\fR] \fBmountpoint\fR \fR[\fIoverlay\fR] \fIfilename/from-to\fR ...
.SH DESCRIPTION
The option \fB-dump\fR as first argument together with a fusefile
setup will print the setup to standard output rather than establishing
-a fusefile mount. This is of most use with a prior overlay setup,
-where then the printout includes the portions of updates that have
-been captured in the overlay. The printout is the series of fusefile
+a fusefile mount. This is of most use with a prior overlay setup where
+then the printout includes the portions of updates that have been
+captured in the overlay. The printout is the series of fusefile
fragment argments to give in order to intersperse the captured overlay
portions according to the overlay table.
+The option \fB-push\fR as first argument together with a fusefile
+setup will push the overlay into the sources (except for
+write-protected fragments). This is only of use with a prior overlay
+setup where then the updates that have been captured in the overlay
+get pushed into the fragments.
+
\fBfusedisk\fR is a helper script to set up a \fBfusefile\fR as a
block device (via \fIfuseblk\fR) by using the device mapper
(\fBdmsetup\fR) to manage an empty block device mapping where content
return size;
}
+#define PUSHBUF 104857600
+/**
+ * Write data from overlay to source.
+ */
+static void push_oly(off_t beg, off_t end) {
+ static char * buffer = 0;
+ // Pretend that there isn't an overlay
+ char *filename = overlay.source.filename;
+ if ( buffer == 0 ) {
+ buffer = malloc( PUSHBUF );
+ if ( buffer == 0 ) {
+ fprintf( stderr, "** OOM!!\n" );
+ exit( 1 );
+ }
+ }
+ overlay.source.filename = 0;
+ while ( beg < end ) {
+ off_t size = end - beg;
+ if ( size > PUSHBUF ) {
+ size = PUSHBUF;
+ }
+ if ( lseek( overlay.source.fd, beg, SEEK_SET ) < 0 ) {
+ fprintf( stderr, "** Cannot seek overlay at %ld\n", beg );
+ break;
+ }
+ size = read( overlay.source.fd, buffer, size );
+ if ( write_block( beg, buffer, size ) < 0 ) {
+ fprintf( stderr, "** Cannot push %ld bytes at %ld\n", size, beg );
+ }
+ beg += size;
+ }
+ overlay.source.filename = filename;
+}
+
static void fusefile_destroy(void *data) {
char *mnt = (char*) data; // As passed to fuse_main
#if DEBUG
/**
* Dump the current fragmentation to stdout.
*/
-static int dump_fragments() {
+static int dump_fragments(int push) {
int oly = 0;
int src = 0;
size_t pos = 0;
for ( ; src < sources.count &&
ENDSOURCE( sources.array[ src ] ) <= x; src++ ) {
// Dump sources.array[src] in full
- fprintf( stdout, "%s/%ld:%ld\n",
- sources.array[ src ].filename,
- pos - sources.array[ src ].start,
- sources.array[ src ].to );
+ if ( !push ) {
+ fprintf( stdout, "%s/%ld:%ld\n",
+ sources.array[ src ].filename,
+ pos - sources.array[ src ].start,
+ sources.array[ src ].to );
+ }
pos = ENDSOURCE( sources.array[ src ] );
}
if ( ( src < sources.count ) && ( sources.array[ src ].start < x ) ) {
// Dump sources.array[src] up to x;
- fprintf( stdout, "%s/%ld:%ld\n",
- sources.array[ src ].filename,
- pos - sources.array[ src ].start,
- x - sources.array[ src ].start );
+ if ( !push ) {
+ fprintf( stdout, "%s/%ld:%ld\n",
+ sources.array[ src ].filename,
+ pos - sources.array[ src ].start,
+ x - sources.array[ src ].start );
+ }
pos = ENDSOURCE( sources.array[ src ] );
}
if ( oly < overlay.count ) {
- fprintf( stdout, "%s/%ld:%ld\n",
- overlay.source.filename,
- overlay.table[ oly ].beg,
- overlay.table[ oly ].end );
+ if ( !push ) {
+ fprintf( stdout, "%s/%ld:%ld\n",
+ overlay.source.filename,
+ overlay.table[ oly ].beg,
+ overlay.table[ oly ].end );
+ } else {
+ push_oly( overlay.table[ oly ].beg, overlay.table[ oly ].end );
+ }
pos = overlay.table[ oly++ ].end;
}
for ( ; src < sources.count &&
}
fuseargc = setup_argv( fuseargc, &argv );
if ( strcmp( "-dump", argv[ 1 ] ) == 0 ) {
- return dump_fragments();
+ return dump_fragments( 0 );
+ }
+ if ( strcmp( "-push", argv[ 1 ] ) == 0 ) {
+ return dump_fragments( 1 );
}
struct fuse_args args = FUSE_ARGS_INIT( fuseargc, argv );
if ( fuse_parse_cmdline( &args, &mnt, &mt, &fg ) ) {