Hello community,

here is the log from the commit of package squashfs for openSUSE:Factory 
checked in at 2019-08-15 12:22:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/squashfs (Old)
 and      /work/SRC/openSUSE:Factory/.squashfs.new.9556 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "squashfs"

Thu Aug 15 12:22:30 2019 rev:38 rq:720711 version:4.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/squashfs/squashfs.changes        2019-04-25 
17:51:57.921020917 +0200
+++ /work/SRC/openSUSE:Factory/.squashfs.new.9556/squashfs.changes      
2019-08-15 12:22:33.946648619 +0200
@@ -1,0 +2,7 @@
+Wed Jun  5 20:21:30 UTC 2019 - Philipp <[email protected]>
+
+-  Add -offset function to skip n bytes at the beginning of the squashfs…
+   
https://github.com/plougher/squashfs-tools/commit/5a498ad24dcfeac9f3d747e894f22901f3ac10
+   (0003-Add-offset-function-to-skip-n-bytes.patch)
+
+-------------------------------------------------------------------

New:
----
  0003-Add-offset-function-to-skip-n-bytes.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ squashfs.spec ++++++
--- /var/tmp/diff_new_pack.ultD1C/_old  2019-08-15 12:22:34.766648415 +0200
+++ /var/tmp/diff_new_pack.ultD1C/_new  2019-08-15 12:22:34.770648414 +0200
@@ -32,6 +32,8 @@
 Patch3:         squashfs-thread-limit
 # PATCH-FIX-UPSTREAM Include <sys/sysmacros.h> for major/minor/makedev
 Patch4:         sysmacros.patch
+# PATCH-FIX_UPSTREAM add -offset function to skip n bytes
+Patch5:         0003-Add-offset-function-to-skip-n-bytes.patch
 %if %{?suse_version} > 1315
 BuildRequires:  liblz4-devel
 %endif
@@ -52,6 +54,7 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %build
 %define _lto_cflags %{nil}

++++++ 0003-Add-offset-function-to-skip-n-bytes.patch ++++++
>From 5a498ad24dcfeac9f3d747e894f22901f3ac10ef Mon Sep 17 00:00:00 2001
From: probonopd <[email protected]>
Date: Thu, 15 Sep 2016 21:09:52 +0200
Subject: [PATCH] Add -offset function to skip n bytes at the beginning of the
 squashfs file

---
 squashfs-tools/mksquashfs.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index d221c358..92b6a319 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -98,6 +98,7 @@ int old_exclude = TRUE;
 int use_regex = FALSE;
 int nopad = FALSE;
 int exit_on_error = FALSE;
+static off_t squashfs_start_offset = 0;
 
 long long global_uid = -1, global_gid = -1;
 
@@ -516,9 +517,9 @@ int read_fs_bytes(int fd, long long byte, int bytes, void 
*buff)
 
        pthread_cleanup_push((void *) pthread_mutex_unlock, &pos_mutex);
        pthread_mutex_lock(&pos_mutex);
-       if(lseek(fd, off, SEEK_SET) == -1) {
+       if(lseek(fd, off+squashfs_start_offset, SEEK_SET) == -1) {
                ERROR("read_fs_bytes: Lseek on destination failed because %s, "
-                       "offset=0x%llx\n", strerror(errno), off);
+                       "offset=0x%llx\n", strerror(errno), 
off+squashfs_start_offset);
                res = 0;
        } else if(read_bytes(fd, buff, bytes) < bytes) {
                ERROR("Read on destination failed\n");
@@ -557,10 +558,10 @@ void write_destination(int fd, long long byte, int bytes, 
void *buff)
        pthread_cleanup_push((void *) pthread_mutex_unlock, &pos_mutex);
        pthread_mutex_lock(&pos_mutex);
 
-       if(lseek(fd, off, SEEK_SET) == -1) {
+       if(lseek(fd, off+squashfs_start_offset, SEEK_SET) == -1) {
                ERROR("write_destination: Lseek on destination "
                        "failed because %s, offset=0x%llx\n", strerror(errno),
-                       off);
+                       off+squashfs_start_offset);
                BAD_ERROR("Probably out of space on output %s\n",
                        block_device ? "block device" : "filesystem");
        }
@@ -2315,9 +2316,9 @@ void *writer(void *arg)
                pthread_cleanup_push((void *) pthread_mutex_unlock, &pos_mutex);
                pthread_mutex_lock(&pos_mutex);
 
-               if(lseek(fd, off, SEEK_SET) == -1) {
+               if(lseek(fd, off+squashfs_start_offset, SEEK_SET) == -1) {
                        ERROR("writer: Lseek on destination failed because "
-                               "%s, offset=0x%llx\n", strerror(errno), off);
+                               "%s, offset=0x%llx\n", strerror(errno), 
off+squashfs_start_offset);
                        BAD_ERROR("Probably out of space on output "
                                "%s\n", block_device ? "block device" :
                                "filesystem");
@@ -5341,6 +5342,15 @@ int main(int argc, char *argv[])
                        force_progress = TRUE;
                else if(strcmp(argv[i], "-no-exports") == 0)
                        exportable = FALSE;
+        else if(strcmp(argv[i], "-offset") == 0 ||
+                               strcmp(argv[i], "-o") ==0) {
+                       if(++i == argc) {
+                               ERROR("%s: %s offset missing argument\n", 
argv[0],
+                                                       argv[i - 1]);
+                               exit(1);
+                       }
+                       squashfs_start_offset = (off_t)atol(argv[i]);
+        }        
                else if(strcmp(argv[i], "-processors") == 0) {
                        if((++i == argc) || !parse_num(argv[i], &processors)) {
                                ERROR("%s: -processors missing or invalid "
@@ -5641,6 +5651,9 @@ int main(int argc, char *argv[])
                        ERROR("\nMiscellaneous options:\n");
                        ERROR("-root-owned\t\talternative name for -all-root"
                                "\n");
+                       ERROR("-o <offset>\t\tSkip <offset> bytes at the "
+                               "beginning of the file.\n\t\t\t"
+                               "Default 0 bytes\n");            
                        ERROR("-noInodeCompression\talternative name for -noI"
                                "\n");
                        ERROR("-noDataCompression\talternative name for -noD"


Reply via email to