diff options
Diffstat (limited to 'pkgs/tools/filesystems')
23 files changed, 233 insertions, 629 deletions
diff --git a/pkgs/tools/filesystems/bcachefs-tools/default.nix b/pkgs/tools/filesystems/bcachefs-tools/default.nix index 98dab6278b0..d53fbb3960b 100644 --- a/pkgs/tools/filesystems/bcachefs-tools/default.nix +++ b/pkgs/tools/filesystems/bcachefs-tools/default.nix @@ -3,12 +3,12 @@ stdenv.mkDerivation { pname = "bcachefs-tools"; - version = "2019-08-21"; + version = "2019-10-01"; src = fetchgit { url = "https://evilpiepirate.org/git/bcachefs-tools.git"; - rev = "72a408f84846fe702b8db4f158b678ee20bbf835"; - sha256 = "0y5700afv1x1i3wnp3g71i3zhyhkwmx79j0irxr63fmg47n0ys1i"; + rev = "7f69c4161c31b8f43723a9ccad1a9a358f4e2e70"; + sha256 = "0v4b8h99cd434v349y8vmhj2igf0ryky7svd20ar1fr7da580kvj"; }; enableParallelBuilding = true; diff --git a/pkgs/tools/filesystems/blobfuse/default.nix b/pkgs/tools/filesystems/blobfuse/default.nix index 067f200e201..6fc0e3a7f21 100644 --- a/pkgs/tools/filesystems/blobfuse/default.nix +++ b/pkgs/tools/filesystems/blobfuse/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { sha256 = "1qh04z1fsj1l6l12sz9yl2sy9hwlrnzac54hwrr7wvsgv90n9gbp"; }; + NIX_CFLAGS_COMPILE = [ "-Wno-error=catch-value" ]; + buildInputs = [ curl gnutls libgcrypt libuuid fuse ]; nativeBuildInputs = [ cmake pkgconfig ]; @@ -20,4 +22,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ jbgi ]; platforms = platforms.linux; }; -} \ No newline at end of file +} diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index f5588cc51ab..95fc1c1cd7a 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -4,11 +4,11 @@ stdenv.mkDerivation rec { pname = "btrfs-progs"; - version = "5.2.1"; + version = "5.2.2"; src = fetchurl { url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz"; - sha256 = "0crjv3i20nyj2dagfw6q7byshscpn6j7wlqch3apkzzzk00lmb1n"; + sha256 = "1imivxjppi8zl27gn472pwpk8bg5dijkbyi340by31vhy7dj24w2"; }; nativeBuildInputs = [ diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index 1755ef625f5..141d21951a8 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -89,7 +89,7 @@ let ps.six ]); - version = "14.2.3"; + version = "14.2.4"; in rec { ceph = stdenv.mkDerivation { pname = "ceph"; @@ -97,7 +97,7 @@ in rec { src = fetchurl { url = "http://download.ceph.com/tarballs/ceph-${version}.tar.gz"; - sha256 = "1pa8czb205pz4vjfh82gsgickj3cdjrx51mcx7acsyqgp3dfvl33"; + sha256 = "1y6hixh6srd5aswhzq0sf0dbygwhx0ardx3w3f7qazf5rapvd03i"; }; patches = [ diff --git a/pkgs/tools/filesystems/cryfs/default.nix b/pkgs/tools/filesystems/cryfs/default.nix index 67016af8c0d..7eee02e220a 100644 --- a/pkgs/tools/filesystems/cryfs/default.nix +++ b/pkgs/tools/filesystems/cryfs/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "cryfs"; repo = "cryfs"; - rev = "${version}"; + rev = version; sha256 = "04yqpad8x0hiiwpykcn3swi0py6sg9xid6g15ny2qs4j3llin5ry"; }; diff --git a/pkgs/tools/filesystems/darling-dmg/default.nix b/pkgs/tools/filesystems/darling-dmg/default.nix index 4d40d61b570..0890db67fe7 100644 --- a/pkgs/tools/filesystems/darling-dmg/default.nix +++ b/pkgs/tools/filesystems/darling-dmg/default.nix @@ -1,24 +1,18 @@ -{ stdenv, fetchFromGitHub, fetchpatch, cmake, fuse, zlib, bzip2, openssl, libxml2, icu } : +{ stdenv, fetchFromGitHub, cmake, fuse, zlib, bzip2, openssl, libxml2, icu } : stdenv.mkDerivation rec { pname = "darling-dmg"; - version = "1.0.4"; + version = "1.0.4+git20180914"; src = fetchFromGitHub { owner = "darlinghq"; repo = "darling-dmg"; - rev = "v${version}"; - sha256 = "0x285p16zfnp0p6injw1frc8krif748sfgxhdd7gb75kz0dfbkrk"; + rev = "97a92a6930e43cdbc9dedaee62716e3223deb027"; + sha256 = "1bngr4827qnl4s2f7z39wjp13nfm3zzzykjshb43wvjz536bnqdj"; }; - patches = [ - (fetchpatch { - url = "https://github.com/darlinghq/darling-dmg/commit/cbb0092264b5c5cf3e92d6c2de23f02d859ebf44.patch"; - sha256 = "05fhgn5c09f1rva6bvbq16nhlkblrhscbf69k04ajwdh7y98sw39"; - }) - ]; - - buildInputs = [ cmake fuse openssl zlib bzip2 libxml2 icu ]; + nativeBuildInputs = [ cmake ]; + buildInputs = [ fuse openssl zlib bzip2 libxml2 icu ]; # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554 CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ]; diff --git a/pkgs/tools/filesystems/f2fs-tools/default.nix b/pkgs/tools/filesystems/f2fs-tools/default.nix index d7fa971c987..c5ec523e247 100644 --- a/pkgs/tools/filesystems/f2fs-tools/default.nix +++ b/pkgs/tools/filesystems/f2fs-tools/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "f2fs-tools"; - version = "1.11.0"; + version = "1.13.0"; src = fetchgit { url = "https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git"; rev = "refs/tags/v${version}"; - sha256 = "188yv77ga466wpzbirsx6vspym8idaschgi7cx92z4jwqpnkk5gv"; + sha256 = "0h6wincsvg6s232ajxblg66r5nx87v00a4w7xkbxgbl1qyny477j"; }; nativeBuildInputs = [ autoreconfHook pkgconfig ]; diff --git a/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch b/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch index 1503732240c..e01a97b0bc3 100644 --- a/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch +++ b/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch @@ -1,25 +1,27 @@ ---- f2fs-tools/configure.ac.orig 2018-11-29 05:05:57.154988687 +0300 -+++ f2fs-tools/configure.ac 2018-11-29 05:06:12.667316101 +0300 -@@ -20,14 +20,16 @@ +diff --git a/configure.ac b/configure.ac +index 9b0e872..0108219 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -20,14 +20,16 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpatsubst(f2fs_tools_version, [\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]), [Minor version for f2fs-tools]) --AC_CHECK_FILE(.git, +-AS_IF([test -d .git],[ - AC_DEFINE([F2FS_TOOLS_DATE], - "m4_bpatsubst(f2fs_tools_gitdate, - [\([0-9-]*\)\(\w\|\W\)*], [\1])", -- [f2fs-tools date based on Git commits]), +- [f2fs-tools date based on Git commits])],[ - AC_DEFINE([F2FS_TOOLS_DATE], - "f2fs_tools_date", -- [f2fs-tools date based on Source releases])) -+dnl AC_CHECK_FILE(.git, -+dnl AC_DEFINE([F2FS_TOOLS_DATE], -+dnl "m4_bpatsubst(f2fs_tools_gitdate, -+dnl [\([0-9-]*\)\(\w\|\W\)*], [\1])", -+dnl [f2fs-tools date based on Git commits]), -+dnl AC_DEFINE([F2FS_TOOLS_DATE], -+dnl "f2fs_tools_date", -+dnl [f2fs-tools date based on Source releases])) +- [f2fs-tools date based on Source releases])]) ++dnl AS_IF([test -d .git],[ ++dnl AC_DEFINE([F2FS_TOOLS_DATE], ++dnl "m4_bpatsubst(f2fs_tools_gitdate, ++dnl [\([0-9-]*\)\(\w\|\W\)*], [\1])", ++dnl [f2fs-tools date based on Git commits])],[ ++dnl AC_DEFINE([F2FS_TOOLS_DATE], ++dnl "f2fs_tools_date", ++dnl [f2fs-tools date based on Source releases])]) + +AC_DEFINE([F2FS_TOOLS_DATE], "f2fs_tools_date", [f2fs-tools date based on Source releases]) diff --git a/pkgs/tools/filesystems/fuse-overlayfs/default.nix b/pkgs/tools/filesystems/fuse-overlayfs/default.nix index a96830feb2a..2c9336802ea 100644 --- a/pkgs/tools/filesystems/fuse-overlayfs/default.nix +++ b/pkgs/tools/filesystems/fuse-overlayfs/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "fuse-overlayfs"; - version = "0.5.1"; + version = "0.6.2"; src = fetchFromGitHub { owner = "containers"; repo = pname; rev = "v${version}"; - sha256 = "03sdnnq0x44jlwf41snrrma4hxdiixmhynw35gjhm84slpljnngp"; + sha256 = "03gad89jg0dif5wqdl1kh0rpmfc80pnkx8hk0v4hrlirr130dgl2"; }; nativeBuildInputs = [ autoreconfHook pkgconfig ]; diff --git a/pkgs/tools/filesystems/irods/default.nix b/pkgs/tools/filesystems/irods/default.nix index 031c1440fcf..14790ae7087 100644 --- a/pkgs/tools/filesystems/irods/default.nix +++ b/pkgs/tools/filesystems/irods/default.nix @@ -30,6 +30,12 @@ in rec { # but we don't use /usr with nix, so remove only 2 items. patches = [ ./irods_root_path.patch ]; + NIX_CFLAGS_COMPILE = [ + # fix build with recent llvm versions + "-Wno-deprecated-register" + "-Wno-deprecated-declarations" + ]; + preConfigure = common.preConfigure + '' patchShebangs ./test substituteInPlace plugins/database/CMakeLists.txt --replace "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp" diff --git a/pkgs/tools/filesystems/mergerfs/default.nix b/pkgs/tools/filesystems/mergerfs/default.nix index 43c7c167b5e..4a3e860d358 100644 --- a/pkgs/tools/filesystems/mergerfs/default.nix +++ b/pkgs/tools/filesystems/mergerfs/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "mergerfs"; - version = "2.28.1"; + version = "2.28.2"; src = fetchFromGitHub { owner = "trapexit"; repo = pname; rev = version; - sha256 = "18yc80ccpqf785gah5xw6jg5524wfra8bf3pcjr7idzdz4ca7nvf"; + sha256 = "14h32acx2fcbyjf1f80vb86q845zwcjszd99a307ybdfhlv18r2m"; }; nativeBuildInputs = [ diff --git a/pkgs/tools/filesystems/netatalk/default.nix b/pkgs/tools/filesystems/netatalk/default.nix index 42889714e92..0a4207d0715 100644 --- a/pkgs/tools/filesystems/netatalk/default.nix +++ b/pkgs/tools/filesystems/netatalk/default.nix @@ -1,6 +1,6 @@ { fetchurl, stdenv, autoreconfHook, pkgconfig, perl, python , db, libgcrypt, avahi, libiconv, pam, openssl, acl -, ed, glibc +, ed, glibc, libevent }: stdenv.mkDerivation rec{ @@ -18,12 +18,13 @@ stdenv.mkDerivation rec{ nativeBuildInputs = [ autoreconfHook pkgconfig perl python python.pkgs.wrapPython ]; - buildInputs = [ db libgcrypt avahi libiconv pam openssl acl ]; + buildInputs = [ db libgcrypt avahi libiconv pam openssl acl libevent ]; configureFlags = [ "--with-bdb=${db.dev}" "--with-ssl-dir=${openssl.dev}" "--with-lockfile=/run/lock/netatalk" + "--with-libevent=${libevent.dev}" "--localstatedir=/var/lib" ]; diff --git a/pkgs/tools/filesystems/sasquatch/default.nix b/pkgs/tools/filesystems/sasquatch/default.nix new file mode 100644 index 00000000000..c393c65a720 --- /dev/null +++ b/pkgs/tools/filesystems/sasquatch/default.nix @@ -0,0 +1,53 @@ +{ fetchFromGitHub +, fetchurl +, lz4 ? null +, lz4Support ? false +, lzma +, lzo +, stdenv +, xz +, zlib +}: + +assert lz4Support -> (lz4 != null); + +let + patch = fetchFromGitHub { + owner = "devttys0"; + repo = "sasquatch"; + rev = "3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed"; + sha256 = "19lhndjv7v9w6nmszry63zh5rqii9v7wvsbpc2n6q606hyz955g2"; + } + "/patches/patch0.txt"; +in +stdenv.mkDerivation rec { + pname = "sasquatch"; + version = "4.3"; + + src = fetchurl { + url = mirror://sourceforge/squashfs/squashfs4.3.tar.gz; + sha256 = "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"; + }; + + buildInputs = [ lzma lzo xz zlib ] + ++ stdenv.lib.optional lz4Support lz4; + + patches = [ patch ]; + patchFlags = [ "-p0" ]; + + postPatch = '' + cd squashfs-tools + ''; + + installFlags = "INSTALL_DIR=\${out}/bin"; + + makeFlags = [ "XZ_SUPPORT=1" ] + ++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1"; + + meta = with stdenv.lib; { + homepage = "https://github.com/devttys0/sasquatch"; + description = "Set of patches to the standard unsquashfs utility (part of squashfs-tools) that attempts to add support for as many hacked-up vendor-specific SquashFS implementations as possible"; + license = licenses.gpl2Plus; + maintainers = [ maintainers.pamplemousse ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/filesystems/simg2img/default.nix b/pkgs/tools/filesystems/simg2img/default.nix index 997aa321afa..78f80ecfa87 100644 --- a/pkgs/tools/filesystems/simg2img/default.nix +++ b/pkgs/tools/filesystems/simg2img/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "anestisb"; repo = "android-simg2img"; - rev = "${version}"; + rev = version; sha256 = "119gl9i61g2wr07hzv6mi1ihql6yd6pwq94ki2pgcpfbamv8f6si"; }; diff --git a/pkgs/tools/filesystems/squashfs/0001-If-SOURCE_DATE_EPOCH-is-set-override-timestamps-with.patch b/pkgs/tools/filesystems/squashfs/0001-If-SOURCE_DATE_EPOCH-is-set-override-timestamps-with.patch deleted file mode 100644 index 5626800e723..00000000000 --- a/pkgs/tools/filesystems/squashfs/0001-If-SOURCE_DATE_EPOCH-is-set-override-timestamps-with.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 0ab12a8585373be2de5129e14d979c62e7a90d82 Mon Sep 17 00:00:00 2001 -From: Chris Lamb <lamby@debian.org> -Date: Mon, 21 Nov 2016 09:33:05 +0100 -Subject: [PATCH] If SOURCE_DATE_EPOCH is set, override timestamps with that - value. - -See https://reproducible-builds.org/specs/source-date-epoch/ for more -information about this environment variable. - -Based on a patch by Alexander Couzens <lynxis@fe...> posted on -https://sourceforge.net/p/squashfs/mailman/message/34673610/ - -Signed-off-by: Chris Lamb <lamby@debian.org> ---- - squashfs-tools/mksquashfs.c | 38 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c -index c2098bd..b49e956 100644 ---- a/squashfs-tools/mksquashfs.c -+++ b/squashfs-tools/mksquashfs.c -@@ -137,6 +137,9 @@ unsigned int cache_bytes = 0, cache_size = 0, inode_count = 0; - /* inode lookup table */ - squashfs_inode *inode_lookup_table = NULL; - -+/* override filesystem creation time */ -+time_t mkfs_fixed_time = -1; -+ - /* in memory directory data */ - #define I_COUNT_SIZE 128 - #define DIR_ENTRIES 32 -@@ -5104,6 +5107,9 @@ int main(int argc, char *argv[]) - int total_mem = get_default_phys_mem(); - int progress = TRUE; - int force_progress = FALSE; -+ char *source_date_epoch, *endptr; -+ unsigned long long epoch; -+ - struct file_buffer **fragment = NULL; - - if(argc > 1 && strcmp(argv[1], "-version") == 0) { -@@ -5641,6 +5647,36 @@ printOptions: - } - } - -+ /* if SOURCE_DATE_EPOCH is set, use that timestamp for the mkfs time */ -+ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); -+ if(source_date_epoch) { -+ errno = 0; -+ epoch = strtoull(source_date_epoch, &endptr, 10); -+ if((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0)) -+ || (errno != 0 && epoch == 0)) { -+ ERROR("Environment variable $SOURCE_DATE_EPOCH: " -+ "strtoull: %s\n", strerror(errno)); -+ EXIT_MKSQUASHFS(); -+ } -+ if(endptr == source_date_epoch) { -+ ERROR("Environment variable $SOURCE_DATE_EPOCH: " -+ "No digits were found: %s\n", endptr); -+ EXIT_MKSQUASHFS(); -+ } -+ if(*endptr != '\0') { -+ ERROR("Environment variable $SOURCE_DATE_EPOCH: " -+ "Trailing garbage: %s\n", endptr); -+ EXIT_MKSQUASHFS(); -+ } -+ if(epoch > ULONG_MAX) { -+ ERROR("Environment variable $SOURCE_DATE_EPOCH: " -+ "value must be smaller than or equal to " -+ "%lu but was found to be: %llu \n", ULONG_MAX, epoch); -+ EXIT_MKSQUASHFS(); -+ } -+ mkfs_fixed_time = (time_t)epoch; -+ } -+ - /* - * Some compressors may need the options to be checked for validity - * once all the options have been processed -@@ -5993,7 +6029,7 @@ printOptions: - sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments, - always_use_fragments, duplicate_checking, exportable, - no_xattrs, comp_opts); -- sBlk.mkfs_time = time(NULL); -+ sBlk.mkfs_time = mkfs_fixed_time != -1 ? mkfs_fixed_time : time(NULL); - - disable_info(); - --- -2.17.0 - diff --git a/pkgs/tools/filesystems/squashfs/0002-If-SOURCE_DATE_EPOCH-is-set-also-clamp-content-times.patch b/pkgs/tools/filesystems/squashfs/0002-If-SOURCE_DATE_EPOCH-is-set-also-clamp-content-times.patch deleted file mode 100644 index 5002375887f..00000000000 --- a/pkgs/tools/filesystems/squashfs/0002-If-SOURCE_DATE_EPOCH-is-set-also-clamp-content-times.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 32a07d4156a281084c90a4b78affc8b0b32a26fc Mon Sep 17 00:00:00 2001 -From: intrigeri <intrigeri@boum.org> -Date: Mon, 21 Nov 2016 11:41:28 +0000 -Subject: [PATCH] If SOURCE_DATE_EPOCH is set, also clamp content timestamps - with that value. - -Based on a patch by Alexander Couzens <lynxis@fe...> posted on -https://sourceforge.net/p/squashfs/mailman/message/34673610/ ---- - squashfs-tools/mksquashfs.c | 15 ++++++++++++--- - 1 file changed, 12 insertions(+), 3 deletions(-) - -diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c -index b49e956..9f020bf 100644 ---- a/squashfs-tools/mksquashfs.c -+++ b/squashfs-tools/mksquashfs.c -@@ -137,6 +137,9 @@ unsigned int cache_bytes = 0, cache_size = 0, inode_count = 0; - /* inode lookup table */ - squashfs_inode *inode_lookup_table = NULL; - -+/* clamp all timestamps to SOURCE_DATE_EPOCH */ -+time_t content_clamp_time = -1; -+ - /* override filesystem creation time */ - time_t mkfs_fixed_time = -1; - -@@ -2246,6 +2249,8 @@ restat: - pathname_reader(dir_ent), strerror(errno)); - goto read_err; - } -+ if(content_clamp_time != -1 && buf2.st_mtime >= content_clamp_time) -+ buf2.st_mtime = content_clamp_time; - - if(read_size != buf2.st_size) { - close(file); -@@ -3101,7 +3106,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 = content_clamp_time != -1 ? content_clamp_time : time(NULL); - buf.st_dev = 0; - buf.st_ino = 0; - dir_ent->inode = lookup_inode2(&buf, PSEUDO_FILE_OTHER, 0); -@@ -3127,6 +3115,8 @@ void dir_scan(squashfs_inode *inode, char *pathname, - /* source directory has disappeared? */ - BAD_ERROR("Cannot stat source directory %s because %s\n", - pathname, strerror(errno)); -+ if(content_clamp_time != -1 && buf.st_mtime >= content_clamp_time) -+ buf.st_mtime = content_clamp_time; - dir_ent->inode = lookup_inode(&buf); - } - -@@ -3365,6 +3372,8 @@ struct dir_info *dir_scan1(char *filename, char *subpath, - free_dir_entry(dir_ent); - continue; - } -+ if(content_clamp_time != -1 && buf.st_mtime >= content_clamp_time) -+ buf.st_mtime = content_clamp_time; - - if((buf.st_mode & S_IFMT) != S_IFREG && - (buf.st_mode & S_IFMT) != S_IFDIR && -@@ -3544,7 +3553,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 = content_clamp_time != -1 ? content_clamp_time : time(NULL); - buf.st_ino = pseudo_ino ++; - - if(pseudo_ent->dev->type == 'd') { -@@ -5674,7 +5683,7 @@ printOptions: - "%lu but was found to be: %llu \n", ULONG_MAX, epoch); - EXIT_MKSQUASHFS(); - } -- mkfs_fixed_time = (time_t)epoch; -+ mkfs_fixed_time = content_clamp_time = (time_t)epoch; - } - - /* --- -2.17.0 - diff --git a/pkgs/tools/filesystems/squashfs/0003-remove-frag-deflator-thread.patch b/pkgs/tools/filesystems/squashfs/0003-remove-frag-deflator-thread.patch deleted file mode 100644 index 4be4b96369a..00000000000 --- a/pkgs/tools/filesystems/squashfs/0003-remove-frag-deflator-thread.patch +++ /dev/null @@ -1,220 +0,0 @@ -From afc0c76a170bd17cbd29bbec6ae6d2227e398570 Mon Sep 17 00:00:00 2001 -From: Alexander Couzens <lynxis@fe80.eu> -Date: Fri, 13 Jan 2017 22:00:37 +0100 -Subject: [PATCH] remove frag_deflator_thread - -frag_deflator_thread compress fragments. -Replace the deflator_thread with a function and -use the function instead of the to_frag queue. ---- - squashfs-tools/info.c | 5 --- - squashfs-tools/mksquashfs.c | 76 +++++++++++++------------------------ - squashfs-tools/mksquashfs.h | 2 +- - squashfs-tools/restore.c | 15 +------- - 4 files changed, 30 insertions(+), 68 deletions(-) - -diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c -index 7968c77..028d578 100644 ---- a/squashfs-tools/info.c -+++ b/squashfs-tools/info.c -@@ -96,11 +96,6 @@ void dump_state() - printf("compressed block queue (deflate thread(s) -> main thread)\n"); - dump_seq_queue(to_main, 0); - -- printf("uncompressed packed fragment queue (main thread -> fragment" -- " deflate thread(s))\n"); -- dump_queue(to_frag); -- -- - printf("locked frag queue (compressed frags waiting while multi-block" - " file is written)\n"); - dump_queue(locked_fragment); -diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c -index cf48e40..cacf14c 100644 ---- a/squashfs-tools/mksquashfs.c -+++ b/squashfs-tools/mksquashfs.c -@@ -270,10 +270,10 @@ unsigned int sid_count = 0, suid_count = 0, sguid_count = 0; - struct cache *reader_buffer, *fragment_buffer, *reserve_cache; - struct cache *bwriter_buffer, *fwriter_buffer; - struct queue *to_reader, *to_deflate, *to_writer, *from_writer, -- *to_frag, *locked_fragment, *to_process_frag; -+ *locked_fragment, *to_process_frag; - struct seq_queue *to_main; - pthread_t reader_thread, writer_thread, main_thread; --pthread_t *deflator_thread, *frag_deflator_thread, *frag_thread; -+pthread_t *deflator_thread, *frag_thread; - pthread_t *restore_thread = NULL; - pthread_mutex_t fragment_mutex = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_t pos_mutex = PTHREAD_MUTEX_INITIALIZER; -@@ -323,7 +323,7 @@ struct dir_info *scan1_opendir(char *pathname, char *subpath, int depth); - void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad); - unsigned short get_checksum_mem(char *buff, int bytes); - void check_usable_phys_mem(int total_mem); -- -+void frag_deflator(struct file_buffer *file_buffer); - - void prep_exit() - { -@@ -1540,7 +1540,7 @@ void write_fragment(struct file_buffer *fragment) - pthread_mutex_lock(&fragment_mutex); - fragment_table[fragment->block].unused = 0; - fragments_outstanding ++; -- queue_put(to_frag, fragment); -+ frag_deflator(fragment); - pthread_cleanup_pop(1); - } - -@@ -2412,51 +2412,34 @@ void *deflator(void *arg) - } - - --void *frag_deflator(void *arg) -+void frag_deflator(struct file_buffer *file_buffer) - { -- void *stream = NULL; -- int res; - -- res = compressor_init(comp, &stream, block_size, 1); -- if(res) -- BAD_ERROR("frag_deflator:: compressor_init failed\n"); -- -- pthread_cleanup_push((void *) pthread_mutex_unlock, &fragment_mutex); -- -- while(1) { -- int c_byte, compressed_size; -- struct file_buffer *file_buffer = queue_get(to_frag); -- struct file_buffer *write_buffer = -+ int c_byte, compressed_size; -+ struct file_buffer *write_buffer = - cache_get(fwriter_buffer, file_buffer->block); - -- c_byte = mangle2(stream, write_buffer->data, file_buffer->data, -- file_buffer->size, block_size, noF, 1); -- compressed_size = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte); -- write_buffer->size = compressed_size; -- pthread_mutex_lock(&fragment_mutex); -- if(fragments_locked == FALSE) { -- fragment_table[file_buffer->block].size = c_byte; -- fragment_table[file_buffer->block].start_block = bytes; -- write_buffer->block = bytes; -- bytes += compressed_size; -- fragments_outstanding --; -- queue_put(to_writer, write_buffer); -- pthread_mutex_unlock(&fragment_mutex); -- TRACE("Writing fragment %lld, uncompressed size %d, " -- "compressed size %d\n", file_buffer->block, -- file_buffer->size, compressed_size); -- } else { -- add_pending_fragment(write_buffer, c_byte, -- file_buffer->block); -- pthread_mutex_unlock(&fragment_mutex); -- } -- cache_block_put(file_buffer); -+ c_byte = mangle2(stream, write_buffer->data, file_buffer->data, -+ file_buffer->size, block_size, noF, 1); -+ compressed_size = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte); -+ write_buffer->size = compressed_size; -+ if(fragments_locked == FALSE) { -+ fragment_table[file_buffer->block].size = c_byte; -+ fragment_table[file_buffer->block].start_block = bytes; -+ write_buffer->block = bytes; -+ bytes += compressed_size; -+ fragments_outstanding --; -+ queue_put(to_writer, write_buffer); -+ TRACE("Writing fragment %lld, uncompressed size %d, " -+ "compressed size %d\n", file_buffer->block, -+ file_buffer->size, compressed_size); -+ } else { -+ add_pending_fragment(write_buffer, c_byte, -+ file_buffer->block); - } -- -- pthread_cleanup_pop(0); -+ cache_block_put(file_buffer); - } - -- - struct file_buffer *get_file_buffer() - { - struct file_buffer *file_buffer = seq_queue_get(to_main); -@@ -4257,19 +4240,17 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, - multiply_overflow(processors * 3, sizeof(pthread_t))) - BAD_ERROR("Processors too large\n"); - -- deflator_thread = malloc(processors * 3 * sizeof(pthread_t)); -+ deflator_thread = malloc(processors * 2 * sizeof(pthread_t)); - if(deflator_thread == NULL) - MEM_ERROR(); - -- frag_deflator_thread = &deflator_thread[processors]; -- frag_thread = &frag_deflator_thread[processors]; -+ frag_thread = &deflator_thread[processors]; - - to_reader = queue_init(1); - to_deflate = queue_init(reader_size); - to_process_frag = queue_init(reader_size); - to_writer = queue_init(bwriter_size + fwriter_size); - from_writer = queue_init(1); -- to_frag = queue_init(fragment_size); - locked_fragment = queue_init(fragment_size); - to_main = seq_queue_init(); - reader_buffer = cache_init(block_size, reader_size, 0, 0); -@@ -4285,9 +4266,6 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, - for(i = 0; i < processors; i++) { - if(pthread_create(&deflator_thread[i], NULL, deflator, NULL)) - BAD_ERROR("Failed to create thread\n"); -- if(pthread_create(&frag_deflator_thread[i], NULL, frag_deflator, -- NULL) != 0) -- BAD_ERROR("Failed to create thread\n"); - if(pthread_create(&frag_thread[i], NULL, frag_thrd, - (void *) destination_file) != 0) - BAD_ERROR("Failed to create thread\n"); -diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h -index 55708a3..dc5bde4 100644 ---- a/squashfs-tools/mksquashfs.h -+++ b/squashfs-tools/mksquashfs.h -@@ -135,7 +135,7 @@ struct append_file { - extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache; - struct cache *bwriter_buffer, *fwriter_buffer; - extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer, -- *to_frag, *locked_fragment, *to_process_frag; -+ *locked_fragment, *to_process_frag; - extern struct append_file **file_mapping; - extern struct seq_queue *to_main; - extern pthread_mutex_t fragment_mutex, dup_mutex; -diff --git a/squashfs-tools/restore.c b/squashfs-tools/restore.c -index 5e336b3..a7aaf2e 100644 ---- a/squashfs-tools/restore.c -+++ b/squashfs-tools/restore.c -@@ -47,8 +47,8 @@ - #define TRUE 1 - - extern pthread_t reader_thread, writer_thread, main_thread; --extern pthread_t *deflator_thread, *frag_deflator_thread, *frag_thread; --extern struct queue *to_deflate, *to_writer, *to_frag, *to_process_frag; -+extern pthread_t *deflator_thread, *frag_thread; -+extern struct queue *to_deflate, *to_writer, *to_process_frag; - extern struct seq_queue *to_main; - extern void restorefs(); - extern int processors; -@@ -120,17 +120,6 @@ void *restore_thrd(void *arg) - pthread_cancel(main_thread); - pthread_join(main_thread, NULL); - -- /* then flush the main thread to fragment deflator thread(s) -- * queue. The fragment deflator thread(s) will idle -- */ -- queue_flush(to_frag); -- -- /* now kill the fragment deflator thread(s) */ -- for(i = 0; i < processors; i++) -- pthread_cancel(frag_deflator_thread[i]); -- for(i = 0; i < processors; i++) -- pthread_join(frag_deflator_thread[i], NULL); -- - /* - * then flush the main thread/fragment deflator thread(s) - * to writer thread queue. The writer thread will idle --- -2.17.0 - diff --git a/pkgs/tools/filesystems/squashfs/squashfs-tools-4.4-4k-align.patch b/pkgs/tools/filesystems/squashfs/4k-align.patch index c9c3dd3d760..e73c0678875 100644 --- a/pkgs/tools/filesystems/squashfs/squashfs-tools-4.4-4k-align.patch +++ b/pkgs/tools/filesystems/squashfs/4k-align.patch @@ -1,3 +1,7 @@ +This patch has been edited to apply to squashfs 4.4, commit +52eb4c279cd283ed9802dd1ceb686560b22ffb67. Below is the original +message body of the patch. + From 7bda7c75748f36b0a50f93e46144d5a4de4974ad Mon Sep 17 00:00:00 2001 From: Amin Hassani <ahassani@google.com> Date: Thu, 15 Dec 2016 10:43:15 -0800 @@ -16,20 +20,24 @@ increased_size = (number_of_unfragmented_files_in_image + number of fragments) * The 4k alignment can be enabled by flag '-4k-align' --- -diff -u a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c ---- a/squashfs-tools/mksquashfs.c 2019-07-06 15:50:22.214873176 +0000 -+++ b/squashfs-tools/mksquashfs.c 2019-07-06 15:51:22.244802582 +0000 -@@ -100,7 +100,9 @@ + squashfs-tools/mksquashfs.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c +index a45b77f..07b1c06 100644 +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -102,7 +102,9 @@ int old_exclude = TRUE; int use_regex = FALSE; int nopad = FALSE; int exit_on_error = FALSE; +int do_4k_align = FALSE; - static off_t squashfs_start_offset = 0; + long long start_offset = 0; +#define ALIGN_UP(bytes, size) (bytes = (bytes + size - 1) & ~(size - 1)) long long global_uid = -1, global_gid = -1; -@@ -1495,6 +1497,9 @@ +@@ -1546,6 +1548,9 @@ void unlock_fragments() * queue at this time. */ while(!queue_empty(locked_fragment)) { @@ -39,17 +47,17 @@ diff -u a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c write_buffer = queue_get(locked_fragment); frg = write_buffer->block; size = SQUASHFS_COMPRESSED_SIZE_BLOCK(fragment_table[frg].size); -@@ -2414,6 +2419,9 @@ - compressed_size = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte); - write_buffer->size = compressed_size; - if(fragments_locked == FALSE) { -+ // 4k align the start of each fragment. -+ if(do_4k_align) -+ ALIGN_UP(bytes, 4096); - fragment_table[file_buffer->block].size = c_byte; - fragment_table[file_buffer->block].start_block = bytes; - write_buffer->block = bytes; -@@ -2728,6 +2736,10 @@ +@@ -2478,6 +2483,9 @@ void *frag_deflator(void *arg) + write_buffer->size = compressed_size; + pthread_mutex_lock(&fragment_mutex); + if(fragments_locked == FALSE) { ++ // 4k align the start of each fragment. ++ if(do_4k_align) ++ ALIGN_UP(bytes, 4096); + fragment_table[file_buffer->block].size = c_byte; + fragment_table[file_buffer->block].start_block = bytes; + write_buffer->block = bytes; +@@ -2877,6 +2885,10 @@ int write_file_blocks(squashfs_inode *inode, struct dir_ent *dir_ent, long long sparse = 0; struct file_buffer *fragment_buffer = NULL; @@ -60,7 +68,7 @@ diff -u a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c if(pre_duplicate(read_size)) return write_file_blocks_dup(inode, dir_ent, read_buffer, dup); -@@ -4808,6 +4820,7 @@ +@@ -4972,6 +4984,7 @@ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad) "compressed", no_fragments ? "no" : noF ? "uncompressed" : "compressed", no_xattrs ? "no" : noX ? "uncompressed" : "compressed", noI || noId ? "uncompressed" : "compressed"); @@ -68,7 +76,7 @@ diff -u a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c printf("\tduplicates are %sremoved\n", duplicate_checking ? "" : "not "); printf("Filesystem size %.2f Kbytes (%.2f Mbytes)\n", bytes / 1024.0, -@@ -5570,6 +5583,8 @@ +@@ -5853,6 +5866,8 @@ print_compressor_options: root_name = argv[i]; } else if(strcmp(argv[i], "-version") == 0) { VERSION(); @@ -77,7 +85,7 @@ diff -u a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c } else { ERROR("%s: invalid option\n\n", argv[0]); printOptions: -@@ -5613,6 +5628,7 @@ +@@ -5904,6 +5919,7 @@ printOptions: ERROR("\t\t\tdirectory containing that directory, " "rather than the\n"); ERROR("\t\t\tcontents of the directory\n"); @@ -85,3 +93,6 @@ diff -u a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c ERROR("\nFilesystem filter options:\n"); ERROR("-p <pseudo-definition>\tAdd pseudo file " "definition\n"); +-- +2.23.0 + diff --git a/pkgs/tools/filesystems/squashfs/darwin.patch b/pkgs/tools/filesystems/squashfs/darwin.patch index 6022e65be47..eb2dc24ec1a 100644 --- a/pkgs/tools/filesystems/squashfs/darwin.patch +++ b/pkgs/tools/filesystems/squashfs/darwin.patch @@ -1,5 +1,11 @@ +Patch based on commits by Dave Vasilevsky <dave@vasilevsky.ca> and +Blake Riley <blake.riley@gmail.com>, squashed into a single patch, +with BSD-specific changes omitted. + +See also https://github.com/plougher/squashfs-tools/pull/69. + diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c -index 4b06ccb..26365e7 100644 +index 4b06ccb..3cad2ab 100644 --- a/squashfs-tools/action.c +++ b/squashfs-tools/action.c @@ -38,6 +38,10 @@ @@ -7,7 +13,7 @@ index 4b06ccb..26365e7 100644 #include <errno.h> +#ifndef FNM_EXTMATCH /* glibc extension */ -+ #define FNM_EXTMATCH 0 ++ #define FNM_EXTMATCH 0 +#endif + #include "squashfs_fs.h" @@ -28,21 +34,21 @@ index 4b06ccb..26365e7 100644 /* diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c -index 7968c77..c8e4c52 100644 +index fe23d78..5c2f835 100644 --- a/squashfs-tools/info.c +++ b/squashfs-tools/info.c -@@ -134,31 +134,22 @@ void dump_state() +@@ -144,31 +144,22 @@ void dump_state() void *info_thrd(void *arg) { sigset_t sigmask; - struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 }; - int sig, waiting = 0; -+ int sig, err, waiting = 0; ++ int sig, err, waiting = 0; sigemptyset(&sigmask); sigaddset(&sigmask, SIGQUIT); sigaddset(&sigmask, SIGHUP); -+ sigaddset(&sigmask, SIGALRM); ++ sigaddset(&sigmask, SIGALRM); while(1) { - if(waiting) @@ -64,11 +70,11 @@ index 7968c77..c8e4c52 100644 continue; default: - BAD_ERROR("sigtimedwait/sigwaitinfo failed " -+ BAD_ERROR("sigwaitfailed " ++ BAD_ERROR("sigwait failed " "because %s\n", strerror(errno)); } } -@@ -169,8 +160,12 @@ void *info_thrd(void *arg) +@@ -179,8 +170,12 @@ void *info_thrd(void *arg) /* set one second interval period, if ^\ received within then, dump queue and cache status */ waiting = 1; @@ -83,119 +89,46 @@ index 7968c77..c8e4c52 100644 } diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c -index d696a51..c86d1b3 100644 +index a45b77f..3607448 100644 --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c -@@ -50,6 +50,10 @@ +@@ -35,7 +35,12 @@ + #include <stddef.h> + #include <sys/types.h> + #include <sys/stat.h> ++#ifndef linux ++#include <sys/sysctl.h> ++#else ++#include <sys/sysinfo.h> + #include <sys/sysmacros.h> ++#endif + #include <fcntl.h> + #include <errno.h> + #include <dirent.h> +@@ -50,7 +55,10 @@ + #include <sys/wait.h> #include <limits.h> #include <ctype.h> - +-#include <sys/sysinfo.h> ++ +#ifndef FNM_EXTMATCH /* glibc extension */ -+ #define FNM_EXTMATCH 0 ++ #define FNM_EXTMATCH 0 +#endif -+ + #ifndef linux #define __BYTE_ORDER BYTE_ORDER - #define __BIG_ENDIAN BIG_ENDIAN -@@ -831,13 +835,13 @@ char *subpathname(struct dir_ent *dir_ent) - } - - --inline unsigned int get_inode_no(struct inode_info *inode) -+static inline unsigned int get_inode_no(struct inode_info *inode) - { - return inode->inode_number; - } - - --inline unsigned int get_parent_no(struct dir_info *dir) -+static inline unsigned int get_parent_no(struct dir_info *dir) - { - return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no; - } -@@ -2030,7 +2034,7 @@ struct file_info *duplicate(long long file_size, long long bytes, - } - - --inline int is_fragment(struct inode_info *inode) -+static inline int is_fragment(struct inode_info *inode) - { - off_t file_size = inode->buf.st_size; - -@@ -2999,13 +3003,13 @@ struct inode_info *lookup_inode2(struct stat *buf, int pseudo, int id) - } - - --inline struct inode_info *lookup_inode(struct stat *buf) -+static inline struct inode_info *lookup_inode(struct stat *buf) - { - return lookup_inode2(buf, 0, 0); - } - - --inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this) -+static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this) - { - if (inode->inode_number == 0) { - inode->inode_number = use_this ? : inode_no ++; -@@ -3016,7 +3020,7 @@ inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this) - } - - --inline struct dir_ent *create_dir_entry(char *name, char *source_name, -+static inline struct dir_ent *create_dir_entry(char *name, char *source_name, - char *nonstandard_pathname, struct dir_info *dir) - { - struct dir_ent *dir_ent = malloc(sizeof(struct dir_ent)); -@@ -3034,7 +3038,7 @@ inline struct dir_ent *create_dir_entry(char *name, char *source_name, - } - - --inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir, -+static inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir, - struct inode_info *inode_info) - { - struct dir_info *dir = dir_ent->our_dir; -@@ -3050,7 +3054,7 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir, - } - - --inline void add_dir_entry2(char *name, char *source_name, -+static inline void add_dir_entry2(char *name, char *source_name, - char *nonstandard_pathname, struct dir_info *sub_dir, - struct inode_info *inode_info, struct dir_info *dir) - { -@@ -3062,7 +3066,7 @@ inline void add_dir_entry2(char *name, char *source_name, - } - - --inline void free_dir_entry(struct dir_ent *dir_ent) -+static inline void free_dir_entry(struct dir_ent *dir_ent) - { - if(dir_ent->name) - free(dir_ent->name); -@@ -3083,7 +3087,7 @@ inline void free_dir_entry(struct dir_ent *dir_ent) - } - - --inline void add_excluded(struct dir_info *dir) -+static inline void add_excluded(struct dir_info *dir) - { - dir->excluded ++; - } -@@ -4200,6 +4204,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, +@@ -4348,6 +4356,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, sigemptyset(&sigmask); sigaddset(&sigmask, SIGQUIT); sigaddset(&sigmask, SIGHUP); + sigaddset(&sigmask, SIGALRM); - if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) == -1) + if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) BAD_ERROR("Failed to set signal mask in intialise_threads\n"); -@@ -4987,6 +4992,36 @@ int parse_num(char *arg, int *res) +@@ -5195,6 +5204,35 @@ int get_physical_memory() + long long page_size = sysconf(_SC_PAGESIZE); + int phys_mem; - int get_physical_memory() - { -+ int phys_mem; +#ifndef linux + #ifdef HW_MEMSIZE + #define SYSCTL_PHYSMEM HW_MEMSIZE @@ -223,50 +156,21 @@ index d696a51..c86d1b3 100644 + ERROR_EXIT(" Defaulting to least viable amount\n"); + phys_mem = SQUASHFS_LOWMEM; + } -+ #undef SYSCTL_PHYSMEM ++ #undef SYSCTL_PHYSMEM +#else - /* - * Long longs are used here because with PAE, a 32-bit - * machine can have more than 4GB of physical memory -@@ -4996,10 +5031,11 @@ int get_physical_memory() - */ - long long num_pages = sysconf(_SC_PHYS_PAGES); - long long page_size = sysconf(_SC_PAGESIZE); -- int phys_mem = num_pages * page_size >> 20; -+ phys_mem = num_pages * page_size >> 20; + if(num_pages == -1 || page_size == -1) { + struct sysinfo sys; + int res = sysinfo(&sys); +@@ -5207,6 +5245,7 @@ int get_physical_memory() + } - if(num_pages == -1 || page_size == -1) - return 0; + phys_mem = num_pages * page_size >> 20; +#endif if(phys_mem < SQUASHFS_LOWMEM) BAD_ERROR("Mksquashfs requires more physical memory than is " -diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h -index 55708a3..d44d1fd 100644 ---- a/squashfs-tools/mksquashfs.h -+++ b/squashfs-tools/mksquashfs.h -@@ -24,6 +24,7 @@ - * mksquashfs.h - * - */ -+#include <pthread.h> - - struct dir_info { - char *pathname; -diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c -index cb74cf6..fe2b4bc 100644 ---- a/squashfs-tools/pseudo.c -+++ b/squashfs-tools/pseudo.c -@@ -30,6 +30,7 @@ - #include <errno.h> - #include <string.h> - #include <stdlib.h> -+#include <sys/stat.h> - #include <sys/types.h> - #include <sys/wait.h> - #include <sys/stat.h> diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c -index 42106f5..837d3fb 100644 +index 4debedf..3257c30 100644 --- a/squashfs-tools/read_xattrs.c +++ b/squashfs-tools/read_xattrs.c @@ -39,13 +39,13 @@ @@ -286,10 +190,10 @@ index 42106f5..837d3fb 100644 extern int read_block(int, long long, long long *, int, void *); diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c -index f190e96..927e441 100644 +index 727f1d5..c1a6183 100644 --- a/squashfs-tools/unsquashfs.c +++ b/squashfs-tools/unsquashfs.c -@@ -32,7 +32,12 @@ +@@ -32,8 +32,12 @@ #include "stdarg.h" #include "fnmatch_compat.h" @@ -297,21 +201,40 @@ index f190e96..927e441 100644 +#include <sys/sysctl.h> +#else #include <sys/sysinfo.h> + #include <sys/sysmacros.h> +#endif -+ #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> -@@ -2185,6 +2190,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size) +@@ -1080,7 +1084,7 @@ int create_inode(char *pathname, struct inode *i) + break; + case SQUASHFS_SYMLINK_TYPE: + case SQUASHFS_LSYMLINK_TYPE: { +- struct timespec times[2] = { ++ struct timeval times[2] = { + { i->time, 0 }, + { i->time, 0 } + }; +@@ -1099,8 +1103,7 @@ int create_inode(char *pathname, struct inode *i) + goto failed; + } + +- res = utimensat(AT_FDCWD, pathname, times, +- AT_SYMLINK_NOFOLLOW); ++ res = lutimes(pathname, times); + if(res == -1) { + EXIT_UNSQUASH_STRICT("create_inode: failed to set time on " + "%s, because %s\n", pathname, +@@ -2235,6 +2238,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size) sigemptyset(&sigmask); sigaddset(&sigmask, SIGQUIT); sigaddset(&sigmask, SIGHUP); + sigaddset(&sigmask, SIGALRM); - if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) == -1) + if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) EXIT_UNSQUASH("Failed to set signal mask in initialise_threads" "\n"); diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h -index 0edbd25..cea9caa 100644 +index 934618b..0e680ab 100644 --- a/squashfs-tools/unsquashfs.h +++ b/squashfs-tools/unsquashfs.h @@ -46,6 +46,10 @@ @@ -319,7 +242,7 @@ index 0edbd25..cea9caa 100644 #include <sys/time.h> +#ifndef FNM_EXTMATCH /* glibc extension */ -+ #define FNM_EXTMATCH 0 ++ #define FNM_EXTMATCH 0 +#endif + #ifndef linux @@ -381,7 +304,7 @@ index c8e2b9b..7d4f7af 100644 } diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c -index 59f4aae..13f0e35 100644 +index 7742dfe..f8cd3b6 100644 --- a/squashfs-tools/unsquashfs_xattr.c +++ b/squashfs-tools/unsquashfs_xattr.c @@ -27,6 +27,11 @@ @@ -389,15 +312,15 @@ index 59f4aae..13f0e35 100644 #include <sys/xattr.h> +#ifdef XATTR_NOFOLLOW /* Apple's xattrs */ -+ #define lsetxattr(path_, name_, val_, sz_, flags_) \ -+ setxattr(path_, name_, val_, sz_, 0, flags_ | XATTR_NOFOLLOW) ++ #define lsetxattr(path_, name_, val_, sz_, flags_) \ ++ setxattr(path_, name_, val_, sz_, 0, flags_ | XATTR_NOFOLLOW) +#endif + #define NOSPACE_MAX 10 extern int root_process; diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c -index b46550c..5b32eca 100644 +index 64dfd82..d82d186 100644 --- a/squashfs-tools/xattr.c +++ b/squashfs-tools/xattr.c @@ -22,6 +22,14 @@ @@ -420,12 +343,15 @@ index b46550c..5b32eca 100644 #include <sys/xattr.h> +#ifdef XATTR_NOFOLLOW /* Apple's xattrs */ -+ #define llistxattr(path_, buf_, sz_) \ -+ listxattr(path_, buf_, sz_, XATTR_NOFOLLOW) -+ #define lgetxattr(path_, name_, val_, sz_) \ -+ getxattr(path_, name_, val_, sz_, 0, XATTR_NOFOLLOW) ++ #define llistxattr(path_, buf_, sz_) \ ++ listxattr(path_, buf_, sz_, XATTR_NOFOLLOW) ++ #define lgetxattr(path_, name_, val_, sz_) \ ++ getxattr(path_, name_, val_, sz_, 0, XATTR_NOFOLLOW) +#endif + #include "squashfs_fs.h" #include "squashfs_swap.h" #include "mksquashfs.h" +-- +2.23.0 + diff --git a/pkgs/tools/filesystems/squashfs/default.nix b/pkgs/tools/filesystems/squashfs/default.nix index 5bd3b27eded..15a535eed3b 100644 --- a/pkgs/tools/filesystems/squashfs/default.nix +++ b/pkgs/tools/filesystems/squashfs/default.nix @@ -8,26 +8,20 @@ assert lz4Support -> (lz4 != null); stdenv.mkDerivation { pname = "squashfs"; - version = "4.4dev_20180612"; + version = "4.4"; src = fetchFromGitHub { owner = "plougher"; repo = "squashfs-tools"; - sha256 = "1y53z8dkph3khdyhkmkmy0sg9p1n8czv3vj4l324nj8kxyih3l2c"; - rev = "6e242dc95485ada8d1d0b3dd9346c5243d4a517f"; + sha256 = "0697fv8n6739mcyn57jclzwwbbqwpvjdfkv1qh9s56lvyqnplwaw"; + # Tag "4.4" points to this commit. + rev = "52eb4c279cd283ed9802dd1ceb686560b22ffb67"; }; patches = [ - # These patches ensures that mksquashfs output is reproducible. - # See also https://reproducible-builds.org/docs/system-images/ - # and https://github.com/NixOS/nixpkgs/issues/40144. - ./0001-If-SOURCE_DATE_EPOCH-is-set-override-timestamps-with.patch - ./0002-If-SOURCE_DATE_EPOCH-is-set-also-clamp-content-times.patch - ./0003-remove-frag-deflator-thread.patch - # This patch adds an option to pad filesystems (increasing size) in # exchange for better chunking / binary diff calculation. - ./squashfs-tools-4.4-4k-align.patch + ./4k-align.patch ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch; buildInputs = [ zlib xz zstd ] diff --git a/pkgs/tools/filesystems/squashfuse/default.nix b/pkgs/tools/filesystems/squashfuse/default.nix index abe89680102..e828698b0e9 100644 --- a/pkgs/tools/filesystems/squashfuse/default.nix +++ b/pkgs/tools/filesystems/squashfuse/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "vasi"; - repo = "${pname}"; + repo = pname; rev = "540204955134eee44201d50132a5f66a246bcfaf"; sha256 = "062s77y32p80vc24a79z31g90b9wxzvws1xvicgx5fn1pd0xa0q6"; }; diff --git a/pkgs/tools/filesystems/udftools/default.nix b/pkgs/tools/filesystems/udftools/default.nix index 11ea490446d..9efaf96182d 100644 --- a/pkgs/tools/filesystems/udftools/default.nix +++ b/pkgs/tools/filesystems/udftools/default.nix @@ -6,7 +6,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "pali"; repo = "udftools"; - rev = "${version}"; + rev = version; sha256 = "0mz04h3rki6ljwfs15z83gf4vv816w7xgz923waiqgmfj9xpvx87"; }; diff --git a/pkgs/tools/filesystems/xtreemfs/default.nix b/pkgs/tools/filesystems/xtreemfs/default.nix index ea25b302e35..d8d41450079 100644 --- a/pkgs/tools/filesystems/xtreemfs/default.nix +++ b/pkgs/tools/filesystems/xtreemfs/default.nix @@ -1,5 +1,5 @@ { stdenv, boost, fuse, openssl, cmake, attr, jdk, ant, which, file, python -, lib, valgrind, makeWrapper, fetchFromGitHub }: +, lib, valgrind, makeWrapper, fetchFromGitHub, fetchpatch }: stdenv.mkDerivation { src = fetchFromGitHub { @@ -15,6 +15,14 @@ stdenv.mkDerivation { buildInputs = [ which attr makeWrapper python ]; + patches = [ + (fetchpatch { + url = "https://github.com/xtreemfs/xtreemfs/commit/ebfdc2fff56c09f310159d92026883941e42a953.patch"; + sha256 = "075w00ad88qm6xpm5679m0gfzkrc53w17sk7ycybf4hzxjs29ygy"; + name = "xtreemfs-fix-for-openssl_1_1"; + }) + ]; + preConfigure = '' export JAVA_HOME=${jdk} export ANT_HOME=${ant} |