diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2023-02-06 23:07:24 +0100 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2023-02-18 21:11:36 +0100 |
commit | 01262c921c7cbafc9a32b912e42c58982f47725c (patch) | |
tree | 8c5fee2472391ffc9fd67ccf5f2e8960161a1b8c /tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch | |
parent | 78dc8e2b13df439db92f233fe61d75959ffb57a6 (diff) | |
download | upstream-01262c921c7cbafc9a32b912e42c58982f47725c.tar.gz upstream-01262c921c7cbafc9a32b912e42c58982f47725c.tar.bz2 upstream-01262c921c7cbafc9a32b912e42c58982f47725c.zip |
tools/squashfs: rename to squashfs3-lzma
The name of squashfs is confusing since in reality it's a really old
version using an old lzma library. This tools is used for old ath79
netgear target and to produde a fake squasfs3 image needed for some
specific bootloader from some OEM (AVM for example)
Rename squashfs tool to squasfs3-lzma to better describe it.
Rename the installed bin from mksquashfs-lzma to mksquashfs3-lzma.
Use tar transform to migrate the root directory in tar to the new
naming.
Drop redundant PKG_CAT variable not needed anymore.
Also update any user of this tool.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch')
-rw-r--r-- | tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch b/tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch new file mode 100644 index 0000000000..e2f4bb2e04 --- /dev/null +++ b/tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch @@ -0,0 +1,79 @@ +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -117,6 +117,9 @@ unsigned int inode_bytes = 0, inode_size + char *data_cache = NULL; + unsigned int cache_bytes = 0, cache_size = 0, inode_count = 0; + ++/* override all timestamps */ ++time_t fixed_time = -1; ++ + /* in memory directory data */ + #define I_COUNT_SIZE 128 + #define DIR_ENTRIES 32 +@@ -1554,6 +1557,11 @@ void dir_scan(squashfs_inode *inode, cha + perror(buffer); + return; + } ++ ++ /* override timestamp of lstat if fixed_time is given */ ++ if(fixed_time != -1) ++ inode_info->buf.st_mtime = fixed_time; ++ + if(sorted) + sort_files_and_write(dir_info); + dir_scan2(inode, dir_info); +@@ -1582,6 +1590,10 @@ struct dir_info *dir_scan1(char *pathnam + perror(buffer); + continue; + } ++ ++ if(fixed_time != -1) ++ buf.st_mtime = fixed_time; ++ + if(excluded(filename, &buf)) + continue; + +@@ -1621,6 +1633,9 @@ int dir_scan2(squashfs_inode *inode, str + char *dir_name = dir_ent->name; + unsigned int inode_number = ((buf->st_mode & S_IFMT) == S_IFDIR) ? dir_ent->inode->inode_number : dir_ent->inode->inode_number + dir_inode_no; + ++ if(fixed_time != -1) ++ buf->st_mtime = fixed_time; ++ + if(dir_ent->inode->inode == SQUASHFS_INVALID_BLK) { + switch(buf->st_mode & S_IFMT) { + case S_IFREG: +@@ -1898,6 +1913,16 @@ int main(int argc, char *argv[]) + exit(1); + } + } ++ } else if(strcmp(argv[i], "-fixed-time") == 0) { ++ if(++i == argc) { ++ ERROR("%s: -fixed-time missing a timestamp\n", argv[0]); ++ exit(1); ++ } ++ fixed_time = strtoll(argv[i], &b, 10); ++ if(*b != '\0') { ++ ERROR("%s: -fixed-time has an invalid number\n", argv[0]); ++ exit(1); ++ } + } else if(strcmp(argv[i], "-noI") == 0 || + strcmp(argv[i], "-noInodeCompression") == 0) + noI = TRUE; +@@ -1967,6 +1992,7 @@ printOptions: + ERROR("-all-root\t\tmake all files owned by root\n"); + ERROR("-force-uid uid\t\tset all file uids to uid\n"); + ERROR("-force-gid gid\t\tset all file gids to gid\n"); ++ ERROR("-fixed-time timestamp\tset all timestamps to timestamp\n"); + ERROR("-le\t\t\tcreate a little endian filesystem\n"); + ERROR("-be\t\t\tcreate a big endian filesystem\n"); + ERROR("-nopad\t\t\tdo not pad filesystem to a multiple of 4K\n"); +@@ -2190,7 +2216,7 @@ printOptions: + sBlk.block_size = block_size; + sBlk.block_log = block_log; + sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, check_data, noF, no_fragments, always_use_fragments, duplicate_checking); +- sBlk.mkfs_time = time(NULL); ++ sBlk.mkfs_time = fixed_time != -1 ? fixed_time : time(NULL); + + restore_filesystem: + write_fragment(); |