Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with upstream branch #1

Open
ajette opened this issue Dec 19, 2018 · 1 comment
Open

Sync with upstream branch #1

ajette opened this issue Dec 19, 2018 · 1 comment

Comments

@ajette
Copy link

ajette commented Dec 19, 2018

Have you considered submitting this upstream? It looks like right now the merge would be painful because I think you originally cloned off of sourceforge and there are some spacing issues. I think your changes, which is such a simple code change but so incredibly useful, can be generally represented against https://github.com/plougher/squashfs-tools with:

diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index d696a51..d5a369f 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -100,6 +100,7 @@ int old_exclude = TRUE;
 int use_regex = FALSE;
 int nopad = FALSE;
 int exit_on_error = FALSE;
+int no_date = FALSE;
 static off_t squashfs_start_offset = 0;
 
 long long global_uid = -1, global_gid = -1;
@@ -3113,7 +3114,7 @@ void dir_scan(squashfs_inode *inode, char *pathname,
                buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR;
                buf.st_uid = getuid();
                buf.st_gid = getgid();
-               buf.st_mtime = time(NULL);
+               buf.st_mtime = (!no_date)? time(NULL) : 0;
                buf.st_dev = 0;
                buf.st_ino = 0;
                dir_ent->inode = lookup_inode2(&buf, PSEUDO_FILE_OTHER, 0);
@@ -3556,7 +3557,7 @@ void dir_scan2(struct dir_info *dir, struct pseudo *pseudo)
                buf.st_gid = pseudo_ent->dev->gid;
                buf.st_rdev = makedev(pseudo_ent->dev->major,
                        pseudo_ent->dev->minor);
-               buf.st_mtime = time(NULL);
+               buf.st_mtime = (!no_date)? time(NULL) : 0;
                buf.st_ino = pseudo_ino ++;
 
                if(pseudo_ent->dev->type == 'd') {
@@ -5565,6 +5566,12 @@ print_compressor_options:
                else if(strcmp(argv[i], "-keep-as-directory") == 0)
                        keep_as_directory = TRUE;
 
+               else if (strcmp(argv[i], "-no-date") == 0) {
+                       no_date = TRUE;
+                       delete = TRUE;
+                       no_fragments = TRUE;
+               }
+
                else if(strcmp(argv[i], "-exit-on-error") == 0)
                        exit_on_error = TRUE;
 
@@ -5620,6 +5627,9 @@ printOptions:
                        ERROR("\t\t\tdirectory containing that directory, "
                                "rather than the\n");
                        ERROR("\t\t\tcontents of the directory\n");
+                       ERROR("-no-date\t\tdo not store the date in the squash file\n");
+                       ERROR("\t\t\t(-noappend and -no-fragments is also activated)\n");
+                       ERROR("\t\t\tthis way, the squash always has the same cksum\n");
                        ERROR("\nFilesystem filter options:\n");
                        ERROR("-p <pseudo-definition>\tAdd pseudo file "
                                "definition\n");
@@ -6048,7 +6058,7 @@ printOptions:
        sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, noId, no_fragments,
                always_use_fragments, duplicate_checking, exportable,
                no_xattrs, comp_opts);
-       sBlk.mkfs_time = time(NULL);
+       sBlk.mkfs_time = (!no_date) ? time(NULL) : 0;
 
        disable_info();
@drieks
Copy link

drieks commented Jan 14, 2019

kernel.org is the correct upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants