disk.scm 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
  4. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2016, 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2016, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
  8. ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
  9. ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
  10. ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
  11. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  12. ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
  13. ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
  14. ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
  15. ;;; Copyright © 2018, 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
  16. ;;; Copyright © 2019, 2021 Leo Famulari <leo@famulari.name>
  17. ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
  18. ;;; Copyright © 2020 Pkill -9 <pkill9@runbox.com>
  19. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  20. ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
  21. ;;; Copyright © 2021 Michael Rohleder <mike@rohleder.de>
  22. ;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
  23. ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
  24. ;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
  25. ;;; Copyright © 2014, 2022 Ludovic Courtès <ludo@gnu.org>
  26. ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  27. ;;; Copyright © 2022 Disseminate Dissent <disseminatedissent@protonmail.com>
  28. ;;;
  29. ;;; This file is part of GNU Guix.
  30. ;;;
  31. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  32. ;;; under the terms of the GNU General Public License as published by
  33. ;;; the Free Software Foundation; either version 3 of the License, or (at
  34. ;;; your option) any later version.
  35. ;;;
  36. ;;; GNU Guix is distributed in the hope that it will be useful, but
  37. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  38. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. ;;; GNU General Public License for more details.
  40. ;;;
  41. ;;; You should have received a copy of the GNU General Public License
  42. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  43. (define-module (gnu packages disk)
  44. #:use-module (gnu packages)
  45. #:use-module (gnu packages autotools)
  46. #:use-module (gnu packages base)
  47. #:use-module (gnu packages bash)
  48. #:use-module (gnu packages build-tools)
  49. #:use-module (gnu packages c)
  50. #:use-module (gnu packages check)
  51. #:use-module (gnu packages compression)
  52. #:use-module (gnu packages crypto)
  53. #:use-module (gnu packages cryptsetup)
  54. #:use-module (gnu packages databases)
  55. #:use-module (gnu packages docbook)
  56. #:use-module (gnu packages documentation)
  57. #:use-module (gnu packages elf)
  58. #:use-module (gnu packages file-systems)
  59. #:use-module (gnu packages file)
  60. #:use-module (gnu packages fontutils)
  61. #:use-module (gnu packages gettext)
  62. #:use-module (gnu packages glib)
  63. #:use-module (gnu packages gnome)
  64. #:use-module (gnu packages gnupg)
  65. #:use-module (gnu packages golang)
  66. #:use-module (gnu packages graphics)
  67. #:use-module (gnu packages gtk)
  68. #:use-module (gnu packages guile)
  69. #:use-module (gnu packages image)
  70. #:use-module (gnu packages linux)
  71. #:use-module (gnu packages ncurses)
  72. #:use-module (gnu packages nss)
  73. #:use-module (gnu packages perl)
  74. #:use-module (gnu packages perl-web)
  75. #:use-module (gnu packages pkg-config)
  76. #:use-module (gnu packages popt)
  77. #:use-module (gnu packages python)
  78. #:use-module (gnu packages python-xyz)
  79. #:use-module (gnu packages qt)
  80. #:use-module (gnu packages readline)
  81. #:use-module (gnu packages samba)
  82. #:use-module (gnu packages serialization)
  83. #:use-module (gnu packages sphinx)
  84. #:use-module (gnu packages sqlite)
  85. #:use-module (gnu packages swig)
  86. #:use-module (gnu packages terminals)
  87. #:use-module (gnu packages textutils)
  88. #:use-module (gnu packages tls)
  89. #:use-module (gnu packages vim)
  90. #:use-module (gnu packages w3m)
  91. #:use-module (gnu packages web)
  92. #:use-module (gnu packages xml)
  93. #:use-module (gnu packages xorg)
  94. #:use-module (guix build-system gnu)
  95. #:use-module (guix build-system glib-or-gtk)
  96. #:use-module (guix build-system go)
  97. #:use-module (guix build-system meson)
  98. #:use-module (guix build-system python)
  99. #:use-module (guix build-system trivial)
  100. #:use-module (guix build-system scons)
  101. #:use-module (guix download)
  102. #:use-module (guix gexp)
  103. #:use-module (guix git-download)
  104. #:use-module ((guix licenses) #:prefix license:)
  105. #:use-module (guix packages)
  106. #:use-module (guix utils))
  107. (define-public bcache-tools
  108. ;; The 1.1 release is a year old and missing new features & documentation.
  109. (let ((commit "096d205a9f1be8540cbc5a468c0da8203023de70")
  110. (revision "0"))
  111. (package
  112. (name "bcache-tools")
  113. (version (git-version "1.1" revision commit))
  114. (source
  115. (origin
  116. (method git-fetch)
  117. (uri (git-reference
  118. (url (string-append "https://git.kernel.org/pub/scm/"
  119. "linux/kernel/git/colyli/bcache-tools.git"))
  120. (commit commit)))
  121. (file-name (git-file-name name version))
  122. (sha256
  123. (base32 "0r0vwg4vacz5zgsafk360xn7gi2scy01c79mkmjrdyxjfij5z3iy"))))
  124. (build-system gnu-build-system)
  125. (arguments
  126. `(#:tests? #f ; no test suite
  127. #:make-flags
  128. (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  129. (string-append "UDEVLIBDIR=" (assoc-ref %outputs "out")
  130. "/lib/udev")
  131. (string-append "DRACUTLIBDIR=" (assoc-ref %outputs "out")
  132. "/lib/dracut")
  133. (string-append "CC=" ,(cc-for-target)))
  134. #:phases
  135. (modify-phases %standard-phases
  136. (delete 'configure) ; no configure script
  137. (add-before 'install 'fix-hard-coded-file-names
  138. (lambda _
  139. ;; Some rules still hard-code /usr.
  140. (substitute* "Makefile"
  141. (("/usr") "${PREFIX}"))
  142. #t))
  143. (add-before 'install 'create-target-directories
  144. (lambda* (#:key outputs #:allow-other-keys)
  145. (let* ((out (assoc-ref outputs "out")))
  146. (for-each (lambda (dir)
  147. (mkdir-p (string-append out dir)))
  148. (list "/lib/udev/rules.d"
  149. "/sbin"
  150. "/share/man/man8"))
  151. #t))))))
  152. (native-inputs
  153. (list pkg-config))
  154. (inputs
  155. `(("util-linux:lib" ,util-linux "lib"))) ; libblkid
  156. (home-page "https://bcache.evilpiepirate.org")
  157. (synopsis "Tools for the Linux kernel block layer cache")
  158. (description
  159. "This package contains user-space utilities to create and inspect bcache
  160. partitions. It's rather minimal as bcache is designed to work well without
  161. configuration on any system.
  162. Linux's @acronym{bcache, block layer cache} lets one or more fast block devices,
  163. such as flash-based @acronym{SSDs, solid state drives}, to act as a cache for
  164. one or more slower (and inexpensive) devices, such as hard disk drives or
  165. redundant storage arrays. In fact, bcache intends to be a superior alternative
  166. to battery-backed RAID controllers.
  167. Bcache is designed around the performance characteristics of SSDs and tries to
  168. minimize write inflation. It's file-system agnostic and does both write-through
  169. and write-back caching.")
  170. (license license:gpl2))))
  171. (define-public udevil
  172. (package
  173. (name "udevil")
  174. (version "0.4.4")
  175. (source
  176. (origin
  177. (method git-fetch)
  178. (uri
  179. (git-reference
  180. (url "https://github.com/IgnorantGuru/udevil")
  181. (commit version)))
  182. (file-name (git-file-name name version))
  183. (sha256
  184. (base32 "0x9mjr9abvbxzfa9mrip5264iz1qxvsl01k3ybz95q4a7xl4jcb3"))))
  185. (build-system gnu-build-system)
  186. (arguments
  187. `(#:configure-flags
  188. (list
  189. "--disable-systemd"
  190. (string-append "--sysconfdir="
  191. (assoc-ref %outputs "out")
  192. "/etc")
  193. ;; udevil expects these programs to be run with uid set as root.
  194. ;; user has to manually add these programs to setuid-programs.
  195. ;; mount and umount are default setuid-programs in guix system.
  196. "--with-mount-prog=/run/setuid-programs/mount"
  197. "--with-umount-prog=/run/setuid-programs/umount"
  198. "--with-losetup-prog=/run/setuid-programs/losetup"
  199. "--with-setfacl-prog=/run/setuid-programs/setfacl")
  200. #:phases
  201. (modify-phases %standard-phases
  202. (add-after 'unpack 'remove-root-reference
  203. (lambda _
  204. (substitute* "src/Makefile.in"
  205. (("-o root -g root") ""))
  206. #t))
  207. (add-after 'unpack 'patch-udevil-reference
  208. ;; udevil expects itself to be run with uid set as root.
  209. ;; devmon also expects udevil to be run with uid set as root.
  210. ;; user has to manually add udevil to setuid-programs.
  211. (lambda _
  212. (substitute* "src/udevil.c"
  213. (("/usr/bin/udevil") "/run/setuid-programs/udevil"))
  214. (substitute* "src/devmon"
  215. (("`which udevil 2>/dev/null`") "/run/setuid-programs/udevil"))
  216. #t)))))
  217. (native-inputs
  218. (list intltool pkg-config))
  219. (inputs
  220. (list cifs-utils
  221. curlftpfs
  222. eudev
  223. fakeroot
  224. glib
  225. sshfs))
  226. (synopsis "Device and file system manager")
  227. (description "udevil is a command line program that mounts and unmounts
  228. removable devices without a password, shows device info, and monitors device
  229. changes. It can also mount ISO files, NFS, SMB, FTP, SSH and WebDAV URLs, and
  230. tmpfs/ramfs filesystems.")
  231. (home-page "https://ignorantguru.github.io/udevil/")
  232. (license license:gpl3+)))
  233. (define-public parted
  234. (package
  235. (name "parted")
  236. (version "3.5")
  237. (source (origin
  238. (method url-fetch)
  239. (uri (string-append "mirror://gnu/parted/parted-"
  240. version ".tar.xz"))
  241. (sha256
  242. (base32
  243. "18h51i3x5cbqhlj5rm23m9sfw63gaaby5czln5w6qpqj3ifdsf29"))))
  244. (build-system gnu-build-system)
  245. (arguments
  246. (list #:phases
  247. #~(modify-phases %standard-phases
  248. (add-after 'unpack 'fix-locales-and-python
  249. (lambda _
  250. (substitute* "tests/t0251-gpt-unicode.sh"
  251. (("C.UTF-8") "en_US.utf8")) ;not in Glibc locales
  252. (substitute* "tests/msdos-overlap"
  253. (("/usr/bin/python") (which "python"))))))))
  254. (inputs
  255. (list lvm2 readline
  256. `(,util-linux "lib")))
  257. (native-inputs
  258. (list gettext-minimal
  259. ;; For the tests.
  260. e2fsprogs
  261. perl
  262. python-wrapper
  263. util-linux))
  264. (outputs '("out" "debug"))
  265. (home-page "https://www.gnu.org/software/parted/")
  266. (synopsis "Disk partition editor")
  267. (description
  268. "GNU Parted is a package for creating and manipulating disk partition
  269. tables. It includes a library and command-line utility.")
  270. (license license:gpl3+)))
  271. (define-public parted-3.4
  272. (package
  273. (inherit parted)
  274. (version "3.4")
  275. (source (origin
  276. (method url-fetch)
  277. (uri (string-append "mirror://gnu/parted/parted-"
  278. version ".tar.xz"))
  279. (sha256
  280. (base32
  281. "0hjkv84x1bs2qqyx1fnzjqyyqrhv7kpdbq9bgydmi99d8wi80ag1"))))))
  282. (define-public fdisk
  283. (package
  284. (name "fdisk")
  285. (version "2.0.0a1")
  286. (source
  287. (origin
  288. (method url-fetch)
  289. (uri (string-append "mirror://gnu/fdisk/gnufdisk-"
  290. version ".tar.gz"))
  291. (sha256
  292. (base32
  293. "1d8za79kw8ihnp2br084rgyjv9whkwp7957rzw815i0izx6xhqy9"))))
  294. (build-system gnu-build-system)
  295. (inputs
  296. `(("gettext" ,gettext-minimal)
  297. ("guile" ,guile-1.8)
  298. ("util-linux" ,util-linux "lib")
  299. ("parted" ,parted)))
  300. ;; The build neglects to look for its own headers in its own tree. A next
  301. ;; release should fix this, but may never come: GNU fdisk looks abandoned.
  302. (arguments
  303. `(#:phases
  304. (modify-phases %standard-phases
  305. (add-after 'unpack 'skip-broken-header-probes
  306. (lambda _
  307. (substitute* "backend/configure"
  308. (("gnufdisk-common.h .*") "\n"))
  309. #t)))
  310. #:make-flags (list (string-append "CPPFLAGS="
  311. " -I../common/include "
  312. " -I../debug/include "
  313. " -I../exception/include"))))
  314. (home-page "https://www.gnu.org/software/fdisk/")
  315. (synopsis "Low-level disk partitioning and formatting")
  316. (description
  317. "GNU fdisk provides a GNU version of the common disk partitioning tool
  318. fdisk. fdisk is used for the creation and manipulation of disk partition
  319. tables, and it understands a variety of different formats.")
  320. (license license:gpl3+)))
  321. (define-public gpart
  322. ;; The latest (0.3) release is from 2015 and is missing a crash fix.
  323. (let ((commit "ec03350a01ad69708b5a3e2d47b8e002b0eba6c9")
  324. (revision "0"))
  325. (package
  326. (name "gpart")
  327. (version (git-version "0.3" revision commit))
  328. (source
  329. (origin
  330. (method git-fetch)
  331. (uri (git-reference
  332. (url "https://github.com/baruch/gpart")
  333. (commit commit)))
  334. (file-name (git-file-name name version))
  335. (sha256
  336. (base32 "1dassswliaiwhhmx7yz540yyxgk53fvg672dbvgc5q0v6cqrh5jx"))))
  337. (build-system gnu-build-system)
  338. (arguments
  339. `(#:configure-flags
  340. (list (string-append "--docdir=" (assoc-ref %outputs "out") "/share/doc/"
  341. ,name "-" ,version))
  342. #:phases
  343. (modify-phases %standard-phases
  344. (add-after 'unpack 'skip-premature-configuration
  345. (lambda _
  346. (substitute* "autogen.sh"
  347. (("\\./configure") "")))))))
  348. (native-inputs
  349. (list autoconf automake))
  350. (home-page "https://github.com/baruch/gpart")
  351. (synopsis "Guess and recover PC-style partition tables")
  352. (description
  353. "Gpart tries to guess the partitions on a PC-style, MBR-partitioned disk
  354. after they have been inadvertently deleted or the primary partition table at
  355. sector 0 damaged. In both cases, the contents of these partitions still exist
  356. on the disk but the operating system cannot access them.
  357. Gpart ignores the partition table and scans each sector of the device or image
  358. file for several known file system and partition types. Only partitions which
  359. have been formatted in some way can be recognized. Several file system guessing
  360. modules are built in; more can be written and loaded at run time.
  361. The guessed table can be restored manually, for example with @command{fdisk},
  362. written to a file, or---if you firmly believe it's entirely correct---directly
  363. to disk.
  364. It should be stressed that gpart does a very heuristic job. It can easily be
  365. right in its guesswork but it can also be terribly wrong. Never believe its
  366. output without any plausibility checks.")
  367. (license license:gpl2+))))
  368. (define-public gptfdisk
  369. (package
  370. (name "gptfdisk")
  371. (version "1.0.9")
  372. (source
  373. (origin
  374. (method url-fetch)
  375. (uri (string-append "mirror://sourceforge/gptfdisk/gptfdisk/"
  376. version "/gptfdisk-" version ".tar.gz"))
  377. (sha256
  378. (base32 "1hjh5m77fmfq5m44yy61kchv7mbfgx026aw3jy5qxszsjckavzns"))))
  379. (build-system gnu-build-system)
  380. (arguments
  381. `(#:test-target "test"
  382. #:phases
  383. (modify-phases %standard-phases
  384. (add-after 'unpack 'fix-include-directory
  385. (lambda _
  386. (substitute* "gptcurses.cc"
  387. (("ncursesw/ncurses.h") "ncurses.h"))))
  388. (delete 'configure) ; no configure script
  389. (replace 'install
  390. ;; There's no ‘make install’ target.
  391. (lambda* (#:key outputs #:allow-other-keys)
  392. (let* ((out (assoc-ref outputs "out"))
  393. (bin (string-append out "/bin"))
  394. (man (string-append out "/share/man/man8")))
  395. (install-file "gdisk" bin)
  396. (install-file "sgdisk" bin)
  397. (install-file "cgdisk" bin)
  398. (install-file "fixparts" bin)
  399. (install-file "cgdisk.8" man)
  400. (install-file "fixparts.8" man)
  401. (install-file "gdisk.8" man)
  402. (install-file "sgdisk.8" man)))))))
  403. (native-inputs
  404. (list gettext-minimal))
  405. (inputs
  406. (list ncurses
  407. popt
  408. `(,util-linux "lib"))) ;libuuid
  409. (home-page "https://www.rodsbooks.com/gdisk/")
  410. (synopsis "Low-level GPT disk partitioning and formatting")
  411. (description "GPT fdisk (aka gdisk) is a text-mode partitioning tool that
  412. works on Globally Unique Identifier (@dfn{GUID}) Partition Table (@dfn{GPT})
  413. disks, rather than on the older Master Boot Record (@dfn{MBR}) partition
  414. scheme.")
  415. (license license:gpl2)))
  416. (define-public ddrescue
  417. (package
  418. (name "ddrescue")
  419. (version "1.27")
  420. (source
  421. (origin
  422. (method url-fetch)
  423. (uri (string-append "mirror://gnu/ddrescue/ddrescue-"
  424. version ".tar.lz"))
  425. (sha256
  426. (base32 "1srj68c7q0r5m7rzv3km43ndcs7xjw053r336vjiakx4qnc0rj1q"))))
  427. (build-system gnu-build-system)
  428. (arguments
  429. `(#:configure-flags (list (string-append "CXX=" ,(cxx-for-target)))))
  430. (home-page "https://www.gnu.org/software/ddrescue/ddrescue.html")
  431. (synopsis "Data recovery utility")
  432. (native-inputs (list lzip))
  433. (description
  434. "GNU ddrescue is a fully automated data recovery tool. It copies data
  435. from one file to another, working to rescue data in case of read errors. The
  436. program also includes a tool for manipulating its log files, which are used
  437. to recover data more efficiently by only reading the necessary blocks.")
  438. (license license:gpl3+)))
  439. (define-public dosfstools
  440. (package
  441. (name "dosfstools")
  442. (version "4.2")
  443. (source
  444. (origin
  445. (method git-fetch)
  446. (uri (git-reference
  447. (url "https://github.com/dosfstools/dosfstools")
  448. (commit (string-append "v" version))))
  449. (file-name (git-file-name name version))
  450. (sha256
  451. (base32 "1xygsixmmc9l7drxylggnzkqqiks8zmlsbhg3z723ii2ak94236s"))))
  452. (build-system gnu-build-system)
  453. (arguments
  454. `(#:configure-flags (list "--enable-compat-symlinks")
  455. #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  456. (string-append "CC=" ,(cc-for-target)))))
  457. (native-inputs
  458. (list autoconf automake
  459. ;; For tests.
  460. xxd))
  461. (home-page "https://github.com/dosfstools/dosfstools")
  462. (synopsis "Utilities for making and checking MS-DOS FAT file systems")
  463. (description
  464. "The dosfstools package includes the mkfs.fat and fsck.fat utilities,
  465. which respectively make and check MS-DOS FAT file systems.")
  466. (license license:gpl3+)))
  467. (define dosfstools/static
  468. (static-package
  469. (package (inherit dosfstools))))
  470. (define-public fatfsck/static
  471. (package
  472. (name "fatfsck-static")
  473. (version (package-version dosfstools))
  474. (build-system trivial-build-system)
  475. (source #f)
  476. (arguments
  477. `(#:modules ((guix build utils))
  478. #:builder
  479. (begin
  480. (use-modules (guix build utils))
  481. (let ((src (string-append (assoc-ref %build-inputs "dosfstools")
  482. "/sbin"))
  483. (exe "fsck.fat")
  484. (bin (string-append (assoc-ref %outputs "out") "/sbin")))
  485. (mkdir-p bin)
  486. (with-directory-excursion bin
  487. (copy-file (string-append src "/" exe) exe)
  488. (remove-store-references exe)
  489. (chmod exe #o555)
  490. ;; Add fsck.vfat symlink to match the Linux driver name.
  491. (symlink exe "fsck.vfat")
  492. #t)))))
  493. (inputs (list dosfstools/static))
  494. (home-page (package-home-page dosfstools))
  495. (synopsis "Statically linked fsck.fat from dosfstools")
  496. (description "This package provides a statically-linked @command{fsck.fat}
  497. and a @command{fsck.vfat} compatibility symlink for use in an initrd.")
  498. (license (package-license dosfstools))))
  499. (define-public sdparm
  500. (package
  501. (name "sdparm")
  502. (version "1.12")
  503. (source
  504. (origin
  505. (method url-fetch)
  506. (uri (string-append "http://sg.danny.cz/sg/p/"
  507. "sdparm-" version ".tar.xz"))
  508. (sha256
  509. (base32 "1gmdxr36allrgap2j4dv238d8awkj327ww0jjwpjwrpbvfpyzjf4"))))
  510. (build-system gnu-build-system)
  511. (home-page "https://sg.danny.cz/sg/sdparm.html")
  512. (synopsis "Provide access to SCSI device parameters")
  513. (description
  514. "Sdparm reads and modifies SCSI device parameters. These devices can be
  515. SCSI disks, in which case the role of @command{sdparm} is similar to its
  516. namesake: the @command{hdparm} utility originally designed for ATA disks.
  517. However, @command{sdparm} can be used to access parameters on any device that
  518. uses a SCSI command set. Such devices include CD/DVD drives (irrespective of
  519. transport), SCSI and ATAPI tape drives, and SCSI enclosures. This utility can
  520. also send commands associated with starting and stopping the media, loading
  521. and unloading removable media and some other housekeeping functions.")
  522. (license license:bsd-3)))
  523. (define-public idle3-tools
  524. (package
  525. (name "idle3-tools")
  526. (version "0.9.1")
  527. (source
  528. (origin
  529. (method url-fetch)
  530. (uri (string-append "mirror://sourceforge/idle3-tools/idle3-tools-"
  531. version ".tgz"))
  532. (sha256
  533. (base32
  534. "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p"))))
  535. (build-system gnu-build-system)
  536. (arguments
  537. `(#:tests? #f ;no test suite
  538. #:phases
  539. (modify-phases %standard-phases
  540. (delete 'configure))
  541. #:make-flags (list "CC=gcc"
  542. (string-append "manprefix=")
  543. (string-append "DESTDIR="
  544. (assoc-ref %outputs "out")))))
  545. (home-page "https://idle3-tools.sourceforge.net")
  546. (synopsis "Change or disable Western Digital hard drives' Idle3 timer")
  547. (description
  548. "Idle3-tools provides a utility to get, set, or disable the Idle3 timer
  549. present in many Western Digital hard drives. This timer is part of the
  550. \"IntelliPark\" feature that stops the disk when not in use. Unfortunately,
  551. the default timer setting is not well suited to Linux or other *nix systems,
  552. and can dramatically shorten the lifespan of the drive if left unchecked.")
  553. (license license:gpl3+)))
  554. (define-public gparted
  555. (package
  556. (name "gparted")
  557. (version "1.5.0")
  558. (source
  559. (origin
  560. (method url-fetch)
  561. (uri (string-append "mirror://sourceforge/gparted/gparted/gparted-"
  562. version "/gparted-" version ".tar.gz"))
  563. (sha256
  564. (base32 "1pm8jah6lakv83zm3isx4bgmi5xdwaqkjxmiv7qky224m4kfm59w"))))
  565. (build-system glib-or-gtk-build-system)
  566. (arguments
  567. ;; Tests require access to files outside the build container, such
  568. ;; as ‘/dev/disk/by-id/’.
  569. `(#:tests? #f))
  570. (inputs
  571. (list `(,util-linux "lib") parted glib gtkmm-3 lvm2 libxml2))
  572. (native-inputs
  573. (list intltool
  574. itstool
  575. yelp-tools
  576. pkg-config))
  577. (home-page "https://gparted.org/")
  578. (synopsis "Partition editor to graphically manage disk partitions")
  579. (description "GParted is a GNOME partition editor for creating,
  580. reorganizing, and deleting disk partitions. It uses libparted from the parted
  581. project to detect and manipulate partition tables. Optional file system tools
  582. permit managing file systems not included in libparted.")
  583. ;; The home page says GPLv2, but the source code says GPLv2+.
  584. (license license:gpl2+)))
  585. (define-public testdisk
  586. (package
  587. (name "testdisk")
  588. (version "7.1")
  589. (source (origin
  590. (method url-fetch)
  591. (uri (string-append "https://www.cgsecurity.org/testdisk-"
  592. version ".tar.bz2"))
  593. (sha256
  594. (base32
  595. "1zlh44w67py416hkvw6nrfmjickc2d43v51vcli5p374d5sw84ql"))))
  596. (build-system gnu-build-system)
  597. (inputs
  598. (list ntfs-3g
  599. `(,util-linux "lib")
  600. openssl
  601. ;; FIXME: add reiserfs.
  602. zlib
  603. e2fsprogs
  604. libjpeg-turbo
  605. ncurses))
  606. (home-page "https://www.cgsecurity.org/wiki/TestDisk")
  607. (synopsis "Data recovery tool")
  608. (description "TestDisk is primarily designed to help recover lost
  609. partitions and/or make non-booting disks bootable again when these symptoms
  610. were caused by faulty software or human error (such as accidentally deleting a
  611. partition table). TestDisk can:
  612. @enumerate
  613. @item Fix partition table, recover deleted partition
  614. @item Recover FAT32 boot sector from its backup
  615. @item Rebuild FAT12/FAT16/FAT32 boot sector
  616. @item Fix FAT tables
  617. @item Rebuild NTFS boot sector
  618. @item Recover NTFS boot sector from its backup
  619. @item Fix MFT using MFT mirror
  620. @item Locate ext2/ext3/ext4 Backup SuperBlock
  621. @item Un-delete files from FAT, exFAT, NTFS and ext2 file systems
  622. @item Copy files from deleted FAT, exFAT, NTFS and ext2/ext3/ext4 partitions.
  623. @end enumerate
  624. This package also includes the @command{photorec} command, described below.
  625. PhotoRec is file data recovery software designed to recover lost files
  626. including video, documents and archives from hard disks, CD-ROMs, and lost
  627. pictures (thus the Photo Recovery name) from digital camera memory. PhotoRec
  628. ignores the file system and goes after the underlying data, so it will still
  629. work even if your media's file system has been severely damaged or
  630. reformatted. It can recover lost files from at least:
  631. @enumerate
  632. @item FAT
  633. @item NTFS
  634. @item exFAT
  635. @item ext2/ext3/ext4 file system
  636. @item HFS+
  637. @end enumerate")
  638. (license license:gpl2+)))
  639. (define-public pydf
  640. (package
  641. (name "pydf")
  642. (version "12")
  643. (source
  644. (origin
  645. (method url-fetch)
  646. (uri (pypi-uri "pydf" version))
  647. (sha256
  648. (base32
  649. "0f8ly8xyp93i2hm9c0qjqd4y86nz73axw2f09z01mszwmg1sfivz"))))
  650. (build-system python-build-system)
  651. (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/pydf/")
  652. (synopsis "Colourised @command{df} clone")
  653. (description "All-singing, all-dancing, fully colourised @command{df} clone
  654. written in Python. It displays the amount of disk space available on the
  655. mounted file systems, using different colours for different types of file
  656. systems. Output format is completely customizable.")
  657. (license license:public-domain)))
  658. (define-public f3
  659. (package
  660. (name "f3")
  661. (version "8.0")
  662. (source
  663. (origin
  664. (method git-fetch)
  665. (uri (git-reference
  666. (url "https://github.com/AltraMayor/f3")
  667. (commit (string-append "v" version))))
  668. (file-name (git-file-name name version))
  669. (sha256
  670. (base32 "17l5vspfcgfbkqg7bakp3gql29yb05gzawm8n3im30ilzdr53678"))))
  671. (build-system gnu-build-system)
  672. (arguments
  673. `(#:tests? #f ; no check target
  674. #:make-flags (list (string-append "CC=" ,(cc-for-target))
  675. (string-append "PREFIX=" %output))
  676. #:phases
  677. (modify-phases %standard-phases
  678. (delete 'configure) ; no configure script
  679. (add-after 'build 'build-extra
  680. (lambda* (#:key make-flags #:allow-other-keys)
  681. (apply invoke "make" "extra" make-flags)))
  682. (add-after 'build 'install-extra
  683. (lambda* (#:key make-flags #:allow-other-keys)
  684. (apply invoke "make" "install-extra" make-flags))))))
  685. (inputs
  686. (list eudev parted))
  687. (home-page "http://oss.digirati.com.br/f3/")
  688. (synopsis "Test real capacity of flash memory cards and such")
  689. (description "F3 (Fight Flash Fraud or Fight Fake Flash) tests the full
  690. capacity of a flash card (flash drive, flash disk, pendrive). F3 writes to
  691. the card and then checks if can read it. It will assure you haven't been sold
  692. a card with a smaller capacity than stated.")
  693. (license license:gpl3+)))
  694. (define-public python-pyparted
  695. (package
  696. (name "python-pyparted")
  697. (version "3.12.0")
  698. (source
  699. (origin
  700. (method git-fetch)
  701. (uri (git-reference
  702. (url "https://github.com/dcantrell/pyparted")
  703. (commit (string-append "v" version))))
  704. (file-name (git-file-name name version))
  705. (sha256
  706. (base32 "0jxc1i1g3lz32wvqvdbb9ng2ypin783004kjnp0pghiz813lpw1d"))))
  707. (build-system python-build-system)
  708. (native-inputs
  709. (list e2fsprogs pkg-config))
  710. (propagated-inputs
  711. (list python-six))
  712. (inputs
  713. (list parted))
  714. (home-page "https://github.com/dcantrell/pyparted")
  715. (synopsis "Parted bindings for Python")
  716. (description "This package provides @code{parted} bindings for Python.")
  717. (license license:gpl2+)))
  718. (define-public python-parted
  719. (deprecated-package "python-parted" python-pyparted))
  720. (define-public duperemove
  721. (package
  722. (name "duperemove")
  723. (version "0.11.3")
  724. (source
  725. (origin
  726. (method git-fetch)
  727. (uri (git-reference
  728. (url "https://github.com/markfasheh/duperemove")
  729. (commit (string-append "v" version))))
  730. (sha256
  731. (base32 "0jwxmhadv2f1mx7gan4gk0xwrjr5g2xa71z1rp0knc1acbkhqdas"))
  732. (file-name (git-file-name name version))))
  733. (build-system gnu-build-system)
  734. (native-inputs
  735. (list pkg-config))
  736. (inputs
  737. (list glib sqlite))
  738. (arguments
  739. `(#:tests? #f ; no test suite
  740. #:phases
  741. (modify-phases %standard-phases
  742. (delete 'configure)) ; no configure script
  743. #:make-flags (list (string-append "PREFIX=" %output)
  744. (string-append "CC=" ,(cc-for-target))
  745. ;; Set to <next release>dev by default.
  746. (string-append "VER=" ,version))))
  747. (home-page "https://github.com/markfasheh/duperemove")
  748. (synopsis "Tools for de-duplicating file system data")
  749. (description "Duperemove is a simple tool for finding duplicated extents
  750. and submitting them for deduplication. When given a list of files it will
  751. hash their contents on a block by block basis and compare those hashes to each
  752. other, finding and categorizing blocks that match each other. When given the
  753. @option{-d} option, duperemove will submit those extents for deduplication
  754. using the Linux kernel extent-same @code{ioctl}.
  755. Duperemove can store the hashes it computes in a @dfn{hash file}. If given an
  756. existing hash file, duperemove will only compute hashes for those files which
  757. have changed since the last run. Thus you can run duperemove repeatedly on
  758. your data as it changes, without having to re-checksum unchanged data.
  759. Duperemove can also take input from the @command{fdupes} program.")
  760. (license license:gpl2)))
  761. (define-public ranger
  762. (package
  763. (name "ranger")
  764. (version "1.9.3")
  765. (source (origin
  766. (method url-fetch)
  767. (uri (string-append "https://ranger.github.io/"
  768. "ranger-" version ".tar.gz"))
  769. (sha256
  770. (base32
  771. "0lfjrpv3z4h0knd3v94fijrw2zjba51mrp3mjqx2c98wr428l26f"))))
  772. (build-system python-build-system)
  773. (inputs
  774. (list w3m))
  775. (native-inputs
  776. (list which
  777. ;; For tests.
  778. python-pytest))
  779. (arguments
  780. '( ;; The 'test' target runs developer tools like pylint, which fail.
  781. #:test-target "test_pytest"
  782. #:phases
  783. (modify-phases %standard-phases
  784. (add-after 'configure 'wrap-program
  785. ;; Tell 'ranger' where 'w3mimgdisplay' is.
  786. (lambda* (#:key inputs outputs #:allow-other-keys)
  787. (let* ((out (assoc-ref outputs "out"))
  788. (ranger (string-append out "/bin/ranger"))
  789. (w3m (assoc-ref inputs "w3m"))
  790. (w3mimgdisplay (string-append w3m
  791. "/libexec/w3m/w3mimgdisplay")))
  792. (wrap-program ranger
  793. `("W3MIMGDISPLAY_PATH" ":" prefix (,w3mimgdisplay)))
  794. #t)))
  795. (replace 'check
  796. ;; The default check phase simply prints 'Ran 0 tests in 0.000s'.
  797. (lambda* (#:key test-target #:allow-other-keys)
  798. (invoke "make" test-target))))))
  799. (home-page "https://ranger.github.io/")
  800. (synopsis "Console file manager")
  801. (description "ranger is a console file manager with Vi key bindings. It
  802. provides a minimalistic and nice curses interface with a view on the directory
  803. hierarchy. It ships with @code{rifle}, a file launcher that is good at
  804. automatically finding out which program to use for what file type.")
  805. (license license:gpl3)))
  806. (define-public fff
  807. (package
  808. (name "fff")
  809. (version "2.2")
  810. (source (origin
  811. (method git-fetch)
  812. (uri (git-reference
  813. (url "https://github.com/dylanaraps/fff")
  814. (commit version)))
  815. (file-name (git-file-name name version))
  816. (sha256
  817. (base32
  818. "14ymdw6l6phnil0xf1frd5kgznaiwppcic0v4hb61s1zpf4wrshg"))))
  819. (build-system gnu-build-system)
  820. (inputs
  821. (list bash
  822. file))
  823. (arguments
  824. (list
  825. #:tests? #f ; no tests
  826. #:make-flags
  827. #~(list
  828. (string-append "PREFIX=" #$output))
  829. #:phases
  830. #~(modify-phases %standard-phases
  831. (add-after 'unpack 'refer-to-inputs
  832. (lambda* (#:key inputs #:allow-other-keys)
  833. (let ((file (assoc-ref inputs "file")))
  834. (substitute* "fff"
  835. (("\\bfile [-\"]" match)
  836. (string-append file "/bin/" match))))))
  837. (delete 'configure)))) ; no configure script
  838. (home-page "https://github.com/dylanaraps/fff")
  839. (synopsis "Simple file manager written in bash")
  840. (description
  841. "@command{fff} (fast file-manager) is a simple, blazing fast and minimal
  842. file manager for Linux, written in bash. It only requires bash and coreutils,
  843. and its highly optimized now for efficient performance.")
  844. (license license:expat)))
  845. (define-public volume-key
  846. (package
  847. (name "volume-key")
  848. (version "0.3.12")
  849. (source (origin
  850. (method url-fetch)
  851. (uri (string-append "https://releases.pagure.org/volume_key/volume_key-"
  852. version ".tar.xz"))
  853. (sha256
  854. (base32
  855. "16rhfz6sjwxlmss1plb2wv2i3jq6wza02rmz1d2jrlnsq67p98vc"))))
  856. (build-system gnu-build-system)
  857. (native-inputs
  858. (list pkg-config swig python-3)) ; used to generate the Python bindings
  859. (inputs
  860. `(("cryptsetup" ,cryptsetup)
  861. ("nss" ,nss)
  862. ("libblkid" ,util-linux "lib")
  863. ("lvm2" ,lvm2) ; for "-ldevmapper"
  864. ("glib" ,glib)
  865. ("gpgme" ,gpgme)))
  866. (arguments
  867. `(#:tests? #f ; not sure how tests are supposed to pass, even when run manually
  868. #:phases
  869. (modify-phases %standard-phases
  870. (add-before 'configure 'patch-python.h-path
  871. (lambda* (#:key inputs #:allow-other-keys)
  872. (let ((python (assoc-ref inputs "python")))
  873. (substitute* "Makefile.in"
  874. (("/usr/include/python") (string-append python "/include/python")))
  875. #t))))))
  876. (home-page "https://pagure.io/volume_key")
  877. (synopsis "Manipulate storage volume encryption keys")
  878. (description
  879. "This package provides a library for manipulating storage volume
  880. encryption keys and storing them separately from volumes to handle forgotten
  881. passphrases.")
  882. (license license:gpl2)))
  883. (define-public ndctl
  884. (package
  885. (name "ndctl")
  886. (version "75")
  887. (source (origin
  888. (method git-fetch)
  889. (uri (git-reference
  890. (url "https://github.com/pmem/ndctl")
  891. (commit (string-append "v" version))))
  892. (file-name (git-file-name name version))
  893. (sha256
  894. (base32
  895. "0i3fmda285qnwnmkxzwji5ffz123yrq9dpcwzg922qpysir7zq40"))))
  896. (build-system meson-build-system)
  897. (arguments
  898. ;; The test suite runs but SKIPs all tests: do not consider this tested!
  899. (list #:configure-flags
  900. #~(list (string-append "-Drootprefix=" #$output)
  901. (string-append "-Dlibdir=" #$output "/lib")
  902. (string-append "-Dbashcompletiondir=" #$output
  903. "/share/bash-completion/completions")
  904. (string-append "-Dsysconfdir=" #$output "/etc")
  905. (string-append "-Diniparserdir="
  906. #$(this-package-input "iniparser")
  907. "/include")
  908. "-Dasciidoctor=disabled" ; use docbook-xsl instead
  909. "-Dsystemd=disabled")
  910. #:phases
  911. #~(modify-phases %standard-phases
  912. (add-after 'unpack 'fix-version
  913. ;; Our VERSION's always better than the build's poor guess.
  914. (lambda _
  915. (with-output-to-file "version"
  916. (lambda _ (display #$version)))))
  917. (add-after 'unpack 'patch-FHS-file-names
  918. (lambda _
  919. (substitute* "git-version-gen"
  920. (("/bin/sh") (which "sh")))
  921. (substitute* "git-version"
  922. (("/bin/bash") (which "bash"))))))))
  923. (native-inputs
  924. (list asciidoc
  925. bash-completion
  926. docbook-xsl
  927. libxml2
  928. pkg-config
  929. xmlto
  930. ;; Required for offline docbook generation.
  931. which))
  932. (inputs
  933. (list eudev
  934. iniparser
  935. json-c
  936. keyutils
  937. kmod
  938. `(,util-linux "lib")))
  939. (home-page "https://github.com/pmem/ndctl")
  940. (synopsis "Manage the non-volatile memory device sub-system in the Linux kernel")
  941. (description
  942. "This package provides a utility library for managing the
  943. libnvdimm (non-volatile memory device) sub-system in the Linux kernel.")
  944. ;; COPYING says LGPL2.1, but many source files are GPL2 so that's
  945. ;; the effective license. Note that some files under ccan/ are
  946. ;; covered by BSD-3 or public domain, see the individual directories.
  947. (license license:gpl2)))
  948. (define-public dmraid
  949. (package
  950. (name "dmraid")
  951. (version "1.0.0.rc16-3")
  952. (source (origin
  953. (method url-fetch)
  954. (uri (string-append "https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
  955. version ".tar.bz2"))
  956. (sha256
  957. (base32
  958. "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))
  959. (build-system gnu-build-system)
  960. (inputs (list lvm2))
  961. (native-inputs (list which))
  962. (arguments
  963. `(#:tests? #f ; No tests.
  964. ;; Prevent a race condition where some target would attempt to link
  965. ;; libdmraid.so before it had been built as reported in
  966. ;; <https://bugs.gnu.org/31999#187>.
  967. #:parallel-build? #f
  968. #:phases (modify-phases %standard-phases
  969. (add-before 'configure 'change-directory
  970. (lambda _
  971. (chdir (string-append ,version "/dmraid"))
  972. (substitute* "make.tmpl.in"
  973. (("/bin/sh") (which "sh")))
  974. #t)))
  975. #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
  976. ;; find libdmraid.so.
  977. (string-append "LDFLAGS=-Wl,-rpath="
  978. (assoc-ref %outputs "out")
  979. "/lib"))))
  980. (home-page "https://people.redhat.com/~heinzm/sw/dmraid/")
  981. (synopsis "Device mapper RAID interface")
  982. (description
  983. "This software supports RAID device discovery, RAID set activation, creation,
  984. removal, rebuild and display of properties for ATARAID/DDF1 metadata.
  985. @command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
  986. to create devices with respective mappings for the ATARAID sets discovered.")
  987. (license license:gpl2+)))
  988. (define-public libblockdev
  989. (package
  990. (name "libblockdev")
  991. (version "2.28")
  992. (source (origin
  993. (method url-fetch)
  994. (uri (string-append "https://github.com/storaged-project/"
  995. "libblockdev/releases/download/"
  996. version "-1/libblockdev-" version ".tar.gz"))
  997. (sha256
  998. (base32
  999. "1x3xbgd2dyjhcqvyalpnrp727xidfxmaxgyyvv5gwx4aw90wijc2"))))
  1000. (build-system gnu-build-system)
  1001. (arguments
  1002. `(#:phases
  1003. (modify-phases %standard-phases
  1004. (add-after 'unpack 'patch-configuration-directory
  1005. (lambda* (#:key outputs #:allow-other-keys)
  1006. (let ((out (assoc-ref outputs "out")))
  1007. (substitute* "src/lib/blockdev.c"
  1008. (("/etc/libblockdev/conf.d/" path) (string-append out path)))))))))
  1009. (native-inputs
  1010. (list gobject-introspection
  1011. pkg-config
  1012. python-wrapper
  1013. util-linux))
  1014. (inputs
  1015. (list btrfs-progs
  1016. cryptsetup
  1017. dosfstools
  1018. dmraid
  1019. eudev
  1020. glib
  1021. kmod
  1022. libbytesize
  1023. libyaml
  1024. lvm2
  1025. mdadm
  1026. ndctl
  1027. nss
  1028. parted
  1029. volume-key
  1030. xfsprogs))
  1031. (home-page "https://github.com/storaged-project/libblockdev")
  1032. (synopsis "Library for manipulating block devices")
  1033. (description
  1034. "libblockdev is a C library supporting GObject introspection for
  1035. manipulation of block devices. It has a plugin-based architecture where each
  1036. technology (like LVM, Btrfs, MD RAID, Swap...) is implemented in a separate
  1037. plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
  1038. LVM D-Bus API).")
  1039. (license license:lgpl2.1+)))
  1040. (define-public rmlint
  1041. (package
  1042. (name "rmlint")
  1043. (version "2.10.1")
  1044. (source (origin
  1045. (method git-fetch)
  1046. (uri (git-reference
  1047. (url "https://github.com/sahib/rmlint")
  1048. (commit (string-append "v" version))))
  1049. (file-name (git-file-name name version))
  1050. (sha256
  1051. (base32
  1052. "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x"))))
  1053. (build-system scons-build-system)
  1054. (arguments
  1055. `(#:scons ,scons-python2
  1056. #:scons-flags (list (string-append "--prefix=" %output)
  1057. (string-append "--actual-prefix=" %output))
  1058. #:tests? #f ; No tests?
  1059. #:phases
  1060. (modify-phases %standard-phases
  1061. (add-after 'unpack 'scons-propagate-environment
  1062. (lambda* (#:key inputs #:allow-other-keys)
  1063. ;; TODO: `rmlint --gui` fails with
  1064. ;; "Failed to load shredder: No module named 'shredder'".
  1065. ;; The GUI might also need extra dependencies, such as
  1066. ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
  1067. (substitute* "lib/cmdline.c"
  1068. (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", NULL\\};")
  1069. (string-append
  1070. "const char *commands[] = {\""
  1071. (assoc-ref inputs "python") "/bin/python"
  1072. "\", \"python\", NULL};")))
  1073. ;; By design, SCons does not, by default, propagate
  1074. ;; environment variables to subprocesses. See:
  1075. ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
  1076. ;; Here, we modify the SConstruct file to arrange for
  1077. ;; environment variables to be propagated.
  1078. (substitute* "SConstruct"
  1079. (("^env = Environment\\(.*\\)" all)
  1080. (string-append
  1081. all
  1082. "\nenv['ENV']=os.environ"))))))))
  1083. (native-inputs
  1084. `(("pkg-config" ,pkg-config)
  1085. ("glib:bin" ,glib "bin")
  1086. ("python-sphinx" ,python-sphinx)))
  1087. (inputs
  1088. `(("python" ,python-wrapper)
  1089. ("glib" ,glib)
  1090. ("libelf" ,libelf)
  1091. ("elfutils" ,elfutils)
  1092. ("json-glib" ,json-glib)
  1093. ("libblkid" ,util-linux "lib")))
  1094. (home-page "https://rmlint.rtfd.org")
  1095. (synopsis "Remove duplicates and other lint from the file system")
  1096. (description "@command{rmlint} finds space waste and other broken things
  1097. on your file system and offers to remove it. @command{rmlint} can find:
  1098. @itemize
  1099. @item duplicate files and duplicate directories,
  1100. @item non-stripped binaries (i.e. binaries with debug symbols),
  1101. @item broken symbolic links,
  1102. @item empty files and directories,
  1103. @item files with broken user and/or group ID.
  1104. @end itemize\n")
  1105. (license license:gpl3+)))
  1106. (define-public lf
  1107. (package
  1108. (name "lf")
  1109. ;; When updating, remove go-github-com-gdamore-tcell-v2-2.3 from golang.scm.
  1110. (version "27")
  1111. (source (origin
  1112. (method git-fetch)
  1113. (uri (git-reference
  1114. (url "https://github.com/gokcehan/lf")
  1115. (commit (string-append "r" version))))
  1116. (file-name (git-file-name name version))
  1117. (sha256
  1118. (base32
  1119. "1piym8za0iw2s8yryh39y072f90mzisv89ffvn1jzb71f71mbfqa"))))
  1120. (build-system go-build-system)
  1121. (native-inputs
  1122. (list go-github.com-mattn-go-runewidth go-golang-org-x-term
  1123. go-gopkg-in-djherbis-times-v1 go-github-com-gdamore-tcell-v2-2.3))
  1124. (arguments
  1125. `(#:import-path "github.com/gokcehan/lf"))
  1126. (home-page "https://github.com/gokcehan/lf")
  1127. (synopsis "Console file browser similar to Ranger")
  1128. (description "lf (as in \"list files\") is a terminal file manager
  1129. written in Go. It is heavily inspired by ranger with some missing and
  1130. extra features. Some of the missing features are deliberately omitted
  1131. since they are better handled by external tools.")
  1132. (license license:expat)))
  1133. (define-public xfe
  1134. (package
  1135. (name "xfe")
  1136. (version "1.44")
  1137. (source
  1138. (origin
  1139. (method url-fetch)
  1140. (uri
  1141. (string-append "mirror://sourceforge/xfe/xfe/" version "/"
  1142. "xfe-" version ".tar.xz"))
  1143. (sha256
  1144. (base32 "1dihq03jqjllb69r78d9ihjjadi39v7sgzdf68qpxz5xhp8i8k2r"))))
  1145. (build-system gnu-build-system)
  1146. (arguments
  1147. `(#:phases
  1148. (modify-phases %standard-phases
  1149. (add-after 'unpack 'patch-potfiles
  1150. (lambda _
  1151. ;; To add missing entry 'intl/plural.c' to potfiles list.
  1152. ;; Refer to https://sourceforge.net/p/xfe/bugs/257/
  1153. (substitute* "po/POTFILES.in"
  1154. (("src/help.h")
  1155. (string-append "src/help.h\n"
  1156. "intl/plural.c")))))
  1157. (add-after 'unpack 'patch-bin-dirs
  1158. (lambda* (#:key inputs #:allow-other-keys)
  1159. (let* ((bash (assoc-ref inputs "bash"))
  1160. (coreutils (assoc-ref inputs "coreutils"))
  1161. (findutils (assoc-ref inputs "findutils"))
  1162. (file-prog (assoc-ref inputs "file")))
  1163. (with-directory-excursion "src"
  1164. (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp"
  1165. "startupnotification.cpp" "xfeutils.cpp"
  1166. "../st/config.h")
  1167. (("/bin/sh" file) (string-append bash file))
  1168. (("/bin/ls" file) (string-append coreutils file))
  1169. (("/usr(/bin/du)" _ file) (string-append coreutils file))
  1170. (("/usr(/bin/sort)" _ file) (string-append coreutils file))
  1171. (("/usr(/bin/cut)" _ file) (string-append coreutils file))
  1172. (("/usr(/bin/xargs)" _ file) (string-append findutils file))
  1173. (("/usr(/bin/file)" _ file) (string-append file-prog file))))
  1174. #t)))
  1175. (add-after 'unpack 'patch-share-dirs
  1176. (lambda* (#:key outputs #:allow-other-keys)
  1177. (let* ((out (assoc-ref outputs "out"))
  1178. (share (string-append out "/share"))
  1179. (xfe (string-append share "/xfe")))
  1180. (with-directory-excursion "src"
  1181. (substitute* '("foxhacks.cpp" "help.h" "xfedefs.h"
  1182. "XFileExplorer.cpp")
  1183. (("/(usr|opt)(/local)?/share") share)
  1184. (("~/.config/xfe") xfe)))
  1185. #t))))))
  1186. (native-inputs
  1187. (list intltool pkg-config))
  1188. (inputs
  1189. `(("bash" ,bash)
  1190. ("coreutils" ,coreutils)
  1191. ("file" ,file)
  1192. ("findutils" ,findutils)
  1193. ("fox" ,fox)
  1194. ("freetype" ,freetype)
  1195. ("x11" ,libx11)
  1196. ("xcb" ,libxcb)
  1197. ("xcb-util" ,xcb-util)
  1198. ("xft" ,libxft)
  1199. ("xrandr" ,libxrandr)))
  1200. (synopsis "File Manager for X-Based Graphical Systems")
  1201. (description "XFE (X File Explorer) is a file manager for X. It is based on
  1202. the popular but discontinued, X Win Commander. It aims to be the file manager
  1203. of choice for all light thinking Unix addicts!")
  1204. (home-page "http://roland65.free.fr/xfe/")
  1205. (license license:gpl2+)))
  1206. (define-public hddtemp
  1207. (package
  1208. (name "hddtemp")
  1209. ;; <https://savannah.nongnu.org/projects/hddtemp/> advertises the project as
  1210. ;; ‘orphaned/unmaintained’. Use a maintained fork/continuation.
  1211. (version "0.4.3")
  1212. (source
  1213. (origin
  1214. (method git-fetch)
  1215. (uri (git-reference
  1216. (url "https://github.com/vitlav/hddtemp")
  1217. (commit (string-append "v" version))))
  1218. (file-name (git-file-name name version))
  1219. (sha256
  1220. (base32 "04kylb2ka0jimi238zpfq1yii2caidpmj3ck51rvxz03y5lpq8fw"))))
  1221. (build-system gnu-build-system)
  1222. (arguments
  1223. `(#:configure-flags (list (string-append
  1224. "--with-db-path="
  1225. (assoc-ref %outputs "out")
  1226. "/share/hddtemp/hddtemp.db"))
  1227. #:phases
  1228. (modify-phases %standard-phases
  1229. (add-before 'bootstrap 'delete-autogen.sh
  1230. (lambda _
  1231. ;; The default 'bootstrap phase works better.
  1232. (delete-file "autogen.sh")))
  1233. (add-after 'install 'install-db
  1234. (lambda* (#:key outputs #:allow-other-keys)
  1235. (let ((out (assoc-ref outputs "out")))
  1236. (install-file "data/hddtemp.db"
  1237. (string-append out "/share/hddtemp"))))))))
  1238. (native-inputs
  1239. `(("autoconf" ,autoconf)
  1240. ("automake" ,automake)
  1241. ("gettext" ,gettext-minimal)))
  1242. (home-page "https://github.com/vitlav/hddtemp")
  1243. (synopsis "Report the temperature of hard drives from S.M.A.R.T. information")
  1244. (description "@command{hddtemp} is a small utility that gives you the
  1245. temperature of your hard drive by reading S.M.A.R.T. information (for drives
  1246. that support this feature).")
  1247. (license license:gpl2+)))
  1248. (define-public memkind
  1249. (package
  1250. (name "memkind")
  1251. (version "1.13.0")
  1252. (source (origin
  1253. (method git-fetch)
  1254. (uri (git-reference
  1255. (url "https://github.com/memkind/memkind")
  1256. (commit (string-append "v" version))))
  1257. (file-name (git-file-name name version))
  1258. (sha256
  1259. (base32 "0zbil6xqmsrnh773ihxyfna6pvvxv3kczdb3g863ssflwwvv7h4w"))))
  1260. (build-system gnu-build-system)
  1261. (inputs
  1262. (list ;; memkind patched jemalloc to add je_arenalookupx,
  1263. ;; je_check_reallocatex--i.e. they forked jemalloc.
  1264. ;("jemalloc" ,jemalloc)
  1265. ndctl numactl))
  1266. (native-inputs
  1267. (list autoconf automake libtool))
  1268. (arguments
  1269. `(#:configure-flags
  1270. (list (string-append "--docdir=" (assoc-ref %outputs "out")
  1271. "/share/doc/" ,name "-" ,version))
  1272. #:tests? #f ; Tests require a NUMA-enabled system.
  1273. #:phases
  1274. (modify-phases %standard-phases
  1275. (add-before 'build 'autogen-jemalloc
  1276. (lambda _
  1277. (with-directory-excursion "jemalloc"
  1278. (substitute* "Makefile.in"
  1279. (("/bin/sh") (which "sh")))
  1280. (invoke "autoconf")
  1281. (substitute* "configure"
  1282. (("/bin/sh") (which "sh")))))))))
  1283. (home-page "https://github.com/memkind/memkind")
  1284. (synopsis "Heap manager with memory kinds (for NUMA)")
  1285. (description "This package provides a user-extensible heap manager
  1286. built on top of jemalloc which enables control of memory characteristics
  1287. and a partitioning of the heap between kinds of memory (for NUMA).")
  1288. (license license:bsd-3)))
  1289. (define-public mmc-utils
  1290. (let ((commit "3969aa4804edb8aed7bcb3c958e49d0c7388b067")
  1291. (revision "1"))
  1292. (package
  1293. (name "mmc-utils")
  1294. (version (git-version "0.1" revision commit))
  1295. (source
  1296. (origin
  1297. (method git-fetch)
  1298. (uri (git-reference
  1299. (url "https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git")
  1300. (commit commit)))
  1301. (file-name (git-file-name name version))
  1302. (sha256
  1303. (base32 "0pvcm685x63afvp8795jd4vn4zs8psh8bs6j2yvk1kgrawpyk10g"))))
  1304. (build-system gnu-build-system)
  1305. (arguments
  1306. `(#:tests? #f ; No test suite
  1307. #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))
  1308. (string-append "CC=" ,(cc-for-target)))
  1309. #:phases
  1310. (modify-phases %standard-phases
  1311. ;; No ./configure script
  1312. (delete 'configure)
  1313. ;; The Makefile's "install-man" target is a no-op.
  1314. (add-after 'install 'install-doc
  1315. (lambda* (#:key outputs #:allow-other-keys)
  1316. (let* ((out (assoc-ref outputs "out"))
  1317. (man1 (string-append out "/share/man/man1")))
  1318. (install-file "man/mmc.1" man1)))))))
  1319. (home-page
  1320. "https://www.kernel.org/doc/html/latest/driver-api/mmc/mmc-tools.html")
  1321. (synopsis "Configure MMC storage devices from userspace")
  1322. (description "mmc-utils is a command-line tool for configuring and
  1323. inspecting MMC storage devices from userspace.")
  1324. (license license:gpl2))))
  1325. (define-public bmaptools
  1326. (package
  1327. (name "bmaptools")
  1328. (version "3.6")
  1329. (source (origin
  1330. (method git-fetch)
  1331. (uri (git-reference
  1332. (url "https://github.com/intel/bmap-tools")
  1333. (commit (string-append "v" version))))
  1334. (file-name (git-file-name name version))
  1335. (sha256
  1336. (base32
  1337. "01xzrv5nvd2nvj91lz4x9s91y9825j9pj96z0ap6yvy3w2dgvkkl"))))
  1338. (build-system python-build-system)
  1339. (arguments
  1340. '(#:phases
  1341. (modify-phases %standard-phases
  1342. (replace 'check
  1343. (lambda _
  1344. ;; XXX: Remove failing test.
  1345. (invoke "nosetests" "-v"
  1346. "--exclude" "test_bmap_helpers"))))))
  1347. (native-inputs
  1348. (list python-mock python-nose))
  1349. (propagated-inputs
  1350. (list python-six))
  1351. (home-page "https://github.com/intel/bmap-tools")
  1352. (synopsis "Create block map for a file or copy a file using block map")
  1353. (description "Bmaptool is a tool for creating the block map (bmap) for a
  1354. file and copying files using the block map. The idea is that large files,
  1355. like raw system image files, can be copied or flashed a lot faster and more
  1356. reliably with @code{bmaptool} than with traditional tools, like @code{dd} or
  1357. @code{cp}.")
  1358. (license license:gpl2)))
  1359. (define-public duc
  1360. (package
  1361. (name "duc")
  1362. (version "1.4.5")
  1363. (source (origin
  1364. (method git-fetch)
  1365. (uri (git-reference
  1366. (url "https://github.com/zevv/duc")
  1367. (commit version)))
  1368. (file-name (git-file-name name version))
  1369. (sha256
  1370. (base32
  1371. "0sglcn38rgn6y3m5ahngizyn3x2rzhqjphs7g0ppnlinkz56rcv4"))))
  1372. (build-system gnu-build-system)
  1373. (arguments
  1374. `(#:phases
  1375. (modify-phases %standard-phases
  1376. (add-after 'unpack 'patch
  1377. (lambda* (#:key outputs #:allow-other-keys)
  1378. (let* ((out (assoc-ref outputs "out")))
  1379. (substitute* "src/duc/cmd-ui.c"
  1380. (("ncursesw/ncurses.h") "ncurses.h"))
  1381. (substitute* "examples/index.cgi"
  1382. (("/usr/local/bin/duc")
  1383. (string-append out "/bin/duc"))))))
  1384. (add-after 'install 'install-examples
  1385. (lambda* (#:key outputs #:allow-other-keys)
  1386. (let* ((out (assoc-ref outputs "out"))
  1387. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  1388. (copy-recursively "examples" (string-append doc "/examples")))))
  1389. (replace 'check
  1390. (lambda* (#:key tests? #:allow-other-keys)
  1391. (substitute* "test.sh"
  1392. ;; Keep the test logs where --keep-failed can see them.
  1393. (("^(DUC_TEST_DIR=).*" _ assign)
  1394. (format #f "~a~a/test-directory~%" assign (getcwd)))
  1395. ;; XXX ‘actual size’ differed on my system (a consistent 348160
  1396. ;; bytes where the tests expect 540672). However, the ‘apparent
  1397. ;; size’ matches, as does the actual test output. Good enough…?
  1398. ((" [0-9]*B actual") " [0-9]*B actual"))
  1399. (when tests?
  1400. (invoke "./test.sh"))))))) ; no ‘check’ target
  1401. (native-inputs
  1402. (list autoconf automake libtool pkg-config))
  1403. (inputs
  1404. (list cairo pango tokyocabinet ncurses))
  1405. (home-page "https://duc.zevv.nl")
  1406. (synopsis "Library and suite of tools for inspecting disk usage")
  1407. (description "Duc maintains a database of accumulated sizes of
  1408. directories of the file system, and allows you to query this database with
  1409. some tools, or create fancy graphs showing you where your bytes are.
  1410. Duc comes with console utilities, ncurses and X11 user interfaces and a CGI
  1411. wrapper for disk usage querying and visualisation.")
  1412. (license license:lgpl3+)))
  1413. (define-public qdirstat
  1414. (package
  1415. (name "qdirstat")
  1416. (version "1.8.1")
  1417. (source (origin
  1418. (method git-fetch)
  1419. (uri (git-reference
  1420. (url "https://github.com/shundhammer/qdirstat")
  1421. (commit version)))
  1422. (file-name (git-file-name name version))
  1423. (sha256
  1424. (base32
  1425. "04vpdlwk01kgmc4r5rnrmrgd4sf2kfh1rjzb2rjkfxdd4pbghsy9"))))
  1426. (arguments
  1427. `(#:phases
  1428. (modify-phases %standard-phases
  1429. (replace 'configure
  1430. (lambda* (#:key outputs #:allow-other-keys)
  1431. (system* "qmake"
  1432. (string-append "INSTALL_PREFIX="
  1433. (assoc-ref outputs "out")))))
  1434. (add-after 'install 'wrap
  1435. (lambda* (#:key inputs outputs #:allow-other-keys)
  1436. (wrap-program (string-append
  1437. (assoc-ref outputs "out")
  1438. "/bin/qdirstat-cache-writer")
  1439. `("PERL5LIB" ":" prefix
  1440. (,(string-append
  1441. (assoc-ref inputs "perl-uri-escape")
  1442. "/lib/perl5/site_perl")))))))))
  1443. (build-system gnu-build-system)
  1444. (inputs
  1445. (list bash-minimal
  1446. perl
  1447. perl-uri-escape
  1448. qtbase-5
  1449. zlib))
  1450. (synopsis "Storage utilisation visualization tool")
  1451. (description
  1452. "QDirStat is a graphical application to show where your disk space has
  1453. gone and to help you to clean it up.")
  1454. (home-page "https://github.com/shundhammer/qdirstat")
  1455. (license license:gpl2)))
  1456. (define-public wipe
  1457. (package
  1458. (name "wipe")
  1459. (version "2.3.1")
  1460. (source (origin
  1461. (method url-fetch)
  1462. (uri (string-append "mirror://sourceforge/wipe/wipe/" version
  1463. "/wipe-" version ".tar.bz2"))
  1464. (sha256
  1465. (base32
  1466. "180snqvh6k6il6prb19fncflf2jcvkihlb4w84sbndcv1wvicfa6"))))
  1467. (build-system gnu-build-system)
  1468. (arguments
  1469. (list
  1470. #:tests? #f ;no tests
  1471. #:phases
  1472. #~(modify-phases %standard-phases
  1473. (add-after 'unpack 'patch-makefile
  1474. (lambda _
  1475. (substitute* "Makefile.in"
  1476. ;; The Makefile.in uses install -o root, but during the
  1477. ;; build there is no root user, so if we leave that in,
  1478. ;; the build fails with the following error:
  1479. ;; /gnu/[...]/install: invalid user ‘root’
  1480. (("-o root") "")
  1481. ;; It's up to the distribution to strip the binaries or
  1482. ;; not.
  1483. (("\\$\\(INSTALL_BIN\\) -s ")
  1484. "$(INSTALL_BIN) "))))
  1485. (add-after 'unpack 'force-autotools-bootstrap
  1486. (lambda _
  1487. ;; Rebuild the build system scripts, as the ones in bundles are
  1488. ;; very old and do not support all the options used by Guix.
  1489. (delete-file "configure"))))))
  1490. (native-inputs (list autoconf automake libtool))
  1491. (home-page "https://wipe.sourceforge.net")
  1492. (synopsis "Secure file/block device wiping utility")
  1493. (description
  1494. "Wipe can erase files and block devices securely. To work properly it
  1495. relies on several assumptions like having the block device write the correct
  1496. sectors, etc. For files it also doesn't work on log-structured file systems
  1497. such as F2FS, JFFS, LogFS, etc. You should @emph{not} trust @command{wipe} to
  1498. work as advertised until you have manually verified that all its assumption
  1499. hold true on your system. To overwrite data it uses the Mersenne Twister
  1500. pseudo-random number generator (PRNG) that is seeded with @file{/dev/urandom}
  1501. or, if unavailable, @file{/dev/random}.")
  1502. (license license:gpl2+)))